提交 2eafd410 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf hists browser: Only 'Zoom into thread' only when sort order has 'pid'

We can't offer a zoom into thread when a bucket (struct hist_entry) may
have samples for more than one thread, i.e. when 'pid' is not part of
the sort order, fix it.
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1452960197-5323-9-git-send-email-namhyung@kernel.org
[ Carved out from a  larger patch ]
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 cfd92dad
...@@ -1782,7 +1782,7 @@ static int ...@@ -1782,7 +1782,7 @@ static int
add_thread_opt(struct hist_browser *browser, struct popup_action *act, add_thread_opt(struct hist_browser *browser, struct popup_action *act,
char **optstr, struct thread *thread) char **optstr, struct thread *thread)
{ {
if (thread == NULL) if (!sort__has_thread || thread == NULL)
return 0; return 0;
if (asprintf(optstr, "Zoom %s %s(%d) thread", if (asprintf(optstr, "Zoom %s %s(%d) thread",
...@@ -2307,10 +2307,12 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, ...@@ -2307,10 +2307,12 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
socked_id); socked_id);
/* perf script support */ /* perf script support */
if (browser->he_selection) { if (browser->he_selection) {
nr_options += add_script_opt(browser, if (sort__has_thread && thread) {
&actions[nr_options], nr_options += add_script_opt(browser,
&options[nr_options], &actions[nr_options],
thread, NULL); &options[nr_options],
thread, NULL);
}
/* /*
* Note that browser->selection != NULL * Note that browser->selection != NULL
* when browser->he_selection is not NULL, * when browser->he_selection is not NULL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册