Skip to contentSkip to conversation

perf vendor events arm64: support for Brahma-B53, Cortex-A57/A72

PATCH Applied Florian Fainelli 4 participants 9 messages May 13, 2019 – May 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover perf vendor events arm64: support for Brahma-B53, Cortex-A57/A72

Hi all,

Based on discussion about the last patch, it turned out that we can remove the [[:xdigit:]] wildcard entirely since get_cpuid_str() strips the revision bits anyway.

Florian Fainelli (3):
perf vendor events arm64: Remove [[:xdigit:]] wildcard perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events

 .../arm/cortex-a57-a72/core-imp-def.json      | 179 ++++++++++++++++++
 tools/perf/pmu-events/arch/arm64/mapfile.csv  |   5 +-
 2 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 perf vendor events arm64: Remove [[:xdigit:]] wildcard

ARM64's implementation of get_cpuidr_str() masks out the revision bits [3:0] while reading the CPU identifier, there is no need for the [[:xdigit:]] wildcard.

---
 tools/perf/pmu-events/arch/arm64/mapfile.csv | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/pmu-events/arch/arm64/mapfile.csv +1 -1
index 59cd8604b0bd..da5ff2204bf6 100644
@@ -12,7 +12,7 @@
 #
 #
 #Family-model,Version,Filename,EventType
-0x00000000410fd03[[:xdigit:]],v1,arm/cortex-a53,core
+0x00000000410fd030,v1,arm/cortex-a53,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v2 1/3] perf vendor events arm64: Remove [[:xdigit:]] wildcard

Quoted 14 lines · Florian Fainelli

ARM64's implementation of get_cpuidr_str() masks out the revision bits [3:0] while reading the CPU identifier, there is no need for the [[:xdigit:]] wildcard.

---
 tools/perf/pmu-events/arch/arm64/mapfile.csv | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/pmu-events/arch/arm64/mapfile.csv +0 -0
index 59cd8604b0bd..da5ff2204bf6 100644

tools/perf/pmu-events/arch/arm64/mapfile.csv line 12

Quoted 1 line
tools/perf/pmu-events/arch/arm64/mapfile.csv +0 -0
@@ -12,7 +12,7 @@
 #

JFYI, this was discussed before, but this a53 entry seemed to make it though:
https://lkml.org/lkml/2018/3/7/1236

Quoted 8 lines
tools/perf/pmu-events/arch/arm64/mapfile.csv +1 -1
 #
 #Family-model,Version,Filename,EventType
-0x00000000410fd03[[:xdigit:]],v1,arm/cortex-a53,core
+0x00000000410fd030,v1,arm/cortex-a53,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
#3 lore raw

[tip:perf/core] perf vendor events arm64: Remove [[:xdigit:]] wildcard

In reply to Florian Fainelli
perf vendor events arm64: Remove [[:xdigit:]] wildcard
Commit-ID:  ae833a6124b1bfe98bea428da86fe5b83b5785a7
Gitweb:     https://git.kernel.org/tip/ae833a6124b1bfe98bea428da86fe5b83b5785a7
Author:     Florian Fainelli <[email protected]>
AuthorDate: Mon, 13 May 2019 13:25:20 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 May 2019 16:36:49 -0300

perf vendor events arm64: Remove [[:xdigit:]] wildcard

ARM64's implementation of get_cpuidr_str() masks out the revision bits [3:0] while reading the CPU identifier, there is no need for the [[:xdigit:]] wildcard.

Cc Alexander Shishkin <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Ganapatrao Kulkarni <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc John Garry <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Sean V Kelley <[email protected]>
Cc Will Deacon <[email protected]>
Cc [email protected] (moderated list:arm pmu profiling and debugging)
---
 tools/perf/pmu-events/arch/arm64/mapfile.csv | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/pmu-events/arch/arm64/mapfile.csv +1 -1
index 59cd8604b0bd..da5ff2204bf6 100644
@@ -12,7 +12,7 @@
 #
 #
 #Family-model,Version,Filename,EventType
-0x00000000410fd03[[:xdigit:]],v1,arm/cortex-a53,core
+0x00000000410fd030,v1,arm/cortex-a53,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
#4 lore raw

PATCH v2 2/3 perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events

In reply to Florian Fainelli

Broadcom's Brahma-B53 CPUs support the same type of events that the Cortex-A53 supports, recognize its CPUID and map it to the cortex-a53 events.

Cc Alexander Shishkin <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc [email protected] (moderated list:arm pmu profiling and debugging)
---
 tools/perf/pmu-events/arch/arm64/mapfile.csv | 1 +
 1 file changed, 1 insertion(+)
