From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
James Clark <james.clark@linaro.org>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Clark Williams <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH v6 3/5] perf report: Add --no-progress option
Date: Thu, 1 Oct 2026 00:01:25 -0700 [thread overview]
Message-ID: <ar4FRWnf6ZBFk7Rl@z2> (raw)
In-Reply-To: <20260930213716.2633750-4-acme@kernel.org>
On Wed, Sep 30, 2026 at 11:37:14PM +0200, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Now that --progress is being added for the stdio case, wire up its
> counterpart for the browsers: the TUI and GTK ones present progress of
> their own and there is no way to turn it off. Install the no-op
> ui_progress ops, the ones already used until a backend sets theirs,
> after setup_browser() installed the ones of the browser in use. The
> phases are still counted, nothing is shown for them, and no second
> option is needed for it: parse-options provides --no-progress as the
> negation of --progress, report.progress_set saying that it was asked
> for, report.progress being false both when nothing was asked for and
> when --no-progress was.
>
> Suggested-by: Namhyung Kim <namhyung@kernel.org>
> Assisted-by: LLM
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/perf/Documentation/perf-report.txt | 5 +++++
> tools/perf/builtin-report.c | 20 ++++++++++++++++----
> tools/perf/ui/progress.c | 6 ++++++
> tools/perf/ui/progress.h | 2 ++
> 4 files changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
> index a7429a30ec28f903..e145124d6c9a1097 100644
> --- a/tools/perf/Documentation/perf-report.txt
> +++ b/tools/perf/Documentation/perf-report.txt
> @@ -43,6 +43,11 @@ OPTIONS
> present progress information, or when --quiet is used, that asks
> for no messages at all.
>
> +--no-progress::
> + Do not show progress while processing the perf.data file. It
> + also turns off the progress the TUI and GTK browsers present,
> + which is their own.
> +
> -n::
> --show-nr-samples::
> Show the number of samples for each symbol
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 963808b561e547c3..105b2859678673ec 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -88,6 +88,7 @@ struct report {
> #endif
> bool use_stdio;
> bool progress;
> + bool progress_set;
> bool show_full_info;
> bool show_threads;
> bool inverted_callchain;
> @@ -1385,8 +1386,15 @@ int cmd_report(int argc, const char **argv)
> "Use the stdio interface"),
> OPT_BOOLEAN(0, "weights", &symbol_conf.annotate_weight,
> "Show or hide weight columns in annotation. Default show if non-zero."),
> - OPT_BOOLEAN(0, "progress", &report.progress,
> - "Show progress while processing the perf.data file"),
> + /*
> + * No --no-progress option to add: parse-options provides it as
> + * the negation of this one, clearing report.progress, which is
> + * also how it starts out. progress_set is what tells the hook
> + * below to stop the TUI and GTK browsers as well, they show
> + * progress until asked not to.
> + */
Nit: I think we can drop this comment.
> + OPT_BOOLEAN_SET(0, "progress", &report.progress, &report.progress_set,
> + "Show progress while processing the perf.data file"),
> OPT_BOOLEAN(0, "header", &report.header, "Show data header."),
> OPT_BOOLEAN(0, "header-only", &report.header_only,
> "Show only data header."),
> @@ -1796,9 +1804,13 @@ int cmd_report(int argc, const char **argv)
> /*
> * For the stdio case: print the percentage of the perf.data file
> * processed so far for each processing phase. --quiet asks for no
> - * messages at all, so it leaves the phases uncounted.
> + * messages at all, so it leaves the phases uncounted, and
> + * --no-progress, progress_set with progress cleared, turns off what
> + * the TUI and GTK browsers show as well.
> */
Maybe this one too..
Thanks,
Namhyung
> - if (report.progress && !quiet && use_browser == 0)
> + if (report.progress_set && !report.progress)
> + ui_progress__noop_init();
> + else if (report.progress && !quiet && use_browser == 0)
> stdio_progress__init();
>
> if (report.data_type && use_browser == 1) {
> diff --git a/tools/perf/ui/progress.c b/tools/perf/ui/progress.c
> index 99d60223c74b2957..362680989ace606a 100644
> --- a/tools/perf/ui/progress.c
> +++ b/tools/perf/ui/progress.c
> @@ -13,6 +13,12 @@ static struct ui_progress_ops null_progress__ops =
>
> struct ui_progress_ops *ui_progress__ops = &null_progress__ops;
>
> +/* Everything counts but nothing is shown, the way it starts out. */
> +void ui_progress__noop_init(void)
> +{
> + ui_progress__ops = &null_progress__ops;
> +}
> +
> void ui_progress__update(struct ui_progress *p, u64 adv)
> {
> u64 last = p->curr;
> diff --git a/tools/perf/ui/progress.h b/tools/perf/ui/progress.h
> index 03f1a8bb260ba076..e8c4f9f768aaf12b 100644
> --- a/tools/perf/ui/progress.h
> +++ b/tools/perf/ui/progress.h
> @@ -25,6 +25,8 @@ void ui_progress__update(struct ui_progress *p, u64 adv);
>
> void stdio_progress__init(void);
>
> +void ui_progress__noop_init(void);
> +
> struct ui_progress_ops {
> void (*init)(struct ui_progress *p);
> void (*update)(struct ui_progress *p);
> --
> 2.55.0
>
next prev parent reply other threads:[~2026-10-01 7:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 21:37 [PATCH v6 0/5] perf tools: Add progress diagnostics and a false-sharing workload Arnaldo Carvalho de Melo
2026-09-30 21:37 ` [PATCH v6 1/5] perf config: Move perf_config__set_variable() to util/config.c Arnaldo Carvalho de Melo
2026-10-01 7:18 ` Namhyung Kim
2026-10-01 9:19 ` Arnaldo Carvalho de Melo
2026-09-30 21:37 ` [PATCH v6 2/5] perf report: Add --progress option Arnaldo Carvalho de Melo
2026-09-30 21:37 ` [PATCH v6 3/5] perf report: Add --no-progress option Arnaldo Carvalho de Melo
2026-10-01 7:01 ` Namhyung Kim [this message]
2026-10-01 9:20 ` Arnaldo Carvalho de Melo
2026-09-30 21:37 ` [PATCH v6 4/5] perf scripts: Add perf-stuck, to tell where a running perf is stuck Arnaldo Carvalho de Melo
2026-10-01 7:24 ` Namhyung Kim
2026-10-01 9:19 ` Arnaldo Carvalho de Melo
2026-09-30 21:37 ` [PATCH v6 5/5] perf test: Add false_sharing workload exhibiting cross-CPU false sharing Arnaldo Carvalho de Melo
2026-10-01 7:28 ` Namhyung Kim
2026-10-01 9:18 ` Arnaldo Carvalho de Melo
-- strict thread matches above, loose matches on Subject: below --
2026-09-30 11:24 [PATCH v6 0/5] perf tools: Add progress diagnostics and a false-sharing workload Arnaldo Carvalho de Melo
2026-09-30 11:24 ` [PATCH v6 3/5] perf report: Add --no-progress option Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ar4FRWnf6ZBFk7Rl@z2 \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®