linux-perf-users.vger.kernel.org archive mirror
 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 v8 2/4] perf sched: Handle missing trace samples in pipe mode
Date: Wed, 05 Aug 2026 21:23:55 +0000	[thread overview]
Message-ID: <20260805212356.03A011F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260805210751.287746-3-atomlin@atomlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing explicit inclusion of `<string.h>` for `strcmp`.
--

--- Patch [2]: [PATCH v8 2/4] perf sched: Handle missing trace samples in pipe mode ---
commit 4cf6347760b0dc1a50946397641b493e66cea7c0
Author: Aaron Tomlin <atomlin@atomlin.com>

perf sched: Handle missing trace samples in pipe mode

This commit updates perf sched to properly handle pipe mode streams by
registering missing attributes and dynamically assigning tracepoint handlers
when the evsel handler is uninitialized.

> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 94a323da0799a..d6b4412045e22 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c

[ ... ]

> @@ -1946,7 +1956,23 @@ static int perf_sched__process_tracepoint_sample(const struct perf_tool *tool __
>  	struct evsel *evsel = sample->evsel;
>  	int err = 0;
>  
> -	if (evsel->handler != NULL) {
> +	if (evsel->handler == NULL) {
> +		evsel->handler = process_sched_ignore;
> +		for (size_t i = 0; i < ARRAY_SIZE(latency_handlers); i++) {
> +			if (!evsel__name_is(evsel, latency_handlers[i].name))
> +				continue;
> +
> +			if (!strcmp(latency_handlers[i].name, "sched:sched_wakeup") &&

[Severity: Low]
This isn't a bug, but are we missing an explicit include for <string.h>?

Even if the file previously omitted it, the perf subsystem guidelines
require files using POSIX libc functions like strcmp() to directly include
their respective headers. Relying on implicit inclusions can lead to
compilation failures under musl libc.

> +			    sample->evsel->evlist &&
> +			    evlist__find_tracepoint_by_name(sample->evsel->evlist, "sched:sched_waking"))
> +				break;
> +
> +			evsel->handler = latency_handlers[i].handler;
> +			break;
> +		}
> +	}
> +
> +	if (evsel->handler != process_sched_ignore) {
>  		tracepoint_handler f = evsel->handler;
>  		err = f(tool, sample, machine);
>  	}

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

  reply	other threads:[~2026-08-05 21:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 21:07 [PATCH v8 0/4] perf sched latency: Refine outputs, unit scaling, and histogram support Aaron Tomlin
2026-08-05 21:07 ` [PATCH v8 1/4] perf sched: Suppress latency table output when trace samples are missing Aaron Tomlin
2026-08-05 21:07 ` [PATCH v8 2/4] perf sched: Handle missing trace samples in pipe mode Aaron Tomlin
2026-08-05 21:23   ` sashiko-bot [this message]
2026-08-05 21:07 ` [PATCH v8 3/4] perf sched latency: Auto-scale latency and runtime display units Aaron Tomlin
2026-08-05 21:07 ` [PATCH v8 4/4] perf sched latency: Add histogram and time interval options Aaron Tomlin
2026-08-05 22:02 ` [PATCH v8 0/4] perf sched latency: Refine outputs, unit scaling, and histogram support Ian Rogers
2026-08-06 14:05   ` Aaron Tomlin
2026-08-06  5:04 ` Namhyung Kim

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=20260805212356.03A011F000E9@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;
as well as URLs for NNTP newsgroup(s).