aboutsummaryrefslogtreecommitdiff
path: root/trace/event-internal.h
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-10-04 14:35:45 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-10-12 09:35:54 +0200
commit93977402441405055500ff0389b49f6bbac9d50b (patch)
tree3a1e1ded1e54db71d2576460552faae5d0f32136 /trace/event-internal.h
parent599ab2f241ee6693ea0a2700210718327b346f7f (diff)
trace: remove global 'uint16 dstate[]' array
Instead of having a global dstate array, declare a single 'uint16 TRACE_${EVENT_NAME}_DSTATE' variable for each trace event. Record a pointer to this variable in the TraceEvent struct too. By turning trace_event_get_state_dynamic_by_id into a macro, this still hits the fast path, and cache affinity is ensured by declaring all the uint16 vars adjacent to each other. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: LluĂ­s Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-7-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace/event-internal.h')
-rw-r--r--trace/event-internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/trace/event-internal.h b/trace/event-internal.h
index 074faf6862..4a98d09153 100644
--- a/trace/event-internal.h
+++ b/trace/event-internal.h
@@ -19,6 +19,12 @@
* @vcpu_id: Unique per-vCPU event identifier.
* @name: Event name.
* @sstate: Static tracing state.
+ * @dstate: Dynamic tracing state
+ *
+ * Interpretation of @dstate depends on whether the event has the 'vcpu'
+ * property:
+ * - false: Boolean value indicating whether the event is active.
+ * - true : Integral counting the number of vCPUs that have this event enabled.
*
* Opaque generic description of a tracing event.
*/
@@ -27,6 +33,7 @@ typedef struct TraceEvent {
TraceEventVCPUID vcpu_id;
const char * name;
const bool sstate;
+ uint16_t *dstate;
} TraceEvent;
void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state);