mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
tools: perform cleanup/supplementals when stopping profiler
This commit is contained in:
@ -44,15 +44,33 @@ static int exit_code = EXIT_SUCCESS;
|
|||||||
static gboolean
|
static gboolean
|
||||||
sigint_handler (gpointer user_data)
|
sigint_handler (gpointer user_data)
|
||||||
{
|
{
|
||||||
g_main_loop_quit (main_loop);
|
static int count;
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
|
if (count >= 2)
|
||||||
|
{
|
||||||
|
g_main_loop_quit (main_loop);
|
||||||
|
return G_SOURCE_REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_printerr ("\n");
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
g_printerr ("%s\n", _("Stopping profiler. Press twice more ^C to force exit."));
|
||||||
|
sysprof_profiler_stop (profiler);
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
|
||||||
|
return G_SOURCE_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
profiler_stopped (SysprofProfiler *profiler_,
|
profiler_stopped (SysprofProfiler *profiler_,
|
||||||
GMainLoop *main_loop_)
|
GMainLoop *main_loop_)
|
||||||
{
|
{
|
||||||
g_main_loop_quit (main_loop_);
|
g_printerr ("%s\n", _("Profiler stopped."));
|
||||||
|
g_main_loop_quit (main_loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user