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

Signed-off-by: Namhyung Kim <[email protected]>
---
 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

Reply via email to