aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2013-02-07 04:02:08 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-02-14 12:59:27 -0500
commit2b676bf068916046151277f27113f80828e33001 (patch)
tree2f508debbd3bc103ed64887914d8f65f590950b6 /tools/perf/builtin-annotate.c
parente3a34029c635b7dee06e51d99441578b96c7d463 (diff)
perf ui/gtk: Implement basic GTK2 annotation browser
Basic implementation of perf annotate on GTK2. Currently only shows first symbol. Add a new --gtk option to use it. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1360227734-375-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 95a2ad3f043e..9d758c9611a5 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -34,7 +34,7 @@
34 34
35struct perf_annotate { 35struct perf_annotate {
36 struct perf_tool tool; 36 struct perf_tool tool;
37 bool force, use_tui, use_stdio; 37 bool force, use_tui, use_stdio, use_gtk;
38 bool full_paths; 38 bool full_paths;
39 bool print_line; 39 bool print_line;
40 const char *sym_hist_filter; 40 const char *sym_hist_filter;
@@ -138,7 +138,10 @@ find_next:
138 continue; 138 continue;
139 } 139 }
140 140
141 if (use_browser > 0) { 141 if (use_browser == 2) {
142 hist_entry__gtk_annotate(he, evidx, NULL);
143 return;
144 } else if (use_browser == 1) {
142 key = hist_entry__tui_annotate(he, evidx, NULL); 145 key = hist_entry__tui_annotate(he, evidx, NULL);
143 switch (key) { 146 switch (key) {
144 case K_RIGHT: 147 case K_RIGHT:
@@ -270,6 +273,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
270 "be more verbose (show symbol address, etc)"), 273 "be more verbose (show symbol address, etc)"),
271 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 274 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
272 "dump raw trace in ASCII"), 275 "dump raw trace in ASCII"),
276 OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"),
273 OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"), 277 OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
274 OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"), 278 OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
275 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, 279 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
@@ -300,6 +304,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
300 use_browser = 0; 304 use_browser = 0;
301 else if (annotate.use_tui) 305 else if (annotate.use_tui)
302 use_browser = 1; 306 use_browser = 1;
307 else if (annotate.use_gtk)
308 use_browser = 2;
303 309
304 setup_browser(true); 310 setup_browser(true);
305 311