[PATCH 2/4] perf hists browser: Check socket context menu

From: Namhyung Kim
Date: Sat Jan 23 2016 - 08:32:52 EST


Show socket filter context menu only if sort key has socket.
Otherwise the info will be incorrect.

Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/ui/browsers/hists.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 683b4d8a0aa3..85c668104c4b 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2306,9 +2306,11 @@ skip_annotation:
browser->selection ?
browser->selection->map : NULL);
}
- nr_options += add_socket_opt(browser, &actions[nr_options],
- &options[nr_options],
- socked_id);
+ if (sort__has_socket) {
+ nr_options += add_socket_opt(browser, &actions[nr_options],
+ &options[nr_options],
+ socked_id);
+ }
/* perf script support */
if (browser->he_selection) {
if (sort__has_thread) {
--
2.6.4