Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Interface for configuring and controlling the state of tracing events. |
| 3 | * |
Lluís Vilanova | 17f7ac7 | 2016-07-11 12:53:24 +0200 | [diff] [blame] | 4 | * Copyright (C) 2012-2016 Lluís Vilanova <vilanova@ac.upc.edu> |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 5 | * |
| 6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 7 | * See the COPYING file in the top-level directory. |
| 8 | */ |
| 9 | |
| 10 | #ifndef TRACE__EVENT_INTERNAL_H |
| 11 | #define TRACE__EVENT_INTERNAL_H |
| 12 | |
Daniel P. Berrange | ef4c9fc | 2016-10-04 14:35:49 +0100 | [diff] [blame] | 13 | /* |
| 14 | * Special value for TraceEvent.vcpu_id field to indicate |
| 15 | * that the event is not VCPU specific |
| 16 | */ |
| 17 | #define TRACE_VCPU_EVENT_NONE ((uint32_t)-1) |
| 18 | |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 19 | /** |
| 20 | * TraceEvent: |
| 21 | * @id: Unique event identifier. |
Lluís Vilanova | 17f7ac7 | 2016-07-11 12:53:24 +0200 | [diff] [blame] | 22 | * @vcpu_id: Unique per-vCPU event identifier. |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 23 | * @name: Event name. |
| 24 | * @sstate: Static tracing state. |
Daniel P. Berrange | 9397740 | 2016-10-04 14:35:45 +0100 | [diff] [blame] | 25 | * @dstate: Dynamic tracing state |
| 26 | * |
| 27 | * Interpretation of @dstate depends on whether the event has the 'vcpu' |
| 28 | * property: |
| 29 | * - false: Boolean value indicating whether the event is active. |
| 30 | * - true : Integral counting the number of vCPUs that have this event enabled. |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 31 | * |
| 32 | * Opaque generic description of a tracing event. |
| 33 | */ |
| 34 | typedef struct TraceEvent { |
Daniel P. Berrange | a82417b | 2016-10-04 14:35:47 +0100 | [diff] [blame] | 35 | uint32_t id; |
| 36 | uint32_t vcpu_id; |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 37 | const char * name; |
| 38 | const bool sstate; |
Daniel P. Berrange | 9397740 | 2016-10-04 14:35:45 +0100 | [diff] [blame] | 39 | uint16_t *dstate; |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 40 | } TraceEvent; |
| 41 | |
Lluís Vilanova | a4d50b1 | 2016-08-23 10:58:52 +0200 | [diff] [blame] | 42 | void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state); |
Lluís Vilanova | 45be2f5 | 2013-03-05 14:47:32 +0100 | [diff] [blame] | 43 | |
Markus Armbruster | 175de52 | 2016-06-29 15:29:06 +0200 | [diff] [blame] | 44 | #endif /* TRACE__EVENT_INTERNAL_H */ |