Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing explicit inclusion of `<stdio.h>` for `FILE` and `fprintf` usage, violating strict musl libc compilation guide.
--
--- Patch [6]: [PATCH v5 6/6] perf c2c: print memory region data with stdio output ---
commit f16f316fde0a57c797db59281b9604cd432a9c29
Author: Thomas Falcon <[email protected]>
perf c2c: print memory region data with stdio output
This commit adds functionality to print memory range data in the perf-c2c
subcommand when running in stdio mode. If memory ranges are not present
or supported, it skips printing them.
> diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> index 653b195f3c376..e774967052cca 100644
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -2636,6 +2636,34 @@ static void print_c2c_info(FILE *out, struct perf_session *session)
> fprintf(out, " Cacheline data grouping : %s\n", c2c.cl_sort);
> }
>
> +
> +static void print_memory_ranges_info(FILE *out, struct perf_session *session)
> +{
> + struct perf_env *env = perf_session__env(session);
> + int nr_ranges = 0;
> +
> + if (!perf_header__has_feat(&session->header, HEADER_MEMORY_RANGES))
> + return;
> + nr_ranges = env->nr_memory_ranges;
> + if (nr_ranges == 0) {
> + pr_debug("No memory ranges found, skipping\n");
> + return;
> + }
> +
> + fprintf(out, "\n");
[Severity: Low]
Does this file need an explicit include for <stdio.h>?
The new print_memory_ranges_info() function uses FILE and fprintf(). The perf
subsystem guidelines note that files using libc types or functions should
directly include the POSIX headers declaring them to prevent build failures
on musl libc systems due to strict namespace separation.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.