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

perf tools: Make quiet mode consistent between tools

Use the global quiet variable everywhere so that all tools hide warnings
in quiet mode and update the documentation to reflect this.

'perf probe' claimed that errors are not printed in quiet mode but I
don't see this so remove it from the docs.

Signed-off-by: James Clark <james.clark@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221018094137.783081-3-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
a527c2c1 65319890

+25 -26
+1 -1
tools/perf/Documentation/perf-annotate.txt
··· 41 41 42 42 -q:: 43 43 --quiet:: 44 - Do not show any message. (Suppress -v) 44 + Do not show any warnings or messages. (Suppress -v) 45 45 46 46 -n:: 47 47 --show-nr-samples::
+1 -1
tools/perf/Documentation/perf-diff.txt
··· 75 75 76 76 -q:: 77 77 --quiet:: 78 - Do not show any message. (Suppress -v) 78 + Do not show any warnings or messages. (Suppress -v) 79 79 80 80 -f:: 81 81 --force::
+1 -1
tools/perf/Documentation/perf-lock.txt
··· 42 42 43 43 -q:: 44 44 --quiet:: 45 - Do not show any message. (Suppress -v) 45 + Do not show any warnings or messages. (Suppress -v) 46 46 47 47 -D:: 48 48 --dump-raw-trace::
+1 -1
tools/perf/Documentation/perf-probe.txt
··· 57 57 58 58 -q:: 59 59 --quiet:: 60 - Be quiet (do not show any messages including errors). 60 + Do not show any warnings or messages. 61 61 Can not use with -v. 62 62 63 63 -a::
+1 -1
tools/perf/Documentation/perf-record.txt
··· 282 282 283 283 -q:: 284 284 --quiet:: 285 - Don't print any message, useful for scripting. 285 + Don't print any warnings or messages, useful for scripting. 286 286 287 287 -v:: 288 288 --verbose::
+1 -1
tools/perf/Documentation/perf-report.txt
··· 27 27 28 28 -q:: 29 29 --quiet:: 30 - Do not show any message. (Suppress -v) 30 + Do not show any warnings or messages. (Suppress -v) 31 31 32 32 -n:: 33 33 --show-nr-samples::
+2 -2
tools/perf/Documentation/perf-stat.txt
··· 354 354 may be used to increase accuracy in this case. 355 355 356 356 --quiet:: 357 - Don't print output. This is useful with perf stat record below to only 358 - write data to the perf.data file. 357 + Don't print output, warnings or messages. This is useful with perf stat 358 + record below to only write data to the perf.data file. 359 359 360 360 STAT RECORD 361 361 -----------
+5 -4
tools/perf/bench/numa.c
··· 16 16 #include <sched.h> 17 17 #include <stdio.h> 18 18 #include <assert.h> 19 + #include <debug.h> 19 20 #include <malloc.h> 20 21 #include <signal.h> 21 22 #include <stdlib.h> ··· 117 116 long bytes_thread; 118 117 119 118 int nr_tasks; 120 - bool show_quiet; 121 119 122 120 bool show_convergence; 123 121 bool measure_convergence; ··· 197 197 OPT_BOOLEAN('c', "show_convergence", &p0.show_convergence, "show convergence details, " 198 198 "convergence is reached when each process (all its threads) is running on a single NUMA node."), 199 199 OPT_BOOLEAN('m', "measure_convergence", &p0.measure_convergence, "measure convergence latency"), 200 - OPT_BOOLEAN('q', "quiet" , &p0.show_quiet, "quiet mode"), 200 + OPT_BOOLEAN('q', "quiet" , &quiet, 201 + "quiet mode (do not show any warnings or messages)"), 201 202 OPT_BOOLEAN('S', "serialize-startup", &p0.serialize_startup,"serialize thread startup"), 202 203 203 204 /* Special option string parsing callbacks: */ ··· 1475 1474 /* char array in count_process_nodes(): */ 1476 1475 BUG_ON(g->p.nr_nodes < 0); 1477 1476 1478 - if (g->p.show_quiet && !g->p.show_details) 1477 + if (quiet && !g->p.show_details) 1479 1478 g->p.show_details = -1; 1480 1479 1481 1480 /* Some memory should be specified: */ ··· 1554 1553 if (!name) 1555 1554 name = "main,"; 1556 1555 1557 - if (!g->p.show_quiet) 1556 + if (!quiet) 1558 1557 printf(" %-30s %15.3f, %-15s %s\n", name, val, txt_unit, txt_short); 1559 1558 else 1560 1559 printf(" %14.3f %s\n", val, txt_long);
+1 -1
tools/perf/builtin-annotate.c
··· 525 525 OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"), 526 526 OPT_INCR('v', "verbose", &verbose, 527 527 "be more verbose (show symbol address, etc)"), 528 - OPT_BOOLEAN('q', "quiet", &quiet, "do now show any message"), 528 + OPT_BOOLEAN('q', "quiet", &quiet, "do now show any warnings or messages"), 529 529 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 530 530 "dump raw trace in ASCII"), 531 531 #ifdef HAVE_GTK2_SUPPORT
+1 -1
tools/perf/builtin-diff.c
··· 1260 1260 static const struct option options[] = { 1261 1261 OPT_INCR('v', "verbose", &verbose, 1262 1262 "be more verbose (show symbol address, etc)"), 1263 - OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), 1263 + OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any warnings or messages"), 1264 1264 OPT_BOOLEAN('b', "baseline-only", &show_baseline_only, 1265 1265 "Show only items with match in baseline"), 1266 1266 OPT_CALLBACK('c', "compute", &compute,
+1 -1
tools/perf/builtin-lock.c
··· 1869 1869 "file", "vmlinux pathname"), 1870 1870 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, 1871 1871 "file", "kallsyms pathname"), 1872 - OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), 1872 + OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any warnings or messages"), 1873 1873 OPT_END() 1874 1874 }; 1875 1875
+3 -4
tools/perf/builtin-probe.c
··· 40 40 int command; /* Command short_name */ 41 41 bool list_events; 42 42 bool uprobes; 43 - bool quiet; 44 43 bool target_used; 45 44 int nevents; 46 45 struct perf_probe_event events[MAX_PROBES]; ··· 513 514 struct option options[] = { 514 515 OPT_INCR('v', "verbose", &verbose, 515 516 "be more verbose (show parsed arguments, etc)"), 516 - OPT_BOOLEAN('q', "quiet", &params.quiet, 517 - "be quiet (do not show any messages)"), 517 + OPT_BOOLEAN('q', "quiet", &quiet, 518 + "be quiet (do not show any warnings or messages)"), 518 519 OPT_CALLBACK_DEFAULT('l', "list", NULL, "[GROUP:]EVENT", 519 520 "list up probe events", 520 521 opt_set_filter_with_command, DEFAULT_LIST_FILTER), ··· 633 634 if (ret) 634 635 return ret; 635 636 636 - if (params.quiet) { 637 + if (quiet) { 637 638 if (verbose != 0) { 638 639 pr_err(" Error: -v and -q are exclusive.\n"); 639 640 return -EINVAL;
+1 -1
tools/perf/builtin-record.c
··· 3388 3388 &record_parse_callchain_opt), 3389 3389 OPT_INCR('v', "verbose", &verbose, 3390 3390 "be more verbose (show counter open errors, etc)"), 3391 - OPT_BOOLEAN('q', "quiet", &quiet, "don't print any message"), 3391 + OPT_BOOLEAN('q', "quiet", &quiet, "don't print any warnings or messages"), 3392 3392 OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat, 3393 3393 "per thread counts"), 3394 3394 OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
+1 -1
tools/perf/builtin-report.c
··· 1222 1222 "input file name"), 1223 1223 OPT_INCR('v', "verbose", &verbose, 1224 1224 "be more verbose (show symbol address, etc)"), 1225 - OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), 1225 + OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any warnings or messages"), 1226 1226 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 1227 1227 "dump raw trace in ASCII"), 1228 1228 OPT_BOOLEAN(0, "stats", &report.stats_mode, "Display event stats"),
+4 -4
tools/perf/builtin-stat.c
··· 1033 1033 /* Do not print anything if we record to the pipe. */ 1034 1034 if (STAT_RECORD && perf_stat.data.is_pipe) 1035 1035 return; 1036 - if (stat_config.quiet) 1036 + if (quiet) 1037 1037 return; 1038 1038 1039 1039 evlist__print_counters(evsel_list, &stat_config, &target, ts, argc, argv); ··· 1283 1283 "print summary for interval mode"), 1284 1284 OPT_BOOLEAN(0, "no-csv-summary", &stat_config.no_csv_summary, 1285 1285 "don't print 'summary' for CSV summary output"), 1286 - OPT_BOOLEAN(0, "quiet", &stat_config.quiet, 1287 - "don't print output (useful with record)"), 1286 + OPT_BOOLEAN(0, "quiet", &quiet, 1287 + "don't print any output, messages or warnings (useful with record)"), 1288 1288 OPT_CALLBACK(0, "cputype", &evsel_list, "hybrid cpu type", 1289 1289 "Only enable events on applying cpu with this type " 1290 1290 "for hybrid platform (e.g. core or atom)", ··· 2383 2383 goto out; 2384 2384 } 2385 2385 2386 - if (!output && !stat_config.quiet) { 2386 + if (!output && !quiet) { 2387 2387 struct timespec tm; 2388 2388 mode = append_file ? "a" : "w"; 2389 2389
-1
tools/perf/util/stat.h
··· 160 160 bool metric_no_group; 161 161 bool metric_no_merge; 162 162 bool stop_read_counter; 163 - bool quiet; 164 163 bool iostat_run; 165 164 char *user_requested_cpu_list; 166 165 bool system_wide;