libsysprof-analyze: add bit for context switch symbols

This commit is contained in:
Christian Hergert
2023-05-25 11:11:52 -07:00
parent 007b42a80f
commit 9c8b3b9c25
2 changed files with 10 additions and 0 deletions

View File

@ -178,6 +178,8 @@ sysprof_document_symbols_worker (GTask *task,
{
g_autoptr(SysprofSymbol) symbol = _sysprof_symbol_new (g_ref_string_new_intern (context_switches[cs].name), NULL, NULL, 0, 0);
symbol->is_context_switch = TRUE;
/* TODO: It would be nice if we had enough insight from the capture header
* as to the host system, so we can show "vmlinuz" and "Linux" respectively
* for binary-path and binary-nick when the capture came from Linux.

View File

@ -37,6 +37,8 @@ struct _SysprofSymbol
SysprofAddress begin_address;
SysprofAddress end_address;
guint is_context_switch : 1;
};
SysprofSymbol *_sysprof_symbol_new (GRefString *name,
@ -58,4 +60,10 @@ _sysprof_symbol_equal (const SysprofSymbol *a,
return strcmp (a->name, b->name) == 0;
}
static inline gboolean
_sysprof_symbol_is_context_switch (SysprofSymbol *symbol)
{
return symbol->is_context_switch;
}
G_END_DECLS