xref: /openbmc/qemu/trace/event-internal.h (revision 438c78da)
1 /*
2  * Interface for configuring and controlling the state of tracing events.
3  *
4  * Copyright (C) 2012-2016 Lluís Vilanova <vilanova@ac.upc.edu>
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 
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 
19 /**
20  * TraceEvent:
21  * @id: Unique event identifier.
22  * @vcpu_id: Unique per-vCPU event identifier.
23  * @name: Event name.
24  * @sstate: Static tracing state.
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.
31  *
32  * Opaque generic description of a tracing event.
33  */
34 typedef struct TraceEvent {
35     uint32_t id;
36     uint32_t vcpu_id;
37     const char * name;
38     const bool sstate;
39     uint16_t *dstate;
40 } TraceEvent;
41 
42 void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state);
43 
44 #endif /* TRACE__EVENT_INTERNAL_H */
45