Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796037730; b=nbMN9NfDTJ+hp4tP0r9IWIo7TZAQmWBphdmYJ/WtQKIKv74VzweKJ0PZTdj08xOnIZOC ZZoPb6NFc/ZxeEprOXHb7RIdKfxj06JkB7dnpDii0KDWKSdOfhsuqXYpcCaYDqZ7IKVKU 63iY5yVUh3GqlbX0Q+0aNpUOxS+UzLn7OoPw+N6Tci6coFMleSLz2wZKgYM2Yx/VLqF9E cwKkUD2feEzcgqFMWyPdRNccpOch5M09lHGKh5+iOj5vVwLM2W3verM19uHDcbHuNiryB GXj6cIFNvoiu0WyV7gCQp88GMTzHkq1eb0iHLThMRGnGXKBoC/HU88sfbTCz3JeYoEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796037730; 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=y4zE6C+v89kd6JCUwCXLOlkyTYbzUvJoite2yOGwvatozzojfQaBQXSz7qkmr8RvMuXI L8ftfBwo6toLqhT5T89NLEzj7EUWviYuAlRs8gwDByz/wSNDiyeDJPY6LphjgfvdbBPDv lXVgRaRd186FRPg/Dg7iZjSFroYh0FGfbN/MlMJbct/18CdMApA+SQYZ2Gtk/wx7q4RGX 7VeU2BYqaqRUmyD4+ammhHM4j6yjhdfl1bODH5b2n9QGo7iqDJ/nxYu5dQZe4piWiTAWh mR3DcBnPAncbLbhb13vL06UmftYqQQbQ34pXhOKdX+5CZq1j3sY+C8lFoZRTQmJ5s9Q== 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.49 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 1E35B606A32E for ; Mon, 30 Nov 2026 11:22:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1E35B606A32E 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) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=FgTROfW8 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-4a3e706b5dfso6549550f8f.2 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=z0MF6DP2F6lQI+89spQKx1XPZ+MiIUFidnY8AB9AqWhpuqo5CKk/ULfdiQiu/g38mA IdW8fVPww83awpDC9Q3Ag1RZ7OU4dhig3XSGJFQJqlyBhq8617QXzUfzRryjPCbokzpc wChL3quohtEqSg8YCrGCnGx0G6/lwk2vqq5HUjszobZ4LUPM6/bWt0jYcooCTuvAYnKD YVO6E3OrgKFd7Iilyd+rxkN3F5awngh9ugiz+j07hQ4QZRtvO6uAbIay6eePRmgJVwcV CwtiZTvsbIoSko5j6/Ygg7eVPqaeh2dDEGp06QnO9uYUsKTrV9XQbnViOWWbppbdQpCP ErnA== X-Forwarded-Encrypted: i=1; AL+hErFRrRUb5rPLvhsUHQWVeV6eZs0Qj262eUuAa5ku514LDRX8R3jALkqsT5HCE/okmA9Mhk8AI+kg5KZ5cp+zjpTt@vger.kernel.org X-Gm-Message-State: APuU4Z9lqUFFe+lS4kKo3DwFktXPmiC2rXeAiKxRDkk29xpBz2gxJpkh RHvsBtppo12DEs2H5XPj4lFdvx2ePGVkwR7ZuukNYEfbmFXhbOlzitphTWC58bwYxbk= X-Gm-Gg: AZFdTZcv2T+txl+YwPrDG0WCAjnfsDtXRnFNZ39sa1zqfSzxFVBakIYAaixqATUbvCc 19anh//v/I6Ycp23M5kj+dPaa4cMOLg7kTr4t6khgwy5bcemmOpUWuDZWr2jF6eKpGSX8n9hQeC VG2Y3ydlFx42btTdaWQkksMoZvDRZfezYzeZhofp+cBW4NBc1KU6UGTnddZkxrVKamDVll8s41V W1g5l5S6iAa69ihsgNx4KuFnf5EekczXlJr2gawgEbfoTa27OgZ70f2GROemfDknlhikVLZVqnT FG5xq3hl201DOjKuZPOOjWzXKgImVvEg3iA9szVg5BHATitEhF+TmHxlhsLYZy2Zd1b00NwHIBW DrZ+M0vY9OjQUTmZo6Fg/z1/fDitKMwW6J9GlWi2bpE0qwiWqdMBSMtcUt0GzMsFpSMbZUvmaLF DXyTdEBlWXU+lp5mQEZkbhK0Bm6J09+ulpfcoWq4pheG+h/6j2nAkyi7IVtORF9n3FuTXDblQKs Q1/ACA6lGvs39tXLN/sR/8gdG2SIYNWZD0j6tGBF3NIY55NgyXykLX388TX4J5oe9GzPcmN/hom kpaEdp+A5KbImqdLe9bOv3A3lps6Cv2CKA== 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-perf-users@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