Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 1/8] perf event: Factor build_id out into its own top-level struct
Date: Sat, 03 Oct 2026 01:33:21 +0000	[thread overview]
Message-ID: <20261003013321.89BF91F00898@smtp.kernel.org> (raw)
In-Reply-To: <20261002173848.3228217-2-irogers@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] perf/libperf: API breakage in perf_record_mmap2 due to renamed fields
--

commit cfeda23f684f7f8aa6b272dc2febc41f9f8eb93c
Author: Ian Rogers <irogers@google.com>

perf event: Factor build_id out into its own top-level struct
    
This commit factors the build ID structure out into its own top-level type,
struct perf_build_id, for consistency. It updates the usage of build IDs
across various perf events to use this new type.

> diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h
> index fdced574c889e..173eab43c1484 100644
> --- a/tools/lib/perf/include/perf/event.h
> +++ b/tools/lib/perf/include/perf/event.h

[ ... ]

> @@ -39,12 +48,7 @@ struct perf_record_mmap2 {
>  			__u64	 ino;
>  			__u64	 ino_generation;
>  		};
> -		struct {
> -			__u8	 build_id_size;
> -			__u8	 __reserved_1;
> -			__u16	 __reserved_2;
> -			__u8	 build_id[20];
> -		};
> +		struct perf_build_id build_id;

[Severity: High]
Does this break the source-level API for external libperf consumers?

External user-space applications (like bpftool, pahole, or custom perf data
parsers) that rely on event->mmap2.build_id_size or treat
event->mmap2.build_id as a byte array will fail to compile against the
updated libperf headers.

While this preserves the binary ABI since the memory layout is exactly 24
bytes in both cases, the renamed fields and altered types will break the
API for existing libperf users. Could this transition be handled with an
anonymous union to preserve source compatibility during the update?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261002173848.3228217-1-irogers@google.com?part=1

  reply	other threads:[~2026-10-03  1:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24  6:19 [PATCH v1 0/5] perf: Default use of build IDs and improvements Ian Rogers
2025-04-24  6:19 ` [PATCH v1 1/5] perf build-id: Reduce size of "size" variable Ian Rogers
2025-04-24  6:19 ` [PATCH v1 2/5] perf build-id: Truncate to avoid overflowing the build_id data Ian Rogers
2025-04-24  6:19 ` [PATCH v1 3/5] perf build-id: Change sprintf functions to snprintf Ian Rogers
2025-04-24  6:19 ` [PATCH v1 4/5] perf dso: Move build_id to dso_id Ian Rogers
2025-04-24  6:19 ` [PATCH v1 5/5] perf record: Make --buildid-mmap the default Ian Rogers
2025-04-24  7:20   ` Ian Rogers
2025-04-25 14:45     ` Arnaldo Carvalho de Melo
2025-04-25 14:59       ` Arnaldo Carvalho de Melo
2025-04-25 16:03       ` Ian Rogers
2026-10-02 17:38 ` [PATCH v2 0/8] perf/core, perf/tools: Add PERF_SAMPLE_BUILD_ID_OFFSET support Ian Rogers
2026-10-02 17:38   ` [PATCH v2 1/8] perf event: Factor build_id out into its own top-level struct Ian Rogers
2026-10-03  1:33     ` sashiko-bot [this message]
2026-10-02 17:38   ` [PATCH v2 2/8] perf/core: Add BUILD_ID_OFFSET to UAPI Ian Rogers
2026-10-03  1:33     ` sashiko-bot
2026-10-02 17:38   ` [PATCH v2 3/8] perf/core: Implement BUILD_ID_OFFSET sample type Ian Rogers
2026-10-03  1:33     ` sashiko-bot
2026-10-02 17:38   ` [PATCH v2 4/8] perf: Refactor thread map and symbol APIs to take perf_sample Ian Rogers
2026-10-03  1:33     ` sashiko-bot
2026-10-02 17:38   ` [PATCH v2 5/8] perf tools: Internal support for BUILD_ID_OFFSET Ian Rogers
2026-10-03  1:33     ` sashiko-bot
2026-10-02 17:38   ` [PATCH v2 6/8] perf inject: Extend perf inject to support bid_offset conversion Ian Rogers
2026-10-03  1:33     ` sashiko-bot
2026-10-02 17:38   ` [PATCH v2 7/8] perf record: Add --buildid-offset option Ian Rogers
2026-10-03  1:33     ` sashiko-bot
2026-10-02 17:38   ` [PATCH v2 8/8] perf tests: Add build_id_offset test coverage Ian Rogers
2026-10-03  1:33     ` 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=20261003013321.89BF91F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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