tools: add --speedtrack command line option

This commit is contained in:
Christian Hergert
2020-03-15 15:57:34 -07:00
parent 9de1dd3ab5
commit 89f656013a

View File

@ -210,6 +210,7 @@ main (gint argc,
gboolean rapl = FALSE;
gboolean memprof = FALSE;
gboolean merge = FALSE;
gboolean speedtrack = FALSE;
int pid = -1;
int fd;
int flags;
@ -231,6 +232,7 @@ main (gint argc,
{ "rapl", 0, 0, G_OPTION_ARG_NONE, &rapl, N_("Include RAPL energy statistics") },
{ "memprof", 0, 0, G_OPTION_ARG_NONE, &memprof, N_("Profile memory allocations and frees") },
{ "gnome-shell", 0, 0, G_OPTION_ARG_NONE, &gnome_shell, N_("Connect to org.gnome.Shell for profiler statistics") },
{ "speedtrack", 0, 0, G_OPTION_ARG_NONE, &speedtrack, N_("Track performance of the applications main loop") },
{ "merge", 0, 0, G_OPTION_ARG_NONE, &merge, N_("Merge all provided *.syscap files and write to stdout") },
{ "version", 0, 0, G_OPTION_ARG_NONE, &version, N_("Print the sysprof-cli version and exit") },
{ NULL }
@ -518,6 +520,15 @@ Examples:\n\
g_object_unref (source);
}
if (speedtrack)
{
source = g_object_new (SYSPROF_TYPE_PRELOAD_SOURCE,
"preload", "libsysprof-speedtrack-3.so",
NULL);
sysprof_profiler_add_source (profiler, source);
g_object_unref (source);
}
if (pid != -1)
{
sysprof_profiler_set_whole_system (profiler, FALSE);