From nobody Sun Feb 8 19:03:09 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D84942A9D for ; Wed, 26 Feb 2025 10:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740566497; cv=none; b=BPpdwPMqXNqtOG/NyxQn+LonJd18uTOAUlfXAAHmOwHYIMlQSjgvV2r1qufcrGhyUBpQZZ7Hv5FNebgNp1jM0Rbdi6UcQyLbP5ktGB2rNVsKRszDxkajb2f+OqILBX8Sa/aOCPUbjDA3V4bJheJobqf3d1TbifjWpYjyGlhH4WA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740566497; c=relaxed/simple; bh=I+I/8/xf34EbwKSApSqeEKtUP8iTESCQ7V0oqUtLUC8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j3JufO0m54wwrKPxkQg6lE3FiORlQje2LTZuYDFmPDchr06GSnp/boqF8BPWLmv0/XLvtpbJuuxC/YoqROWr6783RIFfCamJJ2hXFJ6wmnReDBYZQtoP7Hs6cdbpEPw5IWusUydENgOXVV+lUVzJlcE1k8YfaFNdtatiRE7nwTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hCJC/TyQ; arc=none smtp.client-ip=209.85.221.44 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.b="hCJC/TyQ" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-38f5fc33602so463539f8f.0 for ; Wed, 26 Feb 2025 02:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740566493; x=1741171293; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ojcUEtfO91j+JO9KXm+lQGJj1Y8aR3j+uQwF6xWxzOk=; b=hCJC/TyQGw/rzbRVnbIvHgQNTTQUleZ8aCxLtbJeQAfxU+au2ljZYRF/IkWK3ljUV/ uHEbYUQgJFv4PX7cbe+mgl/iNMFOh/BAhaBRBb5BBtVvTux3wTGkJWydAS8Osc/Jgw+5 UAE2vpIm9k92TbFiTBc0dUBHVCIYjRP1gnsCdIDgd5HC/tuH+q1UeKg8CAiHvSfxxWxb LGJugioIH/XodQBEBOGhxDGDx8RB/jIYJQhl14vD4oMru30JHGrbW01N9U1uZacg+Vsb 6KI/8JtbWYnwLV8o0WrVC4DYCPpHYl45IJ+O01QR9A41o7PFJkThQ5bZQMEHESOpg9od sZpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740566493; x=1741171293; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ojcUEtfO91j+JO9KXm+lQGJj1Y8aR3j+uQwF6xWxzOk=; b=dCoyOPqRi9Wr1dZoONWA1Qj+yi7bOVhHBdK6Qbt/5s3LjKtSNAKfXVWh+7AllCHvCq kmLit5vsNenr2rOUNzn9eImUBWZIiBYRhpXaLXsng8aO0mNO/NQnAvQQV5WXKITLPHhc mSjgB5YdRItnL58TWZPYUgBCkKBc/ip3yHBX7/c+eW372fyNjxFlWYRkB4M1ZX5/I3XS PjNrqXNrsGm/otO3NL2IqyypJrTImHKOrw7MAwAZ0q21c9eQxFDgOJSraeyn09sPCswC JzXITIZ6nmhZhENMiB+sN2mUiQ7PyfZztT9ct1hR0o/mprwJsKjKnv8cHYg3V8C+h6mB fF4A== X-Forwarded-Encrypted: i=1; AJvYcCVVtRux3C0duRhm3gJv6y60bD833Fgq0OOhM2FprMwmtpjaZk+BKBt4ZsmZv8E2dcXVwt/sKNJDlomd6Gc=@vger.kernel.org X-Gm-Message-State: AOJu0YysaHRAkF4QVTWfb1hm+jHobB+eBRJ87BJyHkjxpv+13IqKoVBN IZh2qPPf9pAT+nKYRiT8r0jF18Ze6xt4/cQCBtql8S9UZhOyie5xsbpZxHBi6g8= X-Gm-Gg: ASbGncsky1NgaCq7kE4G6g7tbw6KHSt+01Sk/KPDEIaIN0B2wj2vCUsZ5fL3ob08sVX NRhXPLQ2JqstaOIFlGaSkxQNCTAHAEzwNUnYblKKxmDOlZqQ02kwhwWUBYDX/GeV7csEtF27dEM 32qhUN5g53aRU7wtRb/jgEwfEXtM01JRZQoT83aiqQaZweksd/ry6nKBxtYGtz53L0PnvgprJgm TxnpGODqS7i3C5p857LT7bjmVq6XbXgAhLobhhIOUkglGJgOOaRrf3OQABc30tn8eYsrZXhxRMw vaC++3+0KwFq6q3g/KOEEBvFkXc= X-Google-Smtp-Source: AGHT+IHeEQGMuScqdt+otMxEcTZ0w/KlZkRLRkmqcLWLGizQi7xw1jIAhR1WxzNLVabB3EHEyGVDUA== X-Received: by 2002:a5d:6486:0:b0:38f:2c10:da1e with SMTP id ffacd0b85a97d-38f6f51db8amr15902752f8f.27.1740566493501; Wed, 26 Feb 2025 02:41:33 -0800 (PST) Received: from pop-os.lan ([145.224.66.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm5080832f8f.26.2025.02.26.02.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 02:41:33 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com, namhyung@kernel.org, cyy@cyyself.name Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , Weilin Wang , Yoshihiro Furudera , Greg Kroah-Hartman , Jean-Philippe Romain , Junhao He , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] perf pmu: Dynamically allocate tool PMU Date: Wed, 26 Feb 2025 10:41:00 +0000 Message-Id: <20250226104111.564443-2-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226104111.564443-1-james.clark@linaro.org> References: <20250226104111.564443-1-james.clark@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" perf_pmus__destroy() treats all PMUs as allocated and free's them so we can't have any static PMUs that are added to the PMU lists. Fix it by allocating the tool PMU in the same way as the others. Current users of the tool PMU already use find_pmu() and not perf_pmus__tool_pmu(), so rename the function to add 'new' to avoid it being misused in the future. perf_pmus__fake_pmu() can remain as static as it's not added to the PMU lists. Fixes the following error: $ perf bench internals pmu-scan # Running 'internals/pmu-scan' benchmark: Computing performance of sysfs PMU event scan for 100 times munmap_chunk(): invalid pointer Aborted (core dumped) Fixes: 240505b2d0ad ("perf tool_pmu: Factor tool events into their own PMU") Reviewed-by: Ian Rogers Signed-off-by: James Clark --- tools/perf/util/pmus.c | 2 +- tools/perf/util/tool_pmu.c | 23 +++++++++++------------ tools/perf/util/tool_pmu.h | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c index 8a0a919415d4..6498021acef0 100644 --- a/tools/perf/util/pmus.c +++ b/tools/perf/util/pmus.c @@ -268,7 +268,7 @@ static void pmu_read_sysfs(unsigned int to_read_types) =20 if ((to_read_types & PERF_TOOL_PMU_TYPE_TOOL_MASK) !=3D 0 && (read_pmu_types & PERF_TOOL_PMU_TYPE_TOOL_MASK) =3D=3D 0) { - tool_pmu =3D perf_pmus__tool_pmu(); + tool_pmu =3D tool_pmu__new(); list_add_tail(&tool_pmu->list, &other_pmus); } if ((to_read_types & PERF_TOOL_PMU_TYPE_HWMON_MASK) !=3D 0 && diff --git a/tools/perf/util/tool_pmu.c b/tools/perf/util/tool_pmu.c index 3a68debe7143..9156745ea180 100644 --- a/tools/perf/util/tool_pmu.c +++ b/tools/perf/util/tool_pmu.c @@ -490,17 +490,16 @@ int evsel__tool_pmu_read(struct evsel *evsel, int cpu= _map_idx, int thread) return 0; } =20 -struct perf_pmu *perf_pmus__tool_pmu(void) +struct perf_pmu *tool_pmu__new(void) { - static struct perf_pmu tool =3D { - .name =3D "tool", - .type =3D PERF_PMU_TYPE_TOOL, - .aliases =3D LIST_HEAD_INIT(tool.aliases), - .caps =3D LIST_HEAD_INIT(tool.caps), - .format =3D LIST_HEAD_INIT(tool.format), - }; - if (!tool.events_table) - tool.events_table =3D find_core_events_table("common", "common"); - - return &tool; + struct perf_pmu *tool =3D zalloc(sizeof(struct perf_pmu)); + + tool->name =3D strdup("tool"); + tool->type =3D PERF_PMU_TYPE_TOOL; + INIT_LIST_HEAD(&tool->aliases); + INIT_LIST_HEAD(&tool->caps); + INIT_LIST_HEAD(&tool->format); + tool->events_table =3D find_core_events_table("common", "common"); + + return tool; } diff --git a/tools/perf/util/tool_pmu.h b/tools/perf/util/tool_pmu.h index a60184859080..c6ad1dd90a56 100644 --- a/tools/perf/util/tool_pmu.h +++ b/tools/perf/util/tool_pmu.h @@ -51,6 +51,6 @@ int evsel__tool_pmu_open(struct evsel *evsel, int start_cpu_map_idx, int end_cpu_map_idx); int evsel__tool_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread); =20 -struct perf_pmu *perf_pmus__tool_pmu(void); +struct perf_pmu *tool_pmu__new(void); =20 #endif /* __TOOL_PMU_H */ --=20 2.34.1 From nobody Sun Feb 8 19:03:09 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 881CC24E00F for ; Wed, 26 Feb 2025 10:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740566507; cv=none; b=cuOgrDd04US3uzoPiElwXOpTmFKec9AN24vVUVnPaoH5bIf+wZTu96MCLq2rQUBF9hpdLkMgSTYXA2X3zXEm2C1yc4MZhb0rwbIzOfDG/ENDKUguosLqjuZ+yOf3nn5LrrA+imN/Vea8xnjoFFC1e43E7FWsn4UA1CJ6kF229xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740566507; c=relaxed/simple; bh=6Op+BGD9aOfefERcS9K+XAfwBdR01EIgoovWunnt9yg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Sin5Sdx7Oo1XwrHGbY4WA6TppqQdQewaCu3LAwwwCydm/9UA2/N9DOrGozLZFqP8LKuu/S89qslpeC4Yg5LJK93VqRDAWd+Hg7NatfKiwYCdlDXUSrd31vyLC8hJFue6pCYTsohodtxTyXqfEz+9fh/DbSN3NTm6lWwsILRUTJk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fr1V95L2; arc=none smtp.client-ip=209.85.221.49 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.b="fr1V95L2" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-38f6475f747so3133562f8f.3 for ; Wed, 26 Feb 2025 02:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740566504; x=1741171304; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lYvbQsYkIwtcSeYbqklzOTvT4hGi9DJFoZoz1Lt+cRk=; b=fr1V95L2nrUQbL8RnpGF8ZaqSFwegMLEJfTwiGhiouM1ewBcNhTbSXyY5nmdRpxMww Er80xLJr/1yB7iNOaNuQZ7wZKt4Da5PPwA1MCorn6SHK2p1tXkgyKDbrdHDdXBetPfse VxhnQh6sEuUOgZh1DHCtugP0UrRGiuJj219hK6G68jXPuLyUeLd+H3gJVBz3NZO0JM4Y I44EL2Ivz/kmXR27ff8yp6Oxjhyo438bjF7j9NZMUztij0ocsNLpmFuEJAaamRt+rhWa 6DDZfd2Hkl5988IvjNYTRUTq29KqTjpMGsz0HzP3nVr1OHqi6Fe4wD8S8Qt9IaLL+ExC yMBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740566504; x=1741171304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lYvbQsYkIwtcSeYbqklzOTvT4hGi9DJFoZoz1Lt+cRk=; b=tBClLlWFVu2mwxnLP0NxYwWW2t3g7FWIgTBd0EIgso0wlb4m76a1G9VGXuLUL5kHej phYn3jEeNrwCLKOPHRZltR1Ye2Y6ApL0IY2Vjz5jeuHJGyvuRS7izTk4sVESOcDi1bBY LYIXPFN0xQKYavaZo2ltEX2T5x8Mda30QKZst+LXQMhLJnhNrLPd2Zk3RXn6SywPQKJX ZmYdiTfbyTTo5TKz19sI3AMig5mQ+EJWzXwhLynZClFrAFYqCUoFufz9041dMV4x4kIM /MxI8hX8GPRpkwlwHS2r6rkZ46FJn8Oyxy4wRKgW6Ze6w8BjK1QpSlPYRNsdMvc4fNoW rJmQ== X-Forwarded-Encrypted: i=1; AJvYcCWH9s/+GI9kSXGl4zDjh6FE2PJIAMr0xr7KwLaeZtpmvFsHkx3UV5iehM6f3AkTaoJSo2XHoZHHYqpBiqs=@vger.kernel.org X-Gm-Message-State: AOJu0YzTnqRe9M/Efg21ck7v4QALp91LMAWQpaWuDS9LMJ2QvKquNUyY 4uGX8Uj/W4kmDMHTLAyEd3EVaiEujOjhSiDPl9RUNgWiYFqNWIkbSiqMohBRep8= X-Gm-Gg: ASbGncsvneCosIrD8uEleZgK34ZLWgkEwymC9GCL73qwHwRLZhoM4dFV0prkRoi16IQ 9KlJe2r80OiQsDUEfZwIuBdILIJmRECq1D9FLy6wn+wSvrT60g13k51LxFWiCMbCIcHJDvSFnuR blUtM2c8GRsm/amVADBgqVebTADJHujIHXlk9+J6TlrS40yXWeuKDFQF9GlG6fw211uHv/82pmk b8Dduni7QMYnUkgrOPkPwvubVl4rwPYu6aW7S21Drs6/49Inslcrl2A79tXUCjTzMmnXTmzVo1z fhQRjf02wDfu5HT3rfMWsI/d8ho= X-Google-Smtp-Source: AGHT+IFDcakSn5G3iB9NgJ4EoNZmOL4DHdejQpENpIsDv3JU46wxijY6j/aQynYAolsN0hiLeroFZg== X-Received: by 2002:a5d:47ac:0:b0:38f:516b:5429 with SMTP id ffacd0b85a97d-38f6e96738amr21666765f8f.25.1740566503778; Wed, 26 Feb 2025 02:41:43 -0800 (PST) Received: from pop-os.lan ([145.224.66.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm5080832f8f.26.2025.02.26.02.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 02:41:43 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com, namhyung@kernel.org, cyy@cyyself.name Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , Greg Kroah-Hartman , Weilin Wang , Yoshihiro Furudera , Jean-Philippe Romain , Junhao He , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] perf pmu: Don't double count common sysfs and json events Date: Wed, 26 Feb 2025 10:41:01 +0000 Message-Id: <20250226104111.564443-3-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226104111.564443-1-james.clark@linaro.org> References: <20250226104111.564443-1-james.clark@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" After pmu_add_cpu_aliases() is called, perf_pmu__num_events() returns an incorrect value that double counts common events and doesn't match the actual count of events in the alias list. This is because after 'cpu_aliases_added =3D=3D true', the number of events returned is 'sysfs_aliases + cpu_json_aliases'. But when adding 'case EVENT_SRC_SYSFS' events, 'sysfs_aliases' and 'cpu_json_aliases' are both incremented together, failing to account that these ones overlap and only add a single item to the list. Fix it by adding another counter for overlapping events which doesn't influence 'cpu_json_aliases'. There doesn't seem to be a current issue because it's used in perf list before pmu_add_cpu_aliases() so the correct value is returned. Other uses in tests may also miss it for other reasons like only looking at uncore events. However it's marked as a fixes commit in case any new fix with new uses of perf_pmu__num_events() is backported. Fixes: d9c5f5f94c2d ("perf pmu: Count sys and cpuid JSON events separately") Reviewed-by: Ian Rogers Signed-off-by: James Clark --- tools/perf/util/pmu.c | 7 ++++--- tools/perf/util/pmu.h | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index ec3878c890a9..72aa6167c090 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -596,7 +596,7 @@ static int perf_pmu__new_alias(struct perf_pmu *pmu, co= nst char *name, }; if (pmu_events_table__find_event(pmu->events_table, pmu, name, update_alias, &data) =3D=3D 0) - pmu->cpu_json_aliases++; + pmu->cpu_common_json_aliases++; } pmu->sysfs_aliases++; break; @@ -1884,9 +1884,10 @@ size_t perf_pmu__num_events(struct perf_pmu *pmu) if (pmu->cpu_aliases_added) nr +=3D pmu->cpu_json_aliases; else if (pmu->events_table) - nr +=3D pmu_events_table__num_events(pmu->events_table, pmu) - pmu->cpu_= json_aliases; + nr +=3D pmu_events_table__num_events(pmu->events_table, pmu) - + pmu->cpu_common_json_aliases; else - assert(pmu->cpu_json_aliases =3D=3D 0); + assert(pmu->cpu_json_aliases =3D=3D 0 && pmu->cpu_common_json_aliases = =3D=3D 0); =20 if (perf_pmu__is_tool(pmu)) nr -=3D tool_pmu__num_skip_events(); diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index f5306428c03f..b93014cc3670 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -136,6 +136,11 @@ struct perf_pmu { uint32_t cpu_json_aliases; /** @sys_json_aliases: Number of json event aliases loaded matching the P= MU's identifier. */ uint32_t sys_json_aliases; + /** + * @cpu_common_json_aliases: Number of json events that overlapped with s= ysfs when + * loading all sysfs events. + */ + uint32_t cpu_common_json_aliases; /** @sysfs_aliases_loaded: Are sysfs aliases loaded from disk? */ bool sysfs_aliases_loaded; /** --=20 2.34.1 From nobody Sun Feb 8 19:03:09 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC6272673A3 for ; Wed, 26 Feb 2025 10:41:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740566518; cv=none; b=DxN3arL3Gu6wcRz8OVjhyUce9uZzaxNif3jcHS/Nu0Ar+bEB+OylTFVUkwOX8NbHjPDK4vP/Z4h8GMLt8ZBMasmfHmEyg4R7rVWIdyov6wkoa7EoB7E7gcbdAYZK4SfdyblIV0YkW0EZXDWR5DNp+2o55uXPzGT5h8YQZ9FffA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740566518; c=relaxed/simple; bh=5EiFSMpBB+dPmpFSiJ5l3QtjK6IuR9uOkZs1Cfqm6ys=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MBdkwCx3Gu/cI+MlfTvKh5qnLFapDo51rrvTicPDjPlh+zUjrWyGSY3Jx1eXj40ruXergt941jL0OkeCs+13LIza6KqCProgo1JoV++3fVybWq/IoolOLhBrmSCQeNjmT/KPGkpGtn1gEXerpzFZoH1Bf8FI9LNGPAZ2g2x89fY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HSu4PZX5; arc=none smtp.client-ip=209.85.221.50 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.b="HSu4PZX5" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-38f2b7ce319so5446471f8f.2 for ; Wed, 26 Feb 2025 02:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740566514; x=1741171314; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TnPKi8fEvcW6+/UgkZDLw5oR2nNK48/l+H7XRSgcBmA=; b=HSu4PZX5mBXaDI/iO3DD9eO05Y9TYCkk9SC5Q/DPcOHPTbpn636JJFUqwVBsMegTXu RRSnV2wo//emxyMTWQ3K+ni2F3xIymrj184OUKPVGzUR22VmWskrxH5Zi6RQ860kmhfP vQeLwGONDWutvsmIwQFgd9rms65z41vfcOWXhHY2pSfEhzj7MiR6Dsy0K87EwM2KEO34 PFZ/HYrZHUdXM/1d21kiUz2NTmhxh8WoesZwctKZ57c2S0SjhDgpeLQjbfbFTi4Su4MC ivt3gwyIWNBapq22jax8dCuFxh6TIVtLSO76j4G6eN3bnFZWbXEVqIQgxBdY9FdOa3cK SKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740566514; x=1741171314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TnPKi8fEvcW6+/UgkZDLw5oR2nNK48/l+H7XRSgcBmA=; b=ntOVlf9n5Fehv5VpYmtJKgf2NADvcKG/K/b96waMV7xsqkfaTsGJR867bDYspSKK9J eFPvvDZvwhbhQINRayXDV5RngtO/2+NNCKke44TPGPHNRbb6JbZGWDA2toJVEVEEgl71 PEBH7gl+UHbC4Lp8yGuas2dJ+PtK5fGC24ONTiWlsT26M+2jg/lMqPpf17vfgVQCVVug awEUK8UYQqVmVio4Tn1+5yZFVS6+nOwvdc5JpyL7YuVbnkS7bLmPhd2oBh7yXLrqT/aR j0Kcw3JQ7w3/Hu8MXm8rKHJqSMglrmajKr2eKjhxKMh/A9ifeFqrF9/WZKQlouFORu9S jtBQ== X-Forwarded-Encrypted: i=1; AJvYcCX69swrKkWBKuwgL+3hB0bih1/4p9zL46Dq13/JNTdnkFzCPefQB/G3lD/AU+4JVdbFX5QkapdosRzRtjs=@vger.kernel.org X-Gm-Message-State: AOJu0Yyatqhj3N2QcRk4W/JxjPKGmCyaWd0dMi7kcLEyXTVf6glqonQ6 Y+0TSkSZ/Zuk0ESvoDTdljmgxtPchMcUmDPMzBL9Ug8yj9NDQn0qRYS380IL1JM= X-Gm-Gg: ASbGncsmYlyN1I4hUty5u9rlqJ1TiEFJVV7Sd6yuzwuWynSnoU3zYEzjUagoRkbO1so gLKJHeheverEwydf5k1RK7OEAn3nd9Q3+nLyrhk0FsfBV9Kdi3ajmCxXESKf3q+M1zSCGNOXlIE pKG/zPwLQJmPzBbuXk4H4MliIPxhWY1mDKLQIRVUeIKcTkKnMswOOXQTI7HuvWvkHuuJRtVlLPF E8NWPhJBG52krVEDK+/Q5xLXD64esmKE4hX5FXMgaiR9+IMOD4cLbQeDJ+TkiYXK3uBMlZntS/7 yhfHv5ix9vql8bTTd3bLyQk+TRM= X-Google-Smtp-Source: AGHT+IEOgLtlZFBNQI4Oefdb5y95WXLrPgz8hQbQNHAnUUq8U8VNjZ/k0l10FRBjyvMEjkLPnHcY7g== X-Received: by 2002:a5d:6483:0:b0:38f:2a71:c105 with SMTP id ffacd0b85a97d-390d4f376famr1997877f8f.1.1740566514106; Wed, 26 Feb 2025 02:41:54 -0800 (PST) Received: from pop-os.lan ([145.224.66.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm5080832f8f.26.2025.02.26.02.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 02:41:53 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com, namhyung@kernel.org, cyy@cyyself.name Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , Greg Kroah-Hartman , Weilin Wang , Yoshihiro Furudera , Junhao He , Jean-Philippe Romain , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] perf list: Document -v option deduplication feature Date: Wed, 26 Feb 2025 10:41:02 +0000 Message-Id: <20250226104111.564443-4-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226104111.564443-1-james.clark@linaro.org> References: <20250226104111.564443-1-james.clark@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" -v disables deduplication of similarly suffixed PMUs so add it to the help and doc strings. Reviewed-by: Ian Rogers Signed-off-by: James Clark --- tools/perf/Documentation/perf-list.txt | 2 +- tools/perf/builtin-list.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentat= ion/perf-list.txt index c3ffd93f94d7..8914f12d2b85 100644 --- a/tools/perf/Documentation/perf-list.txt +++ b/tools/perf/Documentation/perf-list.txt @@ -27,7 +27,7 @@ Don't print descriptions. =20 -v:: --long-desc:: -Print longer event descriptions. +Print longer event descriptions and all similar PMUs with alphanumeric suf= fixes. =20 --debug:: Enable debugging output. diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index c19826f218a0..fed482adb039 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c @@ -527,7 +527,7 @@ int cmd_list(int argc, const char **argv) OPT_BOOLEAN('d', "desc", &default_ps.desc, "Print extra event descriptions. --no-desc to not print."), OPT_BOOLEAN('v', "long-desc", &default_ps.long_desc, - "Print longer event descriptions."), + "Print longer event descriptions and all similar PMUs with alphanum= eric suffixes."), OPT_BOOLEAN(0, "details", &default_ps.detailed, "Print information on the perf event names and expressions used int= ernally by events."), OPT_STRING('o', "output", &output_path, "file", "output file name"), --=20 2.34.1