aboutsummaryrefslogtreecommitdiff
path: root/trace/control-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'trace/control-internal.h')
-rw-r--r--trace/control-internal.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/trace/control-internal.h b/trace/control-internal.h
index 7f31e39059..a6d8d2e7c9 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -16,7 +16,6 @@
extern TraceEvent trace_events[];
-extern uint16_t trace_events_dstate[];
extern int trace_events_enabled_count;
@@ -54,18 +53,13 @@ static inline bool trace_event_get_state_static(TraceEvent *ev)
return ev->sstate;
}
-static inline bool trace_event_get_state_dynamic_by_id(TraceEventID id)
-{
- /* it's on fast path, avoid consistency checks (asserts) */
- return unlikely(trace_events_enabled_count) && trace_events_dstate[id];
-}
+/* it's on fast path, avoid consistency checks (asserts) */
+#define trace_event_get_state_dynamic_by_id(id) \
+ (unlikely(trace_events_enabled_count) && _ ## id ## _DSTATE)
static inline bool trace_event_get_state_dynamic(TraceEvent *ev)
{
- TraceEventID id;
- assert(trace_event_get_state_static(ev));
- id = trace_event_get_id(ev);
- return trace_event_get_state_dynamic_by_id(id);
+ return unlikely(trace_events_enabled_count) && *ev->dstate;
}
static inline bool trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu,