libsysprof-analyze: add --silent option for test

This allows testing loading without the print overhead.
This commit is contained in:
Christian Hergert
2023-05-22 17:16:48 -07:00
parent 309f60e263
commit c2c4495e3c

View File

@ -5,6 +5,14 @@
#include "sysprof-document-private.h"
static GMainLoop *main_loop;
static gboolean silent;
static gboolean no_bundled;
static const GOptionEntry entries[] = {
{ "no-bundled", 'b', 0, G_OPTION_ARG_NONE, &no_bundled, "Ignore symbols bundled in capture file" },
{ "silent", 's', 0, G_OPTION_ARG_NONE, &silent, "Do not print symbol information" },
{ 0 }
};
static void
load_cb (GObject *object,
@ -29,6 +37,12 @@ load_cb (GObject *object,
traceables = sysprof_document_list_traceables (document);
n_items = g_list_model_get_n_items (traceables);
if (silent)
{
g_main_loop_quit (main_loop);
return;
}
str = g_string_new ("");
for (guint i = 0; i < n_items; i++)
@ -96,12 +110,6 @@ load_cb (GObject *object,
g_main_loop_quit (main_loop);
}
static gboolean no_bundled;
static const GOptionEntry entries[] = {
{ "no-bundled", 'b', 0, G_OPTION_ARG_NONE, &no_bundled, "Ignore symbols bundled in capture file" },
{ 0 }
};
int
main (int argc,
char *argv[])