From: James Clark <james.clark@linaro.org>
To: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH v2 00/10] perf jevents: Block-indexed string compression and default JEVENTS_ARCH=all
Date: Mon, 30 Nov 2026 11:22:06 +0000 [thread overview]
Message-ID: <31d251e4-47d9-41ea-9e67-b75f38fa8ac7@linaro.org> (raw)
In-Reply-To: <20261116070038.2968725-1-irogers@google.com>
On 16/11/2026 07:00, Ian Rogers wrote:
> Compiled-in PMU event and metric tables (pmu-events-in.o) currently
> store ~6.9 MiB of uncompressed string data in .rodata on x86 alone,
> causing JEVENTS_ARCH to default to $(SRCARCH) rather than all and
> preventing out-of-the-box cross-architecture perf.data event/metric
> resolution unless explicitly built with JEVENTS_ARCH=all.
>
> Compressing big_c_string as a single whole-table stream would force perf
> to allocate and decompress megabytes of unused CPU models' strings on
> startup just to resolve a single event, whereas compressing individual
> short strings suffers from poor compression ratios and per-string
> framing overhead.
>
> Instead, this series introduces "block-indexed string compression":
> sorted, suffix-folded event and metric byte records are packed into
> ~8 KiB blocks without splitting records across block boundaries, each
> block is compressed independently (sharing a single preset or trained
> dictionary across blocks so ~8 KiB blocks retain high compression
> ratios), and every uint32_t string offset is encoded as
> (block_id << 16) | sub_offset. An ~8 KiB target block size sits at the
> knee of the compression vs. random-access curve (smaller 1-4 KiB blocks
> pay 22-128% more .rodata for per-block entropy headers and index
> entries, while larger 16-64 KiB blocks yield <15% extra savings at 2-8x
> higher decompression and page-fault cost per binary-search probe). At
> runtime, pmu_events__get_string() uses a lock-free atomic block pointer
> cache to decompress only the touched ~8 KiB blocks on demand, leaving
> untouched CPU models' and non-host architectures' blocks compressed in
> .rodata at zero runtime CPU or heap cost.
>
> The series starts with a standalone BigCString raw-byte fix for
> describe_metricgroup() binary-search ordering, prepares the string and
> PMU table layout, adds the zlib, lzma, and zstd block compression
> backends, and switches the default JEVENTS_ARCH to all:
>
Compiling all events makes a stripped binary 6% bigger on Arm with zstd,
but I think it's worth it for easier testing of modifications to the
event generation scripts.
Before: 5.8MB
After: 6.2MB
After with JEVENTS_ARCH=arm64: 5.2MB
Reviewed-by: James Clark <james.clark@linaro.org>
prev parent reply other threads:[~2026-11-30 11:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 7:00 Ian Rogers
2026-11-16 7:00 ` [PATCH v2 01/10] perf jevents: Store raw bytes in BigCString instead of C-escaped strings Ian Rogers
2026-11-16 7:00 ` [PATCH v2 02/10] perf jevents: Sort BigCString entries alphabetically Ian Rogers
2026-11-16 7:00 ` [PATCH v2 03/10] perf jevents: Store PMU names as string literals in struct pmu_table_entry Ian Rogers
2026-11-16 7:00 ` [PATCH v2 04/10] perf jevents: Encapsulate big_c_string lookups behind pmu_events__get_string() Ian Rogers
2026-11-16 7:00 ` [PATCH v2 05/10] perf jevents: Add block-indexed string packing and --compress=zlib Ian Rogers
2026-11-16 7:00 ` [PATCH v2 06/10] perf jevents: Add --compress=lzma block compression backend Ian Rogers
2026-11-16 7:00 ` [PATCH v2 07/10] perf jevents: Add --compress=zstd " Ian Rogers
2026-11-16 7:00 ` [PATCH v2 08/10] perf build: Enable jevents string compression when available Ian Rogers
2026-11-16 7:00 ` [PATCH v2 09/10] perf tests pmu-events: Test metricgroup descriptions and concurrent lookups Ian Rogers
2026-11-16 7:00 ` [PATCH v2 10/10] perf build: Default JEVENTS_ARCH to all Ian Rogers
2026-11-24 21:52 ` [PATCH v2 00/10] perf jevents: Block-indexed string compression and default JEVENTS_ARCH=all Ian Rogers
2026-11-25 17:41 ` Athira Rajeev
2026-11-30 0:37 ` Ian Rogers
2026-11-30 15:18 ` Athira Rajeev
2026-11-30 11:22 ` James Clark [this message]
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=31d251e4-47d9-41ea-9e67-b75f38fa8ac7@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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
all inboxes | Powered by JetHome®