mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: add --silent option for test
This allows testing loading without the print overhead.
This commit is contained in:
@ -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[])
|
||||
|
||||
Reference in New Issue
Block a user