mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 08:00:53 +00:00
libsysprof-analyze: add stack traces w/o kernel context
This restores the functionality we had previously for user vs kernel.
This commit is contained in:
@ -1436,6 +1436,28 @@ sysprof_document_list_samples_with_context_switch (SysprofDocument *self)
|
|||||||
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), self->samples_with_context_switch);
|
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), self->samples_with_context_switch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysprof_document_list_samples_without_context_switch:
|
||||||
|
* @self: a #SysprofDocument
|
||||||
|
*
|
||||||
|
* Gets a #GListModel containing #SysprofDocumentSample found within
|
||||||
|
* the #SysprofDocument which contain a context switch.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): a #GListModel of #SysprofDocumentSample
|
||||||
|
*/
|
||||||
|
GListModel *
|
||||||
|
sysprof_document_list_samples_without_context_switch (SysprofDocument *self)
|
||||||
|
{
|
||||||
|
g_autoptr(EggBitset) bitset = NULL;
|
||||||
|
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_DOCUMENT (self), NULL);
|
||||||
|
|
||||||
|
bitset = egg_bitset_copy (self->samples);
|
||||||
|
egg_bitset_subtract (bitset, self->samples_with_context_switch);
|
||||||
|
|
||||||
|
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), bitset);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sysprof_document_list_processes:
|
* sysprof_document_list_processes:
|
||||||
* @self: a #SysprofDocument
|
* @self: a #SysprofDocument
|
||||||
|
|||||||
@ -58,6 +58,9 @@ SYSPROF_AVAILABLE_IN_ALL
|
|||||||
GListModel *sysprof_document_list_samples_with_context_switch
|
GListModel *sysprof_document_list_samples_with_context_switch
|
||||||
(SysprofDocument *self);
|
(SysprofDocument *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
GListModel *sysprof_document_list_samples_without_context_switch
|
||||||
|
(SysprofDocument *self);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GListModel *sysprof_document_list_processes (SysprofDocument *self);
|
GListModel *sysprof_document_list_processes (SysprofDocument *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GListModel *sysprof_document_list_jitmaps (SysprofDocument *self);
|
GListModel *sysprof_document_list_jitmaps (SysprofDocument *self);
|
||||||
|
|||||||
@ -233,6 +233,7 @@ sysprof_session_discover_sampler (SysprofSession *self,
|
|||||||
{
|
{
|
||||||
g_autoptr(GListModel) samples = NULL;
|
g_autoptr(GListModel) samples = NULL;
|
||||||
g_autoptr(GListModel) samples_with_context_switch = NULL;
|
g_autoptr(GListModel) samples_with_context_switch = NULL;
|
||||||
|
g_autoptr(GListModel) samples_without_context_switch = NULL;
|
||||||
|
|
||||||
g_assert (SYSPROF_IS_SESSION (self));
|
g_assert (SYSPROF_IS_SESSION (self));
|
||||||
g_assert (SYSPROF_IS_DOCUMENT (document));
|
g_assert (SYSPROF_IS_DOCUMENT (document));
|
||||||
@ -240,6 +241,7 @@ sysprof_session_discover_sampler (SysprofSession *self,
|
|||||||
|
|
||||||
samples = sysprof_document_list_samples (document);
|
samples = sysprof_document_list_samples (document);
|
||||||
samples_with_context_switch = sysprof_document_list_samples_with_context_switch (document);
|
samples_with_context_switch = sysprof_document_list_samples_with_context_switch (document);
|
||||||
|
samples_without_context_switch = sysprof_document_list_samples_without_context_switch (document);
|
||||||
|
|
||||||
if (g_list_model_get_n_items (samples) > 0)
|
if (g_list_model_get_n_items (samples) > 0)
|
||||||
{
|
{
|
||||||
@ -261,7 +263,7 @@ sysprof_session_discover_sampler (SysprofSession *self,
|
|||||||
g_autoptr(SysprofTrack) subtrack = NULL;
|
g_autoptr(SysprofTrack) subtrack = NULL;
|
||||||
|
|
||||||
subtrack = g_object_new (SYSPROF_TYPE_TRACK,
|
subtrack = g_object_new (SYSPROF_TYPE_TRACK,
|
||||||
"title", _("Context Switches"),
|
"title", _("Stack Traces (In Kernel)"),
|
||||||
NULL);
|
NULL);
|
||||||
g_signal_connect_data (subtrack,
|
g_signal_connect_data (subtrack,
|
||||||
"create-chart",
|
"create-chart",
|
||||||
@ -271,6 +273,22 @@ sysprof_session_discover_sampler (SysprofSession *self,
|
|||||||
0);
|
0);
|
||||||
_sysprof_track_add_subtrack (track, subtrack);
|
_sysprof_track_add_subtrack (track, subtrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_list_model_get_n_items (samples_without_context_switch))
|
||||||
|
{
|
||||||
|
g_autoptr(SysprofTrack) subtrack = NULL;
|
||||||
|
|
||||||
|
subtrack = g_object_new (SYSPROF_TYPE_TRACK,
|
||||||
|
"title", _("Stack Traces (In User)"),
|
||||||
|
NULL);
|
||||||
|
g_signal_connect_data (subtrack,
|
||||||
|
"create-chart",
|
||||||
|
G_CALLBACK (create_chart_for_samples),
|
||||||
|
sysprof_track_samples_new (self, samples_without_context_switch),
|
||||||
|
(GClosureNotify)sysprof_track_samples_free,
|
||||||
|
0);
|
||||||
|
_sysprof_track_add_subtrack (track, subtrack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user