Re: [PATCH v3 1/8] perf sched stats: Add record and rawdump support

Markus Elfring
2025-03-11T16:20:38Z

…
> +++ b/tools/perf/util/event.c
…
> +size_t perf_event__fprintf_schedstat_cpu(union perf_event *event, FILE *fp)
> +{
…
> + size_t size = 0;
> +
> + size = fprintf(fp, "\ncpu%u ", cs->cpu);

I find an other code variant more succinct.

+ size_t size = fprintf(fp, "\ncpu%u ", cs->cpu);

Would you like to care for more complete error detection and corresponding
exception handling?
https://cwe.mitre.org/data/definitions/252.html

Regards,
Markus