From: sashiko-bot@kernel.org
To: "Aaron Tomlin" <atomlin@atomlin.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 2/3] perf sched latency: Auto-scale latency and runtime display units
Date: Sun, 26 Jul 2026 03:33:42 +0000 [thread overview]
Message-ID: <20260726033343.6A31A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260726032533.712462-3-atomlin@atomlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Column misalignment in the 'perf sched latency' output due to data rows being narrower than their corresponding headers.
--
--- Patch [2]: [PATCH v3 2/3] perf sched latency: Auto-scale latency and runtime display units ---
commit 2e23c112768cacfb80cab8592bd0a0612fb05704
Author: Aaron Tomlin <atomlin@atomlin.com>
perf sched latency: Auto-scale latency and runtime display units
This commit introduces dynamic scaling for latency and runtime values in
'perf sched latency', outputting them in ns, us, ms, or s. It also renames
the column headers to reflect the variable units.
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index b3cf678573e0a..8c83dc423b571 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
[ ... ]
> @@ -1430,14 +1443,17 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_
[ ... ]
> - printf("|%11.3f ms |%9" PRIu64 " | avg:%8.3f ms | max:%8.3f ms | max start: %12s s | max end: %12s s\n",
> - (double)work_list->total_runtime / NSEC_PER_MSEC,
> - work_list->nb_atoms, (double)avg / NSEC_PER_MSEC,
> - (double)work_list->max_lat / NSEC_PER_MSEC,
> - max_lat_start, max_lat_end);
> + printf("|%14s |%9" PRIu64 " | avg:%11s | max:%11s | max start: %12s s | max end: %12s s\n",
> + runtime_lat,
> + work_list->nb_atoms, avg_lat, max_lat,
> + max_lat_start, max_lat_end);
[Severity: Low]
Does this format change cause the data columns to misalign with the table
headers during output?
The updated data row format specifiers " avg:%11s " and " max:%11s " expand
to exactly 16 characters each (1 space, 4 chars for the prefix, and 11 chars
for the string).
In the old format, " avg:%8.3f ms " expanded to 17 characters, which
perfectly matched the 17-character width of the corresponding table headers
shown below.
[ ... ]
> @@ -3612,7 +3629,7 @@ static int perf_sched__lat(struct perf_sched *sched)
[ ... ]
> printf("\n -------------------------------------------------------------------------------------------------------------------------------------------\n");
> - printf(" Task | Runtime ms | Count | Avg delay ms | Max delay ms | Max delay start | Max delay end |\n");
> + printf(" Task | Runtime | Count | Avg delay | Max delay | Max delay start | Max delay end |\n");
Because the "Avg delay" and "Max delay" header columns are 17 characters
wide (" Avg delay " and " Max delay "), shrinking the data row
columns by 1 character each will shift the subsequent data columns leftward,
breaking vertical alignment.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260726032533.712462-1-atomlin@atomlin.com?part=2
next prev parent reply other threads:[~2026-07-26 3:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 3:25 [PATCH v3 0/3] perf sched latency: Refine outputs, unit scaling, and histogram support Aaron Tomlin
2026-07-26 3:25 ` [PATCH v3 1/3] perf sched: Suppress latency table output when trace samples are missing Aaron Tomlin
2026-07-26 3:37 ` sashiko-bot
2026-07-26 3:25 ` [PATCH v3 2/3] perf sched latency: Auto-scale latency and runtime display units Aaron Tomlin
2026-07-26 3:33 ` sashiko-bot [this message]
2026-07-26 3:25 ` [PATCH v3 3/3] perf sched latency: Add histogram and time interval options Aaron Tomlin
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=20260726033343.6A31A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=atomlin@atomlin.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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