void trace_list_events(void) { int i; for (i = 0; i < trace_event_count(); i++) { TraceEvent *res = trace_event_id(i); fprintf(stderr, "%s\n", trace_event_get_name(res)); } }
void trace_print_events(FILE *stream, fprintf_function stream_printf) { TraceEventID i; for (i = 0; i < trace_event_count(); i++) { TraceEvent *ev = trace_event_id(i); stream_printf(stream, "%s [Event ID %u] : state %u\n", trace_event_get_name(ev), i, trace_event_get_state_static(ev) && trace_event_get_state_dynamic(ev)); } }
TraceEvent *trace_event_name(const char *name) { assert(name != NULL); TraceEventID i; for (i = 0; i < trace_event_count(); i++) { TraceEvent *ev = trace_event_id(i); if (strcmp(trace_event_get_name(ev), name) == 0) { return ev; } } return NULL; }
TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev) { assert(pat != NULL); TraceEventID i; if (ev == NULL) { i = -1; } else { i = trace_event_get_id(ev); } i++; while (i < trace_event_count()) { TraceEvent *res = trace_event_id(i); if (pattern_glob(pat, trace_event_get_name(res))) { return res; } i++; } return NULL; }