diff options
author | Lluís Vilanova <vilanova@ac.upc.edu> | 2016-07-11 12:53:35 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-07-18 18:13:54 +0100 |
commit | e1d6e0a4c0e23b30501b887211f1fa6e0eb799a3 (patch) | |
tree | 08821c5228cd7408dd690725f6879058722c7557 /trace/control-internal.h | |
parent | ca66f1a1741907e3f5fede89f04ac993f36130a7 (diff) |
trace: Cosmetic changes on fast-path tracing
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace/control-internal.h')
-rw-r--r-- | trace/control-internal.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/trace/control-internal.h b/trace/control-internal.h index 59bcbb4427..b326d88d72 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -60,14 +60,17 @@ static inline bool trace_event_get_state_static(TraceEvent *ev) return ev->sstate; } -static inline bool trace_event_get_state_dynamic_by_id(int id) +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]; } static inline bool trace_event_get_state_dynamic(TraceEvent *ev) { - int id = trace_event_get_id(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); } |