linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kim Phillips <kim.phillips@amd.com>
To: Arnaldo Carvalho de Melo <acme@redhat.com>, kim.phillips@amd.com
Cc: "Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@redhat.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Vijay Thakkar" <vijaythakkar@me.com>,
	"Andi Kleen" <ak@linux.intel.com>,
	"John Garry" <john.garry@huawei.com>,
	"Kan Liang" <kan.liang@linux.intel.com>,
	"Yunfeng Ye" <yeyunfeng@huawei.com>,
	"Jin Yao" <yao.jin@linux.intel.com>,
	"Martin Liška" <mliska@suse.cz>, "Borislav Petkov" <bp@suse.de>,
	"Jon Grimm" <jon.grimm@amd.com>,
	"Martin Jambor" <mjambor@suse.cz>,
	"Michael Petlan" <mpetlan@redhat.com>,
	"William Cohen" <wcohen@redhat.com>,
	"Stephane Eranian" <eranian@google.com>,
	"Ian Rogers" <irogers@google.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] perf vendor events amd: Add ITLB Instruction Fetch Hits event for zen1
Date: Tue,  1 Sep 2020 17:09:42 -0500	[thread overview]
Message-ID: <20200901220944.277505-2-kim.phillips@amd.com> (raw)
In-Reply-To: <20200901220944.277505-1-kim.phillips@amd.com>

The ITLB Instruction Fetch Hits event isn't documented even in
later zen1 PPRs, but it seems to count correctly on zen1 hardware.

Add it to zen1 group so zen1 users can use the upcoming IC Fetch Miss
Ratio Metric.

The IF1G, 1IF2M, IF4K (Instruction fetches to a 1 GB, 2 MB, and 4K page)
unit masks are not added because unlike zen2 hardware, zen1 hardware
counts all its unit masks with a 0 unit mask according to the old
convention:

zen1$ perf stat -e cpu/event=0x94/,cpu/event=0x94,umask=0xff/ sleep 1

 Performance counter stats for 'sleep 1':

           211,318      cpu/event=0x94/u
           211,318      cpu/event=0x94,umask=0xff/u

Rome/zen2:

zen2$ perf stat -e cpu/event=0x94/,cpu/event=0x94,umask=0xff/ sleep 1

 Performance counter stats for 'sleep 1':

                 0      cpu/event=0x94/u
           190,744      cpu/event=0x94,umask=0xff/u

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Vijay Thakkar <vijaythakkar@me.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Yunfeng Ye <yeyunfeng@huawei.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: "Martin Liška" <mliska@suse.cz>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jon Grimm <jon.grimm@amd.com>
Cc: Martin Jambor <mjambor@suse.cz>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 tools/perf/pmu-events/arch/x86/amdzen1/branch.json | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/pmu-events/arch/x86/amdzen1/branch.json b/tools/perf/pmu-events/arch/x86/amdzen1/branch.json
index a9943eeb8d6b..4ceb67a0db21 100644
--- a/tools/perf/pmu-events/arch/x86/amdzen1/branch.json
+++ b/tools/perf/pmu-events/arch/x86/amdzen1/branch.json
@@ -19,5 +19,10 @@
     "EventName": "bp_de_redirect",
     "EventCode": "0x91",
     "BriefDescription": "Decoder Overrides Existing Branch Prediction (speculative)."
+  },
+  {
+    "EventName": "bp_l1_tlb_fetch_hit",
+    "EventCode": "0x94",
+    "BriefDescription": "The number of instruction fetches that hit in the L1 ITLB."
   }
 ]
-- 
2.27.0


  reply	other threads:[~2020-09-01 22:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 22:09 [PATCH 1/4] perf vendor events amd: Add L2 Prefetch events for zen1 Kim Phillips
2020-09-01 22:09 ` Kim Phillips [this message]
2020-09-03  6:03   ` [PATCH 2/4] perf vendor events amd: Add ITLB Instruction Fetch Hits event " Ian Rogers
2020-09-04 19:19     ` Arnaldo Carvalho de Melo
2020-09-01 22:09 ` [PATCH 3/4] perf vendor events amd: Add recommended events Kim Phillips
2020-09-03  6:19   ` Ian Rogers
2020-09-03 18:26     ` Kim Phillips
2020-09-04  5:48       ` Ian Rogers
2020-09-04 19:28         ` Arnaldo Carvalho de Melo
2020-09-01 22:09 ` [PATCH 4/4] perf vendor events amd: Enable Family 19h users by matching Zen2 events Kim Phillips
2020-09-03  6:20   ` Ian Rogers
2020-09-04 19:33     ` Arnaldo Carvalho de Melo
2020-09-03  5:40 ` [PATCH 1/4] perf vendor events amd: Add L2 Prefetch events for zen1 Ian Rogers
2020-09-04 19:18 ` Arnaldo Carvalho de Melo

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=20200901220944.277505-2-kim.phillips@amd.com \
    --to=kim.phillips@amd.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@suse.de \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=jon.grimm@amd.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=mjambor@suse.cz \
    --cc=mliska@suse.cz \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vijaythakkar@me.com \
    --cc=wcohen@redhat.com \
    --cc=yao.jin@linux.intel.com \
    --cc=yeyunfeng@huawei.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;
as well as URLs for NNTP newsgroup(s).