tools/perf/pmu-events/arch/arm64/mapfile.csv +1 -0
index da5ff2204bf6..013155f1eb58 100644
@@ -13,6 +13,7 @@
 #
 #Family-model,Version,Filename,EventType
 0x00000000410fd030,v1,arm/cortex-a53,core
+0x00000000420f1000,v1,arm/cortex-a53,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
Signature · 1 line
2.17.1
#5 lore raw

[tip:perf/core] perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events

perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events
Commit-ID:  93fe8f1e11042e6cdf6f36f4e8ac111c7b818fc7
Gitweb:     https://git.kernel.org/tip/93fe8f1e11042e6cdf6f36f4e8ac111c7b818fc7
Author:     Florian Fainelli <[email protected]>
AuthorDate: Mon, 13 May 2019 13:25:21 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 May 2019 16:36:49 -0300

perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events

Broadcom's Brahma-B53 CPUs support the same type of events that the Cortex-A53 supports, recognize its CPUID and map it to the cortex-a53 events.

---
 tools/perf/pmu-events/arch/arm64/mapfile.csv | 1 +
 1 file changed, 1 insertion(+)
tools/perf/pmu-events/arch/arm64/mapfile.csv +1 -0
index da5ff2204bf6..013155f1eb58 100644
@@ -13,6 +13,7 @@
 #
 #Family-model,Version,Filename,EventType
 0x00000000410fd030,v1,arm/cortex-a53,core
+0x00000000420f1000,v1,arm/cortex-a53,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
#6 lore raw

PATCH v2 3/3 perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events

In reply to Florian Fainelli

The Cortex-A57 and Cortex-A72 both support all ARMv8 recommended events up to the RC_ST_SPEC (0x91) event with the exception of:

- L1D_CACHE_REFILL_INNER (0x44)
- L1D_CACHE_REFILL_OUTER (0x45)
- L1D_TLB_RD (0x4E)
- L1D_TLB_WR (0x4F)
- L2D_TLB_REFILL_RD (0x5C)
- L2D_TLB_REFILL_WR (0x5D)
- L2D_TLB_RD (0x5E)
- L2D_TLB_WR (0x5F)
- STREX_SPEC (0x6F)

Create an appropriate JSON file for mapping those events and update the mapfile.csv for matching the Cortex-A57 and Cortex-A72 MIDR to that file.

---
 .../arm/cortex-a57-a72/core-imp-def.json      | 179 ++++++++++++++++++
 tools/perf/pmu-events/arch/arm64/mapfile.csv  |   2 +
 2 files changed, 181 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json
tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json new file +179 -0
new file mode 100644
index 000000000000..0ac9b7927450
@@ -0,0 +1,179 @@
+[
+    {
+        "ArchStdEvent": "L1D_CACHE_RD",
+    },
+    {
+        "ArchStdEvent": "L1D_CACHE_WR",
+    },
+    {
+        "ArchStdEvent": "L1D_CACHE_REFILL_RD",
+    },
+    {
+        "ArchStdEvent": "L1D_CACHE_REFILL_WR",
+    },
+    {
+        "ArchStdEvent": "L1D_CACHE_WB_VICTIM",
+    },
+    {
+        "ArchStdEvent": "L1D_CACHE_WB_CLEAN",
+    },
+    {
+        "ArchStdEvent": "L1D_CACHE_INVAL",
+    },
+    {
+        "ArchStdEvent": "L1D_TLB_REFILL_RD",
+    },
+    {
+        "ArchStdEvent": "L1D_TLB_REFILL_WR",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_RD",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_WR",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_REFILL_RD",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_REFILL_WR",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_WB_VICTIM",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_WB_CLEAN",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_INVAL",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_RD",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_WR",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_SHARED",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_NOT_SHARED",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_NORMAL",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_PERIPH",
+    },
+    {
+        "ArchStdEvent": "MEM_ACCESS_RD",
+    },
+    {
+        "ArchStdEvent": "MEM_ACCESS_WR",
+    },
+    {
+        "ArchStdEvent": "UNALIGNED_LD_SPEC",
+    },
+    {
+        "ArchStdEvent": "UNALIGNED_ST_SPEC",
+    },
+    {
+        "ArchStdEvent": "UNALIGNED_LDST_SPEC",
+    },
+    {
+        "ArchStdEvent": "LDREX_SPEC",
+    },
+    {
+        "ArchStdEvent": "STREX_PASS_SPEC",
+    },
+    {
+        "ArchStdEvent": "STREX_FAIL_SPEC",
+    },
+    {
+        "ArchStdEvent": "LD_SPEC",
+    },
+    {
+        "ArchStdEvent": "ST_SPEC",
+    },
+    {
+        "ArchStdEvent": "LDST_SPEC",
+    },
+    {
+        "ArchStdEvent": "DP_SPEC",
+    },
+    {
+        "ArchStdEvent": "ASE_SPEC",
+    },
+    {
+        "ArchStdEvent": "VFP_SPEC",
+    },
+    {
+        "ArchStdEvent": "PC_WRITE_SPEC",
+    },
+    {
+        "ArchStdEvent": "CRYPTO_SPEC",
+    },
+    {
+        "ArchStdEvent": "BR_IMMED_SPEC",
+    },
+    {
+        "ArchStdEvent": "BR_RETURN_SPEC",
+    },
+    {
+        "ArchStdEvent": "BR_INDIRECT_SPEC",
+    },
+    {
+        "ArchStdEvent": "ISB_SPEC",
+    },
+    {
+        "ArchStdEvent": "DSB_SPEC",
+    },
+    {
+        "ArchStdEvent": "DMB_SPEC",
+    },
+    {
+        "ArchStdEvent": "EXC_UNDEF",
+    },
+    {
+        "ArchStdEvent": "EXC_SVC",
+    },
+    {
+        "ArchStdEvent": "EXC_PABORT",
+    },
+    {
+        "ArchStdEvent": "EXC_DABORT",
+    },
+    {
+        "ArchStdEvent": "EXC_IRQ",
+    },
+    {
+        "ArchStdEvent": "EXC_FIQ",
+    },
+    {
+        "ArchStdEvent": "EXC_SMC",
+    },
+    {
+        "ArchStdEvent": "EXC_HVC",
+    },
+    {
+        "ArchStdEvent": "EXC_TRAP_PABORT",
+    },
+    {
+        "ArchStdEvent": "EXC_TRAP_DABORT",
+    },
+    {
+        "ArchStdEvent": "EXC_TRAP_OTHER",
+    },
+    {
+        "ArchStdEvent": "EXC_TRAP_IRQ",
+    },
+    {
+        "ArchStdEvent": "EXC_TRAP_FIQ",
+    },
+    {
+        "ArchStdEvent": "RC_LD_SPEC",
+    },
+    {
+        "ArchStdEvent": "RC_ST_SPEC",
+    },
+]
tools/perf/pmu-events/arch/arm64/mapfile.csv +2 -0
index 013155f1eb58..927fcddcb4aa 100644
@@ -14,6 +14,8 @@
 #Family-model,Version,Filename,EventType
 0x00000000410fd030,v1,arm/cortex-a53,core
 0x00000000420f1000,v1,arm/cortex-a53,core
+0x00000000410fd070,v1,arm/cortex-a57-a72,core
+0x00000000410fd080,v1,arm/cortex-a57-a72,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
Signature · 1 line
2.17.1
#7 lore raw

[tip:perf/core] perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events

perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events
Commit-ID:  7025fdbea3a67c5980b94574b755a5fd65ea8a36
Gitweb:     https://git.kernel.org/tip/7025fdbea3a67c5980b94574b755a5fd65ea8a36
Author:     Florian Fainelli <[email protected]>
AuthorDate: Mon, 13 May 2019 13:25:22 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 15 May 2019 16:36:49 -0300

perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events

The Cortex-A57 and Cortex-A72 both support all ARMv8 recommended events up to the RC_ST_SPEC (0x91) event with the exception of:

- L1D_CACHE_REFILL_INNER (0x44)
- L1D_CACHE_REFILL_OUTER (0x45)
- L1D_TLB_RD (0x4E)
- L1D_TLB_WR (0x4F)
- L2D_TLB_REFILL_RD (0x5C)
- L2D_TLB_REFILL_WR (0x5D)
- L2D_TLB_RD (0x5E)
- L2D_TLB_WR (0x5F)
- STREX_SPEC (0x6F)

Create an appropriate JSON file for mapping those events and update the mapfile.csv for matching the Cortex-A57 and Cortex-A72 MIDR to that file.

Cc Alexander Shishkin <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Ganapatrao Kulkarni <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Sean V Kelley <[email protected]>
Cc Will Deacon <[email protected]>
Cc [email protected] (moderated list:arm pmu profiling and debugging)
---
 .../cortex-a57-a72}/core-imp-def.json              | 92 +++++++++++++++++++---
 tools/perf/pmu-events/arch/arm64/mapfile.csv       |  2 +
 2 files changed, 81 insertions(+), 13 deletions(-)
tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json renamed from tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json +79 -13
similarity index 52%
copy from tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json
copy to tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json
index 752e47eb6977..0ac9b7927450 100644
@@ -11,12 +11,6 @@
     {
         "ArchStdEvent": "L1D_CACHE_REFILL_WR",
     },
-    {
-        "ArchStdEvent": "L1D_CACHE_REFILL_INNER",
-    },
-    {
-        "ArchStdEvent": "L1D_CACHE_REFILL_OUTER",
-    },
     {
         "ArchStdEvent": "L1D_CACHE_WB_VICTIM",
     },
