aboutsummaryrefslogtreecommitdiff
path: root/trace
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-10-04 14:35:48 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-10-12 09:35:54 +0200
commit79218be42b835cbc7bd1b0fbd07d115add6e7605 (patch)
treea97e807878adfcad3099b932a268fa99d5e2e787 /trace
parenta82417b50bc80310b6294ae2698303c3d67f900c (diff)
trace: give each trace event a named TraceEvent struct
Currently we only expose a TraceEvent array, which must be indexed via the TraceEventID enum constants. This changes the generator to expose a named TraceEvent instance for each event, with an _EVENT suffix. Reviewed-by: LluĂ­s Vilanova <vilanova@ac.upc.edu> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-10-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace')
-rw-r--r--trace/control-internal.h2
-rw-r--r--trace/control.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/trace/control-internal.h b/trace/control-internal.h
index a6d8d2e7c9..808f85dc06 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -15,7 +15,7 @@
#include "qom/cpu.h"
-extern TraceEvent trace_events[];
+extern TraceEvent *trace_events[];
extern int trace_events_enabled_count;
diff --git a/trace/control.c b/trace/control.c
index e57f2d3f05..9035846b26 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -106,7 +106,7 @@ void trace_event_iter_init(TraceEventIter *iter, const char *pattern)
TraceEvent *trace_event_iter_next(TraceEventIter *iter)
{
while (iter->event < TRACE_EVENT_COUNT) {
- TraceEvent *ev = &(trace_events[iter->event]);
+ TraceEvent *ev = trace_events[iter->event];
iter->event++;
if (!iter->pattern ||
pattern_glob(iter->pattern,