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

perf tui: Only support --tui with slang

Make the --tui command line flags dependent HAVE_SLANG_SUPPORT. This was
reported as confusing in:
https://lore.kernel.org/linux-perf-users/YevaTkzdXmFKdGpc@zx-spectrum.none/

Reported-by: xaizek <xaizek@posteo.net>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: xaizek <xaizek@posteo.net>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20220123191849.3655855-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
3402ae0a 24e3599c

+26 -3
+9 -1
tools/perf/builtin-annotate.c
··· 46 46 struct perf_tool tool; 47 47 struct perf_session *session; 48 48 struct annotation_options opts; 49 - bool use_tui, use_stdio, use_stdio2, use_gtk; 49 + #ifdef HAVE_SLANG_SUPPORT 50 + bool use_tui; 51 + #endif 52 + bool use_stdio, use_stdio2; 53 + bool use_gtk; 50 54 bool skip_missing; 51 55 bool has_br_stack; 52 56 bool group_set; ··· 507 503 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 508 504 "dump raw trace in ASCII"), 509 505 OPT_BOOLEAN(0, "gtk", &annotate.use_gtk, "Use the GTK interface"), 506 + #ifdef HAVE_SLANG_SUPPORT 510 507 OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"), 508 + #endif 511 509 OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"), 512 510 OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"), 513 511 OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux, ··· 630 624 631 625 if (annotate.use_stdio || annotate.use_stdio2) 632 626 use_browser = 0; 627 + #ifdef HAVE_SLANG_SUPPORT 633 628 else if (annotate.use_tui) 634 629 use_browser = 1; 630 + #endif 635 631 else if (annotate.use_gtk) 636 632 use_browser = 2; 637 633
+9 -1
tools/perf/builtin-report.c
··· 71 71 struct perf_tool tool; 72 72 struct perf_session *session; 73 73 struct evswitch evswitch; 74 - bool use_tui, use_gtk, use_stdio; 74 + #ifdef HAVE_SLANG_SUPPORT 75 + bool use_tui; 76 + #endif 77 + bool use_gtk; 78 + bool use_stdio; 75 79 bool show_full_info; 76 80 bool show_threads; 77 81 bool inverted_callchain; ··· 1210 1206 "Show per-thread event counters"), 1211 1207 OPT_STRING(0, "pretty", &report.pretty_printing_style, "key", 1212 1208 "pretty printing style key: normal raw"), 1209 + #ifdef HAVE_SLANG_SUPPORT 1213 1210 OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"), 1211 + #endif 1214 1212 OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"), 1215 1213 OPT_BOOLEAN(0, "stdio", &report.use_stdio, 1216 1214 "Use the stdio interface"), ··· 1498 1492 1499 1493 if (report.use_stdio) 1500 1494 use_browser = 0; 1495 + #ifdef HAVE_SLANG_SUPPORT 1501 1496 else if (report.use_tui) 1502 1497 use_browser = 1; 1498 + #endif 1503 1499 else if (report.use_gtk) 1504 1500 use_browser = 2; 1505 1501
+4
tools/perf/builtin-top.c
··· 1486 1486 "display this many functions"), 1487 1487 OPT_BOOLEAN('U', "hide_user_symbols", &top.hide_user_symbols, 1488 1488 "hide user symbols"), 1489 + #ifdef HAVE_SLANG_SUPPORT 1489 1490 OPT_BOOLEAN(0, "tui", &top.use_tui, "Use the TUI interface"), 1491 + #endif 1490 1492 OPT_BOOLEAN(0, "stdio", &top.use_stdio, "Use the stdio interface"), 1491 1493 OPT_INCR('v', "verbose", &verbose, 1492 1494 "be more verbose (show counter open errors, etc)"), ··· 1669 1667 1670 1668 if (top.use_stdio) 1671 1669 use_browser = 0; 1670 + #ifdef HAVE_SLANG_SUPPORT 1672 1671 else if (top.use_tui) 1673 1672 use_browser = 1; 1673 + #endif 1674 1674 1675 1675 setup_browser(false); 1676 1676
+4 -1
tools/perf/util/top.h
··· 33 33 int print_entries, count_filter, delay_secs; 34 34 int max_stack; 35 35 bool hide_kernel_symbols, hide_user_symbols, zero; 36 - bool use_tui, use_stdio; 36 + #ifdef HAVE_SLANG_SUPPORT 37 + bool use_tui; 38 + #endif 39 + bool use_stdio; 37 40 bool vmlinux_warned; 38 41 bool dump_symtab; 39 42 bool stitch_lbr;