[sysprof] tools: add --speedtrack command line option



commit 89f656013ab125dbbccfe00d50f4aa993677b6f9
Author: Christian Hergert <chergert redhat com>
Date:   Sun Mar 15 15:57:34 2020 -0700

    tools: add --speedtrack command line option

 src/tools/sysprof-cli.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/tools/sysprof-cli.c b/src/tools/sysprof-cli.c
index 8b8cc93..0798b23 100644
--- a/src/tools/sysprof-cli.c
+++ b/src/tools/sysprof-cli.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]