mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
memory: add memory source for basic mem stats
This commit is contained in:
@ -88,6 +88,7 @@ main (gint argc,
|
||||
GError *error = NULL;
|
||||
GSource *gsource;
|
||||
gchar *command = NULL;
|
||||
gboolean memory = FALSE;
|
||||
gboolean version = FALSE;
|
||||
gboolean force = FALSE;
|
||||
int pid = -1;
|
||||
@ -97,6 +98,7 @@ main (gint argc,
|
||||
{ "pid", 'p', 0, G_OPTION_ARG_INT, &pid, N_("Make sysprof specific to a task"), N_("PID") },
|
||||
{ "command", 'c', 0, G_OPTION_ARG_STRING, &command, N_("Run a command and profile the process"), N_("COMMAND") },
|
||||
{ "force", 'f', 0, G_OPTION_ARG_NONE, &force, N_("Force overwrite the capture file") },
|
||||
{ "memory", 'm', 0, G_OPTION_ARG_NONE, &memory, N_("Record basic memory statistics") },
|
||||
{ "version", 0, 0, G_OPTION_ARG_NONE, &version, N_("Print the sysprof-cli version and exit") },
|
||||
{ NULL }
|
||||
};
|
||||
@ -213,6 +215,13 @@ main (gint argc,
|
||||
sp_profiler_add_source (profiler, source);
|
||||
g_object_unref (source);
|
||||
|
||||
if (memory)
|
||||
{
|
||||
source = sp_memory_source_new ();
|
||||
sp_profiler_add_source (profiler, source);
|
||||
g_object_unref (source);
|
||||
}
|
||||
|
||||
if (pid != -1)
|
||||
{
|
||||
sp_profiler_set_whole_system (profiler, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user