mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: allow ignoring process 0
The idle process is sort of a catch-all at times, and so if you remove it that can make it easier to get more reasonble percentages from the rest of the system.
This commit is contained in:
@ -54,8 +54,9 @@ struct _SysprofCallgraphView
|
|||||||
|
|
||||||
guint bottom_up : 1;
|
guint bottom_up : 1;
|
||||||
guint categorize_frames : 1;
|
guint categorize_frames : 1;
|
||||||
guint include_threads : 1;
|
|
||||||
guint hide_system_libraries : 1;
|
guint hide_system_libraries : 1;
|
||||||
|
guint ignore_process_0 : 1;
|
||||||
|
guint include_threads : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _SysprofCallgraphViewClass
|
struct _SysprofCallgraphViewClass
|
||||||
|
|||||||
@ -36,6 +36,7 @@ enum {
|
|||||||
PROP_CALLGRAPH,
|
PROP_CALLGRAPH,
|
||||||
PROP_DOCUMENT,
|
PROP_DOCUMENT,
|
||||||
PROP_HIDE_SYSTEM_LIBRARIES,
|
PROP_HIDE_SYSTEM_LIBRARIES,
|
||||||
|
PROP_IGNORE_PROCESS_0,
|
||||||
PROP_INCLUDE_THREADS,
|
PROP_INCLUDE_THREADS,
|
||||||
PROP_TRACEABLES,
|
PROP_TRACEABLES,
|
||||||
PROP_UTILITY_SUMMARY,
|
PROP_UTILITY_SUMMARY,
|
||||||
@ -435,6 +436,10 @@ sysprof_callgraph_view_set_property (GObject *object,
|
|||||||
sysprof_callgraph_view_set_hide_system_libraries (self, g_value_get_boolean (value));
|
sysprof_callgraph_view_set_hide_system_libraries (self, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_IGNORE_PROCESS_0:
|
||||||
|
sysprof_callgraph_view_set_ignore_process_0 (self, g_value_get_boolean (value));
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_INCLUDE_THREADS:
|
case PROP_INCLUDE_THREADS:
|
||||||
sysprof_callgraph_view_set_include_threads (self, g_value_get_boolean (value));
|
sysprof_callgraph_view_set_include_threads (self, g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
@ -488,6 +493,11 @@ sysprof_callgraph_view_class_init (SysprofCallgraphViewClass *klass)
|
|||||||
FALSE,
|
FALSE,
|
||||||
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
properties[PROP_IGNORE_PROCESS_0] =
|
||||||
|
g_param_spec_boolean ("ignore-process-0", NULL, NULL,
|
||||||
|
FALSE,
|
||||||
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
properties[PROP_TRACEABLES] =
|
properties[PROP_TRACEABLES] =
|
||||||
g_param_spec_object ("traceables", NULL, NULL,
|
g_param_spec_object ("traceables", NULL, NULL,
|
||||||
G_TYPE_LIST_MODEL,
|
G_TYPE_LIST_MODEL,
|
||||||
@ -653,6 +663,9 @@ sysprof_callgraph_view_reload (SysprofCallgraphView *self)
|
|||||||
|
|
||||||
g_clear_handle_id (&self->reload_source, g_source_remove);
|
g_clear_handle_id (&self->reload_source, g_source_remove);
|
||||||
|
|
||||||
|
if (self->ignore_process_0)
|
||||||
|
flags |= SYSPROF_CALLGRAPH_FLAGS_IGNORE_PROCESS_0;
|
||||||
|
|
||||||
if (self->include_threads)
|
if (self->include_threads)
|
||||||
flags |= SYSPROF_CALLGRAPH_FLAGS_INCLUDE_THREADS;
|
flags |= SYSPROF_CALLGRAPH_FLAGS_INCLUDE_THREADS;
|
||||||
|
|
||||||
@ -894,3 +907,27 @@ sysprof_callgraph_view_set_include_threads (SysprofCallgraphView *self,
|
|||||||
sysprof_callgraph_view_queue_reload (self);
|
sysprof_callgraph_view_queue_reload (self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
sysprof_callgraph_view_get_ignore_process_0 (SysprofCallgraphView *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_CALLGRAPH_VIEW (self), FALSE);
|
||||||
|
|
||||||
|
return self->ignore_process_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sysprof_callgraph_view_set_ignore_process_0 (SysprofCallgraphView *self,
|
||||||
|
gboolean ignore_process_0)
|
||||||
|
{
|
||||||
|
g_return_if_fail (SYSPROF_IS_CALLGRAPH_VIEW (self));
|
||||||
|
|
||||||
|
ignore_process_0 = !!ignore_process_0;
|
||||||
|
|
||||||
|
if (self->ignore_process_0 != ignore_process_0)
|
||||||
|
{
|
||||||
|
self->ignore_process_0 = ignore_process_0;
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_IGNORE_PROCESS_0]);
|
||||||
|
sysprof_callgraph_view_queue_reload (self);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -49,6 +49,9 @@ void sysprof_callgraph_view_set_bottom_up (SysprofCallg
|
|||||||
gboolean sysprof_callgraph_view_get_categorize_frames (SysprofCallgraphView *self);
|
gboolean sysprof_callgraph_view_get_categorize_frames (SysprofCallgraphView *self);
|
||||||
void sysprof_callgraph_view_set_categorize_frames (SysprofCallgraphView *self,
|
void sysprof_callgraph_view_set_categorize_frames (SysprofCallgraphView *self,
|
||||||
gboolean categorize_frames);
|
gboolean categorize_frames);
|
||||||
|
gboolean sysprof_callgraph_view_get_ignore_process_0 (SysprofCallgraphView *self);
|
||||||
|
void sysprof_callgraph_view_set_ignore_process_0 (SysprofCallgraphView *self,
|
||||||
|
gboolean ignore_process_0);
|
||||||
gboolean sysprof_callgraph_view_get_include_threads (SysprofCallgraphView *self);
|
gboolean sysprof_callgraph_view_get_include_threads (SysprofCallgraphView *self);
|
||||||
void sysprof_callgraph_view_set_include_threads (SysprofCallgraphView *self,
|
void sysprof_callgraph_view_set_include_threads (SysprofCallgraphView *self,
|
||||||
gboolean include_threads);
|
gboolean include_threads);
|
||||||
|
|||||||
@ -271,6 +271,10 @@
|
|||||||
<attribute name="label" translatable="yes">Bottom Up</attribute>
|
<attribute name="label" translatable="yes">Bottom Up</attribute>
|
||||||
<attribute name="action">win.callgraph.bottom-up</attribute>
|
<attribute name="action">win.callgraph.bottom-up</attribute>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Ignore Process 0</attribute>
|
||||||
|
<attribute name="action">win.callgraph.ignore-process-0</attribute>
|
||||||
|
</item>
|
||||||
</section>
|
</section>
|
||||||
</menu>
|
</menu>
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
@ -97,6 +97,11 @@
|
|||||||
<lookup name="session">SysprofSamplesSection</lookup>
|
<lookup name="session">SysprofSamplesSection</lookup>
|
||||||
</lookup>
|
</lookup>
|
||||||
</binding>
|
</binding>
|
||||||
|
<binding name="ignore-process-0">
|
||||||
|
<lookup name="ignore-process-0" type="SysprofSession">
|
||||||
|
<lookup name="session">SysprofSamplesSection</lookup>
|
||||||
|
</lookup>
|
||||||
|
</binding>
|
||||||
<binding name="document">
|
<binding name="document">
|
||||||
<lookup name="document" type="SysprofSession">
|
<lookup name="document" type="SysprofSession">
|
||||||
<lookup name="session">SysprofSamplesSection</lookup>
|
<lookup name="session">SysprofSamplesSection</lookup>
|
||||||
|
|||||||
@ -41,6 +41,7 @@ struct _SysprofSession
|
|||||||
|
|
||||||
guint bottom_up : 1;
|
guint bottom_up : 1;
|
||||||
guint categorize_frames : 1;
|
guint categorize_frames : 1;
|
||||||
|
guint ignore_process_0 : 1;
|
||||||
guint include_threads : 1;
|
guint include_threads : 1;
|
||||||
guint hide_system_libraries : 1;
|
guint hide_system_libraries : 1;
|
||||||
};
|
};
|
||||||
@ -52,6 +53,7 @@ enum {
|
|||||||
PROP_DOCUMENT_TIME,
|
PROP_DOCUMENT_TIME,
|
||||||
PROP_FILTER,
|
PROP_FILTER,
|
||||||
PROP_HIDE_SYSTEM_LIBRARIES,
|
PROP_HIDE_SYSTEM_LIBRARIES,
|
||||||
|
PROP_IGNORE_PROCESS_0,
|
||||||
PROP_INCLUDE_THREADS,
|
PROP_INCLUDE_THREADS,
|
||||||
PROP_CATEGORIZE_FRAMES,
|
PROP_CATEGORIZE_FRAMES,
|
||||||
PROP_SELECTED_TIME,
|
PROP_SELECTED_TIME,
|
||||||
@ -146,6 +148,10 @@ sysprof_session_get_property (GObject *object,
|
|||||||
g_value_set_boolean (value, self->hide_system_libraries);
|
g_value_set_boolean (value, self->hide_system_libraries);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_IGNORE_PROCESS_0:
|
||||||
|
g_value_set_boolean (value, self->ignore_process_0);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_INCLUDE_THREADS:
|
case PROP_INCLUDE_THREADS:
|
||||||
g_value_set_boolean (value, self->include_threads);
|
g_value_set_boolean (value, self->include_threads);
|
||||||
break;
|
break;
|
||||||
@ -197,6 +203,10 @@ sysprof_session_set_property (GObject *object,
|
|||||||
self->hide_system_libraries = g_value_get_boolean (value);
|
self->hide_system_libraries = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_IGNORE_PROCESS_0:
|
||||||
|
self->ignore_process_0 = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_INCLUDE_THREADS:
|
case PROP_INCLUDE_THREADS:
|
||||||
self->include_threads = g_value_get_boolean (value);
|
self->include_threads = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
@ -245,6 +255,11 @@ sysprof_session_class_init (SysprofSessionClass *klass)
|
|||||||
FALSE,
|
FALSE,
|
||||||
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
properties [PROP_IGNORE_PROCESS_0] =
|
||||||
|
g_param_spec_boolean ("ignore-process-0", NULL, NULL,
|
||||||
|
FALSE,
|
||||||
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
properties [PROP_INCLUDE_THREADS] =
|
properties [PROP_INCLUDE_THREADS] =
|
||||||
g_param_spec_boolean ("include-threads", NULL, NULL,
|
g_param_spec_boolean ("include-threads", NULL, NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
|||||||
@ -132,6 +132,7 @@ sysprof_window_set_document (SysprofWindow *self,
|
|||||||
"bottom-up",
|
"bottom-up",
|
||||||
"categorize-frames",
|
"categorize-frames",
|
||||||
"hide-system-libraries",
|
"hide-system-libraries",
|
||||||
|
"ignore-process-0",
|
||||||
"include-threads",
|
"include-threads",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user