aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Documentation/perf-list.txt10
-rw-r--r--tools/perf/Documentation/perf-record.txt4
-rw-r--r--tools/perf/Documentation/perf-stat.txt3
-rw-r--r--tools/perf/Makefile.config9
-rw-r--r--tools/perf/Makefile.perf10
-rw-r--r--tools/perf/arch/arm64/Makefile21
-rwxr-xr-xtools/perf/arch/arm64/entry/syscalls/mksyscalltbl62
-rw-r--r--tools/perf/arch/powerpc/util/skip-callchain-idx.c12
-rw-r--r--tools/perf/arch/s390/util/kvm-stat.c2
-rw-r--r--tools/perf/arch/x86/entry/syscalls/syscall_64.tbl2
-rw-r--r--tools/perf/arch/x86/util/perf_regs.c2
-rw-r--r--tools/perf/arch/x86/util/pmu.c1
-rw-r--r--tools/perf/arch/x86/util/tsc.c1
-rw-r--r--tools/perf/bench/Build1
-rw-r--r--tools/perf/bench/mem-memcpy-x86-64-asm.S1
-rw-r--r--tools/perf/bench/mem-memcpy-x86-64-lib.c24
-rw-r--r--tools/perf/bench/numa.c5
-rw-r--r--tools/perf/builtin-annotate.c11
-rw-r--r--tools/perf/builtin-c2c.c17
-rw-r--r--tools/perf/builtin-diff.c2
-rw-r--r--tools/perf/builtin-report.c7
-rw-r--r--tools/perf/builtin-script.c42
-rw-r--r--tools/perf/builtin-stat.c106
-rw-r--r--tools/perf/builtin-top.c2
-rw-r--r--tools/perf/builtin-trace.c19
-rwxr-xr-xtools/perf/check-headers.sh3
-rw-r--r--tools/perf/include/bpf/bpf.h3
-rw-r--r--tools/perf/jvmti/jvmti_agent.c3
-rw-r--r--tools/perf/perf.h3
-rw-r--r--tools/perf/pmu-events/Build2
-rw-r--r--tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json87
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z10/basic.json12
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z10/crypto.json16
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z10/extended.json18
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z13/basic.json12
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z13/crypto.json16
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z13/extended.json56
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z13/transaction.json7
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z14/basic.json8
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z14/crypto.json16
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z14/extended.json53
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z14/transaction.json7
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z196/basic.json12
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z196/crypto.json16
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z196/extended.json24
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_zec12/basic.json12
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_zec12/crypto.json16
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_zec12/extended.json35
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_zec12/transaction.json7
-rw-r--r--tools/perf/pmu-events/jevents.c2
-rw-r--r--tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py40
-rwxr-xr-xtools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py4
-rw-r--r--tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py2
-rw-r--r--tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py11
-rw-r--r--tools/perf/scripts/python/sched-migration.py14
-rw-r--r--tools/perf/tests/builtin-test.c4
-rw-r--r--tools/perf/tests/parse-events.c43
-rwxr-xr-xtools/perf/tests/shell/record+probe_libc_inet_pton.sh69
-rwxr-xr-xtools/perf/tests/shell/trace+probe_vfs_getname.sh2
-rw-r--r--tools/perf/tests/topology.c1
-rw-r--r--tools/perf/trace/beauty/Build1
-rw-r--r--tools/perf/trace/beauty/beauty.h3
-rwxr-xr-xtools/perf/trace/beauty/drm_ioctl.sh9
-rwxr-xr-xtools/perf/trace/beauty/kcmp_type.sh2
-rwxr-xr-xtools/perf/trace/beauty/kvm_ioctl.sh4
-rwxr-xr-xtools/perf/trace/beauty/madvise_behavior.sh2
-rwxr-xr-xtools/perf/trace/beauty/perf_ioctl.sh2
-rwxr-xr-xtools/perf/trace/beauty/pkey_alloc_access_rights.sh2
-rwxr-xr-xtools/perf/trace/beauty/sndrv_ctl_ioctl.sh4
-rwxr-xr-xtools/perf/trace/beauty/sndrv_pcm_ioctl.sh4
-rw-r--r--tools/perf/trace/beauty/socket.c28
-rwxr-xr-xtools/perf/trace/beauty/socket_ipproto.sh11
-rwxr-xr-xtools/perf/trace/beauty/vhost_virtio_ioctl.sh6
-rw-r--r--tools/perf/ui/gtk/hists.c2
-rw-r--r--tools/perf/ui/stdio/hist.c8
-rw-r--r--tools/perf/util/bpf-loader.c4
-rw-r--r--tools/perf/util/c++/clang.cpp11
-rw-r--r--tools/perf/util/comm.c16
-rw-r--r--tools/perf/util/cs-etm-decoder/cs-etm-decoder.c10
-rw-r--r--tools/perf/util/cs-etm-decoder/cs-etm-decoder.h1
-rw-r--r--tools/perf/util/cs-etm.c71
-rw-r--r--tools/perf/util/evsel.c25
-rw-r--r--tools/perf/util/evsel.h9
-rw-r--r--tools/perf/util/header.c14
-rw-r--r--tools/perf/util/header.h1
-rw-r--r--tools/perf/util/hist.c12
-rw-r--r--tools/perf/util/hist.h6
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c2
-rw-r--r--tools/perf/util/llvm-utils.c6
-rw-r--r--tools/perf/util/machine.c79
-rw-r--r--tools/perf/util/metricgroup.c26
-rw-r--r--tools/perf/util/metricgroup.h1
-rw-r--r--tools/perf/util/namespaces.h1
-rw-r--r--tools/perf/util/parse-events.y5
-rw-r--r--tools/perf/util/pmu.c105
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c37
-rw-r--r--tools/perf/util/sort.h4
-rw-r--r--tools/perf/util/stat-shadow.c5
-rw-r--r--tools/perf/util/syscalltbl.c4
-rw-r--r--tools/perf/util/unwind-libdw.c2
-rw-r--r--tools/perf/util/unwind-libunwind-local.c2
101 files changed, 1270 insertions, 289 deletions
diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
index 11300dbe35c5..236b9b97dfdb 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -18,6 +18,10 @@ various perf commands with the -e option.
18 18
19OPTIONS 19OPTIONS
20------- 20-------
21-d::
22--desc::
23Print extra event descriptions. (default)
24
21--no-desc:: 25--no-desc::
22Don't print descriptions. 26Don't print descriptions.
23 27
@@ -25,11 +29,13 @@ Don't print descriptions.
25--long-desc:: 29--long-desc::
26Print longer event descriptions. 30Print longer event descriptions.
27 31
32--debug::
33Enable debugging output.
34
28--details:: 35--details::
29Print how named events are resolved internally into perf events, and also 36Print how named events are resolved internally into perf events, and also
30any extra expressions computed by perf stat. 37any extra expressions computed by perf stat.
31 38
32
33[[EVENT_MODIFIERS]] 39[[EVENT_MODIFIERS]]
34EVENT MODIFIERS 40EVENT MODIFIERS
35--------------- 41---------------
@@ -234,7 +240,7 @@ perf also supports group leader sampling using the :S specifier.
234 perf record -e '{cycles,instructions}:S' ... 240 perf record -e '{cycles,instructions}:S' ...
235 perf report --group 241 perf report --group
236 242
237Normally all events in a event group sample, but with :S only 243Normally all events in an event group sample, but with :S only
238the first event (the leader) samples, and it only reads the values of the 244the first event (the leader) samples, and it only reads the values of the
239other events in the group. 245other events in the group.
240 246
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 04168da4268e..246dee081efd 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -94,7 +94,7 @@ OPTIONS
94 "perf report" to view group events together. 94 "perf report" to view group events together.
95 95
96--filter=<filter>:: 96--filter=<filter>::
97 Event filter. This option should follow a event selector (-e) which 97 Event filter. This option should follow an event selector (-e) which
98 selects either tracepoint event(s) or a hardware trace PMU 98 selects either tracepoint event(s) or a hardware trace PMU
99 (e.g. Intel PT or CoreSight). 99 (e.g. Intel PT or CoreSight).
100 100
@@ -153,7 +153,7 @@ OPTIONS
153 153
154--exclude-perf:: 154--exclude-perf::
155 Don't record events issued by perf itself. This option should follow 155 Don't record events issued by perf itself. This option should follow
156 a event selector (-e) which selects tracepoint event(s). It adds a 156 an event selector (-e) which selects tracepoint event(s). It adds a
157 filter expression 'common_pid != $PERFPID' to filters. If other 157 filter expression 'common_pid != $PERFPID' to filters. If other
158 '--filter' exists, the new filter expression will be combined with 158 '--filter' exists, the new filter expression will be combined with
159 them by '&&'. 159 them by '&&'.
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index 5dfe102fb5b5..b10a90b6a718 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -178,6 +178,9 @@ Print count deltas for fixed number of times.
178This option should be used together with "-I" option. 178This option should be used together with "-I" option.
179 example: 'perf stat -I 1000 --interval-count 2 -e cycles -a' 179 example: 'perf stat -I 1000 --interval-count 2 -e cycles -a'
180 180
181--interval-clear::
182Clear the screen before next interval.
183
181--timeout msecs:: 184--timeout msecs::
182Stop the 'perf stat' session and print count deltas after N milliseconds (minimum: 10 ms). 185Stop the 'perf stat' session and print count deltas after N milliseconds (minimum: 10 ms).
183This option is not supported with the "-I" option. 186This option is not supported with the "-I" option.
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index b5ac356ba323..f6d1a03c7523 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -54,6 +54,8 @@ endif
54 54
55ifeq ($(SRCARCH),arm64) 55ifeq ($(SRCARCH),arm64)
56 NO_PERF_REGS := 0 56 NO_PERF_REGS := 0
57 NO_SYSCALL_TABLE := 0
58 CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
57 LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 59 LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
58endif 60endif
59 61
@@ -207,8 +209,7 @@ ifdef PYTHON_CONFIG
207 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) 209 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
208 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) 210 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
209 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil 211 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
210 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) 212 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
211 PYTHON_EMBED_CCOPTS := $(filter-out -specs=%,$(PYTHON_EMBED_CCOPTS))
212 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) 213 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
213endif 214endif
214 215
@@ -906,8 +907,8 @@ bindir = $(abspath $(prefix)/$(bindir_relative))
906mandir = share/man 907mandir = share/man
907infodir = share/info 908infodir = share/info
908perfexecdir = libexec/perf-core 909perfexecdir = libexec/perf-core
909perf_include_dir = lib/include/perf 910perf_include_dir = lib/perf/include
910perf_examples_dir = lib/examples/perf 911perf_examples_dir = lib/perf/examples
911sharedir = $(prefix)/share 912sharedir = $(prefix)/share
912template_dir = share/perf-core/templates 913template_dir = share/perf-core/templates
913STRACE_GROUPS_DIR = share/perf-core/strace/groups 914STRACE_GROUPS_DIR = share/perf-core/strace/groups
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index ecc9fc952655..b3d1b12a5081 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -384,6 +384,8 @@ export INSTALL SHELL_PATH
384 384
385SHELL = $(SHELL_PATH) 385SHELL = $(SHELL_PATH)
386 386
387linux_uapi_dir := $(srctree)/tools/include/uapi/linux
388
387beauty_outdir := $(OUTPUT)trace/beauty/generated 389beauty_outdir := $(OUTPUT)trace/beauty/generated
388beauty_ioctl_outdir := $(beauty_outdir)/ioctl 390beauty_ioctl_outdir := $(beauty_outdir)/ioctl
389drm_ioctl_array := $(beauty_ioctl_outdir)/drm_ioctl_array.c 391drm_ioctl_array := $(beauty_ioctl_outdir)/drm_ioctl_array.c
@@ -431,6 +433,12 @@ kvm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/kvm_ioctl.sh
431$(kvm_ioctl_array): $(kvm_hdr_dir)/kvm.h $(kvm_ioctl_tbl) 433$(kvm_ioctl_array): $(kvm_hdr_dir)/kvm.h $(kvm_ioctl_tbl)
432 $(Q)$(SHELL) '$(kvm_ioctl_tbl)' $(kvm_hdr_dir) > $@ 434 $(Q)$(SHELL) '$(kvm_ioctl_tbl)' $(kvm_hdr_dir) > $@
433 435
436socket_ipproto_array := $(beauty_outdir)/socket_ipproto_array.c
437socket_ipproto_tbl := $(srctree)/tools/perf/trace/beauty/socket_ipproto.sh
438
439$(socket_ipproto_array): $(linux_uapi_dir)/in.h $(socket_ipproto_tbl)
440 $(Q)$(SHELL) '$(socket_ipproto_tbl)' $(linux_uapi_dir) > $@
441
434vhost_virtio_ioctl_array := $(beauty_ioctl_outdir)/vhost_virtio_ioctl_array.c 442vhost_virtio_ioctl_array := $(beauty_ioctl_outdir)/vhost_virtio_ioctl_array.c
435vhost_virtio_hdr_dir := $(srctree)/tools/include/uapi/linux 443vhost_virtio_hdr_dir := $(srctree)/tools/include/uapi/linux
436vhost_virtio_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/vhost_virtio_ioctl.sh 444vhost_virtio_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/vhost_virtio_ioctl.sh
@@ -566,6 +574,7 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc
566 $(sndrv_ctl_ioctl_array) \ 574 $(sndrv_ctl_ioctl_array) \
567 $(kcmp_type_array) \ 575 $(kcmp_type_array) \
568 $(kvm_ioctl_array) \ 576 $(kvm_ioctl_array) \
577 $(socket_ipproto_array) \
569 $(vhost_virtio_ioctl_array) \ 578 $(vhost_virtio_ioctl_array) \
570 $(madvise_behavior_array) \ 579 $(madvise_behavior_array) \
571 $(perf_ioctl_array) \ 580 $(perf_ioctl_array) \
@@ -860,6 +869,7 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea
860 $(OUTPUT)$(sndrv_pcm_ioctl_array) \ 869 $(OUTPUT)$(sndrv_pcm_ioctl_array) \
861 $(OUTPUT)$(kvm_ioctl_array) \ 870 $(OUTPUT)$(kvm_ioctl_array) \
862 $(OUTPUT)$(kcmp_type_array) \ 871 $(OUTPUT)$(kcmp_type_array) \
872 $(OUTPUT)$(socket_ipproto_array) \
863 $(OUTPUT)$(vhost_virtio_ioctl_array) \ 873 $(OUTPUT)$(vhost_virtio_ioctl_array) \
864 $(OUTPUT)$(perf_ioctl_array) \ 874 $(OUTPUT)$(perf_ioctl_array) \
865 $(OUTPUT)$(prctl_option_array) \ 875 $(OUTPUT)$(prctl_option_array) \
diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile
index 91de4860faad..f013b115dc86 100644
--- a/tools/perf/arch/arm64/Makefile
+++ b/tools/perf/arch/arm64/Makefile
@@ -4,3 +4,24 @@ PERF_HAVE_DWARF_REGS := 1
4endif 4endif
5PERF_HAVE_JITDUMP := 1 5PERF_HAVE_JITDUMP := 1
6PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1 6PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
7
8#
9# Syscall table generation for perf
10#
11
12out := $(OUTPUT)arch/arm64/include/generated/asm
13header := $(out)/syscalls.c
14sysdef := $(srctree)/tools/include/uapi/asm-generic/unistd.h
15sysprf := $(srctree)/tools/perf/arch/arm64/entry/syscalls/
16systbl := $(sysprf)/mksyscalltbl
17
18# Create output directory if not already present
19_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
20
21$(header): $(sysdef) $(systbl)
22 $(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(sysdef) > $@
23
24clean::
25 $(call QUIET_CLEAN, arm64) $(RM) $(header)
26
27archheaders: $(header)
diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
new file mode 100755
index 000000000000..52e197317d3e
--- /dev/null
+++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
@@ -0,0 +1,62 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Generate system call table for perf. Derived from
5# powerpc script.
6#
7# Copyright IBM Corp. 2017
8# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
9# Changed by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
10# Changed by: Kim Phillips <kim.phillips@arm.com>
11
12gcc=$1
13hostcc=$2
14input=$3
15
16if ! test -r $input; then
17 echo "Could not read input file" >&2
18 exit 1
19fi
20
21create_table_from_c()
22{
23 local sc nr last_sc
24
25 create_table_exe=`mktemp /tmp/create-table-XXXXXX`
26
27 {
28
29 cat <<-_EoHEADER
30 #include <stdio.h>
31 #define __ARCH_WANT_RENAMEAT
32 #include "$input"
33 int main(int argc, char *argv[])
34 {
35 _EoHEADER
36
37 while read sc nr; do
38 printf "%s\n" " printf(\"\\t[%d] = \\\"$sc\\\",\\n\", __NR_$sc);"
39 last_sc=$sc
40 done
41
42 printf "%s\n" " printf(\"#define SYSCALLTBL_ARM64_MAX_ID %d\\n\", __NR_$last_sc);"
43 printf "}\n"
44
45 } | $hostcc -o $create_table_exe -x c -
46
47 $create_table_exe
48
49 rm -f $create_table_exe
50}
51
52create_table()
53{
54 echo "static const char *syscalltbl_arm64[] = {"
55 create_table_from_c
56 echo "};"
57}
58
59$gcc -E -dM -x c $input \
60 |sed -ne 's/^#define __NR_//p' \
61 |sort -t' ' -k2 -nu \
62 |create_table
diff --git a/tools/perf/arch/powerpc/util/skip-callchain-idx.c b/tools/perf/arch/powerpc/util/skip-callchain-idx.c
index 3598b8b75d27..7c6eeb4633fe 100644
--- a/tools/perf/arch/powerpc/util/skip-callchain-idx.c
+++ b/tools/perf/arch/powerpc/util/skip-callchain-idx.c
@@ -58,9 +58,13 @@ static int check_return_reg(int ra_regno, Dwarf_Frame *frame)
58 } 58 }
59 59
60 /* 60 /*
61 * Check if return address is on the stack. 61 * Check if return address is on the stack. If return address
62 * is in a register (typically R0), it is yet to be saved on
63 * the stack.
62 */ 64 */
63 if (nops != 0 || ops != NULL) 65 if ((nops != 0 || ops != NULL) &&
66 !(nops == 1 && ops[0].atom == DW_OP_regx &&
67 ops[0].number2 == 0 && ops[0].offset == 0))
64 return 0; 68 return 0;
65 69
66 /* 70 /*
@@ -243,10 +247,10 @@ int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain)
243 u64 ip; 247 u64 ip;
244 u64 skip_slot = -1; 248 u64 skip_slot = -1;
245 249
246 if (chain->nr < 3) 250 if (!chain || chain->nr < 3)
247 return skip_slot; 251 return skip_slot;
248 252
249 ip = chain->ips[2]; 253 ip = chain->ips[1];
250 254
251 thread__find_symbol(thread, PERF_RECORD_MISC_USER, ip, &al); 255 thread__find_symbol(thread, PERF_RECORD_MISC_USER, ip, &al);
252 256
diff --git a/tools/perf/arch/s390/util/kvm-stat.c b/tools/perf/arch/s390/util/kvm-stat.c
index d233e2eb9592..aaabab5e2830 100644
--- a/tools/perf/arch/s390/util/kvm-stat.c
+++ b/tools/perf/arch/s390/util/kvm-stat.c
@@ -102,7 +102,7 @@ const char * const kvm_skip_events[] = {
102 102
103int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid) 103int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid)
104{ 104{
105 if (strstr(cpuid, "IBM/S390")) { 105 if (strstr(cpuid, "IBM")) {
106 kvm->exit_reasons = sie_exit_reasons; 106 kvm->exit_reasons = sie_exit_reasons;
107 kvm->exit_reasons_isa = "SIE"; 107 kvm->exit_reasons_isa = "SIE";
108 } else 108 } else
diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
index 4dfe42666d0c..f0b1709a5ffb 100644
--- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
@@ -341,6 +341,8 @@
341330 common pkey_alloc __x64_sys_pkey_alloc 341330 common pkey_alloc __x64_sys_pkey_alloc
342331 common pkey_free __x64_sys_pkey_free 342331 common pkey_free __x64_sys_pkey_free
343332 common statx __x64_sys_statx 343332 common statx __x64_sys_statx
344333 common io_pgetevents __x64_sys_io_pgetevents
345334 common rseq __x64_sys_rseq
344 346
345# 347#
346# x32-specific system call numbers start at 512 to avoid cache impact 348# x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c
index 4b2caf6d48e7..fead6b3b4206 100644
--- a/tools/perf/arch/x86/util/perf_regs.c
+++ b/tools/perf/arch/x86/util/perf_regs.c
@@ -226,7 +226,7 @@ int arch_sdt_arg_parse_op(char *old_op, char **new_op)
226 else if (rm[2].rm_so != rm[2].rm_eo) 226 else if (rm[2].rm_so != rm[2].rm_eo)
227 prefix[0] = '+'; 227 prefix[0] = '+';
228 else 228 else
229 strncpy(prefix, "+0", 2); 229 scnprintf(prefix, sizeof(prefix), "+0");
230 } 230 }
231 231
232 /* Rename register */ 232 /* Rename register */
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c
index 63a74c32ddc5..e33ef5bc31c5 100644
--- a/tools/perf/arch/x86/util/pmu.c
+++ b/tools/perf/arch/x86/util/pmu.c
@@ -1,6 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <string.h> 2#include <string.h>
3 3
4#include <linux/stddef.h>
4#include <linux/perf_event.h> 5#include <linux/perf_event.h>
5 6
6#include "../../util/intel-pt.h" 7#include "../../util/intel-pt.h"
diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
index 06bae7023a51..950539f9a4f7 100644
--- a/tools/perf/arch/x86/util/tsc.c
+++ b/tools/perf/arch/x86/util/tsc.c
@@ -2,6 +2,7 @@
2#include <stdbool.h> 2#include <stdbool.h>
3#include <errno.h> 3#include <errno.h>
4 4
5#include <linux/stddef.h>
5#include <linux/perf_event.h> 6#include <linux/perf_event.h>
6 7
7#include "../../perf.h" 8#include "../../perf.h"
diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build
index 60bf11943047..eafce1a130a1 100644
--- a/tools/perf/bench/Build
+++ b/tools/perf/bench/Build
@@ -7,6 +7,7 @@ perf-y += futex-wake-parallel.o
7perf-y += futex-requeue.o 7perf-y += futex-requeue.o
8perf-y += futex-lock-pi.o 8perf-y += futex-lock-pi.o
9 9
10perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-lib.o
10perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o 11perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
11perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o 12perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
12 13
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S
index b43f8d2a34ec..9ad015a1e202 100644
--- a/tools/perf/bench/mem-memcpy-x86-64-asm.S
+++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S
@@ -6,6 +6,7 @@
6#define altinstr_replacement text 6#define altinstr_replacement text
7#define globl p2align 4; .globl 7#define globl p2align 4; .globl
8#define _ASM_EXTABLE_FAULT(x, y) 8#define _ASM_EXTABLE_FAULT(x, y)
9#define _ASM_EXTABLE(x, y)
9 10
10#include "../../arch/x86/lib/memcpy_64.S" 11#include "../../arch/x86/lib/memcpy_64.S"
11/* 12/*
diff --git a/tools/perf/bench/mem-memcpy-x86-64-lib.c b/tools/perf/bench/mem-memcpy-x86-64-lib.c
new file mode 100644
index 000000000000..4130734dde84
--- /dev/null
+++ b/tools/perf/bench/mem-memcpy-x86-64-lib.c
@@ -0,0 +1,24 @@
1/*
2 * From code in arch/x86/lib/usercopy_64.c, copied to keep tools/ copy
3 * of the kernel's arch/x86/lib/memcpy_64.s used in 'perf bench mem memcpy'
4 * happy.
5 */
6#include <linux/types.h>
7
8unsigned long __memcpy_mcsafe(void *dst, const void *src, size_t cnt);
9unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len);
10
11unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len)
12{
13 for (; len; --len, to++, from++) {
14 /*
15 * Call the assembly routine back directly since
16 * memcpy_mcsafe() may silently fallback to memcpy.
17 */
18 unsigned long rem = __memcpy_mcsafe(to, from, 1);
19
20 if (rem)
21 break;
22 }
23 return len;
24}
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 63eb49082774..44195514b19e 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -1098,7 +1098,7 @@ static void *worker_thread(void *__tdata)
1098 u8 *global_data; 1098 u8 *global_data;
1099 u8 *process_data; 1099 u8 *process_data;
1100 u8 *thread_data; 1100 u8 *thread_data;
1101 u64 bytes_done; 1101 u64 bytes_done, secs;
1102 long work_done; 1102 long work_done;
1103 u32 l; 1103 u32 l;
1104 struct rusage rusage; 1104 struct rusage rusage;
@@ -1254,7 +1254,8 @@ static void *worker_thread(void *__tdata)
1254 timersub(&stop, &start0, &diff); 1254 timersub(&stop, &start0, &diff);
1255 td->runtime_ns = diff.tv_sec * NSEC_PER_SEC; 1255 td->runtime_ns = diff.tv_sec * NSEC_PER_SEC;
1256 td->runtime_ns += diff.tv_usec * NSEC_PER_USEC; 1256 td->runtime_ns += diff.tv_usec * NSEC_PER_USEC;
1257 td->speed_gbs = bytes_done / (td->runtime_ns / NSEC_PER_SEC) / 1e9; 1257 secs = td->runtime_ns / NSEC_PER_SEC;
1258 td->speed_gbs = secs ? bytes_done / secs / 1e9 : 0;
1258 1259
1259 getrusage(RUSAGE_THREAD, &rusage); 1260 getrusage(RUSAGE_THREAD, &rusage);
1260 td->system_time_ns = rusage.ru_stime.tv_sec * NSEC_PER_SEC; 1261 td->system_time_ns = rusage.ru_stime.tv_sec * NSEC_PER_SEC;
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 5eb22cc56363..8180319285af 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -283,6 +283,15 @@ out_put:
283 return ret; 283 return ret;
284} 284}
285 285
286static int process_feature_event(struct perf_tool *tool,
287 union perf_event *event,
288 struct perf_session *session)
289{
290 if (event->feat.feat_id < HEADER_LAST_FEATURE)
291 return perf_event__process_feature(tool, event, session);
292 return 0;
293}
294
286static int hist_entry__tty_annotate(struct hist_entry *he, 295static int hist_entry__tty_annotate(struct hist_entry *he,
287 struct perf_evsel *evsel, 296 struct perf_evsel *evsel,
288 struct perf_annotate *ann) 297 struct perf_annotate *ann)
@@ -471,7 +480,7 @@ int cmd_annotate(int argc, const char **argv)
471 .attr = perf_event__process_attr, 480 .attr = perf_event__process_attr,
472 .build_id = perf_event__process_build_id, 481 .build_id = perf_event__process_build_id,
473 .tracing_data = perf_event__process_tracing_data, 482 .tracing_data = perf_event__process_tracing_data,
474 .feature = perf_event__process_feature, 483 .feature = process_feature_event,
475 .ordered_events = true, 484 .ordered_events = true,
476 .ordering_requires_timestamps = true, 485 .ordering_requires_timestamps = true,
477 }, 486 },
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 307b3594525f..f3aa9d02a5ab 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -56,16 +56,16 @@ struct c2c_hist_entry {
56 56
57 struct compute_stats cstats; 57 struct compute_stats cstats;
58 58
59 unsigned long paddr;
60 unsigned long paddr_cnt;
61 bool paddr_zero;
62 char *nodestr;
63
59 /* 64 /*
60 * must be at the end, 65 * must be at the end,
61 * because of its callchain dynamic entry 66 * because of its callchain dynamic entry
62 */ 67 */
63 struct hist_entry he; 68 struct hist_entry he;
64
65 unsigned long paddr;
66 unsigned long paddr_cnt;
67 bool paddr_zero;
68 char *nodestr;
69}; 69};
70 70
71static char const *coalesce_default = "pid,iaddr"; 71static char const *coalesce_default = "pid,iaddr";
@@ -2193,7 +2193,7 @@ static void print_cacheline(struct c2c_hists *c2c_hists,
2193 fprintf(out, "%s\n", bf); 2193 fprintf(out, "%s\n", bf);
2194 fprintf(out, " -------------------------------------------------------------\n"); 2194 fprintf(out, " -------------------------------------------------------------\n");
2195 2195
2196 hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, true); 2196 hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, false);
2197} 2197}
2198 2198
2199static void print_pareto(FILE *out) 2199static void print_pareto(FILE *out)
@@ -2268,7 +2268,7 @@ static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session)
2268 fprintf(out, "=================================================\n"); 2268 fprintf(out, "=================================================\n");
2269 fprintf(out, "#\n"); 2269 fprintf(out, "#\n");
2270 2270
2271 hists__fprintf(&c2c.hists.hists, true, 0, 0, 0, stdout, false); 2271 hists__fprintf(&c2c.hists.hists, true, 0, 0, 0, stdout, true);
2272 2272
2273 fprintf(out, "\n"); 2273 fprintf(out, "\n");
2274 fprintf(out, "=================================================\n"); 2274 fprintf(out, "=================================================\n");
@@ -2349,6 +2349,9 @@ static int perf_c2c__browse_cacheline(struct hist_entry *he)
2349 " s Toggle full length of symbol and source line columns \n" 2349 " s Toggle full length of symbol and source line columns \n"
2350 " q Return back to cacheline list \n"; 2350 " q Return back to cacheline list \n";
2351 2351
2352 if (!he)
2353 return 0;
2354
2352 /* Display compact version first. */ 2355 /* Display compact version first. */
2353 c2c.symbol_full = false; 2356 c2c.symbol_full = false;
2354 2357
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index d660cb7b222b..39db2ee32d48 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -696,7 +696,7 @@ static void hists__process(struct hists *hists)
696 hists__output_resort(hists, NULL); 696 hists__output_resort(hists, NULL);
697 697
698 hists__fprintf(hists, !quiet, 0, 0, 0, stdout, 698 hists__fprintf(hists, !quiet, 0, 0, 0, stdout,
699 symbol_conf.use_callchain); 699 !symbol_conf.use_callchain);
700} 700}
701 701
702static void data__fprintf(void) 702static void data__fprintf(void)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index cdb5b6949832..02f7a3c27761 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -217,7 +217,8 @@ static int process_feature_event(struct perf_tool *tool,
217 } 217 }
218 218
219 /* 219 /*
220 * All features are received, we can force the 220 * (feat_id = HEADER_LAST_FEATURE) is the end marker which
221 * means all features are received, now we can force the
221 * group if needed. 222 * group if needed.
222 */ 223 */
223 setup_forced_leader(rep, session->evlist); 224 setup_forced_leader(rep, session->evlist);
@@ -477,8 +478,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
477 478
478 hists__fprintf_nr_sample_events(hists, rep, evname, stdout); 479 hists__fprintf_nr_sample_events(hists, rep, evname, stdout);
479 hists__fprintf(hists, !quiet, 0, 0, rep->min_percent, stdout, 480 hists__fprintf(hists, !quiet, 0, 0, rep->min_percent, stdout,
480 symbol_conf.use_callchain || 481 !(symbol_conf.use_callchain ||
481 symbol_conf.show_branchflag_count); 482 symbol_conf.show_branchflag_count));
482 fprintf(stdout, "\n\n"); 483 fprintf(stdout, "\n\n");
483 } 484 }
484 485
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index b3bf35512d21..568ddfac3213 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -180,6 +180,18 @@ static struct {
180 PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE 180 PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE
181 }, 181 },
182 182
183 [PERF_TYPE_HW_CACHE] = {
184 .user_set = false,
185
186 .fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
187 PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
188 PERF_OUTPUT_EVNAME | PERF_OUTPUT_IP |
189 PERF_OUTPUT_SYM | PERF_OUTPUT_SYMOFFSET |
190 PERF_OUTPUT_DSO | PERF_OUTPUT_PERIOD,
191
192 .invalid_fields = PERF_OUTPUT_TRACE | PERF_OUTPUT_BPF_OUTPUT,
193 },
194
183 [PERF_TYPE_RAW] = { 195 [PERF_TYPE_RAW] = {
184 .user_set = false, 196 .user_set = false,
185 197
@@ -1822,6 +1834,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event,
1822 struct perf_evlist *evlist; 1834 struct perf_evlist *evlist;
1823 struct perf_evsel *evsel, *pos; 1835 struct perf_evsel *evsel, *pos;
1824 int err; 1836 int err;
1837 static struct perf_evsel_script *es;
1825 1838
1826 err = perf_event__process_attr(tool, event, pevlist); 1839 err = perf_event__process_attr(tool, event, pevlist);
1827 if (err) 1840 if (err)
@@ -1830,6 +1843,19 @@ static int process_attr(struct perf_tool *tool, union perf_event *event,
1830 evlist = *pevlist; 1843 evlist = *pevlist;
1831 evsel = perf_evlist__last(*pevlist); 1844 evsel = perf_evlist__last(*pevlist);
1832 1845
1846 if (!evsel->priv) {
1847 if (scr->per_event_dump) {
1848 evsel->priv = perf_evsel_script__new(evsel,
1849 scr->session->data);
1850 } else {
1851 es = zalloc(sizeof(*es));
1852 if (!es)
1853 return -ENOMEM;
1854 es->fp = stdout;
1855 evsel->priv = es;
1856 }
1857 }
1858
1833 if (evsel->attr.type >= PERF_TYPE_MAX && 1859 if (evsel->attr.type >= PERF_TYPE_MAX &&
1834 evsel->attr.type != PERF_TYPE_SYNTH) 1860 evsel->attr.type != PERF_TYPE_SYNTH)
1835 return 0; 1861 return 0;
@@ -3018,6 +3044,15 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused,
3018 return set_maps(script); 3044 return set_maps(script);
3019} 3045}
3020 3046
3047static int process_feature_event(struct perf_tool *tool,
3048 union perf_event *event,
3049 struct perf_session *session)
3050{
3051 if (event->feat.feat_id < HEADER_LAST_FEATURE)
3052 return perf_event__process_feature(tool, event, session);
3053 return 0;
3054}
3055
3021#ifdef HAVE_AUXTRACE_SUPPORT 3056#ifdef HAVE_AUXTRACE_SUPPORT
3022static int perf_script__process_auxtrace_info(struct perf_tool *tool, 3057static int perf_script__process_auxtrace_info(struct perf_tool *tool,
3023 union perf_event *event, 3058 union perf_event *event,
@@ -3062,7 +3097,7 @@ int cmd_script(int argc, const char **argv)
3062 .attr = process_attr, 3097 .attr = process_attr,
3063 .event_update = perf_event__process_event_update, 3098 .event_update = perf_event__process_event_update,
3064 .tracing_data = perf_event__process_tracing_data, 3099 .tracing_data = perf_event__process_tracing_data,
3065 .feature = perf_event__process_feature, 3100 .feature = process_feature_event,
3066 .build_id = perf_event__process_build_id, 3101 .build_id = perf_event__process_build_id,
3067 .id_index = perf_event__process_id_index, 3102 .id_index = perf_event__process_id_index,
3068 .auxtrace_info = perf_script__process_auxtrace_info, 3103 .auxtrace_info = perf_script__process_auxtrace_info,
@@ -3113,8 +3148,9 @@ int cmd_script(int argc, const char **argv)
3113 "+field to add and -field to remove." 3148 "+field to add and -field to remove."
3114 "Valid types: hw,sw,trace,raw,synth. " 3149 "Valid types: hw,sw,trace,raw,synth. "
3115 "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," 3150 "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
3116 "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," 3151 "addr,symoff,srcline,period,iregs,uregs,brstack,"
3117 "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr", 3152 "brstacksym,flags,bpf-output,brstackinsn,brstackoff,"
3153 "callindent,insn,insnlen,synth,phys_addr,metric,misc",
3118 parse_output_fields), 3154 parse_output_fields),
3119 OPT_BOOLEAN('a', "all-cpus", &system_wide, 3155 OPT_BOOLEAN('a', "all-cpus", &system_wide,
3120 "system-wide collection from all CPUs"), 3156 "system-wide collection from all CPUs"),
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 096ccb25c11f..d097b5b47eb8 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -65,6 +65,7 @@
65#include "util/tool.h" 65#include "util/tool.h"
66#include "util/string2.h" 66#include "util/string2.h"
67#include "util/metricgroup.h" 67#include "util/metricgroup.h"
68#include "util/top.h"
68#include "asm/bug.h" 69#include "asm/bug.h"
69 70
70#include <linux/time64.h> 71#include <linux/time64.h>
@@ -144,6 +145,8 @@ static struct target target = {
144 145
145typedef int (*aggr_get_id_t)(struct cpu_map *m, int cpu); 146typedef int (*aggr_get_id_t)(struct cpu_map *m, int cpu);
146 147
148#define METRIC_ONLY_LEN 20
149
147static int run_count = 1; 150static int run_count = 1;
148static bool no_inherit = false; 151static bool no_inherit = false;
149static volatile pid_t child_pid = -1; 152static volatile pid_t child_pid = -1;
@@ -173,6 +176,7 @@ static struct cpu_map *aggr_map;
173static aggr_get_id_t aggr_get_id; 176static aggr_get_id_t aggr_get_id;
174static bool append_file; 177static bool append_file;
175static bool interval_count; 178static bool interval_count;
179static bool interval_clear;
176static const char *output_name; 180static const char *output_name;
177static int output_fd; 181static int output_fd;
178static int print_free_counters_hint; 182static int print_free_counters_hint;
@@ -180,6 +184,7 @@ static int print_mixed_hw_group_error;
180static u64 *walltime_run; 184static u64 *walltime_run;
181static bool ru_display = false; 185static bool ru_display = false;
182static struct rusage ru_data; 186static struct rusage ru_data;
187static unsigned int metric_only_len = METRIC_ONLY_LEN;
183 188
184struct perf_stat { 189struct perf_stat {
185 bool record; 190 bool record;
@@ -291,18 +296,6 @@ static int create_perf_stat_counter(struct perf_evsel *evsel)
291 return perf_evsel__open_per_thread(evsel, evsel_list->threads); 296 return perf_evsel__open_per_thread(evsel, evsel_list->threads);
292} 297}
293 298
294/*
295 * Does the counter have nsecs as a unit?
296 */
297static inline int nsec_counter(struct perf_evsel *evsel)
298{
299 if (perf_evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK) ||
300 perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK))
301 return 1;
302
303 return 0;
304}
305
306static int process_synthesized_event(struct perf_tool *tool __maybe_unused, 299static int process_synthesized_event(struct perf_tool *tool __maybe_unused,
307 union perf_event *event, 300 union perf_event *event,
308 struct perf_sample *sample __maybe_unused, 301 struct perf_sample *sample __maybe_unused,
@@ -967,8 +960,6 @@ static void print_metric_csv(void *ctx,
967 fprintf(out, "%s%s%s%s", csv_sep, vals, csv_sep, unit); 960 fprintf(out, "%s%s%s%s", csv_sep, vals, csv_sep, unit);
968} 961}
969 962
970#define METRIC_ONLY_LEN 20
971
972/* Filter out some columns that don't work well in metrics only mode */ 963/* Filter out some columns that don't work well in metrics only mode */
973 964
974static bool valid_only_metric(const char *unit) 965static bool valid_only_metric(const char *unit)
@@ -999,22 +990,20 @@ static void print_metric_only(void *ctx, const char *color, const char *fmt,
999{ 990{
1000 struct outstate *os = ctx; 991 struct outstate *os = ctx;
1001 FILE *out = os->fh; 992 FILE *out = os->fh;
1002 int n; 993 char buf[1024], str[1024];
1003 char buf[1024]; 994 unsigned mlen = metric_only_len;
1004 unsigned mlen = METRIC_ONLY_LEN;
1005 995
1006 if (!valid_only_metric(unit)) 996 if (!valid_only_metric(unit))
1007 return; 997 return;
1008 unit = fixunit(buf, os->evsel, unit); 998 unit = fixunit(buf, os->evsel, unit);
1009 if (color)
1010 n = color_fprintf(out, color, fmt, val);
1011 else
1012 n = fprintf(out, fmt, val);
1013 if (n > METRIC_ONLY_LEN)
1014 n = METRIC_ONLY_LEN;
1015 if (mlen < strlen(unit)) 999 if (mlen < strlen(unit))
1016 mlen = strlen(unit) + 1; 1000 mlen = strlen(unit) + 1;
1017 fprintf(out, "%*s", mlen - n, ""); 1001
1002 if (color)
1003 mlen += strlen(color) + sizeof(PERF_COLOR_RESET) - 1;
1004
1005 color_snprintf(str, sizeof(str), color ?: "", fmt, val);
1006 fprintf(out, "%*s ", mlen, str);
1018} 1007}
1019 1008
1020static void print_metric_only_csv(void *ctx, const char *color __maybe_unused, 1009static void print_metric_only_csv(void *ctx, const char *color __maybe_unused,
@@ -1054,35 +1043,7 @@ static void print_metric_header(void *ctx, const char *color __maybe_unused,
1054 if (csv_output) 1043 if (csv_output)
1055 fprintf(os->fh, "%s%s", unit, csv_sep); 1044 fprintf(os->fh, "%s%s", unit, csv_sep);
1056 else 1045 else
1057 fprintf(os->fh, "%-*s ", METRIC_ONLY_LEN, unit); 1046 fprintf(os->fh, "%*s ", metric_only_len, unit);
1058}
1059
1060static void nsec_printout(int id, int nr, struct perf_evsel *evsel, double avg)
1061{
1062 FILE *output = stat_config.output;
1063 double msecs = avg / NSEC_PER_MSEC;
1064 const char *fmt_v, *fmt_n;
1065 char name[25];
1066
1067 fmt_v = csv_output ? "%.6f%s" : "%18.6f%s";
1068 fmt_n = csv_output ? "%s" : "%-25s";
1069
1070 aggr_printout(evsel, id, nr);
1071
1072 scnprintf(name, sizeof(name), "%s%s",
1073 perf_evsel__name(evsel), csv_output ? "" : " (msec)");
1074
1075 fprintf(output, fmt_v, msecs, csv_sep);
1076
1077 if (csv_output)
1078 fprintf(output, "%s%s", evsel->unit, csv_sep);
1079 else
1080 fprintf(output, "%-*s%s", unit_width, evsel->unit, csv_sep);
1081
1082 fprintf(output, fmt_n, name);
1083
1084 if (evsel->cgrp)
1085 fprintf(output, "%s%s", csv_sep, evsel->cgrp->name);
1086} 1047}
1087 1048
1088static int first_shadow_cpu(struct perf_evsel *evsel, int id) 1049static int first_shadow_cpu(struct perf_evsel *evsel, int id)
@@ -1240,11 +1201,7 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval,
1240 return; 1201 return;
1241 } 1202 }
1242 1203
1243 if (metric_only) 1204 if (!metric_only)
1244 /* nothing */;
1245 else if (nsec_counter(counter))
1246 nsec_printout(id, nr, counter, uval);
1247 else
1248 abs_printout(id, nr, counter, uval); 1205 abs_printout(id, nr, counter, uval);
1249 1206
1250 out.print_metric = pm; 1207 out.print_metric = pm;
@@ -1330,7 +1287,7 @@ static void collect_all_aliases(struct perf_evsel *counter,
1330 alias->scale != counter->scale || 1287 alias->scale != counter->scale ||
1331 alias->cgrp != counter->cgrp || 1288 alias->cgrp != counter->cgrp ||
1332 strcmp(alias->unit, counter->unit) || 1289 strcmp(alias->unit, counter->unit) ||
1333 nsec_counter(alias) != nsec_counter(counter)) 1290 perf_evsel__is_clock(alias) != perf_evsel__is_clock(counter))
1334 break; 1291 break;
1335 alias->merged_stat = true; 1292 alias->merged_stat = true;
1336 cb(alias, data, false); 1293 cb(alias, data, false);
@@ -1704,9 +1661,12 @@ static void print_interval(char *prefix, struct timespec *ts)
1704 FILE *output = stat_config.output; 1661 FILE *output = stat_config.output;
1705 static int num_print_interval; 1662 static int num_print_interval;
1706 1663
1664 if (interval_clear)
1665 puts(CONSOLE_CLEAR);
1666
1707 sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, csv_sep); 1667 sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, csv_sep);
1708 1668
1709 if (num_print_interval == 0 && !csv_output) { 1669 if ((num_print_interval == 0 && !csv_output) || interval_clear) {
1710 switch (stat_config.aggr_mode) { 1670 switch (stat_config.aggr_mode) {
1711 case AGGR_SOCKET: 1671 case AGGR_SOCKET:
1712 fprintf(output, "# time socket cpus"); 1672 fprintf(output, "# time socket cpus");
@@ -1719,7 +1679,7 @@ static void print_interval(char *prefix, struct timespec *ts)
1719 fprintf(output, " counts %*s events\n", unit_width, "unit"); 1679 fprintf(output, " counts %*s events\n", unit_width, "unit");
1720 break; 1680 break;
1721 case AGGR_NONE: 1681 case AGGR_NONE:
1722 fprintf(output, "# time CPU"); 1682 fprintf(output, "# time CPU ");
1723 if (!metric_only) 1683 if (!metric_only)
1724 fprintf(output, " counts %*s events\n", unit_width, "unit"); 1684 fprintf(output, " counts %*s events\n", unit_width, "unit");
1725 break; 1685 break;
@@ -1738,7 +1698,7 @@ static void print_interval(char *prefix, struct timespec *ts)
1738 } 1698 }
1739 } 1699 }
1740 1700
1741 if (num_print_interval == 0 && metric_only) 1701 if ((num_print_interval == 0 || interval_clear) && metric_only)
1742 print_metric_headers(" ", true); 1702 print_metric_headers(" ", true);
1743 if (++num_print_interval == 25) 1703 if (++num_print_interval == 25)
1744 num_print_interval = 0; 1704 num_print_interval = 0;
@@ -2057,6 +2017,8 @@ static const struct option stat_options[] = {
2057 "(overhead is possible for values <= 100ms)"), 2017 "(overhead is possible for values <= 100ms)"),
2058 OPT_INTEGER(0, "interval-count", &stat_config.times, 2018 OPT_INTEGER(0, "interval-count", &stat_config.times,
2059 "print counts for fixed number of times"), 2019 "print counts for fixed number of times"),
2020 OPT_BOOLEAN(0, "interval-clear", &interval_clear,
2021 "clear screen in between new interval"),
2060 OPT_UINTEGER(0, "timeout", &stat_config.timeout, 2022 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
2061 "stop workload and print counts after a timeout period in ms (>= 10ms)"), 2023 "stop workload and print counts after a timeout period in ms (>= 10ms)"),
2062 OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode, 2024 OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode,
@@ -2436,13 +2398,24 @@ static int add_default_attributes(void)
2436 (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) | 2398 (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
2437 (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) }, 2399 (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) },
2438}; 2400};
2401 struct parse_events_error errinfo;
2439 2402
2440 /* Set attrs if no event is selected and !null_run: */ 2403 /* Set attrs if no event is selected and !null_run: */
2441 if (null_run) 2404 if (null_run)
2442 return 0; 2405 return 0;
2443 2406
2444 if (transaction_run) { 2407 if (transaction_run) {
2445 struct parse_events_error errinfo; 2408 /* Handle -T as -M transaction. Once platform specific metrics
2409 * support has been added to the json files, all archictures
2410 * will use this approach. To determine transaction support
2411 * on an architecture test for such a metric name.
2412 */
2413 if (metricgroup__has_metric("transaction")) {
2414 struct option opt = { .value = &evsel_list };
2415
2416 return metricgroup__parse_groups(&opt, "transaction",
2417 &metric_events);
2418 }
2446 2419
2447 if (pmu_have_event("cpu", "cycles-ct") && 2420 if (pmu_have_event("cpu", "cycles-ct") &&
2448 pmu_have_event("cpu", "el-start")) 2421 pmu_have_event("cpu", "el-start"))
@@ -2454,6 +2427,7 @@ static int add_default_attributes(void)
2454 &errinfo); 2427 &errinfo);
2455 if (err) { 2428 if (err) {
2456 fprintf(stderr, "Cannot set up transaction events\n"); 2429 fprintf(stderr, "Cannot set up transaction events\n");
2430 parse_events_print_error(&errinfo, transaction_attrs);
2457 return -1; 2431 return -1;
2458 } 2432 }
2459 return 0; 2433 return 0;
@@ -2479,10 +2453,11 @@ static int add_default_attributes(void)
2479 pmu_have_event("msr", "smi")) { 2453 pmu_have_event("msr", "smi")) {
2480 if (!force_metric_only) 2454 if (!force_metric_only)
2481 metric_only = true; 2455 metric_only = true;
2482 err = parse_events(evsel_list, smi_cost_attrs, NULL); 2456 err = parse_events(evsel_list, smi_cost_attrs, &errinfo);
2483 } else { 2457 } else {
2484 fprintf(stderr, "To measure SMI cost, it needs " 2458 fprintf(stderr, "To measure SMI cost, it needs "
2485 "msr/aperf/, msr/smi/ and cpu/cycles/ support\n"); 2459 "msr/aperf/, msr/smi/ and cpu/cycles/ support\n");
2460 parse_events_print_error(&errinfo, smi_cost_attrs);
2486 return -1; 2461 return -1;
2487 } 2462 }
2488 if (err) { 2463 if (err) {
@@ -2517,12 +2492,13 @@ static int add_default_attributes(void)
2517 if (topdown_attrs[0] && str) { 2492 if (topdown_attrs[0] && str) {
2518 if (warn) 2493 if (warn)
2519 arch_topdown_group_warn(); 2494 arch_topdown_group_warn();
2520 err = parse_events(evsel_list, str, NULL); 2495 err = parse_events(evsel_list, str, &errinfo);
2521 if (err) { 2496 if (err) {
2522 fprintf(stderr, 2497 fprintf(stderr,
2523 "Cannot set up top down events %s: %d\n", 2498 "Cannot set up top down events %s: %d\n",
2524 str, err); 2499 str, err);
2525 free(str); 2500 free(str);
2501 parse_events_print_error(&errinfo, str);
2526 return -1; 2502 return -1;
2527 } 2503 }
2528 } else { 2504 } else {
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index ffdc2769ff9f..d21d8751e749 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -307,7 +307,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
307 hists__output_recalc_col_len(hists, top->print_entries - printed); 307 hists__output_recalc_col_len(hists, top->print_entries - printed);
308 putchar('\n'); 308 putchar('\n');
309 hists__fprintf(hists, false, top->print_entries - printed, win_width, 309 hists__fprintf(hists, false, top->print_entries - printed, win_width,
310 top->min_percent, stdout, symbol_conf.use_callchain); 310 top->min_percent, stdout, !symbol_conf.use_callchain);
311} 311}
312 312
313static void prompt_integer(int *target, const char *msg) 313static void prompt_integer(int *target, const char *msg)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 6a748eca2edb..88561eed7950 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -291,7 +291,7 @@ size_t strarray__scnprintf(struct strarray *sa, char *bf, size_t size, const cha
291{ 291{
292 int idx = val - sa->offset; 292 int idx = val - sa->offset;
293 293
294 if (idx < 0 || idx >= sa->nr_entries) 294 if (idx < 0 || idx >= sa->nr_entries || sa->entries[idx] == NULL)
295 return scnprintf(bf, size, intfmt, val); 295 return scnprintf(bf, size, intfmt, val);
296 296
297 return scnprintf(bf, size, "%s", sa->entries[idx]); 297 return scnprintf(bf, size, "%s", sa->entries[idx]);
@@ -761,10 +761,12 @@ static struct syscall_fmt {
761 .arg = { [0] = STRARRAY(resource, rlimit_resources), }, }, 761 .arg = { [0] = STRARRAY(resource, rlimit_resources), }, },
762 { .name = "socket", 762 { .name = "socket",
763 .arg = { [0] = STRARRAY(family, socket_families), 763 .arg = { [0] = STRARRAY(family, socket_families),
764 [1] = { .scnprintf = SCA_SK_TYPE, /* type */ }, }, }, 764 [1] = { .scnprintf = SCA_SK_TYPE, /* type */ },
765 [2] = { .scnprintf = SCA_SK_PROTO, /* protocol */ }, }, },
765 { .name = "socketpair", 766 { .name = "socketpair",
766 .arg = { [0] = STRARRAY(family, socket_families), 767 .arg = { [0] = STRARRAY(family, socket_families),
767 [1] = { .scnprintf = SCA_SK_TYPE, /* type */ }, }, }, 768 [1] = { .scnprintf = SCA_SK_TYPE, /* type */ },
769 [2] = { .scnprintf = SCA_SK_PROTO, /* protocol */ }, }, },
768 { .name = "stat", .alias = "newstat", }, 770 { .name = "stat", .alias = "newstat", },
769 { .name = "statx", 771 { .name = "statx",
770 .arg = { [0] = { .scnprintf = SCA_FDAT, /* fdat */ }, 772 .arg = { [0] = { .scnprintf = SCA_FDAT, /* fdat */ },
@@ -2990,6 +2992,7 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
2990 2992
2991 if (trace__validate_ev_qualifier(trace)) 2993 if (trace__validate_ev_qualifier(trace))
2992 goto out; 2994 goto out;
2995 trace->trace_syscalls = true;
2993 } 2996 }
2994 2997
2995 err = 0; 2998 err = 0;
@@ -3045,7 +3048,7 @@ int cmd_trace(int argc, const char **argv)
3045 }, 3048 },
3046 .output = stderr, 3049 .output = stderr,
3047 .show_comm = true, 3050 .show_comm = true,
3048 .trace_syscalls = true, 3051 .trace_syscalls = false,
3049 .kernel_syscallchains = false, 3052 .kernel_syscallchains = false,
3050 .max_stack = UINT_MAX, 3053 .max_stack = UINT_MAX,
3051 }; 3054 };
@@ -3191,13 +3194,7 @@ int cmd_trace(int argc, const char **argv)
3191 3194
3192 if (!trace.trace_syscalls && !trace.trace_pgfaults && 3195 if (!trace.trace_syscalls && !trace.trace_pgfaults &&
3193 trace.evlist->nr_entries == 0 /* Was --events used? */) { 3196 trace.evlist->nr_entries == 0 /* Was --events used? */) {
3194 pr_err("Please specify something to trace.\n"); 3197 trace.trace_syscalls = true;
3195 return -1;
3196 }
3197
3198 if (!trace.trace_syscalls && trace.ev_qualifier) {
3199 pr_err("The -e option can't be used with --no-syscalls.\n");
3200 goto out;
3201 } 3198 }
3202 3199
3203 if (output_name != NULL) { 3200 if (output_name != NULL) {
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 10f333e2e825..de28466c0186 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -7,6 +7,7 @@ include/uapi/drm/i915_drm.h
7include/uapi/linux/fcntl.h 7include/uapi/linux/fcntl.h
8include/uapi/linux/kcmp.h 8include/uapi/linux/kcmp.h
9include/uapi/linux/kvm.h 9include/uapi/linux/kvm.h
10include/uapi/linux/in.h
10include/uapi/linux/perf_event.h 11include/uapi/linux/perf_event.h
11include/uapi/linux/prctl.h 12include/uapi/linux/prctl.h
12include/uapi/linux/sched.h 13include/uapi/linux/sched.h
@@ -35,6 +36,7 @@ arch/s390/include/uapi/asm/ptrace.h
35arch/s390/include/uapi/asm/sie.h 36arch/s390/include/uapi/asm/sie.h
36arch/arm/include/uapi/asm/kvm.h 37arch/arm/include/uapi/asm/kvm.h
37arch/arm64/include/uapi/asm/kvm.h 38arch/arm64/include/uapi/asm/kvm.h
39arch/arm64/include/uapi/asm/unistd.h
38arch/alpha/include/uapi/asm/errno.h 40arch/alpha/include/uapi/asm/errno.h
39arch/mips/include/asm/errno.h 41arch/mips/include/asm/errno.h
40arch/mips/include/uapi/asm/errno.h 42arch/mips/include/uapi/asm/errno.h
@@ -53,6 +55,7 @@ include/uapi/asm-generic/errno.h
53include/uapi/asm-generic/errno-base.h 55include/uapi/asm-generic/errno-base.h
54include/uapi/asm-generic/ioctls.h 56include/uapi/asm-generic/ioctls.h
55include/uapi/asm-generic/mman-common.h 57include/uapi/asm-generic/mman-common.h
58include/uapi/asm-generic/unistd.h
56' 59'
57 60
58check_2 () { 61check_2 () {
diff --git a/tools/perf/include/bpf/bpf.h b/tools/perf/include/bpf/bpf.h
index dd764ad5efdf..a63aa6241b7f 100644
--- a/tools/perf/include/bpf/bpf.h
+++ b/tools/perf/include/bpf/bpf.h
@@ -1,6 +1,9 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#ifndef _PERF_BPF_H 2#ifndef _PERF_BPF_H
3#define _PERF_BPF_H 3#define _PERF_BPF_H
4
5#include <uapi/linux/bpf.h>
6
4#define SEC(NAME) __attribute__((section(NAME), used)) 7#define SEC(NAME) __attribute__((section(NAME), used))
5 8
6#define probe(function, vars) \ 9#define probe(function, vars) \
diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c
index 0c6d1002b524..ac1bcdc17dae 100644
--- a/tools/perf/jvmti/jvmti_agent.c
+++ b/tools/perf/jvmti/jvmti_agent.c
@@ -35,6 +35,7 @@
35#include <sys/mman.h> 35#include <sys/mman.h>
36#include <syscall.h> /* for gettid() */ 36#include <syscall.h> /* for gettid() */
37#include <err.h> 37#include <err.h>
38#include <linux/kernel.h>
38 39
39#include "jvmti_agent.h" 40#include "jvmti_agent.h"
40#include "../util/jitdump.h" 41#include "../util/jitdump.h"
@@ -249,7 +250,7 @@ void *jvmti_open(void)
249 /* 250 /*
250 * jitdump file name 251 * jitdump file name
251 */ 252 */
252 snprintf(dump_path, PATH_MAX, "%s/jit-%i.dump", jit_path, getpid()); 253 scnprintf(dump_path, PATH_MAX, "%s/jit-%i.dump", jit_path, getpid());
253 254
254 fd = open(dump_path, O_CREAT|O_TRUNC|O_RDWR, 0666); 255 fd = open(dump_path, O_CREAT|O_TRUNC|O_RDWR, 0666);
255 if (fd == -1) 256 if (fd == -1)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index a1a97956136f..21bf7f5a3cf5 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -5,6 +5,7 @@
5#include <time.h> 5#include <time.h>
6#include <stdbool.h> 6#include <stdbool.h>
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/stddef.h>
8#include <linux/perf_event.h> 9#include <linux/perf_event.h>
9 10
10extern bool test_attr__enabled; 11extern bool test_attr__enabled;
@@ -24,7 +25,9 @@ static inline unsigned long long rdclock(void)
24 return ts.tv_sec * 1000000000ULL + ts.tv_nsec; 25 return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
25} 26}
26 27
28#ifndef MAX_NR_CPUS
27#define MAX_NR_CPUS 1024 29#define MAX_NR_CPUS 1024
30#endif
28 31
29extern const char *input_name; 32extern const char *input_name;
30extern bool perf_host, perf_guest; 33extern bool perf_host, perf_guest;
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
index 17783913d330..215ba30b8534 100644
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -1,7 +1,7 @@
1hostprogs := jevents 1hostprogs := jevents
2 2
3jevents-y += json.o jsmn.o jevents.o 3jevents-y += json.o jsmn.o jevents.o
4CHOSTFLAGS_jevents.o = -I$(srctree)/tools/include 4HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include
5pmu-events-y += pmu-events.o 5pmu-events-y += pmu-events.o
6JDIR = pmu-events/arch/$(SRCARCH) 6JDIR = pmu-events/arch/$(SRCARCH)
7JSON = $(shell [ -d $(JDIR) ] && \ 7JSON = $(shell [ -d $(JDIR) ] && \
diff --git a/tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json b/tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json
index bc03c06c3918..752e47eb6977 100644
--- a/tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json
+++ b/tools/perf/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json
@@ -12,6 +12,21 @@
12 "ArchStdEvent": "L1D_CACHE_REFILL_WR", 12 "ArchStdEvent": "L1D_CACHE_REFILL_WR",
13 }, 13 },
14 { 14 {
15 "ArchStdEvent": "L1D_CACHE_REFILL_INNER",
16 },
17 {
18 "ArchStdEvent": "L1D_CACHE_REFILL_OUTER",
19 },
20 {
21 "ArchStdEvent": "L1D_CACHE_WB_VICTIM",
22 },
23 {
24 "ArchStdEvent": "L1D_CACHE_WB_CLEAN",
25 },
26 {
27 "ArchStdEvent": "L1D_CACHE_INVAL",
28 },
29 {
15 "ArchStdEvent": "L1D_TLB_REFILL_RD", 30 "ArchStdEvent": "L1D_TLB_REFILL_RD",
16 }, 31 },
17 { 32 {
@@ -24,9 +39,75 @@
24 "ArchStdEvent": "L1D_TLB_WR", 39 "ArchStdEvent": "L1D_TLB_WR",
25 }, 40 },
26 { 41 {
42 "ArchStdEvent": "L2D_TLB_REFILL_RD",
43 },
44 {
45 "ArchStdEvent": "L2D_TLB_REFILL_WR",
46 },
47 {
48 "ArchStdEvent": "L2D_TLB_RD",
49 },
50 {
51 "ArchStdEvent": "L2D_TLB_WR",
52 },
53 {
27 "ArchStdEvent": "BUS_ACCESS_RD", 54 "ArchStdEvent": "BUS_ACCESS_RD",
28 }, 55 },
29 { 56 {
30 "ArchStdEvent": "BUS_ACCESS_WR", 57 "ArchStdEvent": "BUS_ACCESS_WR",
31 } 58 },
59 {
60 "ArchStdEvent": "MEM_ACCESS_RD",
61 },
62 {
63 "ArchStdEvent": "MEM_ACCESS_WR",
64 },
65 {
66 "ArchStdEvent": "UNALIGNED_LD_SPEC",
67 },
68 {
69 "ArchStdEvent": "UNALIGNED_ST_SPEC",
70 },
71 {
72 "ArchStdEvent": "UNALIGNED_LDST_SPEC",
73 },
74 {
75 "ArchStdEvent": "EXC_UNDEF",
76 },
77 {
78 "ArchStdEvent": "EXC_SVC",
79 },
80 {
81 "ArchStdEvent": "EXC_PABORT",
82 },
83 {
84 "ArchStdEvent": "EXC_DABORT",
85 },
86 {
87 "ArchStdEvent": "EXC_IRQ",
88 },
89 {
90 "ArchStdEvent": "EXC_FIQ",
91 },
92 {
93 "ArchStdEvent": "EXC_SMC",
94 },
95 {
96 "ArchStdEvent": "EXC_HVC",
97 },
98 {
99 "ArchStdEvent": "EXC_TRAP_PABORT",
100 },
101 {
102 "ArchStdEvent": "EXC_TRAP_DABORT",
103 },
104 {
105 "ArchStdEvent": "EXC_TRAP_OTHER",
106 },
107 {
108 "ArchStdEvent": "EXC_TRAP_IRQ",
109 },
110 {
111 "ArchStdEvent": "EXC_TRAP_FIQ",
112 }
32] 113]
diff --git a/tools/perf/pmu-events/arch/s390/cf_z10/basic.json b/tools/perf/pmu-events/arch/s390/cf_z10/basic.json
index 8bf16759ca53..2dd8dafff2ef 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z10/basic.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z10/basic.json
@@ -1,71 +1,83 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "0", 4 "EventCode": "0",
4 "EventName": "CPU_CYCLES", 5 "EventName": "CPU_CYCLES",
5 "BriefDescription": "CPU Cycles", 6 "BriefDescription": "CPU Cycles",
6 "PublicDescription": "Cycle Count" 7 "PublicDescription": "Cycle Count"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "1", 11 "EventCode": "1",
10 "EventName": "INSTRUCTIONS", 12 "EventName": "INSTRUCTIONS",
11 "BriefDescription": "Instructions", 13 "BriefDescription": "Instructions",
12 "PublicDescription": "Instruction Count" 14 "PublicDescription": "Instruction Count"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "2", 18 "EventCode": "2",
16 "EventName": "L1I_DIR_WRITES", 19 "EventName": "L1I_DIR_WRITES",
17 "BriefDescription": "L1I Directory Writes", 20 "BriefDescription": "L1I Directory Writes",
18 "PublicDescription": "Level-1 I-Cache Directory Write Count" 21 "PublicDescription": "Level-1 I-Cache Directory Write Count"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "3", 25 "EventCode": "3",
22 "EventName": "L1I_PENALTY_CYCLES", 26 "EventName": "L1I_PENALTY_CYCLES",
23 "BriefDescription": "L1I Penalty Cycles", 27 "BriefDescription": "L1I Penalty Cycles",
24 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count" 28 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "4", 32 "EventCode": "4",
28 "EventName": "L1D_DIR_WRITES", 33 "EventName": "L1D_DIR_WRITES",
29 "BriefDescription": "L1D Directory Writes", 34 "BriefDescription": "L1D Directory Writes",
30 "PublicDescription": "Level-1 D-Cache Directory Write Count" 35 "PublicDescription": "Level-1 D-Cache Directory Write Count"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "5", 39 "EventCode": "5",
34 "EventName": "L1D_PENALTY_CYCLES", 40 "EventName": "L1D_PENALTY_CYCLES",
35 "BriefDescription": "L1D Penalty Cycles", 41 "BriefDescription": "L1D Penalty Cycles",
36 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count" 42 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "32", 46 "EventCode": "32",
40 "EventName": "PROBLEM_STATE_CPU_CYCLES", 47 "EventName": "PROBLEM_STATE_CPU_CYCLES",
41 "BriefDescription": "Problem-State CPU Cycles", 48 "BriefDescription": "Problem-State CPU Cycles",
42 "PublicDescription": "Problem-State Cycle Count" 49 "PublicDescription": "Problem-State Cycle Count"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "33", 53 "EventCode": "33",
46 "EventName": "PROBLEM_STATE_INSTRUCTIONS", 54 "EventName": "PROBLEM_STATE_INSTRUCTIONS",
47 "BriefDescription": "Problem-State Instructions", 55 "BriefDescription": "Problem-State Instructions",
48 "PublicDescription": "Problem-State Instruction Count" 56 "PublicDescription": "Problem-State Instruction Count"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "34", 60 "EventCode": "34",
52 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES", 61 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES",
53 "BriefDescription": "Problem-State L1I Directory Writes", 62 "BriefDescription": "Problem-State L1I Directory Writes",
54 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count" 63 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "35", 67 "EventCode": "35",
58 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES", 68 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES",
59 "BriefDescription": "Problem-State L1I Penalty Cycles", 69 "BriefDescription": "Problem-State L1I Penalty Cycles",
60 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count" 70 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "36", 74 "EventCode": "36",
64 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES", 75 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES",
65 "BriefDescription": "Problem-State L1D Directory Writes", 76 "BriefDescription": "Problem-State L1D Directory Writes",
66 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count" 77 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "37", 81 "EventCode": "37",
70 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", 82 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES",
71 "BriefDescription": "Problem-State L1D Penalty Cycles", 83 "BriefDescription": "Problem-State L1D Penalty Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z10/crypto.json b/tools/perf/pmu-events/arch/s390/cf_z10/crypto.json
index 7e5b72492141..db286f19e7b6 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z10/crypto.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z10/crypto.json
@@ -1,95 +1,111 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "64", 4 "EventCode": "64",
4 "EventName": "PRNG_FUNCTIONS", 5 "EventName": "PRNG_FUNCTIONS",
5 "BriefDescription": "PRNG Functions", 6 "BriefDescription": "PRNG Functions",
6 "PublicDescription": "Total number of the PRNG functions issued by the CPU" 7 "PublicDescription": "Total number of the PRNG functions issued by the CPU"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "65", 11 "EventCode": "65",
10 "EventName": "PRNG_CYCLES", 12 "EventName": "PRNG_CYCLES",
11 "BriefDescription": "PRNG Cycles", 13 "BriefDescription": "PRNG Cycles",
12 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU" 14 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "66", 18 "EventCode": "66",
16 "EventName": "PRNG_BLOCKED_FUNCTIONS", 19 "EventName": "PRNG_BLOCKED_FUNCTIONS",
17 "BriefDescription": "PRNG Blocked Functions", 20 "BriefDescription": "PRNG Blocked Functions",
18 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 21 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "67", 25 "EventCode": "67",
22 "EventName": "PRNG_BLOCKED_CYCLES", 26 "EventName": "PRNG_BLOCKED_CYCLES",
23 "BriefDescription": "PRNG Blocked Cycles", 27 "BriefDescription": "PRNG Blocked Cycles",
24 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 28 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "68", 32 "EventCode": "68",
28 "EventName": "SHA_FUNCTIONS", 33 "EventName": "SHA_FUNCTIONS",
29 "BriefDescription": "SHA Functions", 34 "BriefDescription": "SHA Functions",
30 "PublicDescription": "Total number of SHA functions issued by the CPU" 35 "PublicDescription": "Total number of SHA functions issued by the CPU"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "69", 39 "EventCode": "69",
34 "EventName": "SHA_CYCLES", 40 "EventName": "SHA_CYCLES",
35 "BriefDescription": "SHA Cycles", 41 "BriefDescription": "SHA Cycles",
36 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU" 42 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "70", 46 "EventCode": "70",
40 "EventName": "SHA_BLOCKED_FUNCTIONS", 47 "EventName": "SHA_BLOCKED_FUNCTIONS",
41 "BriefDescription": "SHA Blocked Functions", 48 "BriefDescription": "SHA Blocked Functions",
42 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU" 49 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "71", 53 "EventCode": "71",
46 "EventName": "SHA_BLOCKED_CYCLES", 54 "EventName": "SHA_BLOCKED_CYCLES",
47 "BriefDescription": "SHA Bloced Cycles", 55 "BriefDescription": "SHA Bloced Cycles",
48 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU" 56 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "72", 60 "EventCode": "72",
52 "EventName": "DEA_FUNCTIONS", 61 "EventName": "DEA_FUNCTIONS",
53 "BriefDescription": "DEA Functions", 62 "BriefDescription": "DEA Functions",
54 "PublicDescription": "Total number of the DEA functions issued by the CPU" 63 "PublicDescription": "Total number of the DEA functions issued by the CPU"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "73", 67 "EventCode": "73",
58 "EventName": "DEA_CYCLES", 68 "EventName": "DEA_CYCLES",
59 "BriefDescription": "DEA Cycles", 69 "BriefDescription": "DEA Cycles",
60 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU" 70 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "74", 74 "EventCode": "74",
64 "EventName": "DEA_BLOCKED_FUNCTIONS", 75 "EventName": "DEA_BLOCKED_FUNCTIONS",
65 "BriefDescription": "DEA Blocked Functions", 76 "BriefDescription": "DEA Blocked Functions",
66 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 77 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "75", 81 "EventCode": "75",
70 "EventName": "DEA_BLOCKED_CYCLES", 82 "EventName": "DEA_BLOCKED_CYCLES",
71 "BriefDescription": "DEA Blocked Cycles", 83 "BriefDescription": "DEA Blocked Cycles",
72 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 84 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "76", 88 "EventCode": "76",
76 "EventName": "AES_FUNCTIONS", 89 "EventName": "AES_FUNCTIONS",
77 "BriefDescription": "AES Functions", 90 "BriefDescription": "AES Functions",
78 "PublicDescription": "Total number of AES functions issued by the CPU" 91 "PublicDescription": "Total number of AES functions issued by the CPU"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "77", 95 "EventCode": "77",
82 "EventName": "AES_CYCLES", 96 "EventName": "AES_CYCLES",
83 "BriefDescription": "AES Cycles", 97 "BriefDescription": "AES Cycles",
84 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU" 98 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "78", 102 "EventCode": "78",
88 "EventName": "AES_BLOCKED_FUNCTIONS", 103 "EventName": "AES_BLOCKED_FUNCTIONS",
89 "BriefDescription": "AES Blocked Functions", 104 "BriefDescription": "AES Blocked Functions",
90 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 105 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "79", 109 "EventCode": "79",
94 "EventName": "AES_BLOCKED_CYCLES", 110 "EventName": "AES_BLOCKED_CYCLES",
95 "BriefDescription": "AES Blocked Cycles", 111 "BriefDescription": "AES Blocked Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z10/extended.json b/tools/perf/pmu-events/arch/s390/cf_z10/extended.json
index 0feedb40f30f..b6b7f29ca831 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z10/extended.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z10/extended.json
@@ -1,107 +1,125 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "128", 4 "EventCode": "128",
4 "EventName": "L1I_L2_SOURCED_WRITES", 5 "EventName": "L1I_L2_SOURCED_WRITES",
5 "BriefDescription": "L1I L2 Sourced Writes", 6 "BriefDescription": "L1I L2 Sourced Writes",
6 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from the Level-2 (L1.5) cache" 7 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from the Level-2 (L1.5) cache"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "129", 11 "EventCode": "129",
10 "EventName": "L1D_L2_SOURCED_WRITES", 12 "EventName": "L1D_L2_SOURCED_WRITES",
11 "BriefDescription": "L1D L2 Sourced Writes", 13 "BriefDescription": "L1D L2 Sourced Writes",
12 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installed cache line was sourced from the Level-2 (L1.5) cache" 14 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installed cache line was sourced from the Level-2 (L1.5) cache"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "130", 18 "EventCode": "130",
16 "EventName": "L1I_L3_LOCAL_WRITES", 19 "EventName": "L1I_L3_LOCAL_WRITES",
17 "BriefDescription": "L1I L3 Local Writes", 20 "BriefDescription": "L1I L3 Local Writes",
18 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the installed cache line was sourced from the Level-3 cache that is on the same book as the Instruction cache (Local L2 cache)" 21 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the installed cache line was sourced from the Level-3 cache that is on the same book as the Instruction cache (Local L2 cache)"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "131", 25 "EventCode": "131",
22 "EventName": "L1D_L3_LOCAL_WRITES", 26 "EventName": "L1D_L3_LOCAL_WRITES",
23 "BriefDescription": "L1D L3 Local Writes", 27 "BriefDescription": "L1D L3 Local Writes",
24 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installtion cache line was source from the Level-3 cache that is on the same book as the Data cache (Local L2 cache)" 28 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installtion cache line was source from the Level-3 cache that is on the same book as the Data cache (Local L2 cache)"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "132", 32 "EventCode": "132",
28 "EventName": "L1I_L3_REMOTE_WRITES", 33 "EventName": "L1I_L3_REMOTE_WRITES",
29 "BriefDescription": "L1I L3 Remote Writes", 34 "BriefDescription": "L1I L3 Remote Writes",
30 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the installed cache line was sourced from a Level-3 cache that is not on the same book as the Instruction cache (Remote L2 cache)" 35 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the installed cache line was sourced from a Level-3 cache that is not on the same book as the Instruction cache (Remote L2 cache)"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "133", 39 "EventCode": "133",
34 "EventName": "L1D_L3_REMOTE_WRITES", 40 "EventName": "L1D_L3_REMOTE_WRITES",
35 "BriefDescription": "L1D L3 Remote Writes", 41 "BriefDescription": "L1D L3 Remote Writes",
36 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installed cache line was sourced from a Level-3 cache that is not on the same book as the Data cache (Remote L2 cache)" 42 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installed cache line was sourced from a Level-3 cache that is not on the same book as the Data cache (Remote L2 cache)"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "134", 46 "EventCode": "134",
40 "EventName": "L1D_LMEM_SOURCED_WRITES", 47 "EventName": "L1D_LMEM_SOURCED_WRITES",
41 "BriefDescription": "L1D Local Memory Sourced Writes", 48 "BriefDescription": "L1D Local Memory Sourced Writes",
42 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installed cache line was sourced from memory that is attached to the same book as the Data cache (Local Memory)" 49 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the installed cache line was sourced from memory that is attached to the same book as the Data cache (Local Memory)"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "135", 53 "EventCode": "135",
46 "EventName": "L1I_LMEM_SOURCED_WRITES", 54 "EventName": "L1I_LMEM_SOURCED_WRITES",
47 "BriefDescription": "L1I Local Memory Sourced Writes", 55 "BriefDescription": "L1I Local Memory Sourced Writes",
48 "PublicDescription": "A directory write to the Level-1 I-Cache where the installed cache line was sourced from memory that is attached to the s ame book as the Instruction cache (Local Memory)" 56 "PublicDescription": "A directory write to the Level-1 I-Cache where the installed cache line was sourced from memory that is attached to the s ame book as the Instruction cache (Local Memory)"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "136", 60 "EventCode": "136",
52 "EventName": "L1D_RO_EXCL_WRITES", 61 "EventName": "L1D_RO_EXCL_WRITES",
53 "BriefDescription": "L1D Read-only Exclusive Writes", 62 "BriefDescription": "L1D Read-only Exclusive Writes",
54 "PublicDescription": "A directory write to the Level-1 D-Cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line" 63 "PublicDescription": "A directory write to the Level-1 D-Cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "137", 67 "EventCode": "137",
58 "EventName": "L1I_CACHELINE_INVALIDATES", 68 "EventName": "L1I_CACHELINE_INVALIDATES",
59 "BriefDescription": "L1I Cacheline Invalidates", 69 "BriefDescription": "L1I Cacheline Invalidates",
60 "PublicDescription": "A cache line in the Level-1 I-Cache has been invalidated by a store on the same CPU as the Level-1 I-Cache" 70 "PublicDescription": "A cache line in the Level-1 I-Cache has been invalidated by a store on the same CPU as the Level-1 I-Cache"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "138", 74 "EventCode": "138",
64 "EventName": "ITLB1_WRITES", 75 "EventName": "ITLB1_WRITES",
65 "BriefDescription": "ITLB1 Writes", 76 "BriefDescription": "ITLB1 Writes",
66 "PublicDescription": "A translation entry has been written into the Level-1 Instruction Translation Lookaside Buffer" 77 "PublicDescription": "A translation entry has been written into the Level-1 Instruction Translation Lookaside Buffer"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "139", 81 "EventCode": "139",
70 "EventName": "DTLB1_WRITES", 82 "EventName": "DTLB1_WRITES",
71 "BriefDescription": "DTLB1 Writes", 83 "BriefDescription": "DTLB1 Writes",
72 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer" 84 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "140", 88 "EventCode": "140",
76 "EventName": "TLB2_PTE_WRITES", 89 "EventName": "TLB2_PTE_WRITES",
77 "BriefDescription": "TLB2 PTE Writes", 90 "BriefDescription": "TLB2 PTE Writes",
78 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays" 91 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "141", 95 "EventCode": "141",
82 "EventName": "TLB2_CRSTE_WRITES", 96 "EventName": "TLB2_CRSTE_WRITES",
83 "BriefDescription": "TLB2 CRSTE Writes", 97 "BriefDescription": "TLB2 CRSTE Writes",
84 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays" 98 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "142", 102 "EventCode": "142",
88 "EventName": "TLB2_CRSTE_HPAGE_WRITES", 103 "EventName": "TLB2_CRSTE_HPAGE_WRITES",
89 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes", 104 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes",
90 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays for a one-megabyte large page translation" 105 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays for a one-megabyte large page translation"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "145", 109 "EventCode": "145",
94 "EventName": "ITLB1_MISSES", 110 "EventName": "ITLB1_MISSES",
95 "BriefDescription": "ITLB1 Misses", 111 "BriefDescription": "ITLB1 Misses",
96 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle an ITLB1 miss is in progress" 112 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle an ITLB1 miss is in progress"
97 }, 113 },
98 { 114 {
115 "Unit": "CPU-M-CF",
99 "EventCode": "146", 116 "EventCode": "146",
100 "EventName": "DTLB1_MISSES", 117 "EventName": "DTLB1_MISSES",
101 "BriefDescription": "DTLB1 Misses", 118 "BriefDescription": "DTLB1 Misses",
102 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle an DTLB1 miss is in progress" 119 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle an DTLB1 miss is in progress"
103 }, 120 },
104 { 121 {
122 "Unit": "CPU-M-CF",
105 "EventCode": "147", 123 "EventCode": "147",
106 "EventName": "L2C_STORES_SENT", 124 "EventName": "L2C_STORES_SENT",
107 "BriefDescription": "L2C Stores Sent", 125 "BriefDescription": "L2C Stores Sent",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z13/basic.json b/tools/perf/pmu-events/arch/s390/cf_z13/basic.json
index 8bf16759ca53..2dd8dafff2ef 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z13/basic.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z13/basic.json
@@ -1,71 +1,83 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "0", 4 "EventCode": "0",
4 "EventName": "CPU_CYCLES", 5 "EventName": "CPU_CYCLES",
5 "BriefDescription": "CPU Cycles", 6 "BriefDescription": "CPU Cycles",
6 "PublicDescription": "Cycle Count" 7 "PublicDescription": "Cycle Count"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "1", 11 "EventCode": "1",
10 "EventName": "INSTRUCTIONS", 12 "EventName": "INSTRUCTIONS",
11 "BriefDescription": "Instructions", 13 "BriefDescription": "Instructions",
12 "PublicDescription": "Instruction Count" 14 "PublicDescription": "Instruction Count"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "2", 18 "EventCode": "2",
16 "EventName": "L1I_DIR_WRITES", 19 "EventName": "L1I_DIR_WRITES",
17 "BriefDescription": "L1I Directory Writes", 20 "BriefDescription": "L1I Directory Writes",
18 "PublicDescription": "Level-1 I-Cache Directory Write Count" 21 "PublicDescription": "Level-1 I-Cache Directory Write Count"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "3", 25 "EventCode": "3",
22 "EventName": "L1I_PENALTY_CYCLES", 26 "EventName": "L1I_PENALTY_CYCLES",
23 "BriefDescription": "L1I Penalty Cycles", 27 "BriefDescription": "L1I Penalty Cycles",
24 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count" 28 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "4", 32 "EventCode": "4",
28 "EventName": "L1D_DIR_WRITES", 33 "EventName": "L1D_DIR_WRITES",
29 "BriefDescription": "L1D Directory Writes", 34 "BriefDescription": "L1D Directory Writes",
30 "PublicDescription": "Level-1 D-Cache Directory Write Count" 35 "PublicDescription": "Level-1 D-Cache Directory Write Count"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "5", 39 "EventCode": "5",
34 "EventName": "L1D_PENALTY_CYCLES", 40 "EventName": "L1D_PENALTY_CYCLES",
35 "BriefDescription": "L1D Penalty Cycles", 41 "BriefDescription": "L1D Penalty Cycles",
36 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count" 42 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "32", 46 "EventCode": "32",
40 "EventName": "PROBLEM_STATE_CPU_CYCLES", 47 "EventName": "PROBLEM_STATE_CPU_CYCLES",
41 "BriefDescription": "Problem-State CPU Cycles", 48 "BriefDescription": "Problem-State CPU Cycles",
42 "PublicDescription": "Problem-State Cycle Count" 49 "PublicDescription": "Problem-State Cycle Count"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "33", 53 "EventCode": "33",
46 "EventName": "PROBLEM_STATE_INSTRUCTIONS", 54 "EventName": "PROBLEM_STATE_INSTRUCTIONS",
47 "BriefDescription": "Problem-State Instructions", 55 "BriefDescription": "Problem-State Instructions",
48 "PublicDescription": "Problem-State Instruction Count" 56 "PublicDescription": "Problem-State Instruction Count"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "34", 60 "EventCode": "34",
52 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES", 61 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES",
53 "BriefDescription": "Problem-State L1I Directory Writes", 62 "BriefDescription": "Problem-State L1I Directory Writes",
54 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count" 63 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "35", 67 "EventCode": "35",
58 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES", 68 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES",
59 "BriefDescription": "Problem-State L1I Penalty Cycles", 69 "BriefDescription": "Problem-State L1I Penalty Cycles",
60 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count" 70 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "36", 74 "EventCode": "36",
64 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES", 75 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES",
65 "BriefDescription": "Problem-State L1D Directory Writes", 76 "BriefDescription": "Problem-State L1D Directory Writes",
66 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count" 77 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "37", 81 "EventCode": "37",
70 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", 82 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES",
71 "BriefDescription": "Problem-State L1D Penalty Cycles", 83 "BriefDescription": "Problem-State L1D Penalty Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z13/crypto.json b/tools/perf/pmu-events/arch/s390/cf_z13/crypto.json
index 7e5b72492141..db286f19e7b6 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z13/crypto.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z13/crypto.json
@@ -1,95 +1,111 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "64", 4 "EventCode": "64",
4 "EventName": "PRNG_FUNCTIONS", 5 "EventName": "PRNG_FUNCTIONS",
5 "BriefDescription": "PRNG Functions", 6 "BriefDescription": "PRNG Functions",
6 "PublicDescription": "Total number of the PRNG functions issued by the CPU" 7 "PublicDescription": "Total number of the PRNG functions issued by the CPU"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "65", 11 "EventCode": "65",
10 "EventName": "PRNG_CYCLES", 12 "EventName": "PRNG_CYCLES",
11 "BriefDescription": "PRNG Cycles", 13 "BriefDescription": "PRNG Cycles",
12 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU" 14 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "66", 18 "EventCode": "66",
16 "EventName": "PRNG_BLOCKED_FUNCTIONS", 19 "EventName": "PRNG_BLOCKED_FUNCTIONS",
17 "BriefDescription": "PRNG Blocked Functions", 20 "BriefDescription": "PRNG Blocked Functions",
18 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 21 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "67", 25 "EventCode": "67",
22 "EventName": "PRNG_BLOCKED_CYCLES", 26 "EventName": "PRNG_BLOCKED_CYCLES",
23 "BriefDescription": "PRNG Blocked Cycles", 27 "BriefDescription": "PRNG Blocked Cycles",
24 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 28 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "68", 32 "EventCode": "68",
28 "EventName": "SHA_FUNCTIONS", 33 "EventName": "SHA_FUNCTIONS",
29 "BriefDescription": "SHA Functions", 34 "BriefDescription": "SHA Functions",
30 "PublicDescription": "Total number of SHA functions issued by the CPU" 35 "PublicDescription": "Total number of SHA functions issued by the CPU"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "69", 39 "EventCode": "69",
34 "EventName": "SHA_CYCLES", 40 "EventName": "SHA_CYCLES",
35 "BriefDescription": "SHA Cycles", 41 "BriefDescription": "SHA Cycles",
36 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU" 42 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "70", 46 "EventCode": "70",
40 "EventName": "SHA_BLOCKED_FUNCTIONS", 47 "EventName": "SHA_BLOCKED_FUNCTIONS",
41 "BriefDescription": "SHA Blocked Functions", 48 "BriefDescription": "SHA Blocked Functions",
42 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU" 49 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "71", 53 "EventCode": "71",
46 "EventName": "SHA_BLOCKED_CYCLES", 54 "EventName": "SHA_BLOCKED_CYCLES",
47 "BriefDescription": "SHA Bloced Cycles", 55 "BriefDescription": "SHA Bloced Cycles",
48 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU" 56 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "72", 60 "EventCode": "72",
52 "EventName": "DEA_FUNCTIONS", 61 "EventName": "DEA_FUNCTIONS",
53 "BriefDescription": "DEA Functions", 62 "BriefDescription": "DEA Functions",
54 "PublicDescription": "Total number of the DEA functions issued by the CPU" 63 "PublicDescription": "Total number of the DEA functions issued by the CPU"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "73", 67 "EventCode": "73",
58 "EventName": "DEA_CYCLES", 68 "EventName": "DEA_CYCLES",
59 "BriefDescription": "DEA Cycles", 69 "BriefDescription": "DEA Cycles",
60 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU" 70 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "74", 74 "EventCode": "74",
64 "EventName": "DEA_BLOCKED_FUNCTIONS", 75 "EventName": "DEA_BLOCKED_FUNCTIONS",
65 "BriefDescription": "DEA Blocked Functions", 76 "BriefDescription": "DEA Blocked Functions",
66 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 77 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "75", 81 "EventCode": "75",
70 "EventName": "DEA_BLOCKED_CYCLES", 82 "EventName": "DEA_BLOCKED_CYCLES",
71 "BriefDescription": "DEA Blocked Cycles", 83 "BriefDescription": "DEA Blocked Cycles",
72 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 84 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "76", 88 "EventCode": "76",
76 "EventName": "AES_FUNCTIONS", 89 "EventName": "AES_FUNCTIONS",
77 "BriefDescription": "AES Functions", 90 "BriefDescription": "AES Functions",
78 "PublicDescription": "Total number of AES functions issued by the CPU" 91 "PublicDescription": "Total number of AES functions issued by the CPU"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "77", 95 "EventCode": "77",
82 "EventName": "AES_CYCLES", 96 "EventName": "AES_CYCLES",
83 "BriefDescription": "AES Cycles", 97 "BriefDescription": "AES Cycles",
84 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU" 98 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "78", 102 "EventCode": "78",
88 "EventName": "AES_BLOCKED_FUNCTIONS", 103 "EventName": "AES_BLOCKED_FUNCTIONS",
89 "BriefDescription": "AES Blocked Functions", 104 "BriefDescription": "AES Blocked Functions",
90 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 105 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "79", 109 "EventCode": "79",
94 "EventName": "AES_BLOCKED_CYCLES", 110 "EventName": "AES_BLOCKED_CYCLES",
95 "BriefDescription": "AES Blocked Cycles", 111 "BriefDescription": "AES Blocked Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z13/extended.json b/tools/perf/pmu-events/arch/s390/cf_z13/extended.json
index 9a002b6967f1..436ce33f1182 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z13/extended.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z13/extended.json
@@ -1,335 +1,391 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "128", 4 "EventCode": "128",
4 "EventName": "L1D_RO_EXCL_WRITES", 5 "EventName": "L1D_RO_EXCL_WRITES",
5 "BriefDescription": "L1D Read-only Exclusive Writes", 6 "BriefDescription": "L1D Read-only Exclusive Writes",
6 "PublicDescription": "A directory write to the Level-1 Data cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line." 7 "PublicDescription": "A directory write to the Level-1 Data cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line."
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "129", 11 "EventCode": "129",
10 "EventName": "DTLB1_WRITES", 12 "EventName": "DTLB1_WRITES",
11 "BriefDescription": "DTLB1 Writes", 13 "BriefDescription": "DTLB1 Writes",
12 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer" 14 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "130", 18 "EventCode": "130",
16 "EventName": "DTLB1_MISSES", 19 "EventName": "DTLB1_MISSES",
17 "BriefDescription": "DTLB1 Misses", 20 "BriefDescription": "DTLB1 Misses",
18 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle a DTLB1 miss is in progress." 21 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle a DTLB1 miss is in progress."
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "131", 25 "EventCode": "131",
22 "EventName": "DTLB1_HPAGE_WRITES", 26 "EventName": "DTLB1_HPAGE_WRITES",
23 "BriefDescription": "DTLB1 One-Megabyte Page Writes", 27 "BriefDescription": "DTLB1 One-Megabyte Page Writes",
24 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a one-megabyte page" 28 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a one-megabyte page"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "132", 32 "EventCode": "132",
28 "EventName": "DTLB1_GPAGE_WRITES", 33 "EventName": "DTLB1_GPAGE_WRITES",
29 "BriefDescription": "DTLB1 Two-Gigabyte Page Writes", 34 "BriefDescription": "DTLB1 Two-Gigabyte Page Writes",
30 "PublicDescription": "Counter:132 Name:DTLB1_GPAGE_WRITES A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a two-gigabyte page." 35 "PublicDescription": "Counter:132 Name:DTLB1_GPAGE_WRITES A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a two-gigabyte page."
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "133", 39 "EventCode": "133",
34 "EventName": "L1D_L2D_SOURCED_WRITES", 40 "EventName": "L1D_L2D_SOURCED_WRITES",
35 "BriefDescription": "L1D L2D Sourced Writes", 41 "BriefDescription": "L1D L2D Sourced Writes",
36 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Data cache" 42 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Data cache"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "134", 46 "EventCode": "134",
40 "EventName": "ITLB1_WRITES", 47 "EventName": "ITLB1_WRITES",
41 "BriefDescription": "ITLB1 Writes", 48 "BriefDescription": "ITLB1 Writes",
42 "PublicDescription": "A translation entry has been written to the Level-1 Instruction Translation Lookaside Buffer" 49 "PublicDescription": "A translation entry has been written to the Level-1 Instruction Translation Lookaside Buffer"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "135", 53 "EventCode": "135",
46 "EventName": "ITLB1_MISSES", 54 "EventName": "ITLB1_MISSES",
47 "BriefDescription": "ITLB1 Misses", 55 "BriefDescription": "ITLB1 Misses",
48 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle an ITLB1 miss is in progress" 56 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle an ITLB1 miss is in progress"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "136", 60 "EventCode": "136",
52 "EventName": "L1I_L2I_SOURCED_WRITES", 61 "EventName": "L1I_L2I_SOURCED_WRITES",
53 "BriefDescription": "L1I L2I Sourced Writes", 62 "BriefDescription": "L1I L2I Sourced Writes",
54 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from the Level-2 Instruction cache" 63 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from the Level-2 Instruction cache"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "137", 67 "EventCode": "137",
58 "EventName": "TLB2_PTE_WRITES", 68 "EventName": "TLB2_PTE_WRITES",
59 "BriefDescription": "TLB2 PTE Writes", 69 "BriefDescription": "TLB2 PTE Writes",
60 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays" 70 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "138", 74 "EventCode": "138",
64 "EventName": "TLB2_CRSTE_HPAGE_WRITES", 75 "EventName": "TLB2_CRSTE_HPAGE_WRITES",
65 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes", 76 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes",
66 "PublicDescription": "A translation entry has been written to the Level-2 TLB Combined Region Segment Table Entry arrays for a one-megabyte large page translation" 77 "PublicDescription": "A translation entry has been written to the Level-2 TLB Combined Region Segment Table Entry arrays for a one-megabyte large page translation"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "139", 81 "EventCode": "139",
70 "EventName": "TLB2_CRSTE_WRITES", 82 "EventName": "TLB2_CRSTE_WRITES",
71 "BriefDescription": "TLB2 CRSTE Writes", 83 "BriefDescription": "TLB2 CRSTE Writes",
72 "PublicDescription": "A translation entry has been written to the Level-2 TLB Combined Region Segment Table Entry arrays" 84 "PublicDescription": "A translation entry has been written to the Level-2 TLB Combined Region Segment Table Entry arrays"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "140", 88 "EventCode": "140",
76 "EventName": "TX_C_TEND", 89 "EventName": "TX_C_TEND",
77 "BriefDescription": "Completed TEND instructions in constrained TX mode", 90 "BriefDescription": "Completed TEND instructions in constrained TX mode",
78 "PublicDescription": "A TEND instruction has completed in a constrained transactional-execution mode" 91 "PublicDescription": "A TEND instruction has completed in a constrained transactional-execution mode"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "141", 95 "EventCode": "141",
82 "EventName": "TX_NC_TEND", 96 "EventName": "TX_NC_TEND",
83 "BriefDescription": "Completed TEND instructions in non-constrained TX mode", 97 "BriefDescription": "Completed TEND instructions in non-constrained TX mode",
84 "PublicDescription": "A TEND instruction has completed in a non-constrained transactional-execution mode" 98 "PublicDescription": "A TEND instruction has completed in a non-constrained transactional-execution mode"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "143", 102 "EventCode": "143",
88 "EventName": "L1C_TLB1_MISSES", 103 "EventName": "L1C_TLB1_MISSES",
89 "BriefDescription": "L1C TLB1 Misses", 104 "BriefDescription": "L1C TLB1 Misses",
90 "PublicDescription": "Increments by one for any cycle where a Level-1 cache or Level-1 TLB miss is in progress." 105 "PublicDescription": "Increments by one for any cycle where a Level-1 cache or Level-1 TLB miss is in progress."
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "144", 109 "EventCode": "144",
94 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES", 110 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES",
95 "BriefDescription": "L1D On-Chip L3 Sourced Writes", 111 "BriefDescription": "L1D On-Chip L3 Sourced Writes",
96 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache without intervention" 112 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache without intervention"
97 }, 113 },
98 { 114 {
115 "Unit": "CPU-M-CF",
99 "EventCode": "145", 116 "EventCode": "145",
100 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_IV", 117 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_IV",
101 "BriefDescription": "L1D On-Chip L3 Sourced Writes with Intervention", 118 "BriefDescription": "L1D On-Chip L3 Sourced Writes with Intervention",
102 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache with intervention" 119 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache with intervention"
103 }, 120 },
104 { 121 {
122 "Unit": "CPU-M-CF",
105 "EventCode": "146", 123 "EventCode": "146",
106 "EventName": "L1D_ONNODE_L4_SOURCED_WRITES", 124 "EventName": "L1D_ONNODE_L4_SOURCED_WRITES",
107 "BriefDescription": "L1D On-Node L4 Sourced Writes", 125 "BriefDescription": "L1D On-Node L4 Sourced Writes",
108 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Node Level-4 cache" 126 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Node Level-4 cache"
109 }, 127 },
110 { 128 {
129 "Unit": "CPU-M-CF",
111 "EventCode": "147", 130 "EventCode": "147",
112 "EventName": "L1D_ONNODE_L3_SOURCED_WRITES_IV", 131 "EventName": "L1D_ONNODE_L3_SOURCED_WRITES_IV",
113 "BriefDescription": "L1D On-Node L3 Sourced Writes with Intervention", 132 "BriefDescription": "L1D On-Node L3 Sourced Writes with Intervention",
114 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Node Level-3 cache with intervention" 133 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Node Level-3 cache with intervention"
115 }, 134 },
116 { 135 {
136 "Unit": "CPU-M-CF",
117 "EventCode": "148", 137 "EventCode": "148",
118 "EventName": "L1D_ONNODE_L3_SOURCED_WRITES", 138 "EventName": "L1D_ONNODE_L3_SOURCED_WRITES",
119 "BriefDescription": "L1D On-Node L3 Sourced Writes", 139 "BriefDescription": "L1D On-Node L3 Sourced Writes",
120 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Node Level-3 cache without intervention" 140 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Node Level-3 cache without intervention"
121 }, 141 },
122 { 142 {
143 "Unit": "CPU-M-CF",
123 "EventCode": "149", 144 "EventCode": "149",
124 "EventName": "L1D_ONDRAWER_L4_SOURCED_WRITES", 145 "EventName": "L1D_ONDRAWER_L4_SOURCED_WRITES",
125 "BriefDescription": "L1D On-Drawer L4 Sourced Writes", 146 "BriefDescription": "L1D On-Drawer L4 Sourced Writes",
126 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Drawer Level-4 cache" 147 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Drawer Level-4 cache"
127 }, 148 },
128 { 149 {
150 "Unit": "CPU-M-CF",
129 "EventCode": "150", 151 "EventCode": "150",
130 "EventName": "L1D_ONDRAWER_L3_SOURCED_WRITES_IV", 152 "EventName": "L1D_ONDRAWER_L3_SOURCED_WRITES_IV",
131 "BriefDescription": "L1D On-Drawer L3 Sourced Writes with Intervention", 153 "BriefDescription": "L1D On-Drawer L3 Sourced Writes with Intervention",
132 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache with intervention" 154 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache with intervention"
133 }, 155 },
134 { 156 {
157 "Unit": "CPU-M-CF",
135 "EventCode": "151", 158 "EventCode": "151",
136 "EventName": "L1D_ONDRAWER_L3_SOURCED_WRITES", 159 "EventName": "L1D_ONDRAWER_L3_SOURCED_WRITES",
137 "BriefDescription": "L1D On-Drawer L3 Sourced Writes", 160 "BriefDescription": "L1D On-Drawer L3 Sourced Writes",
138 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache without intervention" 161 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache without intervention"
139 }, 162 },
140 { 163 {
164 "Unit": "CPU-M-CF",
141 "EventCode": "152", 165 "EventCode": "152",
142 "EventName": "L1D_OFFDRAWER_SCOL_L4_SOURCED_WRITES", 166 "EventName": "L1D_OFFDRAWER_SCOL_L4_SOURCED_WRITES",
143 "BriefDescription": "L1D Off-Drawer Same-Column L4 Sourced Writes", 167 "BriefDescription": "L1D Off-Drawer Same-Column L4 Sourced Writes",
144 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-4 cache" 168 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-4 cache"
145 }, 169 },
146 { 170 {
171 "Unit": "CPU-M-CF",
147 "EventCode": "153", 172 "EventCode": "153",
148 "EventName": "L1D_OFFDRAWER_SCOL_L3_SOURCED_WRITES_IV", 173 "EventName": "L1D_OFFDRAWER_SCOL_L3_SOURCED_WRITES_IV",
149 "BriefDescription": "L1D Off-Drawer Same-Column L3 Sourced Writes with Intervention", 174 "BriefDescription": "L1D Off-Drawer Same-Column L3 Sourced Writes with Intervention",
150 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache with intervention" 175 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache with intervention"
151 }, 176 },
152 { 177 {
178 "Unit": "CPU-M-CF",
153 "EventCode": "154", 179 "EventCode": "154",
154 "EventName": "L1D_OFFDRAWER_SCOL_L3_SOURCED_WRITES", 180 "EventName": "L1D_OFFDRAWER_SCOL_L3_SOURCED_WRITES",
155 "BriefDescription": "L1D Off-Drawer Same-Column L3 Sourced Writes", 181 "BriefDescription": "L1D Off-Drawer Same-Column L3 Sourced Writes",
156 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache without intervention" 182 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache without intervention"
157 }, 183 },
158 { 184 {
185 "Unit": "CPU-M-CF",
159 "EventCode": "155", 186 "EventCode": "155",
160 "EventName": "L1D_OFFDRAWER_FCOL_L4_SOURCED_WRITES", 187 "EventName": "L1D_OFFDRAWER_FCOL_L4_SOURCED_WRITES",
161 "BriefDescription": "L1D Off-Drawer Far-Column L3 Sourced Writes", 188 "BriefDescription": "L1D Off-Drawer Far-Column L3 Sourced Writes",
162 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-4 cache" 189 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-4 cache"
163 }, 190 },
164 { 191 {
192 "Unit": "CPU-M-CF",
165 "EventCode": "156", 193 "EventCode": "156",
166 "EventName": "L1D_OFFDRAWER_FCOL_L3_SOURCED_WRITES_IV", 194 "EventName": "L1D_OFFDRAWER_FCOL_L3_SOURCED_WRITES_IV",
167 "BriefDescription": "L1D Off-Drawer Far-Column L3 Sourced Writes with Intervention", 195 "BriefDescription": "L1D Off-Drawer Far-Column L3 Sourced Writes with Intervention",
168 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache with intervention" 196 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache with intervention"
169 }, 197 },
170 { 198 {
199 "Unit": "CPU-M-CF",
171 "EventCode": "157", 200 "EventCode": "157",
172 "EventName": "L1D_OFFDRAWER_FCOL_L3_SOURCED_WRITES", 201 "EventName": "L1D_OFFDRAWER_FCOL_L3_SOURCED_WRITES",
173 "BriefDescription": "L1D Off-Drawer Far-Column L3 Sourced Writes", 202 "BriefDescription": "L1D Off-Drawer Far-Column L3 Sourced Writes",
174 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache without intervention" 203 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache without intervention"
175 }, 204 },
176 { 205 {
206 "Unit": "CPU-M-CF",
177 "EventCode": "158", 207 "EventCode": "158",
178 "EventName": "L1D_ONNODE_MEM_SOURCED_WRITES", 208 "EventName": "L1D_ONNODE_MEM_SOURCED_WRITES",
179 "BriefDescription": "L1D On-Node Memory Sourced Writes", 209 "BriefDescription": "L1D On-Node Memory Sourced Writes",
180 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Node memory" 210 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Node memory"
181 }, 211 },
182 { 212 {
213 "Unit": "CPU-M-CF",
183 "EventCode": "159", 214 "EventCode": "159",
184 "EventName": "L1D_ONDRAWER_MEM_SOURCED_WRITES", 215 "EventName": "L1D_ONDRAWER_MEM_SOURCED_WRITES",
185 "BriefDescription": "L1D On-Drawer Memory Sourced Writes", 216 "BriefDescription": "L1D On-Drawer Memory Sourced Writes",
186 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Drawer memory" 217 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Drawer memory"
187 }, 218 },
188 { 219 {
220 "Unit": "CPU-M-CF",
189 "EventCode": "160", 221 "EventCode": "160",
190 "EventName": "L1D_OFFDRAWER_MEM_SOURCED_WRITES", 222 "EventName": "L1D_OFFDRAWER_MEM_SOURCED_WRITES",
191 "BriefDescription": "L1D Off-Drawer Memory Sourced Writes", 223 "BriefDescription": "L1D Off-Drawer Memory Sourced Writes",
192 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Drawer memory" 224 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Drawer memory"
193 }, 225 },
194 { 226 {
227 "Unit": "CPU-M-CF",
195 "EventCode": "161", 228 "EventCode": "161",
196 "EventName": "L1D_ONCHIP_MEM_SOURCED_WRITES", 229 "EventName": "L1D_ONCHIP_MEM_SOURCED_WRITES",
197 "BriefDescription": "L1D On-Chip Memory Sourced Writes", 230 "BriefDescription": "L1D On-Chip Memory Sourced Writes",
198 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Chip memory" 231 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Chip memory"
199 }, 232 },
200 { 233 {
234 "Unit": "CPU-M-CF",
201 "EventCode": "162", 235 "EventCode": "162",
202 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES", 236 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES",
203 "BriefDescription": "L1I On-Chip L3 Sourced Writes", 237 "BriefDescription": "L1I On-Chip L3 Sourced Writes",
204 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Chip Level-3 cache without intervention" 238 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Chip Level-3 cache without intervention"
205 }, 239 },
206 { 240 {
241 "Unit": "CPU-M-CF",
207 "EventCode": "163", 242 "EventCode": "163",
208 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES_IV", 243 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES_IV",
209 "BriefDescription": "L1I On-Chip L3 Sourced Writes with Intervention", 244 "BriefDescription": "L1I On-Chip L3 Sourced Writes with Intervention",
210 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Chip Level-3 cache with intervention" 245 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Chip Level-3 cache with intervention"
211 }, 246 },
212 { 247 {
248 "Unit": "CPU-M-CF",
213 "EventCode": "164", 249 "EventCode": "164",
214 "EventName": "L1I_ONNODE_L4_SOURCED_WRITES", 250 "EventName": "L1I_ONNODE_L4_SOURCED_WRITES",
215 "BriefDescription": "L1I On-Chip L4 Sourced Writes", 251 "BriefDescription": "L1I On-Chip L4 Sourced Writes",
216 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Node Level-4 cache" 252 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Node Level-4 cache"
217 }, 253 },
218 { 254 {
255 "Unit": "CPU-M-CF",
219 "EventCode": "165", 256 "EventCode": "165",
220 "EventName": "L1I_ONNODE_L3_SOURCED_WRITES_IV", 257 "EventName": "L1I_ONNODE_L3_SOURCED_WRITES_IV",
221 "BriefDescription": "L1I On-Node L3 Sourced Writes with Intervention", 258 "BriefDescription": "L1I On-Node L3 Sourced Writes with Intervention",
222 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Node Level-3 cache with intervention" 259 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Node Level-3 cache with intervention"
223 }, 260 },
224 { 261 {
262 "Unit": "CPU-M-CF",
225 "EventCode": "166", 263 "EventCode": "166",
226 "EventName": "L1I_ONNODE_L3_SOURCED_WRITES", 264 "EventName": "L1I_ONNODE_L3_SOURCED_WRITES",
227 "BriefDescription": "L1I On-Node L3 Sourced Writes", 265 "BriefDescription": "L1I On-Node L3 Sourced Writes",
228 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Node Level-3 cache without intervention" 266 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Node Level-3 cache without intervention"
229 }, 267 },
230 { 268 {
269 "Unit": "CPU-M-CF",
231 "EventCode": "167", 270 "EventCode": "167",
232 "EventName": "L1I_ONDRAWER_L4_SOURCED_WRITES", 271 "EventName": "L1I_ONDRAWER_L4_SOURCED_WRITES",
233 "BriefDescription": "L1I On-Drawer L4 Sourced Writes", 272 "BriefDescription": "L1I On-Drawer L4 Sourced Writes",
234 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Drawer Level-4 cache" 273 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Drawer Level-4 cache"
235 }, 274 },
236 { 275 {
276 "Unit": "CPU-M-CF",
237 "EventCode": "168", 277 "EventCode": "168",
238 "EventName": "L1I_ONDRAWER_L3_SOURCED_WRITES_IV", 278 "EventName": "L1I_ONDRAWER_L3_SOURCED_WRITES_IV",
239 "BriefDescription": "L1I On-Drawer L3 Sourced Writes with Intervention", 279 "BriefDescription": "L1I On-Drawer L3 Sourced Writes with Intervention",
240 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache with intervention" 280 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache with intervention"
241 }, 281 },
242 { 282 {
283 "Unit": "CPU-M-CF",
243 "EventCode": "169", 284 "EventCode": "169",
244 "EventName": "L1I_ONDRAWER_L3_SOURCED_WRITES", 285 "EventName": "L1I_ONDRAWER_L3_SOURCED_WRITES",
245 "BriefDescription": "L1I On-Drawer L3 Sourced Writes", 286 "BriefDescription": "L1I On-Drawer L3 Sourced Writes",
246 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache without intervention" 287 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Drawer Level-3 cache without intervention"
247 }, 288 },
248 { 289 {
290 "Unit": "CPU-M-CF",
249 "EventCode": "170", 291 "EventCode": "170",
250 "EventName": "L1I_OFFDRAWER_SCOL_L4_SOURCED_WRITES", 292 "EventName": "L1I_OFFDRAWER_SCOL_L4_SOURCED_WRITES",
251 "BriefDescription": "L1I Off-Drawer Same-Column L4 Sourced Writes", 293 "BriefDescription": "L1I Off-Drawer Same-Column L4 Sourced Writes",
252 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-4 cache" 294 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-4 cache"
253 }, 295 },
254 { 296 {
297 "Unit": "CPU-M-CF",
255 "EventCode": "171", 298 "EventCode": "171",
256 "EventName": "L1I_OFFDRAWER_SCOL_L3_SOURCED_WRITES_IV", 299 "EventName": "L1I_OFFDRAWER_SCOL_L3_SOURCED_WRITES_IV",
257 "BriefDescription": "L1I Off-Drawer Same-Column L3 Sourced Writes with Intervention", 300 "BriefDescription": "L1I Off-Drawer Same-Column L3 Sourced Writes with Intervention",
258 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache with intervention" 301 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache with intervention"
259 }, 302 },
260 { 303 {
304 "Unit": "CPU-M-CF",
261 "EventCode": "172", 305 "EventCode": "172",
262 "EventName": "L1I_OFFDRAWER_SCOL_L3_SOURCED_WRITES", 306 "EventName": "L1I_OFFDRAWER_SCOL_L3_SOURCED_WRITES",
263 "BriefDescription": "L1I Off-Drawer Same-Column L3 Sourced Writes", 307 "BriefDescription": "L1I Off-Drawer Same-Column L3 Sourced Writes",
264 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache without intervention" 308 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Same-Column Level-3 cache without intervention"
265 }, 309 },
266 { 310 {
311 "Unit": "CPU-M-CF",
267 "EventCode": "173", 312 "EventCode": "173",
268 "EventName": "L1I_OFFDRAWER_FCOL_L4_SOURCED_WRITES", 313 "EventName": "L1I_OFFDRAWER_FCOL_L4_SOURCED_WRITES",
269 "BriefDescription": "L1I Off-Drawer Far-Column L4 Sourced Writes", 314 "BriefDescription": "L1I Off-Drawer Far-Column L4 Sourced Writes",
270 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-4 cache" 315 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-4 cache"
271 }, 316 },
272 { 317 {
318 "Unit": "CPU-M-CF",
273 "EventCode": "174", 319 "EventCode": "174",
274 "EventName": "L1I_OFFDRAWER_FCOL_L3_SOURCED_WRITES_IV", 320 "EventName": "L1I_OFFDRAWER_FCOL_L3_SOURCED_WRITES_IV",
275 "BriefDescription": "L1I Off-Drawer Far-Column L3 Sourced Writes with Intervention", 321 "BriefDescription": "L1I Off-Drawer Far-Column L3 Sourced Writes with Intervention",
276 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache with intervention" 322 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache with intervention"
277 }, 323 },
278 { 324 {
325 "Unit": "CPU-M-CF",
279 "EventCode": "175", 326 "EventCode": "175",
280 "EventName": "L1I_OFFDRAWER_FCOL_L3_SOURCED_WRITES", 327 "EventName": "L1I_OFFDRAWER_FCOL_L3_SOURCED_WRITES",
281 "BriefDescription": "L1I Off-Drawer Far-Column L3 Sourced Writes", 328 "BriefDescription": "L1I Off-Drawer Far-Column L3 Sourced Writes",
282 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache without intervention" 329 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Far-Column Level-3 cache without intervention"
283 }, 330 },
284 { 331 {
332 "Unit": "CPU-M-CF",
285 "EventCode": "176", 333 "EventCode": "176",
286 "EventName": "L1I_ONNODE_MEM_SOURCED_WRITES", 334 "EventName": "L1I_ONNODE_MEM_SOURCED_WRITES",
287 "BriefDescription": "L1I On-Node Memory Sourced Writes", 335 "BriefDescription": "L1I On-Node Memory Sourced Writes",
288 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Node memory" 336 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Node memory"
289 }, 337 },
290 { 338 {
339 "Unit": "CPU-M-CF",
291 "EventCode": "177", 340 "EventCode": "177",
292 "EventName": "L1I_ONDRAWER_MEM_SOURCED_WRITES", 341 "EventName": "L1I_ONDRAWER_MEM_SOURCED_WRITES",
293 "BriefDescription": "L1I On-Drawer Memory Sourced Writes", 342 "BriefDescription": "L1I On-Drawer Memory Sourced Writes",
294 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Drawer memory" 343 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Drawer memory"
295 }, 344 },
296 { 345 {
346 "Unit": "CPU-M-CF",
297 "EventCode": "178", 347 "EventCode": "178",
298 "EventName": "L1I_OFFDRAWER_MEM_SOURCED_WRITES", 348 "EventName": "L1I_OFFDRAWER_MEM_SOURCED_WRITES",
299 "BriefDescription": "L1I Off-Drawer Memory Sourced Writes", 349 "BriefDescription": "L1I Off-Drawer Memory Sourced Writes",
300 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Drawer memory" 350 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Drawer memory"
301 }, 351 },
302 { 352 {
353 "Unit": "CPU-M-CF",
303 "EventCode": "179", 354 "EventCode": "179",
304 "EventName": "L1I_ONCHIP_MEM_SOURCED_WRITES", 355 "EventName": "L1I_ONCHIP_MEM_SOURCED_WRITES",
305 "BriefDescription": "L1I On-Chip Memory Sourced Writes", 356 "BriefDescription": "L1I On-Chip Memory Sourced Writes",
306 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Chip memory" 357 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Chip memory"
307 }, 358 },
308 { 359 {
360 "Unit": "CPU-M-CF",
309 "EventCode": "218", 361 "EventCode": "218",
310 "EventName": "TX_NC_TABORT", 362 "EventName": "TX_NC_TABORT",
311 "BriefDescription": "Aborted transactions in non-constrained TX mode", 363 "BriefDescription": "Aborted transactions in non-constrained TX mode",
312 "PublicDescription": "A transaction abort has occurred in a non-constrained transactional-execution mode" 364 "PublicDescription": "A transaction abort has occurred in a non-constrained transactional-execution mode"
313 }, 365 },
314 { 366 {
367 "Unit": "CPU-M-CF",
315 "EventCode": "219", 368 "EventCode": "219",
316 "EventName": "TX_C_TABORT_NO_SPECIAL", 369 "EventName": "TX_C_TABORT_NO_SPECIAL",
317 "BriefDescription": "Aborted transactions in constrained TX mode not using special completion logic", 370 "BriefDescription": "Aborted transactions in constrained TX mode not using special completion logic",
318 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is not using any special logic to allow the transaction to complete" 371 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is not using any special logic to allow the transaction to complete"
319 }, 372 },
320 { 373 {
374 "Unit": "CPU-M-CF",
321 "EventCode": "220", 375 "EventCode": "220",
322 "EventName": "TX_C_TABORT_SPECIAL", 376 "EventName": "TX_C_TABORT_SPECIAL",
323 "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic", 377 "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic",
324 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is using special logic to allow the transaction to complete" 378 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is using special logic to allow the transaction to complete"
325 }, 379 },
326 { 380 {
381 "Unit": "CPU-M-CF",
327 "EventCode": "448", 382 "EventCode": "448",
328 "EventName": "MT_DIAG_CYCLES_ONE_THR_ACTIVE", 383 "EventName": "MT_DIAG_CYCLES_ONE_THR_ACTIVE",
329 "BriefDescription": "Cycle count with one thread active", 384 "BriefDescription": "Cycle count with one thread active",
330 "PublicDescription": "Cycle count with one thread active" 385 "PublicDescription": "Cycle count with one thread active"
331 }, 386 },
332 { 387 {
388 "Unit": "CPU-M-CF",
333 "EventCode": "449", 389 "EventCode": "449",
334 "EventName": "MT_DIAG_CYCLES_TWO_THR_ACTIVE", 390 "EventName": "MT_DIAG_CYCLES_TWO_THR_ACTIVE",
335 "BriefDescription": "Cycle count with two threads active", 391 "BriefDescription": "Cycle count with two threads active",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json b/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json
new file mode 100644
index 000000000000..1a0034f79f73
--- /dev/null
+++ b/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json
@@ -0,0 +1,7 @@
1[
2 {
3 "BriefDescription": "Transaction count",
4 "MetricName": "transaction",
5 "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
6 }
7]
diff --git a/tools/perf/pmu-events/arch/s390/cf_z14/basic.json b/tools/perf/pmu-events/arch/s390/cf_z14/basic.json
index 8f653c9d899d..17fb5241928b 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z14/basic.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z14/basic.json
@@ -1,47 +1,55 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "0", 4 "EventCode": "0",
4 "EventName": "CPU_CYCLES", 5 "EventName": "CPU_CYCLES",
5 "BriefDescription": "CPU Cycles", 6 "BriefDescription": "CPU Cycles",
6 "PublicDescription": "Cycle Count" 7 "PublicDescription": "Cycle Count"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "1", 11 "EventCode": "1",
10 "EventName": "INSTRUCTIONS", 12 "EventName": "INSTRUCTIONS",
11 "BriefDescription": "Instructions", 13 "BriefDescription": "Instructions",
12 "PublicDescription": "Instruction Count" 14 "PublicDescription": "Instruction Count"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "2", 18 "EventCode": "2",
16 "EventName": "L1I_DIR_WRITES", 19 "EventName": "L1I_DIR_WRITES",
17 "BriefDescription": "L1I Directory Writes", 20 "BriefDescription": "L1I Directory Writes",
18 "PublicDescription": "Level-1 I-Cache Directory Write Count" 21 "PublicDescription": "Level-1 I-Cache Directory Write Count"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "3", 25 "EventCode": "3",
22 "EventName": "L1I_PENALTY_CYCLES", 26 "EventName": "L1I_PENALTY_CYCLES",
23 "BriefDescription": "L1I Penalty Cycles", 27 "BriefDescription": "L1I Penalty Cycles",
24 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count" 28 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "4", 32 "EventCode": "4",
28 "EventName": "L1D_DIR_WRITES", 33 "EventName": "L1D_DIR_WRITES",
29 "BriefDescription": "L1D Directory Writes", 34 "BriefDescription": "L1D Directory Writes",
30 "PublicDescription": "Level-1 D-Cache Directory Write Count" 35 "PublicDescription": "Level-1 D-Cache Directory Write Count"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "5", 39 "EventCode": "5",
34 "EventName": "L1D_PENALTY_CYCLES", 40 "EventName": "L1D_PENALTY_CYCLES",
35 "BriefDescription": "L1D Penalty Cycles", 41 "BriefDescription": "L1D Penalty Cycles",
36 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count" 42 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "32", 46 "EventCode": "32",
40 "EventName": "PROBLEM_STATE_CPU_CYCLES", 47 "EventName": "PROBLEM_STATE_CPU_CYCLES",
41 "BriefDescription": "Problem-State CPU Cycles", 48 "BriefDescription": "Problem-State CPU Cycles",
42 "PublicDescription": "Problem-State Cycle Count" 49 "PublicDescription": "Problem-State Cycle Count"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "33", 53 "EventCode": "33",
46 "EventName": "PROBLEM_STATE_INSTRUCTIONS", 54 "EventName": "PROBLEM_STATE_INSTRUCTIONS",
47 "BriefDescription": "Problem-State Instructions", 55 "BriefDescription": "Problem-State Instructions",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z14/crypto.json b/tools/perf/pmu-events/arch/s390/cf_z14/crypto.json
index 7e5b72492141..db286f19e7b6 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z14/crypto.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z14/crypto.json
@@ -1,95 +1,111 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "64", 4 "EventCode": "64",
4 "EventName": "PRNG_FUNCTIONS", 5 "EventName": "PRNG_FUNCTIONS",
5 "BriefDescription": "PRNG Functions", 6 "BriefDescription": "PRNG Functions",
6 "PublicDescription": "Total number of the PRNG functions issued by the CPU" 7 "PublicDescription": "Total number of the PRNG functions issued by the CPU"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "65", 11 "EventCode": "65",
10 "EventName": "PRNG_CYCLES", 12 "EventName": "PRNG_CYCLES",
11 "BriefDescription": "PRNG Cycles", 13 "BriefDescription": "PRNG Cycles",
12 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU" 14 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "66", 18 "EventCode": "66",
16 "EventName": "PRNG_BLOCKED_FUNCTIONS", 19 "EventName": "PRNG_BLOCKED_FUNCTIONS",
17 "BriefDescription": "PRNG Blocked Functions", 20 "BriefDescription": "PRNG Blocked Functions",
18 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 21 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "67", 25 "EventCode": "67",
22 "EventName": "PRNG_BLOCKED_CYCLES", 26 "EventName": "PRNG_BLOCKED_CYCLES",
23 "BriefDescription": "PRNG Blocked Cycles", 27 "BriefDescription": "PRNG Blocked Cycles",
24 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 28 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "68", 32 "EventCode": "68",
28 "EventName": "SHA_FUNCTIONS", 33 "EventName": "SHA_FUNCTIONS",
29 "BriefDescription": "SHA Functions", 34 "BriefDescription": "SHA Functions",
30 "PublicDescription": "Total number of SHA functions issued by the CPU" 35 "PublicDescription": "Total number of SHA functions issued by the CPU"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "69", 39 "EventCode": "69",
34 "EventName": "SHA_CYCLES", 40 "EventName": "SHA_CYCLES",
35 "BriefDescription": "SHA Cycles", 41 "BriefDescription": "SHA Cycles",
36 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU" 42 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "70", 46 "EventCode": "70",
40 "EventName": "SHA_BLOCKED_FUNCTIONS", 47 "EventName": "SHA_BLOCKED_FUNCTIONS",
41 "BriefDescription": "SHA Blocked Functions", 48 "BriefDescription": "SHA Blocked Functions",
42 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU" 49 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "71", 53 "EventCode": "71",
46 "EventName": "SHA_BLOCKED_CYCLES", 54 "EventName": "SHA_BLOCKED_CYCLES",
47 "BriefDescription": "SHA Bloced Cycles", 55 "BriefDescription": "SHA Bloced Cycles",
48 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU" 56 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "72", 60 "EventCode": "72",
52 "EventName": "DEA_FUNCTIONS", 61 "EventName": "DEA_FUNCTIONS",
53 "BriefDescription": "DEA Functions", 62 "BriefDescription": "DEA Functions",
54 "PublicDescription": "Total number of the DEA functions issued by the CPU" 63 "PublicDescription": "Total number of the DEA functions issued by the CPU"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "73", 67 "EventCode": "73",
58 "EventName": "DEA_CYCLES", 68 "EventName": "DEA_CYCLES",
59 "BriefDescription": "DEA Cycles", 69 "BriefDescription": "DEA Cycles",
60 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU" 70 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "74", 74 "EventCode": "74",
64 "EventName": "DEA_BLOCKED_FUNCTIONS", 75 "EventName": "DEA_BLOCKED_FUNCTIONS",
65 "BriefDescription": "DEA Blocked Functions", 76 "BriefDescription": "DEA Blocked Functions",
66 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 77 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "75", 81 "EventCode": "75",
70 "EventName": "DEA_BLOCKED_CYCLES", 82 "EventName": "DEA_BLOCKED_CYCLES",
71 "BriefDescription": "DEA Blocked Cycles", 83 "BriefDescription": "DEA Blocked Cycles",
72 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 84 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "76", 88 "EventCode": "76",
76 "EventName": "AES_FUNCTIONS", 89 "EventName": "AES_FUNCTIONS",
77 "BriefDescription": "AES Functions", 90 "BriefDescription": "AES Functions",
78 "PublicDescription": "Total number of AES functions issued by the CPU" 91 "PublicDescription": "Total number of AES functions issued by the CPU"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "77", 95 "EventCode": "77",
82 "EventName": "AES_CYCLES", 96 "EventName": "AES_CYCLES",
83 "BriefDescription": "AES Cycles", 97 "BriefDescription": "AES Cycles",
84 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU" 98 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "78", 102 "EventCode": "78",
88 "EventName": "AES_BLOCKED_FUNCTIONS", 103 "EventName": "AES_BLOCKED_FUNCTIONS",
89 "BriefDescription": "AES Blocked Functions", 104 "BriefDescription": "AES Blocked Functions",
90 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 105 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "79", 109 "EventCode": "79",
94 "EventName": "AES_BLOCKED_CYCLES", 110 "EventName": "AES_BLOCKED_CYCLES",
95 "BriefDescription": "AES Blocked Cycles", 111 "BriefDescription": "AES Blocked Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z14/extended.json b/tools/perf/pmu-events/arch/s390/cf_z14/extended.json
index aa4dfb46b65b..e7a3524b748f 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z14/extended.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z14/extended.json
@@ -1,317 +1,370 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "128", 4 "EventCode": "128",
4 "EventName": "L1D_RO_EXCL_WRITES", 5 "EventName": "L1D_RO_EXCL_WRITES",
5 "BriefDescription": "L1D Read-only Exclusive Writes", 6 "BriefDescription": "L1D Read-only Exclusive Writes",
6 "PublicDescription": "Counter:128 Name:L1D_RO_EXCL_WRITES A directory write to the Level-1 Data cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line" 7 "PublicDescription": "Counter:128 Name:L1D_RO_EXCL_WRITES A directory write to the Level-1 Data cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "129", 11 "EventCode": "129",
10 "EventName": "DTLB2_WRITES", 12 "EventName": "DTLB2_WRITES",
11 "BriefDescription": "DTLB2 Writes", 13 "BriefDescription": "DTLB2 Writes",
12 "PublicDescription": "A translation has been written into The Translation Lookaside Buffer 2 (TLB2) and the request was made by the data cache" 14 "PublicDescription": "A translation has been written into The Translation Lookaside Buffer 2 (TLB2) and the request was made by the data cache"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "130", 18 "EventCode": "130",
16 "EventName": "DTLB2_MISSES", 19 "EventName": "DTLB2_MISSES",
17 "BriefDescription": "DTLB2 Misses", 20 "BriefDescription": "DTLB2 Misses",
18 "PublicDescription": "A TLB2 miss is in progress for a request made by the data cache. Incremented by one for every TLB2 miss in progress for the Level-1 Data cache on this cycle" 21 "PublicDescription": "A TLB2 miss is in progress for a request made by the data cache. Incremented by one for every TLB2 miss in progress for the Level-1 Data cache on this cycle"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "131", 25 "EventCode": "131",
22 "EventName": "DTLB2_HPAGE_WRITES", 26 "EventName": "DTLB2_HPAGE_WRITES",
23 "BriefDescription": "DTLB2 One-Megabyte Page Writes", 27 "BriefDescription": "DTLB2 One-Megabyte Page Writes",
24 "PublicDescription": "A translation entry was written into the Combined Region and Segment Table Entry array in the Level-2 TLB for a one-megabyte page or a Last Host Translation was done" 28 "PublicDescription": "A translation entry was written into the Combined Region and Segment Table Entry array in the Level-2 TLB for a one-megabyte page or a Last Host Translation was done"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "132", 32 "EventCode": "132",
28 "EventName": "DTLB2_GPAGE_WRITES", 33 "EventName": "DTLB2_GPAGE_WRITES",
29 "BriefDescription": "DTLB2 Two-Gigabyte Page Writes", 34 "BriefDescription": "DTLB2 Two-Gigabyte Page Writes",
30 "PublicDescription": "A translation entry for a two-gigabyte page was written into the Level-2 TLB" 35 "PublicDescription": "A translation entry for a two-gigabyte page was written into the Level-2 TLB"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "133", 39 "EventCode": "133",
34 "EventName": "L1D_L2D_SOURCED_WRITES", 40 "EventName": "L1D_L2D_SOURCED_WRITES",
35 "BriefDescription": "L1D L2D Sourced Writes", 41 "BriefDescription": "L1D L2D Sourced Writes",
36 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Data cache" 42 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Data cache"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "134", 46 "EventCode": "134",
40 "EventName": "ITLB2_WRITES", 47 "EventName": "ITLB2_WRITES",
41 "BriefDescription": "ITLB2 Writes", 48 "BriefDescription": "ITLB2 Writes",
42 "PublicDescription": "A translation entry has been written into the Translation Lookaside Buffer 2 (TLB2) and the request was made by the instruction cache" 49 "PublicDescription": "A translation entry has been written into the Translation Lookaside Buffer 2 (TLB2) and the request was made by the instruction cache"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "135", 53 "EventCode": "135",
46 "EventName": "ITLB2_MISSES", 54 "EventName": "ITLB2_MISSES",
47 "BriefDescription": "ITLB2 Misses", 55 "BriefDescription": "ITLB2 Misses",
48 "PublicDescription": "A TLB2 miss is in progress for a request made by the instruction cache. Incremented by one for every TLB2 miss in progress for the Level-1 Instruction cache in a cycle" 56 "PublicDescription": "A TLB2 miss is in progress for a request made by the instruction cache. Incremented by one for every TLB2 miss in progress for the Level-1 Instruction cache in a cycle"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "136", 60 "EventCode": "136",
52 "EventName": "L1I_L2I_SOURCED_WRITES", 61 "EventName": "L1I_L2I_SOURCED_WRITES",
53 "BriefDescription": "L1I L2I Sourced Writes", 62 "BriefDescription": "L1I L2I Sourced Writes",
54 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from the Level-2 Instruction cache" 63 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from the Level-2 Instruction cache"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "137", 67 "EventCode": "137",
58 "EventName": "TLB2_PTE_WRITES", 68 "EventName": "TLB2_PTE_WRITES",
59 "BriefDescription": "TLB2 PTE Writes", 69 "BriefDescription": "TLB2 PTE Writes",
60 "PublicDescription": "A translation entry was written into the Page Table Entry array in the Level-2 TLB" 70 "PublicDescription": "A translation entry was written into the Page Table Entry array in the Level-2 TLB"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "138", 74 "EventCode": "138",
64 "EventName": "TLB2_CRSTE_WRITES", 75 "EventName": "TLB2_CRSTE_WRITES",
65 "BriefDescription": "TLB2 CRSTE Writes", 76 "BriefDescription": "TLB2 CRSTE Writes",
66 "PublicDescription": "Translation entries were written into the Combined Region and Segment Table Entry array and the Page Table Entry array in the Level-2 TLB" 77 "PublicDescription": "Translation entries were written into the Combined Region and Segment Table Entry array and the Page Table Entry array in the Level-2 TLB"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "139", 81 "EventCode": "139",
70 "EventName": "TLB2_ENGINES_BUSY", 82 "EventName": "TLB2_ENGINES_BUSY",
71 "BriefDescription": "TLB2 Engines Busy", 83 "BriefDescription": "TLB2 Engines Busy",
72 "PublicDescription": "The number of Level-2 TLB translation engines busy in a cycle" 84 "PublicDescription": "The number of Level-2 TLB translation engines busy in a cycle"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "140", 88 "EventCode": "140",
76 "EventName": "TX_C_TEND", 89 "EventName": "TX_C_TEND",
77 "BriefDescription": "Completed TEND instructions in constrained TX mode", 90 "BriefDescription": "Completed TEND instructions in constrained TX mode",
78 "PublicDescription": "A TEND instruction has completed in a constrained transactional-execution mode" 91 "PublicDescription": "A TEND instruction has completed in a constrained transactional-execution mode"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "141", 95 "EventCode": "141",
82 "EventName": "TX_NC_TEND", 96 "EventName": "TX_NC_TEND",
83 "BriefDescription": "Completed TEND instructions in non-constrained TX mode", 97 "BriefDescription": "Completed TEND instructions in non-constrained TX mode",
84 "PublicDescription": "A TEND instruction has completed in a non-constrained transactional-execution mode" 98 "PublicDescription": "A TEND instruction has completed in a non-constrained transactional-execution mode"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "143", 102 "EventCode": "143",
88 "EventName": "L1C_TLB2_MISSES", 103 "EventName": "L1C_TLB2_MISSES",
89 "BriefDescription": "L1C TLB2 Misses", 104 "BriefDescription": "L1C TLB2 Misses",
90 "PublicDescription": "Increments by one for any cycle where a level-1 cache or level-2 TLB miss is in progress" 105 "PublicDescription": "Increments by one for any cycle where a level-1 cache or level-2 TLB miss is in progress"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "144", 109 "EventCode": "144",
94 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES", 110 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES",
95 "BriefDescription": "L1D On-Chip L3 Sourced Writes", 111 "BriefDescription": "L1D On-Chip L3 Sourced Writes",
96 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache without intervention" 112 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache without intervention"
97 }, 113 },
98 { 114 {
115 "Unit": "CPU-M-CF",
99 "EventCode": "145", 116 "EventCode": "145",
100 "EventName": "L1D_ONCHIP_MEMORY_SOURCED_WRITES", 117 "EventName": "L1D_ONCHIP_MEMORY_SOURCED_WRITES",
101 "BriefDescription": "L1D On-Chip Memory Sourced Writes", 118 "BriefDescription": "L1D On-Chip Memory Sourced Writes",
102 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Chip memory" 119 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Chip memory"
103 }, 120 },
104 { 121 {
122 "Unit": "CPU-M-CF",
105 "EventCode": "146", 123 "EventCode": "146",
106 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_IV", 124 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_IV",
107 "BriefDescription": "L1D On-Chip L3 Sourced Writes with Intervention", 125 "BriefDescription": "L1D On-Chip L3 Sourced Writes with Intervention",
108 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache with intervention" 126 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Chip Level-3 cache with intervention"
109 }, 127 },
110 { 128 {
129 "Unit": "CPU-M-CF",
111 "EventCode": "147", 130 "EventCode": "147",
112 "EventName": "L1D_ONCLUSTER_L3_SOURCED_WRITES", 131 "EventName": "L1D_ONCLUSTER_L3_SOURCED_WRITES",
113 "BriefDescription": "L1D On-Cluster L3 Sourced Writes", 132 "BriefDescription": "L1D On-Cluster L3 Sourced Writes",
114 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Cluster Level-3 cache withountervention" 133 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Cluster Level-3 cache withountervention"
115 }, 134 },
116 { 135 {
136 "Unit": "CPU-M-CF",
117 "EventCode": "148", 137 "EventCode": "148",
118 "EventName": "L1D_ONCLUSTER_MEMORY_SOURCED_WRITES", 138 "EventName": "L1D_ONCLUSTER_MEMORY_SOURCED_WRITES",
119 "BriefDescription": "L1D On-Cluster Memory Sourced Writes", 139 "BriefDescription": "L1D On-Cluster Memory Sourced Writes",
120 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Cluster memory" 140 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Cluster memory"
121 }, 141 },
122 { 142 {
143 "Unit": "CPU-M-CF",
123 "EventCode": "149", 144 "EventCode": "149",
124 "EventName": "L1D_ONCLUSTER_L3_SOURCED_WRITES_IV", 145 "EventName": "L1D_ONCLUSTER_L3_SOURCED_WRITES_IV",
125 "BriefDescription": "L1D On-Cluster L3 Sourced Writes with Intervention", 146 "BriefDescription": "L1D On-Cluster L3 Sourced Writes with Intervention",
126 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Cluster Level-3 cache with intervention" 147 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On-Cluster Level-3 cache with intervention"
127 }, 148 },
128 { 149 {
150 "Unit": "CPU-M-CF",
129 "EventCode": "150", 151 "EventCode": "150",
130 "EventName": "L1D_OFFCLUSTER_L3_SOURCED_WRITES", 152 "EventName": "L1D_OFFCLUSTER_L3_SOURCED_WRITES",
131 "BriefDescription": "L1D Off-Cluster L3 Sourced Writes", 153 "BriefDescription": "L1D Off-Cluster L3 Sourced Writes",
132 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache without intervention" 154 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache without intervention"
133 }, 155 },
134 { 156 {
157 "Unit": "CPU-M-CF",
135 "EventCode": "151", 158 "EventCode": "151",
136 "EventName": "L1D_OFFCLUSTER_MEMORY_SOURCED_WRITES", 159 "EventName": "L1D_OFFCLUSTER_MEMORY_SOURCED_WRITES",
137 "BriefDescription": "L1D Off-Cluster Memory Sourced Writes", 160 "BriefDescription": "L1D Off-Cluster Memory Sourced Writes",
138 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from Off-Cluster memory" 161 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from Off-Cluster memory"
139 }, 162 },
140 { 163 {
164 "Unit": "CPU-M-CF",
141 "EventCode": "152", 165 "EventCode": "152",
142 "EventName": "L1D_OFFCLUSTER_L3_SOURCED_WRITES_IV", 166 "EventName": "L1D_OFFCLUSTER_L3_SOURCED_WRITES_IV",
143 "BriefDescription": "L1D Off-Cluster L3 Sourced Writes with Intervention", 167 "BriefDescription": "L1D Off-Cluster L3 Sourced Writes with Intervention",
144 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache with intervention" 168 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache with intervention"
145 }, 169 },
146 { 170 {
171 "Unit": "CPU-M-CF",
147 "EventCode": "153", 172 "EventCode": "153",
148 "EventName": "L1D_OFFDRAWER_L3_SOURCED_WRITES", 173 "EventName": "L1D_OFFDRAWER_L3_SOURCED_WRITES",
149 "BriefDescription": "L1D Off-Drawer L3 Sourced Writes", 174 "BriefDescription": "L1D Off-Drawer L3 Sourced Writes",
150 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache without intervention" 175 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache without intervention"
151 }, 176 },
152 { 177 {
178 "Unit": "CPU-M-CF",
153 "EventCode": "154", 179 "EventCode": "154",
154 "EventName": "L1D_OFFDRAWER_MEMORY_SOURCED_WRITES", 180 "EventName": "L1D_OFFDRAWER_MEMORY_SOURCED_WRITES",
155 "BriefDescription": "L1D Off-Drawer Memory Sourced Writes", 181 "BriefDescription": "L1D Off-Drawer Memory Sourced Writes",
156 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from Off-Drawer memory" 182 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from Off-Drawer memory"
157 }, 183 },
158 { 184 {
185 "Unit": "CPU-M-CF",
159 "EventCode": "155", 186 "EventCode": "155",
160 "EventName": "L1D_OFFDRAWER_L3_SOURCED_WRITES_IV", 187 "EventName": "L1D_OFFDRAWER_L3_SOURCED_WRITES_IV",
161 "BriefDescription": "L1D Off-Drawer L3 Sourced Writes with Intervention", 188 "BriefDescription": "L1D Off-Drawer L3 Sourced Writes with Intervention",
162 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache with intervention" 189 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache with intervention"
163 }, 190 },
164 { 191 {
192 "Unit": "CPU-M-CF",
165 "EventCode": "156", 193 "EventCode": "156",
166 "EventName": "L1D_ONDRAWER_L4_SOURCED_WRITES", 194 "EventName": "L1D_ONDRAWER_L4_SOURCED_WRITES",
167 "BriefDescription": "L1D On-Drawer L4 Sourced Writes", 195 "BriefDescription": "L1D On-Drawer L4 Sourced Writes",
168 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Drawer Level-4 cache" 196 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Drawer Level-4 cache"
169 }, 197 },
170 { 198 {
199 "Unit": "CPU-M-CF",
171 "EventCode": "157", 200 "EventCode": "157",
172 "EventName": "L1D_OFFDRAWER_L4_SOURCED_WRITES", 201 "EventName": "L1D_OFFDRAWER_L4_SOURCED_WRITES",
173 "BriefDescription": "L1D Off-Drawer L4 Sourced Writes", 202 "BriefDescription": "L1D Off-Drawer L4 Sourced Writes",
174 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from Off-Drawer Level-4 cache" 203 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from Off-Drawer Level-4 cache"
175 }, 204 },
176 { 205 {
206 "Unit": "CPU-M-CF",
177 "EventCode": "158", 207 "EventCode": "158",
178 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_RO", 208 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_RO",
179 "BriefDescription": "L1D On-Chip L3 Sourced Writes read-only", 209 "BriefDescription": "L1D On-Chip L3 Sourced Writes read-only",
180 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Chip L3 but a read-only invalidate was done to remove other copies of the cache line" 210 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from On-Chip L3 but a read-only invalidate was done to remove other copies of the cache line"
181 }, 211 },
182 { 212 {
213 "Unit": "CPU-M-CF",
183 "EventCode": "162", 214 "EventCode": "162",
184 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES", 215 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES",
185 "BriefDescription": "L1I On-Chip L3 Sourced Writes", 216 "BriefDescription": "L1I On-Chip L3 Sourced Writes",
186 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache ine was sourced from an On-Chip Level-3 cache without intervention" 217 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache ine was sourced from an On-Chip Level-3 cache without intervention"
187 }, 218 },
188 { 219 {
220 "Unit": "CPU-M-CF",
189 "EventCode": "163", 221 "EventCode": "163",
190 "EventName": "L1I_ONCHIP_MEMORY_SOURCED_WRITES", 222 "EventName": "L1I_ONCHIP_MEMORY_SOURCED_WRITES",
191 "BriefDescription": "L1I On-Chip Memory Sourced Writes", 223 "BriefDescription": "L1I On-Chip Memory Sourced Writes",
192 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache ine was sourced from On-Chip memory" 224 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache ine was sourced from On-Chip memory"
193 }, 225 },
194 { 226 {
227 "Unit": "CPU-M-CF",
195 "EventCode": "164", 228 "EventCode": "164",
196 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES_IV", 229 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES_IV",
197 "BriefDescription": "L1I On-Chip L3 Sourced Writes with Intervention", 230 "BriefDescription": "L1I On-Chip L3 Sourced Writes with Intervention",
198 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache ine was sourced from an On-Chip Level-3 cache with intervention" 231 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache ine was sourced from an On-Chip Level-3 cache with intervention"
199 }, 232 },
200 { 233 {
234 "Unit": "CPU-M-CF",
201 "EventCode": "165", 235 "EventCode": "165",
202 "EventName": "L1I_ONCLUSTER_L3_SOURCED_WRITES", 236 "EventName": "L1I_ONCLUSTER_L3_SOURCED_WRITES",
203 "BriefDescription": "L1I On-Cluster L3 Sourced Writes", 237 "BriefDescription": "L1I On-Cluster L3 Sourced Writes",
204 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Cluster Level-3 cache without intervention" 238 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Cluster Level-3 cache without intervention"
205 }, 239 },
206 { 240 {
241 "Unit": "CPU-M-CF",
207 "EventCode": "166", 242 "EventCode": "166",
208 "EventName": "L1I_ONCLUSTER_MEMORY_SOURCED_WRITES", 243 "EventName": "L1I_ONCLUSTER_MEMORY_SOURCED_WRITES",
209 "BriefDescription": "L1I On-Cluster Memory Sourced Writes", 244 "BriefDescription": "L1I On-Cluster Memory Sourced Writes",
210 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Cluster memory" 245 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On-Cluster memory"
211 }, 246 },
212 { 247 {
248 "Unit": "CPU-M-CF",
213 "EventCode": "167", 249 "EventCode": "167",
214 "EventName": "L1I_ONCLUSTER_L3_SOURCED_WRITES_IV", 250 "EventName": "L1I_ONCLUSTER_L3_SOURCED_WRITES_IV",
215 "BriefDescription": "L1I On-Cluster L3 Sourced Writes with Intervention", 251 "BriefDescription": "L1I On-Cluster L3 Sourced Writes with Intervention",
216 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Cluster Level-3 cache with intervention" 252 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Cluster Level-3 cache with intervention"
217 }, 253 },
218 { 254 {
255 "Unit": "CPU-M-CF",
219 "EventCode": "168", 256 "EventCode": "168",
220 "EventName": "L1I_OFFCLUSTER_L3_SOURCED_WRITES", 257 "EventName": "L1I_OFFCLUSTER_L3_SOURCED_WRITES",
221 "BriefDescription": "L1I Off-Cluster L3 Sourced Writes", 258 "BriefDescription": "L1I Off-Cluster L3 Sourced Writes",
222 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache without intervention" 259 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache without intervention"
223 }, 260 },
224 { 261 {
262 "Unit": "CPU-M-CF",
225 "EventCode": "169", 263 "EventCode": "169",
226 "EventName": "L1I_OFFCLUSTER_MEMORY_SOURCED_WRITES", 264 "EventName": "L1I_OFFCLUSTER_MEMORY_SOURCED_WRITES",
227 "BriefDescription": "L1I Off-Cluster Memory Sourced Writes", 265 "BriefDescription": "L1I Off-Cluster Memory Sourced Writes",
228 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from Off-Cluster memory" 266 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from Off-Cluster memory"
229 }, 267 },
230 { 268 {
269 "Unit": "CPU-M-CF",
231 "EventCode": "170", 270 "EventCode": "170",
232 "EventName": "L1I_OFFCLUSTER_L3_SOURCED_WRITES_IV", 271 "EventName": "L1I_OFFCLUSTER_L3_SOURCED_WRITES_IV",
233 "BriefDescription": "L1I Off-Cluster L3 Sourced Writes with Intervention", 272 "BriefDescription": "L1I Off-Cluster L3 Sourced Writes with Intervention",
234 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache with intervention" 273 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Cluster Level-3 cache with intervention"
235 }, 274 },
236 { 275 {
276 "Unit": "CPU-M-CF",
237 "EventCode": "171", 277 "EventCode": "171",
238 "EventName": "L1I_OFFDRAWER_L3_SOURCED_WRITES", 278 "EventName": "L1I_OFFDRAWER_L3_SOURCED_WRITES",
239 "BriefDescription": "L1I Off-Drawer L3 Sourced Writes", 279 "BriefDescription": "L1I Off-Drawer L3 Sourced Writes",
240 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache without intervention" 280 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache without intervention"
241 }, 281 },
242 { 282 {
283 "Unit": "CPU-M-CF",
243 "EventCode": "172", 284 "EventCode": "172",
244 "EventName": "L1I_OFFDRAWER_MEMORY_SOURCED_WRITES", 285 "EventName": "L1I_OFFDRAWER_MEMORY_SOURCED_WRITES",
245 "BriefDescription": "L1I Off-Drawer Memory Sourced Writes", 286 "BriefDescription": "L1I Off-Drawer Memory Sourced Writes",
246 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from Off-Drawer memory" 287 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from Off-Drawer memory"
247 }, 288 },
248 { 289 {
290 "Unit": "CPU-M-CF",
249 "EventCode": "173", 291 "EventCode": "173",
250 "EventName": "L1I_OFFDRAWER_L3_SOURCED_WRITES_IV", 292 "EventName": "L1I_OFFDRAWER_L3_SOURCED_WRITES_IV",
251 "BriefDescription": "L1I Off-Drawer L3 Sourced Writes with Intervention", 293 "BriefDescription": "L1I Off-Drawer L3 Sourced Writes with Intervention",
252 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache with intervention" 294 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off-Drawer Level-3 cache with intervention"
253 }, 295 },
254 { 296 {
297 "Unit": "CPU-M-CF",
255 "EventCode": "174", 298 "EventCode": "174",
256 "EventName": "L1I_ONDRAWER_L4_SOURCED_WRITES", 299 "EventName": "L1I_ONDRAWER_L4_SOURCED_WRITES",
257 "BriefDescription": "L1I On-Drawer L4 Sourced Writes", 300 "BriefDescription": "L1I On-Drawer L4 Sourced Writes",
258 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Drawer Level-4 cache" 301 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from On-Drawer Level-4 cache"
259 }, 302 },
260 { 303 {
304 "Unit": "CPU-M-CF",
261 "EventCode": "175", 305 "EventCode": "175",
262 "EventName": "L1I_OFFDRAWER_L4_SOURCED_WRITES", 306 "EventName": "L1I_OFFDRAWER_L4_SOURCED_WRITES",
263 "BriefDescription": "L1I Off-Drawer L4 Sourced Writes", 307 "BriefDescription": "L1I Off-Drawer L4 Sourced Writes",
264 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from Off-Drawer Level-4 cache" 308 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from Off-Drawer Level-4 cache"
265 }, 309 },
266 { 310 {
311 "Unit": "CPU-M-CF",
267 "EventCode": "224", 312 "EventCode": "224",
268 "EventName": "BCD_DFP_EXECUTION_SLOTS", 313 "EventName": "BCD_DFP_EXECUTION_SLOTS",
269 "BriefDescription": "BCD DFP Execution Slots", 314 "BriefDescription": "BCD DFP Execution Slots",
270 "PublicDescription": "Count of floating point execution slots used for finished Binary Coded Decimal to Decimal Floating Point conversions. Instructions: CDZT, CXZT, CZDT, CZXT" 315 "PublicDescription": "Count of floating point execution slots used for finished Binary Coded Decimal to Decimal Floating Point conversions. Instructions: CDZT, CXZT, CZDT, CZXT"
271 }, 316 },
272 { 317 {
318 "Unit": "CPU-M-CF",
273 "EventCode": "225", 319 "EventCode": "225",
274 "EventName": "VX_BCD_EXECUTION_SLOTS", 320 "EventName": "VX_BCD_EXECUTION_SLOTS",
275 "BriefDescription": "VX BCD Execution Slots", 321 "BriefDescription": "VX BCD Execution Slots",
276 "PublicDescription": "Count of floating point execution slots used for finished vector arithmetic Binary Coded Decimal instructions. Instructions: VAP, VSP, VMPVMSP, VDP, VSDP, VRP, VLIP, VSRP, VPSOPVCP, VTP, VPKZ, VUPKZ, VCVB, VCVBG, VCVDVCVDG" 322 "PublicDescription": "Count of floating point execution slots used for finished vector arithmetic Binary Coded Decimal instructions. Instructions: VAP, VSP, VMPVMSP, VDP, VSDP, VRP, VLIP, VSRP, VPSOPVCP, VTP, VPKZ, VUPKZ, VCVB, VCVBG, VCVDVCVDG"
277 }, 323 },
278 { 324 {
325 "Unit": "CPU-M-CF",
279 "EventCode": "226", 326 "EventCode": "226",
280 "EventName": "DECIMAL_INSTRUCTIONS", 327 "EventName": "DECIMAL_INSTRUCTIONS",
281 "BriefDescription": "Decimal Instructions", 328 "BriefDescription": "Decimal Instructions",
282 "PublicDescription": "Decimal instructions dispatched. Instructions: CVB, CVD, AP, CP, DP, ED, EDMK, MP, SRP, SP, ZAP" 329 "PublicDescription": "Decimal instructions dispatched. Instructions: CVB, CVD, AP, CP, DP, ED, EDMK, MP, SRP, SP, ZAP"
283 }, 330 },
284 { 331 {
332 "Unit": "CPU-M-CF",
285 "EventCode": "232", 333 "EventCode": "232",
286 "EventName": "LAST_HOST_TRANSLATIONS", 334 "EventName": "LAST_HOST_TRANSLATIONS",
287 "BriefDescription": "Last host translation done", 335 "BriefDescription": "Last host translation done",
288 "PublicDescription": "Last Host Translation done" 336 "PublicDescription": "Last Host Translation done"
289 }, 337 },
290 { 338 {
339 "Unit": "CPU-M-CF",
291 "EventCode": "243", 340 "EventCode": "243",
292 "EventName": "TX_NC_TABORT", 341 "EventName": "TX_NC_TABORT",
293 "BriefDescription": "Aborted transactions in non-constrained TX mode", 342 "BriefDescription": "Aborted transactions in non-constrained TX mode",
294 "PublicDescription": "A transaction abort has occurred in a non-constrained transactional-execution mode" 343 "PublicDescription": "A transaction abort has occurred in a non-constrained transactional-execution mode"
295 }, 344 },
296 { 345 {
346 "Unit": "CPU-M-CF",
297 "EventCode": "244", 347 "EventCode": "244",
298 "EventName": "TX_C_TABORT_NO_SPECIAL", 348 "EventName": "TX_C_TABORT_NO_SPECIAL",
299 "BriefDescription": "Aborted transactions in constrained TX mode not using special completion logic", 349 "BriefDescription": "Aborted transactions in constrained TX mode not using special completion logic",
300 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is not using any special logic to allow the transaction to complete" 350 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is not using any special logic to allow the transaction to complete"
301 }, 351 },
302 { 352 {
353 "Unit": "CPU-M-CF",
303 "EventCode": "245", 354 "EventCode": "245",
304 "EventName": "TX_C_TABORT_SPECIAL", 355 "EventName": "TX_C_TABORT_SPECIAL",
305 "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic", 356 "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic",
306 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is using special logic to allow the transaction to complete" 357 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is using special logic to allow the transaction to complete"
307 }, 358 },
308 { 359 {
360 "Unit": "CPU-M-CF",
309 "EventCode": "448", 361 "EventCode": "448",
310 "EventName": "MT_DIAG_CYCLES_ONE_THR_ACTIVE", 362 "EventName": "MT_DIAG_CYCLES_ONE_THR_ACTIVE",
311 "BriefDescription": "Cycle count with one thread active", 363 "BriefDescription": "Cycle count with one thread active",
312 "PublicDescription": "Cycle count with one thread active" 364 "PublicDescription": "Cycle count with one thread active"
313 }, 365 },
314 { 366 {
367 "Unit": "CPU-M-CF",
315 "EventCode": "449", 368 "EventCode": "449",
316 "EventName": "MT_DIAG_CYCLES_TWO_THR_ACTIVE", 369 "EventName": "MT_DIAG_CYCLES_TWO_THR_ACTIVE",
317 "BriefDescription": "Cycle count with two threads active", 370 "BriefDescription": "Cycle count with two threads active",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json b/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json
new file mode 100644
index 000000000000..1a0034f79f73
--- /dev/null
+++ b/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json
@@ -0,0 +1,7 @@
1[
2 {
3 "BriefDescription": "Transaction count",
4 "MetricName": "transaction",
5 "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
6 }
7]
diff --git a/tools/perf/pmu-events/arch/s390/cf_z196/basic.json b/tools/perf/pmu-events/arch/s390/cf_z196/basic.json
index 8bf16759ca53..2dd8dafff2ef 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z196/basic.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z196/basic.json
@@ -1,71 +1,83 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "0", 4 "EventCode": "0",
4 "EventName": "CPU_CYCLES", 5 "EventName": "CPU_CYCLES",
5 "BriefDescription": "CPU Cycles", 6 "BriefDescription": "CPU Cycles",
6 "PublicDescription": "Cycle Count" 7 "PublicDescription": "Cycle Count"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "1", 11 "EventCode": "1",
10 "EventName": "INSTRUCTIONS", 12 "EventName": "INSTRUCTIONS",
11 "BriefDescription": "Instructions", 13 "BriefDescription": "Instructions",
12 "PublicDescription": "Instruction Count" 14 "PublicDescription": "Instruction Count"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "2", 18 "EventCode": "2",
16 "EventName": "L1I_DIR_WRITES", 19 "EventName": "L1I_DIR_WRITES",
17 "BriefDescription": "L1I Directory Writes", 20 "BriefDescription": "L1I Directory Writes",
18 "PublicDescription": "Level-1 I-Cache Directory Write Count" 21 "PublicDescription": "Level-1 I-Cache Directory Write Count"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "3", 25 "EventCode": "3",
22 "EventName": "L1I_PENALTY_CYCLES", 26 "EventName": "L1I_PENALTY_CYCLES",
23 "BriefDescription": "L1I Penalty Cycles", 27 "BriefDescription": "L1I Penalty Cycles",
24 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count" 28 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "4", 32 "EventCode": "4",
28 "EventName": "L1D_DIR_WRITES", 33 "EventName": "L1D_DIR_WRITES",
29 "BriefDescription": "L1D Directory Writes", 34 "BriefDescription": "L1D Directory Writes",
30 "PublicDescription": "Level-1 D-Cache Directory Write Count" 35 "PublicDescription": "Level-1 D-Cache Directory Write Count"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "5", 39 "EventCode": "5",
34 "EventName": "L1D_PENALTY_CYCLES", 40 "EventName": "L1D_PENALTY_CYCLES",
35 "BriefDescription": "L1D Penalty Cycles", 41 "BriefDescription": "L1D Penalty Cycles",
36 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count" 42 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "32", 46 "EventCode": "32",
40 "EventName": "PROBLEM_STATE_CPU_CYCLES", 47 "EventName": "PROBLEM_STATE_CPU_CYCLES",
41 "BriefDescription": "Problem-State CPU Cycles", 48 "BriefDescription": "Problem-State CPU Cycles",
42 "PublicDescription": "Problem-State Cycle Count" 49 "PublicDescription": "Problem-State Cycle Count"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "33", 53 "EventCode": "33",
46 "EventName": "PROBLEM_STATE_INSTRUCTIONS", 54 "EventName": "PROBLEM_STATE_INSTRUCTIONS",
47 "BriefDescription": "Problem-State Instructions", 55 "BriefDescription": "Problem-State Instructions",
48 "PublicDescription": "Problem-State Instruction Count" 56 "PublicDescription": "Problem-State Instruction Count"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "34", 60 "EventCode": "34",
52 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES", 61 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES",
53 "BriefDescription": "Problem-State L1I Directory Writes", 62 "BriefDescription": "Problem-State L1I Directory Writes",
54 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count" 63 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "35", 67 "EventCode": "35",
58 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES", 68 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES",
59 "BriefDescription": "Problem-State L1I Penalty Cycles", 69 "BriefDescription": "Problem-State L1I Penalty Cycles",
60 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count" 70 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "36", 74 "EventCode": "36",
64 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES", 75 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES",
65 "BriefDescription": "Problem-State L1D Directory Writes", 76 "BriefDescription": "Problem-State L1D Directory Writes",
66 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count" 77 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "37", 81 "EventCode": "37",
70 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", 82 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES",
71 "BriefDescription": "Problem-State L1D Penalty Cycles", 83 "BriefDescription": "Problem-State L1D Penalty Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z196/crypto.json b/tools/perf/pmu-events/arch/s390/cf_z196/crypto.json
index 7e5b72492141..db286f19e7b6 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z196/crypto.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z196/crypto.json
@@ -1,95 +1,111 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "64", 4 "EventCode": "64",
4 "EventName": "PRNG_FUNCTIONS", 5 "EventName": "PRNG_FUNCTIONS",
5 "BriefDescription": "PRNG Functions", 6 "BriefDescription": "PRNG Functions",
6 "PublicDescription": "Total number of the PRNG functions issued by the CPU" 7 "PublicDescription": "Total number of the PRNG functions issued by the CPU"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "65", 11 "EventCode": "65",
10 "EventName": "PRNG_CYCLES", 12 "EventName": "PRNG_CYCLES",
11 "BriefDescription": "PRNG Cycles", 13 "BriefDescription": "PRNG Cycles",
12 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU" 14 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "66", 18 "EventCode": "66",
16 "EventName": "PRNG_BLOCKED_FUNCTIONS", 19 "EventName": "PRNG_BLOCKED_FUNCTIONS",
17 "BriefDescription": "PRNG Blocked Functions", 20 "BriefDescription": "PRNG Blocked Functions",
18 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 21 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "67", 25 "EventCode": "67",
22 "EventName": "PRNG_BLOCKED_CYCLES", 26 "EventName": "PRNG_BLOCKED_CYCLES",
23 "BriefDescription": "PRNG Blocked Cycles", 27 "BriefDescription": "PRNG Blocked Cycles",
24 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 28 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "68", 32 "EventCode": "68",
28 "EventName": "SHA_FUNCTIONS", 33 "EventName": "SHA_FUNCTIONS",
29 "BriefDescription": "SHA Functions", 34 "BriefDescription": "SHA Functions",
30 "PublicDescription": "Total number of SHA functions issued by the CPU" 35 "PublicDescription": "Total number of SHA functions issued by the CPU"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "69", 39 "EventCode": "69",
34 "EventName": "SHA_CYCLES", 40 "EventName": "SHA_CYCLES",
35 "BriefDescription": "SHA Cycles", 41 "BriefDescription": "SHA Cycles",
36 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU" 42 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "70", 46 "EventCode": "70",
40 "EventName": "SHA_BLOCKED_FUNCTIONS", 47 "EventName": "SHA_BLOCKED_FUNCTIONS",
41 "BriefDescription": "SHA Blocked Functions", 48 "BriefDescription": "SHA Blocked Functions",
42 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU" 49 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "71", 53 "EventCode": "71",
46 "EventName": "SHA_BLOCKED_CYCLES", 54 "EventName": "SHA_BLOCKED_CYCLES",
47 "BriefDescription": "SHA Bloced Cycles", 55 "BriefDescription": "SHA Bloced Cycles",
48 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU" 56 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "72", 60 "EventCode": "72",
52 "EventName": "DEA_FUNCTIONS", 61 "EventName": "DEA_FUNCTIONS",
53 "BriefDescription": "DEA Functions", 62 "BriefDescription": "DEA Functions",
54 "PublicDescription": "Total number of the DEA functions issued by the CPU" 63 "PublicDescription": "Total number of the DEA functions issued by the CPU"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "73", 67 "EventCode": "73",
58 "EventName": "DEA_CYCLES", 68 "EventName": "DEA_CYCLES",
59 "BriefDescription": "DEA Cycles", 69 "BriefDescription": "DEA Cycles",
60 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU" 70 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "74", 74 "EventCode": "74",
64 "EventName": "DEA_BLOCKED_FUNCTIONS", 75 "EventName": "DEA_BLOCKED_FUNCTIONS",
65 "BriefDescription": "DEA Blocked Functions", 76 "BriefDescription": "DEA Blocked Functions",
66 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 77 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "75", 81 "EventCode": "75",
70 "EventName": "DEA_BLOCKED_CYCLES", 82 "EventName": "DEA_BLOCKED_CYCLES",
71 "BriefDescription": "DEA Blocked Cycles", 83 "BriefDescription": "DEA Blocked Cycles",
72 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 84 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "76", 88 "EventCode": "76",
76 "EventName": "AES_FUNCTIONS", 89 "EventName": "AES_FUNCTIONS",
77 "BriefDescription": "AES Functions", 90 "BriefDescription": "AES Functions",
78 "PublicDescription": "Total number of AES functions issued by the CPU" 91 "PublicDescription": "Total number of AES functions issued by the CPU"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "77", 95 "EventCode": "77",
82 "EventName": "AES_CYCLES", 96 "EventName": "AES_CYCLES",
83 "BriefDescription": "AES Cycles", 97 "BriefDescription": "AES Cycles",
84 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU" 98 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "78", 102 "EventCode": "78",
88 "EventName": "AES_BLOCKED_FUNCTIONS", 103 "EventName": "AES_BLOCKED_FUNCTIONS",
89 "BriefDescription": "AES Blocked Functions", 104 "BriefDescription": "AES Blocked Functions",
90 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 105 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "79", 109 "EventCode": "79",
94 "EventName": "AES_BLOCKED_CYCLES", 110 "EventName": "AES_BLOCKED_CYCLES",
95 "BriefDescription": "AES Blocked Cycles", 111 "BriefDescription": "AES Blocked Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_z196/extended.json b/tools/perf/pmu-events/arch/s390/cf_z196/extended.json
index b6d7fec7c2e7..b7b42a870bb0 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z196/extended.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z196/extended.json
@@ -1,143 +1,167 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "128", 4 "EventCode": "128",
4 "EventName": "L1D_L2_SOURCED_WRITES", 5 "EventName": "L1D_L2_SOURCED_WRITES",
5 "BriefDescription": "L1D L2 Sourced Writes", 6 "BriefDescription": "L1D L2 Sourced Writes",
6 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from the Level-2 cache" 7 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from the Level-2 cache"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "129", 11 "EventCode": "129",
10 "EventName": "L1I_L2_SOURCED_WRITES", 12 "EventName": "L1I_L2_SOURCED_WRITES",
11 "BriefDescription": "L1I L2 Sourced Writes", 13 "BriefDescription": "L1I L2 Sourced Writes",
12 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from the Level-2 cache" 14 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from the Level-2 cache"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "130", 18 "EventCode": "130",
16 "EventName": "DTLB1_MISSES", 19 "EventName": "DTLB1_MISSES",
17 "BriefDescription": "DTLB1 Misses", 20 "BriefDescription": "DTLB1 Misses",
18 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle a DTLB1 miss is in progress." 21 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle a DTLB1 miss is in progress."
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "131", 25 "EventCode": "131",
22 "EventName": "ITLB1_MISSES", 26 "EventName": "ITLB1_MISSES",
23 "BriefDescription": "ITLB1 Misses", 27 "BriefDescription": "ITLB1 Misses",
24 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle a ITLB1 miss is in progress." 28 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle a ITLB1 miss is in progress."
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "133", 32 "EventCode": "133",
28 "EventName": "L2C_STORES_SENT", 33 "EventName": "L2C_STORES_SENT",
29 "BriefDescription": "L2C Stores Sent", 34 "BriefDescription": "L2C Stores Sent",
30 "PublicDescription": "Incremented by one for every store sent to Level-2 cache" 35 "PublicDescription": "Incremented by one for every store sent to Level-2 cache"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "134", 39 "EventCode": "134",
34 "EventName": "L1D_OFFBOOK_L3_SOURCED_WRITES", 40 "EventName": "L1D_OFFBOOK_L3_SOURCED_WRITES",
35 "BriefDescription": "L1D Off-Book L3 Sourced Writes", 41 "BriefDescription": "L1D Off-Book L3 Sourced Writes",
36 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an Off Book Level-3 cache" 42 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an Off Book Level-3 cache"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "135", 46 "EventCode": "135",
40 "EventName": "L1D_ONBOOK_L4_SOURCED_WRITES", 47 "EventName": "L1D_ONBOOK_L4_SOURCED_WRITES",
41 "BriefDescription": "L1D On-Book L4 Sourced Writes", 48 "BriefDescription": "L1D On-Book L4 Sourced Writes",
42 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an On Book Level-4 cache" 49 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an On Book Level-4 cache"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "136", 53 "EventCode": "136",
46 "EventName": "L1I_ONBOOK_L4_SOURCED_WRITES", 54 "EventName": "L1I_ONBOOK_L4_SOURCED_WRITES",
47 "BriefDescription": "L1I On-Book L4 Sourced Writes", 55 "BriefDescription": "L1I On-Book L4 Sourced Writes",
48 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an On Book Level-4 cache" 56 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an On Book Level-4 cache"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "137", 60 "EventCode": "137",
52 "EventName": "L1D_RO_EXCL_WRITES", 61 "EventName": "L1D_RO_EXCL_WRITES",
53 "BriefDescription": "L1D Read-only Exclusive Writes", 62 "BriefDescription": "L1D Read-only Exclusive Writes",
54 "PublicDescription": "A directory write to the Level-1 D-Cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line" 63 "PublicDescription": "A directory write to the Level-1 D-Cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "138", 67 "EventCode": "138",
58 "EventName": "L1D_OFFBOOK_L4_SOURCED_WRITES", 68 "EventName": "L1D_OFFBOOK_L4_SOURCED_WRITES",
59 "BriefDescription": "L1D Off-Book L4 Sourced Writes", 69 "BriefDescription": "L1D Off-Book L4 Sourced Writes",
60 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an Off Book Level-4 cache" 70 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an Off Book Level-4 cache"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "139", 74 "EventCode": "139",
64 "EventName": "L1I_OFFBOOK_L4_SOURCED_WRITES", 75 "EventName": "L1I_OFFBOOK_L4_SOURCED_WRITES",
65 "BriefDescription": "L1I Off-Book L4 Sourced Writes", 76 "BriefDescription": "L1I Off-Book L4 Sourced Writes",
66 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an Off Book Level-4 cache" 77 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an Off Book Level-4 cache"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "140", 81 "EventCode": "140",
70 "EventName": "DTLB1_HPAGE_WRITES", 82 "EventName": "DTLB1_HPAGE_WRITES",
71 "BriefDescription": "DTLB1 One-Megabyte Page Writes", 83 "BriefDescription": "DTLB1 One-Megabyte Page Writes",
72 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a one-megabyte page" 84 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a one-megabyte page"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "141", 88 "EventCode": "141",
76 "EventName": "L1D_LMEM_SOURCED_WRITES", 89 "EventName": "L1D_LMEM_SOURCED_WRITES",
77 "BriefDescription": "L1D Local Memory Sourced Writes", 90 "BriefDescription": "L1D Local Memory Sourced Writes",
78 "PublicDescription": "A directory write to the Level-1 D-Cache where the installed cache line was sourced from memory that is attached to the same book as the Data cache (Local Memory)" 91 "PublicDescription": "A directory write to the Level-1 D-Cache where the installed cache line was sourced from memory that is attached to the same book as the Data cache (Local Memory)"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "142", 95 "EventCode": "142",
82 "EventName": "L1I_LMEM_SOURCED_WRITES", 96 "EventName": "L1I_LMEM_SOURCED_WRITES",
83 "BriefDescription": "L1I Local Memory Sourced Writes", 97 "BriefDescription": "L1I Local Memory Sourced Writes",
84 "PublicDescription": "A directory write to the Level-1 I-Cache where the installed cache line was sourced from memory that is attached to the same book as the Instruction cache (Local Memory)" 98 "PublicDescription": "A directory write to the Level-1 I-Cache where the installed cache line was sourced from memory that is attached to the same book as the Instruction cache (Local Memory)"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "143", 102 "EventCode": "143",
88 "EventName": "L1I_OFFBOOK_L3_SOURCED_WRITES", 103 "EventName": "L1I_OFFBOOK_L3_SOURCED_WRITES",
89 "BriefDescription": "L1I Off-Book L3 Sourced Writes", 104 "BriefDescription": "L1I Off-Book L3 Sourced Writes",
90 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an Off Book Level-3 cache" 105 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an Off Book Level-3 cache"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "144", 109 "EventCode": "144",
94 "EventName": "DTLB1_WRITES", 110 "EventName": "DTLB1_WRITES",
95 "BriefDescription": "DTLB1 Writes", 111 "BriefDescription": "DTLB1 Writes",
96 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer" 112 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer"
97 }, 113 },
98 { 114 {
115 "Unit": "CPU-M-CF",
99 "EventCode": "145", 116 "EventCode": "145",
100 "EventName": "ITLB1_WRITES", 117 "EventName": "ITLB1_WRITES",
101 "BriefDescription": "ITLB1 Writes", 118 "BriefDescription": "ITLB1 Writes",
102 "PublicDescription": "A translation entry has been written to the Level-1 Instruction Translation Lookaside Buffer" 119 "PublicDescription": "A translation entry has been written to the Level-1 Instruction Translation Lookaside Buffer"
103 }, 120 },
104 { 121 {
122 "Unit": "CPU-M-CF",
105 "EventCode": "146", 123 "EventCode": "146",
106 "EventName": "TLB2_PTE_WRITES", 124 "EventName": "TLB2_PTE_WRITES",
107 "BriefDescription": "TLB2 PTE Writes", 125 "BriefDescription": "TLB2 PTE Writes",
108 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays" 126 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays"
109 }, 127 },
110 { 128 {
129 "Unit": "CPU-M-CF",
111 "EventCode": "147", 130 "EventCode": "147",
112 "EventName": "TLB2_CRSTE_HPAGE_WRITES", 131 "EventName": "TLB2_CRSTE_HPAGE_WRITES",
113 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes", 132 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes",
114 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays for a one-megabyte large page translation" 133 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays for a one-megabyte large page translation"
115 }, 134 },
116 { 135 {
136 "Unit": "CPU-M-CF",
117 "EventCode": "148", 137 "EventCode": "148",
118 "EventName": "TLB2_CRSTE_WRITES", 138 "EventName": "TLB2_CRSTE_WRITES",
119 "BriefDescription": "TLB2 CRSTE Writes", 139 "BriefDescription": "TLB2 CRSTE Writes",
120 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays" 140 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays"
121 }, 141 },
122 { 142 {
143 "Unit": "CPU-M-CF",
123 "EventCode": "150", 144 "EventCode": "150",
124 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES", 145 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES",
125 "BriefDescription": "L1D On-Chip L3 Sourced Writes", 146 "BriefDescription": "L1D On-Chip L3 Sourced Writes",
126 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an On Chip Level-3 cache" 147 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an On Chip Level-3 cache"
127 }, 148 },
128 { 149 {
150 "Unit": "CPU-M-CF",
129 "EventCode": "152", 151 "EventCode": "152",
130 "EventName": "L1D_OFFCHIP_L3_SOURCED_WRITES", 152 "EventName": "L1D_OFFCHIP_L3_SOURCED_WRITES",
131 "BriefDescription": "L1D Off-Chip L3 Sourced Writes", 153 "BriefDescription": "L1D Off-Chip L3 Sourced Writes",
132 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache" 154 "PublicDescription": "A directory write to the Level-1 D-Cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache"
133 }, 155 },
134 { 156 {
157 "Unit": "CPU-M-CF",
135 "EventCode": "153", 158 "EventCode": "153",
136 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES", 159 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES",
137 "BriefDescription": "L1I On-Chip L3 Sourced Writes", 160 "BriefDescription": "L1I On-Chip L3 Sourced Writes",
138 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an On Chip Level-3 cache" 161 "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an On Chip Level-3 cache"
139 }, 162 },
140 { 163 {
164 "Unit": "CPU-M-CF",
141 "EventCode": "155", 165 "EventCode": "155",
142 "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES", 166 "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES",
143 "BriefDescription": "L1I Off-Chip L3 Sourced Writes", 167 "BriefDescription": "L1I Off-Chip L3 Sourced Writes",
diff --git a/tools/perf/pmu-events/arch/s390/cf_zec12/basic.json b/tools/perf/pmu-events/arch/s390/cf_zec12/basic.json
index 8bf16759ca53..2dd8dafff2ef 100644
--- a/tools/perf/pmu-events/arch/s390/cf_zec12/basic.json
+++ b/tools/perf/pmu-events/arch/s390/cf_zec12/basic.json
@@ -1,71 +1,83 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "0", 4 "EventCode": "0",
4 "EventName": "CPU_CYCLES", 5 "EventName": "CPU_CYCLES",
5 "BriefDescription": "CPU Cycles", 6 "BriefDescription": "CPU Cycles",
6 "PublicDescription": "Cycle Count" 7 "PublicDescription": "Cycle Count"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "1", 11 "EventCode": "1",
10 "EventName": "INSTRUCTIONS", 12 "EventName": "INSTRUCTIONS",
11 "BriefDescription": "Instructions", 13 "BriefDescription": "Instructions",
12 "PublicDescription": "Instruction Count" 14 "PublicDescription": "Instruction Count"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "2", 18 "EventCode": "2",
16 "EventName": "L1I_DIR_WRITES", 19 "EventName": "L1I_DIR_WRITES",
17 "BriefDescription": "L1I Directory Writes", 20 "BriefDescription": "L1I Directory Writes",
18 "PublicDescription": "Level-1 I-Cache Directory Write Count" 21 "PublicDescription": "Level-1 I-Cache Directory Write Count"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "3", 25 "EventCode": "3",
22 "EventName": "L1I_PENALTY_CYCLES", 26 "EventName": "L1I_PENALTY_CYCLES",
23 "BriefDescription": "L1I Penalty Cycles", 27 "BriefDescription": "L1I Penalty Cycles",
24 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count" 28 "PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "4", 32 "EventCode": "4",
28 "EventName": "L1D_DIR_WRITES", 33 "EventName": "L1D_DIR_WRITES",
29 "BriefDescription": "L1D Directory Writes", 34 "BriefDescription": "L1D Directory Writes",
30 "PublicDescription": "Level-1 D-Cache Directory Write Count" 35 "PublicDescription": "Level-1 D-Cache Directory Write Count"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "5", 39 "EventCode": "5",
34 "EventName": "L1D_PENALTY_CYCLES", 40 "EventName": "L1D_PENALTY_CYCLES",
35 "BriefDescription": "L1D Penalty Cycles", 41 "BriefDescription": "L1D Penalty Cycles",
36 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count" 42 "PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "32", 46 "EventCode": "32",
40 "EventName": "PROBLEM_STATE_CPU_CYCLES", 47 "EventName": "PROBLEM_STATE_CPU_CYCLES",
41 "BriefDescription": "Problem-State CPU Cycles", 48 "BriefDescription": "Problem-State CPU Cycles",
42 "PublicDescription": "Problem-State Cycle Count" 49 "PublicDescription": "Problem-State Cycle Count"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "33", 53 "EventCode": "33",
46 "EventName": "PROBLEM_STATE_INSTRUCTIONS", 54 "EventName": "PROBLEM_STATE_INSTRUCTIONS",
47 "BriefDescription": "Problem-State Instructions", 55 "BriefDescription": "Problem-State Instructions",
48 "PublicDescription": "Problem-State Instruction Count" 56 "PublicDescription": "Problem-State Instruction Count"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "34", 60 "EventCode": "34",
52 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES", 61 "EventName": "PROBLEM_STATE_L1I_DIR_WRITES",
53 "BriefDescription": "Problem-State L1I Directory Writes", 62 "BriefDescription": "Problem-State L1I Directory Writes",
54 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count" 63 "PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "35", 67 "EventCode": "35",
58 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES", 68 "EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES",
59 "BriefDescription": "Problem-State L1I Penalty Cycles", 69 "BriefDescription": "Problem-State L1I Penalty Cycles",
60 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count" 70 "PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "36", 74 "EventCode": "36",
64 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES", 75 "EventName": "PROBLEM_STATE_L1D_DIR_WRITES",
65 "BriefDescription": "Problem-State L1D Directory Writes", 76 "BriefDescription": "Problem-State L1D Directory Writes",
66 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count" 77 "PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "37", 81 "EventCode": "37",
70 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", 82 "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES",
71 "BriefDescription": "Problem-State L1D Penalty Cycles", 83 "BriefDescription": "Problem-State L1D Penalty Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_zec12/crypto.json b/tools/perf/pmu-events/arch/s390/cf_zec12/crypto.json
index 7e5b72492141..db286f19e7b6 100644
--- a/tools/perf/pmu-events/arch/s390/cf_zec12/crypto.json
+++ b/tools/perf/pmu-events/arch/s390/cf_zec12/crypto.json
@@ -1,95 +1,111 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "64", 4 "EventCode": "64",
4 "EventName": "PRNG_FUNCTIONS", 5 "EventName": "PRNG_FUNCTIONS",
5 "BriefDescription": "PRNG Functions", 6 "BriefDescription": "PRNG Functions",
6 "PublicDescription": "Total number of the PRNG functions issued by the CPU" 7 "PublicDescription": "Total number of the PRNG functions issued by the CPU"
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "65", 11 "EventCode": "65",
10 "EventName": "PRNG_CYCLES", 12 "EventName": "PRNG_CYCLES",
11 "BriefDescription": "PRNG Cycles", 13 "BriefDescription": "PRNG Cycles",
12 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU" 14 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "66", 18 "EventCode": "66",
16 "EventName": "PRNG_BLOCKED_FUNCTIONS", 19 "EventName": "PRNG_BLOCKED_FUNCTIONS",
17 "BriefDescription": "PRNG Blocked Functions", 20 "BriefDescription": "PRNG Blocked Functions",
18 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 21 "PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "67", 25 "EventCode": "67",
22 "EventName": "PRNG_BLOCKED_CYCLES", 26 "EventName": "PRNG_BLOCKED_CYCLES",
23 "BriefDescription": "PRNG Blocked Cycles", 27 "BriefDescription": "PRNG Blocked Cycles",
24 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 28 "PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "68", 32 "EventCode": "68",
28 "EventName": "SHA_FUNCTIONS", 33 "EventName": "SHA_FUNCTIONS",
29 "BriefDescription": "SHA Functions", 34 "BriefDescription": "SHA Functions",
30 "PublicDescription": "Total number of SHA functions issued by the CPU" 35 "PublicDescription": "Total number of SHA functions issued by the CPU"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "69", 39 "EventCode": "69",
34 "EventName": "SHA_CYCLES", 40 "EventName": "SHA_CYCLES",
35 "BriefDescription": "SHA Cycles", 41 "BriefDescription": "SHA Cycles",
36 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU" 42 "PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "70", 46 "EventCode": "70",
40 "EventName": "SHA_BLOCKED_FUNCTIONS", 47 "EventName": "SHA_BLOCKED_FUNCTIONS",
41 "BriefDescription": "SHA Blocked Functions", 48 "BriefDescription": "SHA Blocked Functions",
42 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU" 49 "PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "71", 53 "EventCode": "71",
46 "EventName": "SHA_BLOCKED_CYCLES", 54 "EventName": "SHA_BLOCKED_CYCLES",
47 "BriefDescription": "SHA Bloced Cycles", 55 "BriefDescription": "SHA Bloced Cycles",
48 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU" 56 "PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "72", 60 "EventCode": "72",
52 "EventName": "DEA_FUNCTIONS", 61 "EventName": "DEA_FUNCTIONS",
53 "BriefDescription": "DEA Functions", 62 "BriefDescription": "DEA Functions",
54 "PublicDescription": "Total number of the DEA functions issued by the CPU" 63 "PublicDescription": "Total number of the DEA functions issued by the CPU"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "73", 67 "EventCode": "73",
58 "EventName": "DEA_CYCLES", 68 "EventName": "DEA_CYCLES",
59 "BriefDescription": "DEA Cycles", 69 "BriefDescription": "DEA Cycles",
60 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU" 70 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "74", 74 "EventCode": "74",
64 "EventName": "DEA_BLOCKED_FUNCTIONS", 75 "EventName": "DEA_BLOCKED_FUNCTIONS",
65 "BriefDescription": "DEA Blocked Functions", 76 "BriefDescription": "DEA Blocked Functions",
66 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 77 "PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "75", 81 "EventCode": "75",
70 "EventName": "DEA_BLOCKED_CYCLES", 82 "EventName": "DEA_BLOCKED_CYCLES",
71 "BriefDescription": "DEA Blocked Cycles", 83 "BriefDescription": "DEA Blocked Cycles",
72 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" 84 "PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "76", 88 "EventCode": "76",
76 "EventName": "AES_FUNCTIONS", 89 "EventName": "AES_FUNCTIONS",
77 "BriefDescription": "AES Functions", 90 "BriefDescription": "AES Functions",
78 "PublicDescription": "Total number of AES functions issued by the CPU" 91 "PublicDescription": "Total number of AES functions issued by the CPU"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "77", 95 "EventCode": "77",
82 "EventName": "AES_CYCLES", 96 "EventName": "AES_CYCLES",
83 "BriefDescription": "AES Cycles", 97 "BriefDescription": "AES Cycles",
84 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU" 98 "PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "78", 102 "EventCode": "78",
88 "EventName": "AES_BLOCKED_FUNCTIONS", 103 "EventName": "AES_BLOCKED_FUNCTIONS",
89 "BriefDescription": "AES Blocked Functions", 104 "BriefDescription": "AES Blocked Functions",
90 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU" 105 "PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "79", 109 "EventCode": "79",
94 "EventName": "AES_BLOCKED_CYCLES", 110 "EventName": "AES_BLOCKED_CYCLES",
95 "BriefDescription": "AES Blocked Cycles", 111 "BriefDescription": "AES Blocked Cycles",
diff --git a/tools/perf/pmu-events/arch/s390/cf_zec12/extended.json b/tools/perf/pmu-events/arch/s390/cf_zec12/extended.json
index 8682126aabb2..162251037219 100644
--- a/tools/perf/pmu-events/arch/s390/cf_zec12/extended.json
+++ b/tools/perf/pmu-events/arch/s390/cf_zec12/extended.json
@@ -1,209 +1,244 @@
1[ 1[
2 { 2 {
3 "Unit": "CPU-M-CF",
3 "EventCode": "128", 4 "EventCode": "128",
4 "EventName": "DTLB1_MISSES", 5 "EventName": "DTLB1_MISSES",
5 "BriefDescription": "DTLB1 Misses", 6 "BriefDescription": "DTLB1 Misses",
6 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle a DTLB1 miss is in progress." 7 "PublicDescription": "Level-1 Data TLB miss in progress. Incremented by one for every cycle a DTLB1 miss is in progress."
7 }, 8 },
8 { 9 {
10 "Unit": "CPU-M-CF",
9 "EventCode": "129", 11 "EventCode": "129",
10 "EventName": "ITLB1_MISSES", 12 "EventName": "ITLB1_MISSES",
11 "BriefDescription": "ITLB1 Misses", 13 "BriefDescription": "ITLB1 Misses",
12 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle a ITLB1 miss is in progress." 14 "PublicDescription": "Level-1 Instruction TLB miss in progress. Incremented by one for every cycle a ITLB1 miss is in progress."
13 }, 15 },
14 { 16 {
17 "Unit": "CPU-M-CF",
15 "EventCode": "130", 18 "EventCode": "130",
16 "EventName": "L1D_L2I_SOURCED_WRITES", 19 "EventName": "L1D_L2I_SOURCED_WRITES",
17 "BriefDescription": "L1D L2I Sourced Writes", 20 "BriefDescription": "L1D L2I Sourced Writes",
18 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Instruction cache" 21 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Instruction cache"
19 }, 22 },
20 { 23 {
24 "Unit": "CPU-M-CF",
21 "EventCode": "131", 25 "EventCode": "131",
22 "EventName": "L1I_L2I_SOURCED_WRITES", 26 "EventName": "L1I_L2I_SOURCED_WRITES",
23 "BriefDescription": "L1I L2I Sourced Writes", 27 "BriefDescription": "L1I L2I Sourced Writes",
24 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from the Level-2 Instruction cache" 28 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from the Level-2 Instruction cache"
25 }, 29 },
26 { 30 {
31 "Unit": "CPU-M-CF",
27 "EventCode": "132", 32 "EventCode": "132",
28 "EventName": "L1D_L2D_SOURCED_WRITES", 33 "EventName": "L1D_L2D_SOURCED_WRITES",
29 "BriefDescription": "L1D L2D Sourced Writes", 34 "BriefDescription": "L1D L2D Sourced Writes",
30 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Data cache" 35 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from the Level-2 Data cache"
31 }, 36 },
32 { 37 {
38 "Unit": "CPU-M-CF",
33 "EventCode": "133", 39 "EventCode": "133",
34 "EventName": "DTLB1_WRITES", 40 "EventName": "DTLB1_WRITES",
35 "BriefDescription": "DTLB1 Writes", 41 "BriefDescription": "DTLB1 Writes",
36 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer" 42 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer"
37 }, 43 },
38 { 44 {
45 "Unit": "CPU-M-CF",
39 "EventCode": "135", 46 "EventCode": "135",
40 "EventName": "L1D_LMEM_SOURCED_WRITES", 47 "EventName": "L1D_LMEM_SOURCED_WRITES",
41 "BriefDescription": "L1D Local Memory Sourced Writes", 48 "BriefDescription": "L1D Local Memory Sourced Writes",
42 "PublicDescription": "A directory write to the Level-1 Data cache where the installed cache line was sourced from memory that is attached to the same book as the Data cache (Local Memory)" 49 "PublicDescription": "A directory write to the Level-1 Data cache where the installed cache line was sourced from memory that is attached to the same book as the Data cache (Local Memory)"
43 }, 50 },
44 { 51 {
52 "Unit": "CPU-M-CF",
45 "EventCode": "137", 53 "EventCode": "137",
46 "EventName": "L1I_LMEM_SOURCED_WRITES", 54 "EventName": "L1I_LMEM_SOURCED_WRITES",
47 "BriefDescription": "L1I Local Memory Sourced Writes", 55 "BriefDescription": "L1I Local Memory Sourced Writes",
48 "PublicDescription": "A directory write to the Level-1 Instruction cache where the installed cache line was sourced from memory that is attached to the same book as the Instruction cache (Local Memory)" 56 "PublicDescription": "A directory write to the Level-1 Instruction cache where the installed cache line was sourced from memory that is attached to the same book as the Instruction cache (Local Memory)"
49 }, 57 },
50 { 58 {
59 "Unit": "CPU-M-CF",
51 "EventCode": "138", 60 "EventCode": "138",
52 "EventName": "L1D_RO_EXCL_WRITES", 61 "EventName": "L1D_RO_EXCL_WRITES",
53 "BriefDescription": "L1D Read-only Exclusive Writes", 62 "BriefDescription": "L1D Read-only Exclusive Writes",
54 "PublicDescription": "A directory write to the Level-1 D-Cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line" 63 "PublicDescription": "A directory write to the Level-1 D-Cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line"
55 }, 64 },
56 { 65 {
66 "Unit": "CPU-M-CF",
57 "EventCode": "139", 67 "EventCode": "139",
58 "EventName": "DTLB1_HPAGE_WRITES", 68 "EventName": "DTLB1_HPAGE_WRITES",
59 "BriefDescription": "DTLB1 One-Megabyte Page Writes", 69 "BriefDescription": "DTLB1 One-Megabyte Page Writes",
60 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a one-megabyte page" 70 "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a one-megabyte page"
61 }, 71 },
62 { 72 {
73 "Unit": "CPU-M-CF",
63 "EventCode": "140", 74 "EventCode": "140",
64 "EventName": "ITLB1_WRITES", 75 "EventName": "ITLB1_WRITES",
65 "BriefDescription": "ITLB1 Writes", 76 "BriefDescription": "ITLB1 Writes",
66 "PublicDescription": "A translation entry has been written to the Level-1 Instruction Translation Lookaside Buffer" 77 "PublicDescription": "A translation entry has been written to the Level-1 Instruction Translation Lookaside Buffer"
67 }, 78 },
68 { 79 {
80 "Unit": "CPU-M-CF",
69 "EventCode": "141", 81 "EventCode": "141",
70 "EventName": "TLB2_PTE_WRITES", 82 "EventName": "TLB2_PTE_WRITES",
71 "BriefDescription": "TLB2 PTE Writes", 83 "BriefDescription": "TLB2 PTE Writes",
72 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays" 84 "PublicDescription": "A translation entry has been written to the Level-2 TLB Page Table Entry arrays"
73 }, 85 },
74 { 86 {
87 "Unit": "CPU-M-CF",
75 "EventCode": "142", 88 "EventCode": "142",
76 "EventName": "TLB2_CRSTE_HPAGE_WRITES", 89 "EventName": "TLB2_CRSTE_HPAGE_WRITES",
77 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes", 90 "BriefDescription": "TLB2 CRSTE One-Megabyte Page Writes",
78 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays for a one-megabyte large page translation" 91 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays for a one-megabyte large page translation"
79 }, 92 },
80 { 93 {
94 "Unit": "CPU-M-CF",
81 "EventCode": "143", 95 "EventCode": "143",
82 "EventName": "TLB2_CRSTE_WRITES", 96 "EventName": "TLB2_CRSTE_WRITES",
83 "BriefDescription": "TLB2 CRSTE Writes", 97 "BriefDescription": "TLB2 CRSTE Writes",
84 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays" 98 "PublicDescription": "A translation entry has been written to the Level-2 TLB Common Region Segment Table Entry arrays"
85 }, 99 },
86 { 100 {
101 "Unit": "CPU-M-CF",
87 "EventCode": "144", 102 "EventCode": "144",
88 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES", 103 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES",
89 "BriefDescription": "L1D On-Chip L3 Sourced Writes", 104 "BriefDescription": "L1D On-Chip L3 Sourced Writes",
90 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On Chip Level-3 cache without intervention" 105 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On Chip Level-3 cache without intervention"
91 }, 106 },
92 { 107 {
108 "Unit": "CPU-M-CF",
93 "EventCode": "145", 109 "EventCode": "145",
94 "EventName": "L1D_OFFCHIP_L3_SOURCED_WRITES", 110 "EventName": "L1D_OFFCHIP_L3_SOURCED_WRITES",
95 "BriefDescription": "L1D Off-Chip L3 Sourced Writes", 111 "BriefDescription": "L1D Off-Chip L3 Sourced Writes",
96 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache without intervention" 112 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache without intervention"
97 }, 113 },
98 { 114 {
115 "Unit": "CPU-M-CF",
99 "EventCode": "146", 116 "EventCode": "146",
100 "EventName": "L1D_OFFBOOK_L3_SOURCED_WRITES", 117 "EventName": "L1D_OFFBOOK_L3_SOURCED_WRITES",
101 "BriefDescription": "L1D Off-Book L3 Sourced Writes", 118 "BriefDescription": "L1D Off-Book L3 Sourced Writes",
102 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Book Level-3 cache without intervention" 119 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Book Level-3 cache without intervention"
103 }, 120 },
104 { 121 {
122 "Unit": "CPU-M-CF",
105 "EventCode": "147", 123 "EventCode": "147",
106 "EventName": "L1D_ONBOOK_L4_SOURCED_WRITES", 124 "EventName": "L1D_ONBOOK_L4_SOURCED_WRITES",
107 "BriefDescription": "L1D On-Book L4 Sourced Writes", 125 "BriefDescription": "L1D On-Book L4 Sourced Writes",
108 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On Book Level-4 cache" 126 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an On Book Level-4 cache"
109 }, 127 },
110 { 128 {
129 "Unit": "CPU-M-CF",
111 "EventCode": "148", 130 "EventCode": "148",
112 "EventName": "L1D_OFFBOOK_L4_SOURCED_WRITES", 131 "EventName": "L1D_OFFBOOK_L4_SOURCED_WRITES",
113 "BriefDescription": "L1D Off-Book L4 Sourced Writes", 132 "BriefDescription": "L1D Off-Book L4 Sourced Writes",
114 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Book Level-4 cache" 133 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Book Level-4 cache"
115 }, 134 },
116 { 135 {
136 "Unit": "CPU-M-CF",
117 "EventCode": "149", 137 "EventCode": "149",
118 "EventName": "TX_NC_TEND", 138 "EventName": "TX_NC_TEND",
119 "BriefDescription": "Completed TEND instructions in non-constrained TX mode", 139 "BriefDescription": "Completed TEND instructions in non-constrained TX mode",
120 "PublicDescription": "A TEND instruction has completed in a nonconstrained transactional-execution mode" 140 "PublicDescription": "A TEND instruction has completed in a nonconstrained transactional-execution mode"
121 }, 141 },
122 { 142 {
143 "Unit": "CPU-M-CF",
123 "EventCode": "150", 144 "EventCode": "150",
124 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_IV", 145 "EventName": "L1D_ONCHIP_L3_SOURCED_WRITES_IV",
125 "BriefDescription": "L1D On-Chip L3 Sourced Writes with Intervention", 146 "BriefDescription": "L1D On-Chip L3 Sourced Writes with Intervention",
126 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from a On Chip Level-3 cache with intervention" 147 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from a On Chip Level-3 cache with intervention"
127 }, 148 },
128 { 149 {
150 "Unit": "CPU-M-CF",
129 "EventCode": "151", 151 "EventCode": "151",
130 "EventName": "L1D_OFFCHIP_L3_SOURCED_WRITES_IV", 152 "EventName": "L1D_OFFCHIP_L3_SOURCED_WRITES_IV",
131 "BriefDescription": "L1D Off-Chip L3 Sourced Writes with Intervention", 153 "BriefDescription": "L1D Off-Chip L3 Sourced Writes with Intervention",
132 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache with intervention" 154 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache with intervention"
133 }, 155 },
134 { 156 {
157 "Unit": "CPU-M-CF",
135 "EventCode": "152", 158 "EventCode": "152",
136 "EventName": "L1D_OFFBOOK_L3_SOURCED_WRITES_IV", 159 "EventName": "L1D_OFFBOOK_L3_SOURCED_WRITES_IV",
137 "BriefDescription": "L1D Off-Book L3 Sourced Writes with Intervention", 160 "BriefDescription": "L1D Off-Book L3 Sourced Writes with Intervention",
138 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Book Level-3 cache with intervention" 161 "PublicDescription": "A directory write to the Level-1 Data cache directory where the returned cache line was sourced from an Off Book Level-3 cache with intervention"
139 }, 162 },
140 { 163 {
164 "Unit": "CPU-M-CF",
141 "EventCode": "153", 165 "EventCode": "153",
142 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES", 166 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES",
143 "BriefDescription": "L1I On-Chip L3 Sourced Writes", 167 "BriefDescription": "L1I On-Chip L3 Sourced Writes",
144 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Chip Level-3 cache without intervention" 168 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Chip Level-3 cache without intervention"
145 }, 169 },
146 { 170 {
171 "Unit": "CPU-M-CF",
147 "EventCode": "154", 172 "EventCode": "154",
148 "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES", 173 "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES",
149 "BriefDescription": "L1I Off-Chip L3 Sourced Writes", 174 "BriefDescription": "L1I Off-Chip L3 Sourced Writes",
150 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache without intervention" 175 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache without intervention"
151 }, 176 },
152 { 177 {
178 "Unit": "CPU-M-CF",
153 "EventCode": "155", 179 "EventCode": "155",
154 "EventName": "L1I_OFFBOOK_L3_SOURCED_WRITES", 180 "EventName": "L1I_OFFBOOK_L3_SOURCED_WRITES",
155 "BriefDescription": "L1I Off-Book L3 Sourced Writes", 181 "BriefDescription": "L1I Off-Book L3 Sourced Writes",
156 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Book Level-3 cache without intervention" 182 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Book Level-3 cache without intervention"
157 }, 183 },
158 { 184 {
185 "Unit": "CPU-M-CF",
159 "EventCode": "156", 186 "EventCode": "156",
160 "EventName": "L1I_ONBOOK_L4_SOURCED_WRITES", 187 "EventName": "L1I_ONBOOK_L4_SOURCED_WRITES",
161 "BriefDescription": "L1I On-Book L4 Sourced Writes", 188 "BriefDescription": "L1I On-Book L4 Sourced Writes",
162 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Book Level-4 cache" 189 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Book Level-4 cache"
163 }, 190 },
164 { 191 {
192 "Unit": "CPU-M-CF",
165 "EventCode": "157", 193 "EventCode": "157",
166 "EventName": "L1I_OFFBOOK_L4_SOURCED_WRITES", 194 "EventName": "L1I_OFFBOOK_L4_SOURCED_WRITES",
167 "BriefDescription": "L1I Off-Book L4 Sourced Writes", 195 "BriefDescription": "L1I Off-Book L4 Sourced Writes",
168 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Book Level-4 cache" 196 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Book Level-4 cache"
169 }, 197 },
170 { 198 {
199 "Unit": "CPU-M-CF",
171 "EventCode": "158", 200 "EventCode": "158",
172 "EventName": "TX_C_TEND", 201 "EventName": "TX_C_TEND",
173 "BriefDescription": "Completed TEND instructions in constrained TX mode", 202 "BriefDescription": "Completed TEND instructions in constrained TX mode",
174 "PublicDescription": "A TEND instruction has completed in a constrained transactional-execution mode" 203 "PublicDescription": "A TEND instruction has completed in a constrained transactional-execution mode"
175 }, 204 },
176 { 205 {
206 "Unit": "CPU-M-CF",
177 "EventCode": "159", 207 "EventCode": "159",
178 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES_IV", 208 "EventName": "L1I_ONCHIP_L3_SOURCED_WRITES_IV",
179 "BriefDescription": "L1I On-Chip L3 Sourced Writes with Intervention", 209 "BriefDescription": "L1I On-Chip L3 Sourced Writes with Intervention",
180 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Chip Level-3 cache with intervention" 210 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an On Chip Level-3 cache with intervention"
181 }, 211 },
182 { 212 {
213 "Unit": "CPU-M-CF",
183 "EventCode": "160", 214 "EventCode": "160",
184 "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES_IV", 215 "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES_IV",
185 "BriefDescription": "L1I Off-Chip L3 Sourced Writes with Intervention", 216 "BriefDescription": "L1I Off-Chip L3 Sourced Writes with Intervention",
186 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache with intervention" 217 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache with intervention"
187 }, 218 },
188 { 219 {
220 "Unit": "CPU-M-CF",
189 "EventCode": "161", 221 "EventCode": "161",
190 "EventName": "L1I_OFFBOOK_L3_SOURCED_WRITES_IV", 222 "EventName": "L1I_OFFBOOK_L3_SOURCED_WRITES_IV",
191 "BriefDescription": "L1I Off-Book L3 Sourced Writes with Intervention", 223 "BriefDescription": "L1I Off-Book L3 Sourced Writes with Intervention",
192 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Book Level-3 cache with intervention" 224 "PublicDescription": "A directory write to the Level-1 Instruction cache directory where the returned cache line was sourced from an Off Book Level-3 cache with intervention"
193 }, 225 },
194 { 226 {
227 "Unit": "CPU-M-CF",
195 "EventCode": "177", 228 "EventCode": "177",
196 "EventName": "TX_NC_TABORT", 229 "EventName": "TX_NC_TABORT",
197 "BriefDescription": "Aborted transactions in non-constrained TX mode", 230 "BriefDescription": "Aborted transactions in non-constrained TX mode",
198 "PublicDescription": "A transaction abort has occurred in a nonconstrained transactional-execution mode" 231 "PublicDescription": "A transaction abort has occurred in a nonconstrained transactional-execution mode"
199 }, 232 },
200 { 233 {
234 "Unit": "CPU-M-CF",
201 "EventCode": "178", 235 "EventCode": "178",
202 "EventName": "TX_C_TABORT_NO_SPECIAL", 236 "EventName": "TX_C_TABORT_NO_SPECIAL",
203 "BriefDescription": "Aborted transactions in constrained TX mode not using special completion logic", 237 "BriefDescription": "Aborted transactions in constrained TX mode not using special completion logic",
204 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is not using any special logic to allow the transaction to complete" 238 "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is not using any special logic to allow the transaction to complete"
205 }, 239 },
206 { 240 {
241 "Unit": "CPU-M-CF",
207 "EventCode": "179", 242 "EventCode": "179",
208 "EventName": "TX_C_TABORT_SPECIAL", 243 "EventName": "TX_C_TABORT_SPECIAL",
209 "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic", 244 "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic",
diff --git a/tools/perf/pmu-events/arch/s390/cf_zec12/transaction.json b/tools/perf/pmu-events/arch/s390/cf_zec12/transaction.json
new file mode 100644
index 000000000000..1a0034f79f73
--- /dev/null
+++ b/tools/perf/pmu-events/arch/s390/cf_zec12/transaction.json
@@ -0,0 +1,7 @@
1[
2 {
3 "BriefDescription": "Transaction count",
4 "MetricName": "transaction",
5 "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
6 }
7]
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index db3a594ee1e4..68c92bb599ee 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -233,6 +233,8 @@ static struct map {
233 { "QPI LL", "uncore_qpi" }, 233 { "QPI LL", "uncore_qpi" },
234 { "SBO", "uncore_sbox" }, 234 { "SBO", "uncore_sbox" },
235 { "iMPH-U", "uncore_arb" }, 235 { "iMPH-U", "uncore_arb" },
236 { "CPU-M-CF", "cpum_cf" },
237 { "CPU-M-SF", "cpum_sf" },
236 {} 238 {}
237}; 239};
238 240
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
index 38dfb720fb6f..54ace2f6bc36 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
+++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
@@ -31,10 +31,8 @@ def flag_str(event_name, field_name, value):
31 string = "" 31 string = ""
32 32
33 if flag_fields[event_name][field_name]: 33 if flag_fields[event_name][field_name]:
34 print_delim = 0 34 print_delim = 0
35 keys = flag_fields[event_name][field_name]['values'].keys() 35 for idx in sorted(flag_fields[event_name][field_name]['values']):
36 keys.sort()
37 for idx in keys:
38 if not value and not idx: 36 if not value and not idx:
39 string += flag_fields[event_name][field_name]['values'][idx] 37 string += flag_fields[event_name][field_name]['values'][idx]
40 break 38 break
@@ -51,14 +49,12 @@ def symbol_str(event_name, field_name, value):
51 string = "" 49 string = ""
52 50
53 if symbolic_fields[event_name][field_name]: 51 if symbolic_fields[event_name][field_name]:
54 keys = symbolic_fields[event_name][field_name]['values'].keys() 52 for idx in sorted(symbolic_fields[event_name][field_name]['values']):
55 keys.sort()
56 for idx in keys:
57 if not value and not idx: 53 if not value and not idx:
58 string = symbolic_fields[event_name][field_name]['values'][idx] 54 string = symbolic_fields[event_name][field_name]['values'][idx]
59 break 55 break
60 if (value == idx): 56 if (value == idx):
61 string = symbolic_fields[event_name][field_name]['values'][idx] 57 string = symbolic_fields[event_name][field_name]['values'][idx]
62 break 58 break
63 59
64 return string 60 return string
@@ -74,19 +70,17 @@ def trace_flag_str(value):
74 string = "" 70 string = ""
75 print_delim = 0 71 print_delim = 0
76 72
77 keys = trace_flags.keys() 73 for idx in trace_flags:
78 74 if not value and not idx:
79 for idx in keys: 75 string += "NONE"
80 if not value and not idx: 76 break
81 string += "NONE" 77
82 break 78 if idx and (value & idx) == idx:
83 79 if print_delim:
84 if idx and (value & idx) == idx: 80 string += " | ";
85 if print_delim: 81 string += trace_flags[idx]
86 string += " | "; 82 print_delim = 1
87 string += trace_flags[idx] 83 value &= ~idx
88 print_delim = 1
89 value &= ~idx
90 84
91 return string 85 return string
92 86
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
index 81a56cd2b3c1..21a7a1298094 100755
--- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
+++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
@@ -8,6 +8,7 @@
8# PerfEvent is the base class for all perf event sample, PebsEvent 8# PerfEvent is the base class for all perf event sample, PebsEvent
9# is a HW base Intel x86 PEBS event, and user could add more SW/HW 9# is a HW base Intel x86 PEBS event, and user could add more SW/HW
10# event classes based on requirements. 10# event classes based on requirements.
11from __future__ import print_function
11 12
12import struct 13import struct
13 14
@@ -44,7 +45,8 @@ class PerfEvent(object):
44 PerfEvent.event_num += 1 45 PerfEvent.event_num += 1
45 46
46 def show(self): 47 def show(self):
47 print "PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" % (self.name, self.symbol, self.comm, self.dso) 48 print("PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" %
49 (self.name, self.symbol, self.comm, self.dso))
48 50
49# 51#
50# Basic Intel PEBS (Precise Event-based Sampling) event, whose raw buffer 52# Basic Intel PEBS (Precise Event-based Sampling) event, whose raw buffer
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
index fdd92f699055..cac7b2542ee8 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
+++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
@@ -11,7 +11,7 @@
11try: 11try:
12 import wx 12 import wx
13except ImportError: 13except ImportError:
14 raise ImportError, "You need to install the wxpython lib for this script" 14 raise ImportError("You need to install the wxpython lib for this script")
15 15
16 16
17class RootFrame(wx.Frame): 17class RootFrame(wx.Frame):
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
index f6c84966e4f8..7384dcb628c4 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
+++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
@@ -5,6 +5,7 @@
5# This software may be distributed under the terms of the GNU General 5# This software may be distributed under the terms of the GNU General
6# Public License ("GPL") version 2 as published by the Free Software 6# Public License ("GPL") version 2 as published by the Free Software
7# Foundation. 7# Foundation.
8from __future__ import print_function
8 9
9import errno, os 10import errno, os
10 11
@@ -33,7 +34,7 @@ def nsecs_str(nsecs):
33 return str 34 return str
34 35
35def add_stats(dict, key, value): 36def add_stats(dict, key, value):
36 if not dict.has_key(key): 37 if key not in dict:
37 dict[key] = (value, value, value, 1) 38 dict[key] = (value, value, value, 1)
38 else: 39 else:
39 min, max, avg, count = dict[key] 40 min, max, avg, count = dict[key]
@@ -72,10 +73,10 @@ try:
72except: 73except:
73 if not audit_package_warned: 74 if not audit_package_warned:
74 audit_package_warned = True 75 audit_package_warned = True
75 print "Install the audit-libs-python package to get syscall names.\n" \ 76 print("Install the audit-libs-python package to get syscall names.\n"
76 "For example:\n # apt-get install python-audit (Ubuntu)" \ 77 "For example:\n # apt-get install python-audit (Ubuntu)"
77 "\n # yum install audit-libs-python (Fedora)" \ 78 "\n # yum install audit-libs-python (Fedora)"
78 "\n etc.\n" 79 "\n etc.\n")
79 80
80def syscall_name(id): 81def syscall_name(id):
81 try: 82 try:
diff --git a/tools/perf/scripts/python/sched-migration.py b/tools/perf/scripts/python/sched-migration.py
index de66cb3b72c9..3473e7f66081 100644
--- a/tools/perf/scripts/python/sched-migration.py
+++ b/tools/perf/scripts/python/sched-migration.py
@@ -9,13 +9,17 @@
9# This software is distributed under the terms of the GNU General 9# This software is distributed under the terms of the GNU General
10# Public License ("GPL") version 2 as published by the Free Software 10# Public License ("GPL") version 2 as published by the Free Software
11# Foundation. 11# Foundation.
12 12from __future__ import print_function
13 13
14import os 14import os
15import sys 15import sys
16 16
17from collections import defaultdict 17from collections import defaultdict
18from UserList import UserList 18try:
19 from UserList import UserList
20except ImportError:
21 # Python 3: UserList moved to the collections package
22 from collections import UserList
19 23
20sys.path.append(os.environ['PERF_EXEC_PATH'] + \ 24sys.path.append(os.environ['PERF_EXEC_PATH'] + \
21 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') 25 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
@@ -300,7 +304,7 @@ class TimeSliceList(UserList):
300 if i == -1: 304 if i == -1:
301 return 305 return
302 306
303 for i in xrange(i, len(self.data)): 307 for i in range(i, len(self.data)):
304 timeslice = self.data[i] 308 timeslice = self.data[i]
305 if timeslice.start > end: 309 if timeslice.start > end:
306 return 310 return
@@ -336,8 +340,8 @@ class SchedEventProxy:
336 on_cpu_task = self.current_tsk[headers.cpu] 340 on_cpu_task = self.current_tsk[headers.cpu]
337 341
338 if on_cpu_task != -1 and on_cpu_task != prev_pid: 342 if on_cpu_task != -1 and on_cpu_task != prev_pid:
339 print "Sched switch event rejected ts: %s cpu: %d prev: %s(%d) next: %s(%d)" % \ 343 print("Sched switch event rejected ts: %s cpu: %d prev: %s(%d) next: %s(%d)" % \
340 (headers.ts_format(), headers.cpu, prev_comm, prev_pid, next_comm, next_pid) 344 headers.ts_format(), headers.cpu, prev_comm, prev_pid, next_comm, next_pid)
341 345
342 threads[prev_pid] = prev_comm 346 threads[prev_pid] = prev_comm
343 threads[next_pid] = next_comm 347 threads[next_pid] = next_comm
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 2bde505e2e7e..d7a5e1b9aa6f 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -385,7 +385,7 @@ static int test_and_print(struct test *t, bool force_skip, int subtest)
385 if (!t->subtest.get_nr) 385 if (!t->subtest.get_nr)
386 pr_debug("%s:", t->desc); 386 pr_debug("%s:", t->desc);
387 else 387 else
388 pr_debug("%s subtest %d:", t->desc, subtest); 388 pr_debug("%s subtest %d:", t->desc, subtest + 1);
389 389
390 switch (err) { 390 switch (err) {
391 case TEST_OK: 391 case TEST_OK:
@@ -422,7 +422,7 @@ static const char *shell_test__description(char *description, size_t size,
422 422
423#define for_each_shell_test(dir, base, ent) \ 423#define for_each_shell_test(dir, base, ent) \
424 while ((ent = readdir(dir)) != NULL) \ 424 while ((ent = readdir(dir)) != NULL) \
425 if (!is_directory(base, ent)) 425 if (!is_directory(base, ent) && ent->d_name[0] != '.')
426 426
427static const char *shell_tests__dir(char *path, size_t size) 427static const char *shell_tests__dir(char *path, size_t size)
428{ 428{
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 7d4077068454..3b97ac018d5a 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1309,6 +1309,11 @@ static int test__checkevent_config_cache(struct perf_evlist *evlist)
1309 return 0; 1309 return 0;
1310} 1310}
1311 1311
1312static bool test__intel_pt_valid(void)
1313{
1314 return !!perf_pmu__find("intel_pt");
1315}
1316
1312static int test__intel_pt(struct perf_evlist *evlist) 1317static int test__intel_pt(struct perf_evlist *evlist)
1313{ 1318{
1314 struct perf_evsel *evsel = perf_evlist__first(evlist); 1319 struct perf_evsel *evsel = perf_evlist__first(evlist);
@@ -1317,6 +1322,14 @@ static int test__intel_pt(struct perf_evlist *evlist)
1317 return 0; 1322 return 0;
1318} 1323}
1319 1324
1325static int test__checkevent_complex_name(struct perf_evlist *evlist)
1326{
1327 struct perf_evsel *evsel = perf_evlist__first(evlist);
1328
1329 TEST_ASSERT_VAL("wrong complex name parsing", strcmp(evsel->name, "COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks") == 0);
1330 return 0;
1331}
1332
1320static int count_tracepoints(void) 1333static int count_tracepoints(void)
1321{ 1334{
1322 struct dirent *events_ent; 1335 struct dirent *events_ent;
@@ -1375,6 +1388,7 @@ struct evlist_test {
1375 const char *name; 1388 const char *name;
1376 __u32 type; 1389 __u32 type;
1377 const int id; 1390 const int id;
1391 bool (*valid)(void);
1378 int (*check)(struct perf_evlist *evlist); 1392 int (*check)(struct perf_evlist *evlist);
1379}; 1393};
1380 1394
@@ -1648,9 +1662,15 @@ static struct evlist_test test__events[] = {
1648 }, 1662 },
1649 { 1663 {
1650 .name = "intel_pt//u", 1664 .name = "intel_pt//u",
1665 .valid = test__intel_pt_valid,
1651 .check = test__intel_pt, 1666 .check = test__intel_pt,
1652 .id = 52, 1667 .id = 52,
1653 }, 1668 },
1669 {
1670 .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk",
1671 .check = test__checkevent_complex_name,
1672 .id = 53
1673 }
1654}; 1674};
1655 1675
1656static struct evlist_test test__events_pmu[] = { 1676static struct evlist_test test__events_pmu[] = {
@@ -1669,6 +1689,11 @@ static struct evlist_test test__events_pmu[] = {
1669 .check = test__checkevent_pmu_partial_time_callgraph, 1689 .check = test__checkevent_pmu_partial_time_callgraph,
1670 .id = 2, 1690 .id = 2,
1671 }, 1691 },
1692 {
1693 .name = "cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2/ukp",
1694 .check = test__checkevent_complex_name,
1695 .id = 3,
1696 }
1672}; 1697};
1673 1698
1674struct terms_test { 1699struct terms_test {
@@ -1686,17 +1711,24 @@ static struct terms_test test__terms[] = {
1686 1711
1687static int test_event(struct evlist_test *e) 1712static int test_event(struct evlist_test *e)
1688{ 1713{
1714 struct parse_events_error err = { .idx = 0, };
1689 struct perf_evlist *evlist; 1715 struct perf_evlist *evlist;
1690 int ret; 1716 int ret;
1691 1717
1718 if (e->valid && !e->valid()) {
1719 pr_debug("... SKIP");
1720 return 0;
1721 }
1722
1692 evlist = perf_evlist__new(); 1723 evlist = perf_evlist__new();
1693 if (evlist == NULL) 1724 if (evlist == NULL)
1694 return -ENOMEM; 1725 return -ENOMEM;
1695 1726
1696 ret = parse_events(evlist, e->name, NULL); 1727 ret = parse_events(evlist, e->name, &err);
1697 if (ret) { 1728 if (ret) {
1698 pr_debug("failed to parse event '%s', err %d\n", 1729 pr_debug("failed to parse event '%s', err %d, str '%s'\n",
1699 e->name, ret); 1730 e->name, ret, err.str);
1731 parse_events_print_error(&err, e->name);
1700 } else { 1732 } else {
1701 ret = e->check(evlist); 1733 ret = e->check(evlist);
1702 } 1734 }
@@ -1714,10 +1746,11 @@ static int test_events(struct evlist_test *events, unsigned cnt)
1714 for (i = 0; i < cnt; i++) { 1746 for (i = 0; i < cnt; i++) {
1715 struct evlist_test *e = &events[i]; 1747 struct evlist_test *e = &events[i];
1716 1748
1717 pr_debug("running test %d '%s'\n", e->id, e->name); 1749 pr_debug("running test %d '%s'", e->id, e->name);
1718 ret1 = test_event(e); 1750 ret1 = test_event(e);
1719 if (ret1) 1751 if (ret1)
1720 ret2 = ret1; 1752 ret2 = ret1;
1753 pr_debug("\n");
1721 } 1754 }
1722 1755
1723 return ret2; 1756 return ret2;
@@ -1799,7 +1832,7 @@ static int test_pmu_events(void)
1799 } 1832 }
1800 1833
1801 while (!ret && (ent = readdir(dir))) { 1834 while (!ret && (ent = readdir(dir))) {
1802 struct evlist_test e; 1835 struct evlist_test e = { .id = 0, };
1803 char name[2 * NAME_MAX + 1 + 12 + 3]; 1836 char name[2 * NAME_MAX + 1 + 12 + 3];
1804 1837
1805 /* Names containing . are special and cannot be used directly */ 1838 /* Names containing . are special and cannot be used directly */
diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index 263057039693..3013ac8f83d0 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -13,36 +13,60 @@
13libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g') 13libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g')
14nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254 14nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254
15 15
16event_pattern='probe_libc:inet_pton(\_[[:digit:]]+)?'
17
18add_libc_inet_pton_event() {
19
20 event_name=$(perf probe -f -x $libc -a inet_pton 2>&1 | tail -n +2 | head -n -5 | \
21 grep -P -o "$event_pattern(?=[[:space:]]\(on inet_pton in $libc\))")
22
23 if [ $? -ne 0 -o -z "$event_name" ] ; then
24 printf "FAIL: could not add event\n"
25 return 1
26 fi
27}
28
16trace_libc_inet_pton_backtrace() { 29trace_libc_inet_pton_backtrace() {
17 idx=0 30
18 expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)" 31 expected=`mktemp -u /tmp/expected.XXX`
19 expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" 32
33 echo "ping[][0-9 \.:]+$event_name: \([[:xdigit:]]+\)" > $expected
34 echo ".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
20 case "$(uname -m)" in 35 case "$(uname -m)" in
21 s390x) 36 s390x)
22 eventattr='call-graph=dwarf,max-stack=4' 37 eventattr='call-graph=dwarf,max-stack=4'
23 expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" 38 echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
24 expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" 39 echo "(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
25 expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" 40 echo "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
41 ;;
42 ppc64|ppc64le)
43 eventattr='max-stack=4'
44 echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
45 echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
46 echo ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
26 ;; 47 ;;
27 *) 48 *)
28 eventattr='max-stack=3' 49 eventattr='max-stack=3'
29 expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" 50 echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
30 expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" 51 echo ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
31 ;; 52 ;;
32 esac 53 esac
33 54
34 file=`mktemp -u /tmp/perf.data.XXX` 55 perf_data=`mktemp -u /tmp/perf.data.XXX`
56 perf_script=`mktemp -u /tmp/perf.script.XXX`
57 perf record -e $event_name/$eventattr/ -o $perf_data ping -6 -c 1 ::1 > /dev/null 2>&1
58 perf script -i $perf_data > $perf_script
35 59
36 perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1 60 exec 3<$perf_script
37 perf script -i $file | while read line ; do 61 exec 4<$expected
62 while read line <&3 && read -r pattern <&4; do
63 [ -z "$pattern" ] && break
38 echo $line 64 echo $line
39 echo "$line" | egrep -q "${expected[$idx]}" 65 echo "$line" | egrep -q "$pattern"
40 if [ $? -ne 0 ] ; then 66 if [ $? -ne 0 ] ; then
41 printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line" 67 printf "FAIL: expected backtrace entry \"%s\" got \"%s\"\n" "$pattern" "$line"
42 exit 1 68 return 1
43 fi 69 fi
44 let idx+=1
45 [ -z "${expected[$idx]}" ] && break
46 done 70 done
47 71
48 # If any statements are executed from this point onwards, 72 # If any statements are executed from this point onwards,
@@ -51,13 +75,20 @@ trace_libc_inet_pton_backtrace() {
51 # even if the perf script output does not match. 75 # even if the perf script output does not match.
52} 76}
53 77
78delete_libc_inet_pton_event() {
79
80 if [ -n "$event_name" ] ; then
81 perf probe -q -d $event_name
82 fi
83}
84
54# Check for IPv6 interface existence 85# Check for IPv6 interface existence
55ip a sh lo | fgrep -q inet6 || exit 2 86ip a sh lo | fgrep -q inet6 || exit 2
56 87
57skip_if_no_perf_probe && \ 88skip_if_no_perf_probe && \
58perf probe -q $libc inet_pton && \ 89add_libc_inet_pton_event && \
59trace_libc_inet_pton_backtrace 90trace_libc_inet_pton_backtrace
60err=$? 91err=$?
61rm -f ${file} 92rm -f ${perf_data} ${perf_script} ${expected}
62perf probe -q -d probe_libc:inet_pton 93delete_libc_inet_pton_event
63exit $err 94exit $err
diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
index 55ad9793d544..4ce276efe6b4 100755
--- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
@@ -17,7 +17,7 @@ skip_if_no_perf_probe || exit 2
17file=$(mktemp /tmp/temporary_file.XXXXX) 17file=$(mktemp /tmp/temporary_file.XXXXX)
18 18
19trace_open_vfs_getname() { 19trace_open_vfs_getname() {
20 evts=$(echo $(perf list syscalls:sys_enter_open* |& egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/') 20 evts=$(echo $(perf list syscalls:sys_enter_open* 2>&1 | egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')
21 perf trace -e $evts touch $file 2>&1 | \ 21 perf trace -e $evts touch $file 2>&1 | \
22 egrep " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ open(at)?\((dfd: +CWD, +)?filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$" 22 egrep " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ open(at)?\((dfd: +CWD, +)?filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$"
23} 23}
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
index 40e30a26b23c..9497d02f69e6 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -45,6 +45,7 @@ static int session_write_header(char *path)
45 45
46 perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); 46 perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY);
47 perf_header__set_feat(&session->header, HEADER_NRCPUS); 47 perf_header__set_feat(&session->header, HEADER_NRCPUS);
48 perf_header__set_feat(&session->header, HEADER_ARCH);
48 49
49 session->header.data_size += DATA_SIZE; 50 session->header.data_size += DATA_SIZE;
50 51
diff --git a/tools/perf/trace/beauty/Build b/tools/perf/trace/beauty/Build
index 66330d4b739b..f528ba35e140 100644
--- a/tools/perf/trace/beauty/Build
+++ b/tools/perf/trace/beauty/Build
@@ -7,4 +7,5 @@ endif
7libperf-y += kcmp.o 7libperf-y += kcmp.o
8libperf-y += pkey_alloc.o 8libperf-y += pkey_alloc.o
9libperf-y += prctl.o 9libperf-y += prctl.o
10libperf-y += socket.o
10libperf-y += statx.o 11libperf-y += statx.o
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h
index 984a504d335c..9615af5d412b 100644
--- a/tools/perf/trace/beauty/beauty.h
+++ b/tools/perf/trace/beauty/beauty.h
@@ -106,6 +106,9 @@ size_t syscall_arg__scnprintf_prctl_arg2(char *bf, size_t size, struct syscall_a
106size_t syscall_arg__scnprintf_prctl_arg3(char *bf, size_t size, struct syscall_arg *arg); 106size_t syscall_arg__scnprintf_prctl_arg3(char *bf, size_t size, struct syscall_arg *arg);
107#define SCA_PRCTL_ARG3 syscall_arg__scnprintf_prctl_arg3 107#define SCA_PRCTL_ARG3 syscall_arg__scnprintf_prctl_arg3
108 108
109size_t syscall_arg__scnprintf_socket_protocol(char *bf, size_t size, struct syscall_arg *arg);
110#define SCA_SK_PROTO syscall_arg__scnprintf_socket_protocol
111
109size_t syscall_arg__scnprintf_statx_flags(char *bf, size_t size, struct syscall_arg *arg); 112size_t syscall_arg__scnprintf_statx_flags(char *bf, size_t size, struct syscall_arg *arg);
110#define SCA_STATX_FLAGS syscall_arg__scnprintf_statx_flags 113#define SCA_STATX_FLAGS syscall_arg__scnprintf_statx_flags
111 114
diff --git a/tools/perf/trace/beauty/drm_ioctl.sh b/tools/perf/trace/beauty/drm_ioctl.sh
index 2149d3a98e42..9d3816815e60 100755
--- a/tools/perf/trace/beauty/drm_ioctl.sh
+++ b/tools/perf/trace/beauty/drm_ioctl.sh
@@ -1,13 +1,14 @@
1#!/bin/sh 1#!/bin/sh
2 2
3drm_header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/drm/
4
4printf "#ifndef DRM_COMMAND_BASE\n" 5printf "#ifndef DRM_COMMAND_BASE\n"
5grep "#define DRM_COMMAND_BASE" $drm_header_dir/drm.h 6grep "#define DRM_COMMAND_BASE" $header_dir/drm.h
6printf "#endif\n" 7printf "#endif\n"
7 8
8printf "static const char *drm_ioctl_cmds[] = {\n" 9printf "static const char *drm_ioctl_cmds[] = {\n"
9grep "^#define DRM_IOCTL.*DRM_IO" $drm_header_dir/drm.h | \ 10grep "^#define DRM_IOCTL.*DRM_IO" $header_dir/drm.h | \
10 sed -r 's/^#define +DRM_IOCTL_([A-Z0-9_]+)[ ]+DRM_IO[A-Z]* *\( *(0x[[:xdigit:]]+),*.*/ [\2] = "\1",/g' 11 sed -r 's/^#define +DRM_IOCTL_([A-Z0-9_]+)[ ]+DRM_IO[A-Z]* *\( *(0x[[:xdigit:]]+),*.*/ [\2] = "\1",/g'
11grep "^#define DRM_I915_[A-Z_0-9]\+[ ]\+0x" $drm_header_dir/i915_drm.h | \ 12grep "^#define DRM_I915_[A-Z_0-9]\+[ ]\+0x" $header_dir/i915_drm.h | \
12 sed -r 's/^#define +DRM_I915_([A-Z0-9_]+)[ ]+(0x[[:xdigit:]]+)/\t[DRM_COMMAND_BASE + \2] = "I915_\1",/g' 13 sed -r 's/^#define +DRM_I915_([A-Z0-9_]+)[ ]+(0x[[:xdigit:]]+)/\t[DRM_COMMAND_BASE + \2] = "I915_\1",/g'
13printf "};\n" 14printf "};\n"
diff --git a/tools/perf/trace/beauty/kcmp_type.sh b/tools/perf/trace/beauty/kcmp_type.sh
index 40d063b8c082..a3c304caa336 100755
--- a/tools/perf/trace/beauty/kcmp_type.sh
+++ b/tools/perf/trace/beauty/kcmp_type.sh
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
4 4
5printf "static const char *kcmp_types[] = {\n" 5printf "static const char *kcmp_types[] = {\n"
6regex='^[[:space:]]+(KCMP_(\w+)),' 6regex='^[[:space:]]+(KCMP_(\w+)),'
diff --git a/tools/perf/trace/beauty/kvm_ioctl.sh b/tools/perf/trace/beauty/kvm_ioctl.sh
index bd28817afced..c4699fd46bb6 100755
--- a/tools/perf/trace/beauty/kvm_ioctl.sh
+++ b/tools/perf/trace/beauty/kvm_ioctl.sh
@@ -1,10 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2 2
3kvm_header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
4 4
5printf "static const char *kvm_ioctl_cmds[] = {\n" 5printf "static const char *kvm_ioctl_cmds[] = {\n"
6regex='^#[[:space:]]*define[[:space:]]+KVM_(\w+)[[:space:]]+_IO[RW]*\([[:space:]]*KVMIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*' 6regex='^#[[:space:]]*define[[:space:]]+KVM_(\w+)[[:space:]]+_IO[RW]*\([[:space:]]*KVMIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*'
7egrep $regex ${kvm_header_dir}/kvm.h | \ 7egrep $regex ${header_dir}/kvm.h | \
8 sed -r "s/$regex/\2 \1/g" | \ 8 sed -r "s/$regex/\2 \1/g" | \
9 egrep -v " ((ARM|PPC|S390)_|[GS]ET_(DEBUGREGS|PIT2|XSAVE|TSC_KHZ)|CREATE_SPAPR_TCE_64)" | \ 9 egrep -v " ((ARM|PPC|S390)_|[GS]ET_(DEBUGREGS|PIT2|XSAVE|TSC_KHZ)|CREATE_SPAPR_TCE_64)" | \
10 sort | xargs printf "\t[%s] = \"%s\",\n" 10 sort | xargs printf "\t[%s] = \"%s\",\n"
diff --git a/tools/perf/trace/beauty/madvise_behavior.sh b/tools/perf/trace/beauty/madvise_behavior.sh
index 60ef8640ee70..431639eb4d29 100755
--- a/tools/perf/trace/beauty/madvise_behavior.sh
+++ b/tools/perf/trace/beauty/madvise_behavior.sh
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/asm-generic/
4 4
5printf "static const char *madvise_advices[] = {\n" 5printf "static const char *madvise_advices[] = {\n"
6regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MADV_([[:alnum:]_]+)[[:space:]]+([[:digit:]]+)[[:space:]]*.*' 6regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MADV_([[:alnum:]_]+)[[:space:]]+([[:digit:]]+)[[:space:]]*.*'
diff --git a/tools/perf/trace/beauty/perf_ioctl.sh b/tools/perf/trace/beauty/perf_ioctl.sh
index faea4237c793..6492c74df928 100755
--- a/tools/perf/trace/beauty/perf_ioctl.sh
+++ b/tools/perf/trace/beauty/perf_ioctl.sh
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
4 4
5printf "static const char *perf_ioctl_cmds[] = {\n" 5printf "static const char *perf_ioctl_cmds[] = {\n"
6regex='^#[[:space:]]*define[[:space:]]+PERF_EVENT_IOC_(\w+)[[:space:]]+_IO[RW]*[[:space:]]*\([[:space:]]*.\$.[[:space:]]*,[[:space:]]*([[:digit:]]+).*' 6regex='^#[[:space:]]*define[[:space:]]+PERF_EVENT_IOC_(\w+)[[:space:]]+_IO[RW]*[[:space:]]*\([[:space:]]*.\$.[[:space:]]*,[[:space:]]*([[:digit:]]+).*'
diff --git a/tools/perf/trace/beauty/pkey_alloc_access_rights.sh b/tools/perf/trace/beauty/pkey_alloc_access_rights.sh
index 62e51a02b839..e0a51aeb20b2 100755
--- a/tools/perf/trace/beauty/pkey_alloc_access_rights.sh
+++ b/tools/perf/trace/beauty/pkey_alloc_access_rights.sh
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/asm-generic/
4 4
5printf "static const char *pkey_alloc_access_rights[] = {\n" 5printf "static const char *pkey_alloc_access_rights[] = {\n"
6regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+PKEY_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*' 6regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+PKEY_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*'
diff --git a/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh b/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh
index aad5ab130539..eb511bb5fbd3 100755
--- a/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh
+++ b/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh
@@ -1,8 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2 2
3sound_header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/sound/
4 4
5printf "static const char *sndrv_ctl_ioctl_cmds[] = {\n" 5printf "static const char *sndrv_ctl_ioctl_cmds[] = {\n"
6grep "^#define[\t ]\+SNDRV_CTL_IOCTL_" $sound_header_dir/asound.h | \ 6grep "^#define[\t ]\+SNDRV_CTL_IOCTL_" $header_dir/asound.h | \
7 sed -r 's/^#define +SNDRV_CTL_IOCTL_([A-Z0-9_]+)[\t ]+_IO[RW]*\( *.U., *(0x[[:xdigit:]]+),?.*/\t[\2] = \"\1\",/g' 7 sed -r 's/^#define +SNDRV_CTL_IOCTL_([A-Z0-9_]+)[\t ]+_IO[RW]*\( *.U., *(0x[[:xdigit:]]+),?.*/\t[\2] = \"\1\",/g'
8printf "};\n" 8printf "};\n"
diff --git a/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh b/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh
index b7e9ef6b2f55..6818392968b2 100755
--- a/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh
+++ b/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh
@@ -1,8 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2 2
3sound_header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/sound/
4 4
5printf "static const char *sndrv_pcm_ioctl_cmds[] = {\n" 5printf "static const char *sndrv_pcm_ioctl_cmds[] = {\n"
6grep "^#define[\t ]\+SNDRV_PCM_IOCTL_" $sound_header_dir/asound.h | \ 6grep "^#define[\t ]\+SNDRV_PCM_IOCTL_" $header_dir/asound.h | \
7 sed -r 's/^#define +SNDRV_PCM_IOCTL_([A-Z0-9_]+)[\t ]+_IO[RW]*\( *.A., *(0x[[:xdigit:]]+),?.*/\t[\2] = \"\1\",/g' 7 sed -r 's/^#define +SNDRV_PCM_IOCTL_([A-Z0-9_]+)[\t ]+_IO[RW]*\( *.A., *(0x[[:xdigit:]]+),?.*/\t[\2] = \"\1\",/g'
8printf "};\n" 8printf "};\n"
diff --git a/tools/perf/trace/beauty/socket.c b/tools/perf/trace/beauty/socket.c
new file mode 100644
index 000000000000..65227269384b
--- /dev/null
+++ b/tools/perf/trace/beauty/socket.c
@@ -0,0 +1,28 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * trace/beauty/socket.c
4 *
5 * Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
6 */
7
8#include "trace/beauty/beauty.h"
9#include <sys/types.h>
10#include <sys/socket.h>
11
12static size_t socket__scnprintf_ipproto(int protocol, char *bf, size_t size)
13{
14#include "trace/beauty/generated/socket_ipproto_array.c"
15 static DEFINE_STRARRAY(socket_ipproto);
16
17 return strarray__scnprintf(&strarray__socket_ipproto, bf, size, "%d", protocol);
18}
19
20size_t syscall_arg__scnprintf_socket_protocol(char *bf, size_t size, struct syscall_arg *arg)
21{
22 int domain = syscall_arg__val(arg, 0);
23
24 if (domain == AF_INET || domain == AF_INET6)
25 return socket__scnprintf_ipproto(arg->val, bf, size);
26
27 return syscall_arg__scnprintf_int(bf, size, arg);
28}
diff --git a/tools/perf/trace/beauty/socket_ipproto.sh b/tools/perf/trace/beauty/socket_ipproto.sh
new file mode 100755
index 000000000000..a3cc24633bec
--- /dev/null
+++ b/tools/perf/trace/beauty/socket_ipproto.sh
@@ -0,0 +1,11 @@
1#!/bin/sh
2
3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
4
5printf "static const char *socket_ipproto[] = {\n"
6regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'
7
8egrep $regex ${header_dir}/in.h | \
9 sed -r "s/$regex/\2 \1/g" | \
10 sort | xargs printf "\t[%s] = \"%s\",\n"
11printf "};\n"
diff --git a/tools/perf/trace/beauty/vhost_virtio_ioctl.sh b/tools/perf/trace/beauty/vhost_virtio_ioctl.sh
index 76f1de697787..0f6a5197d0be 100755
--- a/tools/perf/trace/beauty/vhost_virtio_ioctl.sh
+++ b/tools/perf/trace/beauty/vhost_virtio_ioctl.sh
@@ -1,17 +1,17 @@
1#!/bin/sh 1#!/bin/sh
2 2
3vhost_virtio_header_dir=$1 3[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
4 4
5printf "static const char *vhost_virtio_ioctl_cmds[] = {\n" 5printf "static const char *vhost_virtio_ioctl_cmds[] = {\n"
6regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*' 6regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*'
7egrep $regex ${vhost_virtio_header_dir}/vhost.h | \ 7egrep $regex ${header_dir}/vhost.h | \
8 sed -r "s/$regex/\2 \1/g" | \ 8 sed -r "s/$regex/\2 \1/g" | \
9 sort | xargs printf "\t[%s] = \"%s\",\n" 9 sort | xargs printf "\t[%s] = \"%s\",\n"
10printf "};\n" 10printf "};\n"
11 11
12printf "static const char *vhost_virtio_ioctl_read_cmds[] = {\n" 12printf "static const char *vhost_virtio_ioctl_read_cmds[] = {\n"
13regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?R\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*' 13regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?R\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*'
14egrep $regex ${vhost_virtio_header_dir}/vhost.h | \ 14egrep $regex ${header_dir}/vhost.h | \
15 sed -r "s/$regex/\2 \1/g" | \ 15 sed -r "s/$regex/\2 \1/g" | \
16 sort | xargs printf "\t[%s] = \"%s\",\n" 16 sort | xargs printf "\t[%s] = \"%s\",\n"
17printf "};\n" 17printf "};\n"
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index b085f1b3e34d..4ab663ec3e5e 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -382,7 +382,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
382 gtk_tree_store_set(store, &iter, col_idx++, s, -1); 382 gtk_tree_store_set(store, &iter, col_idx++, s, -1);
383 } 383 }
384 384
385 if (hists__has_callchains(hists) && 385 if (hist_entry__has_callchains(h) &&
386 symbol_conf.use_callchain && hists__has(hists, sym)) { 386 symbol_conf.use_callchain && hists__has(hists, sym)) {
387 if (callchain_param.mode == CHAIN_GRAPH_REL) 387 if (callchain_param.mode == CHAIN_GRAPH_REL)
388 total = symbol_conf.cumulate_callchain ? 388 total = symbol_conf.cumulate_callchain ?
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 69b7a28f7a1c..74c4ae1f0a05 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -529,7 +529,7 @@ out:
529 529
530static int hist_entry__fprintf(struct hist_entry *he, size_t size, 530static int hist_entry__fprintf(struct hist_entry *he, size_t size,
531 char *bf, size_t bfsz, FILE *fp, 531 char *bf, size_t bfsz, FILE *fp,
532 bool use_callchain) 532 bool ignore_callchains)
533{ 533{
534 int ret; 534 int ret;
535 int callchain_ret = 0; 535 int callchain_ret = 0;
@@ -550,7 +550,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
550 550
551 ret = fprintf(fp, "%s\n", bf); 551 ret = fprintf(fp, "%s\n", bf);
552 552
553 if (hist_entry__has_callchains(he) && use_callchain) 553 if (hist_entry__has_callchains(he) && !ignore_callchains)
554 callchain_ret = hist_entry_callchain__fprintf(he, total_period, 554 callchain_ret = hist_entry_callchain__fprintf(he, total_period,
555 0, fp); 555 0, fp);
556 556
@@ -755,7 +755,7 @@ int hists__fprintf_headers(struct hists *hists, FILE *fp)
755 755
756size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, 756size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
757 int max_cols, float min_pcnt, FILE *fp, 757 int max_cols, float min_pcnt, FILE *fp,
758 bool use_callchain) 758 bool ignore_callchains)
759{ 759{
760 struct rb_node *nd; 760 struct rb_node *nd;
761 size_t ret = 0; 761 size_t ret = 0;
@@ -799,7 +799,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
799 if (percent < min_pcnt) 799 if (percent < min_pcnt)
800 continue; 800 continue;
801 801
802 ret += hist_entry__fprintf(h, max_cols, line, linesz, fp, use_callchain); 802 ret += hist_entry__fprintf(h, max_cols, line, linesz, fp, ignore_callchains);
803 803
804 if (max_rows && ++nr_rows >= max_rows) 804 if (max_rows && ++nr_rows >= max_rows)
805 break; 805 break;
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index cee658733e2c..3d02ae38ec56 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -747,7 +747,9 @@ int bpf__load(struct bpf_object *obj)
747 747
748 err = bpf_object__load(obj); 748 err = bpf_object__load(obj);
749 if (err) { 749 if (err) {
750 pr_debug("bpf: load objects failed\n"); 750 char bf[128];
751 libbpf_strerror(err, bf, sizeof(bf));
752 pr_debug("bpf: load objects failed: err=%d: (%s)\n", err, bf);
751 return err; 753 return err;
752 } 754 }
753 return 0; 755 return 0;
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index bf31ceab33bd..89512504551b 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -146,8 +146,15 @@ getBPFObjectFromModule(llvm::Module *Module)
146 raw_svector_ostream ostream(*Buffer); 146 raw_svector_ostream ostream(*Buffer);
147 147
148 legacy::PassManager PM; 148 legacy::PassManager PM;
149 if (TargetMachine->addPassesToEmitFile(PM, ostream, 149 bool NotAdded;
150 TargetMachine::CGFT_ObjectFile)) { 150#if CLANG_VERSION_MAJOR < 7
151 NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream,
152 TargetMachine::CGFT_ObjectFile);
153#else
154 NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, nullptr,
155 TargetMachine::CGFT_ObjectFile);
156#endif
157 if (NotAdded) {
151 llvm::errs() << "TargetMachine can't emit a file of this type\n"; 158 llvm::errs() << "TargetMachine can't emit a file of this type\n";
152 return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);; 159 return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);;
153 } 160 }
diff --git a/tools/perf/util/comm.c b/tools/perf/util/comm.c
index 7798a2cc8a86..31279a7bd919 100644
--- a/tools/perf/util/comm.c
+++ b/tools/perf/util/comm.c
@@ -20,9 +20,10 @@ static struct rw_semaphore comm_str_lock = {.lock = PTHREAD_RWLOCK_INITIALIZER,}
20 20
21static struct comm_str *comm_str__get(struct comm_str *cs) 21static struct comm_str *comm_str__get(struct comm_str *cs)
22{ 22{
23 if (cs) 23 if (cs && refcount_inc_not_zero(&cs->refcnt))
24 refcount_inc(&cs->refcnt); 24 return cs;
25 return cs; 25
26 return NULL;
26} 27}
27 28
28static void comm_str__put(struct comm_str *cs) 29static void comm_str__put(struct comm_str *cs)
@@ -67,9 +68,14 @@ struct comm_str *__comm_str__findnew(const char *str, struct rb_root *root)
67 parent = *p; 68 parent = *p;
68 iter = rb_entry(parent, struct comm_str, rb_node); 69 iter = rb_entry(parent, struct comm_str, rb_node);
69 70
71 /*
72 * If we race with comm_str__put, iter->refcnt is 0
73 * and it will be removed within comm_str__put call
74 * shortly, ignore it in this search.
75 */
70 cmp = strcmp(str, iter->str); 76 cmp = strcmp(str, iter->str);
71 if (!cmp) 77 if (!cmp && comm_str__get(iter))
72 return comm_str__get(iter); 78 return iter;
73 79
74 if (cmp < 0) 80 if (cmp < 0)
75 p = &(*p)->rb_left; 81 p = &(*p)->rb_left;
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index 4d5fc374e730..938def6d0bb9 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -31,6 +31,8 @@
31#endif 31#endif
32#endif 32#endif
33 33
34#define CS_ETM_INVAL_ADDR 0xdeadbeefdeadbeefUL
35
34struct cs_etm_decoder { 36struct cs_etm_decoder {
35 void *data; 37 void *data;
36 void (*packet_printer)(const char *msg); 38 void (*packet_printer)(const char *msg);
@@ -261,8 +263,8 @@ static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder)
261 decoder->tail = 0; 263 decoder->tail = 0;
262 decoder->packet_count = 0; 264 decoder->packet_count = 0;
263 for (i = 0; i < MAX_BUFFER; i++) { 265 for (i = 0; i < MAX_BUFFER; i++) {
264 decoder->packet_buffer[i].start_addr = 0xdeadbeefdeadbeefUL; 266 decoder->packet_buffer[i].start_addr = CS_ETM_INVAL_ADDR;
265 decoder->packet_buffer[i].end_addr = 0xdeadbeefdeadbeefUL; 267 decoder->packet_buffer[i].end_addr = CS_ETM_INVAL_ADDR;
266 decoder->packet_buffer[i].last_instr_taken_branch = false; 268 decoder->packet_buffer[i].last_instr_taken_branch = false;
267 decoder->packet_buffer[i].exc = false; 269 decoder->packet_buffer[i].exc = false;
268 decoder->packet_buffer[i].exc_ret = false; 270 decoder->packet_buffer[i].exc_ret = false;
@@ -295,8 +297,8 @@ cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder,
295 decoder->packet_buffer[et].exc = false; 297 decoder->packet_buffer[et].exc = false;
296 decoder->packet_buffer[et].exc_ret = false; 298 decoder->packet_buffer[et].exc_ret = false;
297 decoder->packet_buffer[et].cpu = *((int *)inode->priv); 299 decoder->packet_buffer[et].cpu = *((int *)inode->priv);
298 decoder->packet_buffer[et].start_addr = 0xdeadbeefdeadbeefUL; 300 decoder->packet_buffer[et].start_addr = CS_ETM_INVAL_ADDR;
299 decoder->packet_buffer[et].end_addr = 0xdeadbeefdeadbeefUL; 301 decoder->packet_buffer[et].end_addr = CS_ETM_INVAL_ADDR;
300 302
301 if (decoder->packet_count == MAX_BUFFER - 1) 303 if (decoder->packet_count == MAX_BUFFER - 1)
302 return OCSD_RESP_WAIT; 304 return OCSD_RESP_WAIT;
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
index 743f5f444304..612b5755f742 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
@@ -23,6 +23,7 @@ struct cs_etm_buffer {
23}; 23};
24 24
25enum cs_etm_sample_type { 25enum cs_etm_sample_type {
26 CS_ETM_EMPTY = 0,
26 CS_ETM_RANGE = 1 << 0, 27 CS_ETM_RANGE = 1 << 0,
27 CS_ETM_TRACE_ON = 1 << 1, 28 CS_ETM_TRACE_ON = 1 << 1,
28}; 29};
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 822ba915d144..2ae640257fdb 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -494,6 +494,10 @@ static inline void cs_etm__reset_last_branch_rb(struct cs_etm_queue *etmq)
494 494
495static inline u64 cs_etm__last_executed_instr(struct cs_etm_packet *packet) 495static inline u64 cs_etm__last_executed_instr(struct cs_etm_packet *packet)
496{ 496{
497 /* Returns 0 for the CS_ETM_TRACE_ON packet */
498 if (packet->sample_type == CS_ETM_TRACE_ON)
499 return 0;
500
497 /* 501 /*
498 * The packet records the execution range with an exclusive end address 502 * The packet records the execution range with an exclusive end address
499 * 503 *
@@ -505,6 +509,15 @@ static inline u64 cs_etm__last_executed_instr(struct cs_etm_packet *packet)
505 return packet->end_addr - A64_INSTR_SIZE; 509 return packet->end_addr - A64_INSTR_SIZE;
506} 510}
507 511
512static inline u64 cs_etm__first_executed_instr(struct cs_etm_packet *packet)
513{
514 /* Returns 0 for the CS_ETM_TRACE_ON packet */
515 if (packet->sample_type == CS_ETM_TRACE_ON)
516 return 0;
517
518 return packet->start_addr;
519}
520
508static inline u64 cs_etm__instr_count(const struct cs_etm_packet *packet) 521static inline u64 cs_etm__instr_count(const struct cs_etm_packet *packet)
509{ 522{
510 /* 523 /*
@@ -546,7 +559,7 @@ static void cs_etm__update_last_branch_rb(struct cs_etm_queue *etmq)
546 559
547 be = &bs->entries[etmq->last_branch_pos]; 560 be = &bs->entries[etmq->last_branch_pos];
548 be->from = cs_etm__last_executed_instr(etmq->prev_packet); 561 be->from = cs_etm__last_executed_instr(etmq->prev_packet);
549 be->to = etmq->packet->start_addr; 562 be->to = cs_etm__first_executed_instr(etmq->packet);
550 /* No support for mispredict */ 563 /* No support for mispredict */
551 be->flags.mispred = 0; 564 be->flags.mispred = 0;
552 be->flags.predicted = 1; 565 be->flags.predicted = 1;
@@ -701,7 +714,7 @@ static int cs_etm__synth_branch_sample(struct cs_etm_queue *etmq)
701 sample.ip = cs_etm__last_executed_instr(etmq->prev_packet); 714 sample.ip = cs_etm__last_executed_instr(etmq->prev_packet);
702 sample.pid = etmq->pid; 715 sample.pid = etmq->pid;
703 sample.tid = etmq->tid; 716 sample.tid = etmq->tid;
704 sample.addr = etmq->packet->start_addr; 717 sample.addr = cs_etm__first_executed_instr(etmq->packet);
705 sample.id = etmq->etm->branches_id; 718 sample.id = etmq->etm->branches_id;
706 sample.stream_id = etmq->etm->branches_id; 719 sample.stream_id = etmq->etm->branches_id;
707 sample.period = 1; 720 sample.period = 1;
@@ -897,13 +910,23 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
897 etmq->period_instructions = instrs_over; 910 etmq->period_instructions = instrs_over;
898 } 911 }
899 912
900 if (etm->sample_branches && 913 if (etm->sample_branches && etmq->prev_packet) {
901 etmq->prev_packet && 914 bool generate_sample = false;
902 etmq->prev_packet->sample_type == CS_ETM_RANGE && 915
903 etmq->prev_packet->last_instr_taken_branch) { 916 /* Generate sample for tracing on packet */
904 ret = cs_etm__synth_branch_sample(etmq); 917 if (etmq->prev_packet->sample_type == CS_ETM_TRACE_ON)
905 if (ret) 918 generate_sample = true;
906 return ret; 919
920 /* Generate sample for branch taken packet */
921 if (etmq->prev_packet->sample_type == CS_ETM_RANGE &&
922 etmq->prev_packet->last_instr_taken_branch)
923 generate_sample = true;
924
925 if (generate_sample) {
926 ret = cs_etm__synth_branch_sample(etmq);
927 if (ret)
928 return ret;
929 }
907 } 930 }
908 931
909 if (etm->sample_branches || etm->synth_opts.last_branch) { 932 if (etm->sample_branches || etm->synth_opts.last_branch) {
@@ -922,10 +945,17 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
922static int cs_etm__flush(struct cs_etm_queue *etmq) 945static int cs_etm__flush(struct cs_etm_queue *etmq)
923{ 946{
924 int err = 0; 947 int err = 0;
948 struct cs_etm_auxtrace *etm = etmq->etm;
925 struct cs_etm_packet *tmp; 949 struct cs_etm_packet *tmp;
926 950
951 if (!etmq->prev_packet)
952 return 0;
953
954 /* Handle start tracing packet */
955 if (etmq->prev_packet->sample_type == CS_ETM_EMPTY)
956 goto swap_packet;
957
927 if (etmq->etm->synth_opts.last_branch && 958 if (etmq->etm->synth_opts.last_branch &&
928 etmq->prev_packet &&
929 etmq->prev_packet->sample_type == CS_ETM_RANGE) { 959 etmq->prev_packet->sample_type == CS_ETM_RANGE) {
930 /* 960 /*
931 * Generate a last branch event for the branches left in the 961 * Generate a last branch event for the branches left in the
@@ -939,8 +969,22 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
939 err = cs_etm__synth_instruction_sample( 969 err = cs_etm__synth_instruction_sample(
940 etmq, addr, 970 etmq, addr,
941 etmq->period_instructions); 971 etmq->period_instructions);
972 if (err)
973 return err;
974
942 etmq->period_instructions = 0; 975 etmq->period_instructions = 0;
943 976
977 }
978
979 if (etm->sample_branches &&
980 etmq->prev_packet->sample_type == CS_ETM_RANGE) {
981 err = cs_etm__synth_branch_sample(etmq);
982 if (err)
983 return err;
984 }
985
986swap_packet:
987 if (etmq->etm->synth_opts.last_branch) {
944 /* 988 /*
945 * Swap PACKET with PREV_PACKET: PACKET becomes PREV_PACKET for 989 * Swap PACKET with PREV_PACKET: PACKET becomes PREV_PACKET for
946 * the next incoming packet. 990 * the next incoming packet.
@@ -1020,6 +1064,13 @@ static int cs_etm__run_decoder(struct cs_etm_queue *etmq)
1020 */ 1064 */
1021 cs_etm__flush(etmq); 1065 cs_etm__flush(etmq);
1022 break; 1066 break;
1067 case CS_ETM_EMPTY:
1068 /*
1069 * Should not receive empty packet,
1070 * report error.
1071 */
1072 pr_err("CS ETM Trace: empty packet\n");
1073 return -EINVAL;
1023 default: 1074 default:
1024 break; 1075 break;
1025 } 1076 }
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 94fce4f537e9..ddf84b941abf 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -260,6 +260,17 @@ struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
260 evsel->attr.sample_period = 1; 260 evsel->attr.sample_period = 1;
261 } 261 }
262 262
263 if (perf_evsel__is_clock(evsel)) {
264 /*
265 * The evsel->unit points to static alias->unit
266 * so it's ok to use static string in here.
267 */
268 static const char *unit = "msec";
269
270 evsel->unit = unit;
271 evsel->scale = 1e-6;
272 }
273
263 return evsel; 274 return evsel;
264} 275}
265 276
@@ -848,6 +859,12 @@ static void apply_config_terms(struct perf_evsel *evsel,
848 } 859 }
849} 860}
850 861
862static bool is_dummy_event(struct perf_evsel *evsel)
863{
864 return (evsel->attr.type == PERF_TYPE_SOFTWARE) &&
865 (evsel->attr.config == PERF_COUNT_SW_DUMMY);
866}
867
851/* 868/*
852 * The enable_on_exec/disabled value strategy: 869 * The enable_on_exec/disabled value strategy:
853 * 870 *
@@ -1086,6 +1103,14 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
1086 else 1103 else
1087 perf_evsel__reset_sample_bit(evsel, PERIOD); 1104 perf_evsel__reset_sample_bit(evsel, PERIOD);
1088 } 1105 }
1106
1107 /*
1108 * For initial_delay, a dummy event is added implicitly.
1109 * The software event will trigger -EOPNOTSUPP error out,
1110 * if BRANCH_STACK bit is set.
1111 */
1112 if (opts->initial_delay && is_dummy_event(evsel))
1113 perf_evsel__reset_sample_bit(evsel, BRANCH_STACK);
1089} 1114}
1090 1115
1091static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads) 1116static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index d277930b19a1..973c03167947 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -402,10 +402,13 @@ bool perf_evsel__is_function_event(struct perf_evsel *evsel);
402 402
403static inline bool perf_evsel__is_bpf_output(struct perf_evsel *evsel) 403static inline bool perf_evsel__is_bpf_output(struct perf_evsel *evsel)
404{ 404{
405 struct perf_event_attr *attr = &evsel->attr; 405 return perf_evsel__match(evsel, SOFTWARE, SW_BPF_OUTPUT);
406}
406 407
407 return (attr->config == PERF_COUNT_SW_BPF_OUTPUT) && 408static inline bool perf_evsel__is_clock(struct perf_evsel *evsel)
408 (attr->type == PERF_TYPE_SOFTWARE); 409{
410 return perf_evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK) ||
411 perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK);
409} 412}
410 413
411struct perf_attr_details { 414struct perf_attr_details {
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 540cd2dcd3e7..5af58aac91ad 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2129,6 +2129,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
2129 int cpu_nr = ff->ph->env.nr_cpus_avail; 2129 int cpu_nr = ff->ph->env.nr_cpus_avail;
2130 u64 size = 0; 2130 u64 size = 0;
2131 struct perf_header *ph = ff->ph; 2131 struct perf_header *ph = ff->ph;
2132 bool do_core_id_test = true;
2132 2133
2133 ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); 2134 ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu));
2134 if (!ph->env.cpu) 2135 if (!ph->env.cpu)
@@ -2183,6 +2184,13 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
2183 return 0; 2184 return 0;
2184 } 2185 }
2185 2186
2187 /* On s390 the socket_id number is not related to the numbers of cpus.
2188 * The socket_id number might be higher than the numbers of cpus.
2189 * This depends on the configuration.
2190 */
2191 if (ph->env.arch && !strncmp(ph->env.arch, "s390", 4))
2192 do_core_id_test = false;
2193
2186 for (i = 0; i < (u32)cpu_nr; i++) { 2194 for (i = 0; i < (u32)cpu_nr; i++) {
2187 if (do_read_u32(ff, &nr)) 2195 if (do_read_u32(ff, &nr))
2188 goto free_cpu; 2196 goto free_cpu;
@@ -2192,7 +2200,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
2192 if (do_read_u32(ff, &nr)) 2200 if (do_read_u32(ff, &nr))
2193 goto free_cpu; 2201 goto free_cpu;
2194 2202
2195 if (nr != (u32)-1 && nr > (u32)cpu_nr) { 2203 if (do_core_id_test && nr != (u32)-1 && nr > (u32)cpu_nr) {
2196 pr_debug("socket_id number is too big." 2204 pr_debug("socket_id number is too big."
2197 "You may need to upgrade the perf tool.\n"); 2205 "You may need to upgrade the perf tool.\n");
2198 goto free_cpu; 2206 goto free_cpu;
@@ -2579,7 +2587,7 @@ static const struct feature_ops feat_ops[HEADER_LAST_FEATURE] = {
2579 FEAT_OPR(NUMA_TOPOLOGY, numa_topology, true), 2587 FEAT_OPR(NUMA_TOPOLOGY, numa_topology, true),
2580 FEAT_OPN(BRANCH_STACK, branch_stack, false), 2588 FEAT_OPN(BRANCH_STACK, branch_stack, false),
2581 FEAT_OPR(PMU_MAPPINGS, pmu_mappings, false), 2589 FEAT_OPR(PMU_MAPPINGS, pmu_mappings, false),
2582 FEAT_OPN(GROUP_DESC, group_desc, false), 2590 FEAT_OPR(GROUP_DESC, group_desc, false),
2583 FEAT_OPN(AUXTRACE, auxtrace, false), 2591 FEAT_OPN(AUXTRACE, auxtrace, false),
2584 FEAT_OPN(STAT, stat, false), 2592 FEAT_OPN(STAT, stat, false),
2585 FEAT_OPN(CACHE, cache, true), 2593 FEAT_OPN(CACHE, cache, true),
@@ -3456,7 +3464,7 @@ int perf_event__process_feature(struct perf_tool *tool,
3456 pr_warning("invalid record type %d in pipe-mode\n", type); 3464 pr_warning("invalid record type %d in pipe-mode\n", type);
3457 return 0; 3465 return 0;
3458 } 3466 }
3459 if (feat == HEADER_RESERVED || feat > HEADER_LAST_FEATURE) { 3467 if (feat == HEADER_RESERVED || feat >= HEADER_LAST_FEATURE) {
3460 pr_warning("invalid record type %d in pipe-mode\n", type); 3468 pr_warning("invalid record type %d in pipe-mode\n", type);
3461 return -1; 3469 return -1;
3462 } 3470 }
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 90d4577a92dc..6d7fe44aadc0 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -2,6 +2,7 @@
2#ifndef __PERF_HEADER_H 2#ifndef __PERF_HEADER_H
3#define __PERF_HEADER_H 3#define __PERF_HEADER_H
4 4
5#include <linux/stddef.h>
5#include <linux/perf_event.h> 6#include <linux/perf_event.h>
6#include <sys/types.h> 7#include <sys/types.h>
7#include <stdbool.h> 8#include <stdbool.h>
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 52e8fda93a47..828cb9794c76 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -370,9 +370,11 @@ void hists__delete_entries(struct hists *hists)
370 370
371static int hist_entry__init(struct hist_entry *he, 371static int hist_entry__init(struct hist_entry *he,
372 struct hist_entry *template, 372 struct hist_entry *template,
373 bool sample_self) 373 bool sample_self,
374 size_t callchain_size)
374{ 375{
375 *he = *template; 376 *he = *template;
377 he->callchain_size = callchain_size;
376 378
377 if (symbol_conf.cumulate_callchain) { 379 if (symbol_conf.cumulate_callchain) {
378 he->stat_acc = malloc(sizeof(he->stat)); 380 he->stat_acc = malloc(sizeof(he->stat));
@@ -473,7 +475,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template,
473 475
474 he = ops->new(callchain_size); 476 he = ops->new(callchain_size);
475 if (he) { 477 if (he) {
476 err = hist_entry__init(he, template, sample_self); 478 err = hist_entry__init(he, template, sample_self, callchain_size);
477 if (err) { 479 if (err) {
478 ops->free(he); 480 ops->free(he);
479 he = NULL; 481 he = NULL;
@@ -619,9 +621,11 @@ __hists__add_entry(struct hists *hists,
619 .raw_data = sample->raw_data, 621 .raw_data = sample->raw_data,
620 .raw_size = sample->raw_size, 622 .raw_size = sample->raw_size,
621 .ops = ops, 623 .ops = ops,
622 }; 624 }, *he = hists__findnew_entry(hists, &entry, al, sample_self);
623 625
624 return hists__findnew_entry(hists, &entry, al, sample_self); 626 if (!hists->has_callchains && he && he->callchain_size != 0)
627 hists->has_callchains = true;
628 return he;
625} 629}
626 630
627struct hist_entry *hists__add_entry(struct hists *hists, 631struct hist_entry *hists__add_entry(struct hists *hists,
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 06607c434949..3badd7f1e1b8 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -85,6 +85,7 @@ struct hists {
85 struct events_stats stats; 85 struct events_stats stats;
86 u64 event_stream; 86 u64 event_stream;
87 u16 col_len[HISTC_NR_COLS]; 87 u16 col_len[HISTC_NR_COLS];
88 bool has_callchains;
88 int socket_filter; 89 int socket_filter;
89 struct perf_hpp_list *hpp_list; 90 struct perf_hpp_list *hpp_list;
90 struct list_head hpp_formats; 91 struct list_head hpp_formats;
@@ -180,7 +181,7 @@ size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
180 181
181size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, 182size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
182 int max_cols, float min_pcnt, FILE *fp, 183 int max_cols, float min_pcnt, FILE *fp,
183 bool use_callchain); 184 bool ignore_callchains);
184size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp); 185size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp);
185 186
186void hists__filter_by_dso(struct hists *hists); 187void hists__filter_by_dso(struct hists *hists);
@@ -222,8 +223,7 @@ static inline struct hists *evsel__hists(struct perf_evsel *evsel)
222 223
223static __pure inline bool hists__has_callchains(struct hists *hists) 224static __pure inline bool hists__has_callchains(struct hists *hists)
224{ 225{
225 const struct perf_evsel *evsel = hists_to_evsel(hists); 226 return hists->has_callchains;
226 return evsel__has_callchain(evsel);
227} 227}
228 228
229int hists__init(void); 229int hists__init(void);
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
index ba4c9dd18643..d426761a549d 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
@@ -366,7 +366,7 @@ static int intel_pt_get_cyc(unsigned int byte, const unsigned char *buf,
366 if (len < offs) 366 if (len < offs)
367 return INTEL_PT_NEED_MORE_BYTES; 367 return INTEL_PT_NEED_MORE_BYTES;
368 byte = buf[offs++]; 368 byte = buf[offs++];
369 payload |= (byte >> 1) << shift; 369 payload |= ((uint64_t)byte >> 1) << shift;
370 } 370 }
371 371
372 packet->type = INTEL_PT_CYC; 372 packet->type = INTEL_PT_CYC;
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
index 976e658e38dc..5e94857dfca2 100644
--- a/tools/perf/util/llvm-utils.c
+++ b/tools/perf/util/llvm-utils.c
@@ -266,16 +266,16 @@ static const char *kinc_fetch_script =
266"#!/usr/bin/env sh\n" 266"#!/usr/bin/env sh\n"
267"if ! test -d \"$KBUILD_DIR\"\n" 267"if ! test -d \"$KBUILD_DIR\"\n"
268"then\n" 268"then\n"
269" exit -1\n" 269" exit 1\n"
270"fi\n" 270"fi\n"
271"if ! test -f \"$KBUILD_DIR/include/generated/autoconf.h\"\n" 271"if ! test -f \"$KBUILD_DIR/include/generated/autoconf.h\"\n"
272"then\n" 272"then\n"
273" exit -1\n" 273" exit 1\n"
274"fi\n" 274"fi\n"
275"TMPDIR=`mktemp -d`\n" 275"TMPDIR=`mktemp -d`\n"
276"if test -z \"$TMPDIR\"\n" 276"if test -z \"$TMPDIR\"\n"
277"then\n" 277"then\n"
278" exit -1\n" 278" exit 1\n"
279"fi\n" 279"fi\n"
280"cat << EOF > $TMPDIR/Makefile\n" 280"cat << EOF > $TMPDIR/Makefile\n"
281"obj-y := dummy.o\n" 281"obj-y := dummy.o\n"
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index e7b4a8b513f2..b300a3973448 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -408,23 +408,16 @@ out_err:
408} 408}
409 409
410/* 410/*
411 * Caller must eventually drop thread->refcnt returned with a successful 411 * Front-end cache - TID lookups come in blocks,
412 * lookup/new thread inserted. 412 * so most of the time we dont have to look up
413 * the full rbtree:
413 */ 414 */
414static struct thread *____machine__findnew_thread(struct machine *machine, 415static struct thread*
415 struct threads *threads, 416__threads__get_last_match(struct threads *threads, struct machine *machine,
416 pid_t pid, pid_t tid, 417 int pid, int tid)
417 bool create)
418{ 418{
419 struct rb_node **p = &threads->entries.rb_node;
420 struct rb_node *parent = NULL;
421 struct thread *th; 419 struct thread *th;
422 420
423 /*
424 * Front-end cache - TID lookups come in blocks,
425 * so most of the time we dont have to look up
426 * the full rbtree:
427 */
428 th = threads->last_match; 421 th = threads->last_match;
429 if (th != NULL) { 422 if (th != NULL) {
430 if (th->tid == tid) { 423 if (th->tid == tid) {
@@ -435,12 +428,57 @@ static struct thread *____machine__findnew_thread(struct machine *machine,
435 threads->last_match = NULL; 428 threads->last_match = NULL;
436 } 429 }
437 430
431 return NULL;
432}
433
434static struct thread*
435threads__get_last_match(struct threads *threads, struct machine *machine,
436 int pid, int tid)
437{
438 struct thread *th = NULL;
439
440 if (perf_singlethreaded)
441 th = __threads__get_last_match(threads, machine, pid, tid);
442
443 return th;
444}
445
446static void
447__threads__set_last_match(struct threads *threads, struct thread *th)
448{
449 threads->last_match = th;
450}
451
452static void
453threads__set_last_match(struct threads *threads, struct thread *th)
454{
455 if (perf_singlethreaded)
456 __threads__set_last_match(threads, th);
457}
458
459/*
460 * Caller must eventually drop thread->refcnt returned with a successful
461 * lookup/new thread inserted.
462 */
463static struct thread *____machine__findnew_thread(struct machine *machine,
464 struct threads *threads,
465 pid_t pid, pid_t tid,
466 bool create)
467{
468 struct rb_node **p = &threads->entries.rb_node;
469 struct rb_node *parent = NULL;
470 struct thread *th;
471
472 th = threads__get_last_match(threads, machine, pid, tid);
473 if (th)
474 return th;
475
438 while (*p != NULL) { 476 while (*p != NULL) {
439 parent = *p; 477 parent = *p;
440 th = rb_entry(parent, struct thread, rb_node); 478 th = rb_entry(parent, struct thread, rb_node);
441 479
442 if (th->tid == tid) { 480 if (th->tid == tid) {
443 threads->last_match = th; 481 threads__set_last_match(threads, th);
444 machine__update_thread_pid(machine, th, pid); 482 machine__update_thread_pid(machine, th, pid);
445 return thread__get(th); 483 return thread__get(th);
446 } 484 }
@@ -477,7 +515,7 @@ static struct thread *____machine__findnew_thread(struct machine *machine,
477 * It is now in the rbtree, get a ref 515 * It is now in the rbtree, get a ref
478 */ 516 */
479 thread__get(th); 517 thread__get(th);
480 threads->last_match = th; 518 threads__set_last_match(threads, th);
481 ++threads->nr; 519 ++threads->nr;
482 } 520 }
483 521
@@ -1635,7 +1673,7 @@ static void __machine__remove_thread(struct machine *machine, struct thread *th,
1635 struct threads *threads = machine__threads(machine, th->tid); 1673 struct threads *threads = machine__threads(machine, th->tid);
1636 1674
1637 if (threads->last_match == th) 1675 if (threads->last_match == th)
1638 threads->last_match = NULL; 1676 threads__set_last_match(threads, NULL);
1639 1677
1640 BUG_ON(refcount_read(&th->refcnt) == 0); 1678 BUG_ON(refcount_read(&th->refcnt) == 0);
1641 if (lock) 1679 if (lock)
@@ -2272,6 +2310,7 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
2272{ 2310{
2273 struct callchain_cursor *cursor = arg; 2311 struct callchain_cursor *cursor = arg;
2274 const char *srcline = NULL; 2312 const char *srcline = NULL;
2313 u64 addr;
2275 2314
2276 if (symbol_conf.hide_unresolved && entry->sym == NULL) 2315 if (symbol_conf.hide_unresolved && entry->sym == NULL)
2277 return 0; 2316 return 0;
@@ -2279,7 +2318,13 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
2279 if (append_inlines(cursor, entry->map, entry->sym, entry->ip) == 0) 2318 if (append_inlines(cursor, entry->map, entry->sym, entry->ip) == 0)
2280 return 0; 2319 return 0;
2281 2320
2282 srcline = callchain_srcline(entry->map, entry->sym, entry->ip); 2321 /*
2322 * Convert entry->ip from a virtual address to an offset in
2323 * its corresponding binary.
2324 */
2325 addr = map__map_ip(entry->map, entry->ip);
2326
2327 srcline = callchain_srcline(entry->map, entry->sym, addr);
2283 return callchain_cursor_append(cursor, entry->ip, 2328 return callchain_cursor_append(cursor, entry->ip,
2284 entry->map, entry->sym, 2329 entry->map, entry->sym,
2285 false, NULL, 0, 0, 0, srcline); 2330 false, NULL, 0, 0, 0, srcline);
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 1ddc3d1d0147..a28f9b5cc4ff 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -326,8 +326,8 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,
326 if (raw) 326 if (raw)
327 s = (char *)pe->metric_name; 327 s = (char *)pe->metric_name;
328 else { 328 else {
329 if (asprintf(&s, "%s\n\t[%s]", 329 if (asprintf(&s, "%s\n%*s%s]",
330 pe->metric_name, pe->desc) < 0) 330 pe->metric_name, 8, "[", pe->desc) < 0)
331 return; 331 return;
332 } 332 }
333 333
@@ -490,3 +490,25 @@ out:
490 metricgroup__free_egroups(&group_list); 490 metricgroup__free_egroups(&group_list);
491 return ret; 491 return ret;
492} 492}
493
494bool metricgroup__has_metric(const char *metric)
495{
496 struct pmu_events_map *map = perf_pmu__find_map(NULL);
497 struct pmu_event *pe;
498 int i;
499
500 if (!map)
501 return false;
502
503 for (i = 0; ; i++) {
504 pe = &map->table[i];
505
506 if (!pe->name && !pe->metric_group && !pe->metric_name)
507 break;
508 if (!pe->metric_expr)
509 continue;
510 if (match_metric(pe->metric_name, metric))
511 return true;
512 }
513 return false;
514}
diff --git a/tools/perf/util/metricgroup.h b/tools/perf/util/metricgroup.h
index 06854e125ee7..8a155dba0581 100644
--- a/tools/perf/util/metricgroup.h
+++ b/tools/perf/util/metricgroup.h
@@ -28,4 +28,5 @@ int metricgroup__parse_groups(const struct option *opt,
28 struct rblist *metric_events); 28 struct rblist *metric_events);
29 29
30void metricgroup__print(bool metrics, bool groups, char *filter, bool raw); 30void metricgroup__print(bool metrics, bool groups, char *filter, bool raw);
31bool metricgroup__has_metric(const char *metric);
31#endif 32#endif
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
index 760558dcfd18..cae1a9a39722 100644
--- a/tools/perf/util/namespaces.h
+++ b/tools/perf/util/namespaces.h
@@ -10,6 +10,7 @@
10#define __PERF_NAMESPACES_H 10#define __PERF_NAMESPACES_H
11 11
12#include <sys/types.h> 12#include <sys/types.h>
13#include <linux/stddef.h>
13#include <linux/perf_event.h> 14#include <linux/perf_event.h>
14#include <linux/refcount.h> 15#include <linux/refcount.h>
15#include <linux/types.h> 16#include <linux/types.h>
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 155d2570274f..da8fe57691b8 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -227,11 +227,16 @@ event_def: event_pmu |
227event_pmu: 227event_pmu:
228PE_NAME opt_pmu_config 228PE_NAME opt_pmu_config
229{ 229{
230 struct parse_events_state *parse_state = _parse_state;
231 struct parse_events_error *error = parse_state->error;
230 struct list_head *list, *orig_terms, *terms; 232 struct list_head *list, *orig_terms, *terms;
231 233
232 if (parse_events_copy_term_list($2, &orig_terms)) 234 if (parse_events_copy_term_list($2, &orig_terms))
233 YYABORT; 235 YYABORT;
234 236
237 if (error)
238 error->idx = @1.first_column;
239
235 ALLOC_LIST(list); 240 ALLOC_LIST(list);
236 if (parse_events_add_pmu(_parse_state, list, $1, $2, false, false)) { 241 if (parse_events_add_pmu(_parse_state, list, $1, $2, false, false)) {
237 struct perf_pmu *pmu = NULL; 242 struct perf_pmu *pmu = NULL;
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index d2fb597c9a8c..afd68524ffa9 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -234,6 +234,74 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias,
234 return 0; 234 return 0;
235} 235}
236 236
237static void perf_pmu_assign_str(char *name, const char *field, char **old_str,
238 char **new_str)
239{
240 if (!*old_str)
241 goto set_new;
242
243 if (*new_str) { /* Have new string, check with old */
244 if (strcasecmp(*old_str, *new_str))
245 pr_debug("alias %s differs in field '%s'\n",
246 name, field);
247 zfree(old_str);
248 } else /* Nothing new --> keep old string */
249 return;
250set_new:
251 *old_str = *new_str;
252 *new_str = NULL;
253}
254
255static void perf_pmu_update_alias(struct perf_pmu_alias *old,
256 struct perf_pmu_alias *newalias)
257{
258 perf_pmu_assign_str(old->name, "desc", &old->desc, &newalias->desc);
259 perf_pmu_assign_str(old->name, "long_desc", &old->long_desc,
260 &newalias->long_desc);
261 perf_pmu_assign_str(old->name, "topic", &old->topic, &newalias->topic);
262 perf_pmu_assign_str(old->name, "metric_expr", &old->metric_expr,
263 &newalias->metric_expr);
264 perf_pmu_assign_str(old->name, "metric_name", &old->metric_name,
265 &newalias->metric_name);
266 perf_pmu_assign_str(old->name, "value", &old->str, &newalias->str);
267 old->scale = newalias->scale;
268 old->per_pkg = newalias->per_pkg;
269 old->snapshot = newalias->snapshot;
270 memcpy(old->unit, newalias->unit, sizeof(old->unit));
271}
272
273/* Delete an alias entry. */
274static void perf_pmu_free_alias(struct perf_pmu_alias *newalias)
275{
276 zfree(&newalias->name);
277 zfree(&newalias->desc);
278 zfree(&newalias->long_desc);
279 zfree(&newalias->topic);
280 zfree(&newalias->str);
281 zfree(&newalias->metric_expr);
282 zfree(&newalias->metric_name);
283 parse_events_terms__purge(&newalias->terms);
284 free(newalias);
285}
286
287/* Merge an alias, search in alias list. If this name is already
288 * present merge both of them to combine all information.
289 */
290static bool perf_pmu_merge_alias(struct perf_pmu_alias *newalias,
291 struct list_head *alist)
292{
293 struct perf_pmu_alias *a;
294
295 list_for_each_entry(a, alist, list) {
296 if (!strcasecmp(newalias->name, a->name)) {
297 perf_pmu_update_alias(a, newalias);
298 perf_pmu_free_alias(newalias);
299 return true;
300 }
301 }
302 return false;
303}
304
237static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, 305static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
238 char *desc, char *val, 306 char *desc, char *val,
239 char *long_desc, char *topic, 307 char *long_desc, char *topic,
@@ -241,9 +309,11 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
241 char *metric_expr, 309 char *metric_expr,
242 char *metric_name) 310 char *metric_name)
243{ 311{
312 struct parse_events_term *term;
244 struct perf_pmu_alias *alias; 313 struct perf_pmu_alias *alias;
245 int ret; 314 int ret;
246 int num; 315 int num;
316 char newval[256];
247 317
248 alias = malloc(sizeof(*alias)); 318 alias = malloc(sizeof(*alias));
249 if (!alias) 319 if (!alias)
@@ -262,6 +332,27 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
262 return ret; 332 return ret;
263 } 333 }
264 334
335 /* Scan event and remove leading zeroes, spaces, newlines, some
336 * platforms have terms specified as
337 * event=0x0091 (read from files ../<PMU>/events/<FILE>
338 * and terms specified as event=0x91 (read from JSON files).
339 *
340 * Rebuild string to make alias->str member comparable.
341 */
342 memset(newval, 0, sizeof(newval));
343 ret = 0;
344 list_for_each_entry(term, &alias->terms, list) {
345 if (ret)
346 ret += scnprintf(newval + ret, sizeof(newval) - ret,
347 ",");
348 if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM)
349 ret += scnprintf(newval + ret, sizeof(newval) - ret,
350 "%s=%#x", term->config, term->val.num);
351 else if (term->type_val == PARSE_EVENTS__TERM_TYPE_STR)
352 ret += scnprintf(newval + ret, sizeof(newval) - ret,
353 "%s=%s", term->config, term->val.str);
354 }
355
265 alias->name = strdup(name); 356 alias->name = strdup(name);
266 if (dir) { 357 if (dir) {
267 /* 358 /*
@@ -285,9 +376,10 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
285 snprintf(alias->unit, sizeof(alias->unit), "%s", unit); 376 snprintf(alias->unit, sizeof(alias->unit), "%s", unit);
286 } 377 }
287 alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1; 378 alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1;
288 alias->str = strdup(val); 379 alias->str = strdup(newval);
289 380
290 list_add_tail(&alias->list, list); 381 if (!perf_pmu_merge_alias(alias, list))
382 list_add_tail(&alias->list, list);
291 383
292 return 0; 384 return 0;
293} 385}
@@ -303,6 +395,9 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI
303 395
304 buf[ret] = 0; 396 buf[ret] = 0;
305 397
398 /* Remove trailing newline from sysfs file */
399 rtrim(buf);
400
306 return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL, 401 return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL,
307 NULL, NULL, NULL); 402 NULL, NULL, NULL);
308} 403}
@@ -557,12 +652,6 @@ static int is_arm_pmu_core(const char *name)
557 if (stat(path, &st) == 0) 652 if (stat(path, &st) == 0)
558 return 1; 653 return 1;
559 654
560 /* Look for cpu sysfs (specific to s390) */
561 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s",
562 sysfs, name);
563 if (stat(path, &st) == 0 && !strncmp(name, "cpum_", 5))
564 return 1;
565
566 return 0; 655 return 0;
567} 656}
568 657
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 46e9e19ab1ac..bc32e57d17be 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -908,14 +908,11 @@ static void python_process_tracepoint(struct perf_sample *sample,
908 if (_PyTuple_Resize(&t, n) == -1) 908 if (_PyTuple_Resize(&t, n) == -1)
909 Py_FatalError("error resizing Python tuple"); 909 Py_FatalError("error resizing Python tuple");
910 910
911 if (!dict) { 911 if (!dict)
912 call_object(handler, t, handler_name); 912 call_object(handler, t, handler_name);
913 } else { 913 else
914 call_object(handler, t, default_handler_name); 914 call_object(handler, t, default_handler_name);
915 Py_DECREF(dict);
916 }
917 915
918 Py_XDECREF(all_entries_dict);
919 Py_DECREF(t); 916 Py_DECREF(t);
920} 917}
921 918
@@ -1235,7 +1232,6 @@ static void python_process_general_event(struct perf_sample *sample,
1235 1232
1236 call_object(handler, t, handler_name); 1233 call_object(handler, t, handler_name);
1237 1234
1238 Py_DECREF(dict);
1239 Py_DECREF(t); 1235 Py_DECREF(t);
1240} 1236}
1241 1237
@@ -1627,6 +1623,7 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
1627 fprintf(ofp, "# See the perf-script-python Documentation for the list " 1623 fprintf(ofp, "# See the perf-script-python Documentation for the list "
1628 "of available functions.\n\n"); 1624 "of available functions.\n\n");
1629 1625
1626 fprintf(ofp, "from __future__ import print_function\n\n");
1630 fprintf(ofp, "import os\n"); 1627 fprintf(ofp, "import os\n");
1631 fprintf(ofp, "import sys\n\n"); 1628 fprintf(ofp, "import sys\n\n");
1632 1629
@@ -1636,10 +1633,10 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
1636 fprintf(ofp, "from Core import *\n\n\n"); 1633 fprintf(ofp, "from Core import *\n\n\n");
1637 1634
1638 fprintf(ofp, "def trace_begin():\n"); 1635 fprintf(ofp, "def trace_begin():\n");
1639 fprintf(ofp, "\tprint \"in trace_begin\"\n\n"); 1636 fprintf(ofp, "\tprint(\"in trace_begin\")\n\n");
1640 1637
1641 fprintf(ofp, "def trace_end():\n"); 1638 fprintf(ofp, "def trace_end():\n");
1642 fprintf(ofp, "\tprint \"in trace_end\"\n\n"); 1639 fprintf(ofp, "\tprint(\"in trace_end\")\n\n");
1643 1640
1644 while ((event = trace_find_next_event(pevent, event))) { 1641 while ((event = trace_find_next_event(pevent, event))) {
1645 fprintf(ofp, "def %s__%s(", event->system, event->name); 1642 fprintf(ofp, "def %s__%s(", event->system, event->name);
@@ -1675,7 +1672,7 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
1675 "common_secs, common_nsecs,\n\t\t\t" 1672 "common_secs, common_nsecs,\n\t\t\t"
1676 "common_pid, common_comm)\n\n"); 1673 "common_pid, common_comm)\n\n");
1677 1674
1678 fprintf(ofp, "\t\tprint \""); 1675 fprintf(ofp, "\t\tprint(\"");
1679 1676
1680 not_first = 0; 1677 not_first = 0;
1681 count = 0; 1678 count = 0;
@@ -1736,31 +1733,31 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
1736 fprintf(ofp, "%s", f->name); 1733 fprintf(ofp, "%s", f->name);
1737 } 1734 }
1738 1735
1739 fprintf(ofp, ")\n\n"); 1736 fprintf(ofp, "))\n\n");
1740 1737
1741 fprintf(ofp, "\t\tprint 'Sample: {'+" 1738 fprintf(ofp, "\t\tprint('Sample: {'+"
1742 "get_dict_as_string(perf_sample_dict['sample'], ', ')+'}'\n\n"); 1739 "get_dict_as_string(perf_sample_dict['sample'], ', ')+'}')\n\n");
1743 1740
1744 fprintf(ofp, "\t\tfor node in common_callchain:"); 1741 fprintf(ofp, "\t\tfor node in common_callchain:");
1745 fprintf(ofp, "\n\t\t\tif 'sym' in node:"); 1742 fprintf(ofp, "\n\t\t\tif 'sym' in node:");
1746 fprintf(ofp, "\n\t\t\t\tprint \"\\t[%%x] %%s\" %% (node['ip'], node['sym']['name'])"); 1743 fprintf(ofp, "\n\t\t\t\tprint(\"\\t[%%x] %%s\" %% (node['ip'], node['sym']['name']))");
1747 fprintf(ofp, "\n\t\t\telse:"); 1744 fprintf(ofp, "\n\t\t\telse:");
1748 fprintf(ofp, "\n\t\t\t\tprint \"\t[%%x]\" %% (node['ip'])\n\n"); 1745 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x]\" %% (node['ip']))\n\n");
1749 fprintf(ofp, "\t\tprint \"\\n\"\n\n"); 1746 fprintf(ofp, "\t\tprint()\n\n");
1750 1747
1751 } 1748 }
1752 1749
1753 fprintf(ofp, "def trace_unhandled(event_name, context, " 1750 fprintf(ofp, "def trace_unhandled(event_name, context, "
1754 "event_fields_dict, perf_sample_dict):\n"); 1751 "event_fields_dict, perf_sample_dict):\n");
1755 1752
1756 fprintf(ofp, "\t\tprint get_dict_as_string(event_fields_dict)\n"); 1753 fprintf(ofp, "\t\tprint(get_dict_as_string(event_fields_dict))\n");
1757 fprintf(ofp, "\t\tprint 'Sample: {'+" 1754 fprintf(ofp, "\t\tprint('Sample: {'+"
1758 "get_dict_as_string(perf_sample_dict['sample'], ', ')+'}'\n\n"); 1755 "get_dict_as_string(perf_sample_dict['sample'], ', ')+'}')\n\n");
1759 1756
1760 fprintf(ofp, "def print_header(" 1757 fprintf(ofp, "def print_header("
1761 "event_name, cpu, secs, nsecs, pid, comm):\n" 1758 "event_name, cpu, secs, nsecs, pid, comm):\n"
1762 "\tprint \"%%-20s %%5u %%05u.%%09u %%8u %%-20s \" %% \\\n\t" 1759 "\tprint(\"%%-20s %%5u %%05u.%%09u %%8u %%-20s \" %% \\\n\t"
1763 "(event_name, cpu, secs, nsecs, pid, comm),\n\n"); 1760 "(event_name, cpu, secs, nsecs, pid, comm), end=\"\")\n\n");
1764 1761
1765 fprintf(ofp, "def get_dict_as_string(a_dict, delimiter=' '):\n" 1762 fprintf(ofp, "def get_dict_as_string(a_dict, delimiter=' '):\n"
1766 "\treturn delimiter.join" 1763 "\treturn delimiter.join"
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 7cf2d5cc038e..8bf302cafcec 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -112,6 +112,8 @@ struct hist_entry {
112 112
113 char level; 113 char level;
114 u8 filtered; 114 u8 filtered;
115
116 u16 callchain_size;
115 union { 117 union {
116 /* 118 /*
117 * Since perf diff only supports the stdio output, TUI 119 * Since perf diff only supports the stdio output, TUI
@@ -153,7 +155,7 @@ struct hist_entry {
153 155
154static __pure inline bool hist_entry__has_callchains(struct hist_entry *he) 156static __pure inline bool hist_entry__has_callchains(struct hist_entry *he)
155{ 157{
156 return hists__has_callchains(he->hists); 158 return he->callchain_size != 0;
157} 159}
158 160
159static inline bool hist_entry__has_pairs(struct hist_entry *he) 161static inline bool hist_entry__has_pairs(struct hist_entry *he)
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 594d14a02b67..99990f5f2512 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -913,11 +913,10 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
913 ratio = total / avg; 913 ratio = total / avg;
914 914
915 print_metric(ctxp, NULL, "%8.0f", "cycles / elision", ratio); 915 print_metric(ctxp, NULL, "%8.0f", "cycles / elision", ratio);
916 } else if (perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK) || 916 } else if (perf_evsel__is_clock(evsel)) {
917 perf_evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK)) {
918 if ((ratio = avg_stats(&walltime_nsecs_stats)) != 0) 917 if ((ratio = avg_stats(&walltime_nsecs_stats)) != 0)
919 print_metric(ctxp, NULL, "%8.3f", "CPUs utilized", 918 print_metric(ctxp, NULL, "%8.3f", "CPUs utilized",
920 avg / ratio); 919 avg / (ratio * evsel->scale));
921 else 920 else
922 print_metric(ctxp, NULL, NULL, "CPUs utilized", 0); 921 print_metric(ctxp, NULL, NULL, "CPUs utilized", 0);
923 } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) { 922 } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) {
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 0ee7f568d60c..3393d7ee9401 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -38,6 +38,10 @@ static const char **syscalltbl_native = syscalltbl_powerpc_64;
38#include <asm/syscalls_32.c> 38#include <asm/syscalls_32.c>
39const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID; 39const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID;
40static const char **syscalltbl_native = syscalltbl_powerpc_32; 40static const char **syscalltbl_native = syscalltbl_powerpc_32;
41#elif defined(__aarch64__)
42#include <asm/syscalls.c>
43const int syscalltbl_native_max_id = SYSCALLTBL_ARM64_MAX_ID;
44static const char **syscalltbl_native = syscalltbl_arm64;
41#endif 45#endif
42 46
43struct syscall { 47struct syscall {
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index 538db4e5d1e6..6f318b15950e 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -77,7 +77,7 @@ static int entry(u64 ip, struct unwind_info *ui)
77 if (__report_module(&al, ip, ui)) 77 if (__report_module(&al, ip, ui))
78 return -1; 78 return -1;
79 79
80 e->ip = al.addr; 80 e->ip = ip;
81 e->map = al.map; 81 e->map = al.map;
82 e->sym = al.sym; 82 e->sym = al.sym;
83 83
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 6a11bc7e6b27..79f521a552cf 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -575,7 +575,7 @@ static int entry(u64 ip, struct thread *thread,
575 struct addr_location al; 575 struct addr_location al;
576 576
577 e.sym = thread__find_symbol(thread, PERF_RECORD_MISC_USER, ip, &al); 577 e.sym = thread__find_symbol(thread, PERF_RECORD_MISC_USER, ip, &al);
578 e.ip = al.addr; 578 e.ip = ip;
579 e.map = al.map; 579 e.map = al.map;
580 580
581 pr_debug("unwind: %s:ip = 0x%" PRIx64 " (0x%" PRIx64 ")\n", 581 pr_debug("unwind: %s:ip = 0x%" PRIx64 " (0x%" PRIx64 ")\n",