From: Chun-Tse Shao <ctshao@google.com>
To: linux-kernel@vger.kernel.org
Cc: Chun-Tse Shao <ctshao@google.com>,
peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
namhyung@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, james.clark@linaro.org,
howardchu95@gmail.com, linux@treblig.org, yeoreum.yun@arm.com,
ak@linux.intel.com, weilin.wang@intel.com,
asmadeus@codewreck.org, linux-perf-users@vger.kernel.org
Subject: [PATCH v1 0/2] Fix incorrect counts when count the same uncore event multiple times
Date: Wed, 26 Mar 2025 16:42:34 -0700 [thread overview]
Message-ID: <20250326234758.480431-1-ctshao@google.com> (raw)
Let's take a look an example, the machine is SKX with 6 IMC devices.
perf stat -e clockticks,clockticks -I 1000
# time counts unit events
1.001127430 6,901,503,174 uncore_imc_0/clockticks/
1.001127430 3,940,896,301 uncore_imc_0/clockticks/
2.002649722 988,376,876 uncore_imc_0/clockticks/
2.002649722 988,376,141 uncore_imc_0/clockticks/
3.004071319 1,000,292,675 uncore_imc_0/clockticks/
3.004071319 1,000,294,160 uncore_imc_0/clockticks/
1) The events name should not be uniquified.
2) The initial count for the first `clockticks` is doubled.
3) Subsequent count only report for the first IMC device.
The first patch fixes 1) and 3), and the second patch fixes 2).
After these fix:
perf stat -e clockticks,clockticks -I 1000
# time counts unit events
1.001127586 4,126,938,857 clockticks
1.001127586 4,121,564,277 clockticks
2.001686014 3,953,806,350 clockticks
2.001686014 3,953,809,541 clockticks
3.003121403 4,137,750,252 clockticks
3.003121403 4,137,749,048 clockticks
I also tested `-A`, `--per-socket`, `--per-die` and `--per-core`, all
looks good.
Ian Rogers (2):
perf evlist: Make uniquifying counter names consistent
perf parse-events: Use wildcard processing to set an event to merge
into
tools/perf/builtin-record.c | 7 +-
tools/perf/builtin-top.c | 7 +-
tools/perf/util/evlist.c | 66 +++++++++-----
tools/perf/util/evlist.h | 3 +-
tools/perf/util/evsel.c | 116 ++++++++++++++++++++++++-
tools/perf/util/evsel.h | 11 ++-
tools/perf/util/parse-events.c | 45 ++++++----
tools/perf/util/stat-display.c | 151 +--------------------------------
tools/perf/util/stat.c | 40 +--------
9 files changed, 214 insertions(+), 232 deletions(-)
--
2.49.0.472.ge94155a9ec-goog
next reply other threads:[~2025-03-26 23:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 23:42 Chun-Tse Shao [this message]
2025-03-26 23:42 ` [PATCH v1 1/2] perf evlist: Make uniquifying counter names consistent Chun-Tse Shao
2025-03-26 23:42 ` [PATCH v1 2/2] perf parse-events: Use wildcard processing to set an event to merge into Chun-Tse Shao
2025-03-27 15:11 ` [PATCH v1 0/2] Fix incorrect counts when count the same uncore event multiple times Ian Rogers
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=20250326234758.480431-1-ctshao@google.com \
--to=ctshao@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=asmadeus@codewreck.org \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux@treblig.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=weilin.wang@intel.com \
--cc=yeoreum.yun@arm.com \
/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®