@@ -321,6 +321,16 @@ void trace_print_events(FILE *stream, fprintf_function stream_printf)
}
}
+void trace_print_groups(FILE *stream, fprintf_function stream_printf)
+{
+ unsigned int i;
+
+ for (i = 0; i < NR_TRACE_EVENT_GROUPS; i++) {
+ stream_printf(stream, "%s [GROUP ID %u] : state %u\n",
+ trace_group_list[i].gp_name, i,
+ trace_group_list[i].state);
+ }
+}
bool trace_event_set_state(const char *name, bool state)
{
unsigned int i;
@@ -334,6 +344,26 @@ bool trace_event_set_state(const char *name, bool state)
return false;
}
+bool trace_event_group_set_state(const char *gp_name, bool state)
+{
+ unsigned int i;
+ unsigned int j;
+ TraceEventGroup *group;
+
+ for (i = 0; i < NR_TRACE_EVENT_GROUPS; i++) {
+ group = &trace_group_list[i];
+ if (!strcmp(group->gp_name, gp_name)) {
+ group->state = state;
+
+ for (j = group->start; j <= group->end; j++) {
+ trace_list[j].state = state;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
/* Helper function to create a thread with signals blocked. Use glib's
* portable threads since QEMU abstractions cannot be used due to reentrancy in
* the tracer. Also note the signal masking on POSIX hosts so that the thread
@@ -22,6 +22,13 @@ typedef struct {
bool state;
} TraceEvent;
+typedef struct {
+ const char *gp_name;
+ bool state;
+ int start;
+ int end;
+} TraceEventGroup;
+
void trace0(TraceEventID event);
void trace1(TraceEventID event, uint64_t x1);
void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> --- trace/simple.c | 30 ++++++++++++++++++++++++++++++ trace/simple.h | 7 +++++++ 2 files changed, 37 insertions(+), 0 deletions(-)