All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Aaron Tomlin" <atomlin@atomlin.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v9 4/4] perf sched latency: Add histogram and time interval options
Date: Thu, 06 Aug 2026 15:52:59 +0000	[thread overview]
Message-ID: <20260806155300.6C49D1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260806153926.300499-5-atomlin@atomlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing explicit POSIX libc header inclusions for musl compatibility.
--

--- Patch [4]: [PATCH v9 4/4] perf sched latency: Add histogram and time interval options ---
commit 045c1ada1f2d7eef344279deacd80eabe1267dcc
Author: Aaron Tomlin <atomlin@atomlin.com>
Subject: perf sched latency: Add histogram and time interval options

This commit adds --histogram, --hist-mode, and --time options to the
perf sched latency command. These options provide a visual ASCII bar chart
distribution of how long tasks waited for CPU runtime across latency
buckets within a specific time interval.

> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c

[ ... ]

> @@ -257,6 +324,59 @@ static int scnprintf_latency_unit(char *buf, size_t size, u64 nsecs)
>  	return scnprintf(buf, size, "%6.3f s ", (double)nsecs / NSEC_PER_SEC);
>  }
>  
> +static int latency_bucket(struct perf_sched *sched, u64 delta_ns)

[ ... ]

> +static void print_latency_histogram(struct perf_sched *sched, u64 *hist,
> +				    u64 total_count, const char *title)
> +{
> +	const char **bucket_names = (sched->hist_mode == HIST_MODE_LINEAR) ?
> +		linear_bucket_names : lat_bucket_names;
> +	int bar_total = 40;
> +	char bar[] = "########################################";
> +	int i;
> +
> +	if (total_count == 0)
> +		return;
> +
> +	printf("\n %s (total samples: %" PRIu64 ")\n", title, total_count);

[Severity: Low]
Does this file explicitly include <stdio.h>? The patch introduces new calls
to printf() in print_latency_histogram(), which can cause musl libc builds
to fail due to missing declarations if the file relies on implicit header
inclusions.

[ ... ]

> @@ -3649,6 +3803,24 @@ static int perf_sched__lat(struct perf_sched *sched)
>  
>  	setup_pager();
>  
> +	if (sched->hist_mode_str) {
> +		sched->show_histogram = true;
> +		if (!strcmp(sched->hist_mode_str, "linear"))

[Severity: Low]
Are we sure <string.h> is explicitly included? This introduces a new use
of strcmp() in perf_sched__lat(), which has similar musl compatibility
requirements for explicit POSIX header inclusions.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260806153926.300499-1-atomlin@atomlin.com?part=4

  reply	other threads:[~2026-08-06 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 15:39 [PATCH v9 0/4] perf sched latency: Refine outputs, unit scaling, and histogram support Aaron Tomlin
2026-08-06 15:39 ` [PATCH v9 1/4] perf sched: Suppress latency table output when trace samples are missing Aaron Tomlin
2026-08-06 15:39 ` [PATCH v9 2/4] perf sched: Handle missing trace samples in pipe mode Aaron Tomlin
2026-08-06 15:39 ` [PATCH v9 3/4] perf sched latency: Auto-scale latency and runtime display units Aaron Tomlin
2026-08-06 15:39 ` [PATCH v9 4/4] perf sched latency: Add histogram and time interval options Aaron Tomlin
2026-08-06 15:52   ` sashiko-bot [this message]
2026-08-07 23:52 ` [PATCH v9 0/4] perf sched latency: Refine outputs, unit scaling, and histogram support Namhyung Kim
2026-08-11 12:10   ` 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=20260806155300.6C49D1F00A3A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.