Commit c94cef4b authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf top: Set the 'session_done' volatile variable when exiting

So we can get out of hist processing ASAP on user request.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/n/tip-r8aufbgbixr2f85s3wcoaw9v@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 94ad6e7e
...@@ -577,6 +577,12 @@ static void perf_top__sort_new_samples(void *arg) ...@@ -577,6 +577,12 @@ static void perf_top__sort_new_samples(void *arg)
perf_top__reset_sample_counters(t); perf_top__reset_sample_counters(t);
} }
static void stop_top(void)
{
session_done = 1;
done = 1;
}
static void *display_thread_tui(void *arg) static void *display_thread_tui(void *arg)
{ {
struct perf_evsel *pos; struct perf_evsel *pos;
...@@ -613,13 +619,13 @@ static void *display_thread_tui(void *arg) ...@@ -613,13 +619,13 @@ static void *display_thread_tui(void *arg)
!top->record_opts.overwrite, !top->record_opts.overwrite,
&top->annotation_opts); &top->annotation_opts);
done = 1; stop_top();
return NULL; return NULL;
} }
static void display_sig(int sig __maybe_unused) static void display_sig(int sig __maybe_unused)
{ {
done = 1; stop_top();
} }
static void display_setup_sig(void) static void display_setup_sig(void)
...@@ -672,7 +678,7 @@ static void *display_thread(void *arg) ...@@ -672,7 +678,7 @@ static void *display_thread(void *arg)
if (perf_top__handle_keypress(top, c)) if (perf_top__handle_keypress(top, c))
goto repeat; goto repeat;
done = 1; stop_top();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment