From nobody Mon Feb 9 19:30:28 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.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 47FA719D890 for ; Tue, 25 Feb 2025 16:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740502036; cv=none; b=kd5F0oCAmnlZhZMYJVC3CvBcJ93YP2FFQVErLQA92OG7iqXcJTZ903jQDqO7cBtCkrjnN5IAwmjBj/55O1STP/RBRP2q6JasXb+ep8Ddsd06Pq+pbwKWYlEH/heXRlg7xHFnFQlCCUUOpV1Gw3wh9ZeW7GcAO38ySwQpm7azG+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740502036; c=relaxed/simple; bh=fJcj3avQNuqrPvfGogvQDFTwhN88MwqiTHVq32AqoM4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QB33WwbLK2JtlcP7mlzf9LjrzXNfmqTL7wvUUHqAtN2m1TRmOKR8ZZIH2hPbTt7ATUU2mPxJ+znfSLkmJ/Emp9DuB3PBP87x2IDrlVn++eJ4A953RlMb3vk27Bdyq2e12U1L39n+1CAyUlDQWWyZnqTkCke0FGBPzDJNpJD9vAA= 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=U0gyxRI7; arc=none smtp.client-ip=209.85.128.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="U0gyxRI7" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4399d14334aso51341295e9.0 for ; Tue, 25 Feb 2025 08:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740502031; x=1741106831; 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=T6zYunsslfLFaIghaKuBbDgwSTYPPEUyCdstyv8nGIk=; b=U0gyxRI7RGugzyu1uBefwjMdLMrNAns2UpJb5zn7i3gZcnHlBGr7f4u0XkooxVOU1H kk3YfTEGemNZ+P7oDio9F4Wm6h59z2UoAi//rPbw+Y8cEwkWSyWEiJ6Awg4DggRgPrel lKh2xOkS2u0ynlTE3vzCevhXuHjyEn6BHKnoUrASJG8Xm8lOsKNT1PPdYkmwH+ii6v8q NArWo+2Dwz6KRNUoD0jeJYk18PoFqsTF0Wetg6bBAJGpU1Rnr2nBQUO1CE2Kuq97Kyxx xIphUR2aNrsArg2RNxlS5a4lYEIxMIxkJ6p66LJsXL76pxnTpBVFhqNvAeRQCUDcSwb5 VJAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740502031; x=1741106831; 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=T6zYunsslfLFaIghaKuBbDgwSTYPPEUyCdstyv8nGIk=; b=OgZ/uZUs59dsIkIIs+q8+BoC8k75qY9ixtuRr9sqWV0Xu6pui6wd35YjRweT4JuWA1 USW38NH8ZrdIQPkPhLL/nYUgXfqJ5LL9LzeIwQPnxw564xUH+/ku+xAOyUTJGBwcK0YR M2X06enGFwOUky2lVCNsdOPmWhRh/+q1tvVmWRDmjMIUKP33V7OLDu3g3igF8Gg4eSE4 +1/oGEW5MpebxOf/37U9S/QGg+cn4a2t33Exknm2S8Ch2hsoXb54JgJsc8XazpAghcrF R/Rtkcsgp/M9Es7Reokh91TwY8lvt5fUrwHOIVyJmd8vuF5VHNOMOTBujW8ibPR35ebP D2/w== X-Forwarded-Encrypted: i=1; AJvYcCVp5I9ONGNvB+7W/wLGZBxg9r3hCbl8RlogZaNUCE6PUh43D+p1GL8bzrVpCBgmV0WJB7IUqt3ga1Qlhrk=@vger.kernel.org X-Gm-Message-State: AOJu0YzJVMvIWEDw9PXsnfVE4LvQ4x9pCASBM0sIulrI1atx1fK9WnaJ PFbgM0/e7KbJ/JN+Mz/SRIVBC1DlbP+R6a6TSLQt2a1I96cHCCUfjFtOjiZ+fCU= X-Gm-Gg: ASbGncvMFcM+JaT/dXTC5FCiIOpzfQjdJo7Negy1amQFn4cQ6kYjArHg6ZPZ10gcRQK 587lGC4ekifYLBOitrtZ6Bb1WNx2zbd3+GG1db+Tyn1NTPhQOYYknHiK2AQWcEMY+YtOBjRZrAB oEFpJcznJhjwt+F19soGyaQxXIG9AAhhrwrTcmvDxmebHG/pQbqSn8imsV+QZEEkqQWosQKBirP TbCXlUNT0OqrKr48EZ1fpkeE+MYp5Q7AY7984ZvQ/6nUfGayTR6sDRmr004Miv9RZx9lyNFQ+cz zhQHXmY+AcMTPLqZexwxaLLC+Q== X-Google-Smtp-Source: AGHT+IHxcabNYd68N3fAYJwzKJtxAGyEN4XVr5OMEsGkvW8AeGZ4ctNdJiH2U7/OsTMvRHxz0sqrjw== X-Received: by 2002:a05:600c:3507:b0:439:9225:2f76 with SMTP id 5b1f17b1804b1-43ab8fe97d8mr2239285e9.18.1740502031441; Tue, 25 Feb 2025 08:47:11 -0800 (PST) Received: from pop-os.lan ([145.224.90.0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab154754esm32072415e9.21.2025.02.25.08.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 08:47:11 -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" , Yoshihiro Furudera , Greg Kroah-Hartman , Weilin Wang , Junhao He , Jean-Philippe Romain , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] perf pmu: Dynamically allocate tool PMU Date: Tue, 25 Feb 2025 16:46:28 +0000 Message-Id: <20250225164639.522741-2-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250225164639.522741-1-james.clark@linaro.org> References: <20250225164639.522741-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") Signed-off-by: James Clark Reviewed-by: Ian Rogers --- 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..c1815edaca37 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 perf_pmus__new_tool_pmu(); 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..45eae810b205 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 *perf_pmus__new_tool_pmu(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..268f05064d03 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 *perf_pmus__new_tool_pmu(void); =20 #endif /* __TOOL_PMU_H */ --=20 2.34.1 From nobody Mon Feb 9 19:30:28 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 188D41A0B15 for ; Tue, 25 Feb 2025 16:47:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740502045; cv=none; b=F+fBHql8sv7lKkd63E0XZrnkAH19TwsEl3dixsXb5qtjtvBmlF8eA8CNZX4WoDhxeMO/y7VmQPWAahfxoBsSKZE66rVL4Mr5OjegDN0I7R7ZUl7PTQ03DRI/TXHGCxvn6bzxko3YE0IDSJCQ2ykoKb/O2/vHt8zXz2lmND6KBuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740502045; c=relaxed/simple; bh=wrHzNVnId8j0qsMaPAMXfUrcKGMkQwXnH6urFQaWqoo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ISmKRSQQ2AnKXmGu2KOmlY5/7m9lawC5e//nwrLMVZT5MJWQlwPfAcYRSvnwSBhCmEbHPVD2VJ+HRBRapGwCLjKj2XmC8aZ6SDcfL4WDzH1LkweXqvZAZpaWLzCRMnTBtQ/zGnC4bJwk1407OYnM2w0sV9p+pm+ZWqF0ZZzpSpo= 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=oFn/OcM8; arc=none smtp.client-ip=209.85.128.54 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="oFn/OcM8" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso59392045e9.1 for ; Tue, 25 Feb 2025 08:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740502042; x=1741106842; 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=X6UJaQQmZ+Nba7bOv2fyokA++hlexbBX/filKGo9hKY=; b=oFn/OcM8FSb+FS6Ue+3+IaXtzTj/EjDq1Ylfue4wQfppqTuZedC/Ich3daEnKdUs7+ dbDNVZHrXQ1bcKnIlVPc45O74U520iDJHL7AwmpPRPPEpAIfpOouQi+Tk+SY/fGizt8T 8fyUtMbCIc/iaYyaGvO2mEH/okGJLAfKRsrcmX3pyTgmjTGlg+GNDUVMebz3rAVNYm/s Z5d68FWr9zDgPs4T8GSgFa/RLXUIgW2qCWxG/75cWYV4n6DYtzhb9cE56X4lCmfhALd/ YbT5dQy1pld7JcNWQqKVQs+nU3u1AhG729WjO6reojog6AuFMNyxUA4thUxsMHDiZU1T 652w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740502042; x=1741106842; 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=X6UJaQQmZ+Nba7bOv2fyokA++hlexbBX/filKGo9hKY=; b=KRdsLcrJ87/8233zsRjjr1ih+4ICwyU79cunNx6oTut0ITD/by8P1QlKoMQPpPApMP tM/jrmYcopCq7HpRsS8N4/I5sNBVnp9smxzhsP5pgRDFO8ewh+3Su+bCaTLA3P0n+z4X 6mqv76XvfFVFYEe5Nx0TttN6m9XjQY4GFvuf+Gd7w8uJRuzs23M67VTgTJK+PZHM23de bfrewAtfFwzXSXbaL5LjV0BqiDN6lYLqOvAUXHarj7huliSAjG5o7ZsDLVAFQhmzEPY8 aH7t7YinqJJlRuCCopqIG5XNnPVeigtjtC41RpoKiTUOAZLx652vT5UlIFhkBt62mf7Z t4Xw== X-Forwarded-Encrypted: i=1; AJvYcCW780CRWyT42/D1uQ2sgqbyKe9IsjWT7z/UyLc69WO9hHXb0N6k4SPHu9NJtadMaWc7O4c8EgKAm3mx2p4=@vger.kernel.org X-Gm-Message-State: AOJu0YyfVnp5jaPypRcbyyjDtByTC6v2LRWyC3FXdbP3bKhfDRaL3BWm Kw5WYiz2sBddRNOKhK2YBCkvyRMPKHXw1XkB6Cpnq6tiVQKO4IHP6jZ6zRrkggE= X-Gm-Gg: ASbGncuhFSz/hZxK5WEF65YZr1dxWnxhIwhqxmHeFDwVktlVAL5WTKOonSQprd0kHVy VVV4G593GUrF+W5ooln9QivC+1p5+VegfVfQocvo/LPluw6El/5aGY7IxYWDLmeirwZYzpRDTP3 zCD0IZKhHXf+PqCV56IvFycYBKUY/nVtFI/4qfdB6CisCMw5OpNn9YbwIcBZsYIDBk3Coroy0Er Nol0fLMUYswVwoDx+jSXoqrwUn1ok7lkfV3N04aT7OZ8Rs5D8smUJHHdYVlzBlxvoNoBs6AWZUB 7fZqSw3szFVUls6l371kVgCyWA== X-Google-Smtp-Source: AGHT+IF/oE/rQ1PppVOBOg8I0Vrf8wEOV9x9RbiBK34mWqlWgLOTXGDyIkC+P3rKPQxR+xXeJ89KKg== X-Received: by 2002:a05:600c:3516:b0:439:88bb:d023 with SMTP id 5b1f17b1804b1-43ab0f2dd01mr49558465e9.11.1740502042272; Tue, 25 Feb 2025 08:47:22 -0800 (PST) Received: from pop-os.lan ([145.224.90.0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab154754esm32072415e9.21.2025.02.25.08.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 08:47:21 -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 , Junhao He , Jean-Philippe Romain , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] perf pmu: Don't double count common sysfs and json events Date: Tue, 25 Feb 2025 16:46:29 +0000 Message-Id: <20250225164639.522741-3-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250225164639.522741-1-james.clark@linaro.org> References: <20250225164639.522741-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") Signed-off-by: James Clark Reviewed-by: Ian Rogers --- 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 Mon Feb 9 19:30:28 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 04D791A08BC for ; Tue, 25 Feb 2025 16:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740502057; cv=none; b=mWIsTeR2s62PqQw2JIdZeQFnCTbQUhKIc2KxGgFLSyXdBnv9JKXGhWCoDZUt6LyxxPM5fOANRf3zmTUNeq/PLVOci4GgGpTUm3VjMqdgPyJQu7335ckIWvIk0AHBtX+lYP8JthbFVFrQWa3Ly968D9hzL1j2ERARO/TKVbtp5vk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740502057; c=relaxed/simple; bh=vZO3AQe7+CZOR/U3Zg+1o41nmB25hPOspCaBT/odcNw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D9WjJhufxX3z+w//M/cPRejAIbgnV3gexi7qou//7lUsigiWDJDkwzwev3Btjn5yelp4qdSSJ6e+uIXBSFLpFCicE02jH7osEwVKWhErnORpkJH57fTe/EmviFt2ex5KMk24lpNqyrSC+IsfyTQeQAcEIxHaPJ7BiS9465yPDw0= 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=mb1rWkWa; arc=none smtp.client-ip=209.85.128.42 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="mb1rWkWa" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-439a4fc2d65so56937185e9.3 for ; Tue, 25 Feb 2025 08:47:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740502053; x=1741106853; 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=bD4YPrrWymRk6rucC/v1JXU8kR8dNumKu6tLq4ELeWE=; b=mb1rWkWa7YMG1EkPMWOFSDe8yfK3dLX9c+lVL+/so0ZK6jRuatm/rkZ2MCiLNuTzPm 0IDBrnGwpQlgmnfTv0YScD4VK0xmLTZGP2P0ZgAlKHlrL9qk2CsZjOd8sufEgiYgaETv kzDY5+yLsFmqGhWjaLB1gK5kV8FIkq4GuD/P6y7d8jhKtHWcEAKdOiTmE4WGNZSTokl5 jRvXW/ETtPL5tgKVdhE/BiLf3D1U1apwMX5AosDBzRURVa2rDNzq+b9GdF5t45TgGmNM fh7nLTTV9qxom+PHEeK0VDpY4y/Nm4wwAzt9RBH+AIU5j2YUGzjqy8kfFo3VPDqjpE4q 0Aow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740502053; x=1741106853; 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=bD4YPrrWymRk6rucC/v1JXU8kR8dNumKu6tLq4ELeWE=; b=fCvLry2E1C2huBDXzRBlQuJME/g6u1rww3cV65zd3iL8tykv2DTIyEhVfLtA53sKoY uCIZVZL7wPRqEBPsMasXH4oiEmYdaJvOjwp/zx6d3e3i8FcAkJHiYIQT2BQ0R88ji/MO 2WlTJ26GGbekqmYG8/jIcXOPozsRblj4WzOOlsgbYfuDfd+gfOa4BzDzxJq8hbHC5ztp 1f1cNPmUpKDAudHiirrF3iU+k2Dy76tQRNL+SVneoH3oOxIiGw5XdOGb8btz8fhbsumN soBaVyzYqtEMFhXskCCgNThaHblIeUVjXEc4CPaAVWiQcRIyn1Jopt3Ux9J8WQW1bDKi +4TA== X-Forwarded-Encrypted: i=1; AJvYcCVYDe7oXHLIXFoAI7tQ9pXfUevBvEJx1TU5SYFZoSbD+BiJIyoGbH8j7B/YOwbZ94t15JjIdt4Ois1FSyc=@vger.kernel.org X-Gm-Message-State: AOJu0YwAUFFp2jHmXLf6XrRqk48Q9TMkE6rMi6xndE/cTPOSxtspVcYZ XnWcSQuGC1RO0ODBOwLCPBA4GZYMd8BmIon9vZAIn4gW5mNI8y/iQCggUxKPo7k= X-Gm-Gg: ASbGncvVHuFqEZRYQwY9PcWzLdb9udbGri7aTeXPAJrhxsDdJVQIR65bsKOqRsm+2mo vgmAFhWbEUOYSbpC9wiIu+3X52Er4zyLEPpECB1YJ0lVsz2c/magbIfAoHs1kEPiedUZ0JflAxl HqyX5Q/FJrkQsrKnPDpTiA6Te4cX6GwcsVCJKreQnMZBh0lxsTT8eF8Rzal22jIAb4HVYURDOYJ 7/qLZ9Nm7hcZCs5I/bjpPtl8MzOU4/bfD6B5AUglAbaDVxq0cBHIhj2EJwDOe4/haVzqWrEahy9 KhQyMrA2fNHAMKBNpb48LHnGFA== X-Google-Smtp-Source: AGHT+IH5ZcoPzqCagrsFUM8SoRpAwVswd6FpNDml9RsM7oTLv0BA6f40Ah7/FOS5lM9Vwj5qLNvnWg== X-Received: by 2002:a05:600c:3d19:b0:43a:b186:8abc with SMTP id 5b1f17b1804b1-43ab1868ac3mr38322035e9.2.1740502053232; Tue, 25 Feb 2025 08:47:33 -0800 (PST) Received: from pop-os.lan ([145.224.90.0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab154754esm32072415e9.21.2025.02.25.08.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 08:47:32 -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" , Yoshihiro Furudera , Greg Kroah-Hartman , Weilin Wang , Junhao He , Jean-Philippe Romain , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] perf list: Document -v option deduplication feature Date: Tue, 25 Feb 2025 16:46:30 +0000 Message-Id: <20250225164639.522741-4-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250225164639.522741-1-james.clark@linaro.org> References: <20250225164639.522741-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. Signed-off-by: James Clark Reviewed-by: Ian Rogers --- 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