Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf gtk: Only support --gtk if compiled in

If HAVE_GTK2_SUPPORT isn't defined then --gtk can't succeed, don't
support it as a command line option in this case.

v2. Is a rebase. Patch appears to have been missed in:
https://lore.kernel.org/lkml/Ygu40djM1MqAfkcF@kernel.org/

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: xaizek <xaizek@posteo.net>
Link: https://lore.kernel.org/r/20220707203836.345918-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
557cc18e 2f1d6b41

+14
+8
tools/perf/builtin-annotate.c
··· 50 50 bool use_tui; 51 51 #endif 52 52 bool use_stdio, use_stdio2; 53 + #ifdef HAVE_GTK2_SUPPORT 53 54 bool use_gtk; 55 + #endif 54 56 bool skip_missing; 55 57 bool has_br_stack; 56 58 bool group_set; ··· 528 526 OPT_BOOLEAN('q', "quiet", &quiet, "do now show any message"), 529 527 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 530 528 "dump raw trace in ASCII"), 529 + #ifdef HAVE_GTK2_SUPPORT 531 530 OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"), 531 + #endif 532 532 #ifdef HAVE_SLANG_SUPPORT 533 533 OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"), 534 534 #endif ··· 618 614 if (annotate_check_args(&annotate.opts) < 0) 619 615 return -EINVAL; 620 616 617 + #ifdef HAVE_GTK2_SUPPORT 621 618 if (symbol_conf.show_nr_samples && annotate.use_gtk) { 622 619 pr_err("--show-nr-samples is not available in --gtk mode at this time\n"); 623 620 return ret; 624 621 } 622 + #endif 625 623 626 624 ret = symbol__validate_sym_arguments(); 627 625 if (ret) ··· 662 656 else if (annotate.use_tui) 663 657 use_browser = 1; 664 658 #endif 659 + #ifdef HAVE_GTK2_SUPPORT 665 660 else if (annotate.use_gtk) 666 661 use_browser = 2; 662 + #endif 667 663 668 664 setup_browser(true); 669 665
+6
tools/perf/builtin-report.c
··· 74 74 #ifdef HAVE_SLANG_SUPPORT 75 75 bool use_tui; 76 76 #endif 77 + #ifdef HAVE_GTK2_SUPPORT 77 78 bool use_gtk; 79 + #endif 78 80 bool use_stdio; 79 81 bool show_full_info; 80 82 bool show_threads; ··· 1229 1227 #ifdef HAVE_SLANG_SUPPORT 1230 1228 OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"), 1231 1229 #endif 1230 + #ifdef HAVE_GTK2_SUPPORT 1232 1231 OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"), 1232 + #endif 1233 1233 OPT_BOOLEAN(0, "stdio", &report.use_stdio, 1234 1234 "Use the stdio interface"), 1235 1235 OPT_BOOLEAN(0, "header", &report.header, "Show data header."), ··· 1520 1516 else if (report.use_tui) 1521 1517 use_browser = 1; 1522 1518 #endif 1519 + #ifdef HAVE_GTK2_SUPPORT 1523 1520 else if (report.use_gtk) 1524 1521 use_browser = 2; 1522 + #endif 1525 1523 1526 1524 /* Force tty output for header output and per-thread stat. */ 1527 1525 if (report.header || report.header_only || report.show_threads)