sysprof: include file/category in tooltips

This commit is contained in:
Christian Hergert
2023-08-25 17:41:47 -07:00
parent fd3e5af1fa
commit 9f0a214a69
2 changed files with 13 additions and 1 deletions

View File

@ -27,6 +27,7 @@ src/sysprof/sysprof-dbus-section.ui
src/sysprof/sysprof-dbus-utility.ui
src/sysprof/sysprof-energy-section.ui
src/sysprof/sysprof-files-section.ui
src/sysprof/sysprof-flame-graph.c
src/sysprof/sysprof-frame-utility.ui
src/sysprof/sysprof-graphics-section.ui
src/sysprof/sysprof-greeter.c

View File

@ -20,6 +20,8 @@
#include "config.h"
#include <glib/gi18n.h>
#include "sysprof-callgraph-private.h"
#include "sysprof-category-icon.h"
#include "sysprof-color-iter-private.h"
@ -328,6 +330,7 @@ sysprof_flame_graph_query_tooltip (GtkWidget *widget,
g_autoptr(GString) string = g_string_new (NULL);
SysprofSymbol *symbol = rect->node->summary->symbol;
SysprofCallgraphNode *root = rect->node;
SysprofCallgraphCategory category = SYSPROF_CALLGRAPH_CATEGORY_UNMASK (rect->node->category);
while (root->parent)
root = root->parent;
@ -337,8 +340,16 @@ sysprof_flame_graph_query_tooltip (GtkWidget *widget,
if (symbol->binary_nick && symbol->binary_nick[0])
g_string_append_printf (string, " [%s]", symbol->binary_nick);
if (category && category != SYSPROF_CALLGRAPH_CATEGORY_UNCATEGORIZED)
{
const char *name = _sysprof_callgraph_category_get_name (category);
if (name)
g_string_append_printf (string, "\n%s: %s", _("Category"), name);
}
if (symbol->binary_path && symbol->binary_path[0])
g_string_append_printf (string, "\n%s", symbol->binary_path);
g_string_append_printf (string, "\n%s: %s", _("File"), symbol->binary_path);
g_string_append_c (string, '\n');