From: sashiko-bot@kernel.org
To: "Thomas Falcon" <thomas.falcon@intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v11 3/6] perf header: Support memory ranges
Date: Wed, 23 Sep 2026 16:10:43 +0000 [thread overview]
Message-ID: <20260923161043.95C171F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923155703.34814-4-thomas.falcon@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] perf header: contradictory error message for MAX_MEMORY_RANGES bounds check
--
commit 85df312c747d8e803c10425e475af0b3a2dc6e55
Author: Thomas Falcon <thomas.falcon@intel.com>
perf header: Support memory ranges
This commit adds support for tracking and storing memory range data from
ACPI MRRM tables into the perf data file header. It reads the data from
sysfs and exposes it to userspace tools via a new feature bit.
Link: https://lore.kernel.org/lkml/20250505173819.419271-1-tony.luck@intel.com/
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index ec2935c0ed04e..38f2da9de5f0d 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
[ ... ]
> +static int process_memory_ranges(struct feat_fd *ff, void *data __maybe_unused)
> +{
> + struct perf_env *env = &ff->ph->env;
> + struct memory_range *ranges, *r;
> + u32 nr_memory_ranges, i;
[ ... ]
> + /*
> + * According to version 1.1 of the ACPI MRRM table, the maximum
> + * number of memory regions can be at most 255. Do a sanity check
> + * here to guard against a malformed perf.data file.
> + */
> + if (nr_memory_ranges >= MAX_MEMORY_RANGES) {
> + pr_err("Invalid memory_ranges: nr_memory_ranges (%u) > %u\n",
> + nr_memory_ranges, MAX_MEMORY_RANGES);
[Severity: Low]
Does this error message accurately reflect the bounds check? If a malformed
perf.data file contains exactly MAX_MEMORY_RANGES (256) memory ranges, the
check will reject the file but the log will confusingly print that 256 > 256.
> + return -1;
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260923155703.34814-1-thomas.falcon@intel.com?part=3
next prev parent reply other threads:[~2026-09-23 16:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 15:56 [PATCH v11 0/6] perf: Add support for memory region/range reporting Thomas Falcon
2026-09-23 15:56 ` [PATCH v11 1/6] perf mem: Fix size tracking for mem_lvl's in perf_script__meminfo_scnprintf() Thomas Falcon
2026-09-23 16:05 ` sashiko-bot
2026-09-23 15:56 ` [PATCH v11 2/6] perf mem: Add support for printing PERF_MEM_LVLNUM_L0 Thomas Falcon
2026-09-23 16:13 ` sashiko-bot
2026-09-23 15:57 ` [PATCH v11 3/6] perf header: Support memory ranges Thomas Falcon
2026-09-23 16:10 ` sashiko-bot [this message]
2026-09-23 17:08 ` [PATCH v12 0/6] perf: Add support for memory region/range reporting Thomas Falcon
2026-09-23 17:08 ` [PATCH v12 1/6] perf mem: Fix size tracking for mem_lvl's in perf_script__meminfo_scnprintf() Thomas Falcon
2026-09-23 17:17 ` sashiko-bot
2026-09-23 17:08 ` [PATCH v12 2/6] perf mem: Add support for printing PERF_MEM_LVLNUM_L0 Thomas Falcon
2026-09-23 17:16 ` sashiko-bot
2026-09-23 17:09 ` [PATCH v12 3/6] perf header: Support memory ranges Thomas Falcon
2026-09-23 17:18 ` sashiko-bot
2026-09-23 17:09 ` [PATCH v12 4/6] perf tools: Show memory region in perf-c2c subcommand Thomas Falcon
2026-09-23 17:17 ` sashiko-bot
2026-09-24 0:23 ` Mi, Dapeng
2026-09-24 17:28 ` Arnaldo Carvalho de Melo
2026-09-24 17:29 ` Arnaldo Carvalho de Melo
2026-09-23 17:09 ` [PATCH v12 5/6] perf tools: Show memory region in perf-script subcommand Thomas Falcon
2026-09-23 17:22 ` sashiko-bot
2026-09-23 17:09 ` [PATCH v12 6/6] perf c2c: print memory region data with stdio output Thomas Falcon
2026-09-23 17:18 ` sashiko-bot
2026-09-24 17:35 ` [PATCH v12 0/6] perf: Add support for memory region/range reporting Arnaldo Carvalho de Melo
2026-09-23 15:57 ` [PATCH v11 4/6] perf tools: Show memory region in perf-c2c subcommand Thomas Falcon
2026-09-23 16:04 ` sashiko-bot
2026-09-23 15:57 ` [PATCH v11 5/6] perf tools: Show memory region in perf-script subcommand Thomas Falcon
2026-09-23 16:07 ` sashiko-bot
2026-09-23 15:57 ` [PATCH v11 6/6] perf c2c: print memory region data with stdio output Thomas Falcon
2026-09-23 16:05 ` sashiko-bot
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=20260923161043.95C171F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=thomas.falcon@intel.com \
/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