perf hists browser: Only offer symbol scripting when a symbol is under the cursor
authorNamhyung Kim <[email protected]>
Thu, 21 Jan 2016 22:50:09 +0000 (19:50 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Tue, 26 Jan 2016 14:52:49 +0000 (11:52 -0300)
When this feature was introduced a check was made if there was a
resolved symbol under the cursor, it got lost in commit ea7cd5923309
("perf hists browser: Split popup menu actions - part 2"), reinstate it.

Signed-off-by: Namhyung Kim <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>,
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Wang Nan <[email protected]>
Fixes: ea7cd5923309 ("perf hists browser: Split popup menu actions - part 2")
Link: http://lkml.kernel.org/r/[email protected]
[ Carved out from a  larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/ui/browsers/hists.c

index e66b3a30dd9f7284e906cbeda47e09186cb66c1e..2801d80c690388360525e068a437b152af54b67e 100644 (file)
@@ -2322,10 +2322,12 @@ skip_annotation:
                         *
                         * See hist_browser__show_entry.
                         */
-                       nr_options += add_script_opt(browser,
-                                                    &actions[nr_options],
-                                                    &options[nr_options],
-                                                    NULL, browser->selection->sym);
+                       if (sort__has_sym && browser->selection->sym) {
+                               nr_options += add_script_opt(browser,
+                                                            &actions[nr_options],
+                                                            &options[nr_options],
+                                                            NULL, browser->selection->sym);
+                       }
                }
                nr_options += add_script_opt(browser, &actions[nr_options],
                                             &options[nr_options], NULL, NULL);