All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leo Yan" <leo.yan@arm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 4/7] perf synthetic-events: Split oversized thread maps into records
Date: Fri, 04 Dec 2026 12:15:08 +0000	[thread overview]
Message-ID: <sashiko-outbox-249772@kernel.org> (raw)
In-Reply-To: <20261204-perf_fix_large_threads-v2-4-a6c077f3037d@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] perf: PERF_RECORD_MISC_THREAD_MAP_MORE collides with
  CPUMODE_MASK
--

commit ae292c402320802a8fd8c7199764b2c5af7b2533
Author: Leo Yan <leo.yan@arm.com>

perf synthetic-events: Split oversized thread maps into records

This commit splits oversized thread maps into multiple
PERF_RECORD_THREAD_MAP records that fit within the 16-bit header.size
limit, using a new PERF_RECORD_MISC_THREAD_MAP_MORE flag in header.misc
to mark continuation records.

> diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h
> index fdced574c889e..1785fea2873e4 100644
> --- a/tools/lib/perf/include/perf/event.h
> +++ b/tools/lib/perf/include/perf/event.h
> @@ -406,6 +406,14 @@ struct perf_record_thread_map_entry {
>  	char			 comm[16];
>  };
>  
> +/*
> + * PERF_RECORD_MISC_THREAD_MAP_MORE means another THREAD_MAP record follows
> + * for the same map. A clear bit marks the final record.
> + * Each nr counts only that record's entries; concatenate records in order.
> + * A map fitting in one record has the bit clear.
> + */
> +#define PERF_RECORD_MISC_THREAD_MAP_MORE (1U << 0)

[Severity: Low]
Does defining PERF_RECORD_MISC_THREAD_MAP_MORE as (1U << 0) collide with
PERF_RECORD_MISC_CPUMODE_MASK?

tools/include/uapi/linux/perf_event.h reserves bits 0-2 of header.misc
for PERF_RECORD_MISC_CPUMODE_MASK, with (1 << 0) being
PERF_RECORD_MISC_KERNEL.  Generic perf.data parsers decoding cpumode
will misclassify continuation thread-map records as kernel-mode events.

Other flags in this header (PERF_RECORD_MISC_LOST_SAMPLES_BPF and
PERF_RECORD_MISC_BUILD_ID_SIZE) use (1 << 15) to stay outside the cpumode
mask; moving this flag before it becomes on-disk ABI would avoid that.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-perf_fix_large_threads-v2-0-a6c077f3037d@arm.com?part=4

  reply	other threads:[~2026-12-04 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 11:23 [PATCH v2 0/7] perf: Support thread maps larger than one record Leo Yan
2026-12-04 11:23 ` [PATCH v2 1/7] perf stat: Release aggregation maps on report exit Leo Yan
2026-12-04 11:23 ` [PATCH v2 2/7] perf stat: Drop CPU and thread map references " Leo Yan
2026-12-04 11:23 ` [PATCH v2 3/7] perf stat: Release the initial evlist before opening the session Leo Yan
2026-12-04 11:23 ` [PATCH v2 4/7] perf synthetic-events: Split oversized thread maps into records Leo Yan
2026-12-04 12:15   ` sashiko-bot [this message]
2026-12-04 12:31     ` Leo Yan
2026-12-04 11:23 ` [PATCH v2 5/7] perf: Assemble split thread maps in script and stat report Leo Yan
2026-12-04 12:39   ` sashiko-bot
2026-12-04 11:23 ` [PATCH v2 6/7] perf test: Cover multi-record thread map synthesis Leo Yan
2026-12-04 13:22   ` sashiko-bot
2026-12-04 11:23 ` [PATCH v2 7/7] perf docs: Describe multi-record thread maps Leo Yan
2026-12-04 13:22 ` [PATCH v2 0/7] perf: Support thread maps larger than one record 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=sashiko-outbox-249772@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leo.yan@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.