diff --git a/src/libsysprof/sysprof-callgraph.c b/src/libsysprof/sysprof-callgraph.c index 5007315e..3b4c55a2 100644 --- a/src/libsysprof/sysprof-callgraph.c +++ b/src/libsysprof/sysprof-callgraph.c @@ -356,6 +356,11 @@ sysprof_callgraph_add_traceable (SysprofCallgraph *self, g_assert (SYSPROF_IS_DOCUMENT_TRACEABLE (traceable)); pid = sysprof_document_frame_get_pid (SYSPROF_DOCUMENT_FRAME (traceable)); + + /* Ignore "Process 0" (the Idle process) if requested */ + if (pid == 0 && (self->flags & SYSPROF_CALLGRAPH_FLAGS_IGNORE_PROCESS_0) != 0) + return; + tid = sysprof_document_traceable_get_thread_id (traceable); stack_depth = sysprof_document_traceable_get_stack_depth (traceable); diff --git a/src/libsysprof/sysprof-callgraph.h b/src/libsysprof/sysprof-callgraph.h index 1861a555..a00bacfb 100644 --- a/src/libsysprof/sysprof-callgraph.h +++ b/src/libsysprof/sysprof-callgraph.h @@ -97,6 +97,7 @@ typedef enum _SysprofCallgraphFlags SYSPROF_CALLGRAPH_FLAGS_HIDE_SYSTEM_LIBRARIES = 1 << 2, SYSPROF_CALLGRAPH_FLAGS_BOTTOM_UP = 1 << 3, SYSPROF_CALLGRAPH_FLAGS_CATEGORIZE_FRAMES = 1 << 4, + SYSPROF_CALLGRAPH_FLAGS_IGNORE_PROCESS_0 = 1 << 5, } SysprofCallgraphFlags; SYSPROF_AVAILABLE_IN_ALL