From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796037729; b=eN6wN1H+Ymf1D96ab3cRXxa2csiarijrezF0gJzGEoj4vPYOAVVVMpp8UH9xFUVpVLxp aUtTGH6DQAkmB0Bwjvjd9OR/rR21VzOGbAxxAXp49oeefLzHlsZ1FFEVgviTCtrm1PTu/ W2XCxOTCtXcSFdQN7OZJiWos3yuSRmlmC8p/W3OaPEeoRHiqJfMspqW9iBTFBGUS9SaSj xHDqcCGdIsUUO5Vo6/Vey7lgbuU+Uf2jmntZIbkbuHcUBfQv2+qKhk2NYZIIufyMC6Jjj CVb6XCiBvb224CSrKLriwnqwTXniOqH3WZfIwf9y4hfhjl9VACIRGf/iBT+7Tnz97cw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796037729; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=1KE6EFvuc0uTwHVx4pU6CsfiClzeAkR5pLWXsi1CKqE=; b=juuFxagVdF2X2sgsaLeb7DeCzGYSQj44m3pU+Iy4wBFlqlBHVGJcC8D/qe/4LZjO+mg6 O3tcsp8JVOkJMAT6ehQx3KiUnJtPFBs8mwEDnv1DrsLLOkbTdPYvPTygdtP2hXN0CwB9r usrRe+rBqKZrbH5ycM1nFR+tU5PtXDih40nJjdgo5o+z4WV6MjGPhfS5EIQBpmvHwie/9 qbjNjAqLm5VwMS+OZ7cNe1BVbmoiQfcdefxMbDSZvJsTU+LVeHM8007T+yzH4mBU/M924 Shn7jB5GG0dhatfOx6fY8lGldy+sCibnzPEpp7sGQVdkhrYdQKxl39VYEzaVCSoSaOQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=FgTROfW8; arc=none smtp.remote-ip=209.85.221.52 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C68E606A32D for ; Mon, 30 Nov 2026 11:22:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1C68E606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=FgTROfW8 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-49412eb1474so6883532f8f.3 for ; Mon, 30 Nov 2026 03:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796037727; x=1796642527; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1KE6EFvuc0uTwHVx4pU6CsfiClzeAkR5pLWXsi1CKqE=; b=FgTROfW8Uu38apJga2Cunht+RzqcFZoPtFk9bIACSD9A+tY2RZHeh9t5fITyNVn8GX 83geCEEV1EEYa+pkjURjDP0Mol+jAuf5vADKWoxfPKKuQJZXilONFGLktKw87XNmelmB e52aVbpYZSZ2OV2COGDxJM0uSDZ4ZyPmX09R3KxiRj0xtThGOKrnpU9WWPNg3UheSJnj GZajdSsJx72QakelYm/Xdkj2brIVY1HOpeYHApa6pq/+m081Opb4Jvhj7XG1sGpV882P A/GFdPQ2dbOdBFXY7Uq2Ynq1PqCFIAT9y4EdxtmGSqbkTSdpK2cjyMP+xdj6zz7MdO5m i8fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796037727; x=1796642527; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1KE6EFvuc0uTwHVx4pU6CsfiClzeAkR5pLWXsi1CKqE=; b=mAq+RXVYC6zsCAkaOt6TWkz3bR6nrp8zwd/o8YB55B643u373cJWwk8l9+s3L2GNwP snGA3GptNPRQ6t5MjAhmVFhN+OKXFotpel2k3ZggAix003ms0pEkMfz1VeStzx0FxhkL ltXi1jk9IrziTqTFEyigQoruMpsBPvbfPnwC3fy0Ap+weiLyPyuIxv2FUZsoKVbmZ4AR xjwqbUZdzBfMr8RPHru9RMolZV0pv5BqJC3spCAxHIq9tLZqhi8Aoe/HPshyU7isVDA3 wByMmA1FSac+EDh0Wz6tnb0wyKZjmAeJvGB2msuRdKi54Eu92l06cyMT+2+H6j3q7G39 5SLw== X-Forwarded-Encrypted: i=1; AL+hErGqgAdZhGnE+TdndLOfYqaTbJtx2m0LPROaPgFiKWqcGy0L8Fp6BlPlwHBsiOfGSdrO0tAN/wjpxH/BxUo=@vger.kernel.org X-Gm-Message-State: APuU4Z+jpdw4sQOC4karGqVx4oirw38ft0hcqvUuNvRNZb45bflmUF+i 7RgCD+klUYvcDlb8RLhQL/Cqh/AbTaaiBXo+feqD75LdufGUv8pnwYE6olzzAE3IftQ= X-Gm-Gg: AZFdTZcWdueEAzhALkbs1R7sbLT4wjlmQJ9xxaZQ4pP3eRM8QUP1o03kZhvraoAQKnl 6uVdvEPBoLr2xX5FeAwemUb03iXHpW3Bx/V/SuzK6L+rZHdrFijvpngAB1eFfvmeQlFlpmmMefe 6xZkLB1I/MTJzOM56r/Djl9fLWdR52fCXulDcbu+9sLb7GgRr+vHvMHKt7kHOAmvoEfxxDzhGls micoJJOmxS9dNqN0pMFv7YuToPDv93yFsiEo2KEd71Vt57dx83ZGGVGT6MacvilMy2+2f0s2XQU QY/RpepgX58Vq0HK2C1o8ZA7+bH/N/RqjsVsyYZlOL8xQqeoVY2w4NHC6RGDHEg1Lg+b8m1qCSX jezb3Epmk6m41CwLdOzeuleA1Tw2trUNMGN0X/jln1iU5CeUolZQVqZZqNoUqPGaUqJW4y2GBTq 1huKoDfhv2RUubAVnG+s0/nkkcpm+RLR6+93QxanQAbm7MJI/ILzPUMhYCV2HmmiRYTYK7pk80m 4gOpCTg+k0MstqnINuamzcyjKwafwkvG6HhN63PHxCAeeKW/2EzHq85LNAOx+dirlD7lyOerNu0 3elfJvzAjUnmIR1xiMUOTQXs20zOo0U8jg== X-Received: by 2002:a05:6000:2602:b0:48d:f470:6b3e with SMTP id ffacd0b85a97d-4abb3b42d6amr64477268f8f.13.1796037727416; Mon, 30 Nov 2026 03:22:07 -0800 (PST) Received: from [192.168.1.3] ([37.18.141.193]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b205443sm67591479f8f.39.2026.11.30.03.22.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 03:22:07 -0800 (PST) Message-ID: <31d251e4-47d9-41ea-9e67-b75f38fa8ac7@linaro.org> Date: Mon, 30 Nov 2026 11:22:06 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 00/10] perf jevents: Block-indexed string compression and default JEVENTS_ARCH=all To: Ian Rogers Cc: Jiri Olsa , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim References: <20261116070038.2968725-1-irogers@google.com> Content-Language: en-US From: James Clark In-Reply-To: <20261116070038.2968725-1-irogers@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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