Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thomas Falcon" <thomas.falcon@intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 3/6] perf header: Support memory ranges
Date: Fri, 21 Aug 2026 00:28:01 +0000	[thread overview]
Message-ID: <20260821002802.1483F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260821001819.162277-4-thomas.falcon@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing explicit header inclusion for <fcntl.h> when using POSIX constants (O_RDONLY, O_DIRECTORY) and functions (open, openat) in tools/perf/util/header.c.
--

--- Patch [3]: [PATCH v5 3/6] perf header: Support memory ranges ---
commit 3413492c0a2a11d41de6c16475e806b307c1b825
Author: Thomas Falcon <thomas.falcon@intel.com>

perf header: Support memory ranges

This commit adds support for reading memory range data from the ACPI MRRM
table exposed via sysfs. It saves this data in the perf data file header
under a new feature bit, HEADER_MEMORY_RANGES, and adds support to print it.

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 091d8f7f6bd2c..a81a0f42bb0f9 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
[ ... ]
> @@ -1891,6 +1892,132 @@ static int write_cpu_domain_info(struct feat_fd *ff,
>  	return ret;
>  }
>  
> +static int memory_range__read(struct memory_range *range, const char *path)
> +{
> +	char buf[32];
> +	ssize_t n;
> +	int dfd, fd, tmp, ret = -1;
> +
> +	dfd = open(path, O_RDONLY | O_DIRECTORY);
> +	if (dfd < 0)
> +		return -1;
> +
> +#define _R(name, dst, conv)			\
> +	fd = openat(dfd, name, O_RDONLY);	\

[Severity: Medium]
Will this compile successfully on systems using musl libc?

The code introduces usage of POSIX functions and constants such as open,
openat, O_RDONLY, and O_DIRECTORY without explicitly including <fcntl.h>.

While glibc often implicitly includes these dependencies through other headers,
musl strictly separates declarations. This missing include could lead to build
failures in musl environments.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821001819.162277-1-thomas.falcon@intel.com?part=3

  reply	other threads:[~2026-08-21  0:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  0:18 [PATCH v5 0/6] perf: Add support for memory region/range reporting Thomas Falcon
2026-08-21  0:18 ` [PATCH v5 1/6] perf mem: Fix size tracking for mem_lvl's in perf_script__meminfo_scnprintf() Thomas Falcon
2026-08-21  0:29   ` sashiko-bot
2026-08-21  0:18 ` [PATCH v5 2/6] perf mem: Add support for printing PERF_MEM_LVLNUM_L0 Thomas Falcon
2026-08-21  0:27   ` sashiko-bot
2026-08-21  0:18 ` [PATCH v5 3/6] perf header: Support memory ranges Thomas Falcon
2026-08-21  0:28   ` sashiko-bot [this message]
2026-08-21  0:18 ` [PATCH v5 4/6] perf tools: Show memory region in perf-c2c subcommand Thomas Falcon
2026-08-21  0:30   ` sashiko-bot
2026-08-21  0:18 ` [PATCH v5 5/6] perf tools: Show memory region in perf-script subcommand Thomas Falcon
2026-08-21  0:32   ` sashiko-bot
2026-08-21  0:18 ` [PATCH v5 6/6] perf c2c: print memory region data with stdio output Thomas Falcon
2026-08-21  0:28   ` 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=20260821002802.1483F1F000E9@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