Re: [PATCH v7 2/4] perf sched: Handle missing trace samples in pipe mode
[email protected] Sun, 02 Aug 2026 21:29:36 +0000
| Newsgroups | org.kernel.vger.linux-perf-users |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Missing explicit `<string.h>` inclusion for `strcmp()`, violating musl compatibility guidelines. -- --- Patch [2]: [PATCH v7 2/4] perf sched: Handle missing trace samples in pipe mode --- commit 204b30b0b1a2539fa7ad4c2b18b98020812488df Author: Aaron Tomlin <[email protected]> perf sched: Handle missing trace samples in pipe mode This commit improves the handling of missing trace samples when perf is running in pipe mode. It dynamically registers missing callbacks, moves the trace handlers array to file-scope, and dynamically assigns handlers. > diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c > index 94a323da0799a..232e72537df36 100644 > --- a/tools/perf/builtin-sched.c > +++ b/tools/perf/builtin-sched.c [ ... ] > @@ -1946,7 +1962,22 @@ 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)) { > + if (!strcmp(latency_handlers[i].name, "sched:sched_wakeup") && ^^^^^^^^ [Severity: Low] Does this file need an explicit #include <string.h>? The perf tools musl compatibility guidelines require all POSIX libc functions like strcmp() to have explicit, direct header inclusions to prevent musl compilation failures, rather than relying on implicit inclusions through other headers. > + sample->evsel->evlist && > + evlist__find_tracepoint_by_name(sample->evsel->evlist, "sched:sched_waking")) > + evsel->handler = process_sched_wakeup_ignore; > + else > + evsel->handler = latency_handlers[i].handler; > + break; > + } > + } > + } -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2