libsysprof-analyze: add callgraph flags for thread-ids

This allows you to set a flag to show the thread id of what was recorded.

Use this to help disassociate similar threads in a process to figure out
which thread is consuming a majority of the Total time of that process.
This commit is contained in:
Christian Hergert
2023-06-14 15:11:56 -07:00
parent 54ecdc57cd
commit 5b929b8d5d
20 changed files with 206 additions and 538 deletions

View File

@ -43,6 +43,18 @@ sysprof_document_traceable_default_init (SysprofDocumentTraceableInterface *ifac
g_param_spec_uint ("stack-depth", NULL, NULL,
0, G_MAXUINT16, 0,
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
/**
* SysprofDocumentTraceable:thread-id:
*
* The "thread-id" property contains the thread identifier for the traceable.
*
* Since: 45
*/
g_object_interface_install_property (iface,
g_param_spec_int ("thread-id", NULL, NULL,
-1, G_MAXINT, -1,
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
}
guint
@ -58,6 +70,12 @@ sysprof_document_traceable_get_stack_address (SysprofDocumentTraceable *self,
return SYSPROF_DOCUMENT_TRACEABLE_GET_IFACE (self)->get_stack_address (self, position);
}
int
sysprof_document_traceable_get_thread_id (SysprofDocumentTraceable *self)
{
return SYSPROF_DOCUMENT_TRACEABLE_GET_IFACE (self)->get_thread_id (self);
}
guint
sysprof_document_traceable_get_stack_addresses (SysprofDocumentTraceable *self,
guint64 *addresses,