From e1d6e0a4c0e23b30501b887211f1fa6e0eb799a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Vilanova?= Date: Mon, 11 Jul 2016 12:53:35 +0200 Subject: trace: Cosmetic changes on fast-path tracing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: LluĂ­s Vilanova Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi --- trace/control-internal.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'trace') 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); } -- cgit v1.2.3