This is a note to let you know that I've just added the patch titled perf top: Move sb_evlist to 'struct perf_top' to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: perf-top-move-sb_evlist-to-struct-perf_top.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 8d4aff39dee6b6281d8920114547422643fce749 Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> Date: Fri Apr 24 10:40:54 2020 -0300 perf top: Move sb_evlist to 'struct perf_top' [ Upstream commit ca6c9c8b107f9788662117587cd24bbb19cea94d ] Where state related to a 'perf top' session is grouped. Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx> Cc: Namhyung Kim <namhyung@xxxxxxxxxx> Cc: Song Liu <songliubraving@xxxxxx> Link: http://lore.kernel.org/lkml/20200429131106.27974-3-acme@xxxxxxxxxx Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> Stable-dep-of: 9c51f8788b5d ("perf env: Avoid recursively taking env->bpf_progs.lock") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index b83a861fab2e..d83954f75557 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1542,7 +1542,6 @@ int cmd_top(int argc, const char **argv) OPTS_EVSWITCH(&top.evswitch), OPT_END() }; - struct evlist *sb_evlist = NULL; const char * const top_usage[] = { "perf top [<options>]", NULL @@ -1684,9 +1683,9 @@ int cmd_top(int argc, const char **argv) } if (!top.record_opts.no_bpf_event) - bpf_event__add_sb_event(&sb_evlist, &perf_env); + bpf_event__add_sb_event(&top.sb_evlist, &perf_env); - if (perf_evlist__start_sb_thread(sb_evlist, target)) { + if (perf_evlist__start_sb_thread(top.sb_evlist, target)) { pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); opts->no_bpf_event = true; } @@ -1694,7 +1693,7 @@ int cmd_top(int argc, const char **argv) status = __cmd_top(&top); if (!opts->no_bpf_event) - perf_evlist__stop_sb_thread(sb_evlist); + perf_evlist__stop_sb_thread(top.sb_evlist); out_delete_evlist: evlist__delete(top.evlist); diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index f117d4f4821e..7bea36a61645 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h @@ -18,7 +18,7 @@ struct perf_session; struct perf_top { struct perf_tool tool; - struct evlist *evlist; + struct evlist *evlist, *sb_evlist; struct record_opts record_opts; struct annotation_options annotation_opts; struct evswitch evswitch;