mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-analyze: add aggregate marks by group
This is handy so that we can show aggregate results in other places without using a FlattenListModel which can mess up event ordering.
This commit is contained in:
@ -1311,7 +1311,7 @@ sysprof_document_list_traceables (SysprofDocument *self)
|
|||||||
* Gets a #GListModel containing #SysprofDocumentMark found within
|
* Gets a #GListModel containing #SysprofDocumentMark found within
|
||||||
* the #SysprofDocument.
|
* the #SysprofDocument.
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): a #GListModel of #SysprofDocumentAllocation
|
* Returns: (transfer full): a #GListModel of #SysprofDocumentMark
|
||||||
*/
|
*/
|
||||||
GListModel *
|
GListModel *
|
||||||
sysprof_document_list_marks (SysprofDocument *self)
|
sysprof_document_list_marks (SysprofDocument *self)
|
||||||
@ -1321,6 +1321,43 @@ sysprof_document_list_marks (SysprofDocument *self)
|
|||||||
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), self->marks);
|
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), self->marks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysprof_document_list_marks_by_group:
|
||||||
|
* @self: a #SysprofDocument
|
||||||
|
* @group: the name of the group
|
||||||
|
*
|
||||||
|
* Gets a #GListModel containing #SysprofDocumentMark found within
|
||||||
|
* the #SysprofDocument which are part of @group.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): a #GListModel of #SysprofDocumentMark
|
||||||
|
*/
|
||||||
|
GListModel *
|
||||||
|
sysprof_document_list_marks_by_group (SysprofDocument *self,
|
||||||
|
const char *group)
|
||||||
|
{
|
||||||
|
g_autoptr(EggBitset) bitset = NULL;
|
||||||
|
GHashTable *names;
|
||||||
|
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_DOCUMENT (self), NULL);
|
||||||
|
g_return_val_if_fail (group != NULL, NULL);
|
||||||
|
|
||||||
|
bitset = egg_bitset_new_empty ();
|
||||||
|
|
||||||
|
if ((names = g_hash_table_lookup (self->mark_groups, group)))
|
||||||
|
{
|
||||||
|
GHashTableIter iter;
|
||||||
|
const char *name;
|
||||||
|
EggBitset *indices;
|
||||||
|
|
||||||
|
g_hash_table_iter_init (&iter, names);
|
||||||
|
|
||||||
|
while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&indices))
|
||||||
|
egg_bitset_union (bitset, indices);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), bitset);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sysprof_document_list_allocations:
|
* sysprof_document_list_allocations:
|
||||||
* @self: a #SysprofDocument
|
* @self: a #SysprofDocument
|
||||||
|
|||||||
@ -63,6 +63,9 @@ GListModel *sysprof_document_list_counters (SysprofDocume
|
|||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GListModel *sysprof_document_list_marks (SysprofDocument *self);
|
GListModel *sysprof_document_list_marks (SysprofDocument *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
GListModel *sysprof_document_list_marks_by_group (SysprofDocument *self,
|
||||||
|
const char *group);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
GListModel *sysprof_document_catalog_marks (SysprofDocument *self);
|
GListModel *sysprof_document_catalog_marks (SysprofDocument *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
SysprofDocumentCounter
|
SysprofDocumentCounter
|
||||||
|
|||||||
Reference in New Issue
Block a user