[PATCH 08/12] perf top: Set session_done when exiting
From: Jiri Olsa
Date: Mon Nov 19 2018 - 07:20:44 EST
So we can get out of hist processing ASAP on user request.
Link: http://lkml.kernel.org/n/tip-mi1dfa14swg9tarrp6jcgv41@xxxxxxxxxxxxxx
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/perf/builtin-top.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index ca2a1557ac07..ce542cc1e84f 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -577,6 +577,12 @@ static void perf_top__sort_new_samples(void *arg)
perf_top__reset_sample_counters(t);
}
+static void stop_top(void)
+{
+ session_done = 1;
+ done = 1;
+}
+
static void *display_thread_tui(void *arg)
{
struct perf_evsel *pos;
@@ -613,13 +619,13 @@ static void *display_thread_tui(void *arg)
!top->record_opts.overwrite,
&top->annotation_opts);
- done = 1;
+ stop_top();
return NULL;
}
static void display_sig(int sig __maybe_unused)
{
- done = 1;
+ stop_top();
}
static void display_setup_sig(void)
@@ -672,7 +678,7 @@ static void *display_thread(void *arg)
if (perf_top__handle_keypress(top, c))
goto repeat;
- done = 1;
+ stop_top();
}
}
--
2.17.2