From 9ab48d6eebfd5fec3a51b42b22addd7ebf23da33 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sun, 6 Aug 2023 15:45:33 -0700 Subject: [PATCH] tools: add glxinfo/eglinfo to cli/agent variants Always do it here for now unless we really find a reason to not have it. --- src/sysprof-agent/sysprof-agent.c | 11 +++++++++++ src/sysprof-cli/sysprof-cli.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/sysprof-agent/sysprof-agent.c b/src/sysprof-agent/sysprof-agent.c index b6ea1c53..08ca46c2 100644 --- a/src/sysprof-agent/sysprof-agent.c +++ b/src/sysprof-agent/sysprof-agent.c @@ -602,6 +602,17 @@ main (int argc, sysprof_profiler_add_instrument (profiler, sysprof_tracefd_consumer_new (g_steal_fd (&gjs_trace_fd))); sysprof_profiler_add_instrument (profiler, sysprof_tracefd_consumer_new (g_steal_fd (&trace_fd))); + sysprof_profiler_add_instrument (profiler, + g_object_new (SYSPROF_TYPE_SUBPROCESS_OUTPUT, + "stdout-path", "eglinfo", + "command-argv", (const char * const[]) {"eglinfo", NULL}, + NULL)); + sysprof_profiler_add_instrument (profiler, + g_object_new (SYSPROF_TYPE_SUBPROCESS_OUTPUT, + "stdout-path", "glxinfo", + "command-argv", (const char * const[]) {"glxinfo", NULL}, + NULL)); + /* Now open the writer for our session */ if (!(writer = sysprof_capture_writer_new (capture_filename, BUFFER_SIZE))) { diff --git a/src/sysprof-cli/sysprof-cli.c b/src/sysprof-cli/sysprof-cli.c index f089c286..dfd681ba 100644 --- a/src/sysprof-cli/sysprof-cli.c +++ b/src/sysprof-cli/sysprof-cli.c @@ -545,6 +545,17 @@ Examples:\n\ if (system_bus) sysprof_profiler_add_instrument (profiler, sysprof_dbus_monitor_new (G_BUS_TYPE_SYSTEM)); + sysprof_profiler_add_instrument (profiler, + g_object_new (SYSPROF_TYPE_SUBPROCESS_OUTPUT, + "stdout-path", "eglinfo", + "command-argv", (const char * const[]) {"eglinfo", NULL}, + NULL)); + sysprof_profiler_add_instrument (profiler, + g_object_new (SYSPROF_TYPE_SUBPROCESS_OUTPUT, + "stdout-path", "glxinfo", + "command-argv", (const char * const[]) {"glxinfo", NULL}, + NULL)); + sysprof_profiler_record_async (profiler, writer, NULL,