@@ -33,22 +27,25 @@
         "ArchStdEvent": "L1D_TLB_REFILL_WR",
     },
     {
-        "ArchStdEvent": "L1D_TLB_RD",
+        "ArchStdEvent": "L2D_CACHE_RD",
     },
     {
-        "ArchStdEvent": "L1D_TLB_WR",
+        "ArchStdEvent": "L2D_CACHE_WR",
     },
     {
-        "ArchStdEvent": "L2D_TLB_REFILL_RD",
+        "ArchStdEvent": "L2D_CACHE_REFILL_RD",
     },
     {
-        "ArchStdEvent": "L2D_TLB_REFILL_WR",
+        "ArchStdEvent": "L2D_CACHE_REFILL_WR",
     },
     {
-        "ArchStdEvent": "L2D_TLB_RD",
+        "ArchStdEvent": "L2D_CACHE_WB_VICTIM",
     },
     {
-        "ArchStdEvent": "L2D_TLB_WR",
+        "ArchStdEvent": "L2D_CACHE_WB_CLEAN",
+    },
+    {
+        "ArchStdEvent": "L2D_CACHE_INVAL",
     },
     {
         "ArchStdEvent": "BUS_ACCESS_RD",
@@ -56,6 +53,18 @@
     {
         "ArchStdEvent": "BUS_ACCESS_WR",
     },
+    {
+        "ArchStdEvent": "BUS_ACCESS_SHARED",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_NOT_SHARED",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_NORMAL",
+    },
+    {
+        "ArchStdEvent": "BUS_ACCESS_PERIPH",
+    },
     {
         "ArchStdEvent": "MEM_ACCESS_RD",
     },
@@ -71,6 +80,57 @@
     {
         "ArchStdEvent": "UNALIGNED_LDST_SPEC",
     },
+    {
+        "ArchStdEvent": "LDREX_SPEC",
+    },
+    {
+        "ArchStdEvent": "STREX_PASS_SPEC",
+    },
+    {
+        "ArchStdEvent": "STREX_FAIL_SPEC",
+    },
+    {
+        "ArchStdEvent": "LD_SPEC",
+    },
+    {
+        "ArchStdEvent": "ST_SPEC",
+    },
+    {
+        "ArchStdEvent": "LDST_SPEC",
+    },
+    {
+        "ArchStdEvent": "DP_SPEC",
+    },
+    {
+        "ArchStdEvent": "ASE_SPEC",
+    },
+    {
+        "ArchStdEvent": "VFP_SPEC",
+    },
+    {
+        "ArchStdEvent": "PC_WRITE_SPEC",
+    },
+    {
+        "ArchStdEvent": "CRYPTO_SPEC",
+    },
+    {
+        "ArchStdEvent": "BR_IMMED_SPEC",
+    },
+    {
+        "ArchStdEvent": "BR_RETURN_SPEC",
+    },
+    {
+        "ArchStdEvent": "BR_INDIRECT_SPEC",
+    },
+    {
+        "ArchStdEvent": "ISB_SPEC",
+    },
+    {
+        "ArchStdEvent": "DSB_SPEC",
+    },
+    {
+        "ArchStdEvent": "DMB_SPEC",
+    },
     {
         "ArchStdEvent": "EXC_UNDEF",
     },
@@ -109,5 +169,11 @@
     },
     {
         "ArchStdEvent": "EXC_TRAP_FIQ",
-    }
+    },
+    {
+        "ArchStdEvent": "RC_LD_SPEC",
+    },
+    {
+        "ArchStdEvent": "RC_ST_SPEC",
+    },
 ]
tools/perf/pmu-events/arch/arm64/mapfile.csv +2 -0
index 013155f1eb58..927fcddcb4aa 100644
@@ -14,6 +14,8 @@
 #Family-model,Version,Filename,EventType
 0x00000000410fd030,v1,arm/cortex-a53,core
 0x00000000420f1000,v1,arm/cortex-a53,core
+0x00000000410fd070,v1,arm/cortex-a57-a72,core
+0x00000000410fd080,v1,arm/cortex-a57-a72,core
 0x00000000420f5160,v1,cavium/thunderx2,core
 0x00000000430f0af0,v1,cavium/thunderx2,core
 0x00000000480fd010,v1,hisilicon/hip08,core
#8 lore raw
In reply to Florian Fainelli

Em Mon, May 13, 2019 at 01:25:19PM -0700, Florian Fainelli escreveu:

Quoted 5 lines

Hi all,

Based on discussion about the last patch, it turned out that we can remove the [[:xdigit:]] wildcard entirely since get_cpuid_str() strips the revision bits anyway.

Thanks, applied.

- Arnaldo