aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/arch/alpha/include/uapi/asm/errno.h128
-rw-r--r--tools/arch/mips/include/asm/errno.h17
-rw-r--r--tools/arch/mips/include/uapi/asm/errno.h130
-rw-r--r--tools/arch/parisc/include/uapi/asm/errno.h128
-rw-r--r--tools/arch/powerpc/include/uapi/asm/errno.h10
-rw-r--r--tools/arch/powerpc/include/uapi/asm/kvm.h25
-rw-r--r--tools/arch/s390/include/uapi/asm/kvm.h5
-rw-r--r--tools/arch/s390/include/uapi/asm/unistd.h412
-rw-r--r--tools/arch/sparc/include/uapi/asm/errno.h118
-rw-r--r--tools/arch/x86/include/asm/cpufeatures.h28
-rw-r--r--tools/arch/x86/include/asm/disabled-features.h11
-rw-r--r--tools/arch/x86/include/asm/required-features.h3
-rw-r--r--tools/arch/x86/include/uapi/asm/errno.h1
-rw-r--r--tools/bpf/Makefile29
-rw-r--r--tools/bpf/bpf_jit_disasm.c14
-rw-r--r--tools/bpf/bpftool/Documentation/Makefile30
-rw-r--r--tools/bpf/bpftool/Documentation/bpftool-cgroup.rst118
-rw-r--r--tools/bpf/bpftool/Documentation/bpftool-map.rst8
-rw-r--r--tools/bpf/bpftool/Documentation/bpftool-prog.rst16
-rw-r--r--tools/bpf/bpftool/Documentation/bpftool.rst12
-rw-r--r--tools/bpf/bpftool/Makefile90
-rw-r--r--tools/bpf/bpftool/bash-completion/bpftool8
-rw-r--r--tools/bpf/bpftool/cgroup.c308
-rw-r--r--tools/bpf/bpftool/common.c195
-rw-r--r--tools/bpf/bpftool/jit_disasm.c23
-rw-r--r--tools/bpf/bpftool/main.c16
-rw-r--r--tools/bpf/bpftool/main.h9
-rw-r--r--tools/bpf/bpftool/map.c11
-rw-r--r--tools/bpf/bpftool/prog.c229
-rw-r--r--tools/build/Makefile.feature4
-rw-r--r--tools/build/feature/Makefile15
-rw-r--r--tools/build/feature/test-all.c10
-rw-r--r--tools/build/feature/test-disassembler-four-args.c15
-rw-r--r--tools/build/feature/test-libopencsd.c8
-rw-r--r--tools/build/feature/test-pthread-barrier.c12
-rw-r--r--tools/gpio/gpio-event-mon.c10
-rw-r--r--tools/hv/Makefile23
-rw-r--r--tools/include/asm-generic/bitops/find.h16
-rw-r--r--tools/include/uapi/asm-generic/errno-base.h40
-rw-r--r--tools/include/uapi/asm-generic/errno.h123
-rw-r--r--tools/include/uapi/linux/bpf.h116
-rw-r--r--tools/include/uapi/linux/if_link.h943
-rw-r--r--tools/include/uapi/linux/kvm.h4
-rw-r--r--tools/include/uapi/linux/netlink.h251
-rw-r--r--tools/include/uapi/linux/perf_event.h32
-rw-r--r--tools/include/uapi/linux/sched.h5
-rw-r--r--tools/include/uapi/sound/asound.h9
-rw-r--r--tools/lib/bpf/Build2
-rw-r--r--tools/lib/bpf/Makefile30
-rw-r--r--tools/lib/bpf/bpf.c135
-rw-r--r--tools/lib/bpf/bpf.h4
-rw-r--r--tools/lib/bpf/libbpf.c204
-rw-r--r--tools/lib/bpf/libbpf.h6
-rw-r--r--tools/lib/bpf/nlattr.c187
-rw-r--r--tools/lib/bpf/nlattr.h72
-rw-r--r--tools/lib/find_bit.c39
-rw-r--r--tools/lib/subcmd/pager.c5
-rw-r--r--tools/lib/traceevent/event-parse.c62
-rw-r--r--tools/lib/traceevent/event-plugin.c24
-rw-r--r--tools/lib/traceevent/kbuffer-parse.c4
-rw-r--r--tools/lib/traceevent/parse-filter.c22
-rw-r--r--tools/objtool/check.c90
-rw-r--r--tools/objtool/orc_gen.c5
-rw-r--r--tools/perf/.gitignore1
-rw-r--r--tools/perf/Build4
-rw-r--r--tools/perf/Documentation/perf-buildid-cache.txt3
-rw-r--r--tools/perf/Documentation/perf-evlist.txt4
-rw-r--r--tools/perf/Documentation/perf-inject.txt4
-rw-r--r--tools/perf/Documentation/perf-lock.txt4
-rw-r--r--tools/perf/Documentation/perf-probe.txt18
-rw-r--r--tools/perf/Documentation/perf-record.txt3
-rw-r--r--tools/perf/Documentation/perf-report.txt37
-rw-r--r--tools/perf/Documentation/perf-sched.txt4
-rw-r--r--tools/perf/Documentation/perf-script.txt47
-rw-r--r--tools/perf/Documentation/perf-timechart.txt4
-rw-r--r--tools/perf/Documentation/perf-top.txt6
-rw-r--r--tools/perf/Documentation/perf-trace.txt20
-rw-r--r--tools/perf/Documentation/perf.data-file-format.txt27
-rw-r--r--tools/perf/Documentation/tips.txt2
-rw-r--r--tools/perf/Makefile.config65
-rw-r--r--tools/perf/Makefile.perf17
-rw-r--r--tools/perf/arch/arm/util/auxtrace.c77
-rw-r--r--tools/perf/arch/arm/util/pmu.c6
-rw-r--r--tools/perf/arch/arm64/util/Build5
-rw-r--r--tools/perf/arch/arm64/util/arm-spe.c225
-rw-r--r--tools/perf/arch/arm64/util/header.c65
-rw-r--r--tools/perf/arch/arm64/util/sym-handling.c22
-rw-r--r--tools/perf/arch/common.c44
-rw-r--r--tools/perf/arch/common.h1
-rw-r--r--tools/perf/arch/powerpc/util/header.c2
-rw-r--r--tools/perf/arch/powerpc/util/sym-handling.c8
-rw-r--r--tools/perf/arch/s390/Makefile21
-rw-r--r--tools/perf/arch/s390/annotate/instructions.c3
-rwxr-xr-xtools/perf/arch/s390/entry/syscalls/mksyscalltbl36
-rw-r--r--tools/perf/arch/x86/tests/perf-time-to-tsc.c2
-rw-r--r--tools/perf/arch/x86/util/header.c4
-rw-r--r--tools/perf/arch/x86/util/unwind-libunwind.c2
-rw-r--r--tools/perf/bench/futex-hash.c20
-rw-r--r--tools/perf/bench/futex-lock-pi.c23
-rw-r--r--tools/perf/bench/futex-requeue.c22
-rw-r--r--tools/perf/bench/futex-wake-parallel.c46
-rw-r--r--tools/perf/bench/futex-wake.c18
-rw-r--r--tools/perf/builtin-buildid-cache.c4
-rw-r--r--tools/perf/builtin-c2c.c16
-rw-r--r--tools/perf/builtin-help.c2
-rw-r--r--tools/perf/builtin-inject.c3
-rw-r--r--tools/perf/builtin-kvm.c13
-rw-r--r--tools/perf/builtin-record.c66
-rw-r--r--tools/perf/builtin-report.c283
-rw-r--r--tools/perf/builtin-script.c266
-rw-r--r--tools/perf/builtin-stat.c230
-rw-r--r--tools/perf/builtin-top.c10
-rw-r--r--tools/perf/builtin-trace.c125
-rwxr-xr-xtools/perf/check-headers.sh11
-rw-r--r--tools/perf/perf-completion.sh47
-rw-r--r--tools/perf/perf.c4
-rw-r--r--tools/perf/perf.h1
-rw-r--r--tools/perf/pmu-events/arch/arm64/cavium/thunderx2-imp-def.json62
-rw-r--r--tools/perf/pmu-events/arch/arm64/mapfile.csv15
-rw-r--r--tools/perf/pmu-events/arch/powerpc/mapfile.csv12
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/cache.json5
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/frontend.json7
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/marked.json27
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/other.json276
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/pipeline.json14
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/pmc.json2
-rw-r--r--tools/perf/pmu-events/arch/powerpc/power9/translation.json5
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/cache.json555
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/floating-point.json108
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/frontend.json138
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/memory.json210
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/pipeline.json1156
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwell/virtual-memory.json150
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/cache.json389
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/floating-point.json108
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/frontend.json138
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/memory.json9
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/pipeline.json1156
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/virtual-memory.json150
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/cache.json383
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/floating-point.json108
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/frontend.json138
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/memory.json40
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/pipeline.json1156
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/virtual-memory.json150
-rw-r--r--tools/perf/pmu-events/arch/x86/goldmont/cache.json1050
-rw-r--r--tools/perf/pmu-events/arch/x86/goldmont/memory.json280
-rw-r--r--tools/perf/pmu-events/arch/x86/goldmont/other.json54
-rw-r--r--tools/perf/pmu-events/arch/x86/goldmont/pipeline.json506
-rw-r--r--tools/perf/pmu-events/arch/x86/goldmont/virtual-memory.json60
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/cache.json365
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/floating-point.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/frontend.json132
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/memory.json21
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/pipeline.json981
-rw-r--r--tools/perf/pmu-events/arch/x86/haswell/virtual-memory.json212
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/cache.json377
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/floating-point.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/frontend.json132
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/memory.json28
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/pipeline.json981
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/virtual-memory.json212
-rw-r--r--tools/perf/pmu-events/arch/x86/ivybridge/cache.json243
-rw-r--r--tools/perf/pmu-events/arch/x86/ivybridge/frontend.json122
-rw-r--r--tools/perf/pmu-events/arch/x86/ivybridge/memory.json24
-rw-r--r--tools/perf/pmu-events/arch/x86/ivybridge/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/ivybridge/pipeline.json812
-rw-r--r--tools/perf/pmu-events/arch/x86/ivybridge/virtual-memory.json60
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/cache.json236
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/frontend.json122
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/memory.json24
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/other.json20
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/pipeline.json812
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/virtual-memory.json60
-rw-r--r--tools/perf/pmu-events/arch/x86/mapfile.csv5
-rw-r--r--tools/perf/pmu-events/arch/x86/silvermont/cache.json3
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/cache.json4180
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/floating-point.json5
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/frontend.json232
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/memory.json2008
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/other.json40
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/pipeline.json973
-rw-r--r--tools/perf/pmu-events/arch/x86/skylake/virtual-memory.json262
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/cache.json257
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/floating-point.json3
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/frontend.json48
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/memory.json231
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/other.json94
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/pipeline.json44
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json42
-rw-r--r--tools/perf/pmu-events/jevents.c39
-rw-r--r--tools/perf/scripts/python/bin/mem-phys-addr-record19
-rw-r--r--tools/perf/scripts/python/bin/mem-phys-addr-report3
-rw-r--r--tools/perf/scripts/python/mem-phys-addr.py95
-rw-r--r--tools/perf/tests/attr.c6
-rw-r--r--tools/perf/tests/backward-ring-buffer.c6
-rw-r--r--tools/perf/tests/bp_signal.c2
-rw-r--r--tools/perf/tests/bpf-script-example.c4
-rw-r--r--tools/perf/tests/bpf.c68
-rw-r--r--tools/perf/tests/builtin-test.c10
-rw-r--r--tools/perf/tests/code-reading.c2
-rw-r--r--tools/perf/tests/dwarf-unwind.c1
-rw-r--r--tools/perf/tests/keep-tracking.c2
-rw-r--r--tools/perf/tests/mmap-basic.c2
-rw-r--r--tools/perf/tests/openat-syscall-tp-fields.c5
-rw-r--r--tools/perf/tests/parse-events.c1
-rw-r--r--tools/perf/tests/perf-record.c2
-rw-r--r--tools/perf/tests/sample-parsing.c2
-rwxr-xr-xtools/perf/tests/shell/trace+probe_vfs_getname.sh7
-rw-r--r--tools/perf/tests/sw-clock.c2
-rw-r--r--tools/perf/tests/switch-tracking.c2
-rw-r--r--tools/perf/tests/task-exit.c2
-rw-r--r--tools/perf/tests/thread-map.c2
-rw-r--r--tools/perf/trace/beauty/Build1
-rw-r--r--tools/perf/trace/beauty/arch_errno_names.c1
-rwxr-xr-xtools/perf/trace/beauty/arch_errno_names.sh100
-rw-r--r--tools/perf/trace/beauty/beauty.h5
-rw-r--r--tools/perf/trace/beauty/flock.c10
-rw-r--r--tools/perf/trace/beauty/futex_val3.c18
-rw-r--r--tools/perf/ui/browsers/annotate.c399
-rw-r--r--tools/perf/ui/gtk/annotate.c25
-rw-r--r--tools/perf/util/Build10
-rw-r--r--tools/perf/util/annotate.c652
-rw-r--r--tools/perf/util/annotate.h76
-rw-r--r--tools/perf/util/arm-spe-pkt-decoder.c462
-rw-r--r--tools/perf/util/arm-spe-pkt-decoder.h43
-rw-r--r--tools/perf/util/arm-spe.c231
-rw-r--r--tools/perf/util/arm-spe.h31
-rw-r--r--tools/perf/util/auxtrace.c8
-rw-r--r--tools/perf/util/auxtrace.h1
-rw-r--r--tools/perf/util/bpf-loader.c4
-rw-r--r--tools/perf/util/callchain.c10
-rw-r--r--tools/perf/util/callchain.h2
-rw-r--r--tools/perf/util/cgroup.c3
-rw-r--r--tools/perf/util/cs-etm-decoder/Build1
-rw-r--r--tools/perf/util/cs-etm-decoder/cs-etm-decoder.c513
-rw-r--r--tools/perf/util/cs-etm-decoder/cs-etm-decoder.h105
-rw-r--r--tools/perf/util/cs-etm.c1023
-rw-r--r--tools/perf/util/cs-etm.h18
-rw-r--r--tools/perf/util/data.c10
-rw-r--r--tools/perf/util/dso.c2
-rw-r--r--tools/perf/util/env.c47
-rw-r--r--tools/perf/util/env.h2
-rw-r--r--tools/perf/util/event.c8
-rw-r--r--tools/perf/util/event.h4
-rw-r--r--tools/perf/util/evlist.c70
-rw-r--r--tools/perf/util/evlist.h15
-rw-r--r--tools/perf/util/evsel.c240
-rw-r--r--tools/perf/util/evsel.h12
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh2
-rw-r--r--tools/perf/util/header.c130
-rw-r--r--tools/perf/util/header.h9
-rw-r--r--tools/perf/util/intel-bts.c6
-rw-r--r--tools/perf/util/intel-pt-decoder/Build24
-rw-r--r--tools/perf/util/intel-pt.c11
-rw-r--r--tools/perf/util/machine.c4
-rw-r--r--tools/perf/util/map.c2
-rw-r--r--tools/perf/util/metricgroup.c10
-rw-r--r--tools/perf/util/mmap.c73
-rw-r--r--tools/perf/util/mmap.h4
-rw-r--r--tools/perf/util/ordered-events.c3
-rw-r--r--tools/perf/util/ordered-events.h2
-rw-r--r--tools/perf/util/parse-events.c3
-rw-r--r--tools/perf/util/path.c14
-rw-r--r--tools/perf/util/path.h3
-rw-r--r--tools/perf/util/pmu.c87
-rw-r--r--tools/perf/util/pmu.h2
-rw-r--r--tools/perf/util/probe-event.c85
-rw-r--r--tools/perf/util/python-ext-sources1
-rw-r--r--tools/perf/util/python.c2
-rw-r--r--tools/perf/util/rblist.c19
-rw-r--r--tools/perf/util/rblist.h1
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c3
-rw-r--r--tools/perf/util/session.c54
-rw-r--r--tools/perf/util/session.h2
-rw-r--r--tools/perf/util/sort.c20
-rw-r--r--tools/perf/util/srcline.c9
-rw-r--r--tools/perf/util/srcline.h5
-rw-r--r--tools/perf/util/stat-shadow.c426
-rw-r--r--tools/perf/util/stat.c15
-rw-r--r--tools/perf/util/stat.h63
-rw-r--r--tools/perf/util/string.c46
-rw-r--r--tools/perf/util/string2.h2
-rw-r--r--tools/perf/util/symbol.c5
-rw-r--r--tools/perf/util/symbol.h1
-rw-r--r--tools/perf/util/syscalltbl.c4
-rw-r--r--tools/perf/util/target.h7
-rw-r--r--tools/perf/util/thread_map.c27
-rw-r--r--tools/perf/util/thread_map.h3
-rw-r--r--tools/perf/util/time-utils.c301
-rw-r--r--tools/perf/util/time-utils.h8
-rw-r--r--tools/perf/util/tool.h1
-rw-r--r--tools/perf/util/unwind-libunwind-local.c9
-rw-r--r--tools/perf/util/unwind-libunwind.c4
-rw-r--r--tools/perf/util/util.c2
-rw-r--r--tools/perf/util/util.h10
-rw-r--r--tools/scripts/Makefile.include1
-rw-r--r--tools/testing/nvdimm/Kbuild4
-rw-r--r--tools/testing/nvdimm/acpi_nfit_test.c8
-rw-r--r--tools/testing/nvdimm/device_dax_test.c8
-rw-r--r--tools/testing/nvdimm/libnvdimm_test.c8
-rw-r--r--tools/testing/nvdimm/pmem_test.c8
-rw-r--r--tools/testing/nvdimm/test/iomap.c7
-rw-r--r--tools/testing/nvdimm/test/nfit.c498
-rw-r--r--tools/testing/nvdimm/test/nfit_test.h134
-rw-r--r--tools/testing/nvdimm/watermark.h21
-rw-r--r--tools/testing/radix-tree/idr-test.c29
-rw-r--r--tools/testing/radix-tree/linux/kernel.h2
-rw-r--r--tools/testing/selftests/Makefile9
-rw-r--r--tools/testing/selftests/bpf/.gitignore8
-rw-r--r--tools/testing/selftests/bpf/Makefile24
-rw-r--r--tools/testing/selftests/bpf/bpf_helpers.h5
-rw-r--r--tools/testing/selftests/bpf/config2
-rw-r--r--tools/testing/selftests/bpf/sample_map_ret0.c34
-rw-r--r--tools/testing/selftests/bpf/sample_ret0.c7
-rwxr-xr-xtools/testing/selftests/bpf/tcp_client.py51
-rwxr-xr-xtools/testing/selftests/bpf/tcp_server.py83
-rw-r--r--tools/testing/selftests/bpf/test_align.c178
-rw-r--r--tools/testing/selftests/bpf/test_dev_cgroup.c11
-rw-r--r--tools/testing/selftests/bpf/test_l4lb_noinline.c473
-rw-r--r--tools/testing/selftests/bpf/test_lpm_map.c217
-rw-r--r--tools/testing/selftests/bpf/test_maps.c32
-rwxr-xr-xtools/testing/selftests/bpf/test_offload.py1085
-rw-r--r--tools/testing/selftests/bpf/test_progs.c355
-rw-r--r--tools/testing/selftests/bpf/test_stacktrace_map.c62
-rw-r--r--tools/testing/selftests/bpf/test_tcpbpf.h16
-rw-r--r--tools/testing/selftests/bpf/test_tcpbpf_kern.c115
-rw-r--r--tools/testing/selftests/bpf/test_tcpbpf_user.c126
-rw-r--r--tools/testing/selftests/bpf/test_tracepoint.c26
-rw-r--r--tools/testing/selftests/bpf/test_verifier.c2348
-rw-r--r--tools/testing/selftests/bpf/test_xdp_noinline.c833
-rwxr-xr-xtools/testing/selftests/firmware/fw_fallback.sh172
-rwxr-xr-xtools/testing/selftests/firmware/fw_filesystem.sh5
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc21
-rwxr-xr-xtools/testing/selftests/gen_kselftest_tar.sh4
-rw-r--r--tools/testing/selftests/kselftest.h2
-rwxr-xr-xtools/testing/selftests/kselftest_install.sh4
-rw-r--r--tools/testing/selftests/lib.mk2
-rw-r--r--tools/testing/selftests/media_tests/Makefile7
-rw-r--r--tools/testing/selftests/media_tests/media_device_open.c3
-rw-r--r--tools/testing/selftests/media_tests/media_device_test.c3
-rw-r--r--tools/testing/selftests/media_tests/video_device_test.c3
-rw-r--r--tools/testing/selftests/membarrier/membarrier_test.c237
-rw-r--r--tools/testing/selftests/memfd/Makefile5
-rw-r--r--tools/testing/selftests/memfd/common.c46
-rw-r--r--tools/testing/selftests/memfd/common.h9
-rw-r--r--tools/testing/selftests/memfd/fuse_test.c44
-rw-r--r--tools/testing/selftests/memfd/memfd_test.c212
-rwxr-xr-xtools/testing/selftests/memfd/run_fuse_test.sh2
-rwxr-xr-xtools/testing/selftests/memfd/run_tests.sh1
-rw-r--r--tools/testing/selftests/net/Makefile1
-rwxr-xr-xtools/testing/selftests/net/fib_tests.sh429
-rw-r--r--tools/testing/selftests/net/msg_zerocopy.c21
-rwxr-xr-xtools/testing/selftests/net/rtnetlink.sh229
-rw-r--r--tools/testing/selftests/nsfs/pidns.c2
-rwxr-xr-xtools/testing/selftests/ntb/ntb_test.sh307
-rw-r--r--tools/testing/selftests/powerpc/alignment/Makefile3
-rw-r--r--tools/testing/selftests/powerpc/alignment/alignment_handler.c491
-rw-r--r--tools/testing/selftests/powerpc/benchmarks/mmap_bench.c53
-rw-r--r--tools/testing/selftests/powerpc/mm/.gitignore3
-rw-r--r--tools/testing/selftests/powerpc/mm/Makefile2
-rw-r--r--tools/testing/selftests/powerpc/mm/segv_errors.c78
-rw-r--r--tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c4
-rw-r--r--tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c3
-rw-r--r--tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c2
-rw-r--r--tools/testing/selftests/powerpc/tm/.gitignore1
-rw-r--r--tools/testing/selftests/powerpc/tm/Makefile3
-rw-r--r--tools/testing/selftests/powerpc/tm/tm-trap.c329
-rw-r--r--tools/testing/selftests/powerpc/tm/tm-unavailable.c43
-rw-r--r--tools/testing/selftests/ptp/testptp.c4
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/config2frag.sh25
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/configinit.sh2
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-build.sh5
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh2
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh4
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh2
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh4
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck.sh2
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh6
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm.sh42
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-torture.sh2
-rw-r--r--tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh1
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh1
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh1
-rw-r--r--tools/testing/selftests/seccomp/seccomp_bpf.c4
-rw-r--r--tools/testing/selftests/vm/.gitignore1
-rw-r--r--tools/testing/selftests/vm/Makefile5
-rw-r--r--tools/testing/selftests/vm/compaction_test.c2
-rwxr-xr-xtools/testing/selftests/vm/run_vmtests11
-rw-r--r--tools/testing/selftests/vm/va_128TBswitch.c297
-rw-r--r--tools/testing/selftests/x86/5lvl.c177
-rw-r--r--tools/testing/selftests/x86/Makefile12
-rw-r--r--tools/usb/usbip/libsrc/usbip_device_driver.c7
-rw-r--r--tools/usb/usbip/src/usbip_bind.c9
-rw-r--r--tools/usb/usbip/src/usbip_list.c9
-rw-r--r--tools/usb/usbip/src/usbipd.c2
-rw-r--r--tools/virtio/linux/kernel.h2
-rw-r--r--tools/virtio/linux/thread_info.h1
-rw-r--r--tools/virtio/ringtest/main.h59
-rw-r--r--tools/virtio/ringtest/ptr_ring.c2
-rw-r--r--tools/virtio/ringtest/ring.c30
-rw-r--r--tools/virtio/ringtest/virtio_ring_0_9.c24
-rw-r--r--tools/vm/page-types.c28
408 files changed, 30458 insertions, 15753 deletions
diff --git a/tools/arch/alpha/include/uapi/asm/errno.h b/tools/arch/alpha/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..3d265f6babaf
--- /dev/null
+++ b/tools/arch/alpha/include/uapi/asm/errno.h
@@ -0,0 +1,128 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ALPHA_ERRNO_H
3#define _ALPHA_ERRNO_H
4
5#include <asm-generic/errno-base.h>
6
7#undef EAGAIN /* 11 in errno-base.h */
8
9#define EDEADLK 11 /* Resource deadlock would occur */
10
11#define EAGAIN 35 /* Try again */
12#define EWOULDBLOCK EAGAIN /* Operation would block */
13#define EINPROGRESS 36 /* Operation now in progress */
14#define EALREADY 37 /* Operation already in progress */
15#define ENOTSOCK 38 /* Socket operation on non-socket */
16#define EDESTADDRREQ 39 /* Destination address required */
17#define EMSGSIZE 40 /* Message too long */
18#define EPROTOTYPE 41 /* Protocol wrong type for socket */
19#define ENOPROTOOPT 42 /* Protocol not available */
20#define EPROTONOSUPPORT 43 /* Protocol not supported */
21#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
22#define EOPNOTSUPP 45 /* Operation not supported on transport endpoint */
23#define EPFNOSUPPORT 46 /* Protocol family not supported */
24#define EAFNOSUPPORT 47 /* Address family not supported by protocol */
25#define EADDRINUSE 48 /* Address already in use */
26#define EADDRNOTAVAIL 49 /* Cannot assign requested address */
27#define ENETDOWN 50 /* Network is down */
28#define ENETUNREACH 51 /* Network is unreachable */
29#define ENETRESET 52 /* Network dropped connection because of reset */
30#define ECONNABORTED 53 /* Software caused connection abort */
31#define ECONNRESET 54 /* Connection reset by peer */
32#define ENOBUFS 55 /* No buffer space available */
33#define EISCONN 56 /* Transport endpoint is already connected */
34#define ENOTCONN 57 /* Transport endpoint is not connected */
35#define ESHUTDOWN 58 /* Cannot send after transport endpoint shutdown */
36#define ETOOMANYREFS 59 /* Too many references: cannot splice */
37#define ETIMEDOUT 60 /* Connection timed out */
38#define ECONNREFUSED 61 /* Connection refused */
39#define ELOOP 62 /* Too many symbolic links encountered */
40#define ENAMETOOLONG 63 /* File name too long */
41#define EHOSTDOWN 64 /* Host is down */
42#define EHOSTUNREACH 65 /* No route to host */
43#define ENOTEMPTY 66 /* Directory not empty */
44
45#define EUSERS 68 /* Too many users */
46#define EDQUOT 69 /* Quota exceeded */
47#define ESTALE 70 /* Stale file handle */
48#define EREMOTE 71 /* Object is remote */
49
50#define ENOLCK 77 /* No record locks available */
51#define ENOSYS 78 /* Function not implemented */
52
53#define ENOMSG 80 /* No message of desired type */
54#define EIDRM 81 /* Identifier removed */
55#define ENOSR 82 /* Out of streams resources */
56#define ETIME 83 /* Timer expired */
57#define EBADMSG 84 /* Not a data message */
58#define EPROTO 85 /* Protocol error */
59#define ENODATA 86 /* No data available */
60#define ENOSTR 87 /* Device not a stream */
61
62#define ENOPKG 92 /* Package not installed */
63
64#define EILSEQ 116 /* Illegal byte sequence */
65
66/* The following are just random noise.. */
67#define ECHRNG 88 /* Channel number out of range */
68#define EL2NSYNC 89 /* Level 2 not synchronized */
69#define EL3HLT 90 /* Level 3 halted */
70#define EL3RST 91 /* Level 3 reset */
71
72#define ELNRNG 93 /* Link number out of range */
73#define EUNATCH 94 /* Protocol driver not attached */
74#define ENOCSI 95 /* No CSI structure available */
75#define EL2HLT 96 /* Level 2 halted */
76#define EBADE 97 /* Invalid exchange */
77#define EBADR 98 /* Invalid request descriptor */
78#define EXFULL 99 /* Exchange full */
79#define ENOANO 100 /* No anode */
80#define EBADRQC 101 /* Invalid request code */
81#define EBADSLT 102 /* Invalid slot */
82
83#define EDEADLOCK EDEADLK
84
85#define EBFONT 104 /* Bad font file format */
86#define ENONET 105 /* Machine is not on the network */
87#define ENOLINK 106 /* Link has been severed */
88#define EADV 107 /* Advertise error */
89#define ESRMNT 108 /* Srmount error */
90#define ECOMM 109 /* Communication error on send */
91#define EMULTIHOP 110 /* Multihop attempted */
92#define EDOTDOT 111 /* RFS specific error */
93#define EOVERFLOW 112 /* Value too large for defined data type */
94#define ENOTUNIQ 113 /* Name not unique on network */
95#define EBADFD 114 /* File descriptor in bad state */
96#define EREMCHG 115 /* Remote address changed */
97
98#define EUCLEAN 117 /* Structure needs cleaning */
99#define ENOTNAM 118 /* Not a XENIX named type file */
100#define ENAVAIL 119 /* No XENIX semaphores available */
101#define EISNAM 120 /* Is a named type file */
102#define EREMOTEIO 121 /* Remote I/O error */
103
104#define ELIBACC 122 /* Can not access a needed shared library */
105#define ELIBBAD 123 /* Accessing a corrupted shared library */
106#define ELIBSCN 124 /* .lib section in a.out corrupted */
107#define ELIBMAX 125 /* Attempting to link in too many shared libraries */
108#define ELIBEXEC 126 /* Cannot exec a shared library directly */
109#define ERESTART 127 /* Interrupted system call should be restarted */
110#define ESTRPIPE 128 /* Streams pipe error */
111
112#define ENOMEDIUM 129 /* No medium found */
113#define EMEDIUMTYPE 130 /* Wrong medium type */
114#define ECANCELED 131 /* Operation Cancelled */
115#define ENOKEY 132 /* Required key not available */
116#define EKEYEXPIRED 133 /* Key has expired */
117#define EKEYREVOKED 134 /* Key has been revoked */
118#define EKEYREJECTED 135 /* Key was rejected by service */
119
120/* for robust mutexes */
121#define EOWNERDEAD 136 /* Owner died */
122#define ENOTRECOVERABLE 137 /* State not recoverable */
123
124#define ERFKILL 138 /* Operation not possible due to RF-kill */
125
126#define EHWPOISON 139 /* Memory page has hardware error */
127
128#endif
diff --git a/tools/arch/mips/include/asm/errno.h b/tools/arch/mips/include/asm/errno.h
new file mode 100644
index 000000000000..21d91cdfe3c9
--- /dev/null
+++ b/tools/arch/mips/include/asm/errno.h
@@ -0,0 +1,17 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
7 */
8#ifndef _ASM_ERRNO_H
9#define _ASM_ERRNO_H
10
11#include <uapi/asm/errno.h>
12
13
14/* The biggest error number defined here or in <linux/errno.h>. */
15#define EMAXERRNO 1133
16
17#endif /* _ASM_ERRNO_H */
diff --git a/tools/arch/mips/include/uapi/asm/errno.h b/tools/arch/mips/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..2fb714e2d6d8
--- /dev/null
+++ b/tools/arch/mips/include/uapi/asm/errno.h
@@ -0,0 +1,130 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
8 */
9#ifndef _UAPI_ASM_ERRNO_H
10#define _UAPI_ASM_ERRNO_H
11
12/*
13 * These error numbers are intended to be MIPS ABI compatible
14 */
15
16#include <asm-generic/errno-base.h>
17
18#define ENOMSG 35 /* No message of desired type */
19#define EIDRM 36 /* Identifier removed */
20#define ECHRNG 37 /* Channel number out of range */
21#define EL2NSYNC 38 /* Level 2 not synchronized */
22#define EL3HLT 39 /* Level 3 halted */
23#define EL3RST 40 /* Level 3 reset */
24#define ELNRNG 41 /* Link number out of range */
25#define EUNATCH 42 /* Protocol driver not attached */
26#define ENOCSI 43 /* No CSI structure available */
27#define EL2HLT 44 /* Level 2 halted */
28#define EDEADLK 45 /* Resource deadlock would occur */
29#define ENOLCK 46 /* No record locks available */
30#define EBADE 50 /* Invalid exchange */
31#define EBADR 51 /* Invalid request descriptor */
32#define EXFULL 52 /* Exchange full */
33#define ENOANO 53 /* No anode */
34#define EBADRQC 54 /* Invalid request code */
35#define EBADSLT 55 /* Invalid slot */
36#define EDEADLOCK 56 /* File locking deadlock error */
37#define EBFONT 59 /* Bad font file format */
38#define ENOSTR 60 /* Device not a stream */
39#define ENODATA 61 /* No data available */
40#define ETIME 62 /* Timer expired */
41#define ENOSR 63 /* Out of streams resources */
42#define ENONET 64 /* Machine is not on the network */
43#define ENOPKG 65 /* Package not installed */
44#define EREMOTE 66 /* Object is remote */
45#define ENOLINK 67 /* Link has been severed */
46#define EADV 68 /* Advertise error */
47#define ESRMNT 69 /* Srmount error */
48#define ECOMM 70 /* Communication error on send */
49#define EPROTO 71 /* Protocol error */
50#define EDOTDOT 73 /* RFS specific error */
51#define EMULTIHOP 74 /* Multihop attempted */
52#define EBADMSG 77 /* Not a data message */
53#define ENAMETOOLONG 78 /* File name too long */
54#define EOVERFLOW 79 /* Value too large for defined data type */
55#define ENOTUNIQ 80 /* Name not unique on network */
56#define EBADFD 81 /* File descriptor in bad state */
57#define EREMCHG 82 /* Remote address changed */
58#define ELIBACC 83 /* Can not access a needed shared library */
59#define ELIBBAD 84 /* Accessing a corrupted shared library */
60#define ELIBSCN 85 /* .lib section in a.out corrupted */
61#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
62#define ELIBEXEC 87 /* Cannot exec a shared library directly */
63#define EILSEQ 88 /* Illegal byte sequence */
64#define ENOSYS 89 /* Function not implemented */
65#define ELOOP 90 /* Too many symbolic links encountered */
66#define ERESTART 91 /* Interrupted system call should be restarted */
67#define ESTRPIPE 92 /* Streams pipe error */
68#define ENOTEMPTY 93 /* Directory not empty */
69#define EUSERS 94 /* Too many users */
70#define ENOTSOCK 95 /* Socket operation on non-socket */
71#define EDESTADDRREQ 96 /* Destination address required */
72#define EMSGSIZE 97 /* Message too long */
73#define EPROTOTYPE 98 /* Protocol wrong type for socket */
74#define ENOPROTOOPT 99 /* Protocol not available */
75#define EPROTONOSUPPORT 120 /* Protocol not supported */
76#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
77#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
78#define EPFNOSUPPORT 123 /* Protocol family not supported */
79#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
80#define EADDRINUSE 125 /* Address already in use */
81#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
82#define ENETDOWN 127 /* Network is down */
83#define ENETUNREACH 128 /* Network is unreachable */
84#define ENETRESET 129 /* Network dropped connection because of reset */
85#define ECONNABORTED 130 /* Software caused connection abort */
86#define ECONNRESET 131 /* Connection reset by peer */
87#define ENOBUFS 132 /* No buffer space available */
88#define EISCONN 133 /* Transport endpoint is already connected */
89#define ENOTCONN 134 /* Transport endpoint is not connected */
90#define EUCLEAN 135 /* Structure needs cleaning */
91#define ENOTNAM 137 /* Not a XENIX named type file */
92#define ENAVAIL 138 /* No XENIX semaphores available */
93#define EISNAM 139 /* Is a named type file */
94#define EREMOTEIO 140 /* Remote I/O error */
95#define EINIT 141 /* Reserved */
96#define EREMDEV 142 /* Error 142 */
97#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
98#define ETOOMANYREFS 144 /* Too many references: cannot splice */
99#define ETIMEDOUT 145 /* Connection timed out */
100#define ECONNREFUSED 146 /* Connection refused */
101#define EHOSTDOWN 147 /* Host is down */
102#define EHOSTUNREACH 148 /* No route to host */
103#define EWOULDBLOCK EAGAIN /* Operation would block */
104#define EALREADY 149 /* Operation already in progress */
105#define EINPROGRESS 150 /* Operation now in progress */
106#define ESTALE 151 /* Stale file handle */
107#define ECANCELED 158 /* AIO operation canceled */
108
109/*
110 * These error are Linux extensions.
111 */
112#define ENOMEDIUM 159 /* No medium found */
113#define EMEDIUMTYPE 160 /* Wrong medium type */
114#define ENOKEY 161 /* Required key not available */
115#define EKEYEXPIRED 162 /* Key has expired */
116#define EKEYREVOKED 163 /* Key has been revoked */
117#define EKEYREJECTED 164 /* Key was rejected by service */
118
119/* for robust mutexes */
120#define EOWNERDEAD 165 /* Owner died */
121#define ENOTRECOVERABLE 166 /* State not recoverable */
122
123#define ERFKILL 167 /* Operation not possible due to RF-kill */
124
125#define EHWPOISON 168 /* Memory page has hardware error */
126
127#define EDQUOT 1133 /* Quota exceeded */
128
129
130#endif /* _UAPI_ASM_ERRNO_H */
diff --git a/tools/arch/parisc/include/uapi/asm/errno.h b/tools/arch/parisc/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..fc0df353ff0d
--- /dev/null
+++ b/tools/arch/parisc/include/uapi/asm/errno.h
@@ -0,0 +1,128 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PARISC_ERRNO_H
3#define _PARISC_ERRNO_H
4
5#include <asm-generic/errno-base.h>
6
7#define ENOMSG 35 /* No message of desired type */
8#define EIDRM 36 /* Identifier removed */
9#define ECHRNG 37 /* Channel number out of range */
10#define EL2NSYNC 38 /* Level 2 not synchronized */
11#define EL3HLT 39 /* Level 3 halted */
12#define EL3RST 40 /* Level 3 reset */
13#define ELNRNG 41 /* Link number out of range */
14#define EUNATCH 42 /* Protocol driver not attached */
15#define ENOCSI 43 /* No CSI structure available */
16#define EL2HLT 44 /* Level 2 halted */
17#define EDEADLK 45 /* Resource deadlock would occur */
18#define EDEADLOCK EDEADLK
19#define ENOLCK 46 /* No record locks available */
20#define EILSEQ 47 /* Illegal byte sequence */
21
22#define ENONET 50 /* Machine is not on the network */
23#define ENODATA 51 /* No data available */
24#define ETIME 52 /* Timer expired */
25#define ENOSR 53 /* Out of streams resources */
26#define ENOSTR 54 /* Device not a stream */
27#define ENOPKG 55 /* Package not installed */
28
29#define ENOLINK 57 /* Link has been severed */
30#define EADV 58 /* Advertise error */
31#define ESRMNT 59 /* Srmount error */
32#define ECOMM 60 /* Communication error on send */
33#define EPROTO 61 /* Protocol error */
34
35#define EMULTIHOP 64 /* Multihop attempted */
36
37#define EDOTDOT 66 /* RFS specific error */
38#define EBADMSG 67 /* Not a data message */
39#define EUSERS 68 /* Too many users */
40#define EDQUOT 69 /* Quota exceeded */
41#define ESTALE 70 /* Stale file handle */
42#define EREMOTE 71 /* Object is remote */
43#define EOVERFLOW 72 /* Value too large for defined data type */
44
45/* these errnos are defined by Linux but not HPUX. */
46
47#define EBADE 160 /* Invalid exchange */
48#define EBADR 161 /* Invalid request descriptor */
49#define EXFULL 162 /* Exchange full */
50#define ENOANO 163 /* No anode */
51#define EBADRQC 164 /* Invalid request code */
52#define EBADSLT 165 /* Invalid slot */
53#define EBFONT 166 /* Bad font file format */
54#define ENOTUNIQ 167 /* Name not unique on network */
55#define EBADFD 168 /* File descriptor in bad state */
56#define EREMCHG 169 /* Remote address changed */
57#define ELIBACC 170 /* Can not access a needed shared library */
58#define ELIBBAD 171 /* Accessing a corrupted shared library */
59#define ELIBSCN 172 /* .lib section in a.out corrupted */
60#define ELIBMAX 173 /* Attempting to link in too many shared libraries */
61#define ELIBEXEC 174 /* Cannot exec a shared library directly */
62#define ERESTART 175 /* Interrupted system call should be restarted */
63#define ESTRPIPE 176 /* Streams pipe error */
64#define EUCLEAN 177 /* Structure needs cleaning */
65#define ENOTNAM 178 /* Not a XENIX named type file */
66#define ENAVAIL 179 /* No XENIX semaphores available */
67#define EISNAM 180 /* Is a named type file */
68#define EREMOTEIO 181 /* Remote I/O error */
69#define ENOMEDIUM 182 /* No medium found */
70#define EMEDIUMTYPE 183 /* Wrong medium type */
71#define ENOKEY 184 /* Required key not available */
72#define EKEYEXPIRED 185 /* Key has expired */
73#define EKEYREVOKED 186 /* Key has been revoked */
74#define EKEYREJECTED 187 /* Key was rejected by service */
75
76/* We now return you to your regularly scheduled HPUX. */
77
78#define ENOSYM 215 /* symbol does not exist in executable */
79#define ENOTSOCK 216 /* Socket operation on non-socket */
80#define EDESTADDRREQ 217 /* Destination address required */
81#define EMSGSIZE 218 /* Message too long */
82#define EPROTOTYPE 219 /* Protocol wrong type for socket */
83#define ENOPROTOOPT 220 /* Protocol not available */
84#define EPROTONOSUPPORT 221 /* Protocol not supported */
85#define ESOCKTNOSUPPORT 222 /* Socket type not supported */
86#define EOPNOTSUPP 223 /* Operation not supported on transport endpoint */
87#define EPFNOSUPPORT 224 /* Protocol family not supported */
88#define EAFNOSUPPORT 225 /* Address family not supported by protocol */
89#define EADDRINUSE 226 /* Address already in use */
90#define EADDRNOTAVAIL 227 /* Cannot assign requested address */
91#define ENETDOWN 228 /* Network is down */
92#define ENETUNREACH 229 /* Network is unreachable */
93#define ENETRESET 230 /* Network dropped connection because of reset */
94#define ECONNABORTED 231 /* Software caused connection abort */
95#define ECONNRESET 232 /* Connection reset by peer */
96#define ENOBUFS 233 /* No buffer space available */
97#define EISCONN 234 /* Transport endpoint is already connected */
98#define ENOTCONN 235 /* Transport endpoint is not connected */
99#define ESHUTDOWN 236 /* Cannot send after transport endpoint shutdown */
100#define ETOOMANYREFS 237 /* Too many references: cannot splice */
101#define ETIMEDOUT 238 /* Connection timed out */
102#define ECONNREFUSED 239 /* Connection refused */
103#define EREFUSED ECONNREFUSED /* for HP's NFS apparently */
104#define EREMOTERELEASE 240 /* Remote peer released connection */
105#define EHOSTDOWN 241 /* Host is down */
106#define EHOSTUNREACH 242 /* No route to host */
107
108#define EALREADY 244 /* Operation already in progress */
109#define EINPROGRESS 245 /* Operation now in progress */
110#define EWOULDBLOCK EAGAIN /* Operation would block (Not HPUX compliant) */
111#define ENOTEMPTY 247 /* Directory not empty */
112#define ENAMETOOLONG 248 /* File name too long */
113#define ELOOP 249 /* Too many symbolic links encountered */
114#define ENOSYS 251 /* Function not implemented */
115
116#define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */
117#define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */
118#define ECANCELED ECANCELLED /* SuSv3 and Solaris wants one 'L' */
119
120/* for robust mutexes */
121#define EOWNERDEAD 254 /* Owner died */
122#define ENOTRECOVERABLE 255 /* State not recoverable */
123
124#define ERFKILL 256 /* Operation not possible due to RF-kill */
125
126#define EHWPOISON 257 /* Memory page has hardware error */
127
128#endif
diff --git a/tools/arch/powerpc/include/uapi/asm/errno.h b/tools/arch/powerpc/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..cc79856896a1
--- /dev/null
+++ b/tools/arch/powerpc/include/uapi/asm/errno.h
@@ -0,0 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_POWERPC_ERRNO_H
3#define _ASM_POWERPC_ERRNO_H
4
5#include <asm-generic/errno.h>
6
7#undef EDEADLOCK
8#define EDEADLOCK 58 /* File locking deadlock error */
9
10#endif /* _ASM_POWERPC_ERRNO_H */
diff --git a/tools/arch/powerpc/include/uapi/asm/kvm.h b/tools/arch/powerpc/include/uapi/asm/kvm.h
index 61d6049f4c1e..637b7263cb86 100644
--- a/tools/arch/powerpc/include/uapi/asm/kvm.h
+++ b/tools/arch/powerpc/include/uapi/asm/kvm.h
@@ -443,6 +443,31 @@ struct kvm_ppc_rmmu_info {
443 __u32 ap_encodings[8]; 443 __u32 ap_encodings[8];
444}; 444};
445 445
446/* For KVM_PPC_GET_CPU_CHAR */
447struct kvm_ppc_cpu_char {
448 __u64 character; /* characteristics of the CPU */
449 __u64 behaviour; /* recommended software behaviour */
450 __u64 character_mask; /* valid bits in character */
451 __u64 behaviour_mask; /* valid bits in behaviour */
452};
453
454/*
455 * Values for character and character_mask.
456 * These are identical to the values used by H_GET_CPU_CHARACTERISTICS.
457 */
458#define KVM_PPC_CPU_CHAR_SPEC_BAR_ORI31 (1ULL << 63)
459#define KVM_PPC_CPU_CHAR_BCCTRL_SERIALISED (1ULL << 62)
460#define KVM_PPC_CPU_CHAR_L1D_FLUSH_ORI30 (1ULL << 61)
461#define KVM_PPC_CPU_CHAR_L1D_FLUSH_TRIG2 (1ULL << 60)
462#define KVM_PPC_CPU_CHAR_L1D_THREAD_PRIV (1ULL << 59)
463#define KVM_PPC_CPU_CHAR_BR_HINT_HONOURED (1ULL << 58)
464#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)
465#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)
466
467#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)
468#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)
469#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)
470
446/* Per-vcpu XICS interrupt controller state */ 471/* Per-vcpu XICS interrupt controller state */
447#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c) 472#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
448 473
diff --git a/tools/arch/s390/include/uapi/asm/kvm.h b/tools/arch/s390/include/uapi/asm/kvm.h
index 38535a57fef8..4cdaa55fabfe 100644
--- a/tools/arch/s390/include/uapi/asm/kvm.h
+++ b/tools/arch/s390/include/uapi/asm/kvm.h
@@ -224,6 +224,7 @@ struct kvm_guest_debug_arch {
224#define KVM_SYNC_RICCB (1UL << 7) 224#define KVM_SYNC_RICCB (1UL << 7)
225#define KVM_SYNC_FPRS (1UL << 8) 225#define KVM_SYNC_FPRS (1UL << 8)
226#define KVM_SYNC_GSCB (1UL << 9) 226#define KVM_SYNC_GSCB (1UL << 9)
227#define KVM_SYNC_BPBC (1UL << 10)
227/* length and alignment of the sdnx as a power of two */ 228/* length and alignment of the sdnx as a power of two */
228#define SDNXC 8 229#define SDNXC 8
229#define SDNXL (1UL << SDNXC) 230#define SDNXL (1UL << SDNXC)
@@ -247,7 +248,9 @@ struct kvm_sync_regs {
247 }; 248 };
248 __u8 reserved[512]; /* for future vector expansion */ 249 __u8 reserved[512]; /* for future vector expansion */
249 __u32 fpc; /* valid on KVM_SYNC_VRS or KVM_SYNC_FPRS */ 250 __u32 fpc; /* valid on KVM_SYNC_VRS or KVM_SYNC_FPRS */
250 __u8 padding1[52]; /* riccb needs to be 64byte aligned */ 251 __u8 bpbc : 1; /* bp mode */
252 __u8 reserved2 : 7;
253 __u8 padding1[51]; /* riccb needs to be 64byte aligned */
251 __u8 riccb[64]; /* runtime instrumentation controls block */ 254 __u8 riccb[64]; /* runtime instrumentation controls block */
252 __u8 padding2[192]; /* sdnx needs to be 256byte aligned */ 255 __u8 padding2[192]; /* sdnx needs to be 256byte aligned */
253 union { 256 union {
diff --git a/tools/arch/s390/include/uapi/asm/unistd.h b/tools/arch/s390/include/uapi/asm/unistd.h
new file mode 100644
index 000000000000..725120939051
--- /dev/null
+++ b/tools/arch/s390/include/uapi/asm/unistd.h
@@ -0,0 +1,412 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S390 version
4 *
5 * Derived from "include/asm-i386/unistd.h"
6 */
7
8#ifndef _UAPI_ASM_S390_UNISTD_H_
9#define _UAPI_ASM_S390_UNISTD_H_
10
11/*
12 * This file contains the system call numbers.
13 */
14
15#define __NR_exit 1
16#define __NR_fork 2
17#define __NR_read 3
18#define __NR_write 4
19#define __NR_open 5
20#define __NR_close 6
21#define __NR_restart_syscall 7
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_mknod 14
28#define __NR_chmod 15
29#define __NR_lseek 19
30#define __NR_getpid 20
31#define __NR_mount 21
32#define __NR_umount 22
33#define __NR_ptrace 26
34#define __NR_alarm 27
35#define __NR_pause 29
36#define __NR_utime 30
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_sync 36
40#define __NR_kill 37
41#define __NR_rename 38
42#define __NR_mkdir 39
43#define __NR_rmdir 40
44#define __NR_dup 41
45#define __NR_pipe 42
46#define __NR_times 43
47#define __NR_brk 45
48#define __NR_signal 48
49#define __NR_acct 51
50#define __NR_umount2 52
51#define __NR_ioctl 54
52#define __NR_fcntl 55
53#define __NR_setpgid 57
54#define __NR_umask 60
55#define __NR_chroot 61
56#define __NR_ustat 62
57#define __NR_dup2 63
58#define __NR_getppid 64
59#define __NR_getpgrp 65
60#define __NR_setsid 66
61#define __NR_sigaction 67
62#define __NR_sigsuspend 72
63#define __NR_sigpending 73
64#define __NR_sethostname 74
65#define __NR_setrlimit 75
66#define __NR_getrusage 77
67#define __NR_gettimeofday 78
68#define __NR_settimeofday 79
69#define __NR_symlink 83
70#define __NR_readlink 85
71#define __NR_uselib 86
72#define __NR_swapon 87
73#define __NR_reboot 88
74#define __NR_readdir 89
75#define __NR_mmap 90
76#define __NR_munmap 91
77#define __NR_truncate 92
78#define __NR_ftruncate 93
79#define __NR_fchmod 94
80#define __NR_getpriority 96
81#define __NR_setpriority 97
82#define __NR_statfs 99
83#define __NR_fstatfs 100
84#define __NR_socketcall 102
85#define __NR_syslog 103
86#define __NR_setitimer 104
87#define __NR_getitimer 105
88#define __NR_stat 106
89#define __NR_lstat 107
90#define __NR_fstat 108
91#define __NR_lookup_dcookie 110
92#define __NR_vhangup 111
93#define __NR_idle 112
94#define __NR_wait4 114
95#define __NR_swapoff 115
96#define __NR_sysinfo 116
97#define __NR_ipc 117
98#define __NR_fsync 118
99#define __NR_sigreturn 119
100#define __NR_clone 120
101#define __NR_setdomainname 121
102#define __NR_uname 122
103#define __NR_adjtimex 124
104#define __NR_mprotect 125
105#define __NR_sigprocmask 126
106#define __NR_create_module 127
107#define __NR_init_module 128
108#define __NR_delete_module 129
109#define __NR_get_kernel_syms 130
110#define __NR_quotactl 131
111#define __NR_getpgid 132
112#define __NR_fchdir 133
113#define __NR_bdflush 134
114#define __NR_sysfs 135
115#define __NR_personality 136
116#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
117#define __NR_getdents 141
118#define __NR_flock 143
119#define __NR_msync 144
120#define __NR_readv 145
121#define __NR_writev 146
122#define __NR_getsid 147
123#define __NR_fdatasync 148
124#define __NR__sysctl 149
125#define __NR_mlock 150
126#define __NR_munlock 151
127#define __NR_mlockall 152
128#define __NR_munlockall 153
129#define __NR_sched_setparam 154
130#define __NR_sched_getparam 155
131#define __NR_sched_setscheduler 156
132#define __NR_sched_getscheduler 157
133#define __NR_sched_yield 158
134#define __NR_sched_get_priority_max 159
135#define __NR_sched_get_priority_min 160
136#define __NR_sched_rr_get_interval 161
137#define __NR_nanosleep 162
138#define __NR_mremap 163
139#define __NR_query_module 167
140#define __NR_poll 168
141#define __NR_nfsservctl 169
142#define __NR_prctl 172
143#define __NR_rt_sigreturn 173
144#define __NR_rt_sigaction 174
145#define __NR_rt_sigprocmask 175
146#define __NR_rt_sigpending 176
147#define __NR_rt_sigtimedwait 177
148#define __NR_rt_sigqueueinfo 178
149#define __NR_rt_sigsuspend 179
150#define __NR_pread64 180
151#define __NR_pwrite64 181
152#define __NR_getcwd 183
153#define __NR_capget 184
154#define __NR_capset 185
155#define __NR_sigaltstack 186
156#define __NR_sendfile 187
157#define __NR_getpmsg 188
158#define __NR_putpmsg 189
159#define __NR_vfork 190
160#define __NR_pivot_root 217
161#define __NR_mincore 218
162#define __NR_madvise 219
163#define __NR_getdents64 220
164#define __NR_readahead 222
165#define __NR_setxattr 224
166#define __NR_lsetxattr 225
167#define __NR_fsetxattr 226
168#define __NR_getxattr 227
169#define __NR_lgetxattr 228
170#define __NR_fgetxattr 229
171#define __NR_listxattr 230
172#define __NR_llistxattr 231
173#define __NR_flistxattr 232
174#define __NR_removexattr 233
175#define __NR_lremovexattr 234
176#define __NR_fremovexattr 235
177#define __NR_gettid 236
178#define __NR_tkill 237
179#define __NR_futex 238
180#define __NR_sched_setaffinity 239
181#define __NR_sched_getaffinity 240
182#define __NR_tgkill 241
183/* Number 242 is reserved for tux */
184#define __NR_io_setup 243
185#define __NR_io_destroy 244
186#define __NR_io_getevents 245
187#define __NR_io_submit 246
188#define __NR_io_cancel 247
189#define __NR_exit_group 248
190#define __NR_epoll_create 249
191#define __NR_epoll_ctl 250
192#define __NR_epoll_wait 251
193#define __NR_set_tid_address 252
194#define __NR_fadvise64 253
195#define __NR_timer_create 254
196#define __NR_timer_settime 255
197#define __NR_timer_gettime 256
198#define __NR_timer_getoverrun 257
199#define __NR_timer_delete 258
200#define __NR_clock_settime 259
201#define __NR_clock_gettime 260
202#define __NR_clock_getres 261
203#define __NR_clock_nanosleep 262
204/* Number 263 is reserved for vserver */
205#define __NR_statfs64 265
206#define __NR_fstatfs64 266
207#define __NR_remap_file_pages 267
208#define __NR_mbind 268
209#define __NR_get_mempolicy 269
210#define __NR_set_mempolicy 270
211#define __NR_mq_open 271
212#define __NR_mq_unlink 272
213#define __NR_mq_timedsend 273
214#define __NR_mq_timedreceive 274
215#define __NR_mq_notify 275
216#define __NR_mq_getsetattr 276
217#define __NR_kexec_load 277
218#define __NR_add_key 278
219#define __NR_request_key 279
220#define __NR_keyctl 280
221#define __NR_waitid 281
222#define __NR_ioprio_set 282
223#define __NR_ioprio_get 283
224#define __NR_inotify_init 284
225#define __NR_inotify_add_watch 285
226#define __NR_inotify_rm_watch 286
227#define __NR_migrate_pages 287
228#define __NR_openat 288
229#define __NR_mkdirat 289
230#define __NR_mknodat 290
231#define __NR_fchownat 291
232#define __NR_futimesat 292
233#define __NR_unlinkat 294
234#define __NR_renameat 295
235#define __NR_linkat 296
236#define __NR_symlinkat 297
237#define __NR_readlinkat 298
238#define __NR_fchmodat 299
239#define __NR_faccessat 300
240#define __NR_pselect6 301
241#define __NR_ppoll 302
242#define __NR_unshare 303
243#define __NR_set_robust_list 304
244#define __NR_get_robust_list 305
245#define __NR_splice 306
246#define __NR_sync_file_range 307
247#define __NR_tee 308
248#define __NR_vmsplice 309
249#define __NR_move_pages 310
250#define __NR_getcpu 311
251#define __NR_epoll_pwait 312
252#define __NR_utimes 313
253#define __NR_fallocate 314
254#define __NR_utimensat 315
255#define __NR_signalfd 316
256#define __NR_timerfd 317
257#define __NR_eventfd 318
258#define __NR_timerfd_create 319
259#define __NR_timerfd_settime 320
260#define __NR_timerfd_gettime 321
261#define __NR_signalfd4 322
262#define __NR_eventfd2 323
263#define __NR_inotify_init1 324
264#define __NR_pipe2 325
265#define __NR_dup3 326
266#define __NR_epoll_create1 327
267#define __NR_preadv 328
268#define __NR_pwritev 329
269#define __NR_rt_tgsigqueueinfo 330
270#define __NR_perf_event_open 331
271#define __NR_fanotify_init 332
272#define __NR_fanotify_mark 333
273#define __NR_prlimit64 334
274#define __NR_name_to_handle_at 335
275#define __NR_open_by_handle_at 336
276#define __NR_clock_adjtime 337
277#define __NR_syncfs 338
278#define __NR_setns 339
279#define __NR_process_vm_readv 340
280#define __NR_process_vm_writev 341
281#define __NR_s390_runtime_instr 342
282#define __NR_kcmp 343
283#define __NR_finit_module 344
284#define __NR_sched_setattr 345
285#define __NR_sched_getattr 346
286#define __NR_renameat2 347
287#define __NR_seccomp 348
288#define __NR_getrandom 349
289#define __NR_memfd_create 350
290#define __NR_bpf 351
291#define __NR_s390_pci_mmio_write 352
292#define __NR_s390_pci_mmio_read 353
293#define __NR_execveat 354
294#define __NR_userfaultfd 355
295#define __NR_membarrier 356
296#define __NR_recvmmsg 357
297#define __NR_sendmmsg 358
298#define __NR_socket 359
299#define __NR_socketpair 360
300#define __NR_bind 361
301#define __NR_connect 362
302#define __NR_listen 363
303#define __NR_accept4 364
304#define __NR_getsockopt 365
305#define __NR_setsockopt 366
306#define __NR_getsockname 367
307#define __NR_getpeername 368
308#define __NR_sendto 369
309#define __NR_sendmsg 370
310#define __NR_recvfrom 371
311#define __NR_recvmsg 372
312#define __NR_shutdown 373
313#define __NR_mlock2 374
314#define __NR_copy_file_range 375
315#define __NR_preadv2 376
316#define __NR_pwritev2 377
317#define __NR_s390_guarded_storage 378
318#define __NR_statx 379
319#define __NR_s390_sthyi 380
320#define NR_syscalls 381
321
322/*
323 * There are some system calls that are not present on 64 bit, some
324 * have a different name although they do the same (e.g. __NR_chown32
325 * is __NR_chown on 64 bit).
326 */
327#ifndef __s390x__
328
329#define __NR_time 13
330#define __NR_lchown 16
331#define __NR_setuid 23
332#define __NR_getuid 24
333#define __NR_stime 25
334#define __NR_setgid 46
335#define __NR_getgid 47
336#define __NR_geteuid 49
337#define __NR_getegid 50
338#define __NR_setreuid 70
339#define __NR_setregid 71
340#define __NR_getrlimit 76
341#define __NR_getgroups 80
342#define __NR_setgroups 81
343#define __NR_fchown 95
344#define __NR_ioperm 101
345#define __NR_setfsuid 138
346#define __NR_setfsgid 139
347#define __NR__llseek 140
348#define __NR__newselect 142
349#define __NR_setresuid 164
350#define __NR_getresuid 165
351#define __NR_setresgid 170
352#define __NR_getresgid 171
353#define __NR_chown 182
354#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
355#define __NR_mmap2 192
356#define __NR_truncate64 193
357#define __NR_ftruncate64 194
358#define __NR_stat64 195
359#define __NR_lstat64 196
360#define __NR_fstat64 197
361#define __NR_lchown32 198
362#define __NR_getuid32 199
363#define __NR_getgid32 200
364#define __NR_geteuid32 201
365#define __NR_getegid32 202
366#define __NR_setreuid32 203
367#define __NR_setregid32 204
368#define __NR_getgroups32 205
369#define __NR_setgroups32 206
370#define __NR_fchown32 207
371#define __NR_setresuid32 208
372#define __NR_getresuid32 209
373#define __NR_setresgid32 210
374#define __NR_getresgid32 211
375#define __NR_chown32 212
376#define __NR_setuid32 213
377#define __NR_setgid32 214
378#define __NR_setfsuid32 215
379#define __NR_setfsgid32 216
380#define __NR_fcntl64 221
381#define __NR_sendfile64 223
382#define __NR_fadvise64_64 264
383#define __NR_fstatat64 293
384
385#else
386
387#define __NR_select 142
388#define __NR_getrlimit 191 /* SuS compliant getrlimit */
389#define __NR_lchown 198
390#define __NR_getuid 199
391#define __NR_getgid 200
392#define __NR_geteuid 201
393#define __NR_getegid 202
394#define __NR_setreuid 203
395#define __NR_setregid 204
396#define __NR_getgroups 205
397#define __NR_setgroups 206
398#define __NR_fchown 207
399#define __NR_setresuid 208
400#define __NR_getresuid 209
401#define __NR_setresgid 210
402#define __NR_getresgid 211
403#define __NR_chown 212
404#define __NR_setuid 213
405#define __NR_setgid 214
406#define __NR_setfsuid 215
407#define __NR_setfsgid 216
408#define __NR_newfstatat 293
409
410#endif
411
412#endif /* _UAPI_ASM_S390_UNISTD_H_ */
diff --git a/tools/arch/sparc/include/uapi/asm/errno.h b/tools/arch/sparc/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..81a732b902ee
--- /dev/null
+++ b/tools/arch/sparc/include/uapi/asm/errno.h
@@ -0,0 +1,118 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _SPARC_ERRNO_H
3#define _SPARC_ERRNO_H
4
5/* These match the SunOS error numbering scheme. */
6
7#include <asm-generic/errno-base.h>
8
9#define EWOULDBLOCK EAGAIN /* Operation would block */
10#define EINPROGRESS 36 /* Operation now in progress */
11#define EALREADY 37 /* Operation already in progress */
12#define ENOTSOCK 38 /* Socket operation on non-socket */
13#define EDESTADDRREQ 39 /* Destination address required */
14#define EMSGSIZE 40 /* Message too long */
15#define EPROTOTYPE 41 /* Protocol wrong type for socket */
16#define ENOPROTOOPT 42 /* Protocol not available */
17#define EPROTONOSUPPORT 43 /* Protocol not supported */
18#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
19#define EOPNOTSUPP 45 /* Op not supported on transport endpoint */
20#define EPFNOSUPPORT 46 /* Protocol family not supported */
21#define EAFNOSUPPORT 47 /* Address family not supported by protocol */
22#define EADDRINUSE 48 /* Address already in use */
23#define EADDRNOTAVAIL 49 /* Cannot assign requested address */
24#define ENETDOWN 50 /* Network is down */
25#define ENETUNREACH 51 /* Network is unreachable */
26#define ENETRESET 52 /* Net dropped connection because of reset */
27#define ECONNABORTED 53 /* Software caused connection abort */
28#define ECONNRESET 54 /* Connection reset by peer */
29#define ENOBUFS 55 /* No buffer space available */
30#define EISCONN 56 /* Transport endpoint is already connected */
31#define ENOTCONN 57 /* Transport endpoint is not connected */
32#define ESHUTDOWN 58 /* No send after transport endpoint shutdown */
33#define ETOOMANYREFS 59 /* Too many references: cannot splice */
34#define ETIMEDOUT 60 /* Connection timed out */
35#define ECONNREFUSED 61 /* Connection refused */
36#define ELOOP 62 /* Too many symbolic links encountered */
37#define ENAMETOOLONG 63 /* File name too long */
38#define EHOSTDOWN 64 /* Host is down */
39#define EHOSTUNREACH 65 /* No route to host */
40#define ENOTEMPTY 66 /* Directory not empty */
41#define EPROCLIM 67 /* SUNOS: Too many processes */
42#define EUSERS 68 /* Too many users */
43#define EDQUOT 69 /* Quota exceeded */
44#define ESTALE 70 /* Stale file handle */
45#define EREMOTE 71 /* Object is remote */
46#define ENOSTR 72 /* Device not a stream */
47#define ETIME 73 /* Timer expired */
48#define ENOSR 74 /* Out of streams resources */
49#define ENOMSG 75 /* No message of desired type */
50#define EBADMSG 76 /* Not a data message */
51#define EIDRM 77 /* Identifier removed */
52#define EDEADLK 78 /* Resource deadlock would occur */
53#define ENOLCK 79 /* No record locks available */
54#define ENONET 80 /* Machine is not on the network */
55#define ERREMOTE 81 /* SunOS: Too many lvls of remote in path */
56#define ENOLINK 82 /* Link has been severed */
57#define EADV 83 /* Advertise error */
58#define ESRMNT 84 /* Srmount error */
59#define ECOMM 85 /* Communication error on send */
60#define EPROTO 86 /* Protocol error */
61#define EMULTIHOP 87 /* Multihop attempted */
62#define EDOTDOT 88 /* RFS specific error */
63#define EREMCHG 89 /* Remote address changed */
64#define ENOSYS 90 /* Function not implemented */
65
66/* The rest have no SunOS equivalent. */
67#define ESTRPIPE 91 /* Streams pipe error */
68#define EOVERFLOW 92 /* Value too large for defined data type */
69#define EBADFD 93 /* File descriptor in bad state */
70#define ECHRNG 94 /* Channel number out of range */
71#define EL2NSYNC 95 /* Level 2 not synchronized */
72#define EL3HLT 96 /* Level 3 halted */
73#define EL3RST 97 /* Level 3 reset */
74#define ELNRNG 98 /* Link number out of range */
75#define EUNATCH 99 /* Protocol driver not attached */
76#define ENOCSI 100 /* No CSI structure available */
77#define EL2HLT 101 /* Level 2 halted */
78#define EBADE 102 /* Invalid exchange */
79#define EBADR 103 /* Invalid request descriptor */
80#define EXFULL 104 /* Exchange full */
81#define ENOANO 105 /* No anode */
82#define EBADRQC 106 /* Invalid request code */
83#define EBADSLT 107 /* Invalid slot */
84#define EDEADLOCK 108 /* File locking deadlock error */
85#define EBFONT 109 /* Bad font file format */
86#define ELIBEXEC 110 /* Cannot exec a shared library directly */
87#define ENODATA 111 /* No data available */
88#define ELIBBAD 112 /* Accessing a corrupted shared library */
89#define ENOPKG 113 /* Package not installed */
90#define ELIBACC 114 /* Can not access a needed shared library */
91#define ENOTUNIQ 115 /* Name not unique on network */
92#define ERESTART 116 /* Interrupted syscall should be restarted */
93#define EUCLEAN 117 /* Structure needs cleaning */
94#define ENOTNAM 118 /* Not a XENIX named type file */
95#define ENAVAIL 119 /* No XENIX semaphores available */
96#define EISNAM 120 /* Is a named type file */
97#define EREMOTEIO 121 /* Remote I/O error */
98#define EILSEQ 122 /* Illegal byte sequence */
99#define ELIBMAX 123 /* Atmpt to link in too many shared libs */
100#define ELIBSCN 124 /* .lib section in a.out corrupted */
101
102#define ENOMEDIUM 125 /* No medium found */
103#define EMEDIUMTYPE 126 /* Wrong medium type */
104#define ECANCELED 127 /* Operation Cancelled */
105#define ENOKEY 128 /* Required key not available */
106#define EKEYEXPIRED 129 /* Key has expired */
107#define EKEYREVOKED 130 /* Key has been revoked */
108#define EKEYREJECTED 131 /* Key was rejected by service */
109
110/* for robust mutexes */
111#define EOWNERDEAD 132 /* Owner died */
112#define ENOTRECOVERABLE 133 /* State not recoverable */
113
114#define ERFKILL 134 /* Operation not possible due to RF-kill */
115
116#define EHWPOISON 135 /* Memory page has hardware error */
117
118#endif
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index 800104c8a3ed..1d9199e1c2ad 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -13,7 +13,7 @@
13/* 13/*
14 * Defines x86 CPU feature bits 14 * Defines x86 CPU feature bits
15 */ 15 */
16#define NCAPINTS 18 /* N 32-bit words worth of info */ 16#define NCAPINTS 19 /* N 32-bit words worth of info */
17#define NBUGINTS 1 /* N 32-bit bug flags */ 17#define NBUGINTS 1 /* N 32-bit bug flags */
18 18
19/* 19/*
@@ -197,17 +197,21 @@
197#define X86_FEATURE_CAT_L3 ( 7*32+ 4) /* Cache Allocation Technology L3 */ 197#define X86_FEATURE_CAT_L3 ( 7*32+ 4) /* Cache Allocation Technology L3 */
198#define X86_FEATURE_CAT_L2 ( 7*32+ 5) /* Cache Allocation Technology L2 */ 198#define X86_FEATURE_CAT_L2 ( 7*32+ 5) /* Cache Allocation Technology L2 */
199#define X86_FEATURE_CDP_L3 ( 7*32+ 6) /* Code and Data Prioritization L3 */ 199#define X86_FEATURE_CDP_L3 ( 7*32+ 6) /* Code and Data Prioritization L3 */
200#define X86_FEATURE_INVPCID_SINGLE ( 7*32+ 7) /* Effectively INVPCID && CR4.PCIDE=1 */
200 201
201#define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */ 202#define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
202#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */ 203#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
203#define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */ 204#define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */
204 205#define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */
206#define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
207#define X86_FEATURE_RETPOLINE_AMD ( 7*32+13) /* "" AMD Retpoline mitigation for Spectre variant 2 */
205#define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ 208#define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */
206#define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */ 209#define X86_FEATURE_CDP_L2 ( 7*32+15) /* Code and Data Prioritization L2 */
207#define X86_FEATURE_AVX512_4VNNIW ( 7*32+16) /* AVX-512 Neural Network Instructions */
208#define X86_FEATURE_AVX512_4FMAPS ( 7*32+17) /* AVX-512 Multiply Accumulation Single precision */
209 210
210#define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */ 211#define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */
212#define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* "" Fill RSB on context switches */
213
214#define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
211 215
212/* Virtualization flags: Linux defined, word 8 */ 216/* Virtualization flags: Linux defined, word 8 */
213#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */ 217#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */
@@ -242,6 +246,7 @@
242#define X86_FEATURE_AVX512IFMA ( 9*32+21) /* AVX-512 Integer Fused Multiply-Add instructions */ 246#define X86_FEATURE_AVX512IFMA ( 9*32+21) /* AVX-512 Integer Fused Multiply-Add instructions */
243#define X86_FEATURE_CLFLUSHOPT ( 9*32+23) /* CLFLUSHOPT instruction */ 247#define X86_FEATURE_CLFLUSHOPT ( 9*32+23) /* CLFLUSHOPT instruction */
244#define X86_FEATURE_CLWB ( 9*32+24) /* CLWB instruction */ 248#define X86_FEATURE_CLWB ( 9*32+24) /* CLWB instruction */
249#define X86_FEATURE_INTEL_PT ( 9*32+25) /* Intel Processor Trace */
245#define X86_FEATURE_AVX512PF ( 9*32+26) /* AVX-512 Prefetch */ 250#define X86_FEATURE_AVX512PF ( 9*32+26) /* AVX-512 Prefetch */
246#define X86_FEATURE_AVX512ER ( 9*32+27) /* AVX-512 Exponential and Reciprocal */ 251#define X86_FEATURE_AVX512ER ( 9*32+27) /* AVX-512 Exponential and Reciprocal */
247#define X86_FEATURE_AVX512CD ( 9*32+28) /* AVX-512 Conflict Detection */ 252#define X86_FEATURE_AVX512CD ( 9*32+28) /* AVX-512 Conflict Detection */
@@ -267,6 +272,9 @@
267#define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */ 272#define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */
268#define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */ 273#define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */
269#define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */ 274#define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */
275#define X86_FEATURE_IBPB (13*32+12) /* Indirect Branch Prediction Barrier */
276#define X86_FEATURE_IBRS (13*32+14) /* Indirect Branch Restricted Speculation */
277#define X86_FEATURE_STIBP (13*32+15) /* Single Thread Indirect Branch Predictors */
270 278
271/* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ 279/* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
272#define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ 280#define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */
@@ -315,6 +323,13 @@
315#define X86_FEATURE_SUCCOR (17*32+ 1) /* Uncorrectable error containment and recovery */ 323#define X86_FEATURE_SUCCOR (17*32+ 1) /* Uncorrectable error containment and recovery */
316#define X86_FEATURE_SMCA (17*32+ 3) /* Scalable MCA */ 324#define X86_FEATURE_SMCA (17*32+ 3) /* Scalable MCA */
317 325
326/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
327#define X86_FEATURE_AVX512_4VNNIW (18*32+ 2) /* AVX-512 Neural Network Instructions */
328#define X86_FEATURE_AVX512_4FMAPS (18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
329#define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */
330#define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */
331#define X86_FEATURE_ARCH_CAPABILITIES (18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */
332
318/* 333/*
319 * BUG word(s) 334 * BUG word(s)
320 */ 335 */
@@ -340,5 +355,8 @@
340#define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */ 355#define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */
341#define X86_BUG_MONITOR X86_BUG(12) /* IPI required to wake up remote CPU */ 356#define X86_BUG_MONITOR X86_BUG(12) /* IPI required to wake up remote CPU */
342#define X86_BUG_AMD_E400 X86_BUG(13) /* CPU is among the affected by Erratum 400 */ 357#define X86_BUG_AMD_E400 X86_BUG(13) /* CPU is among the affected by Erratum 400 */
358#define X86_BUG_CPU_MELTDOWN X86_BUG(14) /* CPU is affected by meltdown attack and needs kernel page table isolation */
359#define X86_BUG_SPECTRE_V1 X86_BUG(15) /* CPU is affected by Spectre variant 1 attack with conditional branches */
360#define X86_BUG_SPECTRE_V2 X86_BUG(16) /* CPU is affected by Spectre variant 2 attack with indirect branches */
343 361
344#endif /* _ASM_X86_CPUFEATURES_H */ 362#endif /* _ASM_X86_CPUFEATURES_H */
diff --git a/tools/arch/x86/include/asm/disabled-features.h b/tools/arch/x86/include/asm/disabled-features.h
index 14d6d5007314..33833d1909af 100644
--- a/tools/arch/x86/include/asm/disabled-features.h
+++ b/tools/arch/x86/include/asm/disabled-features.h
@@ -50,6 +50,12 @@
50# define DISABLE_LA57 (1<<(X86_FEATURE_LA57 & 31)) 50# define DISABLE_LA57 (1<<(X86_FEATURE_LA57 & 31))
51#endif 51#endif
52 52
53#ifdef CONFIG_PAGE_TABLE_ISOLATION
54# define DISABLE_PTI 0
55#else
56# define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
57#endif
58
53/* 59/*
54 * Make sure to add features to the correct mask 60 * Make sure to add features to the correct mask
55 */ 61 */
@@ -60,7 +66,7 @@
60#define DISABLED_MASK4 (DISABLE_PCID) 66#define DISABLED_MASK4 (DISABLE_PCID)
61#define DISABLED_MASK5 0 67#define DISABLED_MASK5 0
62#define DISABLED_MASK6 0 68#define DISABLED_MASK6 0
63#define DISABLED_MASK7 0 69#define DISABLED_MASK7 (DISABLE_PTI)
64#define DISABLED_MASK8 0 70#define DISABLED_MASK8 0
65#define DISABLED_MASK9 (DISABLE_MPX) 71#define DISABLED_MASK9 (DISABLE_MPX)
66#define DISABLED_MASK10 0 72#define DISABLED_MASK10 0
@@ -71,6 +77,7 @@
71#define DISABLED_MASK15 0 77#define DISABLED_MASK15 0
72#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP) 78#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)
73#define DISABLED_MASK17 0 79#define DISABLED_MASK17 0
74#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18) 80#define DISABLED_MASK18 0
81#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
75 82
76#endif /* _ASM_X86_DISABLED_FEATURES_H */ 83#endif /* _ASM_X86_DISABLED_FEATURES_H */
diff --git a/tools/arch/x86/include/asm/required-features.h b/tools/arch/x86/include/asm/required-features.h
index d91ba04dd007..fb3a6de7440b 100644
--- a/tools/arch/x86/include/asm/required-features.h
+++ b/tools/arch/x86/include/asm/required-features.h
@@ -106,6 +106,7 @@
106#define REQUIRED_MASK15 0 106#define REQUIRED_MASK15 0
107#define REQUIRED_MASK16 (NEED_LA57) 107#define REQUIRED_MASK16 (NEED_LA57)
108#define REQUIRED_MASK17 0 108#define REQUIRED_MASK17 0
109#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18) 109#define REQUIRED_MASK18 0
110#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
110 111
111#endif /* _ASM_X86_REQUIRED_FEATURES_H */ 112#endif /* _ASM_X86_REQUIRED_FEATURES_H */
diff --git a/tools/arch/x86/include/uapi/asm/errno.h b/tools/arch/x86/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..4c82b503d92f
--- /dev/null
+++ b/tools/arch/x86/include/uapi/asm/errno.h
@@ -0,0 +1 @@
#include <asm-generic/errno.h>
diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
index 07a6697466ef..c8ec0ae16bf0 100644
--- a/tools/bpf/Makefile
+++ b/tools/bpf/Makefile
@@ -9,6 +9,35 @@ MAKE = make
9CFLAGS += -Wall -O2 9CFLAGS += -Wall -O2
10CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include 10CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
11 11
12ifeq ($(srctree),)
13srctree := $(patsubst %/,%,$(dir $(CURDIR)))
14srctree := $(patsubst %/,%,$(dir $(srctree)))
15endif
16
17FEATURE_USER = .bpf
18FEATURE_TESTS = libbfd disassembler-four-args
19FEATURE_DISPLAY = libbfd disassembler-four-args
20
21check_feat := 1
22NON_CHECK_FEAT_TARGETS := clean bpftool_clean
23ifdef MAKECMDGOALS
24ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
25 check_feat := 0
26endif
27endif
28
29ifeq ($(check_feat),1)
30ifeq ($(FEATURES_DUMP),)
31include $(srctree)/tools/build/Makefile.feature
32else
33include $(FEATURES_DUMP)
34endif
35endif
36
37ifeq ($(feature-disassembler-four-args), 1)
38CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
39endif
40
12%.yacc.c: %.y 41%.yacc.c: %.y
13 $(YACC) -o $@ -d $< 42 $(YACC) -o $@ -d $<
14 43
diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
index 75bf526a0168..58c2bab4ef6e 100644
--- a/tools/bpf/bpf_jit_disasm.c
+++ b/tools/bpf/bpf_jit_disasm.c
@@ -72,7 +72,14 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
72 72
73 disassemble_init_for_target(&info); 73 disassemble_init_for_target(&info);
74 74
75#ifdef DISASM_FOUR_ARGS_SIGNATURE
76 disassemble = disassembler(info.arch,
77 bfd_big_endian(bfdf),
78 info.mach,
79 bfdf);
80#else
75 disassemble = disassembler(bfdf); 81 disassemble = disassembler(bfdf);
82#endif
76 assert(disassemble); 83 assert(disassemble);
77 84
78 do { 85 do {
@@ -165,7 +172,8 @@ static uint8_t *get_last_jit_image(char *haystack, size_t hlen,
165{ 172{
166 char *ptr, *pptr, *tmp; 173 char *ptr, *pptr, *tmp;
167 off_t off = 0; 174 off_t off = 0;
168 int ret, flen, proglen, pass, ulen = 0; 175 unsigned int proglen;
176 int ret, flen, pass, ulen = 0;
169 regmatch_t pmatch[1]; 177 regmatch_t pmatch[1];
170 unsigned long base; 178 unsigned long base;
171 regex_t regex; 179 regex_t regex;
@@ -192,7 +200,7 @@ static uint8_t *get_last_jit_image(char *haystack, size_t hlen,
192 } 200 }
193 201
194 ptr = haystack + off - (pmatch[0].rm_eo - pmatch[0].rm_so); 202 ptr = haystack + off - (pmatch[0].rm_eo - pmatch[0].rm_so);
195 ret = sscanf(ptr, "flen=%d proglen=%d pass=%d image=%lx", 203 ret = sscanf(ptr, "flen=%d proglen=%u pass=%d image=%lx",
196 &flen, &proglen, &pass, &base); 204 &flen, &proglen, &pass, &base);
197 if (ret != 4) { 205 if (ret != 4) {
198 regfree(&regex); 206 regfree(&regex);
@@ -232,7 +240,7 @@ static uint8_t *get_last_jit_image(char *haystack, size_t hlen,
232 } 240 }
233 241
234 assert(ulen == proglen); 242 assert(ulen == proglen);
235 printf("%d bytes emitted from JIT compiler (pass:%d, flen:%d)\n", 243 printf("%u bytes emitted from JIT compiler (pass:%d, flen:%d)\n",
236 proglen, pass, flen); 244 proglen, pass, flen);
237 printf("%lx + <x>:\n", base); 245 printf("%lx + <x>:\n", base);
238 246
diff --git a/tools/bpf/bpftool/Documentation/Makefile b/tools/bpf/bpftool/Documentation/Makefile
index 37292bb5ce60..c462a928e03d 100644
--- a/tools/bpf/bpftool/Documentation/Makefile
+++ b/tools/bpf/bpftool/Documentation/Makefile
@@ -3,12 +3,16 @@ include ../../../scripts/utilities.mak
3 3
4INSTALL ?= install 4INSTALL ?= install
5RM ?= rm -f 5RM ?= rm -f
6RMDIR ?= rmdir --ignore-fail-on-non-empty
6 7
7# Make the path relative to DESTDIR, not prefix 8ifeq ($(V),1)
8ifndef DESTDIR 9 Q =
9prefix ?= /usr/local 10else
11 Q = @
10endif 12endif
11mandir ?= $(prefix)/share/man 13
14prefix ?= /usr/local
15mandir ?= $(prefix)/man
12man8dir = $(mandir)/man8 16man8dir = $(mandir)/man8
13 17
14MAN8_RST = $(wildcard *.rst) 18MAN8_RST = $(wildcard *.rst)
@@ -20,15 +24,21 @@ man: man8
20man8: $(DOC_MAN8) 24man8: $(DOC_MAN8)
21 25
22$(OUTPUT)%.8: %.rst 26$(OUTPUT)%.8: %.rst
23 rst2man $< > $@ 27 $(QUIET_GEN)rst2man $< > $@
24 28
25clean: 29clean:
26 $(call QUIET_CLEAN, Documentation) $(RM) $(DOC_MAN8) 30 $(call QUIET_CLEAN, Documentation)
31 $(Q)$(RM) $(DOC_MAN8)
27 32
28install: man 33install: man
29 $(call QUIET_INSTALL, Documentation-man) \ 34 $(call QUIET_INSTALL, Documentation-man)
30 $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir); \ 35 $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
31 $(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir); 36 $(Q)$(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir)
37
38uninstall:
39 $(call QUIET_UNINST, Documentation-man)
40 $(Q)$(RM) $(addprefix $(DESTDIR)$(man8dir)/,$(_DOC_MAN8))
41 $(Q)$(RMDIR) $(DESTDIR)$(man8dir)
32 42
33.PHONY: man man8 clean install 43.PHONY: man man8 clean install uninstall
34.DEFAULT_GOAL := man 44.DEFAULT_GOAL := man
diff --git a/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst b/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst
new file mode 100644
index 000000000000..2fe2a1bdbe3e
--- /dev/null
+++ b/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst
@@ -0,0 +1,118 @@
1================
2bpftool-cgroup
3================
4-------------------------------------------------------------------------------
5tool for inspection and simple manipulation of eBPF progs
6-------------------------------------------------------------------------------
7
8:Manual section: 8
9
10SYNOPSIS
11========
12
13 **bpftool** [*OPTIONS*] **cgroup** *COMMAND*
14
15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-f** | **--bpffs** } }
16
17 *COMMANDS* :=
18 { **show** | **list** | **attach** | **detach** | **help** }
19
20MAP COMMANDS
21=============
22
23| **bpftool** **cgroup { show | list }** *CGROUP*
24| **bpftool** **cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
25| **bpftool** **cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
26| **bpftool** **cgroup help**
27|
28| *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* }
29| *ATTACH_TYPE* := { *ingress* | *egress* | *sock_create* | *sock_ops* | *device* }
30| *ATTACH_FLAGS* := { *multi* | *override* }
31
32DESCRIPTION
33===========
34 **bpftool cgroup { show | list }** *CGROUP*
35 List all programs attached to the cgroup *CGROUP*.
36
37 Output will start with program ID followed by attach type,
38 attach flags and program name.
39
40 **bpftool cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
41 Attach program *PROG* to the cgroup *CGROUP* with attach type
42 *ATTACH_TYPE* and optional *ATTACH_FLAGS*.
43
44 *ATTACH_FLAGS* can be one of: **override** if a sub-cgroup installs
45 some bpf program, the program in this cgroup yields to sub-cgroup
46 program; **multi** if a sub-cgroup installs some bpf program,
47 that cgroup program gets run in addition to the program in this
48 cgroup.
49
50 Only one program is allowed to be attached to a cgroup with
51 no attach flags or the **override** flag. Attaching another
52 program will release old program and attach the new one.
53
54 Multiple programs are allowed to be attached to a cgroup with
55 **multi**. They are executed in FIFO order (those that were
56 attached first, run first).
57
58 Non-default *ATTACH_FLAGS* are supported by kernel version 4.14
59 and later.
60
61 *ATTACH_TYPE* can be on of:
62 **ingress** ingress path of the inet socket (since 4.10);
63 **egress** egress path of the inet socket (since 4.10);
64 **sock_create** opening of an inet socket (since 4.10);
65 **sock_ops** various socket operations (since 4.12);
66 **device** device access (since 4.15).
67
68 **bpftool cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
69 Detach *PROG* from the cgroup *CGROUP* and attach type
70 *ATTACH_TYPE*.
71
72 **bpftool prog help**
73 Print short help message.
74
75OPTIONS
76=======
77 -h, --help
78 Print short generic help message (similar to **bpftool help**).
79
80 -v, --version
81 Print version number (similar to **bpftool version**).
82
83 -j, --json
84 Generate JSON output. For commands that cannot produce JSON, this
85 option has no effect.
86
87 -p, --pretty
88 Generate human-readable JSON output. Implies **-j**.
89
90 -f, --bpffs
91 Show file names of pinned programs.
92
93EXAMPLES
94========
95|
96| **# mount -t bpf none /sys/fs/bpf/**
97| **# mkdir /sys/fs/cgroup/test.slice**
98| **# bpftool prog load ./device_cgroup.o /sys/fs/bpf/prog**
99| **# bpftool cgroup attach /sys/fs/cgroup/test.slice/ device id 1 allow_multi**
100
101**# bpftool cgroup list /sys/fs/cgroup/test.slice/**
102
103::
104
105 ID AttachType AttachFlags Name
106 1 device allow_multi bpf_prog1
107
108|
109| **# bpftool cgroup detach /sys/fs/cgroup/test.slice/ device id 1**
110| **# bpftool cgroup list /sys/fs/cgroup/test.slice/**
111
112::
113
114 ID AttachType AttachFlags Name
115
116SEE ALSO
117========
118 **bpftool**\ (8), **bpftool-prog**\ (8), **bpftool-map**\ (8)
diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst b/tools/bpf/bpftool/Documentation/bpftool-map.rst
index 9f51a268eb06..0ab32b312aec 100644
--- a/tools/bpf/bpftool/Documentation/bpftool-map.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst
@@ -15,13 +15,13 @@ SYNOPSIS
15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-f** | **--bpffs** } } 15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-f** | **--bpffs** } }
16 16
17 *COMMANDS* := 17 *COMMANDS* :=
18 { **show** | **dump** | **update** | **lookup** | **getnext** | **delete** 18 { **show** | **list** | **dump** | **update** | **lookup** | **getnext** | **delete**
19 | **pin** | **help** } 19 | **pin** | **help** }
20 20
21MAP COMMANDS 21MAP COMMANDS
22============= 22=============
23 23
24| **bpftool** **map show** [*MAP*] 24| **bpftool** **map { show | list }** [*MAP*]
25| **bpftool** **map dump** *MAP* 25| **bpftool** **map dump** *MAP*
26| **bpftool** **map update** *MAP* **key** *BYTES* **value** *VALUE* [*UPDATE_FLAGS*] 26| **bpftool** **map update** *MAP* **key** *BYTES* **value** *VALUE* [*UPDATE_FLAGS*]
27| **bpftool** **map lookup** *MAP* **key** *BYTES* 27| **bpftool** **map lookup** *MAP* **key** *BYTES*
@@ -36,7 +36,7 @@ MAP COMMANDS
36 36
37DESCRIPTION 37DESCRIPTION
38=========== 38===========
39 **bpftool map show** [*MAP*] 39 **bpftool map { show | list }** [*MAP*]
40 Show information about loaded maps. If *MAP* is specified 40 Show information about loaded maps. If *MAP* is specified
41 show information only about given map, otherwise list all 41 show information only about given map, otherwise list all
42 maps currently loaded on the system. 42 maps currently loaded on the system.
@@ -128,4 +128,4 @@ EXAMPLES
128 128
129SEE ALSO 129SEE ALSO
130======== 130========
131 **bpftool**\ (8), **bpftool-prog**\ (8) 131 **bpftool**\ (8), **bpftool-prog**\ (8), **bpftool-cgroup**\ (8)
diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
index 36e8d1c3c40d..e4ceee7f2dff 100644
--- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst
@@ -15,22 +15,23 @@ SYNOPSIS
15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-f** | **--bpffs** } } 15 *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-f** | **--bpffs** } }
16 16
17 *COMMANDS* := 17 *COMMANDS* :=
18 { **show** | **dump xlated** | **dump jited** | **pin** | **help** } 18 { **show** | **list** | **dump xlated** | **dump jited** | **pin** | **load** | **help** }
19 19
20MAP COMMANDS 20MAP COMMANDS
21============= 21=============
22 22
23| **bpftool** **prog show** [*PROG*] 23| **bpftool** **prog { show | list }** [*PROG*]
24| **bpftool** **prog dump xlated** *PROG* [{**file** *FILE* | **opcodes**}] 24| **bpftool** **prog dump xlated** *PROG* [{**file** *FILE* | **opcodes**}]
25| **bpftool** **prog dump jited** *PROG* [{**file** *FILE* | **opcodes**}] 25| **bpftool** **prog dump jited** *PROG* [{**file** *FILE* | **opcodes**}]
26| **bpftool** **prog pin** *PROG* *FILE* 26| **bpftool** **prog pin** *PROG* *FILE*
27| **bpftool** **prog load** *OBJ* *FILE*
27| **bpftool** **prog help** 28| **bpftool** **prog help**
28| 29|
29| *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* } 30| *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* }
30 31
31DESCRIPTION 32DESCRIPTION
32=========== 33===========
33 **bpftool prog show** [*PROG*] 34 **bpftool prog { show | list }** [*PROG*]
34 Show information about loaded programs. If *PROG* is 35 Show information about loaded programs. If *PROG* is
35 specified show information only about given program, otherwise 36 specified show information only about given program, otherwise
36 list all programs currently loaded on the system. 37 list all programs currently loaded on the system.
@@ -57,6 +58,11 @@ DESCRIPTION
57 58
58 Note: *FILE* must be located in *bpffs* mount. 59 Note: *FILE* must be located in *bpffs* mount.
59 60
61 **bpftool prog load** *OBJ* *FILE*
62 Load bpf program from binary *OBJ* and pin as *FILE*.
63
64 Note: *FILE* must be located in *bpffs* mount.
65
60 **bpftool prog help** 66 **bpftool prog help**
61 Print short help message. 67 Print short help message.
62 68
@@ -126,8 +132,10 @@ EXAMPLES
126| 132|
127| **# mount -t bpf none /sys/fs/bpf/** 133| **# mount -t bpf none /sys/fs/bpf/**
128| **# bpftool prog pin id 10 /sys/fs/bpf/prog** 134| **# bpftool prog pin id 10 /sys/fs/bpf/prog**
135| **# bpftool prog load ./my_prog.o /sys/fs/bpf/prog2**
129| **# ls -l /sys/fs/bpf/** 136| **# ls -l /sys/fs/bpf/**
130| -rw------- 1 root root 0 Jul 22 01:43 prog 137| -rw------- 1 root root 0 Jul 22 01:43 prog
138| -rw------- 1 root root 0 Jul 22 01:44 prog2
131 139
132**# bpftool prog dum jited pinned /sys/fs/bpf/prog opcodes** 140**# bpftool prog dum jited pinned /sys/fs/bpf/prog opcodes**
133 141
@@ -147,4 +155,4 @@ EXAMPLES
147 155
148SEE ALSO 156SEE ALSO
149======== 157========
150 **bpftool**\ (8), **bpftool-map**\ (8) 158 **bpftool**\ (8), **bpftool-map**\ (8), **bpftool-cgroup**\ (8)
diff --git a/tools/bpf/bpftool/Documentation/bpftool.rst b/tools/bpf/bpftool/Documentation/bpftool.rst
index 926c03d5a8da..20689a321ffe 100644
--- a/tools/bpf/bpftool/Documentation/bpftool.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool.rst
@@ -16,17 +16,19 @@ SYNOPSIS
16 16
17 **bpftool** **version** 17 **bpftool** **version**
18 18
19 *OBJECT* := { **map** | **program** } 19 *OBJECT* := { **map** | **program** | **cgroup** }
20 20
21 *OPTIONS* := { { **-V** | **--version** } | { **-h** | **--help** } 21 *OPTIONS* := { { **-V** | **--version** } | { **-h** | **--help** }
22 | { **-j** | **--json** } [{ **-p** | **--pretty** }] } 22 | { **-j** | **--json** } [{ **-p** | **--pretty** }] }
23 23
24 *MAP-COMMANDS* := 24 *MAP-COMMANDS* :=
25 { **show** | **dump** | **update** | **lookup** | **getnext** | **delete** 25 { **show** | **list** | **dump** | **update** | **lookup** | **getnext** | **delete**
26 | **pin** | **help** } 26 | **pin** | **help** }
27 27
28 *PROG-COMMANDS* := { **show** | **dump jited** | **dump xlated** | **pin** 28 *PROG-COMMANDS* := { **show** | **list** | **dump jited** | **dump xlated** | **pin**
29 | **help** } 29 | **load** | **help** }
30
31 *CGROUP-COMMANDS* := { **show** | **list** | **attach** | **detach** | **help** }
30 32
31DESCRIPTION 33DESCRIPTION
32=========== 34===========
@@ -53,4 +55,4 @@ OPTIONS
53 55
54SEE ALSO 56SEE ALSO
55======== 57========
56 **bpftool-map**\ (8), **bpftool-prog**\ (8) 58 **bpftool-map**\ (8), **bpftool-prog**\ (8), **bpftool-cgroup**\ (8)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index ec3052c0b004..26901ec87361 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -1,25 +1,10 @@
1include ../../scripts/Makefile.include 1include ../../scripts/Makefile.include
2
3include ../../scripts/utilities.mak 2include ../../scripts/utilities.mak
4 3
5ifeq ($(srctree),) 4ifeq ($(srctree),)
6srctree := $(patsubst %/,%,$(dir $(CURDIR))) 5srctree := $(patsubst %/,%,$(dir $(CURDIR)))
7srctree := $(patsubst %/,%,$(dir $(srctree))) 6srctree := $(patsubst %/,%,$(dir $(srctree)))
8srctree := $(patsubst %/,%,$(dir $(srctree))) 7srctree := $(patsubst %/,%,$(dir $(srctree)))
9#$(info Determined 'srctree' to be $(srctree))
10endif
11
12ifneq ($(objtree),)
13#$(info Determined 'objtree' to be $(objtree))
14endif
15
16ifneq ($(OUTPUT),)
17#$(info Determined 'OUTPUT' to be $(OUTPUT))
18# Adding $(OUTPUT) as a directory to look for source files,
19# because use generated output files as sources dependency
20# for flex/bison parsers.
21VPATH += $(OUTPUT)
22export VPATH
23endif 8endif
24 9
25ifeq ($(V),1) 10ifeq ($(V),1)
@@ -28,16 +13,18 @@ else
28 Q = @ 13 Q = @
29endif 14endif
30 15
31BPF_DIR = $(srctree)/tools/lib/bpf/ 16BPF_DIR = $(srctree)/tools/lib/bpf/
32 17
33ifneq ($(OUTPUT),) 18ifneq ($(OUTPUT),)
34 BPF_PATH=$(OUTPUT) 19 BPF_PATH = $(OUTPUT)
35else 20else
36 BPF_PATH=$(BPF_DIR) 21 BPF_PATH = $(BPF_DIR)
37endif 22endif
38 23
39LIBBPF = $(BPF_PATH)libbpf.a 24LIBBPF = $(BPF_PATH)libbpf.a
40 25
26BPFTOOL_VERSION=$(shell make --no-print-directory -sC ../../.. kernelversion)
27
41$(LIBBPF): FORCE 28$(LIBBPF): FORCE
42 $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) 29 $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT)
43 30
@@ -45,22 +32,50 @@ $(LIBBPF)-clean:
45 $(call QUIET_CLEAN, libbpf) 32 $(call QUIET_CLEAN, libbpf)
46 $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(OUTPUT) clean >/dev/null 33 $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(OUTPUT) clean >/dev/null
47 34
48prefix = /usr/local 35prefix ?= /usr/local
49bash_compdir ?= /usr/share/bash-completion/completions 36bash_compdir ?= /usr/share/bash-completion/completions
50 37
51CC = gcc 38CC = gcc
52 39
53CFLAGS += -O2 40CFLAGS += -O2
54CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wshadow 41CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wshadow
55CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf -I$(srctree)/kernel/bpf/ 42CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ -I$(srctree)/tools/include/uapi -I$(srctree)/tools/include -I$(srctree)/tools/lib/bpf -I$(srctree)/kernel/bpf/
43CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
56LIBS = -lelf -lbfd -lopcodes $(LIBBPF) 44LIBS = -lelf -lbfd -lopcodes $(LIBBPF)
57 45
46INSTALL ?= install
47RM ?= rm -f
48
49FEATURE_USER = .bpftool
50FEATURE_TESTS = libbfd disassembler-four-args
51FEATURE_DISPLAY = libbfd disassembler-four-args
52
53check_feat := 1
54NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall
55ifdef MAKECMDGOALS
56ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
57 check_feat := 0
58endif
59endif
60
61ifeq ($(check_feat),1)
62ifeq ($(FEATURES_DUMP),)
63include $(srctree)/tools/build/Makefile.feature
64else
65include $(FEATURES_DUMP)
66endif
67endif
68
69ifeq ($(feature-disassembler-four-args), 1)
70CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
71endif
72
58include $(wildcard *.d) 73include $(wildcard *.d)
59 74
60all: $(OUTPUT)bpftool 75all: $(OUTPUT)bpftool
61 76
62SRCS=$(wildcard *.c) 77SRCS = $(wildcard *.c)
63OBJS=$(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o 78OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o
64 79
65$(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c 80$(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c
66 $(QUIET_CC)$(COMPILE.c) -MMD -o $@ $< 81 $(QUIET_CC)$(COMPILE.c) -MMD -o $@ $<
@@ -73,21 +88,34 @@ $(OUTPUT)%.o: %.c
73 88
74clean: $(LIBBPF)-clean 89clean: $(LIBBPF)-clean
75 $(call QUIET_CLEAN, bpftool) 90 $(call QUIET_CLEAN, bpftool)
76 $(Q)rm -rf $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d 91 $(Q)$(RM) $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
92
93install: $(OUTPUT)bpftool
94 $(call QUIET_INSTALL, bpftool)
95 $(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/sbin
96 $(Q)$(INSTALL) $(OUTPUT)bpftool $(DESTDIR)$(prefix)/sbin/bpftool
97 $(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(bash_compdir)
98 $(Q)$(INSTALL) -m 0644 bash-completion/bpftool $(DESTDIR)$(bash_compdir)
77 99
78install: 100uninstall:
79 install -m 0755 -d $(prefix)/sbin 101 $(call QUIET_UNINST, bpftool)
80 install $(OUTPUT)bpftool $(prefix)/sbin/bpftool 102 $(Q)$(RM) $(DESTDIR)$(prefix)/sbin/bpftool
81 install -m 0755 -d $(bash_compdir) 103 $(Q)$(RM) $(DESTDIR)$(bash_compdir)/bpftool
82 install -m 0644 bash-completion/bpftool $(bash_compdir)
83 104
84doc: 105doc:
85 $(Q)$(MAKE) -C Documentation/ 106 $(call descend,Documentation)
107
108doc-clean:
109 $(call descend,Documentation,clean)
86 110
87doc-install: 111doc-install:
88 $(Q)$(MAKE) -C Documentation/ install 112 $(call descend,Documentation,install)
113
114doc-uninstall:
115 $(call descend,Documentation,uninstall)
89 116
90FORCE: 117FORCE:
91 118
92.PHONY: all clean FORCE install doc doc-install 119.PHONY: all FORCE clean install uninstall
120.PHONY: doc doc-clean doc-install doc-uninstall
93.DEFAULT_GOAL := all 121.DEFAULT_GOAL := all
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
index 7febee05c8e7..0137866bb8f6 100644
--- a/tools/bpf/bpftool/bash-completion/bpftool
+++ b/tools/bpf/bpftool/bash-completion/bpftool
@@ -197,7 +197,7 @@ _bpftool()
197 197
198 local PROG_TYPE='id pinned tag' 198 local PROG_TYPE='id pinned tag'
199 case $command in 199 case $command in
200 show) 200 show|list)
201 [[ $prev != "$command" ]] && return 0 201 [[ $prev != "$command" ]] && return 0
202 COMPREPLY=( $( compgen -W "$PROG_TYPE" -- "$cur" ) ) 202 COMPREPLY=( $( compgen -W "$PROG_TYPE" -- "$cur" ) )
203 return 0 203 return 0
@@ -232,7 +232,7 @@ _bpftool()
232 ;; 232 ;;
233 *) 233 *)
234 [[ $prev == $object ]] && \ 234 [[ $prev == $object ]] && \
235 COMPREPLY=( $( compgen -W 'dump help pin show' -- \ 235 COMPREPLY=( $( compgen -W 'dump help pin show list' -- \
236 "$cur" ) ) 236 "$cur" ) )
237 ;; 237 ;;
238 esac 238 esac
@@ -240,7 +240,7 @@ _bpftool()
240 map) 240 map)
241 local MAP_TYPE='id pinned' 241 local MAP_TYPE='id pinned'
242 case $command in 242 case $command in
243 show|dump) 243 show|list|dump)
244 case $prev in 244 case $prev in
245 $command) 245 $command)
246 COMPREPLY=( $( compgen -W "$MAP_TYPE" -- "$cur" ) ) 246 COMPREPLY=( $( compgen -W "$MAP_TYPE" -- "$cur" ) )
@@ -343,7 +343,7 @@ _bpftool()
343 *) 343 *)
344 [[ $prev == $object ]] && \ 344 [[ $prev == $object ]] && \
345 COMPREPLY=( $( compgen -W 'delete dump getnext help \ 345 COMPREPLY=( $( compgen -W 'delete dump getnext help \
346 lookup pin show update' -- "$cur" ) ) 346 lookup pin show list update' -- "$cur" ) )
347 ;; 347 ;;
348 esac 348 esac
349 ;; 349 ;;
diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c
new file mode 100644
index 000000000000..cae32a61cb18
--- /dev/null
+++ b/tools/bpf/bpftool/cgroup.c
@@ -0,0 +1,308 @@
1// SPDX-License-Identifier: GPL-2.0+
2// Copyright (C) 2017 Facebook
3// Author: Roman Gushchin <guro@fb.com>
4
5#include <fcntl.h>
6#include <stdlib.h>
7#include <string.h>
8#include <sys/stat.h>
9#include <sys/types.h>
10#include <unistd.h>
11
12#include <bpf.h>
13
14#include "main.h"
15
16#define HELP_SPEC_ATTACH_FLAGS \
17 "ATTACH_FLAGS := { multi | override }"
18
19#define HELP_SPEC_ATTACH_TYPES \
20 "ATTACH_TYPE := { ingress | egress | sock_create | sock_ops | device }"
21
22static const char * const attach_type_strings[] = {
23 [BPF_CGROUP_INET_INGRESS] = "ingress",
24 [BPF_CGROUP_INET_EGRESS] = "egress",
25 [BPF_CGROUP_INET_SOCK_CREATE] = "sock_create",
26 [BPF_CGROUP_SOCK_OPS] = "sock_ops",
27 [BPF_CGROUP_DEVICE] = "device",
28 [__MAX_BPF_ATTACH_TYPE] = NULL,
29};
30
31static enum bpf_attach_type parse_attach_type(const char *str)
32{
33 enum bpf_attach_type type;
34
35 for (type = 0; type < __MAX_BPF_ATTACH_TYPE; type++) {
36 if (attach_type_strings[type] &&
37 is_prefix(str, attach_type_strings[type]))
38 return type;
39 }
40
41 return __MAX_BPF_ATTACH_TYPE;
42}
43
44static int show_bpf_prog(int id, const char *attach_type_str,
45 const char *attach_flags_str)
46{
47 struct bpf_prog_info info = {};
48 __u32 info_len = sizeof(info);
49 int prog_fd;
50
51 prog_fd = bpf_prog_get_fd_by_id(id);
52 if (prog_fd < 0)
53 return -1;
54
55 if (bpf_obj_get_info_by_fd(prog_fd, &info, &info_len)) {
56 close(prog_fd);
57 return -1;
58 }
59
60 if (json_output) {
61 jsonw_start_object(json_wtr);
62 jsonw_uint_field(json_wtr, "id", info.id);
63 jsonw_string_field(json_wtr, "attach_type",
64 attach_type_str);
65 jsonw_string_field(json_wtr, "attach_flags",
66 attach_flags_str);
67 jsonw_string_field(json_wtr, "name", info.name);
68 jsonw_end_object(json_wtr);
69 } else {
70 printf("%-8u %-15s %-15s %-15s\n", info.id,
71 attach_type_str,
72 attach_flags_str,
73 info.name);
74 }
75
76 close(prog_fd);
77 return 0;
78}
79
80static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)
81{
82 __u32 prog_ids[1024] = {0};
83 char *attach_flags_str;
84 __u32 prog_cnt, iter;
85 __u32 attach_flags;
86 char buf[32];
87 int ret;
88
89 prog_cnt = ARRAY_SIZE(prog_ids);
90 ret = bpf_prog_query(cgroup_fd, type, 0, &attach_flags, prog_ids,
91 &prog_cnt);
92 if (ret)
93 return ret;
94
95 if (prog_cnt == 0)
96 return 0;
97
98 switch (attach_flags) {
99 case BPF_F_ALLOW_MULTI:
100 attach_flags_str = "multi";
101 break;
102 case BPF_F_ALLOW_OVERRIDE:
103 attach_flags_str = "override";
104 break;
105 case 0:
106 attach_flags_str = "";
107 break;
108 default:
109 snprintf(buf, sizeof(buf), "unknown(%x)", attach_flags);
110 attach_flags_str = buf;
111 }
112
113 for (iter = 0; iter < prog_cnt; iter++)
114 show_bpf_prog(prog_ids[iter], attach_type_strings[type],
115 attach_flags_str);
116
117 return 0;
118}
119
120static int do_show(int argc, char **argv)
121{
122 enum bpf_attach_type type;
123 int cgroup_fd;
124 int ret = -1;
125
126 if (argc < 1) {
127 p_err("too few parameters for cgroup show");
128 goto exit;
129 } else if (argc > 1) {
130 p_err("too many parameters for cgroup show");
131 goto exit;
132 }
133
134 cgroup_fd = open(argv[0], O_RDONLY);
135 if (cgroup_fd < 0) {
136 p_err("can't open cgroup %s", argv[1]);
137 goto exit;
138 }
139
140 if (json_output)
141 jsonw_start_array(json_wtr);
142 else
143 printf("%-8s %-15s %-15s %-15s\n", "ID", "AttachType",
144 "AttachFlags", "Name");
145
146 for (type = 0; type < __MAX_BPF_ATTACH_TYPE; type++) {
147 /*
148 * Not all attach types may be supported, so it's expected,
149 * that some requests will fail.
150 * If we were able to get the show for at least one
151 * attach type, let's return 0.
152 */
153 if (show_attached_bpf_progs(cgroup_fd, type) == 0)
154 ret = 0;
155 }
156
157 if (json_output)
158 jsonw_end_array(json_wtr);
159
160 close(cgroup_fd);
161exit:
162 return ret;
163}
164
165static int do_attach(int argc, char **argv)
166{
167 enum bpf_attach_type attach_type;
168 int cgroup_fd, prog_fd;
169 int attach_flags = 0;
170 int ret = -1;
171 int i;
172
173 if (argc < 4) {
174 p_err("too few parameters for cgroup attach");
175 goto exit;
176 }
177
178 cgroup_fd = open(argv[0], O_RDONLY);
179 if (cgroup_fd < 0) {
180 p_err("can't open cgroup %s", argv[1]);
181 goto exit;
182 }
183
184 attach_type = parse_attach_type(argv[1]);
185 if (attach_type == __MAX_BPF_ATTACH_TYPE) {
186 p_err("invalid attach type");
187 goto exit_cgroup;
188 }
189
190 argc -= 2;
191 argv = &argv[2];
192 prog_fd = prog_parse_fd(&argc, &argv);
193 if (prog_fd < 0)
194 goto exit_cgroup;
195
196 for (i = 0; i < argc; i++) {
197 if (is_prefix(argv[i], "multi")) {
198 attach_flags |= BPF_F_ALLOW_MULTI;
199 } else if (is_prefix(argv[i], "override")) {
200 attach_flags |= BPF_F_ALLOW_OVERRIDE;
201 } else {
202 p_err("unknown option: %s", argv[i]);
203 goto exit_cgroup;
204 }
205 }
206
207 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) {
208 p_err("failed to attach program");
209 goto exit_prog;
210 }
211
212 if (json_output)
213 jsonw_null(json_wtr);
214
215 ret = 0;
216
217exit_prog:
218 close(prog_fd);
219exit_cgroup:
220 close(cgroup_fd);
221exit:
222 return ret;
223}
224
225static int do_detach(int argc, char **argv)
226{
227 enum bpf_attach_type attach_type;
228 int prog_fd, cgroup_fd;
229 int ret = -1;
230
231 if (argc < 4) {
232 p_err("too few parameters for cgroup detach");
233 goto exit;
234 }
235
236 cgroup_fd = open(argv[0], O_RDONLY);
237 if (cgroup_fd < 0) {
238 p_err("can't open cgroup %s", argv[1]);
239 goto exit;
240 }
241
242 attach_type = parse_attach_type(argv[1]);
243 if (attach_type == __MAX_BPF_ATTACH_TYPE) {
244 p_err("invalid attach type");
245 goto exit_cgroup;
246 }
247
248 argc -= 2;
249 argv = &argv[2];
250 prog_fd = prog_parse_fd(&argc, &argv);
251 if (prog_fd < 0)
252 goto exit_cgroup;
253
254 if (bpf_prog_detach2(prog_fd, cgroup_fd, attach_type)) {
255 p_err("failed to detach program");
256 goto exit_prog;
257 }
258
259 if (json_output)
260 jsonw_null(json_wtr);
261
262 ret = 0;
263
264exit_prog:
265 close(prog_fd);
266exit_cgroup:
267 close(cgroup_fd);
268exit:
269 return ret;
270}
271
272static int do_help(int argc, char **argv)
273{
274 if (json_output) {
275 jsonw_null(json_wtr);
276 return 0;
277 }
278
279 fprintf(stderr,
280 "Usage: %s %s { show | list } CGROUP\n"
281 " %s %s attach CGROUP ATTACH_TYPE PROG [ATTACH_FLAGS]\n"
282 " %s %s detach CGROUP ATTACH_TYPE PROG\n"
283 " %s %s help\n"
284 "\n"
285 " " HELP_SPEC_ATTACH_TYPES "\n"
286 " " HELP_SPEC_ATTACH_FLAGS "\n"
287 " " HELP_SPEC_PROGRAM "\n"
288 " " HELP_SPEC_OPTIONS "\n"
289 "",
290 bin_name, argv[-2], bin_name, argv[-2],
291 bin_name, argv[-2], bin_name, argv[-2]);
292
293 return 0;
294}
295
296static const struct cmd cmds[] = {
297 { "show", do_show },
298 { "list", do_show },
299 { "attach", do_attach },
300 { "detach", do_detach },
301 { "help", do_help },
302 { 0 }
303};
304
305int do_cgroup(int argc, char **argv)
306{
307 return cmd_select(cmds, argc, argv, do_help);
308}
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index 2bd3b280e6dd..0b482c0070e0 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -34,6 +34,7 @@
34/* Author: Jakub Kicinski <kubakici@wp.pl> */ 34/* Author: Jakub Kicinski <kubakici@wp.pl> */
35 35
36#include <errno.h> 36#include <errno.h>
37#include <fcntl.h>
37#include <fts.h> 38#include <fts.h>
38#include <libgen.h> 39#include <libgen.h>
39#include <mntent.h> 40#include <mntent.h>
@@ -44,7 +45,9 @@
44#include <unistd.h> 45#include <unistd.h>
45#include <linux/limits.h> 46#include <linux/limits.h>
46#include <linux/magic.h> 47#include <linux/magic.h>
48#include <net/if.h>
47#include <sys/mount.h> 49#include <sys/mount.h>
50#include <sys/stat.h>
48#include <sys/types.h> 51#include <sys/types.h>
49#include <sys/vfs.h> 52#include <sys/vfs.h>
50 53
@@ -163,13 +166,49 @@ int open_obj_pinned_any(char *path, enum bpf_obj_type exp_type)
163 return fd; 166 return fd;
164} 167}
165 168
166int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32)) 169int do_pin_fd(int fd, const char *name)
167{ 170{
168 char err_str[ERR_MAX_LEN]; 171 char err_str[ERR_MAX_LEN];
169 unsigned int id;
170 char *endptr;
171 char *file; 172 char *file;
172 char *dir; 173 char *dir;
174 int err = 0;
175
176 err = bpf_obj_pin(fd, name);
177 if (!err)
178 goto out;
179
180 file = malloc(strlen(name) + 1);
181 strcpy(file, name);
182 dir = dirname(file);
183
184 if (errno != EPERM || is_bpffs(dir)) {
185 p_err("can't pin the object (%s): %s", name, strerror(errno));
186 goto out_free;
187 }
188
189 /* Attempt to mount bpffs, then retry pinning. */
190 err = mnt_bpffs(dir, err_str, ERR_MAX_LEN);
191 if (!err) {
192 err = bpf_obj_pin(fd, name);
193 if (err)
194 p_err("can't pin the object (%s): %s", name,
195 strerror(errno));
196 } else {
197 err_str[ERR_MAX_LEN - 1] = '\0';
198 p_err("can't mount BPF file system to pin the object (%s): %s",
199 name, err_str);
200 }
201
202out_free:
203 free(file);
204out:
205 return err;
206}
207
208int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32))
209{
210 unsigned int id;
211 char *endptr;
173 int err; 212 int err;
174 int fd; 213 int fd;
175 214
@@ -195,35 +234,8 @@ int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32))
195 return -1; 234 return -1;
196 } 235 }
197 236
198 err = bpf_obj_pin(fd, *argv); 237 err = do_pin_fd(fd, *argv);
199 if (!err)
200 goto out_close;
201
202 file = malloc(strlen(*argv) + 1);
203 strcpy(file, *argv);
204 dir = dirname(file);
205
206 if (errno != EPERM || is_bpffs(dir)) {
207 p_err("can't pin the object (%s): %s", *argv, strerror(errno));
208 goto out_free;
209 }
210
211 /* Attempt to mount bpffs, then retry pinning. */
212 err = mnt_bpffs(dir, err_str, ERR_MAX_LEN);
213 if (!err) {
214 err = bpf_obj_pin(fd, *argv);
215 if (err)
216 p_err("can't pin the object (%s): %s", *argv,
217 strerror(errno));
218 } else {
219 err_str[ERR_MAX_LEN - 1] = '\0';
220 p_err("can't mount BPF file system to pin the object (%s): %s",
221 *argv, err_str);
222 }
223 238
224out_free:
225 free(file);
226out_close:
227 close(fd); 239 close(fd);
228 return err; 240 return err;
229} 241}
@@ -403,3 +415,124 @@ void delete_pinned_obj_table(struct pinned_obj_table *tab)
403 free(obj); 415 free(obj);
404 } 416 }
405} 417}
418
419static char *
420ifindex_to_name_ns(__u32 ifindex, __u32 ns_dev, __u32 ns_ino, char *buf)
421{
422 struct stat st;
423 int err;
424
425 err = stat("/proc/self/ns/net", &st);
426 if (err) {
427 p_err("Can't stat /proc/self: %s", strerror(errno));
428 return NULL;
429 }
430
431 if (st.st_dev != ns_dev || st.st_ino != ns_ino)
432 return NULL;
433
434 return if_indextoname(ifindex, buf);
435}
436
437static int read_sysfs_hex_int(char *path)
438{
439 char vendor_id_buf[8];
440 int len;
441 int fd;
442
443 fd = open(path, O_RDONLY);
444 if (fd < 0) {
445 p_err("Can't open %s: %s", path, strerror(errno));
446 return -1;
447 }
448
449 len = read(fd, vendor_id_buf, sizeof(vendor_id_buf));
450 close(fd);
451 if (len < 0) {
452 p_err("Can't read %s: %s", path, strerror(errno));
453 return -1;
454 }
455 if (len >= (int)sizeof(vendor_id_buf)) {
456 p_err("Value in %s too long", path);
457 return -1;
458 }
459
460 vendor_id_buf[len] = 0;
461
462 return strtol(vendor_id_buf, NULL, 0);
463}
464
465static int read_sysfs_netdev_hex_int(char *devname, const char *entry_name)
466{
467 char full_path[64];
468
469 snprintf(full_path, sizeof(full_path), "/sys/class/net/%s/device/%s",
470 devname, entry_name);
471
472 return read_sysfs_hex_int(full_path);
473}
474
475const char *ifindex_to_bfd_name_ns(__u32 ifindex, __u64 ns_dev, __u64 ns_ino)
476{
477 char devname[IF_NAMESIZE];
478 int vendor_id;
479 int device_id;
480
481 if (!ifindex_to_name_ns(ifindex, ns_dev, ns_ino, devname)) {
482 p_err("Can't get net device name for ifindex %d: %s", ifindex,
483 strerror(errno));
484 return NULL;
485 }
486
487 vendor_id = read_sysfs_netdev_hex_int(devname, "vendor");
488 if (vendor_id < 0) {
489 p_err("Can't get device vendor id for %s", devname);
490 return NULL;
491 }
492
493 switch (vendor_id) {
494 case 0x19ee:
495 device_id = read_sysfs_netdev_hex_int(devname, "device");
496 if (device_id != 0x4000 &&
497 device_id != 0x6000 &&
498 device_id != 0x6003)
499 p_info("Unknown NFP device ID, assuming it is NFP-6xxx arch");
500 return "NFP-6xxx";
501 default:
502 p_err("Can't get bfd arch name for device vendor id 0x%04x",
503 vendor_id);
504 return NULL;
505 }
506}
507
508void print_dev_plain(__u32 ifindex, __u64 ns_dev, __u64 ns_inode)
509{
510 char name[IF_NAMESIZE];
511
512 if (!ifindex)
513 return;
514
515 printf(" dev ");
516 if (ifindex_to_name_ns(ifindex, ns_dev, ns_inode, name))
517 printf("%s", name);
518 else
519 printf("ifindex %u ns_dev %llu ns_ino %llu",
520 ifindex, ns_dev, ns_inode);
521}
522
523void print_dev_json(__u32 ifindex, __u64 ns_dev, __u64 ns_inode)
524{
525 char name[IF_NAMESIZE];
526
527 if (!ifindex)
528 return;
529
530 jsonw_name(json_wtr, "dev");
531 jsonw_start_object(json_wtr);
532 jsonw_uint_field(json_wtr, "ifindex", ifindex);
533 jsonw_uint_field(json_wtr, "ns_dev", ns_dev);
534 jsonw_uint_field(json_wtr, "ns_inode", ns_inode);
535 if (ifindex_to_name_ns(ifindex, ns_dev, ns_inode, name))
536 jsonw_string_field(json_wtr, "ifname", name);
537 jsonw_end_object(json_wtr);
538}
diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
index 1551d3918d4c..87439320ef70 100644
--- a/tools/bpf/bpftool/jit_disasm.c
+++ b/tools/bpf/bpftool/jit_disasm.c
@@ -76,7 +76,8 @@ static int fprintf_json(void *out, const char *fmt, ...)
76 return 0; 76 return 0;
77} 77}
78 78
79void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes) 79void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
80 const char *arch)
80{ 81{
81 disassembler_ftype disassemble; 82 disassembler_ftype disassemble;
82 struct disassemble_info info; 83 struct disassemble_info info;
@@ -100,6 +101,19 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes)
100 else 101 else
101 init_disassemble_info(&info, stdout, 102 init_disassemble_info(&info, stdout,
102 (fprintf_ftype) fprintf); 103 (fprintf_ftype) fprintf);
104
105 /* Update architecture info for offload. */
106 if (arch) {
107 const bfd_arch_info_type *inf = bfd_scan_arch(arch);
108
109 if (inf) {
110 bfdf->arch_info = inf;
111 } else {
112 p_err("No libfd support for %s", arch);
113 return;
114 }
115 }
116
103 info.arch = bfd_get_arch(bfdf); 117 info.arch = bfd_get_arch(bfdf);
104 info.mach = bfd_get_mach(bfdf); 118 info.mach = bfd_get_mach(bfdf);
105 info.buffer = image; 119 info.buffer = image;
@@ -107,7 +121,14 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes)
107 121
108 disassemble_init_for_target(&info); 122 disassemble_init_for_target(&info);
109 123
124#ifdef DISASM_FOUR_ARGS_SIGNATURE
125 disassemble = disassembler(info.arch,
126 bfd_big_endian(bfdf),
127 info.mach,
128 bfdf);
129#else
110 disassemble = disassembler(bfdf); 130 disassemble = disassembler(bfdf);
131#endif
111 assert(disassemble); 132 assert(disassemble);
112 133
113 if (json_output) 134 if (json_output)
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index d294bc8168be..3a0396d87c42 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -38,7 +38,6 @@
38#include <errno.h> 38#include <errno.h>
39#include <getopt.h> 39#include <getopt.h>
40#include <linux/bpf.h> 40#include <linux/bpf.h>
41#include <linux/version.h>
42#include <stdio.h> 41#include <stdio.h>
43#include <stdlib.h> 42#include <stdlib.h>
44#include <string.h> 43#include <string.h>
@@ -85,7 +84,7 @@ static int do_help(int argc, char **argv)
85 " %s batch file FILE\n" 84 " %s batch file FILE\n"
86 " %s version\n" 85 " %s version\n"
87 "\n" 86 "\n"
88 " OBJECT := { prog | map }\n" 87 " OBJECT := { prog | map | cgroup }\n"
89 " " HELP_SPEC_OPTIONS "\n" 88 " " HELP_SPEC_OPTIONS "\n"
90 "", 89 "",
91 bin_name, bin_name, bin_name); 90 bin_name, bin_name, bin_name);
@@ -95,21 +94,13 @@ static int do_help(int argc, char **argv)
95 94
96static int do_version(int argc, char **argv) 95static int do_version(int argc, char **argv)
97{ 96{
98 unsigned int version[3];
99
100 version[0] = LINUX_VERSION_CODE >> 16;
101 version[1] = LINUX_VERSION_CODE >> 8 & 0xf;
102 version[2] = LINUX_VERSION_CODE & 0xf;
103
104 if (json_output) { 97 if (json_output) {
105 jsonw_start_object(json_wtr); 98 jsonw_start_object(json_wtr);
106 jsonw_name(json_wtr, "version"); 99 jsonw_name(json_wtr, "version");
107 jsonw_printf(json_wtr, "\"%u.%u.%u\"", 100 jsonw_printf(json_wtr, "\"%s\"", BPFTOOL_VERSION);
108 version[0], version[1], version[2]);
109 jsonw_end_object(json_wtr); 101 jsonw_end_object(json_wtr);
110 } else { 102 } else {
111 printf("%s v%u.%u.%u\n", bin_name, 103 printf("%s v%s\n", bin_name, BPFTOOL_VERSION);
112 version[0], version[1], version[2]);
113 } 104 }
114 return 0; 105 return 0;
115} 106}
@@ -173,6 +164,7 @@ static const struct cmd cmds[] = {
173 { "batch", do_batch }, 164 { "batch", do_batch },
174 { "prog", do_prog }, 165 { "prog", do_prog },
175 { "map", do_map }, 166 { "map", do_map },
167 { "cgroup", do_cgroup },
176 { "version", do_version }, 168 { "version", do_version },
177 { 0 } 169 { 0 }
178}; 170};
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index bff330b49791..b8e9584d6246 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -96,6 +96,8 @@ struct pinned_obj {
96int build_pinned_obj_table(struct pinned_obj_table *table, 96int build_pinned_obj_table(struct pinned_obj_table *table,
97 enum bpf_obj_type type); 97 enum bpf_obj_type type);
98void delete_pinned_obj_table(struct pinned_obj_table *tab); 98void delete_pinned_obj_table(struct pinned_obj_table *tab);
99void print_dev_plain(__u32 ifindex, __u64 ns_dev, __u64 ns_inode);
100void print_dev_json(__u32 ifindex, __u64 ns_dev, __u64 ns_inode);
99 101
100struct cmd { 102struct cmd {
101 const char *cmd; 103 const char *cmd;
@@ -111,13 +113,18 @@ char *get_fdinfo(int fd, const char *key);
111int open_obj_pinned(char *path); 113int open_obj_pinned(char *path);
112int open_obj_pinned_any(char *path, enum bpf_obj_type exp_type); 114int open_obj_pinned_any(char *path, enum bpf_obj_type exp_type);
113int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32)); 115int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32));
116int do_pin_fd(int fd, const char *name);
114 117
115int do_prog(int argc, char **arg); 118int do_prog(int argc, char **arg);
116int do_map(int argc, char **arg); 119int do_map(int argc, char **arg);
120int do_cgroup(int argc, char **arg);
117 121
118int prog_parse_fd(int *argc, char ***argv); 122int prog_parse_fd(int *argc, char ***argv);
119 123
120void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes); 124void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
125 const char *arch);
121void print_hex_data_json(uint8_t *data, size_t len); 126void print_hex_data_json(uint8_t *data, size_t len);
122 127
128const char *ifindex_to_bfd_name_ns(__u32 ifindex, __u64 ns_dev, __u64 ns_ino);
129
123#endif 130#endif
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index a8c3a33dd185..f95fa67bb498 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -66,6 +66,7 @@ static const char * const map_type_name[] = {
66 [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps", 66 [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps",
67 [BPF_MAP_TYPE_DEVMAP] = "devmap", 67 [BPF_MAP_TYPE_DEVMAP] = "devmap",
68 [BPF_MAP_TYPE_SOCKMAP] = "sockmap", 68 [BPF_MAP_TYPE_SOCKMAP] = "sockmap",
69 [BPF_MAP_TYPE_CPUMAP] = "cpumap",
69}; 70};
70 71
71static unsigned int get_possible_cpus(void) 72static unsigned int get_possible_cpus(void)
@@ -428,6 +429,9 @@ static int show_map_close_json(int fd, struct bpf_map_info *info)
428 429
429 jsonw_name(json_wtr, "flags"); 430 jsonw_name(json_wtr, "flags");
430 jsonw_printf(json_wtr, "%#x", info->map_flags); 431 jsonw_printf(json_wtr, "%#x", info->map_flags);
432
433 print_dev_json(info->ifindex, info->netns_dev, info->netns_ino);
434
431 jsonw_uint_field(json_wtr, "bytes_key", info->key_size); 435 jsonw_uint_field(json_wtr, "bytes_key", info->key_size);
432 jsonw_uint_field(json_wtr, "bytes_value", info->value_size); 436 jsonw_uint_field(json_wtr, "bytes_value", info->value_size);
433 jsonw_uint_field(json_wtr, "max_entries", info->max_entries); 437 jsonw_uint_field(json_wtr, "max_entries", info->max_entries);
@@ -469,7 +473,9 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info)
469 if (*info->name) 473 if (*info->name)
470 printf("name %s ", info->name); 474 printf("name %s ", info->name);
471 475
472 printf("flags 0x%x\n", info->map_flags); 476 printf("flags 0x%x", info->map_flags);
477 print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino);
478 printf("\n");
473 printf("\tkey %uB value %uB max_entries %u", 479 printf("\tkey %uB value %uB max_entries %u",
474 info->key_size, info->value_size, info->max_entries); 480 info->key_size, info->value_size, info->max_entries);
475 481
@@ -861,7 +867,7 @@ static int do_help(int argc, char **argv)
861 } 867 }
862 868
863 fprintf(stderr, 869 fprintf(stderr,
864 "Usage: %s %s show [MAP]\n" 870 "Usage: %s %s { show | list } [MAP]\n"
865 " %s %s dump MAP\n" 871 " %s %s dump MAP\n"
866 " %s %s update MAP key BYTES value VALUE [UPDATE_FLAGS]\n" 872 " %s %s update MAP key BYTES value VALUE [UPDATE_FLAGS]\n"
867 " %s %s lookup MAP key BYTES\n" 873 " %s %s lookup MAP key BYTES\n"
@@ -885,6 +891,7 @@ static int do_help(int argc, char **argv)
885 891
886static const struct cmd cmds[] = { 892static const struct cmd cmds[] = {
887 { "show", do_show }, 893 { "show", do_show },
894 { "list", do_show },
888 { "help", do_help }, 895 { "help", do_help },
889 { "dump", do_dump }, 896 { "dump", do_dump },
890 { "update", do_update }, 897 { "update", do_update },
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index dded77345bfb..e8e2baaf93c2 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -45,6 +45,7 @@
45#include <sys/stat.h> 45#include <sys/stat.h>
46 46
47#include <bpf.h> 47#include <bpf.h>
48#include <libbpf.h>
48 49
49#include "main.h" 50#include "main.h"
50#include "disasm.h" 51#include "disasm.h"
@@ -65,6 +66,7 @@ static const char * const prog_type_name[] = {
65 [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", 66 [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit",
66 [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", 67 [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops",
67 [BPF_PROG_TYPE_SK_SKB] = "sk_skb", 68 [BPF_PROG_TYPE_SK_SKB] = "sk_skb",
69 [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device",
68}; 70};
69 71
70static void print_boot_time(__u64 nsecs, char *buf, unsigned int size) 72static void print_boot_time(__u64 nsecs, char *buf, unsigned int size)
@@ -229,6 +231,8 @@ static void print_prog_json(struct bpf_prog_info *info, int fd)
229 info->tag[0], info->tag[1], info->tag[2], info->tag[3], 231 info->tag[0], info->tag[1], info->tag[2], info->tag[3],
230 info->tag[4], info->tag[5], info->tag[6], info->tag[7]); 232 info->tag[4], info->tag[5], info->tag[6], info->tag[7]);
231 233
234 print_dev_json(info->ifindex, info->netns_dev, info->netns_ino);
235
232 if (info->load_time) { 236 if (info->load_time) {
233 char buf[32]; 237 char buf[32];
234 238
@@ -286,6 +290,7 @@ static void print_prog_plain(struct bpf_prog_info *info, int fd)
286 290
287 printf("tag "); 291 printf("tag ");
288 fprint_hex(stdout, info->tag, BPF_TAG_SIZE, ""); 292 fprint_hex(stdout, info->tag, BPF_TAG_SIZE, "");
293 print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino);
289 printf("\n"); 294 printf("\n");
290 295
291 if (info->load_time) { 296 if (info->load_time) {
@@ -402,6 +407,88 @@ static int do_show(int argc, char **argv)
402 return err; 407 return err;
403} 408}
404 409
410#define SYM_MAX_NAME 256
411
412struct kernel_sym {
413 unsigned long address;
414 char name[SYM_MAX_NAME];
415};
416
417struct dump_data {
418 unsigned long address_call_base;
419 struct kernel_sym *sym_mapping;
420 __u32 sym_count;
421 char scratch_buff[SYM_MAX_NAME];
422};
423
424static int kernel_syms_cmp(const void *sym_a, const void *sym_b)
425{
426 return ((struct kernel_sym *)sym_a)->address -
427 ((struct kernel_sym *)sym_b)->address;
428}
429
430static void kernel_syms_load(struct dump_data *dd)
431{
432 struct kernel_sym *sym;
433 char buff[256];
434 void *tmp, *address;
435 FILE *fp;
436
437 fp = fopen("/proc/kallsyms", "r");
438 if (!fp)
439 return;
440
441 while (!feof(fp)) {
442 if (!fgets(buff, sizeof(buff), fp))
443 break;
444 tmp = realloc(dd->sym_mapping,
445 (dd->sym_count + 1) *
446 sizeof(*dd->sym_mapping));
447 if (!tmp) {
448out:
449 free(dd->sym_mapping);
450 dd->sym_mapping = NULL;
451 fclose(fp);
452 return;
453 }
454 dd->sym_mapping = tmp;
455 sym = &dd->sym_mapping[dd->sym_count];
456 if (sscanf(buff, "%p %*c %s", &address, sym->name) != 2)
457 continue;
458 sym->address = (unsigned long)address;
459 if (!strcmp(sym->name, "__bpf_call_base")) {
460 dd->address_call_base = sym->address;
461 /* sysctl kernel.kptr_restrict was set */
462 if (!sym->address)
463 goto out;
464 }
465 if (sym->address)
466 dd->sym_count++;
467 }
468
469 fclose(fp);
470
471 qsort(dd->sym_mapping, dd->sym_count,
472 sizeof(*dd->sym_mapping), kernel_syms_cmp);
473}
474
475static void kernel_syms_destroy(struct dump_data *dd)
476{
477 free(dd->sym_mapping);
478}
479
480static struct kernel_sym *kernel_syms_search(struct dump_data *dd,
481 unsigned long key)
482{
483 struct kernel_sym sym = {
484 .address = key,
485 };
486
487 return dd->sym_mapping ?
488 bsearch(&sym, dd->sym_mapping, dd->sym_count,
489 sizeof(*dd->sym_mapping), kernel_syms_cmp) : NULL;
490}
491
405static void print_insn(struct bpf_verifier_env *env, const char *fmt, ...) 492static void print_insn(struct bpf_verifier_env *env, const char *fmt, ...)
406{ 493{
407 va_list args; 494 va_list args;
@@ -411,8 +498,71 @@ static void print_insn(struct bpf_verifier_env *env, const char *fmt, ...)
411 va_end(args); 498 va_end(args);
412} 499}
413 500
414static void dump_xlated_plain(void *buf, unsigned int len, bool opcodes) 501static const char *print_call_pcrel(struct dump_data *dd,
502 struct kernel_sym *sym,
503 unsigned long address,
504 const struct bpf_insn *insn)
505{
506 if (sym)
507 snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
508 "%+d#%s", insn->off, sym->name);
509 else
510 snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
511 "%+d#0x%lx", insn->off, address);
512 return dd->scratch_buff;
513}
514
515static const char *print_call_helper(struct dump_data *dd,
516 struct kernel_sym *sym,
517 unsigned long address)
518{
519 if (sym)
520 snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
521 "%s", sym->name);
522 else
523 snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
524 "0x%lx", address);
525 return dd->scratch_buff;
526}
527
528static const char *print_call(void *private_data,
529 const struct bpf_insn *insn)
530{
531 struct dump_data *dd = private_data;
532 unsigned long address = dd->address_call_base + insn->imm;
533 struct kernel_sym *sym;
534
535 sym = kernel_syms_search(dd, address);
536 if (insn->src_reg == BPF_PSEUDO_CALL)
537 return print_call_pcrel(dd, sym, address, insn);
538 else
539 return print_call_helper(dd, sym, address);
540}
541
542static const char *print_imm(void *private_data,
543 const struct bpf_insn *insn,
544 __u64 full_imm)
545{
546 struct dump_data *dd = private_data;
547
548 if (insn->src_reg == BPF_PSEUDO_MAP_FD)
549 snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
550 "map[id:%u]", insn->imm);
551 else
552 snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
553 "0x%llx", (unsigned long long)full_imm);
554 return dd->scratch_buff;
555}
556
557static void dump_xlated_plain(struct dump_data *dd, void *buf,
558 unsigned int len, bool opcodes)
415{ 559{
560 const struct bpf_insn_cbs cbs = {
561 .cb_print = print_insn,
562 .cb_call = print_call,
563 .cb_imm = print_imm,
564 .private_data = dd,
565 };
416 struct bpf_insn *insn = buf; 566 struct bpf_insn *insn = buf;
417 bool double_insn = false; 567 bool double_insn = false;
418 unsigned int i; 568 unsigned int i;
@@ -426,7 +576,7 @@ static void dump_xlated_plain(void *buf, unsigned int len, bool opcodes)
426 double_insn = insn[i].code == (BPF_LD | BPF_IMM | BPF_DW); 576 double_insn = insn[i].code == (BPF_LD | BPF_IMM | BPF_DW);
427 577
428 printf("% 4d: ", i); 578 printf("% 4d: ", i);
429 print_bpf_insn(print_insn, NULL, insn + i, true); 579 print_bpf_insn(&cbs, NULL, insn + i, true);
430 580
431 if (opcodes) { 581 if (opcodes) {
432 printf(" "); 582 printf(" ");
@@ -455,8 +605,15 @@ static void print_insn_json(struct bpf_verifier_env *env, const char *fmt, ...)
455 va_end(args); 605 va_end(args);
456} 606}
457 607
458static void dump_xlated_json(void *buf, unsigned int len, bool opcodes) 608static void dump_xlated_json(struct dump_data *dd, void *buf,
609 unsigned int len, bool opcodes)
459{ 610{
611 const struct bpf_insn_cbs cbs = {
612 .cb_print = print_insn_json,
613 .cb_call = print_call,
614 .cb_imm = print_imm,
615 .private_data = dd,
616 };
460 struct bpf_insn *insn = buf; 617 struct bpf_insn *insn = buf;
461 bool double_insn = false; 618 bool double_insn = false;
462 unsigned int i; 619 unsigned int i;
@@ -471,7 +628,7 @@ static void dump_xlated_json(void *buf, unsigned int len, bool opcodes)
471 628
472 jsonw_start_object(json_wtr); 629 jsonw_start_object(json_wtr);
473 jsonw_name(json_wtr, "disasm"); 630 jsonw_name(json_wtr, "disasm");
474 print_bpf_insn(print_insn_json, NULL, insn + i, true); 631 print_bpf_insn(&cbs, NULL, insn + i, true);
475 632
476 if (opcodes) { 633 if (opcodes) {
477 jsonw_name(json_wtr, "opcodes"); 634 jsonw_name(json_wtr, "opcodes");
@@ -506,6 +663,7 @@ static void dump_xlated_json(void *buf, unsigned int len, bool opcodes)
506static int do_dump(int argc, char **argv) 663static int do_dump(int argc, char **argv)
507{ 664{
508 struct bpf_prog_info info = {}; 665 struct bpf_prog_info info = {};
666 struct dump_data dd = {};
509 __u32 len = sizeof(info); 667 __u32 len = sizeof(info);
510 unsigned int buf_size; 668 unsigned int buf_size;
511 char *filepath = NULL; 669 char *filepath = NULL;
@@ -593,6 +751,14 @@ static int do_dump(int argc, char **argv)
593 goto err_free; 751 goto err_free;
594 } 752 }
595 753
754 if ((member_len == &info.jited_prog_len &&
755 info.jited_prog_insns == 0) ||
756 (member_len == &info.xlated_prog_len &&
757 info.xlated_prog_insns == 0)) {
758 p_err("error retrieving insn dump: kernel.kptr_restrict set?");
759 goto err_free;
760 }
761
596 if (filepath) { 762 if (filepath) {
597 fd = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0600); 763 fd = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
598 if (fd < 0) { 764 if (fd < 0) {
@@ -609,17 +775,29 @@ static int do_dump(int argc, char **argv)
609 goto err_free; 775 goto err_free;
610 } 776 }
611 } else { 777 } else {
612 if (member_len == &info.jited_prog_len) 778 if (member_len == &info.jited_prog_len) {
613 disasm_print_insn(buf, *member_len, opcodes); 779 const char *name = NULL;
614 else 780
781 if (info.ifindex) {
782 name = ifindex_to_bfd_name_ns(info.ifindex,
783 info.netns_dev,
784 info.netns_ino);
785 if (!name)
786 goto err_free;
787 }
788
789 disasm_print_insn(buf, *member_len, opcodes, name);
790 } else {
791 kernel_syms_load(&dd);
615 if (json_output) 792 if (json_output)
616 dump_xlated_json(buf, *member_len, opcodes); 793 dump_xlated_json(&dd, buf, *member_len, opcodes);
617 else 794 else
618 dump_xlated_plain(buf, *member_len, opcodes); 795 dump_xlated_plain(&dd, buf, *member_len, opcodes);
796 kernel_syms_destroy(&dd);
797 }
619 } 798 }
620 799
621 free(buf); 800 free(buf);
622
623 return 0; 801 return 0;
624 802
625err_free: 803err_free:
@@ -637,6 +815,30 @@ static int do_pin(int argc, char **argv)
637 return err; 815 return err;
638} 816}
639 817
818static int do_load(int argc, char **argv)
819{
820 struct bpf_object *obj;
821 int prog_fd;
822
823 if (argc != 2)
824 usage();
825
826 if (bpf_prog_load(argv[0], BPF_PROG_TYPE_UNSPEC, &obj, &prog_fd)) {
827 p_err("failed to load program");
828 return -1;
829 }
830
831 if (do_pin_fd(prog_fd, argv[1])) {
832 p_err("failed to pin program");
833 return -1;
834 }
835
836 if (json_output)
837 jsonw_null(json_wtr);
838
839 return 0;
840}
841
640static int do_help(int argc, char **argv) 842static int do_help(int argc, char **argv)
641{ 843{
642 if (json_output) { 844 if (json_output) {
@@ -645,26 +847,29 @@ static int do_help(int argc, char **argv)
645 } 847 }
646 848
647 fprintf(stderr, 849 fprintf(stderr,
648 "Usage: %s %s show [PROG]\n" 850 "Usage: %s %s { show | list } [PROG]\n"
649 " %s %s dump xlated PROG [{ file FILE | opcodes }]\n" 851 " %s %s dump xlated PROG [{ file FILE | opcodes }]\n"
650 " %s %s dump jited PROG [{ file FILE | opcodes }]\n" 852 " %s %s dump jited PROG [{ file FILE | opcodes }]\n"
651 " %s %s pin PROG FILE\n" 853 " %s %s pin PROG FILE\n"
854 " %s %s load OBJ FILE\n"
652 " %s %s help\n" 855 " %s %s help\n"
653 "\n" 856 "\n"
654 " " HELP_SPEC_PROGRAM "\n" 857 " " HELP_SPEC_PROGRAM "\n"
655 " " HELP_SPEC_OPTIONS "\n" 858 " " HELP_SPEC_OPTIONS "\n"
656 "", 859 "",
657 bin_name, argv[-2], bin_name, argv[-2], bin_name, argv[-2], 860 bin_name, argv[-2], bin_name, argv[-2], bin_name, argv[-2],
658 bin_name, argv[-2], bin_name, argv[-2]); 861 bin_name, argv[-2], bin_name, argv[-2], bin_name, argv[-2]);
659 862
660 return 0; 863 return 0;
661} 864}
662 865
663static const struct cmd cmds[] = { 866static const struct cmd cmds[] = {
664 { "show", do_show }, 867 { "show", do_show },
868 { "list", do_show },
665 { "help", do_help }, 869 { "help", do_help },
666 { "dump", do_dump }, 870 { "dump", do_dump },
667 { "pin", do_pin }, 871 { "pin", do_pin },
872 { "load", do_load },
668 { 0 } 873 { 0 }
669}; 874};
670 875
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index c71a05b9c984..c378f003b007 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -56,6 +56,7 @@ FEATURE_TESTS_BASIC := \
56 libunwind-arm \ 56 libunwind-arm \
57 libunwind-aarch64 \ 57 libunwind-aarch64 \
58 pthread-attr-setaffinity-np \ 58 pthread-attr-setaffinity-np \
59 pthread-barrier \
59 stackprotector-all \ 60 stackprotector-all \
60 timerfd \ 61 timerfd \
61 libdw-dwarf-unwind \ 62 libdw-dwarf-unwind \
@@ -65,7 +66,8 @@ FEATURE_TESTS_BASIC := \
65 bpf \ 66 bpf \
66 sched_getcpu \ 67 sched_getcpu \
67 sdt \ 68 sdt \
68 setns 69 setns \
70 libopencsd
69 71
70# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list 72# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
71# of all feature tests 73# of all feature tests
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 96982640fbf8..0a490cb15149 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -13,6 +13,7 @@ FILES= \
13 test-hello.bin \ 13 test-hello.bin \
14 test-libaudit.bin \ 14 test-libaudit.bin \
15 test-libbfd.bin \ 15 test-libbfd.bin \
16 test-disassembler-four-args.bin \
16 test-liberty.bin \ 17 test-liberty.bin \
17 test-liberty-z.bin \ 18 test-liberty-z.bin \
18 test-cplus-demangle.bin \ 19 test-cplus-demangle.bin \
@@ -37,6 +38,7 @@ FILES= \
37 test-libunwind-debug-frame-arm.bin \ 38 test-libunwind-debug-frame-arm.bin \
38 test-libunwind-debug-frame-aarch64.bin \ 39 test-libunwind-debug-frame-aarch64.bin \
39 test-pthread-attr-setaffinity-np.bin \ 40 test-pthread-attr-setaffinity-np.bin \
41 test-pthread-barrier.bin \
40 test-stackprotector-all.bin \ 42 test-stackprotector-all.bin \
41 test-timerfd.bin \ 43 test-timerfd.bin \
42 test-libdw-dwarf-unwind.bin \ 44 test-libdw-dwarf-unwind.bin \
@@ -51,7 +53,8 @@ FILES= \
51 test-cxx.bin \ 53 test-cxx.bin \
52 test-jvmti.bin \ 54 test-jvmti.bin \
53 test-sched_getcpu.bin \ 55 test-sched_getcpu.bin \
54 test-setns.bin 56 test-setns.bin \
57 test-libopencsd.bin
55 58
56FILES := $(addprefix $(OUTPUT),$(FILES)) 59FILES := $(addprefix $(OUTPUT),$(FILES))
57 60
@@ -79,6 +82,9 @@ $(OUTPUT)test-hello.bin:
79$(OUTPUT)test-pthread-attr-setaffinity-np.bin: 82$(OUTPUT)test-pthread-attr-setaffinity-np.bin:
80 $(BUILD) -D_GNU_SOURCE -lpthread 83 $(BUILD) -D_GNU_SOURCE -lpthread
81 84
85$(OUTPUT)test-pthread-barrier.bin:
86 $(BUILD) -lpthread
87
82$(OUTPUT)test-stackprotector-all.bin: 88$(OUTPUT)test-stackprotector-all.bin:
83 $(BUILD) -fstack-protector-all 89 $(BUILD) -fstack-protector-all
84 90
@@ -100,6 +106,10 @@ $(OUTPUT)test-sched_getcpu.bin:
100$(OUTPUT)test-setns.bin: 106$(OUTPUT)test-setns.bin:
101 $(BUILD) 107 $(BUILD)
102 108
109$(OUTPUT)test-libopencsd.bin:
110 $(BUILD) # -lopencsd_c_api -lopencsd provided by
111 # $(FEATURE_CHECK_LDFLAGS-libopencsd)
112
103DWARFLIBS := -ldw 113DWARFLIBS := -ldw
104ifeq ($(findstring -static,${LDFLAGS}),-static) 114ifeq ($(findstring -static,${LDFLAGS}),-static)
105DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 115DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
@@ -188,6 +198,9 @@ $(OUTPUT)test-libpython-version.bin:
188$(OUTPUT)test-libbfd.bin: 198$(OUTPUT)test-libbfd.bin:
189 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl 199 $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
190 200
201$(OUTPUT)test-disassembler-four-args.bin:
202 $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
203
191$(OUTPUT)test-liberty.bin: 204$(OUTPUT)test-liberty.bin:
192 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty 205 $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
193 206
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 4112702e4aed..8dc20a61341f 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -118,6 +118,10 @@
118# include "test-pthread-attr-setaffinity-np.c" 118# include "test-pthread-attr-setaffinity-np.c"
119#undef main 119#undef main
120 120
121#define main main_test_pthread_barrier
122# include "test-pthread-barrier.c"
123#undef main
124
121#define main main_test_sched_getcpu 125#define main main_test_sched_getcpu
122# include "test-sched_getcpu.c" 126# include "test-sched_getcpu.c"
123#undef main 127#undef main
@@ -158,6 +162,10 @@
158# include "test-setns.c" 162# include "test-setns.c"
159#undef main 163#undef main
160 164
165#define main main_test_libopencsd
166# include "test-libopencsd.c"
167#undef main
168
161int main(int argc, char *argv[]) 169int main(int argc, char *argv[])
162{ 170{
163 main_test_libpython(); 171 main_test_libpython();
@@ -187,6 +195,7 @@ int main(int argc, char *argv[])
187 main_test_sync_compare_and_swap(argc, argv); 195 main_test_sync_compare_and_swap(argc, argv);
188 main_test_zlib(); 196 main_test_zlib();
189 main_test_pthread_attr_setaffinity_np(); 197 main_test_pthread_attr_setaffinity_np();
198 main_test_pthread_barrier();
190 main_test_lzma(); 199 main_test_lzma();
191 main_test_get_cpuid(); 200 main_test_get_cpuid();
192 main_test_bpf(); 201 main_test_bpf();
@@ -194,6 +203,7 @@ int main(int argc, char *argv[])
194 main_test_sched_getcpu(); 203 main_test_sched_getcpu();
195 main_test_sdt(); 204 main_test_sdt();
196 main_test_setns(); 205 main_test_setns();
206 main_test_libopencsd();
197 207
198 return 0; 208 return 0;
199} 209}
diff --git a/tools/build/feature/test-disassembler-four-args.c b/tools/build/feature/test-disassembler-four-args.c
new file mode 100644
index 000000000000..45ce65cfddf0
--- /dev/null
+++ b/tools/build/feature/test-disassembler-four-args.c
@@ -0,0 +1,15 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <bfd.h>
3#include <dis-asm.h>
4
5int main(void)
6{
7 bfd *abfd = bfd_openr(NULL, NULL);
8
9 disassembler(bfd_get_arch(abfd),
10 bfd_big_endian(abfd),
11 bfd_get_mach(abfd),
12 abfd);
13
14 return 0;
15}
diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
new file mode 100644
index 000000000000..5ff1246e6194
--- /dev/null
+++ b/tools/build/feature/test-libopencsd.c
@@ -0,0 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <opencsd/c_api/opencsd_c_api.h>
3
4int main(void)
5{
6 (void)ocsd_get_version();
7 return 0;
8}
diff --git a/tools/build/feature/test-pthread-barrier.c b/tools/build/feature/test-pthread-barrier.c
new file mode 100644
index 000000000000..0558d9334d97
--- /dev/null
+++ b/tools/build/feature/test-pthread-barrier.c
@@ -0,0 +1,12 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <stdint.h>
3#include <pthread.h>
4
5int main(void)
6{
7 pthread_barrier_t barrier;
8
9 pthread_barrier_init(&barrier, NULL, 1);
10 pthread_barrier_wait(&barrier);
11 return pthread_barrier_destroy(&barrier);
12}
diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c
index 1c14c2595158..dac4d4131d9b 100644
--- a/tools/gpio/gpio-event-mon.c
+++ b/tools/gpio/gpio-event-mon.c
@@ -14,6 +14,7 @@
14#include <unistd.h> 14#include <unistd.h>
15#include <stdlib.h> 15#include <stdlib.h>
16#include <stdbool.h> 16#include <stdbool.h>
17#include <stdint.h>
17#include <stdio.h> 18#include <stdio.h>
18#include <dirent.h> 19#include <dirent.h>
19#include <errno.h> 20#include <errno.h>
@@ -23,12 +24,13 @@
23#include <getopt.h> 24#include <getopt.h>
24#include <inttypes.h> 25#include <inttypes.h>
25#include <sys/ioctl.h> 26#include <sys/ioctl.h>
27#include <sys/types.h>
26#include <linux/gpio.h> 28#include <linux/gpio.h>
27 29
28int monitor_device(const char *device_name, 30int monitor_device(const char *device_name,
29 unsigned int line, 31 unsigned int line,
30 u_int32_t handleflags, 32 uint32_t handleflags,
31 u_int32_t eventflags, 33 uint32_t eventflags,
32 unsigned int loops) 34 unsigned int loops)
33{ 35{
34 struct gpioevent_request req; 36 struct gpioevent_request req;
@@ -145,8 +147,8 @@ int main(int argc, char **argv)
145 const char *device_name = NULL; 147 const char *device_name = NULL;
146 unsigned int line = -1; 148 unsigned int line = -1;
147 unsigned int loops = 0; 149 unsigned int loops = 0;
148 u_int32_t handleflags = GPIOHANDLE_REQUEST_INPUT; 150 uint32_t handleflags = GPIOHANDLE_REQUEST_INPUT;
149 u_int32_t eventflags = 0; 151 uint32_t eventflags = 0;
150 int c; 152 int c;
151 153
152 while ((c = getopt(argc, argv, "c:n:o:dsrf?")) != -1) { 154 while ((c = getopt(argc, argv, "c:n:o:dsrf?")) != -1) {
diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index 31503819454d..1139d71fa0cf 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -7,9 +7,30 @@ CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS)
7 7
8CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include 8CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
9 9
10all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon 10sbindir ?= /usr/sbin
11libexecdir ?= /usr/libexec
12sharedstatedir ?= /var/lib
13
14ALL_PROGRAMS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
15
16ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh
17
18all: $(ALL_PROGRAMS)
19
11%: %.c 20%: %.c
12 $(CC) $(CFLAGS) -o $@ $^ 21 $(CC) $(CFLAGS) -o $@ $^
13 22
14clean: 23clean:
15 $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon 24 $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
25
26install: all
27 install -d -m 755 $(DESTDIR)$(sbindir); \
28 install -d -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd; \
29 install -d -m 755 $(DESTDIR)$(sharedstatedir); \
30 for program in $(ALL_PROGRAMS); do \
31 install $$program -m 755 $(DESTDIR)$(sbindir); \
32 done; \
33 install -m 755 lsvmbus $(DESTDIR)$(sbindir); \
34 for script in $(ALL_SCRIPTS); do \
35 install $$script -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd/$${script%.sh}; \
36 done
diff --git a/tools/include/asm-generic/bitops/find.h b/tools/include/asm-generic/bitops/find.h
index 9311fadaaab2..16ed1982cb34 100644
--- a/tools/include/asm-generic/bitops/find.h
+++ b/tools/include/asm-generic/bitops/find.h
@@ -16,6 +16,22 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
16 size, unsigned long offset); 16 size, unsigned long offset);
17#endif 17#endif
18 18
19#ifndef find_next_and_bit
20/**
21 * find_next_and_bit - find the next set bit in both memory regions
22 * @addr1: The first address to base the search on
23 * @addr2: The second address to base the search on
24 * @offset: The bitnumber to start searching at
25 * @size: The bitmap size in bits
26 *
27 * Returns the bit number for the next set bit
28 * If no bits are set, returns @size.
29 */
30extern unsigned long find_next_and_bit(const unsigned long *addr1,
31 const unsigned long *addr2, unsigned long size,
32 unsigned long offset);
33#endif
34
19#ifndef find_next_zero_bit 35#ifndef find_next_zero_bit
20 36
21/** 37/**
diff --git a/tools/include/uapi/asm-generic/errno-base.h b/tools/include/uapi/asm-generic/errno-base.h
new file mode 100644
index 000000000000..9653140bff92
--- /dev/null
+++ b/tools/include/uapi/asm-generic/errno-base.h
@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_GENERIC_ERRNO_BASE_H
3#define _ASM_GENERIC_ERRNO_BASE_H
4
5#define EPERM 1 /* Operation not permitted */
6#define ENOENT 2 /* No such file or directory */
7#define ESRCH 3 /* No such process */
8#define EINTR 4 /* Interrupted system call */
9#define EIO 5 /* I/O error */
10#define ENXIO 6 /* No such device or address */
11#define E2BIG 7 /* Argument list too long */
12#define ENOEXEC 8 /* Exec format error */
13#define EBADF 9 /* Bad file number */
14#define ECHILD 10 /* No child processes */
15#define EAGAIN 11 /* Try again */
16#define ENOMEM 12 /* Out of memory */
17#define EACCES 13 /* Permission denied */
18#define EFAULT 14 /* Bad address */
19#define ENOTBLK 15 /* Block device required */
20#define EBUSY 16 /* Device or resource busy */
21#define EEXIST 17 /* File exists */
22#define EXDEV 18 /* Cross-device link */
23#define ENODEV 19 /* No such device */
24#define ENOTDIR 20 /* Not a directory */
25#define EISDIR 21 /* Is a directory */
26#define EINVAL 22 /* Invalid argument */
27#define ENFILE 23 /* File table overflow */
28#define EMFILE 24 /* Too many open files */
29#define ENOTTY 25 /* Not a typewriter */
30#define ETXTBSY 26 /* Text file busy */
31#define EFBIG 27 /* File too large */
32#define ENOSPC 28 /* No space left on device */
33#define ESPIPE 29 /* Illegal seek */
34#define EROFS 30 /* Read-only file system */
35#define EMLINK 31 /* Too many links */
36#define EPIPE 32 /* Broken pipe */
37#define EDOM 33 /* Math argument out of domain of func */
38#define ERANGE 34 /* Math result not representable */
39
40#endif
diff --git a/tools/include/uapi/asm-generic/errno.h b/tools/include/uapi/asm-generic/errno.h
new file mode 100644
index 000000000000..cf9c51ac49f9
--- /dev/null
+++ b/tools/include/uapi/asm-generic/errno.h
@@ -0,0 +1,123 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_GENERIC_ERRNO_H
3#define _ASM_GENERIC_ERRNO_H
4
5#include <asm-generic/errno-base.h>
6
7#define EDEADLK 35 /* Resource deadlock would occur */
8#define ENAMETOOLONG 36 /* File name too long */
9#define ENOLCK 37 /* No record locks available */
10
11/*
12 * This error code is special: arch syscall entry code will return
13 * -ENOSYS if users try to call a syscall that doesn't exist. To keep
14 * failures of syscalls that really do exist distinguishable from
15 * failures due to attempts to use a nonexistent syscall, syscall
16 * implementations should refrain from returning -ENOSYS.
17 */
18#define ENOSYS 38 /* Invalid system call number */
19
20#define ENOTEMPTY 39 /* Directory not empty */
21#define ELOOP 40 /* Too many symbolic links encountered */
22#define EWOULDBLOCK EAGAIN /* Operation would block */
23#define ENOMSG 42 /* No message of desired type */
24#define EIDRM 43 /* Identifier removed */
25#define ECHRNG 44 /* Channel number out of range */
26#define EL2NSYNC 45 /* Level 2 not synchronized */
27#define EL3HLT 46 /* Level 3 halted */
28#define EL3RST 47 /* Level 3 reset */
29#define ELNRNG 48 /* Link number out of range */
30#define EUNATCH 49 /* Protocol driver not attached */
31#define ENOCSI 50 /* No CSI structure available */
32#define EL2HLT 51 /* Level 2 halted */
33#define EBADE 52 /* Invalid exchange */
34#define EBADR 53 /* Invalid request descriptor */
35#define EXFULL 54 /* Exchange full */
36#define ENOANO 55 /* No anode */
37#define EBADRQC 56 /* Invalid request code */
38#define EBADSLT 57 /* Invalid slot */
39
40#define EDEADLOCK EDEADLK
41
42#define EBFONT 59 /* Bad font file format */
43#define ENOSTR 60 /* Device not a stream */
44#define ENODATA 61 /* No data available */
45#define ETIME 62 /* Timer expired */
46#define ENOSR 63 /* Out of streams resources */
47#define ENONET 64 /* Machine is not on the network */
48#define ENOPKG 65 /* Package not installed */
49#define EREMOTE 66 /* Object is remote */
50#define ENOLINK 67 /* Link has been severed */
51#define EADV 68 /* Advertise error */
52#define ESRMNT 69 /* Srmount error */
53#define ECOMM 70 /* Communication error on send */
54#define EPROTO 71 /* Protocol error */
55#define EMULTIHOP 72 /* Multihop attempted */
56#define EDOTDOT 73 /* RFS specific error */
57#define EBADMSG 74 /* Not a data message */
58#define EOVERFLOW 75 /* Value too large for defined data type */
59#define ENOTUNIQ 76 /* Name not unique on network */
60#define EBADFD 77 /* File descriptor in bad state */
61#define EREMCHG 78 /* Remote address changed */
62#define ELIBACC 79 /* Can not access a needed shared library */
63#define ELIBBAD 80 /* Accessing a corrupted shared library */
64#define ELIBSCN 81 /* .lib section in a.out corrupted */
65#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
66#define ELIBEXEC 83 /* Cannot exec a shared library directly */
67#define EILSEQ 84 /* Illegal byte sequence */
68#define ERESTART 85 /* Interrupted system call should be restarted */
69#define ESTRPIPE 86 /* Streams pipe error */
70#define EUSERS 87 /* Too many users */
71#define ENOTSOCK 88 /* Socket operation on non-socket */
72#define EDESTADDRREQ 89 /* Destination address required */
73#define EMSGSIZE 90 /* Message too long */
74#define EPROTOTYPE 91 /* Protocol wrong type for socket */
75#define ENOPROTOOPT 92 /* Protocol not available */
76#define EPROTONOSUPPORT 93 /* Protocol not supported */
77#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
78#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
79#define EPFNOSUPPORT 96 /* Protocol family not supported */
80#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
81#define EADDRINUSE 98 /* Address already in use */
82#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
83#define ENETDOWN 100 /* Network is down */
84#define ENETUNREACH 101 /* Network is unreachable */
85#define ENETRESET 102 /* Network dropped connection because of reset */
86#define ECONNABORTED 103 /* Software caused connection abort */
87#define ECONNRESET 104 /* Connection reset by peer */
88#define ENOBUFS 105 /* No buffer space available */
89#define EISCONN 106 /* Transport endpoint is already connected */
90#define ENOTCONN 107 /* Transport endpoint is not connected */
91#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
92#define ETOOMANYREFS 109 /* Too many references: cannot splice */
93#define ETIMEDOUT 110 /* Connection timed out */
94#define ECONNREFUSED 111 /* Connection refused */
95#define EHOSTDOWN 112 /* Host is down */
96#define EHOSTUNREACH 113 /* No route to host */
97#define EALREADY 114 /* Operation already in progress */
98#define EINPROGRESS 115 /* Operation now in progress */
99#define ESTALE 116 /* Stale file handle */
100#define EUCLEAN 117 /* Structure needs cleaning */
101#define ENOTNAM 118 /* Not a XENIX named type file */
102#define ENAVAIL 119 /* No XENIX semaphores available */
103#define EISNAM 120 /* Is a named type file */
104#define EREMOTEIO 121 /* Remote I/O error */
105#define EDQUOT 122 /* Quota exceeded */
106
107#define ENOMEDIUM 123 /* No medium found */
108#define EMEDIUMTYPE 124 /* Wrong medium type */
109#define ECANCELED 125 /* Operation Canceled */
110#define ENOKEY 126 /* Required key not available */
111#define EKEYEXPIRED 127 /* Key has expired */
112#define EKEYREVOKED 128 /* Key has been revoked */
113#define EKEYREJECTED 129 /* Key was rejected by service */
114
115/* for robust mutexes */
116#define EOWNERDEAD 130 /* Owner died */
117#define ENOTRECOVERABLE 131 /* State not recoverable */
118
119#define ERFKILL 132 /* Operation not possible due to RF-kill */
120
121#define EHWPOISON 133 /* Memory page has hardware error */
122
123#endif
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 4c223ab30293..db6bdc375126 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -17,7 +17,7 @@
17#define BPF_ALU64 0x07 /* alu mode in double word width */ 17#define BPF_ALU64 0x07 /* alu mode in double word width */
18 18
19/* ld/ldx fields */ 19/* ld/ldx fields */
20#define BPF_DW 0x18 /* double word */ 20#define BPF_DW 0x18 /* double word (64-bit) */
21#define BPF_XADD 0xc0 /* exclusive add */ 21#define BPF_XADD 0xc0 /* exclusive add */
22 22
23/* alu/jmp fields */ 23/* alu/jmp fields */
@@ -197,8 +197,14 @@ enum bpf_attach_type {
197 */ 197 */
198#define BPF_F_STRICT_ALIGNMENT (1U << 0) 198#define BPF_F_STRICT_ALIGNMENT (1U << 0)
199 199
200/* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */
200#define BPF_PSEUDO_MAP_FD 1 201#define BPF_PSEUDO_MAP_FD 1
201 202
203/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
204 * offset to another bpf function
205 */
206#define BPF_PSEUDO_CALL 1
207
202/* flags for BPF_MAP_UPDATE_ELEM command */ 208/* flags for BPF_MAP_UPDATE_ELEM command */
203#define BPF_ANY 0 /* create new element or update existing */ 209#define BPF_ANY 0 /* create new element or update existing */
204#define BPF_NOEXIST 1 /* create new element if it didn't exist */ 210#define BPF_NOEXIST 1 /* create new element if it didn't exist */
@@ -239,6 +245,7 @@ union bpf_attr {
239 * BPF_F_NUMA_NODE is set). 245 * BPF_F_NUMA_NODE is set).
240 */ 246 */
241 char map_name[BPF_OBJ_NAME_LEN]; 247 char map_name[BPF_OBJ_NAME_LEN];
248 __u32 map_ifindex; /* ifindex of netdev to create on */
242 }; 249 };
243 250
244 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */ 251 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
@@ -635,6 +642,14 @@ union bpf_attr {
635 * @optlen: length of optval in bytes 642 * @optlen: length of optval in bytes
636 * Return: 0 or negative error 643 * Return: 0 or negative error
637 * 644 *
645 * int bpf_sock_ops_cb_flags_set(bpf_sock_ops, flags)
646 * Set callback flags for sock_ops
647 * @bpf_sock_ops: pointer to bpf_sock_ops_kern struct
648 * @flags: flags value
649 * Return: 0 for no error
650 * -EINVAL if there is no full tcp socket
651 * bits in flags that are not supported by current kernel
652 *
638 * int bpf_skb_adjust_room(skb, len_diff, mode, flags) 653 * int bpf_skb_adjust_room(skb, len_diff, mode, flags)
639 * Grow or shrink room in sk_buff. 654 * Grow or shrink room in sk_buff.
640 * @skb: pointer to skb 655 * @skb: pointer to skb
@@ -677,6 +692,10 @@ union bpf_attr {
677 * @buf: buf to fill 692 * @buf: buf to fill
678 * @buf_size: size of the buf 693 * @buf_size: size of the buf
679 * Return : 0 on success or negative error code 694 * Return : 0 on success or negative error code
695 *
696 * int bpf_override_return(pt_regs, rc)
697 * @pt_regs: pointer to struct pt_regs
698 * @rc: the return value to set
680 */ 699 */
681#define __BPF_FUNC_MAPPER(FN) \ 700#define __BPF_FUNC_MAPPER(FN) \
682 FN(unspec), \ 701 FN(unspec), \
@@ -736,7 +755,9 @@ union bpf_attr {
736 FN(xdp_adjust_meta), \ 755 FN(xdp_adjust_meta), \
737 FN(perf_event_read_value), \ 756 FN(perf_event_read_value), \
738 FN(perf_prog_read_value), \ 757 FN(perf_prog_read_value), \
739 FN(getsockopt), 758 FN(getsockopt), \
759 FN(override_return), \
760 FN(sock_ops_cb_flags_set),
740 761
741/* integer value in 'imm' field of BPF_CALL instruction selects which helper 762/* integer value in 'imm' field of BPF_CALL instruction selects which helper
742 * function eBPF program intends to call 763 * function eBPF program intends to call
@@ -888,6 +909,9 @@ struct xdp_md {
888 __u32 data; 909 __u32 data;
889 __u32 data_end; 910 __u32 data_end;
890 __u32 data_meta; 911 __u32 data_meta;
912 /* Below access go through struct xdp_rxq_info */
913 __u32 ingress_ifindex; /* rxq->dev->ifindex */
914 __u32 rx_queue_index; /* rxq->queue_index */
891}; 915};
892 916
893enum sk_action { 917enum sk_action {
@@ -910,6 +934,9 @@ struct bpf_prog_info {
910 __u32 nr_map_ids; 934 __u32 nr_map_ids;
911 __aligned_u64 map_ids; 935 __aligned_u64 map_ids;
912 char name[BPF_OBJ_NAME_LEN]; 936 char name[BPF_OBJ_NAME_LEN];
937 __u32 ifindex;
938 __u64 netns_dev;
939 __u64 netns_ino;
913} __attribute__((aligned(8))); 940} __attribute__((aligned(8)));
914 941
915struct bpf_map_info { 942struct bpf_map_info {
@@ -920,6 +947,9 @@ struct bpf_map_info {
920 __u32 max_entries; 947 __u32 max_entries;
921 __u32 map_flags; 948 __u32 map_flags;
922 char name[BPF_OBJ_NAME_LEN]; 949 char name[BPF_OBJ_NAME_LEN];
950 __u32 ifindex;
951 __u64 netns_dev;
952 __u64 netns_ino;
923} __attribute__((aligned(8))); 953} __attribute__((aligned(8)));
924 954
925/* User bpf_sock_ops struct to access socket values and specify request ops 955/* User bpf_sock_ops struct to access socket values and specify request ops
@@ -931,8 +961,9 @@ struct bpf_map_info {
931struct bpf_sock_ops { 961struct bpf_sock_ops {
932 __u32 op; 962 __u32 op;
933 union { 963 union {
934 __u32 reply; 964 __u32 args[4]; /* Optionally passed to bpf program */
935 __u32 replylong[4]; 965 __u32 reply; /* Returned by bpf program */
966 __u32 replylong[4]; /* Optionally returned by bpf prog */
936 }; 967 };
937 __u32 family; 968 __u32 family;
938 __u32 remote_ip4; /* Stored in network byte order */ 969 __u32 remote_ip4; /* Stored in network byte order */
@@ -941,8 +972,45 @@ struct bpf_sock_ops {
941 __u32 local_ip6[4]; /* Stored in network byte order */ 972 __u32 local_ip6[4]; /* Stored in network byte order */
942 __u32 remote_port; /* Stored in network byte order */ 973 __u32 remote_port; /* Stored in network byte order */
943 __u32 local_port; /* stored in host byte order */ 974 __u32 local_port; /* stored in host byte order */
975 __u32 is_fullsock; /* Some TCP fields are only valid if
976 * there is a full socket. If not, the
977 * fields read as zero.
978 */
979 __u32 snd_cwnd;
980 __u32 srtt_us; /* Averaged RTT << 3 in usecs */
981 __u32 bpf_sock_ops_cb_flags; /* flags defined in uapi/linux/tcp.h */
982 __u32 state;
983 __u32 rtt_min;
984 __u32 snd_ssthresh;
985 __u32 rcv_nxt;
986 __u32 snd_nxt;
987 __u32 snd_una;
988 __u32 mss_cache;
989 __u32 ecn_flags;
990 __u32 rate_delivered;
991 __u32 rate_interval_us;
992 __u32 packets_out;
993 __u32 retrans_out;
994 __u32 total_retrans;
995 __u32 segs_in;
996 __u32 data_segs_in;
997 __u32 segs_out;
998 __u32 data_segs_out;
999 __u32 lost_out;
1000 __u32 sacked_out;
1001 __u32 sk_txhash;
1002 __u64 bytes_received;
1003 __u64 bytes_acked;
944}; 1004};
945 1005
1006/* Definitions for bpf_sock_ops_cb_flags */
1007#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0)
1008#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1)
1009#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2)
1010#define BPF_SOCK_OPS_ALL_CB_FLAGS 0x7 /* Mask of all currently
1011 * supported cb flags
1012 */
1013
946/* List of known BPF sock_ops operators. 1014/* List of known BPF sock_ops operators.
947 * New entries can only be added at the end 1015 * New entries can only be added at the end
948 */ 1016 */
@@ -976,6 +1044,43 @@ enum {
976 * a congestion threshold. RTTs above 1044 * a congestion threshold. RTTs above
977 * this indicate congestion 1045 * this indicate congestion
978 */ 1046 */
1047 BPF_SOCK_OPS_RTO_CB, /* Called when an RTO has triggered.
1048 * Arg1: value of icsk_retransmits
1049 * Arg2: value of icsk_rto
1050 * Arg3: whether RTO has expired
1051 */
1052 BPF_SOCK_OPS_RETRANS_CB, /* Called when skb is retransmitted.
1053 * Arg1: sequence number of 1st byte
1054 * Arg2: # segments
1055 * Arg3: return value of
1056 * tcp_transmit_skb (0 => success)
1057 */
1058 BPF_SOCK_OPS_STATE_CB, /* Called when TCP changes state.
1059 * Arg1: old_state
1060 * Arg2: new_state
1061 */
1062};
1063
1064/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
1065 * changes between the TCP and BPF versions. Ideally this should never happen.
1066 * If it does, we need to add code to convert them before calling
1067 * the BPF sock_ops function.
1068 */
1069enum {
1070 BPF_TCP_ESTABLISHED = 1,
1071 BPF_TCP_SYN_SENT,
1072 BPF_TCP_SYN_RECV,
1073 BPF_TCP_FIN_WAIT1,
1074 BPF_TCP_FIN_WAIT2,
1075 BPF_TCP_TIME_WAIT,
1076 BPF_TCP_CLOSE,
1077 BPF_TCP_CLOSE_WAIT,
1078 BPF_TCP_LAST_ACK,
1079 BPF_TCP_LISTEN,
1080 BPF_TCP_CLOSING, /* Now a valid state */
1081 BPF_TCP_NEW_SYN_RECV,
1082
1083 BPF_TCP_MAX_STATES /* Leave at the end! */
979}; 1084};
980 1085
981#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */ 1086#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */
@@ -995,7 +1100,8 @@ struct bpf_perf_event_value {
995#define BPF_DEVCG_DEV_CHAR (1ULL << 1) 1100#define BPF_DEVCG_DEV_CHAR (1ULL << 1)
996 1101
997struct bpf_cgroup_dev_ctx { 1102struct bpf_cgroup_dev_ctx {
998 __u32 access_type; /* (access << 16) | type */ 1103 /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */
1104 __u32 access_type;
999 __u32 major; 1105 __u32 major;
1000 __u32 minor; 1106 __u32 minor;
1001}; 1107};
diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h
new file mode 100644
index 000000000000..8616131e2c61
--- /dev/null
+++ b/tools/include/uapi/linux/if_link.h
@@ -0,0 +1,943 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UAPI_LINUX_IF_LINK_H
3#define _UAPI_LINUX_IF_LINK_H
4
5#include <linux/types.h>
6#include <linux/netlink.h>
7
8/* This struct should be in sync with struct rtnl_link_stats64 */
9struct rtnl_link_stats {
10 __u32 rx_packets; /* total packets received */
11 __u32 tx_packets; /* total packets transmitted */
12 __u32 rx_bytes; /* total bytes received */
13 __u32 tx_bytes; /* total bytes transmitted */
14 __u32 rx_errors; /* bad packets received */
15 __u32 tx_errors; /* packet transmit problems */
16 __u32 rx_dropped; /* no space in linux buffers */
17 __u32 tx_dropped; /* no space available in linux */
18 __u32 multicast; /* multicast packets received */
19 __u32 collisions;
20
21 /* detailed rx_errors: */
22 __u32 rx_length_errors;
23 __u32 rx_over_errors; /* receiver ring buff overflow */
24 __u32 rx_crc_errors; /* recved pkt with crc error */
25 __u32 rx_frame_errors; /* recv'd frame alignment error */
26 __u32 rx_fifo_errors; /* recv'r fifo overrun */
27 __u32 rx_missed_errors; /* receiver missed packet */
28
29 /* detailed tx_errors */
30 __u32 tx_aborted_errors;
31 __u32 tx_carrier_errors;
32 __u32 tx_fifo_errors;
33 __u32 tx_heartbeat_errors;
34 __u32 tx_window_errors;
35
36 /* for cslip etc */
37 __u32 rx_compressed;
38 __u32 tx_compressed;
39
40 __u32 rx_nohandler; /* dropped, no handler found */
41};
42
43/* The main device statistics structure */
44struct rtnl_link_stats64 {
45 __u64 rx_packets; /* total packets received */
46 __u64 tx_packets; /* total packets transmitted */
47 __u64 rx_bytes; /* total bytes received */
48 __u64 tx_bytes; /* total bytes transmitted */
49 __u64 rx_errors; /* bad packets received */
50 __u64 tx_errors; /* packet transmit problems */
51 __u64 rx_dropped; /* no space in linux buffers */
52 __u64 tx_dropped; /* no space available in linux */
53 __u64 multicast; /* multicast packets received */
54 __u64 collisions;
55
56 /* detailed rx_errors: */
57 __u64 rx_length_errors;
58 __u64 rx_over_errors; /* receiver ring buff overflow */
59 __u64 rx_crc_errors; /* recved pkt with crc error */
60 __u64 rx_frame_errors; /* recv'd frame alignment error */
61 __u64 rx_fifo_errors; /* recv'r fifo overrun */
62 __u64 rx_missed_errors; /* receiver missed packet */
63
64 /* detailed tx_errors */
65 __u64 tx_aborted_errors;
66 __u64 tx_carrier_errors;
67 __u64 tx_fifo_errors;
68 __u64 tx_heartbeat_errors;
69 __u64 tx_window_errors;
70
71 /* for cslip etc */
72 __u64 rx_compressed;
73 __u64 tx_compressed;
74
75 __u64 rx_nohandler; /* dropped, no handler found */
76};
77
78/* The struct should be in sync with struct ifmap */
79struct rtnl_link_ifmap {
80 __u64 mem_start;
81 __u64 mem_end;
82 __u64 base_addr;
83 __u16 irq;
84 __u8 dma;
85 __u8 port;
86};
87
88/*
89 * IFLA_AF_SPEC
90 * Contains nested attributes for address family specific attributes.
91 * Each address family may create a attribute with the address family
92 * number as type and create its own attribute structure in it.
93 *
94 * Example:
95 * [IFLA_AF_SPEC] = {
96 * [AF_INET] = {
97 * [IFLA_INET_CONF] = ...,
98 * },
99 * [AF_INET6] = {
100 * [IFLA_INET6_FLAGS] = ...,
101 * [IFLA_INET6_CONF] = ...,
102 * }
103 * }
104 */
105
106enum {
107 IFLA_UNSPEC,
108 IFLA_ADDRESS,
109 IFLA_BROADCAST,
110 IFLA_IFNAME,
111 IFLA_MTU,
112 IFLA_LINK,
113 IFLA_QDISC,
114 IFLA_STATS,
115 IFLA_COST,
116#define IFLA_COST IFLA_COST
117 IFLA_PRIORITY,
118#define IFLA_PRIORITY IFLA_PRIORITY
119 IFLA_MASTER,
120#define IFLA_MASTER IFLA_MASTER
121 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
122#define IFLA_WIRELESS IFLA_WIRELESS
123 IFLA_PROTINFO, /* Protocol specific information for a link */
124#define IFLA_PROTINFO IFLA_PROTINFO
125 IFLA_TXQLEN,
126#define IFLA_TXQLEN IFLA_TXQLEN
127 IFLA_MAP,
128#define IFLA_MAP IFLA_MAP
129 IFLA_WEIGHT,
130#define IFLA_WEIGHT IFLA_WEIGHT
131 IFLA_OPERSTATE,
132 IFLA_LINKMODE,
133 IFLA_LINKINFO,
134#define IFLA_LINKINFO IFLA_LINKINFO
135 IFLA_NET_NS_PID,
136 IFLA_IFALIAS,
137 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
138 IFLA_VFINFO_LIST,
139 IFLA_STATS64,
140 IFLA_VF_PORTS,
141 IFLA_PORT_SELF,
142 IFLA_AF_SPEC,
143 IFLA_GROUP, /* Group the device belongs to */
144 IFLA_NET_NS_FD,
145 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
146 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
147#define IFLA_PROMISCUITY IFLA_PROMISCUITY
148 IFLA_NUM_TX_QUEUES,
149 IFLA_NUM_RX_QUEUES,
150 IFLA_CARRIER,
151 IFLA_PHYS_PORT_ID,
152 IFLA_CARRIER_CHANGES,
153 IFLA_PHYS_SWITCH_ID,
154 IFLA_LINK_NETNSID,
155 IFLA_PHYS_PORT_NAME,
156 IFLA_PROTO_DOWN,
157 IFLA_GSO_MAX_SEGS,
158 IFLA_GSO_MAX_SIZE,
159 IFLA_PAD,
160 IFLA_XDP,
161 IFLA_EVENT,
162 IFLA_NEW_NETNSID,
163 IFLA_IF_NETNSID,
164 IFLA_CARRIER_UP_COUNT,
165 IFLA_CARRIER_DOWN_COUNT,
166 __IFLA_MAX
167};
168
169
170#define IFLA_MAX (__IFLA_MAX - 1)
171
172/* backwards compatibility for userspace */
173#ifndef __KERNEL__
174#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
175#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
176#endif
177
178enum {
179 IFLA_INET_UNSPEC,
180 IFLA_INET_CONF,
181 __IFLA_INET_MAX,
182};
183
184#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
185
186/* ifi_flags.
187
188 IFF_* flags.
189
190 The only change is:
191 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
192 more not changeable by user. They describe link media
193 characteristics and set by device driver.
194
195 Comments:
196 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
197 - If neither of these three flags are set;
198 the interface is NBMA.
199
200 - IFF_MULTICAST does not mean anything special:
201 multicasts can be used on all not-NBMA links.
202 IFF_MULTICAST means that this media uses special encapsulation
203 for multicast frames. Apparently, all IFF_POINTOPOINT and
204 IFF_BROADCAST devices are able to use multicasts too.
205 */
206
207/* IFLA_LINK.
208 For usual devices it is equal ifi_index.
209 If it is a "virtual interface" (f.e. tunnel), ifi_link
210 can point to real physical interface (f.e. for bandwidth calculations),
211 or maybe 0, what means, that real media is unknown (usual
212 for IPIP tunnels, when route to endpoint is allowed to change)
213 */
214
215/* Subtype attributes for IFLA_PROTINFO */
216enum {
217 IFLA_INET6_UNSPEC,
218 IFLA_INET6_FLAGS, /* link flags */
219 IFLA_INET6_CONF, /* sysctl parameters */
220 IFLA_INET6_STATS, /* statistics */
221 IFLA_INET6_MCAST, /* MC things. What of them? */
222 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
223 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
224 IFLA_INET6_TOKEN, /* device token */
225 IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
226 __IFLA_INET6_MAX
227};
228
229#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
230
231enum in6_addr_gen_mode {
232 IN6_ADDR_GEN_MODE_EUI64,
233 IN6_ADDR_GEN_MODE_NONE,
234 IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
235 IN6_ADDR_GEN_MODE_RANDOM,
236};
237
238/* Bridge section */
239
240enum {
241 IFLA_BR_UNSPEC,
242 IFLA_BR_FORWARD_DELAY,
243 IFLA_BR_HELLO_TIME,
244 IFLA_BR_MAX_AGE,
245 IFLA_BR_AGEING_TIME,
246 IFLA_BR_STP_STATE,
247 IFLA_BR_PRIORITY,
248 IFLA_BR_VLAN_FILTERING,
249 IFLA_BR_VLAN_PROTOCOL,
250 IFLA_BR_GROUP_FWD_MASK,
251 IFLA_BR_ROOT_ID,
252 IFLA_BR_BRIDGE_ID,
253 IFLA_BR_ROOT_PORT,
254 IFLA_BR_ROOT_PATH_COST,
255 IFLA_BR_TOPOLOGY_CHANGE,
256 IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
257 IFLA_BR_HELLO_TIMER,
258 IFLA_BR_TCN_TIMER,
259 IFLA_BR_TOPOLOGY_CHANGE_TIMER,
260 IFLA_BR_GC_TIMER,
261 IFLA_BR_GROUP_ADDR,
262 IFLA_BR_FDB_FLUSH,
263 IFLA_BR_MCAST_ROUTER,
264 IFLA_BR_MCAST_SNOOPING,
265 IFLA_BR_MCAST_QUERY_USE_IFADDR,
266 IFLA_BR_MCAST_QUERIER,
267 IFLA_BR_MCAST_HASH_ELASTICITY,
268 IFLA_BR_MCAST_HASH_MAX,
269 IFLA_BR_MCAST_LAST_MEMBER_CNT,
270 IFLA_BR_MCAST_STARTUP_QUERY_CNT,
271 IFLA_BR_MCAST_LAST_MEMBER_INTVL,
272 IFLA_BR_MCAST_MEMBERSHIP_INTVL,
273 IFLA_BR_MCAST_QUERIER_INTVL,
274 IFLA_BR_MCAST_QUERY_INTVL,
275 IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
276 IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
277 IFLA_BR_NF_CALL_IPTABLES,
278 IFLA_BR_NF_CALL_IP6TABLES,
279 IFLA_BR_NF_CALL_ARPTABLES,
280 IFLA_BR_VLAN_DEFAULT_PVID,
281 IFLA_BR_PAD,
282 IFLA_BR_VLAN_STATS_ENABLED,
283 IFLA_BR_MCAST_STATS_ENABLED,
284 IFLA_BR_MCAST_IGMP_VERSION,
285 IFLA_BR_MCAST_MLD_VERSION,
286 __IFLA_BR_MAX,
287};
288
289#define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
290
291struct ifla_bridge_id {
292 __u8 prio[2];
293 __u8 addr[6]; /* ETH_ALEN */
294};
295
296enum {
297 BRIDGE_MODE_UNSPEC,
298 BRIDGE_MODE_HAIRPIN,
299};
300
301enum {
302 IFLA_BRPORT_UNSPEC,
303 IFLA_BRPORT_STATE, /* Spanning tree state */
304 IFLA_BRPORT_PRIORITY, /* " priority */
305 IFLA_BRPORT_COST, /* " cost */
306 IFLA_BRPORT_MODE, /* mode (hairpin) */
307 IFLA_BRPORT_GUARD, /* bpdu guard */
308 IFLA_BRPORT_PROTECT, /* root port protection */
309 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
310 IFLA_BRPORT_LEARNING, /* mac learning */
311 IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
312 IFLA_BRPORT_PROXYARP, /* proxy ARP */
313 IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
314 IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
315 IFLA_BRPORT_ROOT_ID, /* designated root */
316 IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
317 IFLA_BRPORT_DESIGNATED_PORT,
318 IFLA_BRPORT_DESIGNATED_COST,
319 IFLA_BRPORT_ID,
320 IFLA_BRPORT_NO,
321 IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
322 IFLA_BRPORT_CONFIG_PENDING,
323 IFLA_BRPORT_MESSAGE_AGE_TIMER,
324 IFLA_BRPORT_FORWARD_DELAY_TIMER,
325 IFLA_BRPORT_HOLD_TIMER,
326 IFLA_BRPORT_FLUSH,
327 IFLA_BRPORT_MULTICAST_ROUTER,
328 IFLA_BRPORT_PAD,
329 IFLA_BRPORT_MCAST_FLOOD,
330 IFLA_BRPORT_MCAST_TO_UCAST,
331 IFLA_BRPORT_VLAN_TUNNEL,
332 IFLA_BRPORT_BCAST_FLOOD,
333 IFLA_BRPORT_GROUP_FWD_MASK,
334 IFLA_BRPORT_NEIGH_SUPPRESS,
335 __IFLA_BRPORT_MAX
336};
337#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
338
339struct ifla_cacheinfo {
340 __u32 max_reasm_len;
341 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
342 __u32 reachable_time;
343 __u32 retrans_time;
344};
345
346enum {
347 IFLA_INFO_UNSPEC,
348 IFLA_INFO_KIND,
349 IFLA_INFO_DATA,
350 IFLA_INFO_XSTATS,
351 IFLA_INFO_SLAVE_KIND,
352 IFLA_INFO_SLAVE_DATA,
353 __IFLA_INFO_MAX,
354};
355
356#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
357
358/* VLAN section */
359
360enum {
361 IFLA_VLAN_UNSPEC,
362 IFLA_VLAN_ID,
363 IFLA_VLAN_FLAGS,
364 IFLA_VLAN_EGRESS_QOS,
365 IFLA_VLAN_INGRESS_QOS,
366 IFLA_VLAN_PROTOCOL,
367 __IFLA_VLAN_MAX,
368};
369
370#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
371
372struct ifla_vlan_flags {
373 __u32 flags;
374 __u32 mask;
375};
376
377enum {
378 IFLA_VLAN_QOS_UNSPEC,
379 IFLA_VLAN_QOS_MAPPING,
380 __IFLA_VLAN_QOS_MAX
381};
382
383#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
384
385struct ifla_vlan_qos_mapping {
386 __u32 from;
387 __u32 to;
388};
389
390/* MACVLAN section */
391enum {
392 IFLA_MACVLAN_UNSPEC,
393 IFLA_MACVLAN_MODE,
394 IFLA_MACVLAN_FLAGS,
395 IFLA_MACVLAN_MACADDR_MODE,
396 IFLA_MACVLAN_MACADDR,
397 IFLA_MACVLAN_MACADDR_DATA,
398 IFLA_MACVLAN_MACADDR_COUNT,
399 __IFLA_MACVLAN_MAX,
400};
401
402#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
403
404enum macvlan_mode {
405 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
406 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
407 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
408 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
409 MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
410};
411
412enum macvlan_macaddr_mode {
413 MACVLAN_MACADDR_ADD,
414 MACVLAN_MACADDR_DEL,
415 MACVLAN_MACADDR_FLUSH,
416 MACVLAN_MACADDR_SET,
417};
418
419#define MACVLAN_FLAG_NOPROMISC 1
420
421/* VRF section */
422enum {
423 IFLA_VRF_UNSPEC,
424 IFLA_VRF_TABLE,
425 __IFLA_VRF_MAX
426};
427
428#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
429
430enum {
431 IFLA_VRF_PORT_UNSPEC,
432 IFLA_VRF_PORT_TABLE,
433 __IFLA_VRF_PORT_MAX
434};
435
436#define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
437
438/* MACSEC section */
439enum {
440 IFLA_MACSEC_UNSPEC,
441 IFLA_MACSEC_SCI,
442 IFLA_MACSEC_PORT,
443 IFLA_MACSEC_ICV_LEN,
444 IFLA_MACSEC_CIPHER_SUITE,
445 IFLA_MACSEC_WINDOW,
446 IFLA_MACSEC_ENCODING_SA,
447 IFLA_MACSEC_ENCRYPT,
448 IFLA_MACSEC_PROTECT,
449 IFLA_MACSEC_INC_SCI,
450 IFLA_MACSEC_ES,
451 IFLA_MACSEC_SCB,
452 IFLA_MACSEC_REPLAY_PROTECT,
453 IFLA_MACSEC_VALIDATION,
454 IFLA_MACSEC_PAD,
455 __IFLA_MACSEC_MAX,
456};
457
458#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
459
460enum macsec_validation_type {
461 MACSEC_VALIDATE_DISABLED = 0,
462 MACSEC_VALIDATE_CHECK = 1,
463 MACSEC_VALIDATE_STRICT = 2,
464 __MACSEC_VALIDATE_END,
465 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
466};
467
468/* IPVLAN section */
469enum {
470 IFLA_IPVLAN_UNSPEC,
471 IFLA_IPVLAN_MODE,
472 IFLA_IPVLAN_FLAGS,
473 __IFLA_IPVLAN_MAX
474};
475
476#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
477
478enum ipvlan_mode {
479 IPVLAN_MODE_L2 = 0,
480 IPVLAN_MODE_L3,
481 IPVLAN_MODE_L3S,
482 IPVLAN_MODE_MAX
483};
484
485#define IPVLAN_F_PRIVATE 0x01
486#define IPVLAN_F_VEPA 0x02
487
488/* VXLAN section */
489enum {
490 IFLA_VXLAN_UNSPEC,
491 IFLA_VXLAN_ID,
492 IFLA_VXLAN_GROUP, /* group or remote address */
493 IFLA_VXLAN_LINK,
494 IFLA_VXLAN_LOCAL,
495 IFLA_VXLAN_TTL,
496 IFLA_VXLAN_TOS,
497 IFLA_VXLAN_LEARNING,
498 IFLA_VXLAN_AGEING,
499 IFLA_VXLAN_LIMIT,
500 IFLA_VXLAN_PORT_RANGE, /* source port */
501 IFLA_VXLAN_PROXY,
502 IFLA_VXLAN_RSC,
503 IFLA_VXLAN_L2MISS,
504 IFLA_VXLAN_L3MISS,
505 IFLA_VXLAN_PORT, /* destination port */
506 IFLA_VXLAN_GROUP6,
507 IFLA_VXLAN_LOCAL6,
508 IFLA_VXLAN_UDP_CSUM,
509 IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
510 IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
511 IFLA_VXLAN_REMCSUM_TX,
512 IFLA_VXLAN_REMCSUM_RX,
513 IFLA_VXLAN_GBP,
514 IFLA_VXLAN_REMCSUM_NOPARTIAL,
515 IFLA_VXLAN_COLLECT_METADATA,
516 IFLA_VXLAN_LABEL,
517 IFLA_VXLAN_GPE,
518 __IFLA_VXLAN_MAX
519};
520#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
521
522struct ifla_vxlan_port_range {
523 __be16 low;
524 __be16 high;
525};
526
527/* GENEVE section */
528enum {
529 IFLA_GENEVE_UNSPEC,
530 IFLA_GENEVE_ID,
531 IFLA_GENEVE_REMOTE,
532 IFLA_GENEVE_TTL,
533 IFLA_GENEVE_TOS,
534 IFLA_GENEVE_PORT, /* destination port */
535 IFLA_GENEVE_COLLECT_METADATA,
536 IFLA_GENEVE_REMOTE6,
537 IFLA_GENEVE_UDP_CSUM,
538 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
539 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
540 IFLA_GENEVE_LABEL,
541 __IFLA_GENEVE_MAX
542};
543#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
544
545/* PPP section */
546enum {
547 IFLA_PPP_UNSPEC,
548 IFLA_PPP_DEV_FD,
549 __IFLA_PPP_MAX
550};
551#define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
552
553/* GTP section */
554
555enum ifla_gtp_role {
556 GTP_ROLE_GGSN = 0,
557 GTP_ROLE_SGSN,
558};
559
560enum {
561 IFLA_GTP_UNSPEC,
562 IFLA_GTP_FD0,
563 IFLA_GTP_FD1,
564 IFLA_GTP_PDP_HASHSIZE,
565 IFLA_GTP_ROLE,
566 __IFLA_GTP_MAX,
567};
568#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
569
570/* Bonding section */
571
572enum {
573 IFLA_BOND_UNSPEC,
574 IFLA_BOND_MODE,
575 IFLA_BOND_ACTIVE_SLAVE,
576 IFLA_BOND_MIIMON,
577 IFLA_BOND_UPDELAY,
578 IFLA_BOND_DOWNDELAY,
579 IFLA_BOND_USE_CARRIER,
580 IFLA_BOND_ARP_INTERVAL,
581 IFLA_BOND_ARP_IP_TARGET,
582 IFLA_BOND_ARP_VALIDATE,
583 IFLA_BOND_ARP_ALL_TARGETS,
584 IFLA_BOND_PRIMARY,
585 IFLA_BOND_PRIMARY_RESELECT,
586 IFLA_BOND_FAIL_OVER_MAC,
587 IFLA_BOND_XMIT_HASH_POLICY,
588 IFLA_BOND_RESEND_IGMP,
589 IFLA_BOND_NUM_PEER_NOTIF,
590 IFLA_BOND_ALL_SLAVES_ACTIVE,
591 IFLA_BOND_MIN_LINKS,
592 IFLA_BOND_LP_INTERVAL,
593 IFLA_BOND_PACKETS_PER_SLAVE,
594 IFLA_BOND_AD_LACP_RATE,
595 IFLA_BOND_AD_SELECT,
596 IFLA_BOND_AD_INFO,
597 IFLA_BOND_AD_ACTOR_SYS_PRIO,
598 IFLA_BOND_AD_USER_PORT_KEY,
599 IFLA_BOND_AD_ACTOR_SYSTEM,
600 IFLA_BOND_TLB_DYNAMIC_LB,
601 __IFLA_BOND_MAX,
602};
603
604#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
605
606enum {
607 IFLA_BOND_AD_INFO_UNSPEC,
608 IFLA_BOND_AD_INFO_AGGREGATOR,
609 IFLA_BOND_AD_INFO_NUM_PORTS,
610 IFLA_BOND_AD_INFO_ACTOR_KEY,
611 IFLA_BOND_AD_INFO_PARTNER_KEY,
612 IFLA_BOND_AD_INFO_PARTNER_MAC,
613 __IFLA_BOND_AD_INFO_MAX,
614};
615
616#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
617
618enum {
619 IFLA_BOND_SLAVE_UNSPEC,
620 IFLA_BOND_SLAVE_STATE,
621 IFLA_BOND_SLAVE_MII_STATUS,
622 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
623 IFLA_BOND_SLAVE_PERM_HWADDR,
624 IFLA_BOND_SLAVE_QUEUE_ID,
625 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
626 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
627 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
628 __IFLA_BOND_SLAVE_MAX,
629};
630
631#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
632
633/* SR-IOV virtual function management section */
634
635enum {
636 IFLA_VF_INFO_UNSPEC,
637 IFLA_VF_INFO,
638 __IFLA_VF_INFO_MAX,
639};
640
641#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
642
643enum {
644 IFLA_VF_UNSPEC,
645 IFLA_VF_MAC, /* Hardware queue specific attributes */
646 IFLA_VF_VLAN, /* VLAN ID and QoS */
647 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
648 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
649 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
650 IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
651 IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
652 * on/off switch
653 */
654 IFLA_VF_STATS, /* network device statistics */
655 IFLA_VF_TRUST, /* Trust VF */
656 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
657 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
658 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
659 __IFLA_VF_MAX,
660};
661
662#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
663
664struct ifla_vf_mac {
665 __u32 vf;
666 __u8 mac[32]; /* MAX_ADDR_LEN */
667};
668
669struct ifla_vf_vlan {
670 __u32 vf;
671 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
672 __u32 qos;
673};
674
675enum {
676 IFLA_VF_VLAN_INFO_UNSPEC,
677 IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
678 __IFLA_VF_VLAN_INFO_MAX,
679};
680
681#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
682#define MAX_VLAN_LIST_LEN 1
683
684struct ifla_vf_vlan_info {
685 __u32 vf;
686 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
687 __u32 qos;
688 __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
689};
690
691struct ifla_vf_tx_rate {
692 __u32 vf;
693 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
694};
695
696struct ifla_vf_rate {
697 __u32 vf;
698 __u32 min_tx_rate; /* Min Bandwidth in Mbps */
699 __u32 max_tx_rate; /* Max Bandwidth in Mbps */
700};
701
702struct ifla_vf_spoofchk {
703 __u32 vf;
704 __u32 setting;
705};
706
707struct ifla_vf_guid {
708 __u32 vf;
709 __u64 guid;
710};
711
712enum {
713 IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
714 IFLA_VF_LINK_STATE_ENABLE, /* link always up */
715 IFLA_VF_LINK_STATE_DISABLE, /* link always down */
716 __IFLA_VF_LINK_STATE_MAX,
717};
718
719struct ifla_vf_link_state {
720 __u32 vf;
721 __u32 link_state;
722};
723
724struct ifla_vf_rss_query_en {
725 __u32 vf;
726 __u32 setting;
727};
728
729enum {
730 IFLA_VF_STATS_RX_PACKETS,
731 IFLA_VF_STATS_TX_PACKETS,
732 IFLA_VF_STATS_RX_BYTES,
733 IFLA_VF_STATS_TX_BYTES,
734 IFLA_VF_STATS_BROADCAST,
735 IFLA_VF_STATS_MULTICAST,
736 IFLA_VF_STATS_PAD,
737 IFLA_VF_STATS_RX_DROPPED,
738 IFLA_VF_STATS_TX_DROPPED,
739 __IFLA_VF_STATS_MAX,
740};
741
742#define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
743
744struct ifla_vf_trust {
745 __u32 vf;
746 __u32 setting;
747};
748
749/* VF ports management section
750 *
751 * Nested layout of set/get msg is:
752 *
753 * [IFLA_NUM_VF]
754 * [IFLA_VF_PORTS]
755 * [IFLA_VF_PORT]
756 * [IFLA_PORT_*], ...
757 * [IFLA_VF_PORT]
758 * [IFLA_PORT_*], ...
759 * ...
760 * [IFLA_PORT_SELF]
761 * [IFLA_PORT_*], ...
762 */
763
764enum {
765 IFLA_VF_PORT_UNSPEC,
766 IFLA_VF_PORT, /* nest */
767 __IFLA_VF_PORT_MAX,
768};
769
770#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
771
772enum {
773 IFLA_PORT_UNSPEC,
774 IFLA_PORT_VF, /* __u32 */
775 IFLA_PORT_PROFILE, /* string */
776 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
777 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
778 IFLA_PORT_HOST_UUID, /* binary UUID */
779 IFLA_PORT_REQUEST, /* __u8 */
780 IFLA_PORT_RESPONSE, /* __u16, output only */
781 __IFLA_PORT_MAX,
782};
783
784#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
785
786#define PORT_PROFILE_MAX 40
787#define PORT_UUID_MAX 16
788#define PORT_SELF_VF -1
789
790enum {
791 PORT_REQUEST_PREASSOCIATE = 0,
792 PORT_REQUEST_PREASSOCIATE_RR,
793 PORT_REQUEST_ASSOCIATE,
794 PORT_REQUEST_DISASSOCIATE,
795};
796
797enum {
798 PORT_VDP_RESPONSE_SUCCESS = 0,
799 PORT_VDP_RESPONSE_INVALID_FORMAT,
800 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
801 PORT_VDP_RESPONSE_UNUSED_VTID,
802 PORT_VDP_RESPONSE_VTID_VIOLATION,
803 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
804 PORT_VDP_RESPONSE_OUT_OF_SYNC,
805 /* 0x08-0xFF reserved for future VDP use */
806 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
807 PORT_PROFILE_RESPONSE_INPROGRESS,
808 PORT_PROFILE_RESPONSE_INVALID,
809 PORT_PROFILE_RESPONSE_BADSTATE,
810 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
811 PORT_PROFILE_RESPONSE_ERROR,
812};
813
814struct ifla_port_vsi {
815 __u8 vsi_mgr_id;
816 __u8 vsi_type_id[3];
817 __u8 vsi_type_version;
818 __u8 pad[3];
819};
820
821
822/* IPoIB section */
823
824enum {
825 IFLA_IPOIB_UNSPEC,
826 IFLA_IPOIB_PKEY,
827 IFLA_IPOIB_MODE,
828 IFLA_IPOIB_UMCAST,
829 __IFLA_IPOIB_MAX
830};
831
832enum {
833 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
834 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
835};
836
837#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
838
839
840/* HSR section */
841
842enum {
843 IFLA_HSR_UNSPEC,
844 IFLA_HSR_SLAVE1,
845 IFLA_HSR_SLAVE2,
846 IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
847 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
848 IFLA_HSR_SEQ_NR,
849 IFLA_HSR_VERSION, /* HSR version */
850 __IFLA_HSR_MAX,
851};
852
853#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
854
855/* STATS section */
856
857struct if_stats_msg {
858 __u8 family;
859 __u8 pad1;
860 __u16 pad2;
861 __u32 ifindex;
862 __u32 filter_mask;
863};
864
865/* A stats attribute can be netdev specific or a global stat.
866 * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
867 */
868enum {
869 IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
870 IFLA_STATS_LINK_64,
871 IFLA_STATS_LINK_XSTATS,
872 IFLA_STATS_LINK_XSTATS_SLAVE,
873 IFLA_STATS_LINK_OFFLOAD_XSTATS,
874 IFLA_STATS_AF_SPEC,
875 __IFLA_STATS_MAX,
876};
877
878#define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
879
880#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
881
882/* These are embedded into IFLA_STATS_LINK_XSTATS:
883 * [IFLA_STATS_LINK_XSTATS]
884 * -> [LINK_XSTATS_TYPE_xxx]
885 * -> [rtnl link type specific attributes]
886 */
887enum {
888 LINK_XSTATS_TYPE_UNSPEC,
889 LINK_XSTATS_TYPE_BRIDGE,
890 __LINK_XSTATS_TYPE_MAX
891};
892#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
893
894/* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
895enum {
896 IFLA_OFFLOAD_XSTATS_UNSPEC,
897 IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
898 __IFLA_OFFLOAD_XSTATS_MAX
899};
900#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
901
902/* XDP section */
903
904#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
905#define XDP_FLAGS_SKB_MODE (1U << 1)
906#define XDP_FLAGS_DRV_MODE (1U << 2)
907#define XDP_FLAGS_HW_MODE (1U << 3)
908#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
909 XDP_FLAGS_DRV_MODE | \
910 XDP_FLAGS_HW_MODE)
911#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
912 XDP_FLAGS_MODES)
913
914/* These are stored into IFLA_XDP_ATTACHED on dump. */
915enum {
916 XDP_ATTACHED_NONE = 0,
917 XDP_ATTACHED_DRV,
918 XDP_ATTACHED_SKB,
919 XDP_ATTACHED_HW,
920};
921
922enum {
923 IFLA_XDP_UNSPEC,
924 IFLA_XDP_FD,
925 IFLA_XDP_ATTACHED,
926 IFLA_XDP_FLAGS,
927 IFLA_XDP_PROG_ID,
928 __IFLA_XDP_MAX,
929};
930
931#define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
932
933enum {
934 IFLA_EVENT_NONE,
935 IFLA_EVENT_REBOOT, /* internal reset / reboot */
936 IFLA_EVENT_FEATURES, /* change in offload features */
937 IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
938 IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
939 IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
940 IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
941};
942
943#endif /* _UAPI_LINUX_IF_LINK_H */
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 496e59a2738b..8fb90a0819c3 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -932,6 +932,8 @@ struct kvm_ppc_resize_hpt {
932#define KVM_CAP_HYPERV_SYNIC2 148 932#define KVM_CAP_HYPERV_SYNIC2 148
933#define KVM_CAP_HYPERV_VP_INDEX 149 933#define KVM_CAP_HYPERV_VP_INDEX 149
934#define KVM_CAP_S390_AIS_MIGRATION 150 934#define KVM_CAP_S390_AIS_MIGRATION 150
935#define KVM_CAP_PPC_GET_CPU_CHAR 151
936#define KVM_CAP_S390_BPB 152
935 937
936#ifdef KVM_CAP_IRQ_ROUTING 938#ifdef KVM_CAP_IRQ_ROUTING
937 939
@@ -1261,6 +1263,8 @@ struct kvm_s390_ucas_mapping {
1261#define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg) 1263#define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg)
1262/* Available with KVM_CAP_PPC_RADIX_MMU */ 1264/* Available with KVM_CAP_PPC_RADIX_MMU */
1263#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info) 1265#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)
1266/* Available with KVM_CAP_PPC_GET_CPU_CHAR */
1267#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
1264 1268
1265/* ioctl for vm fd */ 1269/* ioctl for vm fd */
1266#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device) 1270#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)
diff --git a/tools/include/uapi/linux/netlink.h b/tools/include/uapi/linux/netlink.h
new file mode 100644
index 000000000000..776bc92e9118
--- /dev/null
+++ b/tools/include/uapi/linux/netlink.h
@@ -0,0 +1,251 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UAPI__LINUX_NETLINK_H
3#define _UAPI__LINUX_NETLINK_H
4
5#include <linux/kernel.h>
6#include <linux/socket.h> /* for __kernel_sa_family_t */
7#include <linux/types.h>
8
9#define NETLINK_ROUTE 0 /* Routing/device hook */
10#define NETLINK_UNUSED 1 /* Unused number */
11#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
12#define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */
13#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
14#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
15#define NETLINK_XFRM 6 /* ipsec */
16#define NETLINK_SELINUX 7 /* SELinux event notifications */
17#define NETLINK_ISCSI 8 /* Open-iSCSI */
18#define NETLINK_AUDIT 9 /* auditing */
19#define NETLINK_FIB_LOOKUP 10
20#define NETLINK_CONNECTOR 11
21#define NETLINK_NETFILTER 12 /* netfilter subsystem */
22#define NETLINK_IP6_FW 13
23#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
24#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
25#define NETLINK_GENERIC 16
26/* leave room for NETLINK_DM (DM Events) */
27#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
28#define NETLINK_ECRYPTFS 19
29#define NETLINK_RDMA 20
30#define NETLINK_CRYPTO 21 /* Crypto layer */
31#define NETLINK_SMC 22 /* SMC monitoring */
32
33#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
34
35#define MAX_LINKS 32
36
37struct sockaddr_nl {
38 __kernel_sa_family_t nl_family; /* AF_NETLINK */
39 unsigned short nl_pad; /* zero */
40 __u32 nl_pid; /* port ID */
41 __u32 nl_groups; /* multicast groups mask */
42};
43
44struct nlmsghdr {
45 __u32 nlmsg_len; /* Length of message including header */
46 __u16 nlmsg_type; /* Message content */
47 __u16 nlmsg_flags; /* Additional flags */
48 __u32 nlmsg_seq; /* Sequence number */
49 __u32 nlmsg_pid; /* Sending process port ID */
50};
51
52/* Flags values */
53
54#define NLM_F_REQUEST 0x01 /* It is request message. */
55#define NLM_F_MULTI 0x02 /* Multipart message, terminated by NLMSG_DONE */
56#define NLM_F_ACK 0x04 /* Reply with ack, with zero or error code */
57#define NLM_F_ECHO 0x08 /* Echo this request */
58#define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */
59#define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */
60
61/* Modifiers to GET request */
62#define NLM_F_ROOT 0x100 /* specify tree root */
63#define NLM_F_MATCH 0x200 /* return all matching */
64#define NLM_F_ATOMIC 0x400 /* atomic GET */
65#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
66
67/* Modifiers to NEW request */
68#define NLM_F_REPLACE 0x100 /* Override existing */
69#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
70#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
71#define NLM_F_APPEND 0x800 /* Add to end of list */
72
73/* Modifiers to DELETE request */
74#define NLM_F_NONREC 0x100 /* Do not delete recursively */
75
76/* Flags for ACK message */
77#define NLM_F_CAPPED 0x100 /* request was capped */
78#define NLM_F_ACK_TLVS 0x200 /* extended ACK TVLs were included */
79
80/*
81 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
82 4.4BSD CHANGE NLM_F_REPLACE
83
84 True CHANGE NLM_F_CREATE|NLM_F_REPLACE
85 Append NLM_F_CREATE
86 Check NLM_F_EXCL
87 */
88
89#define NLMSG_ALIGNTO 4U
90#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
91#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
92#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
93#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
94#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
95#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
97#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
99 (nlh)->nlmsg_len <= (len))
100#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
101
102#define NLMSG_NOOP 0x1 /* Nothing. */
103#define NLMSG_ERROR 0x2 /* Error */
104#define NLMSG_DONE 0x3 /* End of a dump */
105#define NLMSG_OVERRUN 0x4 /* Data lost */
106
107#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
108
109struct nlmsgerr {
110 int error;
111 struct nlmsghdr msg;
112 /*
113 * followed by the message contents unless NETLINK_CAP_ACK was set
114 * or the ACK indicates success (error == 0)
115 * message length is aligned with NLMSG_ALIGN()
116 */
117 /*
118 * followed by TLVs defined in enum nlmsgerr_attrs
119 * if NETLINK_EXT_ACK was set
120 */
121};
122
123/**
124 * enum nlmsgerr_attrs - nlmsgerr attributes
125 * @NLMSGERR_ATTR_UNUSED: unused
126 * @NLMSGERR_ATTR_MSG: error message string (string)
127 * @NLMSGERR_ATTR_OFFS: offset of the invalid attribute in the original
128 * message, counting from the beginning of the header (u32)
129 * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to
130 * be used - in the success case - to identify a created
131 * object or operation or similar (binary)
132 * @__NLMSGERR_ATTR_MAX: number of attributes
133 * @NLMSGERR_ATTR_MAX: highest attribute number
134 */
135enum nlmsgerr_attrs {
136 NLMSGERR_ATTR_UNUSED,
137 NLMSGERR_ATTR_MSG,
138 NLMSGERR_ATTR_OFFS,
139 NLMSGERR_ATTR_COOKIE,
140
141 __NLMSGERR_ATTR_MAX,
142 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
143};
144
145#define NETLINK_ADD_MEMBERSHIP 1
146#define NETLINK_DROP_MEMBERSHIP 2
147#define NETLINK_PKTINFO 3
148#define NETLINK_BROADCAST_ERROR 4
149#define NETLINK_NO_ENOBUFS 5
150#ifndef __KERNEL__
151#define NETLINK_RX_RING 6
152#define NETLINK_TX_RING 7
153#endif
154#define NETLINK_LISTEN_ALL_NSID 8
155#define NETLINK_LIST_MEMBERSHIPS 9
156#define NETLINK_CAP_ACK 10
157#define NETLINK_EXT_ACK 11
158
159struct nl_pktinfo {
160 __u32 group;
161};
162
163struct nl_mmap_req {
164 unsigned int nm_block_size;
165 unsigned int nm_block_nr;
166 unsigned int nm_frame_size;
167 unsigned int nm_frame_nr;
168};
169
170struct nl_mmap_hdr {
171 unsigned int nm_status;
172 unsigned int nm_len;
173 __u32 nm_group;
174 /* credentials */
175 __u32 nm_pid;
176 __u32 nm_uid;
177 __u32 nm_gid;
178};
179
180#ifndef __KERNEL__
181enum nl_mmap_status {
182 NL_MMAP_STATUS_UNUSED,
183 NL_MMAP_STATUS_RESERVED,
184 NL_MMAP_STATUS_VALID,
185 NL_MMAP_STATUS_COPY,
186 NL_MMAP_STATUS_SKIP,
187};
188
189#define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
190#define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
191#define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
192#endif
193
194#define NET_MAJOR 36 /* Major 36 is reserved for networking */
195
196enum {
197 NETLINK_UNCONNECTED = 0,
198 NETLINK_CONNECTED,
199};
200
201/*
202 * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
203 * +---------------------+- - -+- - - - - - - - - -+- - -+
204 * | Header | Pad | Payload | Pad |
205 * | (struct nlattr) | ing | | ing |
206 * +---------------------+- - -+- - - - - - - - - -+- - -+
207 * <-------------- nlattr->nla_len -------------->
208 */
209
210struct nlattr {
211 __u16 nla_len;
212 __u16 nla_type;
213};
214
215/*
216 * nla_type (16 bits)
217 * +---+---+-------------------------------+
218 * | N | O | Attribute Type |
219 * +---+---+-------------------------------+
220 * N := Carries nested attributes
221 * O := Payload stored in network byte order
222 *
223 * Note: The N and O flag are mutually exclusive.
224 */
225#define NLA_F_NESTED (1 << 15)
226#define NLA_F_NET_BYTEORDER (1 << 14)
227#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
228
229#define NLA_ALIGNTO 4
230#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
231#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
232
233/* Generic 32 bitflags attribute content sent to the kernel.
234 *
235 * The value is a bitmap that defines the values being set
236 * The selector is a bitmask that defines which value is legit
237 *
238 * Examples:
239 * value = 0x0, and selector = 0x1
240 * implies we are selecting bit 1 and we want to set its value to 0.
241 *
242 * value = 0x2, and selector = 0x2
243 * implies we are selecting bit 2 and we want to set its value to 1.
244 *
245 */
246struct nla_bitfield32 {
247 __u32 value;
248 __u32 selector;
249};
250
251#endif /* _UAPI__LINUX_NETLINK_H */
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index b9a4953018ed..e0739a1aa4b2 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -418,6 +418,27 @@ struct perf_event_attr {
418 __u16 __reserved_2; /* align to __u64 */ 418 __u16 __reserved_2; /* align to __u64 */
419}; 419};
420 420
421/*
422 * Structure used by below PERF_EVENT_IOC_QUERY_BPF command
423 * to query bpf programs attached to the same perf tracepoint
424 * as the given perf event.
425 */
426struct perf_event_query_bpf {
427 /*
428 * The below ids array length
429 */
430 __u32 ids_len;
431 /*
432 * Set by the kernel to indicate the number of
433 * available programs
434 */
435 __u32 prog_cnt;
436 /*
437 * User provided buffer to store program ids
438 */
439 __u32 ids[0];
440};
441
421#define perf_flags(attr) (*(&(attr)->read_format + 1)) 442#define perf_flags(attr) (*(&(attr)->read_format + 1))
422 443
423/* 444/*
@@ -433,6 +454,7 @@ struct perf_event_attr {
433#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *) 454#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
434#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32) 455#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32)
435#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) 456#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
457#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
436 458
437enum perf_event_ioc_flags { 459enum perf_event_ioc_flags {
438 PERF_IOC_FLAG_GROUP = 1U << 0, 460 PERF_IOC_FLAG_GROUP = 1U << 0,
@@ -612,9 +634,12 @@ struct perf_event_mmap_page {
612 */ 634 */
613#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12) 635#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12)
614/* 636/*
615 * PERF_RECORD_MISC_MMAP_DATA and PERF_RECORD_MISC_COMM_EXEC are used on 637 * Following PERF_RECORD_MISC_* are used on different
616 * different events so can reuse the same bit position. 638 * events, so can reuse the same bit position:
617 * Ditto PERF_RECORD_MISC_SWITCH_OUT. 639 *
640 * PERF_RECORD_MISC_MMAP_DATA - PERF_RECORD_MMAP* events
641 * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event
642 * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events
618 */ 643 */
619#define PERF_RECORD_MISC_MMAP_DATA (1 << 13) 644#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
620#define PERF_RECORD_MISC_COMM_EXEC (1 << 13) 645#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
@@ -864,6 +889,7 @@ enum perf_event_type {
864 * struct perf_event_header header; 889 * struct perf_event_header header;
865 * u32 pid; 890 * u32 pid;
866 * u32 tid; 891 * u32 tid;
892 * struct sample_id sample_id;
867 * }; 893 * };
868 */ 894 */
869 PERF_RECORD_ITRACE_START = 12, 895 PERF_RECORD_ITRACE_START = 12,
diff --git a/tools/include/uapi/linux/sched.h b/tools/include/uapi/linux/sched.h
index 30a9e51bbb1e..22627f80063e 100644
--- a/tools/include/uapi/linux/sched.h
+++ b/tools/include/uapi/linux/sched.h
@@ -49,5 +49,10 @@
49 */ 49 */
50#define SCHED_FLAG_RESET_ON_FORK 0x01 50#define SCHED_FLAG_RESET_ON_FORK 0x01
51#define SCHED_FLAG_RECLAIM 0x02 51#define SCHED_FLAG_RECLAIM 0x02
52#define SCHED_FLAG_DL_OVERRUN 0x04
53
54#define SCHED_FLAG_ALL (SCHED_FLAG_RESET_ON_FORK | \
55 SCHED_FLAG_RECLAIM | \
56 SCHED_FLAG_DL_OVERRUN)
52 57
53#endif /* _UAPI_LINUX_SCHED_H */ 58#endif /* _UAPI_LINUX_SCHED_H */
diff --git a/tools/include/uapi/sound/asound.h b/tools/include/uapi/sound/asound.h
index c227ccba60ae..07d61583fd02 100644
--- a/tools/include/uapi/sound/asound.h
+++ b/tools/include/uapi/sound/asound.h
@@ -214,6 +214,11 @@ typedef int __bitwise snd_pcm_format_t;
214#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22) 214#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
215#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23) 215#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
216#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24) 216#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
217#define SNDRV_PCM_FORMAT_S20_LE ((__force snd_pcm_format_t) 25) /* in four bytes, LSB justified */
218#define SNDRV_PCM_FORMAT_S20_BE ((__force snd_pcm_format_t) 26) /* in four bytes, LSB justified */
219#define SNDRV_PCM_FORMAT_U20_LE ((__force snd_pcm_format_t) 27) /* in four bytes, LSB justified */
220#define SNDRV_PCM_FORMAT_U20_BE ((__force snd_pcm_format_t) 28) /* in four bytes, LSB justified */
221/* gap in the numbering for a future standard linear format */
217#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31) 222#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
218#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */ 223#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
219#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */ 224#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
@@ -248,6 +253,8 @@ typedef int __bitwise snd_pcm_format_t;
248#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE 253#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
249#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE 254#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
250#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE 255#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
256#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_LE
257#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_LE
251#endif 258#endif
252#ifdef SNDRV_BIG_ENDIAN 259#ifdef SNDRV_BIG_ENDIAN
253#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE 260#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
@@ -259,6 +266,8 @@ typedef int __bitwise snd_pcm_format_t;
259#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE 266#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
260#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE 267#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
261#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE 268#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
269#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_BE
270#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_BE
262#endif 271#endif
263 272
264typedef int __bitwise snd_pcm_subformat_t; 273typedef int __bitwise snd_pcm_subformat_t;
diff --git a/tools/lib/bpf/Build b/tools/lib/bpf/Build
index d8749756352d..64c679d67109 100644
--- a/tools/lib/bpf/Build
+++ b/tools/lib/bpf/Build
@@ -1 +1 @@
libbpf-y := libbpf.o bpf.o libbpf-y := libbpf.o bpf.o nlattr.o
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 4555304dc18e..e6d5f8d1477f 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -93,7 +93,6 @@ export prefix libdir src obj
93# Shell quotes 93# Shell quotes
94libdir_SQ = $(subst ','\'',$(libdir)) 94libdir_SQ = $(subst ','\'',$(libdir))
95libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) 95libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
96plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
97 96
98LIB_FILE = libbpf.a libbpf.so 97LIB_FILE = libbpf.a libbpf.so
99 98
@@ -150,7 +149,7 @@ CMD_TARGETS = $(LIB_FILE)
150 149
151TARGETS = $(CMD_TARGETS) 150TARGETS = $(CMD_TARGETS)
152 151
153all: fixdep $(VERSION_FILES) all_cmd 152all: fixdep all_cmd
154 153
155all_cmd: $(CMD_TARGETS) 154all_cmd: $(CMD_TARGETS)
156 155
@@ -161,6 +160,12 @@ $(BPF_IN): force elfdep bpfdep
161 @(test -f ../../include/uapi/linux/bpf_common.h -a -f ../../../include/uapi/linux/bpf_common.h && ( \ 160 @(test -f ../../include/uapi/linux/bpf_common.h -a -f ../../../include/uapi/linux/bpf_common.h && ( \
162 (diff -B ../../include/uapi/linux/bpf_common.h ../../../include/uapi/linux/bpf_common.h >/dev/null) || \ 161 (diff -B ../../include/uapi/linux/bpf_common.h ../../../include/uapi/linux/bpf_common.h >/dev/null) || \
163 echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf_common.h' differs from latest version at 'include/uapi/linux/bpf_common.h'" >&2 )) || true 162 echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf_common.h' differs from latest version at 'include/uapi/linux/bpf_common.h'" >&2 )) || true
163 @(test -f ../../include/uapi/linux/netlink.h -a -f ../../../include/uapi/linux/netlink.h && ( \
164 (diff -B ../../include/uapi/linux/netlink.h ../../../include/uapi/linux/netlink.h >/dev/null) || \
165 echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/netlink.h' differs from latest version at 'include/uapi/linux/netlink.h'" >&2 )) || true
166 @(test -f ../../include/uapi/linux/if_link.h -a -f ../../../include/uapi/linux/if_link.h && ( \
167 (diff -B ../../include/uapi/linux/if_link.h ../../../include/uapi/linux/if_link.h >/dev/null) || \
168 echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'" >&2 )) || true
164 $(Q)$(MAKE) $(build)=libbpf 169 $(Q)$(MAKE) $(build)=libbpf
165 170
166$(OUTPUT)libbpf.so: $(BPF_IN) 171$(OUTPUT)libbpf.so: $(BPF_IN)
@@ -169,21 +174,11 @@ $(OUTPUT)libbpf.so: $(BPF_IN)
169$(OUTPUT)libbpf.a: $(BPF_IN) 174$(OUTPUT)libbpf.a: $(BPF_IN)
170 $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^ 175 $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
171 176
172define update_dir
173 (echo $1 > $@.tmp; \
174 if [ -r $@ ] && cmp -s $@ $@.tmp; then \
175 rm -f $@.tmp; \
176 else \
177 echo ' UPDATE $@'; \
178 mv -f $@.tmp $@; \
179 fi);
180endef
181
182define do_install 177define do_install
183 if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ 178 if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
184 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ 179 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
185 fi; \ 180 fi; \
186 $(INSTALL) $1 '$(DESTDIR_SQ)$2' 181 $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2'
187endef 182endef
188 183
189install_lib: all_cmd 184install_lib: all_cmd
@@ -192,7 +187,8 @@ install_lib: all_cmd
192 187
193install_headers: 188install_headers:
194 $(call QUIET_INSTALL, headers) \ 189 $(call QUIET_INSTALL, headers) \
195 $(call do_install,bpf.h,$(prefix)/include/bpf,644) 190 $(call do_install,bpf.h,$(prefix)/include/bpf,644); \
191 $(call do_install,libbpf.h,$(prefix)/include/bpf,644);
196 192
197install: install_lib 193install: install_lib
198 194
@@ -203,7 +199,7 @@ config-clean:
203 $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null 199 $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
204 200
205clean: 201clean:
206 $(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \ 202 $(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so .*.d .*.cmd \
207 $(RM) LIBBPF-CFLAGS 203 $(RM) LIBBPF-CFLAGS
208 $(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf 204 $(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
209 205
@@ -213,10 +209,10 @@ PHONY += force elfdep bpfdep
213force: 209force:
214 210
215elfdep: 211elfdep:
216 @if [ "$(feature-libelf)" != "1" ]; then echo "No libelf found"; exit -1 ; fi 212 @if [ "$(feature-libelf)" != "1" ]; then echo "No libelf found"; exit 1 ; fi
217 213
218bpfdep: 214bpfdep:
219 @if [ "$(feature-bpf)" != "1" ]; then echo "BPF API too old"; exit -1 ; fi 215 @if [ "$(feature-bpf)" != "1" ]; then echo "BPF API too old"; exit 1 ; fi
220 216
221# Declare the contents of the .PHONY variable as phony. We keep that 217# Declare the contents of the .PHONY variable as phony. We keep that
222# information in a variable so we can use it in if_changed and friends. 218# information in a variable so we can use it in if_changed and friends.
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 5128677e4117..592a58a2b681 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -1,3 +1,5 @@
1// SPDX-License-Identifier: LGPL-2.1
2
1/* 3/*
2 * common eBPF ELF operations. 4 * common eBPF ELF operations.
3 * 5 *
@@ -25,6 +27,16 @@
25#include <asm/unistd.h> 27#include <asm/unistd.h>
26#include <linux/bpf.h> 28#include <linux/bpf.h>
27#include "bpf.h" 29#include "bpf.h"
30#include "libbpf.h"
31#include "nlattr.h"
32#include <linux/rtnetlink.h>
33#include <linux/if_link.h>
34#include <sys/socket.h>
35#include <errno.h>
36
37#ifndef SOL_NETLINK
38#define SOL_NETLINK 270
39#endif
28 40
29/* 41/*
30 * When building perf, unistd.h is overridden. __NR_bpf is 42 * When building perf, unistd.h is overridden. __NR_bpf is
@@ -46,7 +58,9 @@
46# endif 58# endif
47#endif 59#endif
48 60
61#ifndef min
49#define min(x, y) ((x) < (y) ? (x) : (y)) 62#define min(x, y) ((x) < (y) ? (x) : (y))
63#endif
50 64
51static inline __u64 ptr_to_u64(const void *ptr) 65static inline __u64 ptr_to_u64(const void *ptr)
52{ 66{
@@ -413,3 +427,124 @@ int bpf_obj_get_info_by_fd(int prog_fd, void *info, __u32 *info_len)
413 427
414 return err; 428 return err;
415} 429}
430
431int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags)
432{
433 struct sockaddr_nl sa;
434 int sock, seq = 0, len, ret = -1;
435 char buf[4096];
436 struct nlattr *nla, *nla_xdp;
437 struct {
438 struct nlmsghdr nh;
439 struct ifinfomsg ifinfo;
440 char attrbuf[64];
441 } req;
442 struct nlmsghdr *nh;
443 struct nlmsgerr *err;
444 socklen_t addrlen;
445 int one = 1;
446
447 memset(&sa, 0, sizeof(sa));
448 sa.nl_family = AF_NETLINK;
449
450 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
451 if (sock < 0) {
452 return -errno;
453 }
454
455 if (setsockopt(sock, SOL_NETLINK, NETLINK_EXT_ACK,
456 &one, sizeof(one)) < 0) {
457 fprintf(stderr, "Netlink error reporting not supported\n");
458 }
459
460 if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
461 ret = -errno;
462 goto cleanup;
463 }
464
465 addrlen = sizeof(sa);
466 if (getsockname(sock, (struct sockaddr *)&sa, &addrlen) < 0) {
467 ret = -errno;
468 goto cleanup;
469 }
470
471 if (addrlen != sizeof(sa)) {
472 ret = -LIBBPF_ERRNO__INTERNAL;
473 goto cleanup;
474 }
475
476 memset(&req, 0, sizeof(req));
477 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
478 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
479 req.nh.nlmsg_type = RTM_SETLINK;
480 req.nh.nlmsg_pid = 0;
481 req.nh.nlmsg_seq = ++seq;
482 req.ifinfo.ifi_family = AF_UNSPEC;
483 req.ifinfo.ifi_index = ifindex;
484
485 /* started nested attribute for XDP */
486 nla = (struct nlattr *)(((char *)&req)
487 + NLMSG_ALIGN(req.nh.nlmsg_len));
488 nla->nla_type = NLA_F_NESTED | IFLA_XDP;
489 nla->nla_len = NLA_HDRLEN;
490
491 /* add XDP fd */
492 nla_xdp = (struct nlattr *)((char *)nla + nla->nla_len);
493 nla_xdp->nla_type = IFLA_XDP_FD;
494 nla_xdp->nla_len = NLA_HDRLEN + sizeof(int);
495 memcpy((char *)nla_xdp + NLA_HDRLEN, &fd, sizeof(fd));
496 nla->nla_len += nla_xdp->nla_len;
497
498 /* if user passed in any flags, add those too */
499 if (flags) {
500 nla_xdp = (struct nlattr *)((char *)nla + nla->nla_len);
501 nla_xdp->nla_type = IFLA_XDP_FLAGS;
502 nla_xdp->nla_len = NLA_HDRLEN + sizeof(flags);
503 memcpy((char *)nla_xdp + NLA_HDRLEN, &flags, sizeof(flags));
504 nla->nla_len += nla_xdp->nla_len;
505 }
506
507 req.nh.nlmsg_len += NLA_ALIGN(nla->nla_len);
508
509 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
510 ret = -errno;
511 goto cleanup;
512 }
513
514 len = recv(sock, buf, sizeof(buf), 0);
515 if (len < 0) {
516 ret = -errno;
517 goto cleanup;
518 }
519
520 for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len);
521 nh = NLMSG_NEXT(nh, len)) {
522 if (nh->nlmsg_pid != sa.nl_pid) {
523 ret = -LIBBPF_ERRNO__WRNGPID;
524 goto cleanup;
525 }
526 if (nh->nlmsg_seq != seq) {
527 ret = -LIBBPF_ERRNO__INVSEQ;
528 goto cleanup;
529 }
530 switch (nh->nlmsg_type) {
531 case NLMSG_ERROR:
532 err = (struct nlmsgerr *)NLMSG_DATA(nh);
533 if (!err->error)
534 continue;
535 ret = err->error;
536 nla_dump_errormsg(nh);
537 goto cleanup;
538 case NLMSG_DONE:
539 break;
540 default:
541 break;
542 }
543 }
544
545 ret = 0;
546
547cleanup:
548 close(sock);
549 return ret;
550}
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 6534889e2b2f..8d18fb73d7fb 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -1,3 +1,5 @@
1/* SPDX-License-Identifier: LGPL-2.1 */
2
1/* 3/*
2 * common eBPF ELF operations. 4 * common eBPF ELF operations.
3 * 5 *
@@ -40,7 +42,7 @@ int bpf_create_map_in_map(enum bpf_map_type map_type, const char *name,
40 __u32 map_flags); 42 __u32 map_flags);
41 43
42/* Recommend log buffer size */ 44/* Recommend log buffer size */
43#define BPF_LOG_BUF_SIZE 65536 45#define BPF_LOG_BUF_SIZE (256 * 1024)
44int bpf_load_program_name(enum bpf_prog_type type, const char *name, 46int bpf_load_program_name(enum bpf_prog_type type, const char *name,
45 const struct bpf_insn *insns, 47 const struct bpf_insn *insns,
46 size_t insns_cnt, const char *license, 48 size_t insns_cnt, const char *license,
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 5aa45f89da93..71ddc481f349 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1,3 +1,5 @@
1// SPDX-License-Identifier: LGPL-2.1
2
1/* 3/*
2 * Common eBPF ELF object loading operations. 4 * Common eBPF ELF object loading operations.
3 * 5 *
@@ -106,6 +108,8 @@ static const char *libbpf_strerror_table[NR_ERRNO] = {
106 [ERRCODE_OFFSET(PROG2BIG)] = "Program too big", 108 [ERRCODE_OFFSET(PROG2BIG)] = "Program too big",
107 [ERRCODE_OFFSET(KVER)] = "Incorrect kernel version", 109 [ERRCODE_OFFSET(KVER)] = "Incorrect kernel version",
108 [ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type", 110 [ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type",
111 [ERRCODE_OFFSET(WRNGPID)] = "Wrong pid in netlink message",
112 [ERRCODE_OFFSET(INVSEQ)] = "Invalid netlink sequence",
109}; 113};
110 114
111int libbpf_strerror(int err, char *buf, size_t size) 115int libbpf_strerror(int err, char *buf, size_t size)
@@ -174,12 +178,19 @@ struct bpf_program {
174 char *name; 178 char *name;
175 char *section_name; 179 char *section_name;
176 struct bpf_insn *insns; 180 struct bpf_insn *insns;
177 size_t insns_cnt; 181 size_t insns_cnt, main_prog_cnt;
178 enum bpf_prog_type type; 182 enum bpf_prog_type type;
179 183
180 struct { 184 struct reloc_desc {
185 enum {
186 RELO_LD64,
187 RELO_CALL,
188 } type;
181 int insn_idx; 189 int insn_idx;
182 int map_idx; 190 union {
191 int map_idx;
192 int text_off;
193 };
183 } *reloc_desc; 194 } *reloc_desc;
184 int nr_reloc; 195 int nr_reloc;
185 196
@@ -234,6 +245,7 @@ struct bpf_object {
234 } *reloc; 245 } *reloc;
235 int nr_reloc; 246 int nr_reloc;
236 int maps_shndx; 247 int maps_shndx;
248 int text_shndx;
237 } efile; 249 } efile;
238 /* 250 /*
239 * All loaded bpf_object is linked in a list, which is 251 * All loaded bpf_object is linked in a list, which is
@@ -375,9 +387,13 @@ bpf_object__init_prog_names(struct bpf_object *obj)
375 size_t pi, si; 387 size_t pi, si;
376 388
377 for (pi = 0; pi < obj->nr_programs; pi++) { 389 for (pi = 0; pi < obj->nr_programs; pi++) {
378 char *name = NULL; 390 const char *name = NULL;
379 391
380 prog = &obj->programs[pi]; 392 prog = &obj->programs[pi];
393 if (prog->idx == obj->efile.text_shndx) {
394 name = ".text";
395 goto skip_search;
396 }
381 397
382 for (si = 0; si < symbols->d_size / sizeof(GElf_Sym) && !name; 398 for (si = 0; si < symbols->d_size / sizeof(GElf_Sym) && !name;
383 si++) { 399 si++) {
@@ -387,6 +403,8 @@ bpf_object__init_prog_names(struct bpf_object *obj)
387 continue; 403 continue;
388 if (sym.st_shndx != prog->idx) 404 if (sym.st_shndx != prog->idx)
389 continue; 405 continue;
406 if (GELF_ST_BIND(sym.st_info) != STB_GLOBAL)
407 continue;
390 408
391 name = elf_strptr(obj->efile.elf, 409 name = elf_strptr(obj->efile.elf,
392 obj->efile.strtabidx, 410 obj->efile.strtabidx,
@@ -403,7 +421,7 @@ bpf_object__init_prog_names(struct bpf_object *obj)
403 prog->section_name); 421 prog->section_name);
404 return -EINVAL; 422 return -EINVAL;
405 } 423 }
406 424skip_search:
407 prog->name = strdup(name); 425 prog->name = strdup(name);
408 if (!prog->name) { 426 if (!prog->name) {
409 pr_warning("failed to allocate memory for prog sym %s\n", 427 pr_warning("failed to allocate memory for prog sym %s\n",
@@ -793,6 +811,8 @@ static int bpf_object__elf_collect(struct bpf_object *obj)
793 } else if ((sh.sh_type == SHT_PROGBITS) && 811 } else if ((sh.sh_type == SHT_PROGBITS) &&
794 (sh.sh_flags & SHF_EXECINSTR) && 812 (sh.sh_flags & SHF_EXECINSTR) &&
795 (data->d_size > 0)) { 813 (data->d_size > 0)) {
814 if (strcmp(name, ".text") == 0)
815 obj->efile.text_shndx = idx;
796 err = bpf_object__add_program(obj, data->d_buf, 816 err = bpf_object__add_program(obj, data->d_buf,
797 data->d_size, name, idx); 817 data->d_size, name, idx);
798 if (err) { 818 if (err) {
@@ -854,11 +874,14 @@ bpf_object__find_prog_by_idx(struct bpf_object *obj, int idx)
854} 874}
855 875
856static int 876static int
857bpf_program__collect_reloc(struct bpf_program *prog, 877bpf_program__collect_reloc(struct bpf_program *prog, GElf_Shdr *shdr,
858 size_t nr_maps, GElf_Shdr *shdr, 878 Elf_Data *data, struct bpf_object *obj)
859 Elf_Data *data, Elf_Data *symbols,
860 int maps_shndx, struct bpf_map *maps)
861{ 879{
880 Elf_Data *symbols = obj->efile.symbols;
881 int text_shndx = obj->efile.text_shndx;
882 int maps_shndx = obj->efile.maps_shndx;
883 struct bpf_map *maps = obj->maps;
884 size_t nr_maps = obj->nr_maps;
862 int i, nrels; 885 int i, nrels;
863 886
864 pr_debug("collecting relocating info for: '%s'\n", 887 pr_debug("collecting relocating info for: '%s'\n",
@@ -891,8 +914,11 @@ bpf_program__collect_reloc(struct bpf_program *prog,
891 GELF_R_SYM(rel.r_info)); 914 GELF_R_SYM(rel.r_info));
892 return -LIBBPF_ERRNO__FORMAT; 915 return -LIBBPF_ERRNO__FORMAT;
893 } 916 }
917 pr_debug("relo for %lld value %lld name %d\n",
918 (long long) (rel.r_info >> 32),
919 (long long) sym.st_value, sym.st_name);
894 920
895 if (sym.st_shndx != maps_shndx) { 921 if (sym.st_shndx != maps_shndx && sym.st_shndx != text_shndx) {
896 pr_warning("Program '%s' contains non-map related relo data pointing to section %u\n", 922 pr_warning("Program '%s' contains non-map related relo data pointing to section %u\n",
897 prog->section_name, sym.st_shndx); 923 prog->section_name, sym.st_shndx);
898 return -LIBBPF_ERRNO__RELOC; 924 return -LIBBPF_ERRNO__RELOC;
@@ -901,6 +927,17 @@ bpf_program__collect_reloc(struct bpf_program *prog,
901 insn_idx = rel.r_offset / sizeof(struct bpf_insn); 927 insn_idx = rel.r_offset / sizeof(struct bpf_insn);
902 pr_debug("relocation: insn_idx=%u\n", insn_idx); 928 pr_debug("relocation: insn_idx=%u\n", insn_idx);
903 929
930 if (insns[insn_idx].code == (BPF_JMP | BPF_CALL)) {
931 if (insns[insn_idx].src_reg != BPF_PSEUDO_CALL) {
932 pr_warning("incorrect bpf_call opcode\n");
933 return -LIBBPF_ERRNO__RELOC;
934 }
935 prog->reloc_desc[i].type = RELO_CALL;
936 prog->reloc_desc[i].insn_idx = insn_idx;
937 prog->reloc_desc[i].text_off = sym.st_value;
938 continue;
939 }
940
904 if (insns[insn_idx].code != (BPF_LD | BPF_IMM | BPF_DW)) { 941 if (insns[insn_idx].code != (BPF_LD | BPF_IMM | BPF_DW)) {
905 pr_warning("bpf: relocation: invalid relo for insns[%d].code 0x%x\n", 942 pr_warning("bpf: relocation: invalid relo for insns[%d].code 0x%x\n",
906 insn_idx, insns[insn_idx].code); 943 insn_idx, insns[insn_idx].code);
@@ -922,6 +959,7 @@ bpf_program__collect_reloc(struct bpf_program *prog,
922 return -LIBBPF_ERRNO__RELOC; 959 return -LIBBPF_ERRNO__RELOC;
923 } 960 }
924 961
962 prog->reloc_desc[i].type = RELO_LD64;
925 prog->reloc_desc[i].insn_idx = insn_idx; 963 prog->reloc_desc[i].insn_idx = insn_idx;
926 prog->reloc_desc[i].map_idx = map_idx; 964 prog->reloc_desc[i].map_idx = map_idx;
927 } 965 }
@@ -961,27 +999,76 @@ bpf_object__create_maps(struct bpf_object *obj)
961} 999}
962 1000
963static int 1001static int
1002bpf_program__reloc_text(struct bpf_program *prog, struct bpf_object *obj,
1003 struct reloc_desc *relo)
1004{
1005 struct bpf_insn *insn, *new_insn;
1006 struct bpf_program *text;
1007 size_t new_cnt;
1008
1009 if (relo->type != RELO_CALL)
1010 return -LIBBPF_ERRNO__RELOC;
1011
1012 if (prog->idx == obj->efile.text_shndx) {
1013 pr_warning("relo in .text insn %d into off %d\n",
1014 relo->insn_idx, relo->text_off);
1015 return -LIBBPF_ERRNO__RELOC;
1016 }
1017
1018 if (prog->main_prog_cnt == 0) {
1019 text = bpf_object__find_prog_by_idx(obj, obj->efile.text_shndx);
1020 if (!text) {
1021 pr_warning("no .text section found yet relo into text exist\n");
1022 return -LIBBPF_ERRNO__RELOC;
1023 }
1024 new_cnt = prog->insns_cnt + text->insns_cnt;
1025 new_insn = realloc(prog->insns, new_cnt * sizeof(*insn));
1026 if (!new_insn) {
1027 pr_warning("oom in prog realloc\n");
1028 return -ENOMEM;
1029 }
1030 memcpy(new_insn + prog->insns_cnt, text->insns,
1031 text->insns_cnt * sizeof(*insn));
1032 prog->insns = new_insn;
1033 prog->main_prog_cnt = prog->insns_cnt;
1034 prog->insns_cnt = new_cnt;
1035 }
1036 insn = &prog->insns[relo->insn_idx];
1037 insn->imm += prog->main_prog_cnt - relo->insn_idx;
1038 pr_debug("added %zd insn from %s to prog %s\n",
1039 text->insns_cnt, text->section_name, prog->section_name);
1040 return 0;
1041}
1042
1043static int
964bpf_program__relocate(struct bpf_program *prog, struct bpf_object *obj) 1044bpf_program__relocate(struct bpf_program *prog, struct bpf_object *obj)
965{ 1045{
966 int i; 1046 int i, err;
967 1047
968 if (!prog || !prog->reloc_desc) 1048 if (!prog || !prog->reloc_desc)
969 return 0; 1049 return 0;
970 1050
971 for (i = 0; i < prog->nr_reloc; i++) { 1051 for (i = 0; i < prog->nr_reloc; i++) {
972 int insn_idx, map_idx; 1052 if (prog->reloc_desc[i].type == RELO_LD64) {
973 struct bpf_insn *insns = prog->insns; 1053 struct bpf_insn *insns = prog->insns;
1054 int insn_idx, map_idx;
974 1055
975 insn_idx = prog->reloc_desc[i].insn_idx; 1056 insn_idx = prog->reloc_desc[i].insn_idx;
976 map_idx = prog->reloc_desc[i].map_idx; 1057 map_idx = prog->reloc_desc[i].map_idx;
977 1058
978 if (insn_idx >= (int)prog->insns_cnt) { 1059 if (insn_idx >= (int)prog->insns_cnt) {
979 pr_warning("relocation out of range: '%s'\n", 1060 pr_warning("relocation out of range: '%s'\n",
980 prog->section_name); 1061 prog->section_name);
981 return -LIBBPF_ERRNO__RELOC; 1062 return -LIBBPF_ERRNO__RELOC;
1063 }
1064 insns[insn_idx].src_reg = BPF_PSEUDO_MAP_FD;
1065 insns[insn_idx].imm = obj->maps[map_idx].fd;
1066 } else {
1067 err = bpf_program__reloc_text(prog, obj,
1068 &prog->reloc_desc[i]);
1069 if (err)
1070 return err;
982 } 1071 }
983 insns[insn_idx].src_reg = BPF_PSEUDO_MAP_FD;
984 insns[insn_idx].imm = obj->maps[map_idx].fd;
985 } 1072 }
986 1073
987 zfree(&prog->reloc_desc); 1074 zfree(&prog->reloc_desc);
@@ -1024,7 +1111,6 @@ static int bpf_object__collect_reloc(struct bpf_object *obj)
1024 Elf_Data *data = obj->efile.reloc[i].data; 1111 Elf_Data *data = obj->efile.reloc[i].data;
1025 int idx = shdr->sh_info; 1112 int idx = shdr->sh_info;
1026 struct bpf_program *prog; 1113 struct bpf_program *prog;
1027 size_t nr_maps = obj->nr_maps;
1028 1114
1029 if (shdr->sh_type != SHT_REL) { 1115 if (shdr->sh_type != SHT_REL) {
1030 pr_warning("internal error at %d\n", __LINE__); 1116 pr_warning("internal error at %d\n", __LINE__);
@@ -1038,11 +1124,9 @@ static int bpf_object__collect_reloc(struct bpf_object *obj)
1038 return -LIBBPF_ERRNO__RELOC; 1124 return -LIBBPF_ERRNO__RELOC;
1039 } 1125 }
1040 1126
1041 err = bpf_program__collect_reloc(prog, nr_maps, 1127 err = bpf_program__collect_reloc(prog,
1042 shdr, data, 1128 shdr, data,
1043 obj->efile.symbols, 1129 obj);
1044 obj->efile.maps_shndx,
1045 obj->maps);
1046 if (err) 1130 if (err)
1047 return err; 1131 return err;
1048 } 1132 }
@@ -1195,6 +1279,8 @@ bpf_object__load_progs(struct bpf_object *obj)
1195 int err; 1279 int err;
1196 1280
1197 for (i = 0; i < obj->nr_programs; i++) { 1281 for (i = 0; i < obj->nr_programs; i++) {
1282 if (obj->programs[i].idx == obj->efile.text_shndx)
1283 continue;
1198 err = bpf_program__load(&obj->programs[i], 1284 err = bpf_program__load(&obj->programs[i],
1199 obj->license, 1285 obj->license,
1200 obj->kern_version); 1286 obj->kern_version);
@@ -1721,6 +1807,45 @@ BPF_PROG_TYPE_FNS(tracepoint, BPF_PROG_TYPE_TRACEPOINT);
1721BPF_PROG_TYPE_FNS(xdp, BPF_PROG_TYPE_XDP); 1807BPF_PROG_TYPE_FNS(xdp, BPF_PROG_TYPE_XDP);
1722BPF_PROG_TYPE_FNS(perf_event, BPF_PROG_TYPE_PERF_EVENT); 1808BPF_PROG_TYPE_FNS(perf_event, BPF_PROG_TYPE_PERF_EVENT);
1723 1809
1810#define BPF_PROG_SEC(string, type) { string, sizeof(string) - 1, type }
1811static const struct {
1812 const char *sec;
1813 size_t len;
1814 enum bpf_prog_type prog_type;
1815} section_names[] = {
1816 BPF_PROG_SEC("socket", BPF_PROG_TYPE_SOCKET_FILTER),
1817 BPF_PROG_SEC("kprobe/", BPF_PROG_TYPE_KPROBE),
1818 BPF_PROG_SEC("kretprobe/", BPF_PROG_TYPE_KPROBE),
1819 BPF_PROG_SEC("tracepoint/", BPF_PROG_TYPE_TRACEPOINT),
1820 BPF_PROG_SEC("xdp", BPF_PROG_TYPE_XDP),
1821 BPF_PROG_SEC("perf_event", BPF_PROG_TYPE_PERF_EVENT),
1822 BPF_PROG_SEC("cgroup/skb", BPF_PROG_TYPE_CGROUP_SKB),
1823 BPF_PROG_SEC("cgroup/sock", BPF_PROG_TYPE_CGROUP_SOCK),
1824 BPF_PROG_SEC("cgroup/dev", BPF_PROG_TYPE_CGROUP_DEVICE),
1825 BPF_PROG_SEC("sockops", BPF_PROG_TYPE_SOCK_OPS),
1826 BPF_PROG_SEC("sk_skb", BPF_PROG_TYPE_SK_SKB),
1827};
1828#undef BPF_PROG_SEC
1829
1830static enum bpf_prog_type bpf_program__guess_type(struct bpf_program *prog)
1831{
1832 int i;
1833
1834 if (!prog->section_name)
1835 goto err;
1836
1837 for (i = 0; i < ARRAY_SIZE(section_names); i++)
1838 if (strncmp(prog->section_name, section_names[i].sec,
1839 section_names[i].len) == 0)
1840 return section_names[i].prog_type;
1841
1842err:
1843 pr_warning("failed to guess program type based on section name %s\n",
1844 prog->section_name);
1845
1846 return BPF_PROG_TYPE_UNSPEC;
1847}
1848
1724int bpf_map__fd(struct bpf_map *map) 1849int bpf_map__fd(struct bpf_map *map)
1725{ 1850{
1726 return map ? map->fd : -EINVAL; 1851 return map ? map->fd : -EINVAL;
@@ -1818,7 +1943,7 @@ long libbpf_get_error(const void *ptr)
1818int bpf_prog_load(const char *file, enum bpf_prog_type type, 1943int bpf_prog_load(const char *file, enum bpf_prog_type type,
1819 struct bpf_object **pobj, int *prog_fd) 1944 struct bpf_object **pobj, int *prog_fd)
1820{ 1945{
1821 struct bpf_program *prog; 1946 struct bpf_program *prog, *first_prog = NULL;
1822 struct bpf_object *obj; 1947 struct bpf_object *obj;
1823 int err; 1948 int err;
1824 1949
@@ -1826,13 +1951,30 @@ int bpf_prog_load(const char *file, enum bpf_prog_type type,
1826 if (IS_ERR(obj)) 1951 if (IS_ERR(obj))
1827 return -ENOENT; 1952 return -ENOENT;
1828 1953
1829 prog = bpf_program__next(NULL, obj); 1954 bpf_object__for_each_program(prog, obj) {
1830 if (!prog) { 1955 /*
1956 * If type is not specified, try to guess it based on
1957 * section name.
1958 */
1959 if (type == BPF_PROG_TYPE_UNSPEC) {
1960 type = bpf_program__guess_type(prog);
1961 if (type == BPF_PROG_TYPE_UNSPEC) {
1962 bpf_object__close(obj);
1963 return -EINVAL;
1964 }
1965 }
1966
1967 bpf_program__set_type(prog, type);
1968 if (prog->idx != obj->efile.text_shndx && !first_prog)
1969 first_prog = prog;
1970 }
1971
1972 if (!first_prog) {
1973 pr_warning("object file doesn't contain bpf program\n");
1831 bpf_object__close(obj); 1974 bpf_object__close(obj);
1832 return -ENOENT; 1975 return -ENOENT;
1833 } 1976 }
1834 1977
1835 bpf_program__set_type(prog, type);
1836 err = bpf_object__load(obj); 1978 err = bpf_object__load(obj);
1837 if (err) { 1979 if (err) {
1838 bpf_object__close(obj); 1980 bpf_object__close(obj);
@@ -1840,6 +1982,6 @@ int bpf_prog_load(const char *file, enum bpf_prog_type type,
1840 } 1982 }
1841 1983
1842 *pobj = obj; 1984 *pobj = obj;
1843 *prog_fd = bpf_program__fd(prog); 1985 *prog_fd = bpf_program__fd(first_prog);
1844 return 0; 1986 return 0;
1845} 1987}
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 6e20003109e0..f85906533cdd 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -1,3 +1,5 @@
1/* SPDX-License-Identifier: LGPL-2.1 */
2
1/* 3/*
2 * Common eBPF ELF object loading operations. 4 * Common eBPF ELF object loading operations.
3 * 5 *
@@ -42,6 +44,8 @@ enum libbpf_errno {
42 LIBBPF_ERRNO__PROG2BIG, /* Program too big */ 44 LIBBPF_ERRNO__PROG2BIG, /* Program too big */
43 LIBBPF_ERRNO__KVER, /* Incorrect kernel version */ 45 LIBBPF_ERRNO__KVER, /* Incorrect kernel version */
44 LIBBPF_ERRNO__PROGTYPE, /* Kernel doesn't support this program type */ 46 LIBBPF_ERRNO__PROGTYPE, /* Kernel doesn't support this program type */
47 LIBBPF_ERRNO__WRNGPID, /* Wrong pid in netlink message */
48 LIBBPF_ERRNO__INVSEQ, /* Invalid netlink sequence */
45 __LIBBPF_ERRNO__END, 49 __LIBBPF_ERRNO__END,
46}; 50};
47 51
@@ -246,4 +250,6 @@ long libbpf_get_error(const void *ptr);
246 250
247int bpf_prog_load(const char *file, enum bpf_prog_type type, 251int bpf_prog_load(const char *file, enum bpf_prog_type type,
248 struct bpf_object **pobj, int *prog_fd); 252 struct bpf_object **pobj, int *prog_fd);
253
254int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags);
249#endif 255#endif
diff --git a/tools/lib/bpf/nlattr.c b/tools/lib/bpf/nlattr.c
new file mode 100644
index 000000000000..4719434278b2
--- /dev/null
+++ b/tools/lib/bpf/nlattr.c
@@ -0,0 +1,187 @@
1// SPDX-License-Identifier: LGPL-2.1
2
3/*
4 * NETLINK Netlink attributes
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation version 2.1
9 * of the License.
10 *
11 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
12 */
13
14#include <errno.h>
15#include "nlattr.h"
16#include <linux/rtnetlink.h>
17#include <string.h>
18#include <stdio.h>
19
20static uint16_t nla_attr_minlen[NLA_TYPE_MAX+1] = {
21 [NLA_U8] = sizeof(uint8_t),
22 [NLA_U16] = sizeof(uint16_t),
23 [NLA_U32] = sizeof(uint32_t),
24 [NLA_U64] = sizeof(uint64_t),
25 [NLA_STRING] = 1,
26 [NLA_FLAG] = 0,
27};
28
29static int nla_len(const struct nlattr *nla)
30{
31 return nla->nla_len - NLA_HDRLEN;
32}
33
34static struct nlattr *nla_next(const struct nlattr *nla, int *remaining)
35{
36 int totlen = NLA_ALIGN(nla->nla_len);
37
38 *remaining -= totlen;
39 return (struct nlattr *) ((char *) nla + totlen);
40}
41
42static int nla_ok(const struct nlattr *nla, int remaining)
43{
44 return remaining >= sizeof(*nla) &&
45 nla->nla_len >= sizeof(*nla) &&
46 nla->nla_len <= remaining;
47}
48
49static void *nla_data(const struct nlattr *nla)
50{
51 return (char *) nla + NLA_HDRLEN;
52}
53
54static int nla_type(const struct nlattr *nla)
55{
56 return nla->nla_type & NLA_TYPE_MASK;
57}
58
59static int validate_nla(struct nlattr *nla, int maxtype,
60 struct nla_policy *policy)
61{
62 struct nla_policy *pt;
63 unsigned int minlen = 0;
64 int type = nla_type(nla);
65
66 if (type < 0 || type > maxtype)
67 return 0;
68
69 pt = &policy[type];
70
71 if (pt->type > NLA_TYPE_MAX)
72 return 0;
73
74 if (pt->minlen)
75 minlen = pt->minlen;
76 else if (pt->type != NLA_UNSPEC)
77 minlen = nla_attr_minlen[pt->type];
78
79 if (nla_len(nla) < minlen)
80 return -1;
81
82 if (pt->maxlen && nla_len(nla) > pt->maxlen)
83 return -1;
84
85 if (pt->type == NLA_STRING) {
86 char *data = nla_data(nla);
87 if (data[nla_len(nla) - 1] != '\0')
88 return -1;
89 }
90
91 return 0;
92}
93
94static inline int nlmsg_len(const struct nlmsghdr *nlh)
95{
96 return nlh->nlmsg_len - NLMSG_HDRLEN;
97}
98
99/**
100 * Create attribute index based on a stream of attributes.
101 * @arg tb Index array to be filled (maxtype+1 elements).
102 * @arg maxtype Maximum attribute type expected and accepted.
103 * @arg head Head of attribute stream.
104 * @arg len Length of attribute stream.
105 * @arg policy Attribute validation policy.
106 *
107 * Iterates over the stream of attributes and stores a pointer to each
108 * attribute in the index array using the attribute type as index to
109 * the array. Attribute with a type greater than the maximum type
110 * specified will be silently ignored in order to maintain backwards
111 * compatibility. If \a policy is not NULL, the attribute will be
112 * validated using the specified policy.
113 *
114 * @see nla_validate
115 * @return 0 on success or a negative error code.
116 */
117static int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len,
118 struct nla_policy *policy)
119{
120 struct nlattr *nla;
121 int rem, err;
122
123 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
124
125 nla_for_each_attr(nla, head, len, rem) {
126 int type = nla_type(nla);
127
128 if (type > maxtype)
129 continue;
130
131 if (policy) {
132 err = validate_nla(nla, maxtype, policy);
133 if (err < 0)
134 goto errout;
135 }
136
137 if (tb[type])
138 fprintf(stderr, "Attribute of type %#x found multiple times in message, "
139 "previous attribute is being ignored.\n", type);
140
141 tb[type] = nla;
142 }
143
144 err = 0;
145errout:
146 return err;
147}
148
149/* dump netlink extended ack error message */
150int nla_dump_errormsg(struct nlmsghdr *nlh)
151{
152 struct nla_policy extack_policy[NLMSGERR_ATTR_MAX + 1] = {
153 [NLMSGERR_ATTR_MSG] = { .type = NLA_STRING },
154 [NLMSGERR_ATTR_OFFS] = { .type = NLA_U32 },
155 };
156 struct nlattr *tb[NLMSGERR_ATTR_MAX + 1], *attr;
157 struct nlmsgerr *err;
158 char *errmsg = NULL;
159 int hlen, alen;
160
161 /* no TLVs, nothing to do here */
162 if (!(nlh->nlmsg_flags & NLM_F_ACK_TLVS))
163 return 0;
164
165 err = (struct nlmsgerr *)NLMSG_DATA(nlh);
166 hlen = sizeof(*err);
167
168 /* if NLM_F_CAPPED is set then the inner err msg was capped */
169 if (!(nlh->nlmsg_flags & NLM_F_CAPPED))
170 hlen += nlmsg_len(&err->msg);
171
172 attr = (struct nlattr *) ((void *) err + hlen);
173 alen = nlh->nlmsg_len - hlen;
174
175 if (nla_parse(tb, NLMSGERR_ATTR_MAX, attr, alen, extack_policy) != 0) {
176 fprintf(stderr,
177 "Failed to parse extended error attributes\n");
178 return 0;
179 }
180
181 if (tb[NLMSGERR_ATTR_MSG])
182 errmsg = (char *) nla_data(tb[NLMSGERR_ATTR_MSG]);
183
184 fprintf(stderr, "Kernel error message: %s\n", errmsg);
185
186 return 0;
187}
diff --git a/tools/lib/bpf/nlattr.h b/tools/lib/bpf/nlattr.h
new file mode 100644
index 000000000000..931a71f68f93
--- /dev/null
+++ b/tools/lib/bpf/nlattr.h
@@ -0,0 +1,72 @@
1/* SPDX-License-Identifier: LGPL-2.1 */
2
3/*
4 * NETLINK Netlink attributes
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation version 2.1
9 * of the License.
10 *
11 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
12 */
13
14#ifndef __NLATTR_H
15#define __NLATTR_H
16
17#include <stdint.h>
18#include <linux/netlink.h>
19/* avoid multiple definition of netlink features */
20#define __LINUX_NETLINK_H
21
22/**
23 * Standard attribute types to specify validation policy
24 */
25enum {
26 NLA_UNSPEC, /**< Unspecified type, binary data chunk */
27 NLA_U8, /**< 8 bit integer */
28 NLA_U16, /**< 16 bit integer */
29 NLA_U32, /**< 32 bit integer */
30 NLA_U64, /**< 64 bit integer */
31 NLA_STRING, /**< NUL terminated character string */
32 NLA_FLAG, /**< Flag */
33 NLA_MSECS, /**< Micro seconds (64bit) */
34 NLA_NESTED, /**< Nested attributes */
35 __NLA_TYPE_MAX,
36};
37
38#define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
39
40/**
41 * @ingroup attr
42 * Attribute validation policy.
43 *
44 * See section @core_doc{core_attr_parse,Attribute Parsing} for more details.
45 */
46struct nla_policy {
47 /** Type of attribute or NLA_UNSPEC */
48 uint16_t type;
49
50 /** Minimal length of payload required */
51 uint16_t minlen;
52
53 /** Maximal length of payload allowed */
54 uint16_t maxlen;
55};
56
57/**
58 * @ingroup attr
59 * Iterate over a stream of attributes
60 * @arg pos loop counter, set to current attribute
61 * @arg head head of attribute stream
62 * @arg len length of attribute stream
63 * @arg rem initialized to len, holds bytes currently remaining in stream
64 */
65#define nla_for_each_attr(pos, head, len, rem) \
66 for (pos = head, rem = len; \
67 nla_ok(pos, rem); \
68 pos = nla_next(pos, &(rem)))
69
70int nla_dump_errormsg(struct nlmsghdr *nlh);
71
72#endif /* __NLATTR_H */
diff --git a/tools/lib/find_bit.c b/tools/lib/find_bit.c
index 42c15f906aac..a88bd507091e 100644
--- a/tools/lib/find_bit.c
+++ b/tools/lib/find_bit.c
@@ -22,22 +22,29 @@
22#include <linux/bitmap.h> 22#include <linux/bitmap.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24 24
25#if !defined(find_next_bit) 25#if !defined(find_next_bit) || !defined(find_next_zero_bit) || \
26 !defined(find_next_and_bit)
26 27
27/* 28/*
28 * This is a common helper function for find_next_bit and 29 * This is a common helper function for find_next_bit, find_next_zero_bit, and
29 * find_next_zero_bit. The difference is the "invert" argument, which 30 * find_next_and_bit. The differences are:
30 * is XORed with each fetched word before searching it for one bits. 31 * - The "invert" argument, which is XORed with each fetched word before
32 * searching it for one bits.
33 * - The optional "addr2", which is anded with "addr1" if present.
31 */ 34 */
32static unsigned long _find_next_bit(const unsigned long *addr, 35static inline unsigned long _find_next_bit(const unsigned long *addr1,
33 unsigned long nbits, unsigned long start, unsigned long invert) 36 const unsigned long *addr2, unsigned long nbits,
37 unsigned long start, unsigned long invert)
34{ 38{
35 unsigned long tmp; 39 unsigned long tmp;
36 40
37 if (unlikely(start >= nbits)) 41 if (unlikely(start >= nbits))
38 return nbits; 42 return nbits;
39 43
40 tmp = addr[start / BITS_PER_LONG] ^ invert; 44 tmp = addr1[start / BITS_PER_LONG];
45 if (addr2)
46 tmp &= addr2[start / BITS_PER_LONG];
47 tmp ^= invert;
41 48
42 /* Handle 1st word. */ 49 /* Handle 1st word. */
43 tmp &= BITMAP_FIRST_WORD_MASK(start); 50 tmp &= BITMAP_FIRST_WORD_MASK(start);
@@ -48,7 +55,10 @@ static unsigned long _find_next_bit(const unsigned long *addr,
48 if (start >= nbits) 55 if (start >= nbits)
49 return nbits; 56 return nbits;
50 57
51 tmp = addr[start / BITS_PER_LONG] ^ invert; 58 tmp = addr1[start / BITS_PER_LONG];
59 if (addr2)
60 tmp &= addr2[start / BITS_PER_LONG];
61 tmp ^= invert;
52 } 62 }
53 63
54 return min(start + __ffs(tmp), nbits); 64 return min(start + __ffs(tmp), nbits);
@@ -62,7 +72,7 @@ static unsigned long _find_next_bit(const unsigned long *addr,
62unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 72unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
63 unsigned long offset) 73 unsigned long offset)
64{ 74{
65 return _find_next_bit(addr, size, offset, 0UL); 75 return _find_next_bit(addr, NULL, size, offset, 0UL);
66} 76}
67#endif 77#endif
68 78
@@ -104,6 +114,15 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
104unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 114unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
105 unsigned long offset) 115 unsigned long offset)
106{ 116{
107 return _find_next_bit(addr, size, offset, ~0UL); 117 return _find_next_bit(addr, NULL, size, offset, ~0UL);
118}
119#endif
120
121#ifndef find_next_and_bit
122unsigned long find_next_and_bit(const unsigned long *addr1,
123 const unsigned long *addr2, unsigned long size,
124 unsigned long offset)
125{
126 return _find_next_bit(addr1, addr2, size, offset, 0UL);
108} 127}
109#endif 128#endif
diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c
index 5ba754d17952..9997a8805a82 100644
--- a/tools/lib/subcmd/pager.c
+++ b/tools/lib/subcmd/pager.c
@@ -30,10 +30,13 @@ static void pager_preexec(void)
30 * have real input 30 * have real input
31 */ 31 */
32 fd_set in; 32 fd_set in;
33 fd_set exception;
33 34
34 FD_ZERO(&in); 35 FD_ZERO(&in);
36 FD_ZERO(&exception);
35 FD_SET(0, &in); 37 FD_SET(0, &in);
36 select(1, &in, NULL, &in, NULL); 38 FD_SET(0, &exception);
39 select(1, &in, NULL, &exception, NULL);
37 40
38 setenv("LESS", "FRSX", 0); 41 setenv("LESS", "FRSX", 0);
39} 42}
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 7ce724fc0544..e5f2acbb70cc 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -1094,7 +1094,7 @@ static enum event_type __read_token(char **tok)
1094 if (strcmp(*tok, "LOCAL_PR_FMT") == 0) { 1094 if (strcmp(*tok, "LOCAL_PR_FMT") == 0) {
1095 free(*tok); 1095 free(*tok);
1096 *tok = NULL; 1096 *tok = NULL;
1097 return force_token("\"\%s\" ", tok); 1097 return force_token("\"%s\" ", tok);
1098 } else if (strcmp(*tok, "STA_PR_FMT") == 0) { 1098 } else if (strcmp(*tok, "STA_PR_FMT") == 0) {
1099 free(*tok); 1099 free(*tok);
1100 *tok = NULL; 1100 *tok = NULL;
@@ -3970,6 +3970,11 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
3970 val &= ~fval; 3970 val &= ~fval;
3971 } 3971 }
3972 } 3972 }
3973 if (val) {
3974 if (print && arg->flags.delim)
3975 trace_seq_puts(s, arg->flags.delim);
3976 trace_seq_printf(s, "0x%llx", val);
3977 }
3973 break; 3978 break;
3974 case PRINT_SYMBOL: 3979 case PRINT_SYMBOL:
3975 val = eval_num_arg(data, size, event, arg->symbol.field); 3980 val = eval_num_arg(data, size, event, arg->symbol.field);
@@ -3980,6 +3985,8 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
3980 break; 3985 break;
3981 } 3986 }
3982 } 3987 }
3988 if (!flag)
3989 trace_seq_printf(s, "0x%llx", val);
3983 break; 3990 break;
3984 case PRINT_HEX: 3991 case PRINT_HEX:
3985 case PRINT_HEX_STR: 3992 case PRINT_HEX_STR:
@@ -4293,6 +4300,26 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc
4293 goto process_again; 4300 goto process_again;
4294 case 'p': 4301 case 'p':
4295 ls = 1; 4302 ls = 1;
4303 if (isalnum(ptr[1])) {
4304 ptr++;
4305 /* Check for special pointers */
4306 switch (*ptr) {
4307 case 's':
4308 case 'S':
4309 case 'f':
4310 case 'F':
4311 break;
4312 default:
4313 /*
4314 * Older kernels do not process
4315 * dereferenced pointers.
4316 * Only process if the pointer
4317 * value is a printable.
4318 */
4319 if (isprint(*(char *)bptr))
4320 goto process_string;
4321 }
4322 }
4296 /* fall through */ 4323 /* fall through */
4297 case 'd': 4324 case 'd':
4298 case 'u': 4325 case 'u':
@@ -4345,6 +4372,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc
4345 4372
4346 break; 4373 break;
4347 case 's': 4374 case 's':
4375 process_string:
4348 arg = alloc_arg(); 4376 arg = alloc_arg();
4349 if (!arg) { 4377 if (!arg) {
4350 do_warning_event(event, "%s(%d): not enough memory!", 4378 do_warning_event(event, "%s(%d): not enough memory!",
@@ -4949,21 +4977,27 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
4949 else 4977 else
4950 ls = 2; 4978 ls = 2;
4951 4979
4952 if (*(ptr+1) == 'F' || *(ptr+1) == 'f' || 4980 if (isalnum(ptr[1]))
4953 *(ptr+1) == 'S' || *(ptr+1) == 's') {
4954 ptr++; 4981 ptr++;
4982
4983 if (arg->type == PRINT_BSTRING) {
4984 trace_seq_puts(s, arg->string.string);
4985 break;
4986 }
4987
4988 if (*ptr == 'F' || *ptr == 'f' ||
4989 *ptr == 'S' || *ptr == 's') {
4955 show_func = *ptr; 4990 show_func = *ptr;
4956 } else if (*(ptr+1) == 'M' || *(ptr+1) == 'm') { 4991 } else if (*ptr == 'M' || *ptr == 'm') {
4957 print_mac_arg(s, *(ptr+1), data, size, event, arg); 4992 print_mac_arg(s, *ptr, data, size, event, arg);
4958 ptr++;
4959 arg = arg->next; 4993 arg = arg->next;
4960 break; 4994 break;
4961 } else if (*(ptr+1) == 'I' || *(ptr+1) == 'i') { 4995 } else if (*ptr == 'I' || *ptr == 'i') {
4962 int n; 4996 int n;
4963 4997
4964 n = print_ip_arg(s, ptr+1, data, size, event, arg); 4998 n = print_ip_arg(s, ptr, data, size, event, arg);
4965 if (n > 0) { 4999 if (n > 0) {
4966 ptr += n; 5000 ptr += n - 1;
4967 arg = arg->next; 5001 arg = arg->next;
4968 break; 5002 break;
4969 } 5003 }
@@ -5532,8 +5566,14 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
5532 5566
5533 event = pevent_find_event_by_record(pevent, record); 5567 event = pevent_find_event_by_record(pevent, record);
5534 if (!event) { 5568 if (!event) {
5535 do_warning("ug! no event found for type %d", 5569 int i;
5536 trace_parse_common_type(pevent, record->data)); 5570 int type = trace_parse_common_type(pevent, record->data);
5571
5572 do_warning("ug! no event found for type %d", type);
5573 trace_seq_printf(s, "[UNKNOWN TYPE %d]", type);
5574 for (i = 0; i < record->size; i++)
5575 trace_seq_printf(s, " %02x",
5576 ((unsigned char *)record->data)[i]);
5537 return; 5577 return;
5538 } 5578 }
5539 5579
diff --git a/tools/lib/traceevent/event-plugin.c b/tools/lib/traceevent/event-plugin.c
index a16756ae3526..d542cb60ca1a 100644
--- a/tools/lib/traceevent/event-plugin.c
+++ b/tools/lib/traceevent/event-plugin.c
@@ -120,12 +120,12 @@ char **traceevent_plugin_list_options(void)
120 for (op = reg->options; op->name; op++) { 120 for (op = reg->options; op->name; op++) {
121 char *alias = op->plugin_alias ? op->plugin_alias : op->file; 121 char *alias = op->plugin_alias ? op->plugin_alias : op->file;
122 char **temp = list; 122 char **temp = list;
123 int ret;
123 124
124 name = malloc(strlen(op->name) + strlen(alias) + 2); 125 ret = asprintf(&name, "%s:%s", alias, op->name);
125 if (!name) 126 if (ret < 0)
126 goto err; 127 goto err;
127 128
128 sprintf(name, "%s:%s", alias, op->name);
129 list = realloc(list, count + 2); 129 list = realloc(list, count + 2);
130 if (!list) { 130 if (!list) {
131 list = temp; 131 list = temp;
@@ -290,17 +290,14 @@ load_plugin(struct pevent *pevent, const char *path,
290 const char *alias; 290 const char *alias;
291 char *plugin; 291 char *plugin;
292 void *handle; 292 void *handle;
293 int ret;
293 294
294 plugin = malloc(strlen(path) + strlen(file) + 2); 295 ret = asprintf(&plugin, "%s/%s", path, file);
295 if (!plugin) { 296 if (ret < 0) {
296 warning("could not allocate plugin memory\n"); 297 warning("could not allocate plugin memory\n");
297 return; 298 return;
298 } 299 }
299 300
300 strcpy(plugin, path);
301 strcat(plugin, "/");
302 strcat(plugin, file);
303
304 handle = dlopen(plugin, RTLD_NOW | RTLD_GLOBAL); 301 handle = dlopen(plugin, RTLD_NOW | RTLD_GLOBAL);
305 if (!handle) { 302 if (!handle) {
306 warning("could not load plugin '%s'\n%s\n", 303 warning("could not load plugin '%s'\n%s\n",
@@ -391,6 +388,7 @@ load_plugins(struct pevent *pevent, const char *suffix,
391 char *home; 388 char *home;
392 char *path; 389 char *path;
393 char *envdir; 390 char *envdir;
391 int ret;
394 392
395 if (pevent->flags & PEVENT_DISABLE_PLUGINS) 393 if (pevent->flags & PEVENT_DISABLE_PLUGINS)
396 return; 394 return;
@@ -421,16 +419,12 @@ load_plugins(struct pevent *pevent, const char *suffix,
421 if (!home) 419 if (!home)
422 return; 420 return;
423 421
424 path = malloc(strlen(home) + strlen(LOCAL_PLUGIN_DIR) + 2); 422 ret = asprintf(&path, "%s/%s", home, LOCAL_PLUGIN_DIR);
425 if (!path) { 423 if (ret < 0) {
426 warning("could not allocate plugin memory\n"); 424 warning("could not allocate plugin memory\n");
427 return; 425 return;
428 } 426 }
429 427
430 strcpy(path, home);
431 strcat(path, "/");
432 strcat(path, LOCAL_PLUGIN_DIR);
433
434 load_plugins_dir(pevent, suffix, path, load_plugin, data); 428 load_plugins_dir(pevent, suffix, path, load_plugin, data);
435 429
436 free(path); 430 free(path);
diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c
index c94e3641b046..ca424b157e46 100644
--- a/tools/lib/traceevent/kbuffer-parse.c
+++ b/tools/lib/traceevent/kbuffer-parse.c
@@ -24,8 +24,8 @@
24 24
25#include "kbuffer.h" 25#include "kbuffer.h"
26 26
27#define MISSING_EVENTS (1 << 31) 27#define MISSING_EVENTS (1UL << 31)
28#define MISSING_STORED (1 << 30) 28#define MISSING_STORED (1UL << 30)
29 29
30#define COMMIT_MASK ((1 << 27) - 1) 30#define COMMIT_MASK ((1 << 27) - 1)
31 31
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 315df0a70265..431e8b309f6e 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -287,12 +287,10 @@ find_event(struct pevent *pevent, struct event_list **events,
287 sys_name = NULL; 287 sys_name = NULL;
288 } 288 }
289 289
290 reg = malloc(strlen(event_name) + 3); 290 ret = asprintf(&reg, "^%s$", event_name);
291 if (reg == NULL) 291 if (ret < 0)
292 return PEVENT_ERRNO__MEM_ALLOC_FAILED; 292 return PEVENT_ERRNO__MEM_ALLOC_FAILED;
293 293
294 sprintf(reg, "^%s$", event_name);
295
296 ret = regcomp(&ereg, reg, REG_ICASE|REG_NOSUB); 294 ret = regcomp(&ereg, reg, REG_ICASE|REG_NOSUB);
297 free(reg); 295 free(reg);
298 296
@@ -300,13 +298,12 @@ find_event(struct pevent *pevent, struct event_list **events,
300 return PEVENT_ERRNO__INVALID_EVENT_NAME; 298 return PEVENT_ERRNO__INVALID_EVENT_NAME;
301 299
302 if (sys_name) { 300 if (sys_name) {
303 reg = malloc(strlen(sys_name) + 3); 301 ret = asprintf(&reg, "^%s$", sys_name);
304 if (reg == NULL) { 302 if (ret < 0) {
305 regfree(&ereg); 303 regfree(&ereg);
306 return PEVENT_ERRNO__MEM_ALLOC_FAILED; 304 return PEVENT_ERRNO__MEM_ALLOC_FAILED;
307 } 305 }
308 306
309 sprintf(reg, "^%s$", sys_name);
310 ret = regcomp(&sreg, reg, REG_ICASE|REG_NOSUB); 307 ret = regcomp(&sreg, reg, REG_ICASE|REG_NOSUB);
311 free(reg); 308 free(reg);
312 if (ret) { 309 if (ret) {
@@ -1634,6 +1631,7 @@ int pevent_filter_clear_trivial(struct event_filter *filter,
1634 case FILTER_TRIVIAL_FALSE: 1631 case FILTER_TRIVIAL_FALSE:
1635 if (filter_type->filter->boolean.value) 1632 if (filter_type->filter->boolean.value)
1636 continue; 1633 continue;
1634 break;
1637 case FILTER_TRIVIAL_TRUE: 1635 case FILTER_TRIVIAL_TRUE:
1638 if (!filter_type->filter->boolean.value) 1636 if (!filter_type->filter->boolean.value)
1639 continue; 1637 continue;
@@ -1879,17 +1877,25 @@ static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r
1879 struct pevent *pevent; 1877 struct pevent *pevent;
1880 unsigned long long addr; 1878 unsigned long long addr;
1881 const char *val = NULL; 1879 const char *val = NULL;
1880 unsigned int size;
1882 char hex[64]; 1881 char hex[64];
1883 1882
1884 /* If the field is not a string convert it */ 1883 /* If the field is not a string convert it */
1885 if (arg->str.field->flags & FIELD_IS_STRING) { 1884 if (arg->str.field->flags & FIELD_IS_STRING) {
1886 val = record->data + arg->str.field->offset; 1885 val = record->data + arg->str.field->offset;
1886 size = arg->str.field->size;
1887
1888 if (arg->str.field->flags & FIELD_IS_DYNAMIC) {
1889 addr = *(unsigned int *)val;
1890 val = record->data + (addr & 0xffff);
1891 size = addr >> 16;
1892 }
1887 1893
1888 /* 1894 /*
1889 * We need to copy the data since we can't be sure the field 1895 * We need to copy the data since we can't be sure the field
1890 * is null terminated. 1896 * is null terminated.
1891 */ 1897 */
1892 if (*(val + arg->str.field->size - 1)) { 1898 if (*(val + size - 1)) {
1893 /* copy it */ 1899 /* copy it */
1894 memcpy(arg->str.buffer, val, arg->str.field->size); 1900 memcpy(arg->str.buffer, val, arg->str.field->size);
1895 /* the buffer is already NULL terminated */ 1901 /* the buffer is already NULL terminated */
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index f40d46e24bcc..b00b1896547e 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -138,6 +138,7 @@ static int __dead_end_function(struct objtool_file *file, struct symbol *func,
138 "__reiserfs_panic", 138 "__reiserfs_panic",
139 "lbug_with_loc", 139 "lbug_with_loc",
140 "fortify_panic", 140 "fortify_panic",
141 "usercopy_abort",
141 }; 142 };
142 143
143 if (func->bind == STB_WEAK) 144 if (func->bind == STB_WEAK)
@@ -543,18 +544,14 @@ static int add_call_destinations(struct objtool_file *file)
543 dest_off = insn->offset + insn->len + insn->immediate; 544 dest_off = insn->offset + insn->len + insn->immediate;
544 insn->call_dest = find_symbol_by_offset(insn->sec, 545 insn->call_dest = find_symbol_by_offset(insn->sec,
545 dest_off); 546 dest_off);
546 /* 547
547 * FIXME: Thanks to retpolines, it's now considered 548 if (!insn->call_dest && !insn->ignore) {
548 * normal for a function to call within itself. So 549 WARN_FUNC("unsupported intra-function call",
549 * disable this warning for now. 550 insn->sec, insn->offset);
550 */ 551 WARN("If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE.");
551#if 0
552 if (!insn->call_dest) {
553 WARN_FUNC("can't find call dest symbol at offset 0x%lx",
554 insn->sec, insn->offset, dest_off);
555 return -1; 552 return -1;
556 } 553 }
557#endif 554
558 } else if (rela->sym->type == STT_SECTION) { 555 } else if (rela->sym->type == STT_SECTION) {
559 insn->call_dest = find_symbol_by_offset(rela->sym->sec, 556 insn->call_dest = find_symbol_by_offset(rela->sym->sec,
560 rela->addend+4); 557 rela->addend+4);
@@ -598,7 +595,7 @@ static int handle_group_alt(struct objtool_file *file,
598 struct instruction *orig_insn, 595 struct instruction *orig_insn,
599 struct instruction **new_insn) 596 struct instruction **new_insn)
600{ 597{
601 struct instruction *last_orig_insn, *last_new_insn, *insn, *fake_jump; 598 struct instruction *last_orig_insn, *last_new_insn, *insn, *fake_jump = NULL;
602 unsigned long dest_off; 599 unsigned long dest_off;
603 600
604 last_orig_insn = NULL; 601 last_orig_insn = NULL;
@@ -614,28 +611,30 @@ static int handle_group_alt(struct objtool_file *file,
614 last_orig_insn = insn; 611 last_orig_insn = insn;
615 } 612 }
616 613
617 if (!next_insn_same_sec(file, last_orig_insn)) { 614 if (next_insn_same_sec(file, last_orig_insn)) {
618 WARN("%s: don't know how to handle alternatives at end of section", 615 fake_jump = malloc(sizeof(*fake_jump));
619 special_alt->orig_sec->name); 616 if (!fake_jump) {
620 return -1; 617 WARN("malloc failed");
621 } 618 return -1;
622 619 }
623 fake_jump = malloc(sizeof(*fake_jump)); 620 memset(fake_jump, 0, sizeof(*fake_jump));
624 if (!fake_jump) { 621 INIT_LIST_HEAD(&fake_jump->alts);
625 WARN("malloc failed"); 622 clear_insn_state(&fake_jump->state);
626 return -1; 623
624 fake_jump->sec = special_alt->new_sec;
625 fake_jump->offset = -1;
626 fake_jump->type = INSN_JUMP_UNCONDITIONAL;
627 fake_jump->jump_dest = list_next_entry(last_orig_insn, list);
628 fake_jump->ignore = true;
627 } 629 }
628 memset(fake_jump, 0, sizeof(*fake_jump));
629 INIT_LIST_HEAD(&fake_jump->alts);
630 clear_insn_state(&fake_jump->state);
631
632 fake_jump->sec = special_alt->new_sec;
633 fake_jump->offset = -1;
634 fake_jump->type = INSN_JUMP_UNCONDITIONAL;
635 fake_jump->jump_dest = list_next_entry(last_orig_insn, list);
636 fake_jump->ignore = true;
637 630
638 if (!special_alt->new_len) { 631 if (!special_alt->new_len) {
632 if (!fake_jump) {
633 WARN("%s: empty alternative at end of section",
634 special_alt->orig_sec->name);
635 return -1;
636 }
637
639 *new_insn = fake_jump; 638 *new_insn = fake_jump;
640 return 0; 639 return 0;
641 } 640 }
@@ -648,6 +647,8 @@ static int handle_group_alt(struct objtool_file *file,
648 647
649 last_new_insn = insn; 648 last_new_insn = insn;
650 649
650 insn->ignore = orig_insn->ignore_alts;
651
651 if (insn->type != INSN_JUMP_CONDITIONAL && 652 if (insn->type != INSN_JUMP_CONDITIONAL &&
652 insn->type != INSN_JUMP_UNCONDITIONAL) 653 insn->type != INSN_JUMP_UNCONDITIONAL)
653 continue; 654 continue;
@@ -656,8 +657,14 @@ static int handle_group_alt(struct objtool_file *file,
656 continue; 657 continue;
657 658
658 dest_off = insn->offset + insn->len + insn->immediate; 659 dest_off = insn->offset + insn->len + insn->immediate;
659 if (dest_off == special_alt->new_off + special_alt->new_len) 660 if (dest_off == special_alt->new_off + special_alt->new_len) {
661 if (!fake_jump) {
662 WARN("%s: alternative jump to end of section",
663 special_alt->orig_sec->name);
664 return -1;
665 }
660 insn->jump_dest = fake_jump; 666 insn->jump_dest = fake_jump;
667 }
661 668
662 if (!insn->jump_dest) { 669 if (!insn->jump_dest) {
663 WARN_FUNC("can't find alternative jump destination", 670 WARN_FUNC("can't find alternative jump destination",
@@ -672,7 +679,8 @@ static int handle_group_alt(struct objtool_file *file,
672 return -1; 679 return -1;
673 } 680 }
674 681
675 list_add(&fake_jump->list, &last_new_insn->list); 682 if (fake_jump)
683 list_add(&fake_jump->list, &last_new_insn->list);
676 684
677 return 0; 685 return 0;
678} 686}
@@ -729,10 +737,6 @@ static int add_special_section_alts(struct objtool_file *file)
729 goto out; 737 goto out;
730 } 738 }
731 739
732 /* Ignore retpoline alternatives. */
733 if (orig_insn->ignore_alts)
734 continue;
735
736 new_insn = NULL; 740 new_insn = NULL;
737 if (!special_alt->group || special_alt->new_len) { 741 if (!special_alt->group || special_alt->new_len) {
738 new_insn = find_insn(file, special_alt->new_sec, 742 new_insn = find_insn(file, special_alt->new_sec,
@@ -1089,11 +1093,11 @@ static int decode_sections(struct objtool_file *file)
1089 if (ret) 1093 if (ret)
1090 return ret; 1094 return ret;
1091 1095
1092 ret = add_call_destinations(file); 1096 ret = add_special_section_alts(file);
1093 if (ret) 1097 if (ret)
1094 return ret; 1098 return ret;
1095 1099
1096 ret = add_special_section_alts(file); 1100 ret = add_call_destinations(file);
1097 if (ret) 1101 if (ret)
1098 return ret; 1102 return ret;
1099 1103
@@ -1720,10 +1724,12 @@ static int validate_branch(struct objtool_file *file, struct instruction *first,
1720 1724
1721 insn->visited = true; 1725 insn->visited = true;
1722 1726
1723 list_for_each_entry(alt, &insn->alts, list) { 1727 if (!insn->ignore_alts) {
1724 ret = validate_branch(file, alt->insn, state); 1728 list_for_each_entry(alt, &insn->alts, list) {
1725 if (ret) 1729 ret = validate_branch(file, alt->insn, state);
1726 return 1; 1730 if (ret)
1731 return 1;
1732 }
1727 } 1733 }
1728 1734
1729 switch (insn->type) { 1735 switch (insn->type) {
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index e61fe703197b..18384d9be4e1 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -98,6 +98,11 @@ static int create_orc_entry(struct section *u_sec, struct section *ip_relasec,
98 struct orc_entry *orc; 98 struct orc_entry *orc;
99 struct rela *rela; 99 struct rela *rela;
100 100
101 if (!insn_sec->sym) {
102 WARN("missing symbol for section %s", insn_sec->name);
103 return -1;
104 }
105
101 /* populate ORC data */ 106 /* populate ORC data */
102 orc = (struct orc_entry *)u_sec->data->d_buf + idx; 107 orc = (struct orc_entry *)u_sec->data->d_buf + idx;
103 memcpy(orc, o, sizeof(*orc)); 108 memcpy(orc, o, sizeof(*orc));
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 643cc4ba6872..3e5135dded16 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -31,5 +31,6 @@ config.mak.autogen
31.config-detected 31.config-detected
32util/intel-pt-decoder/inat-tables.c 32util/intel-pt-decoder/inat-tables.c
33arch/*/include/generated/ 33arch/*/include/generated/
34trace/beauty/generated/
34pmu-events/pmu-events.c 35pmu-events/pmu-events.c
35pmu-events/jevents 36pmu-events/jevents
diff --git a/tools/perf/Build b/tools/perf/Build
index b48ca40fccf9..e5232d567611 100644
--- a/tools/perf/Build
+++ b/tools/perf/Build
@@ -25,7 +25,7 @@ perf-y += builtin-data.o
25perf-y += builtin-version.o 25perf-y += builtin-version.o
26perf-y += builtin-c2c.o 26perf-y += builtin-c2c.o
27 27
28perf-$(CONFIG_AUDIT) += builtin-trace.o 28perf-$(CONFIG_TRACE) += builtin-trace.o
29perf-$(CONFIG_LIBELF) += builtin-probe.o 29perf-$(CONFIG_LIBELF) += builtin-probe.o
30 30
31perf-y += bench/ 31perf-y += bench/
@@ -50,6 +50,6 @@ libperf-y += util/
50libperf-y += arch/ 50libperf-y += arch/
51libperf-y += ui/ 51libperf-y += ui/
52libperf-y += scripts/ 52libperf-y += scripts/
53libperf-$(CONFIG_AUDIT) += trace/beauty/ 53libperf-$(CONFIG_TRACE) += trace/beauty/
54 54
55gtk-y += ui/gtk/ 55gtk-y += ui/gtk/
diff --git a/tools/perf/Documentation/perf-buildid-cache.txt b/tools/perf/Documentation/perf-buildid-cache.txt
index 84681007f80f..73c2650bd0db 100644
--- a/tools/perf/Documentation/perf-buildid-cache.txt
+++ b/tools/perf/Documentation/perf-buildid-cache.txt
@@ -24,6 +24,9 @@ OPTIONS
24-a:: 24-a::
25--add=:: 25--add=::
26 Add specified file to the cache. 26 Add specified file to the cache.
27-f::
28--force::
29 Don't complain, do it.
27-k:: 30-k::
28--kcore:: 31--kcore::
29 Add specified kcore file to the cache. For the current host that is 32 Add specified kcore file to the cache. For the current host that is
diff --git a/tools/perf/Documentation/perf-evlist.txt b/tools/perf/Documentation/perf-evlist.txt
index 6f7200fb85cf..c0a66400a960 100644
--- a/tools/perf/Documentation/perf-evlist.txt
+++ b/tools/perf/Documentation/perf-evlist.txt
@@ -20,6 +20,10 @@ OPTIONS
20--input=:: 20--input=::
21 Input file name. (default: perf.data unless stdin is a fifo) 21 Input file name. (default: perf.data unless stdin is a fifo)
22 22
23-f::
24--force::
25 Don't complain, do it.
26
23-F:: 27-F::
24--freq=:: 28--freq=::
25 Show just the sample frequency used for each event. 29 Show just the sample frequency used for each event.
diff --git a/tools/perf/Documentation/perf-inject.txt b/tools/perf/Documentation/perf-inject.txt
index 87b2588d1cbd..a64d6588470e 100644
--- a/tools/perf/Documentation/perf-inject.txt
+++ b/tools/perf/Documentation/perf-inject.txt
@@ -60,6 +60,10 @@ include::itrace.txt[]
60 found in the jitdumps files captured in the input perf.data file. Use this option 60 found in the jitdumps files captured in the input perf.data file. Use this option
61 if you are monitoring environment using JIT runtimes, such as Java, DART or V8. 61 if you are monitoring environment using JIT runtimes, such as Java, DART or V8.
62 62
63-f::
64--force::
65 Don't complain, do it.
66
63SEE ALSO 67SEE ALSO
64-------- 68--------
65linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1] 69linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1]
diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt
index ab25be28c9dc..74d774592196 100644
--- a/tools/perf/Documentation/perf-lock.txt
+++ b/tools/perf/Documentation/perf-lock.txt
@@ -42,6 +42,10 @@ COMMON OPTIONS
42--dump-raw-trace:: 42--dump-raw-trace::
43 Dump raw trace in ASCII. 43 Dump raw trace in ASCII.
44 44
45-f::
46--force::
47 Don't complan, do it.
48
45REPORT OPTIONS 49REPORT OPTIONS
46-------------- 50--------------
47 51
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index d7e4869905f1..b6866a05edd2 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -170,7 +170,7 @@ Probe points are defined by following syntax.
170 or, 170 or,
171 sdt_PROVIDER:SDTEVENT 171 sdt_PROVIDER:SDTEVENT
172 172
173'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function. You can also specify a group name by 'GROUP', if omitted, set 'probe' is used for kprobe and 'probe_<bin>' is used for uprobe. 173'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function, and for return probes, a "\_\_return" suffix is automatically added to the function name. You can also specify a group name by 'GROUP', if omitted, set 'probe' is used for kprobe and 'probe_<bin>' is used for uprobe.
174Note that using existing group name can conflict with other events. Especially, using the group name reserved for kernel modules can hide embedded events in the 174Note that using existing group name can conflict with other events. Especially, using the group name reserved for kernel modules can hide embedded events in the
175modules. 175modules.
176'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, ':RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. And ';PTN' means lazy matching pattern (see LAZY MATCHING). Note that ';PTN' must be the end of the probe point definition. In addition, '@SRC' specifies a source file which has that function. 176'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, ':RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. And ';PTN' means lazy matching pattern (see LAZY MATCHING). Note that ';PTN' must be the end of the probe point definition. In addition, '@SRC' specifies a source file which has that function.
@@ -182,6 +182,14 @@ Note that before using the SDT event, the target binary (on which SDT events are
182For details of the SDT, see below. 182For details of the SDT, see below.
183https://sourceware.org/gdb/onlinedocs/gdb/Static-Probe-Points.html 183https://sourceware.org/gdb/onlinedocs/gdb/Static-Probe-Points.html
184 184
185ESCAPED CHARACTER
186-----------------
187
188In the probe syntax, '=', '@', '+', ':' and ';' are treated as a special character. You can use a backslash ('\') to escape the special characters.
189This is useful if you need to probe on a specific versioned symbols, like @GLIBC_... suffixes, or also you need to specify a source file which includes the special characters.
190Note that usually single backslash is consumed by shell, so you might need to pass double backslash (\\) or wrapping with single quotes (\'AAA\@BBB').
191See EXAMPLES how it is used.
192
185PROBE ARGUMENT 193PROBE ARGUMENT
186-------------- 194--------------
187Each probe argument follows below syntax. 195Each probe argument follows below syntax.
@@ -277,6 +285,14 @@ Add a USDT probe to a target process running in a different mount namespace
277 285
278 ./perf probe --target-ns <target pid> -x /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64/server/libjvm.so %sdt_hotspot:thread__sleep__end 286 ./perf probe --target-ns <target pid> -x /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64/server/libjvm.so %sdt_hotspot:thread__sleep__end
279 287
288Add a probe on specific versioned symbol by backslash escape
289
290 ./perf probe -x /lib64/libc-2.25.so 'malloc_get_state\@GLIBC_2.2.5'
291
292Add a probe in a source file using special characters by backslash escape
293
294 ./perf probe -x /opt/test/a.out 'foo\+bar.c:4'
295
280 296
281SEE ALSO 297SEE ALSO
282-------- 298--------
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 5a626ef666c2..3eea6de35a38 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -430,6 +430,9 @@ Configure all used events to run in user space.
430--timestamp-filename 430--timestamp-filename
431Append timestamp to output file name. 431Append timestamp to output file name.
432 432
433--timestamp-boundary::
434Record timestamp boundary (time of first/last samples).
435
433--switch-output[=mode]:: 436--switch-output[=mode]::
434Generate multiple perf.data files, timestamp prefixed, switching to a new one 437Generate multiple perf.data files, timestamp prefixed, switching to a new one
435based on 'mode' value: 438based on 'mode' value:
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index ddde2b54af57..907e505b6309 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -402,6 +402,26 @@ OPTIONS
402 stop time is not given (i.e, time string is 'x.y,') then analysis goes 402 stop time is not given (i.e, time string is 'x.y,') then analysis goes
403 to end of file. 403 to end of file.
404 404
405 Also support time percent with multiple time range. Time string is
406 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'.
407
408 For example:
409 Select the second 10% time slice:
410
411 perf report --time 10%/2
412
413 Select from 0% to 10% time slice:
414
415 perf report --time 0%-10%
416
417 Select the first and second 10% time slices:
418
419 perf report --time 10%/1,10%/2
420
421 Select from 0% to 10% and 30% to 40% slices:
422
423 perf report --time 0%-10%,30%-40%
424
405--itrace:: 425--itrace::
406 Options for decoding instruction tracing data. The options are: 426 Options for decoding instruction tracing data. The options are:
407 427
@@ -437,8 +457,23 @@ include::itrace.txt[]
437 will be printed. Each entry is function name or file/line. Enabled by 457 will be printed. Each entry is function name or file/line. Enabled by
438 default, disable with --no-inline. 458 default, disable with --no-inline.
439 459
460--mmaps::
461 Show --tasks output plus mmap information in a format similar to
462 /proc/<PID>/maps.
463
464 Please note that not all mmaps are stored, options affecting which ones
465 are include 'perf record --data', for instance.
466
467--stats::
468 Display overall events statistics without any further processing.
469 (like the one at the end of the perf report -D command)
470
471--tasks::
472 Display monitored tasks stored in perf data. Displaying pid/tid/ppid
473 plus the command string aligned to distinguish parent and child tasks.
474
440include::callchain-overhead-calculation.txt[] 475include::callchain-overhead-calculation.txt[]
441 476
442SEE ALSO 477SEE ALSO
443-------- 478--------
444linkperf:perf-stat[1], linkperf:perf-annotate[1] 479linkperf:perf-stat[1], linkperf:perf-annotate[1], linkperf:perf-record[1]
diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt
index 55b67338548e..c7e50f263887 100644
--- a/tools/perf/Documentation/perf-sched.txt
+++ b/tools/perf/Documentation/perf-sched.txt
@@ -74,6 +74,10 @@ OPTIONS
74--dump-raw-trace=:: 74--dump-raw-trace=::
75 Display verbose dump of the sched data. 75 Display verbose dump of the sched data.
76 76
77-f::
78--force::
79 Don't complain, do it.
80
77OPTIONS for 'perf sched map' 81OPTIONS for 'perf sched map'
78---------------------------- 82----------------------------
79 83
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 2811fcf684cb..7730c1d2b5d3 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -117,7 +117,7 @@ OPTIONS
117 Comma separated list of fields to print. Options are: 117 Comma separated list of fields to print. Options are:
118 comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff, 118 comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
119 srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn, 119 srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn,
120 brstackoff, callindent, insn, insnlen, synth, phys_addr. 120 brstackoff, callindent, insn, insnlen, synth, phys_addr, metric, misc.
121 Field list can be prepended with the type, trace, sw or hw, 121 Field list can be prepended with the type, trace, sw or hw,
122 to indicate to which event type the field list applies. 122 to indicate to which event type the field list applies.
123 e.g., -F sw:comm,tid,time,ip,sym and -F trace:time,cpu,trace 123 e.g., -F sw:comm,tid,time,ip,sym and -F trace:time,cpu,trace
@@ -217,6 +217,32 @@ OPTIONS
217 217
218 The brstackoff field will print an offset into a specific dso/binary. 218 The brstackoff field will print an offset into a specific dso/binary.
219 219
220 With the metric option perf script can compute metrics for
221 sampling periods, similar to perf stat. This requires
222 specifying a group with multiple metrics with the :S option
223 for perf record. perf will sample on the first event, and
224 compute metrics for all the events in the group. Please note
225 that the metric computed is averaged over the whole sampling
226 period, not just for the sample point.
227
228 For sample events it's possible to display misc field with -F +misc option,
229 following letters are displayed for each bit:
230
231 PERF_RECORD_MISC_KERNEL K
232 PERF_RECORD_MISC_USER U
233 PERF_RECORD_MISC_HYPERVISOR H
234 PERF_RECORD_MISC_GUEST_KERNEL G
235 PERF_RECORD_MISC_GUEST_USER g
236 PERF_RECORD_MISC_MMAP_DATA* M
237 PERF_RECORD_MISC_COMM_EXEC E
238 PERF_RECORD_MISC_SWITCH_OUT S
239
240 $ perf script -F +misc ...
241 sched-messaging 1414 K 28690.636582: 4590 cycles ...
242 sched-messaging 1407 U 28690.636600: 325620 cycles ...
243 sched-messaging 1414 K 28690.636608: 19473 cycles ...
244 misc field ___________/
245
220-k:: 246-k::
221--vmlinux=<file>:: 247--vmlinux=<file>::
222 vmlinux pathname 248 vmlinux pathname
@@ -274,6 +300,9 @@ OPTIONS
274 Display context switch events i.e. events of type PERF_RECORD_SWITCH or 300 Display context switch events i.e. events of type PERF_RECORD_SWITCH or
275 PERF_RECORD_SWITCH_CPU_WIDE. 301 PERF_RECORD_SWITCH_CPU_WIDE.
276 302
303--show-lost-events
304 Display lost events i.e. events of type PERF_RECORD_LOST.
305
277--demangle:: 306--demangle::
278 Demangle symbol names to human readable form. It's enabled by default, 307 Demangle symbol names to human readable form. It's enabled by default,
279 disable with --no-demangle. 308 disable with --no-demangle.
@@ -321,6 +350,22 @@ include::itrace.txt[]
321 stop time is not given (i.e, time string is 'x.y,') then analysis goes 350 stop time is not given (i.e, time string is 'x.y,') then analysis goes
322 to end of file. 351 to end of file.
323 352
353 Also support time percent with multipe time range. Time string is
354 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'.
355
356 For example:
357 Select the second 10% time slice:
358 perf script --time 10%/2
359
360 Select from 0% to 10% time slice:
361 perf script --time 0%-10%
362
363 Select the first and second 10% time slices:
364 perf script --time 10%/1,10%/2
365
366 Select from 0% to 10% and 30% to 40% slices:
367 perf script --time 0%-10%,30%-40%
368
324--max-blocks:: 369--max-blocks::
325 Set the maximum number of program blocks to print with brstackasm for 370 Set the maximum number of program blocks to print with brstackasm for
326 each sample. 371 each sample.
diff --git a/tools/perf/Documentation/perf-timechart.txt b/tools/perf/Documentation/perf-timechart.txt
index df98d1c82688..ef0c7565bd5c 100644
--- a/tools/perf/Documentation/perf-timechart.txt
+++ b/tools/perf/Documentation/perf-timechart.txt
@@ -50,7 +50,9 @@ TIMECHART OPTIONS
50-p:: 50-p::
51--process:: 51--process::
52 Select the processes to display, by name or PID 52 Select the processes to display, by name or PID
53 53-f::
54--force::
55 Don't complain, do it.
54--symfs=<directory>:: 56--symfs=<directory>::
55 Look for files with symbols relative to this directory. 57 Look for files with symbols relative to this directory.
56-n:: 58-n::
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index 4353262bc462..8a32cc77bead 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -268,6 +268,12 @@ INTERACTIVE PROMPTING KEYS
268[S]:: 268[S]::
269 Stop annotation, return to full profile display. 269 Stop annotation, return to full profile display.
270 270
271[K]::
272 Hide kernel symbols.
273
274[U]::
275 Hide user symbols.
276
271[z]:: 277[z]::
272 Toggle event count zeroing across display updates. 278 Toggle event count zeroing across display updates.
273 279
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
index d53bea6bd571..33a88e984e66 100644
--- a/tools/perf/Documentation/perf-trace.txt
+++ b/tools/perf/Documentation/perf-trace.txt
@@ -86,18 +86,18 @@ comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-
86In per-thread mode with inheritance mode on (default), Events are captured only when 86In per-thread mode with inheritance mode on (default), Events are captured only when
87the thread executes on the designated CPUs. Default is to monitor all CPUs. 87the thread executes on the designated CPUs. Default is to monitor all CPUs.
88 88
89--duration: 89--duration::
90 Show only events that had a duration greater than N.M ms. 90 Show only events that had a duration greater than N.M ms.
91 91
92--sched: 92--sched::
93 Accrue thread runtime and provide a summary at the end of the session. 93 Accrue thread runtime and provide a summary at the end of the session.
94 94
95-i 95-i::
96--input 96--input::
97 Process events from a given perf data file. 97 Process events from a given perf data file.
98 98
99-T 99-T::
100--time 100--time::
101 Print full timestamp rather time relative to first sample. 101 Print full timestamp rather time relative to first sample.
102 102
103--comm:: 103--comm::
@@ -117,6 +117,10 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
117 Show tool stats such as number of times fd->pathname was discovered thru 117 Show tool stats such as number of times fd->pathname was discovered thru
118 hooking the open syscall return + vfs_getname or via reading /proc/pid/fd, etc. 118 hooking the open syscall return + vfs_getname or via reading /proc/pid/fd, etc.
119 119
120-f::
121--force::
122 Don't complain, do it.
123
120-F=[all|min|maj]:: 124-F=[all|min|maj]::
121--pf=[all|min|maj]:: 125--pf=[all|min|maj]::
122 Trace pagefaults. Optionally, you can specify whether you want minor, 126 Trace pagefaults. Optionally, you can specify whether you want minor,
@@ -159,6 +163,10 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
159 Implies '--call-graph dwarf' when --call-graph not present on the 163 Implies '--call-graph dwarf' when --call-graph not present on the
160 command line, on systems where DWARF unwinding was built in. 164 command line, on systems where DWARF unwinding was built in.
161 165
166--print-sample::
167 Print the PERF_RECORD_SAMPLE PERF_SAMPLE_ info for the
168 raw_syscalls:sys_{enter,exit} tracepoints, for debugging.
169
162--proc-map-timeout:: 170--proc-map-timeout::
163 When processing pre-existing threads /proc/XXX/mmap, it may take a long time, 171 When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
164 because the file may be huge. A time out is needed in such cases. 172 because the file may be huge. A time out is needed in such cases.
diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt
index e90c59c6d815..f7d85e89a98a 100644
--- a/tools/perf/Documentation/perf.data-file-format.txt
+++ b/tools/perf/Documentation/perf.data-file-format.txt
@@ -238,6 +238,33 @@ struct auxtrace_index {
238 struct auxtrace_index_entry entries[PERF_AUXTRACE_INDEX_ENTRY_COUNT]; 238 struct auxtrace_index_entry entries[PERF_AUXTRACE_INDEX_ENTRY_COUNT];
239}; 239};
240 240
241 HEADER_STAT = 19,
242
243This is merely a flag signifying that the data section contains data
244recorded from perf stat record.
245
246 HEADER_CACHE = 20,
247
248Description of the cache hierarchy. Based on the Linux sysfs format
249in /sys/devices/system/cpu/cpu*/cache/
250
251 u32 version Currently always 1
252 u32 number_of_cache_levels
253
254struct {
255 u32 level;
256 u32 line_size;
257 u32 sets;
258 u32 ways;
259 struct perf_header_string type;
260 struct perf_header_string size;
261 struct perf_header_string map;
262}[number_of_cache_levels];
263
264 HEADER_SAMPLE_TIME = 21,
265
266Two uint64_t for the time of first sample and the time of last sample.
267
241 other bits are reserved and should ignored for now 268 other bits are reserved and should ignored for now
242 HEADER_FEAT_BITS = 256, 269 HEADER_FEAT_BITS = 256,
243 270
diff --git a/tools/perf/Documentation/tips.txt b/tools/perf/Documentation/tips.txt
index db0ca3063eae..849599f39c5e 100644
--- a/tools/perf/Documentation/tips.txt
+++ b/tools/perf/Documentation/tips.txt
@@ -32,3 +32,5 @@ Order by the overhead of source file name and line number: perf report -s srclin
32System-wide collection from all CPUs: perf record -a 32System-wide collection from all CPUs: perf record -a
33Show current config key-value pairs: perf config --list 33Show current config key-value pairs: perf config --list
34Show user configuration overrides: perf config --user --list 34Show user configuration overrides: perf config --user --list
35To add Node.js USDT(User-Level Statically Defined Tracing): perf buildid-cache --add `which node`
36To report cacheline events from previous recording: perf c2c report
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 0294bfb6c5f8..0dfdaa9fa81e 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -22,6 +22,7 @@ include $(srctree)/tools/scripts/Makefile.arch
22$(call detected_var,SRCARCH) 22$(call detected_var,SRCARCH)
23 23
24NO_PERF_REGS := 1 24NO_PERF_REGS := 1
25NO_SYSCALL_TABLE := 1
25 26
26# Additional ARCH settings for ppc 27# Additional ARCH settings for ppc
27ifeq ($(SRCARCH),powerpc) 28ifeq ($(SRCARCH),powerpc)
@@ -33,7 +34,8 @@ endif
33ifeq ($(SRCARCH),x86) 34ifeq ($(SRCARCH),x86)
34 $(call detected,CONFIG_X86) 35 $(call detected,CONFIG_X86)
35 ifeq (${IS_64_BIT}, 1) 36 ifeq (${IS_64_BIT}, 1)
36 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE -I$(OUTPUT)arch/x86/include/generated 37 NO_SYSCALL_TABLE := 0
38 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
37 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S 39 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
38 LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma 40 LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
39 $(call detected,CONFIG_X86_64) 41 $(call detected,CONFIG_X86_64)
@@ -55,12 +57,18 @@ endif
55 57
56ifeq ($(ARCH),s390) 58ifeq ($(ARCH),s390)
57 NO_PERF_REGS := 0 59 NO_PERF_REGS := 0
60 NO_SYSCALL_TABLE := 0
61 CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
58endif 62endif
59 63
60ifeq ($(NO_PERF_REGS),0) 64ifeq ($(NO_PERF_REGS),0)
61 $(call detected,CONFIG_PERF_REGS) 65 $(call detected,CONFIG_PERF_REGS)
62endif 66endif
63 67
68ifneq ($(NO_SYSCALL_TABLE),1)
69 CFLAGS += -DHAVE_SYSCALL_TABLE
70endif
71
64# So far there's only x86 and arm libdw unwind support merged in perf. 72# So far there's only x86 and arm libdw unwind support merged in perf.
65# Disable it on all other architectures in case libdw unwind 73# Disable it on all other architectures in case libdw unwind
66# support is detected in system. Add supported architectures 74# support is detected in system. Add supported architectures
@@ -97,6 +105,16 @@ FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
97FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS) 105FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
98FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) 106FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
99 107
108ifdef CSINCLUDES
109 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
110endif
111OPENCSDLIBS := -lopencsd_c_api -lopencsd
112ifdef CSLIBS
113 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
114endif
115FEATURE_CHECK_CFLAGS-libopencsd := $(LIBOPENCSD_CFLAGS)
116FEATURE_CHECK_LDFLAGS-libopencsd := $(LIBOPENCSD_LDFLAGS) $(OPENCSDLIBS)
117
100ifeq ($(NO_PERF_REGS),0) 118ifeq ($(NO_PERF_REGS),0)
101 CFLAGS += -DHAVE_PERF_REGS_SUPPORT 119 CFLAGS += -DHAVE_PERF_REGS_SUPPORT
102endif 120endif
@@ -265,6 +283,10 @@ ifeq ($(feature-pthread-attr-setaffinity-np), 1)
265 CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP 283 CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
266endif 284endif
267 285
286ifeq ($(feature-pthread-barrier), 1)
287 CFLAGS += -DHAVE_PTHREAD_BARRIER
288endif
289
268ifndef NO_BIONIC 290ifndef NO_BIONIC
269 $(call feature_check,bionic) 291 $(call feature_check,bionic)
270 ifeq ($(feature-bionic), 1) 292 ifeq ($(feature-bionic), 1)
@@ -341,6 +363,21 @@ ifeq ($(feature-setns), 1)
341 $(call detected,CONFIG_SETNS) 363 $(call detected,CONFIG_SETNS)
342endif 364endif
343 365
366ifndef NO_CORESIGHT
367 ifeq ($(feature-libopencsd), 1)
368 CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
369 LDFLAGS += $(LIBOPENCSD_LDFLAGS)
370 EXTLIBS += $(OPENCSDLIBS)
371 $(call detected,CONFIG_LIBOPENCSD)
372 ifdef CSTRACE_RAW
373 CFLAGS += -DCS_DEBUG_RAW
374 ifeq (${CSTRACE_RAW}, packed)
375 CFLAGS += -DCS_RAW_PACKED
376 endif
377 endif
378 endif
379endif
380
344ifndef NO_LIBELF 381ifndef NO_LIBELF
345 CFLAGS += -DHAVE_LIBELF_SUPPORT 382 CFLAGS += -DHAVE_LIBELF_SUPPORT
346 EXTLIBS += -lelf 383 EXTLIBS += -lelf
@@ -519,14 +556,18 @@ ifndef NO_LIBUNWIND
519 EXTLIBS += $(EXTLIBS_LIBUNWIND) 556 EXTLIBS += $(EXTLIBS_LIBUNWIND)
520endif 557endif
521 558
522ifndef NO_LIBAUDIT 559ifeq ($(NO_SYSCALL_TABLE),0)
523 ifneq ($(feature-libaudit), 1) 560 $(call detected,CONFIG_TRACE)
524 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); 561else
525 NO_LIBAUDIT := 1 562 ifndef NO_LIBAUDIT
526 else 563 ifneq ($(feature-libaudit), 1)
527 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT 564 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
528 EXTLIBS += -laudit 565 NO_LIBAUDIT := 1
529 $(call detected,CONFIG_AUDIT) 566 else
567 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
568 EXTLIBS += -laudit
569 $(call detected,CONFIG_TRACE)
570 endif
530 endif 571 endif
531endif 572endif
532 573
@@ -768,7 +809,7 @@ else
768 NO_PERF_READ_VDSOX32 := 1 809 NO_PERF_READ_VDSOX32 := 1
769endif 810endif
770 811
771ifdef LIBBABELTRACE 812ifndef NO_LIBBABELTRACE
772 $(call feature_check,libbabeltrace) 813 $(call feature_check,libbabeltrace)
773 ifeq ($(feature-libbabeltrace), 1) 814 ifeq ($(feature-libbabeltrace), 1)
774 CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS) 815 CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
@@ -935,6 +976,10 @@ define print_var_code
935endef 976endef
936 977
937ifeq ($(VF),1) 978ifeq ($(VF),1)
979 # Display EXTRA features which are detected manualy
980 # from here with feature_check call and thus cannot
981 # be partof global state output.
982 $(foreach feat,$(FEATURE_TESTS_EXTRA),$(call feature_print_status,$(feat),))
938 $(call print_var,prefix) 983 $(call print_var,prefix)
939 $(call print_var,bindir) 984 $(call print_var,bindir)
940 $(call print_var,libdir) 985 $(call print_var,libdir)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 68cf1360a3f3..9b0351d3ce34 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -77,7 +77,7 @@ include ../scripts/utilities.mak
77# 77#
78# Define NO_ZLIB if you do not want to support compressed kernel modules 78# Define NO_ZLIB if you do not want to support compressed kernel modules
79# 79#
80# Define LIBBABELTRACE if you DO want libbabeltrace support 80# Define NO_LIBBABELTRACE if you do not want libbabeltrace support
81# for CTF data format. 81# for CTF data format.
82# 82#
83# Define NO_LZMA if you do not want to support compressed (xz) kernel modules 83# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
@@ -98,6 +98,8 @@ include ../scripts/utilities.mak
98# When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if 98# When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if
99# llvm-config is not in $PATH. 99# llvm-config is not in $PATH.
100 100
101# Define NO_CORESIGHT if you do not want support for CoreSight trace decoding.
102
101# As per kernel Makefile, avoid funny character set dependencies 103# As per kernel Makefile, avoid funny character set dependencies
102unexport LC_ALL 104unexport LC_ALL
103LC_COLLATE=C 105LC_COLLATE=C
@@ -462,6 +464,13 @@ prctl_option_tbl := $(srctree)/tools/perf/trace/beauty/prctl_option.sh
462$(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl) 464$(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl)
463 $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@ 465 $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@
464 466
467arch_errno_name_array := $(beauty_outdir)/arch_errno_name_array.c
468arch_errno_hdr_dir := $(srctree)/tools
469arch_errno_tbl := $(srctree)/tools/perf/trace/beauty/arch_errno_names.sh
470
471$(arch_errno_name_array): $(arch_errno_tbl)
472 $(Q)$(SHELL) '$(arch_errno_tbl)' $(CC) $(arch_errno_hdr_dir) > $@
473
465all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) 474all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
466 475
467$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) 476$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
@@ -565,7 +574,8 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc
565 $(vhost_virtio_ioctl_array) \ 574 $(vhost_virtio_ioctl_array) \
566 $(madvise_behavior_array) \ 575 $(madvise_behavior_array) \
567 $(perf_ioctl_array) \ 576 $(perf_ioctl_array) \
568 $(prctl_option_array) 577 $(prctl_option_array) \
578 $(arch_errno_name_array)
569 579
570$(OUTPUT)%.o: %.c prepare FORCE 580$(OUTPUT)%.o: %.c prepare FORCE
571 $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ 581 $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
@@ -847,7 +857,8 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea
847 $(OUTPUT)$(kcmp_type_array) \ 857 $(OUTPUT)$(kcmp_type_array) \
848 $(OUTPUT)$(vhost_virtio_ioctl_array) \ 858 $(OUTPUT)$(vhost_virtio_ioctl_array) \
849 $(OUTPUT)$(perf_ioctl_array) \ 859 $(OUTPUT)$(perf_ioctl_array) \
850 $(OUTPUT)$(prctl_option_array) 860 $(OUTPUT)$(prctl_option_array) \
861 $(OUTPUT)$(arch_errno_name_array)
851 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean 862 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
852 863
853# 864#
diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c
index 8edf2cb71564..2323581b157d 100644
--- a/tools/perf/arch/arm/util/auxtrace.c
+++ b/tools/perf/arch/arm/util/auxtrace.c
@@ -22,6 +22,42 @@
22#include "../../util/evlist.h" 22#include "../../util/evlist.h"
23#include "../../util/pmu.h" 23#include "../../util/pmu.h"
24#include "cs-etm.h" 24#include "cs-etm.h"
25#include "arm-spe.h"
26
27static struct perf_pmu **find_all_arm_spe_pmus(int *nr_spes, int *err)
28{
29 struct perf_pmu **arm_spe_pmus = NULL;
30 int ret, i, nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
31 /* arm_spe_xxxxxxxxx\0 */
32 char arm_spe_pmu_name[sizeof(ARM_SPE_PMU_NAME) + 10];
33
34 arm_spe_pmus = zalloc(sizeof(struct perf_pmu *) * nr_cpus);
35 if (!arm_spe_pmus) {
36 pr_err("spes alloc failed\n");
37 *err = -ENOMEM;
38 return NULL;
39 }
40
41 for (i = 0; i < nr_cpus; i++) {
42 ret = sprintf(arm_spe_pmu_name, "%s%d", ARM_SPE_PMU_NAME, i);
43 if (ret < 0) {
44 pr_err("sprintf failed\n");
45 *err = -ENOMEM;
46 return NULL;
47 }
48
49 arm_spe_pmus[*nr_spes] = perf_pmu__find(arm_spe_pmu_name);
50 if (arm_spe_pmus[*nr_spes]) {
51 pr_debug2("%s %d: arm_spe_pmu %d type %d name %s\n",
52 __func__, __LINE__, *nr_spes,
53 arm_spe_pmus[*nr_spes]->type,
54 arm_spe_pmus[*nr_spes]->name);
55 (*nr_spes)++;
56 }
57 }
58
59 return arm_spe_pmus;
60}
25 61
26struct auxtrace_record 62struct auxtrace_record
27*auxtrace_record__init(struct perf_evlist *evlist, int *err) 63*auxtrace_record__init(struct perf_evlist *evlist, int *err)
@@ -29,22 +65,51 @@ struct auxtrace_record
29 struct perf_pmu *cs_etm_pmu; 65 struct perf_pmu *cs_etm_pmu;
30 struct perf_evsel *evsel; 66 struct perf_evsel *evsel;
31 bool found_etm = false; 67 bool found_etm = false;
68 bool found_spe = false;
69 static struct perf_pmu **arm_spe_pmus = NULL;
70 static int nr_spes = 0;
71 int i;
72
73 if (!evlist)
74 return NULL;
32 75
33 cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME); 76 cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME);
34 77
35 if (evlist) { 78 if (!arm_spe_pmus)
36 evlist__for_each_entry(evlist, evsel) { 79 arm_spe_pmus = find_all_arm_spe_pmus(&nr_spes, err);
37 if (cs_etm_pmu && 80
38 evsel->attr.type == cs_etm_pmu->type) 81 evlist__for_each_entry(evlist, evsel) {
39 found_etm = true; 82 if (cs_etm_pmu &&
83 evsel->attr.type == cs_etm_pmu->type)
84 found_etm = true;
85
86 if (!nr_spes)
87 continue;
88
89 for (i = 0; i < nr_spes; i++) {
90 if (evsel->attr.type == arm_spe_pmus[i]->type) {
91 found_spe = true;
92 break;
93 }
40 } 94 }
41 } 95 }
42 96
97 if (found_etm && found_spe) {
98 pr_err("Concurrent ARM Coresight ETM and SPE operation not currently supported\n");
99 *err = -EOPNOTSUPP;
100 return NULL;
101 }
102
43 if (found_etm) 103 if (found_etm)
44 return cs_etm_record_init(err); 104 return cs_etm_record_init(err);
45 105
106#if defined(__aarch64__)
107 if (found_spe)
108 return arm_spe_recording_init(err, arm_spe_pmus[i]);
109#endif
110
46 /* 111 /*
47 * Clear 'err' even if we haven't found a cs_etm event - that way perf 112 * Clear 'err' even if we haven't found an event - that way perf
48 * record can still be used even if tracers aren't present. The NULL 113 * record can still be used even if tracers aren't present. The NULL
49 * return value will take care of telling the infrastructure HW tracing 114 * return value will take care of telling the infrastructure HW tracing
50 * isn't available. 115 * isn't available.
diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c
index 98d67399a0d6..ac4dffc807b8 100644
--- a/tools/perf/arch/arm/util/pmu.c
+++ b/tools/perf/arch/arm/util/pmu.c
@@ -20,6 +20,7 @@
20#include <linux/perf_event.h> 20#include <linux/perf_event.h>
21 21
22#include "cs-etm.h" 22#include "cs-etm.h"
23#include "arm-spe.h"
23#include "../../util/pmu.h" 24#include "../../util/pmu.h"
24 25
25struct perf_event_attr 26struct perf_event_attr
@@ -30,7 +31,12 @@ struct perf_event_attr
30 /* add ETM default config here */ 31 /* add ETM default config here */
31 pmu->selectable = true; 32 pmu->selectable = true;
32 pmu->set_drv_config = cs_etm_set_drv_config; 33 pmu->set_drv_config = cs_etm_set_drv_config;
34#if defined(__aarch64__)
35 } else if (strstarts(pmu->name, ARM_SPE_PMU_NAME)) {
36 return arm_spe_pmu_default_config(pmu);
37#endif
33 } 38 }
39
34#endif 40#endif
35 return NULL; 41 return NULL;
36} 42}
diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build
index cef6fb38d17e..c0b8dfef98ba 100644
--- a/tools/perf/arch/arm64/util/Build
+++ b/tools/perf/arch/arm64/util/Build
@@ -1,6 +1,9 @@
1libperf-y += header.o
2libperf-y += sym-handling.o
1libperf-$(CONFIG_DWARF) += dwarf-regs.o 3libperf-$(CONFIG_DWARF) += dwarf-regs.o
2libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o 4libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
3 5
4libperf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \ 6libperf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \
5 ../../arm/util/auxtrace.o \ 7 ../../arm/util/auxtrace.o \
6 ../../arm/util/cs-etm.o 8 ../../arm/util/cs-etm.o \
9 arm-spe.o
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
new file mode 100644
index 000000000000..1120e39c1b00
--- /dev/null
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -0,0 +1,225 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Arm Statistical Profiling Extensions (SPE) support
4 * Copyright (c) 2017-2018, Arm Ltd.
5 */
6
7#include <linux/kernel.h>
8#include <linux/types.h>
9#include <linux/bitops.h>
10#include <linux/log2.h>
11#include <time.h>
12
13#include "../../util/cpumap.h"
14#include "../../util/evsel.h"
15#include "../../util/evlist.h"
16#include "../../util/session.h"
17#include "../../util/util.h"
18#include "../../util/pmu.h"
19#include "../../util/debug.h"
20#include "../../util/auxtrace.h"
21#include "../../util/arm-spe.h"
22
23#define KiB(x) ((x) * 1024)
24#define MiB(x) ((x) * 1024 * 1024)
25
26struct arm_spe_recording {
27 struct auxtrace_record itr;
28 struct perf_pmu *arm_spe_pmu;
29 struct perf_evlist *evlist;
30};
31
32static size_t
33arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused,
34 struct perf_evlist *evlist __maybe_unused)
35{
36 return ARM_SPE_AUXTRACE_PRIV_SIZE;
37}
38
39static int arm_spe_info_fill(struct auxtrace_record *itr,
40 struct perf_session *session,
41 struct auxtrace_info_event *auxtrace_info,
42 size_t priv_size)
43{
44 struct arm_spe_recording *sper =
45 container_of(itr, struct arm_spe_recording, itr);
46 struct perf_pmu *arm_spe_pmu = sper->arm_spe_pmu;
47
48 if (priv_size != ARM_SPE_AUXTRACE_PRIV_SIZE)
49 return -EINVAL;
50
51 if (!session->evlist->nr_mmaps)
52 return -EINVAL;
53
54 auxtrace_info->type = PERF_AUXTRACE_ARM_SPE;
55 auxtrace_info->priv[ARM_SPE_PMU_TYPE] = arm_spe_pmu->type;
56
57 return 0;
58}
59
60static int arm_spe_recording_options(struct auxtrace_record *itr,
61 struct perf_evlist *evlist,
62 struct record_opts *opts)
63{
64 struct arm_spe_recording *sper =
65 container_of(itr, struct arm_spe_recording, itr);
66 struct perf_pmu *arm_spe_pmu = sper->arm_spe_pmu;
67 struct perf_evsel *evsel, *arm_spe_evsel = NULL;
68 bool privileged = geteuid() == 0 || perf_event_paranoid() < 0;
69 struct perf_evsel *tracking_evsel;
70 int err;
71
72 sper->evlist = evlist;
73
74 evlist__for_each_entry(evlist, evsel) {
75 if (evsel->attr.type == arm_spe_pmu->type) {
76 if (arm_spe_evsel) {
77 pr_err("There may be only one " ARM_SPE_PMU_NAME "x event\n");
78 return -EINVAL;
79 }
80 evsel->attr.freq = 0;
81 evsel->attr.sample_period = 1;
82 arm_spe_evsel = evsel;
83 opts->full_auxtrace = true;
84 }
85 }
86
87 if (!opts->full_auxtrace)
88 return 0;
89
90 /* We are in full trace mode but '-m,xyz' wasn't specified */
91 if (opts->full_auxtrace && !opts->auxtrace_mmap_pages) {
92 if (privileged) {
93 opts->auxtrace_mmap_pages = MiB(4) / page_size;
94 } else {
95 opts->auxtrace_mmap_pages = KiB(128) / page_size;
96 if (opts->mmap_pages == UINT_MAX)
97 opts->mmap_pages = KiB(256) / page_size;
98 }
99 }
100
101 /* Validate auxtrace_mmap_pages */
102 if (opts->auxtrace_mmap_pages) {
103 size_t sz = opts->auxtrace_mmap_pages * (size_t)page_size;
104 size_t min_sz = KiB(8);
105
106 if (sz < min_sz || !is_power_of_2(sz)) {
107 pr_err("Invalid mmap size for ARM SPE: must be at least %zuKiB and a power of 2\n",
108 min_sz / 1024);
109 return -EINVAL;
110 }
111 }
112
113
114 /*
115 * To obtain the auxtrace buffer file descriptor, the auxtrace event
116 * must come first.
117 */
118 perf_evlist__to_front(evlist, arm_spe_evsel);
119
120 perf_evsel__set_sample_bit(arm_spe_evsel, CPU);
121 perf_evsel__set_sample_bit(arm_spe_evsel, TIME);
122 perf_evsel__set_sample_bit(arm_spe_evsel, TID);
123
124 /* Add dummy event to keep tracking */
125 err = parse_events(evlist, "dummy:u", NULL);
126 if (err)
127 return err;
128
129 tracking_evsel = perf_evlist__last(evlist);
130 perf_evlist__set_tracking_event(evlist, tracking_evsel);
131
132 tracking_evsel->attr.freq = 0;
133 tracking_evsel->attr.sample_period = 1;
134 perf_evsel__set_sample_bit(tracking_evsel, TIME);
135 perf_evsel__set_sample_bit(tracking_evsel, CPU);
136 perf_evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK);
137
138 return 0;
139}
140
141static u64 arm_spe_reference(struct auxtrace_record *itr __maybe_unused)
142{
143 struct timespec ts;
144
145 clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
146
147 return ts.tv_sec ^ ts.tv_nsec;
148}
149
150static void arm_spe_recording_free(struct auxtrace_record *itr)
151{
152 struct arm_spe_recording *sper =
153 container_of(itr, struct arm_spe_recording, itr);
154
155 free(sper);
156}
157
158static int arm_spe_read_finish(struct auxtrace_record *itr, int idx)
159{
160 struct arm_spe_recording *sper =
161 container_of(itr, struct arm_spe_recording, itr);
162 struct perf_evsel *evsel;
163
164 evlist__for_each_entry(sper->evlist, evsel) {
165 if (evsel->attr.type == sper->arm_spe_pmu->type)
166 return perf_evlist__enable_event_idx(sper->evlist,
167 evsel, idx);
168 }
169 return -EINVAL;
170}
171
172struct auxtrace_record *arm_spe_recording_init(int *err,
173 struct perf_pmu *arm_spe_pmu)
174{
175 struct arm_spe_recording *sper;
176
177 if (!arm_spe_pmu) {
178 *err = -ENODEV;
179 return NULL;
180 }
181
182 sper = zalloc(sizeof(struct arm_spe_recording));
183 if (!sper) {
184 *err = -ENOMEM;
185 return NULL;
186 }
187
188 sper->arm_spe_pmu = arm_spe_pmu;
189 sper->itr.recording_options = arm_spe_recording_options;
190 sper->itr.info_priv_size = arm_spe_info_priv_size;
191 sper->itr.info_fill = arm_spe_info_fill;
192 sper->itr.free = arm_spe_recording_free;
193 sper->itr.reference = arm_spe_reference;
194 sper->itr.read_finish = arm_spe_read_finish;
195 sper->itr.alignment = 0;
196
197 return &sper->itr;
198}
199
200struct perf_event_attr
201*arm_spe_pmu_default_config(struct perf_pmu *arm_spe_pmu)
202{
203 struct perf_event_attr *attr;
204
205 attr = zalloc(sizeof(struct perf_event_attr));
206 if (!attr) {
207 pr_err("arm_spe default config cannot allocate a perf_event_attr\n");
208 return NULL;
209 }
210
211 /*
212 * If kernel driver doesn't advertise a minimum,
213 * use max allowable by PMSIDR_EL1.INTERVAL
214 */
215 if (perf_pmu__scan_file(arm_spe_pmu, "caps/min_interval", "%llu",
216 &attr->sample_period) != 1) {
217 pr_debug("arm_spe driver doesn't advertise a min. interval. Using 4096\n");
218 attr->sample_period = 4096;
219 }
220
221 arm_spe_pmu->selectable = true;
222 arm_spe_pmu->is_uncore = false;
223
224 return attr;
225}
diff --git a/tools/perf/arch/arm64/util/header.c b/tools/perf/arch/arm64/util/header.c
new file mode 100644
index 000000000000..534cd2507d83
--- /dev/null
+++ b/tools/perf/arch/arm64/util/header.c
@@ -0,0 +1,65 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <api/fs/fs.h>
4#include "header.h"
5
6#define MIDR "/regs/identification/midr_el1"
7#define MIDR_SIZE 19
8#define MIDR_REVISION_MASK 0xf
9#define MIDR_VARIANT_SHIFT 20
10#define MIDR_VARIANT_MASK (0xf << MIDR_VARIANT_SHIFT)
11
12char *get_cpuid_str(struct perf_pmu *pmu)
13{
14 char *buf = NULL;
15 char path[PATH_MAX];
16 const char *sysfs = sysfs__mountpoint();
17 int cpu;
18 u64 midr = 0;
19 struct cpu_map *cpus;
20 FILE *file;
21
22 if (!sysfs || !pmu || !pmu->cpus)
23 return NULL;
24
25 buf = malloc(MIDR_SIZE);
26 if (!buf)
27 return NULL;
28
29 /* read midr from list of cpus mapped to this pmu */
30 cpus = cpu_map__get(pmu->cpus);
31 for (cpu = 0; cpu < cpus->nr; cpu++) {
32 scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
33 sysfs, cpus->map[cpu]);
34
35 file = fopen(path, "r");
36 if (!file) {
37 pr_debug("fopen failed for file %s\n", path);
38 continue;
39 }
40
41 if (!fgets(buf, MIDR_SIZE, file)) {
42 fclose(file);
43 continue;
44 }
45 fclose(file);
46
47 /* Ignore/clear Variant[23:20] and
48 * Revision[3:0] of MIDR
49 */
50 midr = strtoul(buf, NULL, 16);
51 midr &= (~(MIDR_VARIANT_MASK | MIDR_REVISION_MASK));
52 scnprintf(buf, MIDR_SIZE, "0x%016lx", midr);
53 /* got midr break loop */
54 break;
55 }
56
57 if (!midr) {
58 pr_err("failed to get cpuid string for PMU %s\n", pmu->name);
59 free(buf);
60 buf = NULL;
61 }
62
63 cpu_map__put(cpus);
64 return buf;
65}
diff --git a/tools/perf/arch/arm64/util/sym-handling.c b/tools/perf/arch/arm64/util/sym-handling.c
new file mode 100644
index 000000000000..0051b1ee8450
--- /dev/null
+++ b/tools/perf/arch/arm64/util/sym-handling.c
@@ -0,0 +1,22 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * Copyright (C) 2015 Naveen N. Rao, IBM Corporation
7 */
8
9#include "debug.h"
10#include "symbol.h"
11#include "map.h"
12#include "probe-event.h"
13#include "probe-file.h"
14
15#ifdef HAVE_LIBELF_SUPPORT
16bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
17{
18 return ehdr.e_type == ET_EXEC ||
19 ehdr.e_type == ET_REL ||
20 ehdr.e_type == ET_DYN;
21}
22#endif
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
index 8c0cfeb55f8e..c6f373508a4f 100644
--- a/tools/perf/arch/common.c
+++ b/tools/perf/arch/common.c
@@ -1,12 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <stdio.h> 2#include <stdio.h>
3#include <sys/utsname.h>
4#include "common.h" 3#include "common.h"
4#include "../util/env.h"
5#include "../util/util.h" 5#include "../util/util.h"
6#include "../util/debug.h" 6#include "../util/debug.h"
7 7
8#include "sane_ctype.h"
9
10const char *const arm_triplets[] = { 8const char *const arm_triplets[] = {
11 "arm-eabi-", 9 "arm-eabi-",
12 "arm-linux-androideabi-", 10 "arm-linux-androideabi-",
@@ -120,55 +118,19 @@ static int lookup_triplets(const char *const *triplets, const char *name)
120 return -1; 118 return -1;
121} 119}
122 120
123/*
124 * Return architecture name in a normalized form.
125 * The conversion logic comes from the Makefile.
126 */
127const char *normalize_arch(char *arch)
128{
129 if (!strcmp(arch, "x86_64"))
130 return "x86";
131 if (arch[0] == 'i' && arch[2] == '8' && arch[3] == '6')
132 return "x86";
133 if (!strcmp(arch, "sun4u") || !strncmp(arch, "sparc", 5))
134 return "sparc";
135 if (!strcmp(arch, "aarch64") || !strcmp(arch, "arm64"))
136 return "arm64";
137 if (!strncmp(arch, "arm", 3) || !strcmp(arch, "sa110"))
138 return "arm";
139 if (!strncmp(arch, "s390", 4))
140 return "s390";
141 if (!strncmp(arch, "parisc", 6))
142 return "parisc";
143 if (!strncmp(arch, "powerpc", 7) || !strncmp(arch, "ppc", 3))
144 return "powerpc";
145 if (!strncmp(arch, "mips", 4))
146 return "mips";
147 if (!strncmp(arch, "sh", 2) && isdigit(arch[2]))
148 return "sh";
149
150 return arch;
151}
152
153static int perf_env__lookup_binutils_path(struct perf_env *env, 121static int perf_env__lookup_binutils_path(struct perf_env *env,
154 const char *name, const char **path) 122 const char *name, const char **path)
155{ 123{
156 int idx; 124 int idx;
157 const char *arch, *cross_env; 125 const char *arch = perf_env__arch(env), *cross_env;
158 struct utsname uts;
159 const char *const *path_list; 126 const char *const *path_list;
160 char *buf = NULL; 127 char *buf = NULL;
161 128
162 arch = normalize_arch(env->arch);
163
164 if (uname(&uts) < 0)
165 goto out;
166
167 /* 129 /*
168 * We don't need to try to find objdump path for native system. 130 * We don't need to try to find objdump path for native system.
169 * Just use default binutils path (e.g.: "objdump"). 131 * Just use default binutils path (e.g.: "objdump").
170 */ 132 */
171 if (!strcmp(normalize_arch(uts.machine), arch)) 133 if (!strcmp(perf_env__arch(NULL), arch))
172 goto out; 134 goto out;
173 135
174 cross_env = getenv("CROSS_COMPILE"); 136 cross_env = getenv("CROSS_COMPILE");
diff --git a/tools/perf/arch/common.h b/tools/perf/arch/common.h
index a1546509ad24..2d875baa92e6 100644
--- a/tools/perf/arch/common.h
+++ b/tools/perf/arch/common.h
@@ -7,6 +7,5 @@
7extern const char *objdump_path; 7extern const char *objdump_path;
8 8
9int perf_env__lookup_objdump(struct perf_env *env); 9int perf_env__lookup_objdump(struct perf_env *env);
10const char *normalize_arch(char *arch);
11 10
12#endif /* ARCH_PERF_COMMON_H */ 11#endif /* ARCH_PERF_COMMON_H */
diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
index 7a4cf80c207a..0b242664f5ea 100644
--- a/tools/perf/arch/powerpc/util/header.c
+++ b/tools/perf/arch/powerpc/util/header.c
@@ -35,7 +35,7 @@ get_cpuid(char *buffer, size_t sz)
35} 35}
36 36
37char * 37char *
38get_cpuid_str(void) 38get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
39{ 39{
40 char *bufp; 40 char *bufp;
41 41
diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c
index 9c4e23d8c8ce..53d83d7e6a09 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -64,6 +64,14 @@ int arch__compare_symbol_names_n(const char *namea, const char *nameb,
64 64
65 return strncmp(namea, nameb, n); 65 return strncmp(namea, nameb, n);
66} 66}
67
68const char *arch__normalize_symbol_name(const char *name)
69{
70 /* Skip over initial dot */
71 if (name && *name == '.')
72 name++;
73 return name;
74}
67#endif 75#endif
68 76
69#if defined(_CALL_ELF) && _CALL_ELF == 2 77#if defined(_CALL_ELF) && _CALL_ELF == 2
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 09ba923debe8..48228de415d0 100644
--- a/tools/perf/arch/s390/Makefile
+++ b/tools/perf/arch/s390/Makefile
@@ -3,3 +3,24 @@ PERF_HAVE_DWARF_REGS := 1
3endif 3endif
4HAVE_KVM_STAT_SUPPORT := 1 4HAVE_KVM_STAT_SUPPORT := 1
5PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1 5PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
6
7#
8# Syscall table generation for perf
9#
10
11out := $(OUTPUT)arch/s390/include/generated/asm
12header := $(out)/syscalls_64.c
13sysdef := $(srctree)/tools/arch/s390/include/uapi/asm/unistd.h
14sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls/
15systbl := $(sysprf)/mksyscalltbl
16
17# Create output directory if not already present
18_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
19
20$(header): $(sysdef) $(systbl)
21 $(Q)$(SHELL) '$(systbl)' '$(CC)' $(sysdef) > $@
22
23clean::
24 $(call QUIET_CLEAN, s390) $(RM) $(header)
25
26archheaders: $(header)
diff --git a/tools/perf/arch/s390/annotate/instructions.c b/tools/perf/arch/s390/annotate/instructions.c
index e0e466c650df..8c72b44444cb 100644
--- a/tools/perf/arch/s390/annotate/instructions.c
+++ b/tools/perf/arch/s390/annotate/instructions.c
@@ -18,7 +18,8 @@ static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *na
18 if (!strcmp(name, "br")) 18 if (!strcmp(name, "br"))
19 ops = &ret_ops; 19 ops = &ret_ops;
20 20
21 arch__associate_ins_ops(arch, name, ops); 21 if (ops)
22 arch__associate_ins_ops(arch, name, ops);
22 return ops; 23 return ops;
23} 24}
24 25
diff --git a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl
new file mode 100755
index 000000000000..7fa0d0abd419
--- /dev/null
+++ b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl
@@ -0,0 +1,36 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Generate system call table for perf
5#
6#
7# Copyright IBM Corp. 2017
8# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
9#
10
11gcc=$1
12input=$2
13
14if ! test -r $input; then
15 echo "Could not read input file" >&2
16 exit 1
17fi
18
19create_table()
20{
21 local max_nr
22
23 echo 'static const char *syscalltbl_s390_64[] = {'
24 while read sc nr; do
25 printf '\t[%d] = "%s",\n' $nr $sc
26 max_nr=$nr
27 done
28 echo '};'
29 echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr"
30}
31
32
33$gcc -m64 -E -dM -x c $input \
34 |sed -ne 's/^#define __NR_//p' \
35 |sort -t' ' -k2 -nu \
36 |create_table
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
index b59678e8c1e2..06abe8108b33 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -84,7 +84,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
84 84
85 CHECK__(perf_evlist__open(evlist)); 85 CHECK__(perf_evlist__open(evlist));
86 86
87 CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false)); 87 CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
88 88
89 pc = evlist->mmap[0].base; 89 pc = evlist->mmap[0].base;
90 ret = perf_read_tsc_conversion(pc, &tc); 90 ret = perf_read_tsc_conversion(pc, &tc);
diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
index 33027c5e6f92..fb0d71afee8b 100644
--- a/tools/perf/arch/x86/util/header.c
+++ b/tools/perf/arch/x86/util/header.c
@@ -66,11 +66,11 @@ get_cpuid(char *buffer, size_t sz)
66} 66}
67 67
68char * 68char *
69get_cpuid_str(void) 69get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
70{ 70{
71 char *buf = malloc(128); 71 char *buf = malloc(128);
72 72
73 if (__get_cpuid(buf, 128, "%s-%u-%X$") < 0) { 73 if (buf && __get_cpuid(buf, 128, "%s-%u-%X$") < 0) {
74 free(buf); 74 free(buf);
75 return NULL; 75 return NULL;
76 } 76 }
diff --git a/tools/perf/arch/x86/util/unwind-libunwind.c b/tools/perf/arch/x86/util/unwind-libunwind.c
index 9c917f80c906..05920e3edf7a 100644
--- a/tools/perf/arch/x86/util/unwind-libunwind.c
+++ b/tools/perf/arch/x86/util/unwind-libunwind.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2 2
3#ifndef REMOTE_UNWIND_LIBUNWIND
4#include <errno.h> 3#include <errno.h>
4#ifndef REMOTE_UNWIND_LIBUNWIND
5#include <libunwind.h> 5#include <libunwind.h>
6#include "perf_regs.h" 6#include "perf_regs.h"
7#include "../../util/unwind.h" 7#include "../../util/unwind.h"
diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c
index 58ae6ed8f38b..9aa3a674829b 100644
--- a/tools/perf/bench/futex-hash.c
+++ b/tools/perf/bench/futex-hash.c
@@ -24,9 +24,9 @@
24#include <subcmd/parse-options.h> 24#include <subcmd/parse-options.h>
25#include "bench.h" 25#include "bench.h"
26#include "futex.h" 26#include "futex.h"
27#include "cpumap.h"
27 28
28#include <err.h> 29#include <err.h>
29#include <sys/time.h>
30 30
31static unsigned int nthreads = 0; 31static unsigned int nthreads = 0;
32static unsigned int nsecs = 10; 32static unsigned int nsecs = 10;
@@ -118,11 +118,12 @@ static void print_summary(void)
118int bench_futex_hash(int argc, const char **argv) 118int bench_futex_hash(int argc, const char **argv)
119{ 119{
120 int ret = 0; 120 int ret = 0;
121 cpu_set_t cpu; 121 cpu_set_t cpuset;
122 struct sigaction act; 122 struct sigaction act;
123 unsigned int i, ncpus; 123 unsigned int i;
124 pthread_attr_t thread_attr; 124 pthread_attr_t thread_attr;
125 struct worker *worker = NULL; 125 struct worker *worker = NULL;
126 struct cpu_map *cpu;
126 127
127 argc = parse_options(argc, argv, options, bench_futex_hash_usage, 0); 128 argc = parse_options(argc, argv, options, bench_futex_hash_usage, 0);
128 if (argc) { 129 if (argc) {
@@ -130,14 +131,16 @@ int bench_futex_hash(int argc, const char **argv)
130 exit(EXIT_FAILURE); 131 exit(EXIT_FAILURE);
131 } 132 }
132 133
133 ncpus = sysconf(_SC_NPROCESSORS_ONLN); 134 cpu = cpu_map__new(NULL);
135 if (!cpu)
136 goto errmem;
134 137
135 sigfillset(&act.sa_mask); 138 sigfillset(&act.sa_mask);
136 act.sa_sigaction = toggle_done; 139 act.sa_sigaction = toggle_done;
137 sigaction(SIGINT, &act, NULL); 140 sigaction(SIGINT, &act, NULL);
138 141
139 if (!nthreads) /* default to the number of CPUs */ 142 if (!nthreads) /* default to the number of CPUs */
140 nthreads = ncpus; 143 nthreads = cpu->nr;
141 144
142 worker = calloc(nthreads, sizeof(*worker)); 145 worker = calloc(nthreads, sizeof(*worker));
143 if (!worker) 146 if (!worker)
@@ -163,10 +166,10 @@ int bench_futex_hash(int argc, const char **argv)
163 if (!worker[i].futex) 166 if (!worker[i].futex)
164 goto errmem; 167 goto errmem;
165 168
166 CPU_ZERO(&cpu); 169 CPU_ZERO(&cpuset);
167 CPU_SET(i % ncpus, &cpu); 170 CPU_SET(cpu->map[i % cpu->nr], &cpuset);
168 171
169 ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpu); 172 ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset);
170 if (ret) 173 if (ret)
171 err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); 174 err(EXIT_FAILURE, "pthread_attr_setaffinity_np");
172 175
@@ -217,6 +220,7 @@ int bench_futex_hash(int argc, const char **argv)
217 print_summary(); 220 print_summary();
218 221
219 free(worker); 222 free(worker);
223 free(cpu);
220 return ret; 224 return ret;
221errmem: 225errmem:
222 err(EXIT_FAILURE, "calloc"); 226 err(EXIT_FAILURE, "calloc");
diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
index 08653ae8a8c4..8e9c4753e304 100644
--- a/tools/perf/bench/futex-lock-pi.c
+++ b/tools/perf/bench/futex-lock-pi.c
@@ -15,6 +15,7 @@
15#include <errno.h> 15#include <errno.h>
16#include "bench.h" 16#include "bench.h"
17#include "futex.h" 17#include "futex.h"
18#include "cpumap.h"
18 19
19#include <err.h> 20#include <err.h>
20#include <stdlib.h> 21#include <stdlib.h>
@@ -32,7 +33,7 @@ static struct worker *worker;
32static unsigned int nsecs = 10; 33static unsigned int nsecs = 10;
33static bool silent = false, multi = false; 34static bool silent = false, multi = false;
34static bool done = false, fshared = false; 35static bool done = false, fshared = false;
35static unsigned int ncpus, nthreads = 0; 36static unsigned int nthreads = 0;
36static int futex_flag = 0; 37static int futex_flag = 0;
37struct timeval start, end, runtime; 38struct timeval start, end, runtime;
38static pthread_mutex_t thread_lock; 39static pthread_mutex_t thread_lock;
@@ -113,9 +114,10 @@ static void *workerfn(void *arg)
113 return NULL; 114 return NULL;
114} 115}
115 116
116static void create_threads(struct worker *w, pthread_attr_t thread_attr) 117static void create_threads(struct worker *w, pthread_attr_t thread_attr,
118 struct cpu_map *cpu)
117{ 119{
118 cpu_set_t cpu; 120 cpu_set_t cpuset;
119 unsigned int i; 121 unsigned int i;
120 122
121 threads_starting = nthreads; 123 threads_starting = nthreads;
@@ -130,10 +132,10 @@ static void create_threads(struct worker *w, pthread_attr_t thread_attr)
130 } else 132 } else
131 worker[i].futex = &global_futex; 133 worker[i].futex = &global_futex;
132 134
133 CPU_ZERO(&cpu); 135 CPU_ZERO(&cpuset);
134 CPU_SET(i % ncpus, &cpu); 136 CPU_SET(cpu->map[i % cpu->nr], &cpuset);
135 137
136 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpu)) 138 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset))
137 err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); 139 err(EXIT_FAILURE, "pthread_attr_setaffinity_np");
138 140
139 if (pthread_create(&w[i].thread, &thread_attr, workerfn, &worker[i])) 141 if (pthread_create(&w[i].thread, &thread_attr, workerfn, &worker[i]))
@@ -147,19 +149,22 @@ int bench_futex_lock_pi(int argc, const char **argv)
147 unsigned int i; 149 unsigned int i;
148 struct sigaction act; 150 struct sigaction act;
149 pthread_attr_t thread_attr; 151 pthread_attr_t thread_attr;
152 struct cpu_map *cpu;
150 153
151 argc = parse_options(argc, argv, options, bench_futex_lock_pi_usage, 0); 154 argc = parse_options(argc, argv, options, bench_futex_lock_pi_usage, 0);
152 if (argc) 155 if (argc)
153 goto err; 156 goto err;
154 157
155 ncpus = sysconf(_SC_NPROCESSORS_ONLN); 158 cpu = cpu_map__new(NULL);
159 if (!cpu)
160 err(EXIT_FAILURE, "calloc");
156 161
157 sigfillset(&act.sa_mask); 162 sigfillset(&act.sa_mask);
158 act.sa_sigaction = toggle_done; 163 act.sa_sigaction = toggle_done;
159 sigaction(SIGINT, &act, NULL); 164 sigaction(SIGINT, &act, NULL);
160 165
161 if (!nthreads) 166 if (!nthreads)
162 nthreads = ncpus; 167 nthreads = cpu->nr;
163 168
164 worker = calloc(nthreads, sizeof(*worker)); 169 worker = calloc(nthreads, sizeof(*worker));
165 if (!worker) 170 if (!worker)
@@ -180,7 +185,7 @@ int bench_futex_lock_pi(int argc, const char **argv)
180 pthread_attr_init(&thread_attr); 185 pthread_attr_init(&thread_attr);
181 gettimeofday(&start, NULL); 186 gettimeofday(&start, NULL);
182 187
183 create_threads(worker, thread_attr); 188 create_threads(worker, thread_attr, cpu);
184 pthread_attr_destroy(&thread_attr); 189 pthread_attr_destroy(&thread_attr);
185 190
186 pthread_mutex_lock(&thread_lock); 191 pthread_mutex_lock(&thread_lock);
diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c
index 1058c194608a..fc692efa0c05 100644
--- a/tools/perf/bench/futex-requeue.c
+++ b/tools/perf/bench/futex-requeue.c
@@ -22,6 +22,7 @@
22#include <errno.h> 22#include <errno.h>
23#include "bench.h" 23#include "bench.h"
24#include "futex.h" 24#include "futex.h"
25#include "cpumap.h"
25 26
26#include <err.h> 27#include <err.h>
27#include <stdlib.h> 28#include <stdlib.h>
@@ -40,7 +41,7 @@ static bool done = false, silent = false, fshared = false;
40static pthread_mutex_t thread_lock; 41static pthread_mutex_t thread_lock;
41static pthread_cond_t thread_parent, thread_worker; 42static pthread_cond_t thread_parent, thread_worker;
42static struct stats requeuetime_stats, requeued_stats; 43static struct stats requeuetime_stats, requeued_stats;
43static unsigned int ncpus, threads_starting, nthreads = 0; 44static unsigned int threads_starting, nthreads = 0;
44static int futex_flag = 0; 45static int futex_flag = 0;
45 46
46static const struct option options[] = { 47static const struct option options[] = {
@@ -83,19 +84,19 @@ static void *workerfn(void *arg __maybe_unused)
83} 84}
84 85
85static void block_threads(pthread_t *w, 86static void block_threads(pthread_t *w,
86 pthread_attr_t thread_attr) 87 pthread_attr_t thread_attr, struct cpu_map *cpu)
87{ 88{
88 cpu_set_t cpu; 89 cpu_set_t cpuset;
89 unsigned int i; 90 unsigned int i;
90 91
91 threads_starting = nthreads; 92 threads_starting = nthreads;
92 93
93 /* create and block all threads */ 94 /* create and block all threads */
94 for (i = 0; i < nthreads; i++) { 95 for (i = 0; i < nthreads; i++) {
95 CPU_ZERO(&cpu); 96 CPU_ZERO(&cpuset);
96 CPU_SET(i % ncpus, &cpu); 97 CPU_SET(cpu->map[i % cpu->nr], &cpuset);
97 98
98 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpu)) 99 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset))
99 err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); 100 err(EXIT_FAILURE, "pthread_attr_setaffinity_np");
100 101
101 if (pthread_create(&w[i], &thread_attr, workerfn, NULL)) 102 if (pthread_create(&w[i], &thread_attr, workerfn, NULL))
@@ -116,19 +117,22 @@ int bench_futex_requeue(int argc, const char **argv)
116 unsigned int i, j; 117 unsigned int i, j;
117 struct sigaction act; 118 struct sigaction act;
118 pthread_attr_t thread_attr; 119 pthread_attr_t thread_attr;
120 struct cpu_map *cpu;
119 121
120 argc = parse_options(argc, argv, options, bench_futex_requeue_usage, 0); 122 argc = parse_options(argc, argv, options, bench_futex_requeue_usage, 0);
121 if (argc) 123 if (argc)
122 goto err; 124 goto err;
123 125
124 ncpus = sysconf(_SC_NPROCESSORS_ONLN); 126 cpu = cpu_map__new(NULL);
127 if (!cpu)
128 err(EXIT_FAILURE, "cpu_map__new");
125 129
126 sigfillset(&act.sa_mask); 130 sigfillset(&act.sa_mask);
127 act.sa_sigaction = toggle_done; 131 act.sa_sigaction = toggle_done;
128 sigaction(SIGINT, &act, NULL); 132 sigaction(SIGINT, &act, NULL);
129 133
130 if (!nthreads) 134 if (!nthreads)
131 nthreads = ncpus; 135 nthreads = cpu->nr;
132 136
133 worker = calloc(nthreads, sizeof(*worker)); 137 worker = calloc(nthreads, sizeof(*worker));
134 if (!worker) 138 if (!worker)
@@ -156,7 +160,7 @@ int bench_futex_requeue(int argc, const char **argv)
156 struct timeval start, end, runtime; 160 struct timeval start, end, runtime;
157 161
158 /* create, launch & block all threads */ 162 /* create, launch & block all threads */
159 block_threads(worker, thread_attr); 163 block_threads(worker, thread_attr, cpu);
160 164
161 /* make sure all threads are already blocked */ 165 /* make sure all threads are already blocked */
162 pthread_mutex_lock(&thread_lock); 166 pthread_mutex_lock(&thread_lock);
diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c
index b4732dad9f89..69d8fdc87315 100644
--- a/tools/perf/bench/futex-wake-parallel.c
+++ b/tools/perf/bench/futex-wake-parallel.c
@@ -7,7 +7,17 @@
7 * for each individual thread to service its share of work. Ultimately 7 * for each individual thread to service its share of work. Ultimately
8 * it can be used to measure futex_wake() changes. 8 * it can be used to measure futex_wake() changes.
9 */ 9 */
10#include "bench.h"
11#include <linux/compiler.h>
12#include "../util/debug.h"
10 13
14#ifndef HAVE_PTHREAD_BARRIER
15int bench_futex_wake_parallel(int argc __maybe_unused, const char **argv __maybe_unused)
16{
17 pr_err("%s: pthread_barrier_t unavailable, disabling this test...\n", __func__);
18 return 0;
19}
20#else /* HAVE_PTHREAD_BARRIER */
11/* For the CLR_() macros */ 21/* For the CLR_() macros */
12#include <string.h> 22#include <string.h>
13#include <pthread.h> 23#include <pthread.h>
@@ -15,12 +25,11 @@
15#include <signal.h> 25#include <signal.h>
16#include "../util/stat.h" 26#include "../util/stat.h"
17#include <subcmd/parse-options.h> 27#include <subcmd/parse-options.h>
18#include <linux/compiler.h>
19#include <linux/kernel.h> 28#include <linux/kernel.h>
20#include <linux/time64.h> 29#include <linux/time64.h>
21#include <errno.h> 30#include <errno.h>
22#include "bench.h"
23#include "futex.h" 31#include "futex.h"
32#include "cpumap.h"
24 33
25#include <err.h> 34#include <err.h>
26#include <stdlib.h> 35#include <stdlib.h>
@@ -42,8 +51,9 @@ static bool done = false, silent = false, fshared = false;
42static unsigned int nblocked_threads = 0, nwaking_threads = 0; 51static unsigned int nblocked_threads = 0, nwaking_threads = 0;
43static pthread_mutex_t thread_lock; 52static pthread_mutex_t thread_lock;
44static pthread_cond_t thread_parent, thread_worker; 53static pthread_cond_t thread_parent, thread_worker;
54static pthread_barrier_t barrier;
45static struct stats waketime_stats, wakeup_stats; 55static struct stats waketime_stats, wakeup_stats;
46static unsigned int ncpus, threads_starting; 56static unsigned int threads_starting;
47static int futex_flag = 0; 57static int futex_flag = 0;
48 58
49static const struct option options[] = { 59static const struct option options[] = {
@@ -64,6 +74,8 @@ static void *waking_workerfn(void *arg)
64 struct thread_data *waker = (struct thread_data *) arg; 74 struct thread_data *waker = (struct thread_data *) arg;
65 struct timeval start, end; 75 struct timeval start, end;
66 76
77 pthread_barrier_wait(&barrier);
78
67 gettimeofday(&start, NULL); 79 gettimeofday(&start, NULL);
68 80
69 waker->nwoken = futex_wake(&futex, nwakes, futex_flag); 81 waker->nwoken = futex_wake(&futex, nwakes, futex_flag);
@@ -84,6 +96,8 @@ static void wakeup_threads(struct thread_data *td, pthread_attr_t thread_attr)
84 96
85 pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); 97 pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
86 98
99 pthread_barrier_init(&barrier, NULL, nwaking_threads + 1);
100
87 /* create and block all threads */ 101 /* create and block all threads */
88 for (i = 0; i < nwaking_threads; i++) { 102 for (i = 0; i < nwaking_threads; i++) {
89 /* 103 /*
@@ -96,9 +110,13 @@ static void wakeup_threads(struct thread_data *td, pthread_attr_t thread_attr)
96 err(EXIT_FAILURE, "pthread_create"); 110 err(EXIT_FAILURE, "pthread_create");
97 } 111 }
98 112
113 pthread_barrier_wait(&barrier);
114
99 for (i = 0; i < nwaking_threads; i++) 115 for (i = 0; i < nwaking_threads; i++)
100 if (pthread_join(td[i].worker, NULL)) 116 if (pthread_join(td[i].worker, NULL))
101 err(EXIT_FAILURE, "pthread_join"); 117 err(EXIT_FAILURE, "pthread_join");
118
119 pthread_barrier_destroy(&barrier);
102} 120}
103 121
104static void *blocked_workerfn(void *arg __maybe_unused) 122static void *blocked_workerfn(void *arg __maybe_unused)
@@ -119,19 +137,20 @@ static void *blocked_workerfn(void *arg __maybe_unused)
119 return NULL; 137 return NULL;
120} 138}
121 139
122static void block_threads(pthread_t *w, pthread_attr_t thread_attr) 140static void block_threads(pthread_t *w, pthread_attr_t thread_attr,
141 struct cpu_map *cpu)
123{ 142{
124 cpu_set_t cpu; 143 cpu_set_t cpuset;
125 unsigned int i; 144 unsigned int i;
126 145
127 threads_starting = nblocked_threads; 146 threads_starting = nblocked_threads;
128 147
129 /* create and block all threads */ 148 /* create and block all threads */
130 for (i = 0; i < nblocked_threads; i++) { 149 for (i = 0; i < nblocked_threads; i++) {
131 CPU_ZERO(&cpu); 150 CPU_ZERO(&cpuset);
132 CPU_SET(i % ncpus, &cpu); 151 CPU_SET(cpu->map[i % cpu->nr], &cpuset);
133 152
134 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpu)) 153 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset))
135 err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); 154 err(EXIT_FAILURE, "pthread_attr_setaffinity_np");
136 155
137 if (pthread_create(&w[i], &thread_attr, blocked_workerfn, NULL)) 156 if (pthread_create(&w[i], &thread_attr, blocked_workerfn, NULL))
@@ -205,6 +224,7 @@ int bench_futex_wake_parallel(int argc, const char **argv)
205 struct sigaction act; 224 struct sigaction act;
206 pthread_attr_t thread_attr; 225 pthread_attr_t thread_attr;
207 struct thread_data *waking_worker; 226 struct thread_data *waking_worker;
227 struct cpu_map *cpu;
208 228
209 argc = parse_options(argc, argv, options, 229 argc = parse_options(argc, argv, options,
210 bench_futex_wake_parallel_usage, 0); 230 bench_futex_wake_parallel_usage, 0);
@@ -217,9 +237,12 @@ int bench_futex_wake_parallel(int argc, const char **argv)
217 act.sa_sigaction = toggle_done; 237 act.sa_sigaction = toggle_done;
218 sigaction(SIGINT, &act, NULL); 238 sigaction(SIGINT, &act, NULL);
219 239
220 ncpus = sysconf(_SC_NPROCESSORS_ONLN); 240 cpu = cpu_map__new(NULL);
241 if (!cpu)
242 err(EXIT_FAILURE, "calloc");
243
221 if (!nblocked_threads) 244 if (!nblocked_threads)
222 nblocked_threads = ncpus; 245 nblocked_threads = cpu->nr;
223 246
224 /* some sanity checks */ 247 /* some sanity checks */
225 if (nwaking_threads > nblocked_threads || !nwaking_threads) 248 if (nwaking_threads > nblocked_threads || !nwaking_threads)
@@ -259,7 +282,7 @@ int bench_futex_wake_parallel(int argc, const char **argv)
259 err(EXIT_FAILURE, "calloc"); 282 err(EXIT_FAILURE, "calloc");
260 283
261 /* create, launch & block all threads */ 284 /* create, launch & block all threads */
262 block_threads(blocked_worker, thread_attr); 285 block_threads(blocked_worker, thread_attr, cpu);
263 286
264 /* make sure all threads are already blocked */ 287 /* make sure all threads are already blocked */
265 pthread_mutex_lock(&thread_lock); 288 pthread_mutex_lock(&thread_lock);
@@ -297,3 +320,4 @@ int bench_futex_wake_parallel(int argc, const char **argv)
297 free(blocked_worker); 320 free(blocked_worker);
298 return ret; 321 return ret;
299} 322}
323#endif /* HAVE_PTHREAD_BARRIER */
diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c
index 8c5c0b6b5c97..e8181ad7d088 100644
--- a/tools/perf/bench/futex-wake.c
+++ b/tools/perf/bench/futex-wake.c
@@ -22,6 +22,7 @@
22#include <errno.h> 22#include <errno.h>
23#include "bench.h" 23#include "bench.h"
24#include "futex.h" 24#include "futex.h"
25#include "cpumap.h"
25 26
26#include <err.h> 27#include <err.h>
27#include <stdlib.h> 28#include <stdlib.h>
@@ -89,19 +90,19 @@ static void print_summary(void)
89} 90}
90 91
91static void block_threads(pthread_t *w, 92static void block_threads(pthread_t *w,
92 pthread_attr_t thread_attr) 93 pthread_attr_t thread_attr, struct cpu_map *cpu)
93{ 94{
94 cpu_set_t cpu; 95 cpu_set_t cpuset;
95 unsigned int i; 96 unsigned int i;
96 97
97 threads_starting = nthreads; 98 threads_starting = nthreads;
98 99
99 /* create and block all threads */ 100 /* create and block all threads */
100 for (i = 0; i < nthreads; i++) { 101 for (i = 0; i < nthreads; i++) {
101 CPU_ZERO(&cpu); 102 CPU_ZERO(&cpuset);
102 CPU_SET(i % ncpus, &cpu); 103 CPU_SET(cpu->map[i % cpu->nr], &cpuset);
103 104
104 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpu)) 105 if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset))
105 err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); 106 err(EXIT_FAILURE, "pthread_attr_setaffinity_np");
106 107
107 if (pthread_create(&w[i], &thread_attr, workerfn, NULL)) 108 if (pthread_create(&w[i], &thread_attr, workerfn, NULL))
@@ -122,6 +123,7 @@ int bench_futex_wake(int argc, const char **argv)
122 unsigned int i, j; 123 unsigned int i, j;
123 struct sigaction act; 124 struct sigaction act;
124 pthread_attr_t thread_attr; 125 pthread_attr_t thread_attr;
126 struct cpu_map *cpu;
125 127
126 argc = parse_options(argc, argv, options, bench_futex_wake_usage, 0); 128 argc = parse_options(argc, argv, options, bench_futex_wake_usage, 0);
127 if (argc) { 129 if (argc) {
@@ -129,7 +131,9 @@ int bench_futex_wake(int argc, const char **argv)
129 exit(EXIT_FAILURE); 131 exit(EXIT_FAILURE);
130 } 132 }
131 133
132 ncpus = sysconf(_SC_NPROCESSORS_ONLN); 134 cpu = cpu_map__new(NULL);
135 if (!cpu)
136 err(EXIT_FAILURE, "calloc");
133 137
134 sigfillset(&act.sa_mask); 138 sigfillset(&act.sa_mask);
135 act.sa_sigaction = toggle_done; 139 act.sa_sigaction = toggle_done;
@@ -161,7 +165,7 @@ int bench_futex_wake(int argc, const char **argv)
161 struct timeval start, end, runtime; 165 struct timeval start, end, runtime;
162 166
163 /* create, launch & block all threads */ 167 /* create, launch & block all threads */
164 block_threads(worker, thread_attr); 168 block_threads(worker, thread_attr, cpu);
165 169
166 /* make sure all threads are already blocked */ 170 /* make sure all threads are already blocked */
167 pthread_mutex_lock(&thread_lock); 171 pthread_mutex_lock(&thread_lock);
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 3d354ba6e9c5..41db2cba77eb 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -325,8 +325,8 @@ int cmd_buildid_cache(int argc, const char **argv)
325 "file", "kcore file to add"), 325 "file", "kcore file to add"),
326 OPT_STRING('r', "remove", &remove_name_list_str, "file list", 326 OPT_STRING('r', "remove", &remove_name_list_str, "file list",
327 "file(s) to remove"), 327 "file(s) to remove"),
328 OPT_STRING('p', "purge", &purge_name_list_str, "path list", 328 OPT_STRING('p', "purge", &purge_name_list_str, "file list",
329 "path(s) to remove (remove old caches too)"), 329 "file(s) to remove (remove old caches too)"),
330 OPT_STRING('M', "missing", &missing_filename, "file", 330 OPT_STRING('M', "missing", &missing_filename, "file",
331 "to find missing build ids in the cache"), 331 "to find missing build ids in the cache"),
332 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), 332 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 17855c4626a0..c0815a37fdb5 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -27,13 +27,10 @@
27#include "sort.h" 27#include "sort.h"
28#include "tool.h" 28#include "tool.h"
29#include "data.h" 29#include "data.h"
30#include "sort.h"
31#include "event.h" 30#include "event.h"
32#include "evlist.h" 31#include "evlist.h"
33#include "evsel.h" 32#include "evsel.h"
34#include <asm/bug.h>
35#include "ui/browsers/hists.h" 33#include "ui/browsers/hists.h"
36#include "evlist.h"
37#include "thread.h" 34#include "thread.h"
38 35
39struct c2c_hists { 36struct c2c_hists {
@@ -2224,9 +2221,9 @@ static int perf_c2c__browse_cacheline(struct hist_entry *he)
2224 struct hist_browser *browser; 2221 struct hist_browser *browser;
2225 int key = -1; 2222 int key = -1;
2226 const char help[] = 2223 const char help[] =
2227 " ENTER Togle callchains (if present) \n" 2224 " ENTER Toggle callchains (if present) \n"
2228 " n Togle Node details info \n" 2225 " n Toggle Node details info \n"
2229 " s Togle full lenght of symbol and source line columns \n" 2226 " s Toggle full length of symbol and source line columns \n"
2230 " q Return back to cacheline list \n"; 2227 " q Return back to cacheline list \n";
2231 2228
2232 /* Display compact version first. */ 2229 /* Display compact version first. */
@@ -2303,7 +2300,7 @@ static int perf_c2c__hists_browse(struct hists *hists)
2303 int key = -1; 2300 int key = -1;
2304 const char help[] = 2301 const char help[] =
2305 " d Display cacheline details \n" 2302 " d Display cacheline details \n"
2306 " ENTER Togle callchains (if present) \n" 2303 " ENTER Toggle callchains (if present) \n"
2307 " q Quit \n"; 2304 " q Quit \n";
2308 2305
2309 browser = perf_c2c_browser__new(hists); 2306 browser = perf_c2c_browser__new(hists);
@@ -2393,9 +2390,10 @@ static int setup_callchain(struct perf_evlist *evlist)
2393 enum perf_call_graph_mode mode = CALLCHAIN_NONE; 2390 enum perf_call_graph_mode mode = CALLCHAIN_NONE;
2394 2391
2395 if ((sample_type & PERF_SAMPLE_REGS_USER) && 2392 if ((sample_type & PERF_SAMPLE_REGS_USER) &&
2396 (sample_type & PERF_SAMPLE_STACK_USER)) 2393 (sample_type & PERF_SAMPLE_STACK_USER)) {
2397 mode = CALLCHAIN_DWARF; 2394 mode = CALLCHAIN_DWARF;
2398 else if (sample_type & PERF_SAMPLE_BRANCH_STACK) 2395 dwarf_callchain_users = true;
2396 } else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
2399 mode = CALLCHAIN_LBR; 2397 mode = CALLCHAIN_LBR;
2400 else if (sample_type & PERF_SAMPLE_CALLCHAIN) 2398 else if (sample_type & PERF_SAMPLE_CALLCHAIN)
2401 mode = CALLCHAIN_FP; 2399 mode = CALLCHAIN_FP;
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index a0f7ed2b869b..4aca13f23b9d 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -439,7 +439,7 @@ int cmd_help(int argc, const char **argv)
439#ifdef HAVE_LIBELF_SUPPORT 439#ifdef HAVE_LIBELF_SUPPORT
440 "probe", 440 "probe",
441#endif 441#endif
442#ifdef HAVE_LIBAUDIT_SUPPORT 442#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
443 "trace", 443 "trace",
444#endif 444#endif
445 NULL }; 445 NULL };
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 16a28547ca86..40fe919bbcf3 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -536,8 +536,7 @@ found:
536 sample_sw.period = sample->period; 536 sample_sw.period = sample->period;
537 sample_sw.time = sample->time; 537 sample_sw.time = sample->time;
538 perf_event__synthesize_sample(event_sw, evsel->attr.sample_type, 538 perf_event__synthesize_sample(event_sw, evsel->attr.sample_type,
539 evsel->attr.read_format, &sample_sw, 539 evsel->attr.read_format, &sample_sw);
540 false);
541 build_id__mark_dso_hit(tool, event_sw, &sample_sw, evsel, machine); 540 build_id__mark_dso_hit(tool, event_sw, &sample_sw, evsel, machine);
542 return perf_event__repipe(tool, event_sw, &sample_sw, machine); 541 return perf_event__repipe(tool, event_sw, &sample_sw, machine);
543} 542}
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0c36f2ac6a0e..55d919dc5bc6 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -26,6 +26,9 @@
26#include <sys/timerfd.h> 26#include <sys/timerfd.h>
27#endif 27#endif
28#include <sys/time.h> 28#include <sys/time.h>
29#include <sys/types.h>
30#include <sys/stat.h>
31#include <fcntl.h>
29 32
30#include <linux/kernel.h> 33#include <linux/kernel.h>
31#include <linux/time64.h> 34#include <linux/time64.h>
@@ -741,20 +744,20 @@ static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx,
741 u64 *mmap_time) 744 u64 *mmap_time)
742{ 745{
743 union perf_event *event; 746 union perf_event *event;
744 struct perf_sample sample; 747 u64 timestamp;
745 s64 n = 0; 748 s64 n = 0;
746 int err; 749 int err;
747 750
748 *mmap_time = ULLONG_MAX; 751 *mmap_time = ULLONG_MAX;
749 while ((event = perf_evlist__mmap_read(kvm->evlist, idx)) != NULL) { 752 while ((event = perf_evlist__mmap_read(kvm->evlist, idx)) != NULL) {
750 err = perf_evlist__parse_sample(kvm->evlist, event, &sample); 753 err = perf_evlist__parse_sample_timestamp(kvm->evlist, event, &timestamp);
751 if (err) { 754 if (err) {
752 perf_evlist__mmap_consume(kvm->evlist, idx); 755 perf_evlist__mmap_consume(kvm->evlist, idx);
753 pr_err("Failed to parse sample\n"); 756 pr_err("Failed to parse sample\n");
754 return -1; 757 return -1;
755 } 758 }
756 759
757 err = perf_session__queue_event(kvm->session, event, &sample, 0); 760 err = perf_session__queue_event(kvm->session, event, timestamp, 0);
758 /* 761 /*
759 * FIXME: Here we can't consume the event, as perf_session__queue_event will 762 * FIXME: Here we can't consume the event, as perf_session__queue_event will
760 * point to it, and it'll get possibly overwritten by the kernel. 763 * point to it, and it'll get possibly overwritten by the kernel.
@@ -768,7 +771,7 @@ static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx,
768 771
769 /* save time stamp of our first sample for this mmap */ 772 /* save time stamp of our first sample for this mmap */
770 if (n == 0) 773 if (n == 0)
771 *mmap_time = sample.time; 774 *mmap_time = timestamp;
772 775
773 /* limit events per mmap handled all at once */ 776 /* limit events per mmap handled all at once */
774 n++; 777 n++;
@@ -1044,7 +1047,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
1044 goto out; 1047 goto out;
1045 } 1048 }
1046 1049
1047 if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages, false) < 0) { 1050 if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) {
1048 ui__error("Failed to mmap the events: %s\n", 1051 ui__error("Failed to mmap the events: %s\n",
1049 str_error_r(errno, sbuf, sizeof(sbuf))); 1052 str_error_r(errno, sbuf, sizeof(sbuf)));
1050 perf_evlist__close(evlist); 1053 perf_evlist__close(evlist);
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 003255910c05..bf4ca749d1ac 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -51,7 +51,6 @@
51#include <signal.h> 51#include <signal.h>
52#include <sys/mman.h> 52#include <sys/mman.h>
53#include <sys/wait.h> 53#include <sys/wait.h>
54#include <asm/bug.h>
55#include <linux/time64.h> 54#include <linux/time64.h>
56 55
57struct switch_output { 56struct switch_output {
@@ -79,6 +78,7 @@ struct record {
79 bool no_buildid_cache_set; 78 bool no_buildid_cache_set;
80 bool buildid_all; 79 bool buildid_all;
81 bool timestamp_filename; 80 bool timestamp_filename;
81 bool timestamp_boundary;
82 struct switch_output switch_output; 82 struct switch_output switch_output;
83 unsigned long long samples; 83 unsigned long long samples;
84}; 84};
@@ -301,7 +301,7 @@ static int record__mmap_evlist(struct record *rec,
301 struct record_opts *opts = &rec->opts; 301 struct record_opts *opts = &rec->opts;
302 char msg[512]; 302 char msg[512];
303 303
304 if (perf_evlist__mmap_ex(evlist, opts->mmap_pages, false, 304 if (perf_evlist__mmap_ex(evlist, opts->mmap_pages,
305 opts->auxtrace_mmap_pages, 305 opts->auxtrace_mmap_pages,
306 opts->auxtrace_snapshot_mode) < 0) { 306 opts->auxtrace_snapshot_mode) < 0) {
307 if (errno == EPERM) { 307 if (errno == EPERM) {
@@ -372,6 +372,8 @@ try_again:
372 ui__error("%s\n", msg); 372 ui__error("%s\n", msg);
373 goto out; 373 goto out;
374 } 374 }
375
376 pos->supported = true;
375 } 377 }
376 378
377 if (perf_evlist__apply_filters(evlist, &pos)) { 379 if (perf_evlist__apply_filters(evlist, &pos)) {
@@ -408,8 +410,15 @@ static int process_sample_event(struct perf_tool *tool,
408{ 410{
409 struct record *rec = container_of(tool, struct record, tool); 411 struct record *rec = container_of(tool, struct record, tool);
410 412
411 rec->samples++; 413 if (rec->evlist->first_sample_time == 0)
414 rec->evlist->first_sample_time = sample->time;
415
416 rec->evlist->last_sample_time = sample->time;
412 417
418 if (rec->buildid_all)
419 return 0;
420
421 rec->samples++;
413 return build_id__mark_dso_hit(tool, event, sample, evsel, machine); 422 return build_id__mark_dso_hit(tool, event, sample, evsel, machine);
414} 423}
415 424
@@ -434,9 +443,11 @@ static int process_buildids(struct record *rec)
434 443
435 /* 444 /*
436 * If --buildid-all is given, it marks all DSO regardless of hits, 445 * If --buildid-all is given, it marks all DSO regardless of hits,
437 * so no need to process samples. 446 * so no need to process samples. But if timestamp_boundary is enabled,
447 * it still needs to walk on all samples to get the timestamps of
448 * first/last samples.
438 */ 449 */
439 if (rec->buildid_all) 450 if (rec->buildid_all && !rec->timestamp_boundary)
440 rec->tool.sample = NULL; 451 rec->tool.sample = NULL;
441 452
442 return perf_session__process_events(session); 453 return perf_session__process_events(session);
@@ -477,7 +488,7 @@ static struct perf_event_header finished_round_event = {
477}; 488};
478 489
479static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evlist, 490static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evlist,
480 bool backward) 491 bool overwrite)
481{ 492{
482 u64 bytes_written = rec->bytes_written; 493 u64 bytes_written = rec->bytes_written;
483 int i; 494 int i;
@@ -487,18 +498,18 @@ static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evli
487 if (!evlist) 498 if (!evlist)
488 return 0; 499 return 0;
489 500
490 maps = backward ? evlist->backward_mmap : evlist->mmap; 501 maps = overwrite ? evlist->overwrite_mmap : evlist->mmap;
491 if (!maps) 502 if (!maps)
492 return 0; 503 return 0;
493 504
494 if (backward && evlist->bkw_mmap_state != BKW_MMAP_DATA_PENDING) 505 if (overwrite && evlist->bkw_mmap_state != BKW_MMAP_DATA_PENDING)
495 return 0; 506 return 0;
496 507
497 for (i = 0; i < evlist->nr_mmaps; i++) { 508 for (i = 0; i < evlist->nr_mmaps; i++) {
498 struct auxtrace_mmap *mm = &maps[i].auxtrace_mmap; 509 struct auxtrace_mmap *mm = &maps[i].auxtrace_mmap;
499 510
500 if (maps[i].base) { 511 if (maps[i].base) {
501 if (perf_mmap__push(&maps[i], evlist->overwrite, backward, rec, record__pushfn) != 0) { 512 if (perf_mmap__push(&maps[i], overwrite, rec, record__pushfn) != 0) {
502 rc = -1; 513 rc = -1;
503 goto out; 514 goto out;
504 } 515 }
@@ -518,7 +529,7 @@ static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evli
518 if (bytes_written != rec->bytes_written) 529 if (bytes_written != rec->bytes_written)
519 rc = record__write(rec, &finished_round_event, sizeof(finished_round_event)); 530 rc = record__write(rec, &finished_round_event, sizeof(finished_round_event));
520 531
521 if (backward) 532 if (overwrite)
522 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_EMPTY); 533 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_EMPTY);
523out: 534out:
524 return rc; 535 return rc;
@@ -690,8 +701,8 @@ perf_evlist__pick_pc(struct perf_evlist *evlist)
690 if (evlist) { 701 if (evlist) {
691 if (evlist->mmap && evlist->mmap[0].base) 702 if (evlist->mmap && evlist->mmap[0].base)
692 return evlist->mmap[0].base; 703 return evlist->mmap[0].base;
693 if (evlist->backward_mmap && evlist->backward_mmap[0].base) 704 if (evlist->overwrite_mmap && evlist->overwrite_mmap[0].base)
694 return evlist->backward_mmap[0].base; 705 return evlist->overwrite_mmap[0].base;
695 } 706 }
696 return NULL; 707 return NULL;
697} 708}
@@ -784,6 +795,28 @@ static int record__synthesize(struct record *rec, bool tail)
784 perf_event__synthesize_guest_os, tool); 795 perf_event__synthesize_guest_os, tool);
785 } 796 }
786 797
798 err = perf_event__synthesize_extra_attr(&rec->tool,
799 rec->evlist,
800 process_synthesized_event,
801 data->is_pipe);
802 if (err)
803 goto out;
804
805 err = perf_event__synthesize_thread_map2(&rec->tool, rec->evlist->threads,
806 process_synthesized_event,
807 NULL);
808 if (err < 0) {
809 pr_err("Couldn't synthesize thread map.\n");
810 return err;
811 }
812
813 err = perf_event__synthesize_cpu_map(&rec->tool, rec->evlist->cpus,
814 process_synthesized_event, NULL);
815 if (err < 0) {
816 pr_err("Couldn't synthesize cpu map.\n");
817 return err;
818 }
819
787 err = __machine__synthesize_threads(machine, tool, &opts->target, rec->evlist->threads, 820 err = __machine__synthesize_threads(machine, tool, &opts->target, rec->evlist->threads,
788 process_synthesized_event, opts->sample_address, 821 process_synthesized_event, opts->sample_address,
789 opts->proc_map_timeout, 1); 822 opts->proc_map_timeout, 1);
@@ -1533,7 +1566,8 @@ static struct option __record_options[] = {
1533 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time, 1566 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
1534 &record.opts.sample_time_set, 1567 &record.opts.sample_time_set,
1535 "Record the sample timestamps"), 1568 "Record the sample timestamps"),
1536 OPT_BOOLEAN('P', "period", &record.opts.period, "Record the sample period"), 1569 OPT_BOOLEAN_SET('P', "period", &record.opts.period, &record.opts.period_set,
1570 "Record the sample period"),
1537 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples, 1571 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
1538 "don't sample"), 1572 "don't sample"),
1539 OPT_BOOLEAN_SET('N', "no-buildid-cache", &record.no_buildid_cache, 1573 OPT_BOOLEAN_SET('N', "no-buildid-cache", &record.no_buildid_cache,
@@ -1598,6 +1632,8 @@ static struct option __record_options[] = {
1598 "Record build-id of all DSOs regardless of hits"), 1632 "Record build-id of all DSOs regardless of hits"),
1599 OPT_BOOLEAN(0, "timestamp-filename", &record.timestamp_filename, 1633 OPT_BOOLEAN(0, "timestamp-filename", &record.timestamp_filename,
1600 "append timestamp to output filename"), 1634 "append timestamp to output filename"),
1635 OPT_BOOLEAN(0, "timestamp-boundary", &record.timestamp_boundary,
1636 "Record timestamp boundary (time of first/last samples)"),
1601 OPT_STRING_OPTARG_SET(0, "switch-output", &record.switch_output.str, 1637 OPT_STRING_OPTARG_SET(0, "switch-output", &record.switch_output.str,
1602 &record.switch_output.set, "signal,size,time", 1638 &record.switch_output.set, "signal,size,time",
1603 "Switch output when receive SIGUSR2 or cross size,time threshold", 1639 "Switch output when receive SIGUSR2 or cross size,time threshold",
@@ -1781,8 +1817,8 @@ int cmd_record(int argc, const char **argv)
1781 goto out; 1817 goto out;
1782 } 1818 }
1783 1819
1784 /* Enable ignoring missing threads when -u option is defined. */ 1820 /* Enable ignoring missing threads when -u/-p option is defined. */
1785 rec->opts.ignore_missing_thread = rec->opts.target.uid != UINT_MAX; 1821 rec->opts.ignore_missing_thread = rec->opts.target.uid != UINT_MAX || rec->opts.target.pid;
1786 1822
1787 err = -ENOMEM; 1823 err = -ENOMEM;
1788 if (perf_evlist__create_maps(rec->evlist, &rec->opts.target) < 0) 1824 if (perf_evlist__create_maps(rec->evlist, &rec->opts.target) < 0)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index af5dd038195e..42a52dcc41cd 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -15,6 +15,7 @@
15#include "util/color.h" 15#include "util/color.h"
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/rbtree.h> 17#include <linux/rbtree.h>
18#include <linux/err.h>
18#include "util/symbol.h" 19#include "util/symbol.h"
19#include "util/callchain.h" 20#include "util/callchain.h"
20#include "util/values.h" 21#include "util/values.h"
@@ -51,6 +52,7 @@
51#include <sys/types.h> 52#include <sys/types.h>
52#include <sys/stat.h> 53#include <sys/stat.h>
53#include <unistd.h> 54#include <unistd.h>
55#include <linux/mman.h>
54 56
55struct report { 57struct report {
56 struct perf_tool tool; 58 struct perf_tool tool;
@@ -60,6 +62,9 @@ struct report {
60 bool show_threads; 62 bool show_threads;
61 bool inverted_callchain; 63 bool inverted_callchain;
62 bool mem_mode; 64 bool mem_mode;
65 bool stats_mode;
66 bool tasks_mode;
67 bool mmaps_mode;
63 bool header; 68 bool header;
64 bool header_only; 69 bool header_only;
65 bool nonany_branch_mode; 70 bool nonany_branch_mode;
@@ -69,7 +74,9 @@ struct report {
69 const char *cpu_list; 74 const char *cpu_list;
70 const char *symbol_filter_str; 75 const char *symbol_filter_str;
71 const char *time_str; 76 const char *time_str;
72 struct perf_time_interval ptime; 77 struct perf_time_interval *ptime_range;
78 int range_size;
79 int range_num;
73 float min_percent; 80 float min_percent;
74 u64 nr_entries; 81 u64 nr_entries;
75 u64 queue_size; 82 u64 queue_size;
@@ -162,12 +169,28 @@ static int hist_iter__branch_callback(struct hist_entry_iter *iter,
162 struct hist_entry *he = iter->he; 169 struct hist_entry *he = iter->he;
163 struct report *rep = arg; 170 struct report *rep = arg;
164 struct branch_info *bi; 171 struct branch_info *bi;
172 struct perf_sample *sample = iter->sample;
173 struct perf_evsel *evsel = iter->evsel;
174 int err;
175
176 if (!ui__has_annotation())
177 return 0;
178
179 hist__account_cycles(sample->branch_stack, al, sample,
180 rep->nonany_branch_mode);
165 181
166 bi = he->branch_info; 182 bi = he->branch_info;
183 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel->idx);
184 if (err)
185 goto out;
186
187 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel->idx);
188
167 branch_type_count(&rep->brtype_stat, &bi->flags, 189 branch_type_count(&rep->brtype_stat, &bi->flags,
168 bi->from.addr, bi->to.addr); 190 bi->from.addr, bi->to.addr);
169 191
170 return 0; 192out:
193 return err;
171} 194}
172 195
173static int process_sample_event(struct perf_tool *tool, 196static int process_sample_event(struct perf_tool *tool,
@@ -186,8 +209,10 @@ static int process_sample_event(struct perf_tool *tool,
186 }; 209 };
187 int ret = 0; 210 int ret = 0;
188 211
189 if (perf_time__skip_sample(&rep->ptime, sample->time)) 212 if (perf_time__ranges_skip_sample(rep->ptime_range, rep->range_num,
213 sample->time)) {
190 return 0; 214 return 0;
215 }
191 216
192 if (machine__resolve(machine, &al, sample) < 0) { 217 if (machine__resolve(machine, &al, sample) < 0) {
193 pr_debug("problem processing %d event, skipping it.\n", 218 pr_debug("problem processing %d event, skipping it.\n",
@@ -312,9 +337,10 @@ static int report__setup_sample_type(struct report *rep)
312 337
313 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) { 338 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
314 if ((sample_type & PERF_SAMPLE_REGS_USER) && 339 if ((sample_type & PERF_SAMPLE_REGS_USER) &&
315 (sample_type & PERF_SAMPLE_STACK_USER)) 340 (sample_type & PERF_SAMPLE_STACK_USER)) {
316 callchain_param.record_mode = CALLCHAIN_DWARF; 341 callchain_param.record_mode = CALLCHAIN_DWARF;
317 else if (sample_type & PERF_SAMPLE_BRANCH_STACK) 342 dwarf_callchain_users = true;
343 } else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
318 callchain_param.record_mode = CALLCHAIN_LBR; 344 callchain_param.record_mode = CALLCHAIN_LBR;
319 else 345 else
320 callchain_param.record_mode = CALLCHAIN_FP; 346 callchain_param.record_mode = CALLCHAIN_FP;
@@ -377,6 +403,9 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
377 if (evname != NULL) 403 if (evname != NULL)
378 ret += fprintf(fp, " of event '%s'", evname); 404 ret += fprintf(fp, " of event '%s'", evname);
379 405
406 if (rep->time_str)
407 ret += fprintf(fp, " (time slices: %s)", rep->time_str);
408
380 if (symbol_conf.show_ref_callgraph && 409 if (symbol_conf.show_ref_callgraph &&
381 strstr(evname, "call-graph=no")) { 410 strstr(evname, "call-graph=no")) {
382 ret += fprintf(fp, ", show reference callgraph"); 411 ret += fprintf(fp, ", show reference callgraph");
@@ -567,6 +596,174 @@ static void report__output_resort(struct report *rep)
567 ui_progress__finish(); 596 ui_progress__finish();
568} 597}
569 598
599static void stats_setup(struct report *rep)
600{
601 memset(&rep->tool, 0, sizeof(rep->tool));
602 rep->tool.no_warn = true;
603}
604
605static int stats_print(struct report *rep)
606{
607 struct perf_session *session = rep->session;
608
609 perf_session__fprintf_nr_events(session, stdout);
610 return 0;
611}
612
613static void tasks_setup(struct report *rep)
614{
615 memset(&rep->tool, 0, sizeof(rep->tool));
616 if (rep->mmaps_mode) {
617 rep->tool.mmap = perf_event__process_mmap;
618 rep->tool.mmap2 = perf_event__process_mmap2;
619 }
620 rep->tool.comm = perf_event__process_comm;
621 rep->tool.exit = perf_event__process_exit;
622 rep->tool.fork = perf_event__process_fork;
623 rep->tool.no_warn = true;
624}
625
626struct task {
627 struct thread *thread;
628 struct list_head list;
629 struct list_head children;
630};
631
632static struct task *tasks_list(struct task *task, struct machine *machine)
633{
634 struct thread *parent_thread, *thread = task->thread;
635 struct task *parent_task;
636
637 /* Already listed. */
638 if (!list_empty(&task->list))
639 return NULL;
640
641 /* Last one in the chain. */
642 if (thread->ppid == -1)
643 return task;
644
645 parent_thread = machine__find_thread(machine, -1, thread->ppid);
646 if (!parent_thread)
647 return ERR_PTR(-ENOENT);
648
649 parent_task = thread__priv(parent_thread);
650 list_add_tail(&task->list, &parent_task->children);
651 return tasks_list(parent_task, machine);
652}
653
654static size_t maps__fprintf_task(struct maps *maps, int indent, FILE *fp)
655{
656 size_t printed = 0;
657 struct rb_node *nd;
658
659 for (nd = rb_first(&maps->entries); nd; nd = rb_next(nd)) {
660 struct map *map = rb_entry(nd, struct map, rb_node);
661
662 printed += fprintf(fp, "%*s %" PRIx64 "-%" PRIx64 " %c%c%c%c %08" PRIx64 " %" PRIu64 " %s\n",
663 indent, "", map->start, map->end,
664 map->prot & PROT_READ ? 'r' : '-',
665 map->prot & PROT_WRITE ? 'w' : '-',
666 map->prot & PROT_EXEC ? 'x' : '-',
667 map->flags & MAP_SHARED ? 's' : 'p',
668 map->pgoff,
669 map->ino, map->dso->name);
670 }
671
672 return printed;
673}
674
675static int map_groups__fprintf_task(struct map_groups *mg, int indent, FILE *fp)
676{
677 int printed = 0, i;
678 for (i = 0; i < MAP__NR_TYPES; ++i)
679 printed += maps__fprintf_task(&mg->maps[i], indent, fp);
680 return printed;
681}
682
683static void task__print_level(struct task *task, FILE *fp, int level)
684{
685 struct thread *thread = task->thread;
686 struct task *child;
687 int comm_indent = fprintf(fp, " %8d %8d %8d |%*s",
688 thread->pid_, thread->tid, thread->ppid,
689 level, "");
690
691 fprintf(fp, "%s\n", thread__comm_str(thread));
692
693 map_groups__fprintf_task(thread->mg, comm_indent, fp);
694
695 if (!list_empty(&task->children)) {
696 list_for_each_entry(child, &task->children, list)
697 task__print_level(child, fp, level + 1);
698 }
699}
700
701static int tasks_print(struct report *rep, FILE *fp)
702{
703 struct perf_session *session = rep->session;
704 struct machine *machine = &session->machines.host;
705 struct task *tasks, *task;
706 unsigned int nr = 0, itask = 0, i;
707 struct rb_node *nd;
708 LIST_HEAD(list);
709
710 /*
711 * No locking needed while accessing machine->threads,
712 * because --tasks is single threaded command.
713 */
714
715 /* Count all the threads. */
716 for (i = 0; i < THREADS__TABLE_SIZE; i++)
717 nr += machine->threads[i].nr;
718
719 tasks = malloc(sizeof(*tasks) * nr);
720 if (!tasks)
721 return -ENOMEM;
722
723 for (i = 0; i < THREADS__TABLE_SIZE; i++) {
724 struct threads *threads = &machine->threads[i];
725
726 for (nd = rb_first(&threads->entries); nd; nd = rb_next(nd)) {
727 task = tasks + itask++;
728
729 task->thread = rb_entry(nd, struct thread, rb_node);
730 INIT_LIST_HEAD(&task->children);
731 INIT_LIST_HEAD(&task->list);
732 thread__set_priv(task->thread, task);
733 }
734 }
735
736 /*
737 * Iterate every task down to the unprocessed parent
738 * and link all in task children list. Task with no
739 * parent is added into 'list'.
740 */
741 for (itask = 0; itask < nr; itask++) {
742 task = tasks + itask;
743
744 if (!list_empty(&task->list))
745 continue;
746
747 task = tasks_list(task, machine);
748 if (IS_ERR(task)) {
749 pr_err("Error: failed to process tasks\n");
750 free(tasks);
751 return PTR_ERR(task);
752 }
753
754 if (task)
755 list_add_tail(&task->list, &list);
756 }
757
758 fprintf(fp, "# %8s %8s %8s %s\n", "pid", "tid", "ppid", "comm");
759
760 list_for_each_entry(task, &list, list)
761 task__print_level(task, fp, 0);
762
763 free(tasks);
764 return 0;
765}
766
570static int __cmd_report(struct report *rep) 767static int __cmd_report(struct report *rep)
571{ 768{
572 int ret; 769 int ret;
@@ -598,12 +795,24 @@ static int __cmd_report(struct report *rep)
598 return ret; 795 return ret;
599 } 796 }
600 797
798 if (rep->stats_mode)
799 stats_setup(rep);
800
801 if (rep->tasks_mode)
802 tasks_setup(rep);
803
601 ret = perf_session__process_events(session); 804 ret = perf_session__process_events(session);
602 if (ret) { 805 if (ret) {
603 ui__error("failed to process sample\n"); 806 ui__error("failed to process sample\n");
604 return ret; 807 return ret;
605 } 808 }
606 809
810 if (rep->stats_mode)
811 return stats_print(rep);
812
813 if (rep->tasks_mode)
814 return tasks_print(rep, stdout);
815
607 report__warn_kptr_restrict(rep); 816 report__warn_kptr_restrict(rep);
608 817
609 evlist__for_each_entry(session->evlist, pos) 818 evlist__for_each_entry(session->evlist, pos)
@@ -760,6 +969,9 @@ int cmd_report(int argc, const char **argv)
760 OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), 969 OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
761 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 970 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
762 "dump raw trace in ASCII"), 971 "dump raw trace in ASCII"),
972 OPT_BOOLEAN(0, "stats", &report.stats_mode, "Display event stats"),
973 OPT_BOOLEAN(0, "tasks", &report.tasks_mode, "Display recorded tasks"),
974 OPT_BOOLEAN(0, "mmaps", &report.mmaps_mode, "Display recorded tasks memory maps"),
763 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, 975 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
764 "file", "vmlinux pathname"), 976 "file", "vmlinux pathname"),
765 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, 977 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
@@ -907,6 +1119,9 @@ int cmd_report(int argc, const char **argv)
907 report.symbol_filter_str = argv[0]; 1119 report.symbol_filter_str = argv[0];
908 } 1120 }
909 1121
1122 if (report.mmaps_mode)
1123 report.tasks_mode = true;
1124
910 if (quiet) 1125 if (quiet)
911 perf_quiet_option(); 1126 perf_quiet_option();
912 1127
@@ -921,13 +1136,6 @@ int cmd_report(int argc, const char **argv)
921 return -EINVAL; 1136 return -EINVAL;
922 } 1137 }
923 1138
924 if (report.use_stdio)
925 use_browser = 0;
926 else if (report.use_tui)
927 use_browser = 1;
928 else if (report.use_gtk)
929 use_browser = 2;
930
931 if (report.inverted_callchain) 1139 if (report.inverted_callchain)
932 callchain_param.order = ORDER_CALLER; 1140 callchain_param.order = ORDER_CALLER;
933 if (symbol_conf.cumulate_callchain && !callchain_param.order_set) 1141 if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
@@ -1014,6 +1222,13 @@ repeat:
1014 perf_hpp_list.need_collapse = true; 1222 perf_hpp_list.need_collapse = true;
1015 } 1223 }
1016 1224
1225 if (report.use_stdio)
1226 use_browser = 0;
1227 else if (report.use_tui)
1228 use_browser = 1;
1229 else if (report.use_gtk)
1230 use_browser = 2;
1231
1017 /* Force tty output for header output and per-thread stat. */ 1232 /* Force tty output for header output and per-thread stat. */
1018 if (report.header || report.header_only || report.show_threads) 1233 if (report.header || report.header_only || report.show_threads)
1019 use_browser = 0; 1234 use_browser = 0;
@@ -1021,6 +1236,12 @@ repeat:
1021 report.tool.show_feat_hdr = SHOW_FEAT_HEADER; 1236 report.tool.show_feat_hdr = SHOW_FEAT_HEADER;
1022 if (report.show_full_info) 1237 if (report.show_full_info)
1023 report.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO; 1238 report.tool.show_feat_hdr = SHOW_FEAT_HEADER_FULL_INFO;
1239 if (report.stats_mode || report.tasks_mode)
1240 use_browser = 0;
1241 if (report.stats_mode && report.tasks_mode) {
1242 pr_err("Error: --tasks and --mmaps can't be used together with --stats\n");
1243 goto error;
1244 }
1024 1245
1025 if (strcmp(input_name, "-") != 0) 1246 if (strcmp(input_name, "-") != 0)
1026 setup_browser(true); 1247 setup_browser(true);
@@ -1043,7 +1264,8 @@ repeat:
1043 ret = 0; 1264 ret = 0;
1044 goto error; 1265 goto error;
1045 } 1266 }
1046 } else if (use_browser == 0 && !quiet) { 1267 } else if (use_browser == 0 && !quiet &&
1268 !report.stats_mode && !report.tasks_mode) {
1047 fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n", 1269 fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n",
1048 stdout); 1270 stdout);
1049 } 1271 }
@@ -1077,9 +1299,36 @@ repeat:
1077 if (symbol__init(&session->header.env) < 0) 1299 if (symbol__init(&session->header.env) < 0)
1078 goto error; 1300 goto error;
1079 1301
1080 if (perf_time__parse_str(&report.ptime, report.time_str) != 0) { 1302 report.ptime_range = perf_time__range_alloc(report.time_str,
1081 pr_err("Invalid time string\n"); 1303 &report.range_size);
1082 return -EINVAL; 1304 if (!report.ptime_range) {
1305 ret = -ENOMEM;
1306 goto error;
1307 }
1308
1309 if (perf_time__parse_str(report.ptime_range, report.time_str) != 0) {
1310 if (session->evlist->first_sample_time == 0 &&
1311 session->evlist->last_sample_time == 0) {
1312 pr_err("HINT: no first/last sample time found in perf data.\n"
1313 "Please use latest perf binary to execute 'perf record'\n"
1314 "(if '--buildid-all' is enabled, please set '--timestamp-boundary').\n");
1315 ret = -EINVAL;
1316 goto error;
1317 }
1318
1319 report.range_num = perf_time__percent_parse_str(
1320 report.ptime_range, report.range_size,
1321 report.time_str,
1322 session->evlist->first_sample_time,
1323 session->evlist->last_sample_time);
1324
1325 if (report.range_num < 0) {
1326 pr_err("Invalid time string\n");
1327 ret = -EINVAL;
1328 goto error;
1329 }
1330 } else {
1331 report.range_num = 1;
1083 } 1332 }
1084 1333
1085 sort__setup_elide(stdout); 1334 sort__setup_elide(stdout);
@@ -1092,6 +1341,8 @@ repeat:
1092 ret = 0; 1341 ret = 0;
1093 1342
1094error: 1343error:
1344 zfree(&report.ptime_range);
1345
1095 perf_session__delete(session); 1346 perf_session__delete(session);
1096 return ret; 1347 return ret;
1097} 1348}
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 9b43bda45a41..ab19a6ee4093 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -22,9 +22,11 @@
22#include "util/cpumap.h" 22#include "util/cpumap.h"
23#include "util/thread_map.h" 23#include "util/thread_map.h"
24#include "util/stat.h" 24#include "util/stat.h"
25#include "util/color.h"
25#include "util/string2.h" 26#include "util/string2.h"
26#include "util/thread-stack.h" 27#include "util/thread-stack.h"
27#include "util/time-utils.h" 28#include "util/time-utils.h"
29#include "util/path.h"
28#include "print_binary.h" 30#include "print_binary.h"
29#include <linux/bitmap.h> 31#include <linux/bitmap.h>
30#include <linux/kernel.h> 32#include <linux/kernel.h>
@@ -40,6 +42,7 @@
40#include <sys/param.h> 42#include <sys/param.h>
41#include <sys/types.h> 43#include <sys/types.h>
42#include <sys/stat.h> 44#include <sys/stat.h>
45#include <fcntl.h>
43#include <unistd.h> 46#include <unistd.h>
44 47
45#include "sane_ctype.h" 48#include "sane_ctype.h"
@@ -90,6 +93,8 @@ enum perf_output_field {
90 PERF_OUTPUT_SYNTH = 1U << 25, 93 PERF_OUTPUT_SYNTH = 1U << 25,
91 PERF_OUTPUT_PHYS_ADDR = 1U << 26, 94 PERF_OUTPUT_PHYS_ADDR = 1U << 26,
92 PERF_OUTPUT_UREGS = 1U << 27, 95 PERF_OUTPUT_UREGS = 1U << 27,
96 PERF_OUTPUT_METRIC = 1U << 28,
97 PERF_OUTPUT_MISC = 1U << 29,
93}; 98};
94 99
95struct output_option { 100struct output_option {
@@ -124,6 +129,8 @@ struct output_option {
124 {.str = "brstackoff", .field = PERF_OUTPUT_BRSTACKOFF}, 129 {.str = "brstackoff", .field = PERF_OUTPUT_BRSTACKOFF},
125 {.str = "synth", .field = PERF_OUTPUT_SYNTH}, 130 {.str = "synth", .field = PERF_OUTPUT_SYNTH},
126 {.str = "phys_addr", .field = PERF_OUTPUT_PHYS_ADDR}, 131 {.str = "phys_addr", .field = PERF_OUTPUT_PHYS_ADDR},
132 {.str = "metric", .field = PERF_OUTPUT_METRIC},
133 {.str = "misc", .field = PERF_OUTPUT_MISC},
127}; 134};
128 135
129enum { 136enum {
@@ -215,12 +222,20 @@ struct perf_evsel_script {
215 char *filename; 222 char *filename;
216 FILE *fp; 223 FILE *fp;
217 u64 samples; 224 u64 samples;
225 /* For metric output */
226 u64 val;
227 int gnum;
218}; 228};
219 229
230static inline struct perf_evsel_script *evsel_script(struct perf_evsel *evsel)
231{
232 return (struct perf_evsel_script *)evsel->priv;
233}
234
220static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel, 235static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel,
221 struct perf_data *data) 236 struct perf_data *data)
222{ 237{
223 struct perf_evsel_script *es = malloc(sizeof(*es)); 238 struct perf_evsel_script *es = zalloc(sizeof(*es));
224 239
225 if (es != NULL) { 240 if (es != NULL) {
226 if (asprintf(&es->filename, "%s.%s.dump", data->file.path, perf_evsel__name(evsel)) < 0) 241 if (asprintf(&es->filename, "%s.%s.dump", data->file.path, perf_evsel__name(evsel)) < 0)
@@ -228,7 +243,6 @@ static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel
228 es->fp = fopen(es->filename, "w"); 243 es->fp = fopen(es->filename, "w");
229 if (es->fp == NULL) 244 if (es->fp == NULL)
230 goto out_free_filename; 245 goto out_free_filename;
231 es->samples = 0;
232 } 246 }
233 247
234 return es; 248 return es;
@@ -423,11 +437,6 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
423 PERF_OUTPUT_CPU, allow_user_set)) 437 PERF_OUTPUT_CPU, allow_user_set))
424 return -EINVAL; 438 return -EINVAL;
425 439
426 if (PRINT_FIELD(PERIOD) &&
427 perf_evsel__check_stype(evsel, PERF_SAMPLE_PERIOD, "PERIOD",
428 PERF_OUTPUT_PERIOD))
429 return -EINVAL;
430
431 if (PRINT_FIELD(IREGS) && 440 if (PRINT_FIELD(IREGS) &&
432 perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS", 441 perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS",
433 PERF_OUTPUT_IREGS)) 442 PERF_OUTPUT_IREGS))
@@ -588,7 +597,8 @@ static int perf_sample__fprintf_uregs(struct perf_sample *sample,
588 597
589static int perf_sample__fprintf_start(struct perf_sample *sample, 598static int perf_sample__fprintf_start(struct perf_sample *sample,
590 struct thread *thread, 599 struct thread *thread,
591 struct perf_evsel *evsel, FILE *fp) 600 struct perf_evsel *evsel,
601 u32 type, FILE *fp)
592{ 602{
593 struct perf_event_attr *attr = &evsel->attr; 603 struct perf_event_attr *attr = &evsel->attr;
594 unsigned long secs; 604 unsigned long secs;
@@ -618,6 +628,47 @@ static int perf_sample__fprintf_start(struct perf_sample *sample,
618 printed += fprintf(fp, "[%03d] ", sample->cpu); 628 printed += fprintf(fp, "[%03d] ", sample->cpu);
619 } 629 }
620 630
631 if (PRINT_FIELD(MISC)) {
632 int ret = 0;
633
634 #define has(m) \
635 (sample->misc & PERF_RECORD_MISC_##m) == PERF_RECORD_MISC_##m
636
637 if (has(KERNEL))
638 ret += fprintf(fp, "K");
639 if (has(USER))
640 ret += fprintf(fp, "U");
641 if (has(HYPERVISOR))
642 ret += fprintf(fp, "H");
643 if (has(GUEST_KERNEL))
644 ret += fprintf(fp, "G");
645 if (has(GUEST_USER))
646 ret += fprintf(fp, "g");
647
648 switch (type) {
649 case PERF_RECORD_MMAP:
650 case PERF_RECORD_MMAP2:
651 if (has(MMAP_DATA))
652 ret += fprintf(fp, "M");
653 break;
654 case PERF_RECORD_COMM:
655 if (has(COMM_EXEC))
656 ret += fprintf(fp, "E");
657 break;
658 case PERF_RECORD_SWITCH:
659 case PERF_RECORD_SWITCH_CPU_WIDE:
660 if (has(SWITCH_OUT))
661 ret += fprintf(fp, "S");
662 default:
663 break;
664 }
665
666 #undef has
667
668 ret += fprintf(fp, "%*s", 6 - ret, " ");
669 printed += ret;
670 }
671
621 if (PRINT_FIELD(TIME)) { 672 if (PRINT_FIELD(TIME)) {
622 nsecs = sample->time; 673 nsecs = sample->time;
623 secs = nsecs / NSEC_PER_SEC; 674 secs = nsecs / NSEC_PER_SEC;
@@ -1437,13 +1488,16 @@ struct perf_script {
1437 bool show_mmap_events; 1488 bool show_mmap_events;
1438 bool show_switch_events; 1489 bool show_switch_events;
1439 bool show_namespace_events; 1490 bool show_namespace_events;
1491 bool show_lost_events;
1440 bool allocated; 1492 bool allocated;
1441 bool per_event_dump; 1493 bool per_event_dump;
1442 struct cpu_map *cpus; 1494 struct cpu_map *cpus;
1443 struct thread_map *threads; 1495 struct thread_map *threads;
1444 int name_width; 1496 int name_width;
1445 const char *time_str; 1497 const char *time_str;
1446 struct perf_time_interval ptime; 1498 struct perf_time_interval *ptime_range;
1499 int range_size;
1500 int range_num;
1447}; 1501};
1448 1502
1449static int perf_evlist__max_name_len(struct perf_evlist *evlist) 1503static int perf_evlist__max_name_len(struct perf_evlist *evlist)
@@ -1477,6 +1531,88 @@ static int data_src__fprintf(u64 data_src, FILE *fp)
1477 return fprintf(fp, "%-*s", maxlen, out); 1531 return fprintf(fp, "%-*s", maxlen, out);
1478} 1532}
1479 1533
1534struct metric_ctx {
1535 struct perf_sample *sample;
1536 struct thread *thread;
1537 struct perf_evsel *evsel;
1538 FILE *fp;
1539};
1540
1541static void script_print_metric(void *ctx, const char *color,
1542 const char *fmt,
1543 const char *unit, double val)
1544{
1545 struct metric_ctx *mctx = ctx;
1546
1547 if (!fmt)
1548 return;
1549 perf_sample__fprintf_start(mctx->sample, mctx->thread, mctx->evsel,
1550 PERF_RECORD_SAMPLE, mctx->fp);
1551 fputs("\tmetric: ", mctx->fp);
1552 if (color)
1553 color_fprintf(mctx->fp, color, fmt, val);
1554 else
1555 printf(fmt, val);
1556 fprintf(mctx->fp, " %s\n", unit);
1557}
1558
1559static void script_new_line(void *ctx)
1560{
1561 struct metric_ctx *mctx = ctx;
1562
1563 perf_sample__fprintf_start(mctx->sample, mctx->thread, mctx->evsel,
1564 PERF_RECORD_SAMPLE, mctx->fp);
1565 fputs("\tmetric: ", mctx->fp);
1566}
1567
1568static void perf_sample__fprint_metric(struct perf_script *script,
1569 struct thread *thread,
1570 struct perf_evsel *evsel,
1571 struct perf_sample *sample,
1572 FILE *fp)
1573{
1574 struct perf_stat_output_ctx ctx = {
1575 .print_metric = script_print_metric,
1576 .new_line = script_new_line,
1577 .ctx = &(struct metric_ctx) {
1578 .sample = sample,
1579 .thread = thread,
1580 .evsel = evsel,
1581 .fp = fp,
1582 },
1583 .force_header = false,
1584 };
1585 struct perf_evsel *ev2;
1586 static bool init;
1587 u64 val;
1588
1589 if (!init) {
1590 perf_stat__init_shadow_stats();
1591 init = true;
1592 }
1593 if (!evsel->stats)
1594 perf_evlist__alloc_stats(script->session->evlist, false);
1595 if (evsel_script(evsel->leader)->gnum++ == 0)
1596 perf_stat__reset_shadow_stats();
1597 val = sample->period * evsel->scale;
1598 perf_stat__update_shadow_stats(evsel,
1599 val,
1600 sample->cpu,
1601 &rt_stat);
1602 evsel_script(evsel)->val = val;
1603 if (evsel_script(evsel->leader)->gnum == evsel->leader->nr_members) {
1604 for_each_group_member (ev2, evsel->leader) {
1605 perf_stat__print_shadow_stats(ev2,
1606 evsel_script(ev2)->val,
1607 sample->cpu,
1608 &ctx,
1609 NULL,
1610 &rt_stat);
1611 }
1612 evsel_script(evsel->leader)->gnum = 0;
1613 }
1614}
1615
1480static void process_event(struct perf_script *script, 1616static void process_event(struct perf_script *script,
1481 struct perf_sample *sample, struct perf_evsel *evsel, 1617 struct perf_sample *sample, struct perf_evsel *evsel,
1482 struct addr_location *al, 1618 struct addr_location *al,
@@ -1493,7 +1629,8 @@ static void process_event(struct perf_script *script,
1493 1629
1494 ++es->samples; 1630 ++es->samples;
1495 1631
1496 perf_sample__fprintf_start(sample, thread, evsel, fp); 1632 perf_sample__fprintf_start(sample, thread, evsel,
1633 PERF_RECORD_SAMPLE, fp);
1497 1634
1498 if (PRINT_FIELD(PERIOD)) 1635 if (PRINT_FIELD(PERIOD))
1499 fprintf(fp, "%10" PRIu64 " ", sample->period); 1636 fprintf(fp, "%10" PRIu64 " ", sample->period);
@@ -1564,6 +1701,9 @@ static void process_event(struct perf_script *script,
1564 if (PRINT_FIELD(PHYS_ADDR)) 1701 if (PRINT_FIELD(PHYS_ADDR))
1565 fprintf(fp, "%16" PRIx64, sample->phys_addr); 1702 fprintf(fp, "%16" PRIx64, sample->phys_addr);
1566 fprintf(fp, "\n"); 1703 fprintf(fp, "\n");
1704
1705 if (PRINT_FIELD(METRIC))
1706 perf_sample__fprint_metric(script, thread, evsel, sample, fp);
1567} 1707}
1568 1708
1569static struct scripting_ops *scripting_ops; 1709static struct scripting_ops *scripting_ops;
@@ -1643,8 +1783,10 @@ static int process_sample_event(struct perf_tool *tool,
1643 struct perf_script *scr = container_of(tool, struct perf_script, tool); 1783 struct perf_script *scr = container_of(tool, struct perf_script, tool);
1644 struct addr_location al; 1784 struct addr_location al;
1645 1785
1646 if (perf_time__skip_sample(&scr->ptime, sample->time)) 1786 if (perf_time__ranges_skip_sample(scr->ptime_range, scr->range_num,
1787 sample->time)) {
1647 return 0; 1788 return 0;
1789 }
1648 1790
1649 if (debug_mode) { 1791 if (debug_mode) {
1650 if (sample->time < last_timestamp) { 1792 if (sample->time < last_timestamp) {
@@ -1737,7 +1879,8 @@ static int process_comm_event(struct perf_tool *tool,
1737 sample->tid = event->comm.tid; 1879 sample->tid = event->comm.tid;
1738 sample->pid = event->comm.pid; 1880 sample->pid = event->comm.pid;
1739 } 1881 }
1740 perf_sample__fprintf_start(sample, thread, evsel, stdout); 1882 perf_sample__fprintf_start(sample, thread, evsel,
1883 PERF_RECORD_COMM, stdout);
1741 perf_event__fprintf(event, stdout); 1884 perf_event__fprintf(event, stdout);
1742 ret = 0; 1885 ret = 0;
1743out: 1886out:
@@ -1772,7 +1915,8 @@ static int process_namespaces_event(struct perf_tool *tool,
1772 sample->tid = event->namespaces.tid; 1915 sample->tid = event->namespaces.tid;
1773 sample->pid = event->namespaces.pid; 1916 sample->pid = event->namespaces.pid;
1774 } 1917 }
1775 perf_sample__fprintf_start(sample, thread, evsel, stdout); 1918 perf_sample__fprintf_start(sample, thread, evsel,
1919 PERF_RECORD_NAMESPACES, stdout);
1776 perf_event__fprintf(event, stdout); 1920 perf_event__fprintf(event, stdout);
1777 ret = 0; 1921 ret = 0;
1778out: 1922out:
@@ -1805,7 +1949,8 @@ static int process_fork_event(struct perf_tool *tool,
1805 sample->tid = event->fork.tid; 1949 sample->tid = event->fork.tid;
1806 sample->pid = event->fork.pid; 1950 sample->pid = event->fork.pid;
1807 } 1951 }
1808 perf_sample__fprintf_start(sample, thread, evsel, stdout); 1952 perf_sample__fprintf_start(sample, thread, evsel,
1953 PERF_RECORD_FORK, stdout);
1809 perf_event__fprintf(event, stdout); 1954 perf_event__fprintf(event, stdout);
1810 thread__put(thread); 1955 thread__put(thread);
1811 1956
@@ -1834,7 +1979,8 @@ static int process_exit_event(struct perf_tool *tool,
1834 sample->tid = event->fork.tid; 1979 sample->tid = event->fork.tid;
1835 sample->pid = event->fork.pid; 1980 sample->pid = event->fork.pid;
1836 } 1981 }
1837 perf_sample__fprintf_start(sample, thread, evsel, stdout); 1982 perf_sample__fprintf_start(sample, thread, evsel,
1983 PERF_RECORD_EXIT, stdout);
1838 perf_event__fprintf(event, stdout); 1984 perf_event__fprintf(event, stdout);
1839 1985
1840 if (perf_event__process_exit(tool, event, sample, machine) < 0) 1986 if (perf_event__process_exit(tool, event, sample, machine) < 0)
@@ -1869,7 +2015,8 @@ static int process_mmap_event(struct perf_tool *tool,
1869 sample->tid = event->mmap.tid; 2015 sample->tid = event->mmap.tid;
1870 sample->pid = event->mmap.pid; 2016 sample->pid = event->mmap.pid;
1871 } 2017 }
1872 perf_sample__fprintf_start(sample, thread, evsel, stdout); 2018 perf_sample__fprintf_start(sample, thread, evsel,
2019 PERF_RECORD_MMAP, stdout);
1873 perf_event__fprintf(event, stdout); 2020 perf_event__fprintf(event, stdout);
1874 thread__put(thread); 2021 thread__put(thread);
1875 return 0; 2022 return 0;
@@ -1900,7 +2047,8 @@ static int process_mmap2_event(struct perf_tool *tool,
1900 sample->tid = event->mmap2.tid; 2047 sample->tid = event->mmap2.tid;
1901 sample->pid = event->mmap2.pid; 2048 sample->pid = event->mmap2.pid;
1902 } 2049 }
1903 perf_sample__fprintf_start(sample, thread, evsel, stdout); 2050 perf_sample__fprintf_start(sample, thread, evsel,
2051 PERF_RECORD_MMAP2, stdout);
1904 perf_event__fprintf(event, stdout); 2052 perf_event__fprintf(event, stdout);
1905 thread__put(thread); 2053 thread__put(thread);
1906 return 0; 2054 return 0;
@@ -1926,7 +2074,31 @@ static int process_switch_event(struct perf_tool *tool,
1926 return -1; 2074 return -1;
1927 } 2075 }
1928 2076
1929 perf_sample__fprintf_start(sample, thread, evsel, stdout); 2077 perf_sample__fprintf_start(sample, thread, evsel,
2078 PERF_RECORD_SWITCH, stdout);
2079 perf_event__fprintf(event, stdout);
2080 thread__put(thread);
2081 return 0;
2082}
2083
2084static int
2085process_lost_event(struct perf_tool *tool,
2086 union perf_event *event,
2087 struct perf_sample *sample,
2088 struct machine *machine)
2089{
2090 struct perf_script *script = container_of(tool, struct perf_script, tool);
2091 struct perf_session *session = script->session;
2092 struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
2093 struct thread *thread;
2094
2095 thread = machine__findnew_thread(machine, sample->pid,
2096 sample->tid);
2097 if (thread == NULL)
2098 return -1;
2099
2100 perf_sample__fprintf_start(sample, thread, evsel,
2101 PERF_RECORD_LOST, stdout);
1930 perf_event__fprintf(event, stdout); 2102 perf_event__fprintf(event, stdout);
1931 thread__put(thread); 2103 thread__put(thread);
1932 return 0; 2104 return 0;
@@ -2026,6 +2198,8 @@ static int __cmd_script(struct perf_script *script)
2026 script->tool.context_switch = process_switch_event; 2198 script->tool.context_switch = process_switch_event;
2027 if (script->show_namespace_events) 2199 if (script->show_namespace_events)
2028 script->tool.namespaces = process_namespaces_event; 2200 script->tool.namespaces = process_namespaces_event;
2201 if (script->show_lost_events)
2202 script->tool.lost = process_lost_event;
2029 2203
2030 if (perf_script__setup_per_event_dump(script)) { 2204 if (perf_script__setup_per_event_dump(script)) {
2031 pr_err("Couldn't create the per event dump files\n"); 2205 pr_err("Couldn't create the per event dump files\n");
@@ -2311,19 +2485,6 @@ out:
2311 return rc; 2485 return rc;
2312} 2486}
2313 2487
2314/* Helper function for filesystems that return a dent->d_type DT_UNKNOWN */
2315static int is_directory(const char *base_path, const struct dirent *dent)
2316{
2317 char path[PATH_MAX];
2318 struct stat st;
2319
2320 sprintf(path, "%s/%s", base_path, dent->d_name);
2321 if (stat(path, &st))
2322 return 0;
2323
2324 return S_ISDIR(st.st_mode);
2325}
2326
2327#define for_each_lang(scripts_path, scripts_dir, lang_dirent) \ 2488#define for_each_lang(scripts_path, scripts_dir, lang_dirent) \
2328 while ((lang_dirent = readdir(scripts_dir)) != NULL) \ 2489 while ((lang_dirent = readdir(scripts_dir)) != NULL) \
2329 if ((lang_dirent->d_type == DT_DIR || \ 2490 if ((lang_dirent->d_type == DT_DIR || \
@@ -2758,9 +2919,10 @@ static void script__setup_sample_type(struct perf_script *script)
2758 2919
2759 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) { 2920 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
2760 if ((sample_type & PERF_SAMPLE_REGS_USER) && 2921 if ((sample_type & PERF_SAMPLE_REGS_USER) &&
2761 (sample_type & PERF_SAMPLE_STACK_USER)) 2922 (sample_type & PERF_SAMPLE_STACK_USER)) {
2762 callchain_param.record_mode = CALLCHAIN_DWARF; 2923 callchain_param.record_mode = CALLCHAIN_DWARF;
2763 else if (sample_type & PERF_SAMPLE_BRANCH_STACK) 2924 dwarf_callchain_users = true;
2925 } else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
2764 callchain_param.record_mode = CALLCHAIN_LBR; 2926 callchain_param.record_mode = CALLCHAIN_LBR;
2765 else 2927 else
2766 callchain_param.record_mode = CALLCHAIN_FP; 2928 callchain_param.record_mode = CALLCHAIN_FP;
@@ -2975,6 +3137,8 @@ int cmd_script(int argc, const char **argv)
2975 "Show context switch events (if recorded)"), 3137 "Show context switch events (if recorded)"),
2976 OPT_BOOLEAN('\0', "show-namespace-events", &script.show_namespace_events, 3138 OPT_BOOLEAN('\0', "show-namespace-events", &script.show_namespace_events,
2977 "Show namespace events (if recorded)"), 3139 "Show namespace events (if recorded)"),
3140 OPT_BOOLEAN('\0', "show-lost-events", &script.show_lost_events,
3141 "Show lost events (if recorded)"),
2978 OPT_BOOLEAN('\0', "per-event-dump", &script.per_event_dump, 3142 OPT_BOOLEAN('\0', "per-event-dump", &script.per_event_dump,
2979 "Dump trace output to files named by the monitored events"), 3143 "Dump trace output to files named by the monitored events"),
2980 OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"), 3144 OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
@@ -3281,18 +3445,46 @@ int cmd_script(int argc, const char **argv)
3281 if (err < 0) 3445 if (err < 0)
3282 goto out_delete; 3446 goto out_delete;
3283 3447
3284 /* needs to be parsed after looking up reference time */ 3448 script.ptime_range = perf_time__range_alloc(script.time_str,
3285 if (perf_time__parse_str(&script.ptime, script.time_str) != 0) { 3449 &script.range_size);
3286 pr_err("Invalid time string\n"); 3450 if (!script.ptime_range) {
3287 err = -EINVAL; 3451 err = -ENOMEM;
3288 goto out_delete; 3452 goto out_delete;
3289 } 3453 }
3290 3454
3455 /* needs to be parsed after looking up reference time */
3456 if (perf_time__parse_str(script.ptime_range, script.time_str) != 0) {
3457 if (session->evlist->first_sample_time == 0 &&
3458 session->evlist->last_sample_time == 0) {
3459 pr_err("HINT: no first/last sample time found in perf data.\n"
3460 "Please use latest perf binary to execute 'perf record'\n"
3461 "(if '--buildid-all' is enabled, please set '--timestamp-boundary').\n");
3462 err = -EINVAL;
3463 goto out_delete;
3464 }
3465
3466 script.range_num = perf_time__percent_parse_str(
3467 script.ptime_range, script.range_size,
3468 script.time_str,
3469 session->evlist->first_sample_time,
3470 session->evlist->last_sample_time);
3471
3472 if (script.range_num < 0) {
3473 pr_err("Invalid time string\n");
3474 err = -EINVAL;
3475 goto out_delete;
3476 }
3477 } else {
3478 script.range_num = 1;
3479 }
3480
3291 err = __cmd_script(&script); 3481 err = __cmd_script(&script);
3292 3482
3293 flush_scripting(); 3483 flush_scripting();
3294 3484
3295out_delete: 3485out_delete:
3486 zfree(&script.ptime_range);
3487
3296 perf_evlist__free_stats(session->evlist); 3488 perf_evlist__free_stats(session->evlist);
3297 perf_session__delete(session); 3489 perf_session__delete(session);
3298 3490
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 59af5a8419e2..98bf9d32f222 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -63,7 +63,6 @@
63#include "util/group.h" 63#include "util/group.h"
64#include "util/session.h" 64#include "util/session.h"
65#include "util/tool.h" 65#include "util/tool.h"
66#include "util/group.h"
67#include "util/string2.h" 66#include "util/string2.h"
68#include "util/metricgroup.h" 67#include "util/metricgroup.h"
69#include "asm/bug.h" 68#include "asm/bug.h"
@@ -214,8 +213,13 @@ static inline void diff_timespec(struct timespec *r, struct timespec *a,
214 213
215static void perf_stat__reset_stats(void) 214static void perf_stat__reset_stats(void)
216{ 215{
216 int i;
217
217 perf_evlist__reset_stats(evsel_list); 218 perf_evlist__reset_stats(evsel_list);
218 perf_stat__reset_shadow_stats(); 219 perf_stat__reset_shadow_stats();
220
221 for (i = 0; i < stat_config.stats_num; i++)
222 perf_stat__reset_shadow_per_stat(&stat_config.stats[i]);
219} 223}
220 224
221static int create_perf_stat_counter(struct perf_evsel *evsel) 225static int create_perf_stat_counter(struct perf_evsel *evsel)
@@ -272,7 +276,7 @@ static int create_perf_stat_counter(struct perf_evsel *evsel)
272 attr->enable_on_exec = 1; 276 attr->enable_on_exec = 1;
273 } 277 }
274 278
275 if (target__has_cpu(&target)) 279 if (target__has_cpu(&target) && !target__has_per_thread(&target))
276 return perf_evsel__open_per_cpu(evsel, perf_evsel__cpus(evsel)); 280 return perf_evsel__open_per_cpu(evsel, perf_evsel__cpus(evsel));
277 281
278 return perf_evsel__open_per_thread(evsel, evsel_list->threads); 282 return perf_evsel__open_per_thread(evsel, evsel_list->threads);
@@ -335,7 +339,7 @@ static int read_counter(struct perf_evsel *counter)
335 int nthreads = thread_map__nr(evsel_list->threads); 339 int nthreads = thread_map__nr(evsel_list->threads);
336 int ncpus, cpu, thread; 340 int ncpus, cpu, thread;
337 341
338 if (target__has_cpu(&target)) 342 if (target__has_cpu(&target) && !target__has_per_thread(&target))
339 ncpus = perf_evsel__nr_cpus(counter); 343 ncpus = perf_evsel__nr_cpus(counter);
340 else 344 else
341 ncpus = 1; 345 ncpus = 1;
@@ -458,19 +462,8 @@ static void workload_exec_failed_signal(int signo __maybe_unused, siginfo_t *inf
458 workload_exec_errno = info->si_value.sival_int; 462 workload_exec_errno = info->si_value.sival_int;
459} 463}
460 464
461static bool has_unit(struct perf_evsel *counter)
462{
463 return counter->unit && *counter->unit;
464}
465
466static bool has_scale(struct perf_evsel *counter)
467{
468 return counter->scale != 1;
469}
470
471static int perf_stat_synthesize_config(bool is_pipe) 465static int perf_stat_synthesize_config(bool is_pipe)
472{ 466{
473 struct perf_evsel *counter;
474 int err; 467 int err;
475 468
476 if (is_pipe) { 469 if (is_pipe) {
@@ -482,53 +475,10 @@ static int perf_stat_synthesize_config(bool is_pipe)
482 } 475 }
483 } 476 }
484 477
485 /* 478 err = perf_event__synthesize_extra_attr(NULL,
486 * Synthesize other events stuff not carried within 479 evsel_list,
487 * attr event - unit, scale, name 480 process_synthesized_event,
488 */ 481 is_pipe);
489 evlist__for_each_entry(evsel_list, counter) {
490 if (!counter->supported)
491 continue;
492
493 /*
494 * Synthesize unit and scale only if it's defined.
495 */
496 if (has_unit(counter)) {
497 err = perf_event__synthesize_event_update_unit(NULL, counter, process_synthesized_event);
498 if (err < 0) {
499 pr_err("Couldn't synthesize evsel unit.\n");
500 return err;
501 }
502 }
503
504 if (has_scale(counter)) {
505 err = perf_event__synthesize_event_update_scale(NULL, counter, process_synthesized_event);
506 if (err < 0) {
507 pr_err("Couldn't synthesize evsel scale.\n");
508 return err;
509 }
510 }
511
512 if (counter->own_cpus) {
513 err = perf_event__synthesize_event_update_cpus(NULL, counter, process_synthesized_event);
514 if (err < 0) {
515 pr_err("Couldn't synthesize evsel scale.\n");
516 return err;
517 }
518 }
519
520 /*
521 * Name is needed only for pipe output,
522 * perf.data carries event names.
523 */
524 if (is_pipe) {
525 err = perf_event__synthesize_event_update_name(NULL, counter, process_synthesized_event);
526 if (err < 0) {
527 pr_err("Couldn't synthesize evsel name.\n");
528 return err;
529 }
530 }
531 }
532 482
533 err = perf_event__synthesize_thread_map2(NULL, evsel_list->threads, 483 err = perf_event__synthesize_thread_map2(NULL, evsel_list->threads,
534 process_synthesized_event, 484 process_synthesized_event,
@@ -1151,7 +1101,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
1151} 1101}
1152 1102
1153static void printout(int id, int nr, struct perf_evsel *counter, double uval, 1103static void printout(int id, int nr, struct perf_evsel *counter, double uval,
1154 char *prefix, u64 run, u64 ena, double noise) 1104 char *prefix, u64 run, u64 ena, double noise,
1105 struct runtime_stat *st)
1155{ 1106{
1156 struct perf_stat_output_ctx out; 1107 struct perf_stat_output_ctx out;
1157 struct outstate os = { 1108 struct outstate os = {
@@ -1244,7 +1195,7 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval,
1244 1195
1245 perf_stat__print_shadow_stats(counter, uval, 1196 perf_stat__print_shadow_stats(counter, uval,
1246 first_shadow_cpu(counter, id), 1197 first_shadow_cpu(counter, id),
1247 &out, &metric_events); 1198 &out, &metric_events, st);
1248 if (!csv_output && !metric_only) { 1199 if (!csv_output && !metric_only) {
1249 print_noise(counter, noise); 1200 print_noise(counter, noise);
1250 print_running(run, ena); 1201 print_running(run, ena);
@@ -1268,7 +1219,8 @@ static void aggr_update_shadow(void)
1268 val += perf_counts(counter->counts, cpu, 0)->val; 1219 val += perf_counts(counter->counts, cpu, 0)->val;
1269 } 1220 }
1270 perf_stat__update_shadow_stats(counter, val, 1221 perf_stat__update_shadow_stats(counter, val,
1271 first_shadow_cpu(counter, id)); 1222 first_shadow_cpu(counter, id),
1223 &rt_stat);
1272 } 1224 }
1273 } 1225 }
1274} 1226}
@@ -1388,7 +1340,8 @@ static void print_aggr(char *prefix)
1388 fprintf(output, "%s", prefix); 1340 fprintf(output, "%s", prefix);
1389 1341
1390 uval = val * counter->scale; 1342 uval = val * counter->scale;
1391 printout(id, nr, counter, uval, prefix, run, ena, 1.0); 1343 printout(id, nr, counter, uval, prefix, run, ena, 1.0,
1344 &rt_stat);
1392 if (!metric_only) 1345 if (!metric_only)
1393 fputc('\n', output); 1346 fputc('\n', output);
1394 } 1347 }
@@ -1397,13 +1350,24 @@ static void print_aggr(char *prefix)
1397 } 1350 }
1398} 1351}
1399 1352
1400static void print_aggr_thread(struct perf_evsel *counter, char *prefix) 1353static int cmp_val(const void *a, const void *b)
1401{ 1354{
1402 FILE *output = stat_config.output; 1355 return ((struct perf_aggr_thread_value *)b)->val -
1403 int nthreads = thread_map__nr(counter->threads); 1356 ((struct perf_aggr_thread_value *)a)->val;
1404 int ncpus = cpu_map__nr(counter->cpus); 1357}
1405 int cpu, thread; 1358
1359static struct perf_aggr_thread_value *sort_aggr_thread(
1360 struct perf_evsel *counter,
1361 int nthreads, int ncpus,
1362 int *ret)
1363{
1364 int cpu, thread, i = 0;
1406 double uval; 1365 double uval;
1366 struct perf_aggr_thread_value *buf;
1367
1368 buf = calloc(nthreads, sizeof(struct perf_aggr_thread_value));
1369 if (!buf)
1370 return NULL;
1407 1371
1408 for (thread = 0; thread < nthreads; thread++) { 1372 for (thread = 0; thread < nthreads; thread++) {
1409 u64 ena = 0, run = 0, val = 0; 1373 u64 ena = 0, run = 0, val = 0;
@@ -1414,13 +1378,63 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
1414 run += perf_counts(counter->counts, cpu, thread)->run; 1378 run += perf_counts(counter->counts, cpu, thread)->run;
1415 } 1379 }
1416 1380
1381 uval = val * counter->scale;
1382
1383 /*
1384 * Skip value 0 when enabling --per-thread globally,
1385 * otherwise too many 0 output.
1386 */
1387 if (uval == 0.0 && target__has_per_thread(&target))
1388 continue;
1389
1390 buf[i].counter = counter;
1391 buf[i].id = thread;
1392 buf[i].uval = uval;
1393 buf[i].val = val;
1394 buf[i].run = run;
1395 buf[i].ena = ena;
1396 i++;
1397 }
1398
1399 qsort(buf, i, sizeof(struct perf_aggr_thread_value), cmp_val);
1400
1401 if (ret)
1402 *ret = i;
1403
1404 return buf;
1405}
1406
1407static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
1408{
1409 FILE *output = stat_config.output;
1410 int nthreads = thread_map__nr(counter->threads);
1411 int ncpus = cpu_map__nr(counter->cpus);
1412 int thread, sorted_threads, id;
1413 struct perf_aggr_thread_value *buf;
1414
1415 buf = sort_aggr_thread(counter, nthreads, ncpus, &sorted_threads);
1416 if (!buf) {
1417 perror("cannot sort aggr thread");
1418 return;
1419 }
1420
1421 for (thread = 0; thread < sorted_threads; thread++) {
1417 if (prefix) 1422 if (prefix)
1418 fprintf(output, "%s", prefix); 1423 fprintf(output, "%s", prefix);
1419 1424
1420 uval = val * counter->scale; 1425 id = buf[thread].id;
1421 printout(thread, 0, counter, uval, prefix, run, ena, 1.0); 1426 if (stat_config.stats)
1427 printout(id, 0, buf[thread].counter, buf[thread].uval,
1428 prefix, buf[thread].run, buf[thread].ena, 1.0,
1429 &stat_config.stats[id]);
1430 else
1431 printout(id, 0, buf[thread].counter, buf[thread].uval,
1432 prefix, buf[thread].run, buf[thread].ena, 1.0,
1433 &rt_stat);
1422 fputc('\n', output); 1434 fputc('\n', output);
1423 } 1435 }
1436
1437 free(buf);
1424} 1438}
1425 1439
1426struct caggr_data { 1440struct caggr_data {
@@ -1455,7 +1469,8 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
1455 fprintf(output, "%s", prefix); 1469 fprintf(output, "%s", prefix);
1456 1470
1457 uval = cd.avg * counter->scale; 1471 uval = cd.avg * counter->scale;
1458 printout(-1, 0, counter, uval, prefix, cd.avg_running, cd.avg_enabled, cd.avg); 1472 printout(-1, 0, counter, uval, prefix, cd.avg_running, cd.avg_enabled,
1473 cd.avg, &rt_stat);
1459 if (!metric_only) 1474 if (!metric_only)
1460 fprintf(output, "\n"); 1475 fprintf(output, "\n");
1461} 1476}
@@ -1494,7 +1509,8 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
1494 fprintf(output, "%s", prefix); 1509 fprintf(output, "%s", prefix);
1495 1510
1496 uval = val * counter->scale; 1511 uval = val * counter->scale;
1497 printout(cpu, 0, counter, uval, prefix, run, ena, 1.0); 1512 printout(cpu, 0, counter, uval, prefix, run, ena, 1.0,
1513 &rt_stat);
1498 1514
1499 fputc('\n', output); 1515 fputc('\n', output);
1500 } 1516 }
@@ -1526,7 +1542,8 @@ static void print_no_aggr_metric(char *prefix)
1526 run = perf_counts(counter->counts, cpu, 0)->run; 1542 run = perf_counts(counter->counts, cpu, 0)->run;
1527 1543
1528 uval = val * counter->scale; 1544 uval = val * counter->scale;
1529 printout(cpu, 0, counter, uval, prefix, run, ena, 1.0); 1545 printout(cpu, 0, counter, uval, prefix, run, ena, 1.0,
1546 &rt_stat);
1530 } 1547 }
1531 fputc('\n', stat_config.output); 1548 fputc('\n', stat_config.output);
1532 } 1549 }
@@ -1582,7 +1599,8 @@ static void print_metric_headers(const char *prefix, bool no_indent)
1582 perf_stat__print_shadow_stats(counter, 0, 1599 perf_stat__print_shadow_stats(counter, 0,
1583 0, 1600 0,
1584 &out, 1601 &out,
1585 &metric_events); 1602 &metric_events,
1603 &rt_stat);
1586 } 1604 }
1587 fputc('\n', stat_config.output); 1605 fputc('\n', stat_config.output);
1588} 1606}
@@ -2541,6 +2559,35 @@ int process_cpu_map_event(struct perf_tool *tool,
2541 return set_maps(st); 2559 return set_maps(st);
2542} 2560}
2543 2561
2562static int runtime_stat_new(struct perf_stat_config *config, int nthreads)
2563{
2564 int i;
2565
2566 config->stats = calloc(nthreads, sizeof(struct runtime_stat));
2567 if (!config->stats)
2568 return -1;
2569
2570 config->stats_num = nthreads;
2571
2572 for (i = 0; i < nthreads; i++)
2573 runtime_stat__init(&config->stats[i]);
2574
2575 return 0;
2576}
2577
2578static void runtime_stat_delete(struct perf_stat_config *config)
2579{
2580 int i;
2581
2582 if (!config->stats)
2583 return;
2584
2585 for (i = 0; i < config->stats_num; i++)
2586 runtime_stat__exit(&config->stats[i]);
2587
2588 free(config->stats);
2589}
2590
2544static const char * const stat_report_usage[] = { 2591static const char * const stat_report_usage[] = {
2545 "perf stat report [<options>]", 2592 "perf stat report [<options>]",
2546 NULL, 2593 NULL,
@@ -2750,12 +2797,16 @@ int cmd_stat(int argc, const char **argv)
2750 run_count = 1; 2797 run_count = 1;
2751 } 2798 }
2752 2799
2753 if ((stat_config.aggr_mode == AGGR_THREAD) && !target__has_task(&target)) { 2800 if ((stat_config.aggr_mode == AGGR_THREAD) &&
2754 fprintf(stderr, "The --per-thread option is only available " 2801 !target__has_task(&target)) {
2755 "when monitoring via -p -t options.\n"); 2802 if (!target.system_wide || target.cpu_list) {
2756 parse_options_usage(NULL, stat_options, "p", 1); 2803 fprintf(stderr, "The --per-thread option is only "
2757 parse_options_usage(NULL, stat_options, "t", 1); 2804 "available when monitoring via -p -t -a "
2758 goto out; 2805 "options or only --per-thread.\n");
2806 parse_options_usage(NULL, stat_options, "p", 1);
2807 parse_options_usage(NULL, stat_options, "t", 1);
2808 goto out;
2809 }
2759 } 2810 }
2760 2811
2761 /* 2812 /*
@@ -2779,6 +2830,9 @@ int cmd_stat(int argc, const char **argv)
2779 2830
2780 target__validate(&target); 2831 target__validate(&target);
2781 2832
2833 if ((stat_config.aggr_mode == AGGR_THREAD) && (target.system_wide))
2834 target.per_thread = true;
2835
2782 if (perf_evlist__create_maps(evsel_list, &target) < 0) { 2836 if (perf_evlist__create_maps(evsel_list, &target) < 0) {
2783 if (target__has_task(&target)) { 2837 if (target__has_task(&target)) {
2784 pr_err("Problems finding threads of monitor\n"); 2838 pr_err("Problems finding threads of monitor\n");
@@ -2796,8 +2850,15 @@ int cmd_stat(int argc, const char **argv)
2796 * Initialize thread_map with comm names, 2850 * Initialize thread_map with comm names,
2797 * so we could print it out on output. 2851 * so we could print it out on output.
2798 */ 2852 */
2799 if (stat_config.aggr_mode == AGGR_THREAD) 2853 if (stat_config.aggr_mode == AGGR_THREAD) {
2800 thread_map__read_comms(evsel_list->threads); 2854 thread_map__read_comms(evsel_list->threads);
2855 if (target.system_wide) {
2856 if (runtime_stat_new(&stat_config,
2857 thread_map__nr(evsel_list->threads))) {
2858 goto out;
2859 }
2860 }
2861 }
2801 2862
2802 if (interval && interval < 100) { 2863 if (interval && interval < 100) {
2803 if (interval < 10) { 2864 if (interval < 10) {
@@ -2887,5 +2948,8 @@ out:
2887 sysfs__write_int(FREEZE_ON_SMI_PATH, 0); 2948 sysfs__write_int(FREEZE_ON_SMI_PATH, 0);
2888 2949
2889 perf_evlist__delete(evsel_list); 2950 perf_evlist__delete(evsel_list);
2951
2952 runtime_stat_delete(&stat_config);
2953
2890 return status; 2954 return status;
2891} 2955}
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 9e0d2645ae13..c6ccda52117d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -99,6 +99,7 @@ static void perf_top__resize(struct perf_top *top)
99 99
100static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he) 100static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
101{ 101{
102 struct perf_evsel *evsel = hists_to_evsel(he->hists);
102 struct symbol *sym; 103 struct symbol *sym;
103 struct annotation *notes; 104 struct annotation *notes;
104 struct map *map; 105 struct map *map;
@@ -137,7 +138,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
137 return err; 138 return err;
138 } 139 }
139 140
140 err = symbol__disassemble(sym, map, NULL, 0, NULL, NULL); 141 err = symbol__annotate(sym, map, evsel, 0, NULL);
141 if (err == 0) { 142 if (err == 0) {
142out_assign: 143out_assign:
143 top->sym_filter_entry = he; 144 top->sym_filter_entry = he;
@@ -229,6 +230,7 @@ static void perf_top__record_precise_ip(struct perf_top *top,
229static void perf_top__show_details(struct perf_top *top) 230static void perf_top__show_details(struct perf_top *top)
230{ 231{
231 struct hist_entry *he = top->sym_filter_entry; 232 struct hist_entry *he = top->sym_filter_entry;
233 struct perf_evsel *evsel = hists_to_evsel(he->hists);
232 struct annotation *notes; 234 struct annotation *notes;
233 struct symbol *symbol; 235 struct symbol *symbol;
234 int more; 236 int more;
@@ -241,6 +243,8 @@ static void perf_top__show_details(struct perf_top *top)
241 243
242 pthread_mutex_lock(&notes->lock); 244 pthread_mutex_lock(&notes->lock);
243 245
246 symbol__calc_percent(symbol, evsel);
247
244 if (notes->src == NULL) 248 if (notes->src == NULL)
245 goto out_unlock; 249 goto out_unlock;
246 250
@@ -412,7 +416,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
412 fprintf(stdout, "\t[S] stop annotation.\n"); 416 fprintf(stdout, "\t[S] stop annotation.\n");
413 417
414 fprintf(stdout, 418 fprintf(stdout,
415 "\t[K] hide kernel_symbols symbols. \t(%s)\n", 419 "\t[K] hide kernel symbols. \t(%s)\n",
416 top->hide_kernel_symbols ? "yes" : "no"); 420 top->hide_kernel_symbols ? "yes" : "no");
417 fprintf(stdout, 421 fprintf(stdout,
418 "\t[U] hide user symbols. \t(%s)\n", 422 "\t[U] hide user symbols. \t(%s)\n",
@@ -903,7 +907,7 @@ try_again:
903 } 907 }
904 } 908 }
905 909
906 if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) { 910 if (perf_evlist__mmap(evlist, opts->mmap_pages) < 0) {
907 ui__error("Failed to mmap with %d (%s)\n", 911 ui__error("Failed to mmap with %d (%s)\n",
908 errno, str_error_r(errno, msg, sizeof(msg))); 912 errno, str_error_r(errno, msg, sizeof(msg)));
909 goto out_err; 913 goto out_err;
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 84debdbad327..e7f1b182fc15 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -21,6 +21,7 @@
21#include "builtin.h" 21#include "builtin.h"
22#include "util/color.h" 22#include "util/color.h"
23#include "util/debug.h" 23#include "util/debug.h"
24#include "util/env.h"
24#include "util/event.h" 25#include "util/event.h"
25#include "util/evlist.h" 26#include "util/evlist.h"
26#include <subcmd/exec-cmd.h> 27#include <subcmd/exec-cmd.h>
@@ -45,18 +46,17 @@
45 46
46#include <errno.h> 47#include <errno.h>
47#include <inttypes.h> 48#include <inttypes.h>
48#include <libaudit.h> /* FIXME: Still needed for audit_errno_to_name */
49#include <poll.h> 49#include <poll.h>
50#include <signal.h> 50#include <signal.h>
51#include <stdlib.h> 51#include <stdlib.h>
52#include <string.h> 52#include <string.h>
53#include <linux/err.h> 53#include <linux/err.h>
54#include <linux/filter.h> 54#include <linux/filter.h>
55#include <linux/audit.h>
56#include <linux/kernel.h> 55#include <linux/kernel.h>
57#include <linux/random.h> 56#include <linux/random.h>
58#include <linux/stringify.h> 57#include <linux/stringify.h>
59#include <linux/time64.h> 58#include <linux/time64.h>
59#include <fcntl.h>
60 60
61#include "sane_ctype.h" 61#include "sane_ctype.h"
62 62
@@ -111,6 +111,7 @@ struct trace {
111 bool summary; 111 bool summary;
112 bool summary_only; 112 bool summary_only;
113 bool show_comm; 113 bool show_comm;
114 bool print_sample;
114 bool show_tool_stats; 115 bool show_tool_stats;
115 bool trace_syscalls; 116 bool trace_syscalls;
116 bool kernel_syscallchains; 117 bool kernel_syscallchains;
@@ -545,9 +546,10 @@ static size_t syscall_arg__scnprintf_getrandom_flags(char *bf, size_t size,
545 { .scnprintf = SCA_STRARRAY, \ 546 { .scnprintf = SCA_STRARRAY, \
546 .parm = &strarray__##array, } 547 .parm = &strarray__##array, }
547 548
549#include "trace/beauty/arch_errno_names.c"
548#include "trace/beauty/eventfd.c" 550#include "trace/beauty/eventfd.c"
549#include "trace/beauty/flock.c"
550#include "trace/beauty/futex_op.c" 551#include "trace/beauty/futex_op.c"
552#include "trace/beauty/futex_val3.c"
551#include "trace/beauty/mmap.c" 553#include "trace/beauty/mmap.c"
552#include "trace/beauty/mode_t.c" 554#include "trace/beauty/mode_t.c"
553#include "trace/beauty/msg_flags.c" 555#include "trace/beauty/msg_flags.c"
@@ -610,7 +612,8 @@ static struct syscall_fmt {
610 { .name = "fstat", .alias = "newfstat", }, 612 { .name = "fstat", .alias = "newfstat", },
611 { .name = "fstatat", .alias = "newfstatat", }, 613 { .name = "fstatat", .alias = "newfstatat", },
612 { .name = "futex", 614 { .name = "futex",
613 .arg = { [1] = { .scnprintf = SCA_FUTEX_OP, /* op */ }, }, }, 615 .arg = { [1] = { .scnprintf = SCA_FUTEX_OP, /* op */ },
616 [5] = { .scnprintf = SCA_FUTEX_VAL3, /* val3 */ }, }, },
614 { .name = "futimesat", 617 { .name = "futimesat",
615 .arg = { [0] = { .scnprintf = SCA_FDAT, /* fd */ }, }, }, 618 .arg = { [0] = { .scnprintf = SCA_FDAT, /* fd */ }, }, },
616 { .name = "getitimer", 619 { .name = "getitimer",
@@ -622,6 +625,7 @@ static struct syscall_fmt {
622 .arg = { [2] = { .scnprintf = SCA_GETRANDOM_FLAGS, /* flags */ }, }, }, 625 .arg = { [2] = { .scnprintf = SCA_GETRANDOM_FLAGS, /* flags */ }, }, },
623 { .name = "getrlimit", 626 { .name = "getrlimit",
624 .arg = { [0] = STRARRAY(resource, rlimit_resources), }, }, 627 .arg = { [0] = STRARRAY(resource, rlimit_resources), }, },
628 { .name = "gettid", .errpid = true, },
625 { .name = "ioctl", 629 { .name = "ioctl",
626 .arg = { 630 .arg = {
627#if defined(__i386__) || defined(__x86_64__) 631#if defined(__i386__) || defined(__x86_64__)
@@ -819,7 +823,7 @@ static size_t fprintf_duration(unsigned long t, bool calculated, FILE *fp)
819 size_t printed = fprintf(fp, "("); 823 size_t printed = fprintf(fp, "(");
820 824
821 if (!calculated) 825 if (!calculated)
822 printed += fprintf(fp, " ? "); 826 printed += fprintf(fp, " ");
823 else if (duration >= 1.0) 827 else if (duration >= 1.0)
824 printed += color_fprintf(fp, PERF_COLOR_RED, "%6.3f ms", duration); 828 printed += color_fprintf(fp, PERF_COLOR_RED, "%6.3f ms", duration);
825 else if (duration >= 0.01) 829 else if (duration >= 0.01)
@@ -1554,10 +1558,9 @@ static void thread__update_stats(struct thread_trace *ttrace,
1554 update_stats(stats, duration); 1558 update_stats(stats, duration);
1555} 1559}
1556 1560
1557static int trace__printf_interrupted_entry(struct trace *trace, struct perf_sample *sample) 1561static int trace__printf_interrupted_entry(struct trace *trace)
1558{ 1562{
1559 struct thread_trace *ttrace; 1563 struct thread_trace *ttrace;
1560 u64 duration;
1561 size_t printed; 1564 size_t printed;
1562 1565
1563 if (trace->current == NULL) 1566 if (trace->current == NULL)
@@ -1568,15 +1571,30 @@ static int trace__printf_interrupted_entry(struct trace *trace, struct perf_samp
1568 if (!ttrace->entry_pending) 1571 if (!ttrace->entry_pending)
1569 return 0; 1572 return 0;
1570 1573
1571 duration = sample->time - ttrace->entry_time; 1574 printed = trace__fprintf_entry_head(trace, trace->current, 0, false, ttrace->entry_time, trace->output);
1572
1573 printed = trace__fprintf_entry_head(trace, trace->current, duration, true, ttrace->entry_time, trace->output);
1574 printed += fprintf(trace->output, "%-70s) ...\n", ttrace->entry_str); 1575 printed += fprintf(trace->output, "%-70s) ...\n", ttrace->entry_str);
1575 ttrace->entry_pending = false; 1576 ttrace->entry_pending = false;
1576 1577
1577 return printed; 1578 return printed;
1578} 1579}
1579 1580
1581static int trace__fprintf_sample(struct trace *trace, struct perf_evsel *evsel,
1582 struct perf_sample *sample, struct thread *thread)
1583{
1584 int printed = 0;
1585
1586 if (trace->print_sample) {
1587 double ts = (double)sample->time / NSEC_PER_MSEC;
1588
1589 printed += fprintf(trace->output, "%22s %10.3f %s %d/%d [%d]\n",
1590 perf_evsel__name(evsel), ts,
1591 thread__comm_str(thread),
1592 sample->pid, sample->tid, sample->cpu);
1593 }
1594
1595 return printed;
1596}
1597
1580static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, 1598static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
1581 union perf_event *event __maybe_unused, 1599 union perf_event *event __maybe_unused,
1582 struct perf_sample *sample) 1600 struct perf_sample *sample)
@@ -1597,6 +1615,8 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
1597 if (ttrace == NULL) 1615 if (ttrace == NULL)
1598 goto out_put; 1616 goto out_put;
1599 1617
1618 trace__fprintf_sample(trace, evsel, sample, thread);
1619
1600 args = perf_evsel__sc_tp_ptr(evsel, args, sample); 1620 args = perf_evsel__sc_tp_ptr(evsel, args, sample);
1601 1621
1602 if (ttrace->entry_str == NULL) { 1622 if (ttrace->entry_str == NULL) {
@@ -1606,7 +1626,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
1606 } 1626 }
1607 1627
1608 if (!(trace->duration_filter || trace->summary_only || trace->min_stack)) 1628 if (!(trace->duration_filter || trace->summary_only || trace->min_stack))
1609 trace__printf_interrupted_entry(trace, sample); 1629 trace__printf_interrupted_entry(trace);
1610 1630
1611 ttrace->entry_time = sample->time; 1631 ttrace->entry_time = sample->time;
1612 msg = ttrace->entry_str; 1632 msg = ttrace->entry_str;
@@ -1641,9 +1661,12 @@ static int trace__resolve_callchain(struct trace *trace, struct perf_evsel *evse
1641 struct callchain_cursor *cursor) 1661 struct callchain_cursor *cursor)
1642{ 1662{
1643 struct addr_location al; 1663 struct addr_location al;
1664 int max_stack = evsel->attr.sample_max_stack ?
1665 evsel->attr.sample_max_stack :
1666 trace->max_stack;
1644 1667
1645 if (machine__resolve(trace->host, &al, sample) < 0 || 1668 if (machine__resolve(trace->host, &al, sample) < 0 ||
1646 thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, trace->max_stack)) 1669 thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack))
1647 return -1; 1670 return -1;
1648 1671
1649 return 0; 1672 return 0;
@@ -1659,6 +1682,14 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_sample *sam
1659 return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, trace->output); 1682 return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, trace->output);
1660} 1683}
1661 1684
1685static const char *errno_to_name(struct perf_evsel *evsel, int err)
1686{
1687 struct perf_env *env = perf_evsel__env(evsel);
1688 const char *arch_name = perf_env__arch(env);
1689
1690 return arch_syscalls__strerrno(arch_name, err);
1691}
1692
1662static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, 1693static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
1663 union perf_event *event __maybe_unused, 1694 union perf_event *event __maybe_unused,
1664 struct perf_sample *sample) 1695 struct perf_sample *sample)
@@ -1679,6 +1710,8 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
1679 if (ttrace == NULL) 1710 if (ttrace == NULL)
1680 goto out_put; 1711 goto out_put;
1681 1712
1713 trace__fprintf_sample(trace, evsel, sample, thread);
1714
1682 if (trace->summary) 1715 if (trace->summary)
1683 thread__update_stats(ttrace, id, sample); 1716 thread__update_stats(ttrace, id, sample);
1684 1717
@@ -1729,7 +1762,7 @@ signed_print:
1729errno_print: { 1762errno_print: {
1730 char bf[STRERR_BUFSIZE]; 1763 char bf[STRERR_BUFSIZE];
1731 const char *emsg = str_error_r(-ret, bf, sizeof(bf)), 1764 const char *emsg = str_error_r(-ret, bf, sizeof(bf)),
1732 *e = audit_errno_to_name(-ret); 1765 *e = errno_to_name(evsel, -ret);
1733 1766
1734 fprintf(trace->output, ") = -1 %s %s", e, emsg); 1767 fprintf(trace->output, ") = -1 %s %s", e, emsg);
1735 } 1768 }
@@ -1910,7 +1943,7 @@ static int trace__event_handler(struct trace *trace, struct perf_evsel *evsel,
1910 } 1943 }
1911 } 1944 }
1912 1945
1913 trace__printf_interrupted_entry(trace, sample); 1946 trace__printf_interrupted_entry(trace);
1914 trace__fprintf_tstamp(trace, sample->time, trace->output); 1947 trace__fprintf_tstamp(trace, sample->time, trace->output);
1915 1948
1916 if (trace->trace_syscalls) 1949 if (trace->trace_syscalls)
@@ -2221,6 +2254,9 @@ static int trace__add_syscall_newtp(struct trace *trace)
2221 if (perf_evsel__init_sc_tp_uint_field(sys_exit, ret)) 2254 if (perf_evsel__init_sc_tp_uint_field(sys_exit, ret))
2222 goto out_delete_sys_exit; 2255 goto out_delete_sys_exit;
2223 2256
2257 perf_evsel__config_callchain(sys_enter, &trace->opts, &callchain_param);
2258 perf_evsel__config_callchain(sys_exit, &trace->opts, &callchain_param);
2259
2224 perf_evlist__add(evlist, sys_enter); 2260 perf_evlist__add(evlist, sys_enter);
2225 perf_evlist__add(evlist, sys_exit); 2261 perf_evlist__add(evlist, sys_exit);
2226 2262
@@ -2317,6 +2353,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2317 pgfault_maj = perf_evsel__new_pgfault(PERF_COUNT_SW_PAGE_FAULTS_MAJ); 2353 pgfault_maj = perf_evsel__new_pgfault(PERF_COUNT_SW_PAGE_FAULTS_MAJ);
2318 if (pgfault_maj == NULL) 2354 if (pgfault_maj == NULL)
2319 goto out_error_mem; 2355 goto out_error_mem;
2356 perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param);
2320 perf_evlist__add(evlist, pgfault_maj); 2357 perf_evlist__add(evlist, pgfault_maj);
2321 } 2358 }
2322 2359
@@ -2324,6 +2361,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2324 pgfault_min = perf_evsel__new_pgfault(PERF_COUNT_SW_PAGE_FAULTS_MIN); 2361 pgfault_min = perf_evsel__new_pgfault(PERF_COUNT_SW_PAGE_FAULTS_MIN);
2325 if (pgfault_min == NULL) 2362 if (pgfault_min == NULL)
2326 goto out_error_mem; 2363 goto out_error_mem;
2364 perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param);
2327 perf_evlist__add(evlist, pgfault_min); 2365 perf_evlist__add(evlist, pgfault_min);
2328 } 2366 }
2329 2367
@@ -2344,45 +2382,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2344 goto out_delete_evlist; 2382 goto out_delete_evlist;
2345 } 2383 }
2346 2384
2347 perf_evlist__config(evlist, &trace->opts, NULL); 2385 perf_evlist__config(evlist, &trace->opts, &callchain_param);
2348
2349 if (callchain_param.enabled) {
2350 bool use_identifier = false;
2351
2352 if (trace->syscalls.events.sys_exit) {
2353 perf_evsel__config_callchain(trace->syscalls.events.sys_exit,
2354 &trace->opts, &callchain_param);
2355 use_identifier = true;
2356 }
2357
2358 if (pgfault_maj) {
2359 perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param);
2360 use_identifier = true;
2361 }
2362
2363 if (pgfault_min) {
2364 perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param);
2365 use_identifier = true;
2366 }
2367
2368 if (use_identifier) {
2369 /*
2370 * Now we have evsels with different sample_ids, use
2371 * PERF_SAMPLE_IDENTIFIER to map from sample to evsel
2372 * from a fixed position in each ring buffer record.
2373 *
2374 * As of this the changeset introducing this comment, this
2375 * isn't strictly needed, as the fields that can come before
2376 * PERF_SAMPLE_ID are all used, but we'll probably disable
2377 * some of those for things like copying the payload of
2378 * pointer syscall arguments, and for vfs_getname we don't
2379 * need PERF_SAMPLE_ADDR and PERF_SAMPLE_IP, so do this
2380 * here as a warning we need to use PERF_SAMPLE_IDENTIFIER.
2381 */
2382 perf_evlist__set_sample_bit(evlist, IDENTIFIER);
2383 perf_evlist__reset_sample_bit(evlist, ID);
2384 }
2385 }
2386 2386
2387 signal(SIGCHLD, sig_handler); 2387 signal(SIGCHLD, sig_handler);
2388 signal(SIGINT, sig_handler); 2388 signal(SIGINT, sig_handler);
@@ -2437,7 +2437,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2437 if (err < 0) 2437 if (err < 0)
2438 goto out_error_apply_filters; 2438 goto out_error_apply_filters;
2439 2439
2440 err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false); 2440 err = perf_evlist__mmap(evlist, trace->opts.mmap_pages);
2441 if (err < 0) 2441 if (err < 0)
2442 goto out_error_mmap; 2442 goto out_error_mmap;
2443 2443
@@ -2455,6 +2455,18 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2455 trace->multiple_threads = thread_map__pid(evlist->threads, 0) == -1 || 2455 trace->multiple_threads = thread_map__pid(evlist->threads, 0) == -1 ||
2456 evlist->threads->nr > 1 || 2456 evlist->threads->nr > 1 ||
2457 perf_evlist__first(evlist)->attr.inherit; 2457 perf_evlist__first(evlist)->attr.inherit;
2458
2459 /*
2460 * Now that we already used evsel->attr to ask the kernel to setup the
2461 * events, lets reuse evsel->attr.sample_max_stack as the limit in
2462 * trace__resolve_callchain(), allowing per-event max-stack settings
2463 * to override an explicitely set --max-stack global setting.
2464 */
2465 evlist__for_each_entry(evlist, evsel) {
2466 if ((evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) &&
2467 evsel->attr.sample_max_stack == 0)
2468 evsel->attr.sample_max_stack = trace->max_stack;
2469 }
2458again: 2470again:
2459 before = trace->nr_events; 2471 before = trace->nr_events;
2460 2472
@@ -3046,6 +3058,8 @@ int cmd_trace(int argc, const char **argv)
3046 "Set the maximum stack depth when parsing the callchain, " 3058 "Set the maximum stack depth when parsing the callchain, "
3047 "anything beyond the specified depth will be ignored. " 3059 "anything beyond the specified depth will be ignored. "
3048 "Default: kernel.perf_event_max_stack or " __stringify(PERF_MAX_STACK_DEPTH)), 3060 "Default: kernel.perf_event_max_stack or " __stringify(PERF_MAX_STACK_DEPTH)),
3061 OPT_BOOLEAN(0, "print-sample", &trace.print_sample,
3062 "print the PERF_RECORD_SAMPLE PERF_SAMPLE_ info, for debugging"),
3049 OPT_UINTEGER(0, "proc-map-timeout", &trace.opts.proc_map_timeout, 3063 OPT_UINTEGER(0, "proc-map-timeout", &trace.opts.proc_map_timeout,
3050 "per thread proc mmap processing timeout in ms"), 3064 "per thread proc mmap processing timeout in ms"),
3051 OPT_UINTEGER('D', "delay", &trace.opts.initial_delay, 3065 OPT_UINTEGER('D', "delay", &trace.opts.initial_delay,
@@ -3097,8 +3111,9 @@ int cmd_trace(int argc, const char **argv)
3097 } 3111 }
3098 3112
3099#ifdef HAVE_DWARF_UNWIND_SUPPORT 3113#ifdef HAVE_DWARF_UNWIND_SUPPORT
3100 if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled && trace.trace_syscalls) 3114 if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled) {
3101 record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false); 3115 record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false);
3116 }
3102#endif 3117#endif
3103 3118
3104 if (callchain_param.enabled) { 3119 if (callchain_param.enabled) {
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 3e64f10b6d66..51abdb0a4047 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -33,21 +33,30 @@ arch/s390/include/uapi/asm/kvm.h
33arch/s390/include/uapi/asm/kvm_perf.h 33arch/s390/include/uapi/asm/kvm_perf.h
34arch/s390/include/uapi/asm/ptrace.h 34arch/s390/include/uapi/asm/ptrace.h
35arch/s390/include/uapi/asm/sie.h 35arch/s390/include/uapi/asm/sie.h
36arch/s390/include/uapi/asm/unistd.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/alpha/include/uapi/asm/errno.h
40arch/mips/include/asm/errno.h
41arch/mips/include/uapi/asm/errno.h
42arch/parisc/include/uapi/asm/errno.h
43arch/powerpc/include/uapi/asm/errno.h
44arch/sparc/include/uapi/asm/errno.h
45arch/x86/include/uapi/asm/errno.h
38include/asm-generic/bitops/arch_hweight.h 46include/asm-generic/bitops/arch_hweight.h
39include/asm-generic/bitops/const_hweight.h 47include/asm-generic/bitops/const_hweight.h
40include/asm-generic/bitops/__fls.h 48include/asm-generic/bitops/__fls.h
41include/asm-generic/bitops/fls.h 49include/asm-generic/bitops/fls.h
42include/asm-generic/bitops/fls64.h 50include/asm-generic/bitops/fls64.h
43include/linux/coresight-pmu.h 51include/linux/coresight-pmu.h
52include/uapi/asm-generic/errno.h
53include/uapi/asm-generic/errno-base.h
44include/uapi/asm-generic/ioctls.h 54include/uapi/asm-generic/ioctls.h
45include/uapi/asm-generic/mman-common.h 55include/uapi/asm-generic/mman-common.h
46' 56'
47 57
48check () { 58check () {
49 file=$1 59 file=$1
50 opts="--ignore-blank-lines --ignore-space-change"
51 60
52 shift 61 shift
53 while [ -n "$*" ]; do 62 while [ -n "$*" ]; do
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh
index 345f5d6e9ed5..fdf75d45efff 100644
--- a/tools/perf/perf-completion.sh
+++ b/tools/perf/perf-completion.sh
@@ -162,8 +162,37 @@ __perf_main ()
162 # List possible events for -e option 162 # List possible events for -e option
163 elif [[ $prev == @("-e"|"--event") && 163 elif [[ $prev == @("-e"|"--event") &&
164 $prev_skip_opts == @(record|stat|top) ]]; then 164 $prev_skip_opts == @(record|stat|top) ]]; then
165 evts=$($cmd list --raw-dump) 165
166 __perfcomp_colon "$evts" "$cur" 166 local cur1=${COMP_WORDS[COMP_CWORD]}
167 local raw_evts=$($cmd list --raw-dump)
168 local arr s tmp result
169
170 if [[ "$cur1" == */* && ${cur1#*/} =~ ^[A-Z] ]]; then
171 OLD_IFS="$IFS"
172 IFS=" "
173 arr=($raw_evts)
174 IFS="$OLD_IFS"
175
176 for s in ${arr[@]}
177 do
178 if [[ "$s" == *cpu/* ]]; then
179 tmp=${s#*cpu/}
180 result=$result" ""cpu/"${tmp^^}
181 else
182 result=$result" "$s
183 fi
184 done
185
186 evts=${result}" "$(ls /sys/bus/event_source/devices/cpu/events)
187 else
188 evts=${raw_evts}" "$(ls /sys/bus/event_source/devices/cpu/events)
189 fi
190
191 if [[ "$cur1" == , ]]; then
192 __perfcomp_colon "$evts" ""
193 else
194 __perfcomp_colon "$evts" "$cur1"
195 fi
167 else 196 else
168 # List subcommands for perf commands 197 # List subcommands for perf commands
169 if [[ $prev_skip_opts == @(kvm|kmem|mem|lock|sched| 198 if [[ $prev_skip_opts == @(kvm|kmem|mem|lock|sched|
@@ -246,11 +275,21 @@ fi
246type perf &>/dev/null && 275type perf &>/dev/null &&
247_perf() 276_perf()
248{ 277{
278 if [[ "$COMP_WORDBREAKS" != *,* ]]; then
279 COMP_WORDBREAKS="${COMP_WORDBREAKS},"
280 export COMP_WORDBREAKS
281 fi
282
283 if [[ "$COMP_WORDBREAKS" == *:* ]]; then
284 COMP_WORDBREAKS="${COMP_WORDBREAKS/:/}"
285 export COMP_WORDBREAKS
286 fi
287
249 local cur words cword prev 288 local cur words cword prev
250 if [ $preload_get_comp_words_by_ref = "true" ]; then 289 if [ $preload_get_comp_words_by_ref = "true" ]; then
251 _get_comp_words_by_ref -n =: cur words cword prev 290 _get_comp_words_by_ref -n =:, cur words cword prev
252 else 291 else
253 __perf_get_comp_words_by_ref -n =: cur words cword prev 292 __perf_get_comp_words_by_ref -n =:, cur words cword prev
254 fi 293 fi
255 __perf_main 294 __perf_main
256} && 295} &&
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 62b13518bc6e..1b3fc8ec0fa2 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -73,7 +73,7 @@ static struct cmd_struct commands[] = {
73 { "lock", cmd_lock, 0 }, 73 { "lock", cmd_lock, 0 },
74 { "kvm", cmd_kvm, 0 }, 74 { "kvm", cmd_kvm, 0 },
75 { "test", cmd_test, 0 }, 75 { "test", cmd_test, 0 },
76#ifdef HAVE_LIBAUDIT_SUPPORT 76#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
77 { "trace", cmd_trace, 0 }, 77 { "trace", cmd_trace, 0 },
78#endif 78#endif
79 { "inject", cmd_inject, 0 }, 79 { "inject", cmd_inject, 0 },
@@ -485,7 +485,7 @@ int main(int argc, const char **argv)
485 argv[0] = cmd; 485 argv[0] = cmd;
486 } 486 }
487 if (strstarts(cmd, "trace")) { 487 if (strstarts(cmd, "trace")) {
488#ifdef HAVE_LIBAUDIT_SUPPORT 488#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
489 setup_path(); 489 setup_path();
490 argv[0] = "trace"; 490 argv[0] = "trace";
491 return cmd_trace(argc, argv); 491 return cmd_trace(argc, argv);
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 2357f4ccc9c7..cfe46236a5e5 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -50,6 +50,7 @@ struct record_opts {
50 bool sample_time_set; 50 bool sample_time_set;
51 bool sample_cpu; 51 bool sample_cpu;
52 bool period; 52 bool period;
53 bool period_set;
53 bool running_time; 54 bool running_time;
54 bool full_auxtrace; 55 bool full_auxtrace;
55 bool auxtrace_snapshot_mode; 56 bool auxtrace_snapshot_mode;
diff --git a/tools/perf/pmu-events/arch/arm64/cavium/thunderx2-imp-def.json b/tools/perf/pmu-events/arch/arm64/cavium/thunderx2-imp-def.json
new file mode 100644
index 000000000000..2db45c40ebc7
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cavium/thunderx2-imp-def.json
@@ -0,0 +1,62 @@
1[
2 {
3 "PublicDescription": "Attributable Level 1 data cache access, read",
4 "EventCode": "0x40",
5 "EventName": "l1d_cache_rd",
6 "BriefDescription": "L1D cache read",
7 },
8 {
9 "PublicDescription": "Attributable Level 1 data cache access, write ",
10 "EventCode": "0x41",
11 "EventName": "l1d_cache_wr",
12 "BriefDescription": "L1D cache write",
13 },
14 {
15 "PublicDescription": "Attributable Level 1 data cache refill, read",
16 "EventCode": "0x42",
17 "EventName": "l1d_cache_refill_rd",
18 "BriefDescription": "L1D cache refill read",
19 },
20 {
21 "PublicDescription": "Attributable Level 1 data cache refill, write",
22 "EventCode": "0x43",
23 "EventName": "l1d_cache_refill_wr",
24 "BriefDescription": "L1D refill write",
25 },
26 {
27 "PublicDescription": "Attributable Level 1 data TLB refill, read",
28 "EventCode": "0x4C",
29 "EventName": "l1d_tlb_refill_rd",
30 "BriefDescription": "L1D tlb refill read",
31 },
32 {
33 "PublicDescription": "Attributable Level 1 data TLB refill, write",
34 "EventCode": "0x4D",
35 "EventName": "l1d_tlb_refill_wr",
36 "BriefDescription": "L1D tlb refill write",
37 },
38 {
39 "PublicDescription": "Attributable Level 1 data or unified TLB access, read",
40 "EventCode": "0x4E",
41 "EventName": "l1d_tlb_rd",
42 "BriefDescription": "L1D tlb read",
43 },
44 {
45 "PublicDescription": "Attributable Level 1 data or unified TLB access, write",
46 "EventCode": "0x4F",
47 "EventName": "l1d_tlb_wr",
48 "BriefDescription": "L1D tlb write",
49 },
50 {
51 "PublicDescription": "Bus access read",
52 "EventCode": "0x60",
53 "EventName": "bus_access_rd",
54 "BriefDescription": "Bus access read",
55 },
56 {
57 "PublicDescription": "Bus access write",
58 "EventCode": "0x61",
59 "EventName": "bus_access_wr",
60 "BriefDescription": "Bus access write",
61 }
62]
diff --git a/tools/perf/pmu-events/arch/arm64/mapfile.csv b/tools/perf/pmu-events/arch/arm64/mapfile.csv
new file mode 100644
index 000000000000..219d6756134e
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/mapfile.csv
@@ -0,0 +1,15 @@
1# Format:
2# MIDR,Version,JSON/file/pathname,Type
3#
4# where
5# MIDR Processor version
6# Variant[23:20] and Revision [3:0] should be zero.
7# Version could be used to track version of of JSON file
8# but currently unused.
9# JSON/file/pathname is the path to JSON file, relative
10# to tools/perf/pmu-events/arch/arm64/.
11# Type is core, uncore etc
12#
13#
14#Family-model,Version,Filename,EventType
150x00000000420f5160,v1,cavium,core
diff --git a/tools/perf/pmu-events/arch/powerpc/mapfile.csv b/tools/perf/pmu-events/arch/powerpc/mapfile.csv
index a0f3a11ca19f..229150e7ab7d 100644
--- a/tools/perf/pmu-events/arch/powerpc/mapfile.csv
+++ b/tools/perf/pmu-events/arch/powerpc/mapfile.csv
@@ -13,13 +13,5 @@
13# 13#
14 14
15# Power8 entries 15# Power8 entries
16004b0000,1,power8,core 16004[bcd][[:xdigit:]]{4},1,power8,core
17004b0201,1,power8,core 17004e[[:xdigit:]]{4},1,power9,core
18004c0000,1,power8,core
19004d0000,1,power8,core
20004d0100,1,power8,core
21004d0200,1,power8,core
22004c0100,1,power8,core
23004e0100,1,power9,core
24004e0200,1,power9,core
25004e1200,1,power9,core
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/cache.json b/tools/perf/pmu-events/arch/powerpc/power9/cache.json
index 18f6645f2897..7945c5196c43 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/cache.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/cache.json
@@ -125,11 +125,6 @@
125 "BriefDescription": "Finish stall because the NTF instruction was a larx waiting to be satisfied" 125 "BriefDescription": "Finish stall because the NTF instruction was a larx waiting to be satisfied"
126 }, 126 },
127 {, 127 {,
128 "EventCode": "0x3006C",
129 "EventName": "PM_RUN_CYC_SMT2_MODE",
130 "BriefDescription": "Cycles in which this thread's run latch is set and the core is in SMT2 mode"
131 },
132 {,
133 "EventCode": "0x1C058", 128 "EventCode": "0x1C058",
134 "EventName": "PM_DTLB_MISS_16G", 129 "EventName": "PM_DTLB_MISS_16G",
135 "BriefDescription": "Data TLB Miss page size 16G" 130 "BriefDescription": "Data TLB Miss page size 16G"
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/frontend.json b/tools/perf/pmu-events/arch/powerpc/power9/frontend.json
index c63a919eda98..bd8361b5fd6a 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/frontend.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/frontend.json
@@ -1,10 +1,5 @@
1[ 1[
2 {, 2 {,
3 "EventCode": "0x3E15C",
4 "EventName": "PM_MRK_L2_TM_ST_ABORT_SISTER",
5 "BriefDescription": "TM marked store abort for this thread"
6 },
7 {,
8 "EventCode": "0x25044", 3 "EventCode": "0x25044",
9 "EventName": "PM_IPTEG_FROM_L31_MOD", 4 "EventName": "PM_IPTEG_FROM_L31_MOD",
10 "BriefDescription": "A Page Table Entry was loaded into the TLB with Modified (M) data from another core's L3 on the same chip due to a instruction side request" 5 "BriefDescription": "A Page Table Entry was loaded into the TLB with Modified (M) data from another core's L3 on the same chip due to a instruction side request"
@@ -369,4 +364,4 @@
369 "EventName": "PM_IPTEG_FROM_L31_ECO_MOD", 364 "EventName": "PM_IPTEG_FROM_L31_ECO_MOD",
370 "BriefDescription": "A Page Table Entry was loaded into the TLB with Modified (M) data from another core's ECO L3 on the same chip due to a instruction side request" 365 "BriefDescription": "A Page Table Entry was loaded into the TLB with Modified (M) data from another core's ECO L3 on the same chip due to a instruction side request"
371 } 366 }
372] 367] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/marked.json b/tools/perf/pmu-events/arch/powerpc/power9/marked.json
index b9df54fb37e3..22f9f32060a8 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/marked.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/marked.json
@@ -1,10 +1,5 @@
1[ 1[
2 {, 2 {,
3 "EventCode": "0x3C052",
4 "EventName": "PM_DATA_SYS_PUMP_MPRED",
5 "BriefDescription": "Final Pump Scope (system) mispredicted. Either the original scope was too small (Chip/Group) or the original scope was System and it should have been smaller. Counts for a demand load"
6 },
7 {,
8 "EventCode": "0x3013E", 3 "EventCode": "0x3013E",
9 "EventName": "PM_MRK_STALL_CMPLU_CYC", 4 "EventName": "PM_MRK_STALL_CMPLU_CYC",
10 "BriefDescription": "Number of cycles the marked instruction is experiencing a stall while it is next to complete (NTC)" 5 "BriefDescription": "Number of cycles the marked instruction is experiencing a stall while it is next to complete (NTC)"
@@ -255,6 +250,11 @@
255 "BriefDescription": "A Page Directory Entry was reloaded to a level 1 page walk cache from the core's L3 data cache" 250 "BriefDescription": "A Page Directory Entry was reloaded to a level 1 page walk cache from the core's L3 data cache"
256 }, 251 },
257 {, 252 {,
253 "EventCode": "0x3C052",
254 "EventName": "PM_DATA_SYS_PUMP_MPRED",
255 "BriefDescription": "Final Pump Scope (system) mispredicted. Either the original scope was too small (Chip/Group) or the original scope was System and it should have been smaller. Counts for a demand load"
256 },
257 {,
258 "EventCode": "0x4D142", 258 "EventCode": "0x4D142",
259 "EventName": "PM_MRK_DATA_FROM_L3", 259 "EventName": "PM_MRK_DATA_FROM_L3",
260 "BriefDescription": "The processor's data cache was reloaded from local core's L3 due to a marked load" 260 "BriefDescription": "The processor's data cache was reloaded from local core's L3 due to a marked load"
@@ -435,21 +435,6 @@
435 "BriefDescription": "ITLB Reloaded. Counts 1 per ITLB miss for HPT but multiple for radix depending on number of levels traveresed" 435 "BriefDescription": "ITLB Reloaded. Counts 1 per ITLB miss for HPT but multiple for radix depending on number of levels traveresed"
436 }, 436 },
437 {, 437 {,
438 "EventCode": "0x2D024",
439 "EventName": "PM_RADIX_PWC_L2_HIT",
440 "BriefDescription": "A radix translation attempt missed in the TLB but hit on both the first and second levels of page walk cache."
441 },
442 {,
443 "EventCode": "0x3F056",
444 "EventName": "PM_RADIX_PWC_L3_HIT",
445 "BriefDescription": "A radix translation attempt missed in the TLB but hit on the first, second, and third levels of page walk cache."
446 },
447 {,
448 "EventCode": "0x4E014",
449 "EventName": "PM_TM_TX_PASS_RUN_INST",
450 "BriefDescription": "Run instructions spent in successful transactions"
451 },
452 {,
453 "EventCode": "0x1E044", 438 "EventCode": "0x1E044",
454 "EventName": "PM_DPTEG_FROM_L3_NO_CONFLICT", 439 "EventName": "PM_DPTEG_FROM_L3_NO_CONFLICT",
455 "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 without conflict due to a data side request. When using Radix Page Translation, this count excludes PDE reloads. Only PTE reloads are included" 440 "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 without conflict due to a data side request. When using Radix Page Translation, this count excludes PDE reloads. Only PTE reloads are included"
@@ -644,4 +629,4 @@
644 "EventName": "PM_MRK_BR_MPRED_CMPL", 629 "EventName": "PM_MRK_BR_MPRED_CMPL",
645 "BriefDescription": "Marked Branch Mispredicted" 630 "BriefDescription": "Marked Branch Mispredicted"
646 } 631 }
647] 632] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/other.json b/tools/perf/pmu-events/arch/powerpc/power9/other.json
index 54cc3be00fc2..5ce312973f1e 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/other.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/other.json
@@ -80,6 +80,11 @@
80 "BriefDescription": "A radix translation attempt missed in the TLB and all levels of page walk cache." 80 "BriefDescription": "A radix translation attempt missed in the TLB and all levels of page walk cache."
81 }, 81 },
82 {, 82 {,
83 "EventCode": "0x26882",
84 "EventName": "PM_L2_DC_INV",
85 "BriefDescription": "D-cache invalidates sent over the reload bus to the core"
86 },
87 {,
83 "EventCode": "0x24048", 88 "EventCode": "0x24048",
84 "EventName": "PM_INST_FROM_LMEM", 89 "EventName": "PM_INST_FROM_LMEM",
85 "BriefDescription": "The processor's Instruction cache was reloaded from the local chip's Memory due to an instruction fetch (not prefetch)" 90 "BriefDescription": "The processor's Instruction cache was reloaded from the local chip's Memory due to an instruction fetch (not prefetch)"
@@ -95,11 +100,6 @@
95 "BriefDescription": "Number of TM transactions that passed" 100 "BriefDescription": "Number of TM transactions that passed"
96 }, 101 },
97 {, 102 {,
98 "EventCode": "0xD1A0",
99 "EventName": "PM_MRK_LSU_FLUSH_LHS",
100 "BriefDescription": "Effective Address alias flush : no EA match but Real Address match. If the data has not yet been returned for this load, the instruction will just be rejected, but if it has returned data, it will be flushed"
101 },
102 {,
103 "EventCode": "0xF088", 103 "EventCode": "0xF088",
104 "EventName": "PM_LSU0_STORE_REJECT", 104 "EventName": "PM_LSU0_STORE_REJECT",
105 "BriefDescription": "All internal store rejects cause the instruction to go back to the SRQ and go to sleep until woken up to try again after the condition has been met" 105 "BriefDescription": "All internal store rejects cause the instruction to go back to the SRQ and go to sleep until woken up to try again after the condition has been met"
@@ -127,7 +127,7 @@
127 {, 127 {,
128 "EventCode": "0xD08C", 128 "EventCode": "0xD08C",
129 "EventName": "PM_LSU2_LDMX_FIN", 129 "EventName": "PM_LSU2_LDMX_FIN",
130 "BriefDescription": "New P9 instruction LDMX. The definition of this new PMU event is (from the ldmx RFC02491): The thread has executed an ldmx instruction that accessed a doubleword that contains an effective address within an enabled section of the Load Monitored region. This event, therefore, should not occur if the FSCR has disabled the load monitored facility (FSCR[52]) or disabled the EBB facility (FSCR[56])" 130 "BriefDescription": "New P9 instruction LDMX. The definition of this new PMU event is (from the ldmx RFC02491): The thread has executed an ldmx instruction that accessed a doubleword that contains an effective address within an enabled section of the Load Monitored region. This event, therefore, should not occur if the FSCR has disabled the load monitored facility (FSCR[52]) or disabled the EBB facility (FSCR[56])."
131 }, 131 },
132 {, 132 {,
133 "EventCode": "0x300F8", 133 "EventCode": "0x300F8",
@@ -205,11 +205,6 @@
205 "BriefDescription": "Duration in cycles to reload with Modified (M) data from another core's ECO L3 on the same chip due to a marked load" 205 "BriefDescription": "Duration in cycles to reload with Modified (M) data from another core's ECO L3 on the same chip due to a marked load"
206 }, 206 },
207 {, 207 {,
208 "EventCode": "0xF0B4",
209 "EventName": "PM_DC_PREF_CONS_ALLOC",
210 "BriefDescription": "Prefetch stream allocated in the conservative phase by either the hardware prefetch mechanism or software prefetch"
211 },
212 {,
213 "EventCode": "0xF894", 208 "EventCode": "0xF894",
214 "EventName": "PM_LSU3_L1_CAM_CANCEL", 209 "EventName": "PM_LSU3_L1_CAM_CANCEL",
215 "BriefDescription": "ls3 l1 tm cam cancel" 210 "BriefDescription": "ls3 l1 tm cam cancel"
@@ -220,21 +215,11 @@
220 "BriefDescription": "Dispatch Flush: TLBIE" 215 "BriefDescription": "Dispatch Flush: TLBIE"
221 }, 216 },
222 {, 217 {,
223 "EventCode": "0xD1A4",
224 "EventName": "PM_MRK_LSU_FLUSH_SAO",
225 "BriefDescription": "A load-hit-load condition with Strong Address Ordering will have address compare disabled and flush"
226 },
227 {,
228 "EventCode": "0x4E11E", 218 "EventCode": "0x4E11E",
229 "EventName": "PM_MRK_DATA_FROM_DMEM_CYC", 219 "EventName": "PM_MRK_DATA_FROM_DMEM_CYC",
230 "BriefDescription": "Duration in cycles to reload from another chip's memory on the same Node or Group (Distant) due to a marked load" 220 "BriefDescription": "Duration in cycles to reload from another chip's memory on the same Node or Group (Distant) due to a marked load"
231 }, 221 },
232 {, 222 {,
233 "EventCode": "0x5894",
234 "EventName": "PM_LWSYNC",
235 "BriefDescription": "Lwsync instruction decoded and transferred"
236 },
237 {,
238 "EventCode": "0x14156", 223 "EventCode": "0x14156",
239 "EventName": "PM_MRK_DATA_FROM_L2_CYC", 224 "EventName": "PM_MRK_DATA_FROM_L2_CYC",
240 "BriefDescription": "Duration in cycles to reload from local core's L2 due to a marked load" 225 "BriefDescription": "Duration in cycles to reload from local core's L2 due to a marked load"
@@ -245,11 +230,6 @@
245 "BriefDescription": "Read clearing SC" 230 "BriefDescription": "Read clearing SC"
246 }, 231 },
247 {, 232 {,
248 "EventCode": "0x50A0",
249 "EventName": "PM_HWSYNC",
250 "BriefDescription": "Hwsync instruction decoded and transferred"
251 },
252 {,
253 "EventCode": "0x168B0", 233 "EventCode": "0x168B0",
254 "EventName": "PM_L3_P1_NODE_PUMP", 234 "EventName": "PM_L3_P1_NODE_PUMP",
255 "BriefDescription": "L3 PF sent with nodal scope port 1, counts even retried requests" 235 "BriefDescription": "L3 PF sent with nodal scope port 1, counts even retried requests"
@@ -265,6 +245,11 @@
265 "BriefDescription": "The processor's data cache was reloaded from local core's L2 with load hit store conflict due to a marked load" 245 "BriefDescription": "The processor's data cache was reloaded from local core's L2 with load hit store conflict due to a marked load"
266 }, 246 },
267 {, 247 {,
248 "EventCode": "0x468AE",
249 "EventName": "PM_L3_P3_CO_RTY",
250 "BriefDescription": "L3 CO received retry port 3 (memory only), every retry counted"
251 },
252 {,
268 "EventCode": "0x460A8", 253 "EventCode": "0x460A8",
269 "EventName": "PM_SN_HIT", 254 "EventName": "PM_SN_HIT",
270 "BriefDescription": "Any port snooper hit L3. Up to 4 can happen in a cycle but we only count 1" 255 "BriefDescription": "Any port snooper hit L3. Up to 4 can happen in a cycle but we only count 1"
@@ -280,11 +265,6 @@
280 "BriefDescription": "Prefetch stream allocated by the hardware prefetch mechanism" 265 "BriefDescription": "Prefetch stream allocated by the hardware prefetch mechanism"
281 }, 266 },
282 {, 267 {,
283 "EventCode": "0xF0BC",
284 "EventName": "PM_LS2_UNALIGNED_ST",
285 "BriefDescription": "Store instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the Store of that size. If the Store wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty"
286 },
287 {,
288 "EventCode": "0xD0AC", 268 "EventCode": "0xD0AC",
289 "EventName": "PM_SRQ_SYNC_CYC", 269 "EventName": "PM_SRQ_SYNC_CYC",
290 "BriefDescription": "A sync is in the S2Q (edge detect to count)" 270 "BriefDescription": "A sync is in the S2Q (edge detect to count)"
@@ -380,26 +360,11 @@
380 "BriefDescription": "Cycles in which this thread's run latch is set and the core is in SMT4 mode" 360 "BriefDescription": "Cycles in which this thread's run latch is set and the core is in SMT4 mode"
381 }, 361 },
382 {, 362 {,
383 "EventCode": "0x5088",
384 "EventName": "PM_DECODE_FUSION_OP_PRESERV",
385 "BriefDescription": "Destructive op operand preservation"
386 },
387 {,
388 "EventCode": "0x1D14E", 363 "EventCode": "0x1D14E",
389 "EventName": "PM_MRK_DATA_FROM_OFF_CHIP_CACHE_CYC", 364 "EventName": "PM_MRK_DATA_FROM_OFF_CHIP_CACHE_CYC",
390 "BriefDescription": "Duration in cycles to reload either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to a marked load" 365 "BriefDescription": "Duration in cycles to reload either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to a marked load"
391 }, 366 },
392 {, 367 {,
393 "EventCode": "0x509C",
394 "EventName": "PM_FORCED_NOP",
395 "BriefDescription": "Instruction was forced to execute as a nop because it was found to behave like a nop (have no effect) at decode time"
396 },
397 {,
398 "EventCode": "0xC098",
399 "EventName": "PM_LS2_UNALIGNED_LD",
400 "BriefDescription": "Load instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the load of that size. If the load wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty"
401 },
402 {,
403 "EventCode": "0x20058", 368 "EventCode": "0x20058",
404 "EventName": "PM_DARQ1_10_12_ENTRIES", 369 "EventName": "PM_DARQ1_10_12_ENTRIES",
405 "BriefDescription": "Cycles in which 10 or more DARQ1 entries (out of 12) are in use" 370 "BriefDescription": "Cycles in which 10 or more DARQ1 entries (out of 12) are in use"
@@ -435,11 +400,6 @@
435 "BriefDescription": "All internal store rejects cause the instruction to go back to the SRQ and go to sleep until woken up to try again after the condition has been met" 400 "BriefDescription": "All internal store rejects cause the instruction to go back to the SRQ and go to sleep until woken up to try again after the condition has been met"
436 }, 401 },
437 {, 402 {,
438 "EventCode": "0x4505E",
439 "EventName": "PM_FLOP_CMPL",
440 "BriefDescription": "Floating Point Operation Finished"
441 },
442 {,
443 "EventCode": "0x1D144", 403 "EventCode": "0x1D144",
444 "EventName": "PM_MRK_DATA_FROM_L3_DISP_CONFLICT", 404 "EventName": "PM_MRK_DATA_FROM_L3_DISP_CONFLICT",
445 "BriefDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to a marked load" 405 "BriefDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to a marked load"
@@ -480,14 +440,9 @@
480 "BriefDescription": "XL-form branch was mispredicted due to the predicted target address missing from EAT. The EAT forces a mispredict in this case since there is no predicated target to validate. This is a rare case that may occur when the EAT is full and a branch is issued" 440 "BriefDescription": "XL-form branch was mispredicted due to the predicted target address missing from EAT. The EAT forces a mispredict in this case since there is no predicated target to validate. This is a rare case that may occur when the EAT is full and a branch is issued"
481 }, 441 },
482 {, 442 {,
483 "EventCode": "0xC094", 443 "EventCode": "0x460AE",
484 "EventName": "PM_LS0_UNALIGNED_LD", 444 "EventName": "PM_L3_P2_CO_RTY",
485 "BriefDescription": "Load instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the load of that size. If the load wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty" 445 "BriefDescription": "L3 CO received retry port 2 (memory only), every retry counted"
486 },
487 {,
488 "EventCode": "0xF8BC",
489 "EventName": "PM_LS3_UNALIGNED_ST",
490 "BriefDescription": "Store instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the Store of that size. If the Store wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty"
491 }, 446 },
492 {, 447 {,
493 "EventCode": "0x58B0", 448 "EventCode": "0x58B0",
@@ -505,11 +460,6 @@
505 "BriefDescription": "TM Store (fav or non-fav) ran into conflict (failed)" 460 "BriefDescription": "TM Store (fav or non-fav) ran into conflict (failed)"
506 }, 461 },
507 {, 462 {,
508 "EventCode": "0xD998",
509 "EventName": "PM_MRK_LSU_FLUSH_EMSH",
510 "BriefDescription": "An ERAT miss was detected after a set-p hit. Erat tracker indicates fail due to tlbmiss and the instruction gets flushed because the instruction was working on the wrong address"
511 },
512 {,
513 "EventCode": "0xF8A0", 463 "EventCode": "0xF8A0",
514 "EventName": "PM_NON_DATA_STORE", 464 "EventName": "PM_NON_DATA_STORE",
515 "BriefDescription": "All ops that drain from s2q to L2 and contain no data" 465 "BriefDescription": "All ops that drain from s2q to L2 and contain no data"
@@ -525,11 +475,6 @@
525 "BriefDescription": "Unconditional Branch Completed. HW branch prediction was not used for this branch. This can be an I-form branch, a B-form branch with BO-field set to branch always, or a B-form branch which was covenrted to a Resolve." 475 "BriefDescription": "Unconditional Branch Completed. HW branch prediction was not used for this branch. This can be an I-form branch, a B-form branch with BO-field set to branch always, or a B-form branch which was covenrted to a Resolve."
526 }, 476 },
527 {, 477 {,
528 "EventCode": "0x1F056",
529 "EventName": "PM_RADIX_PWC_L1_HIT",
530 "BriefDescription": "A radix translation attempt missed in the TLB and only the first level page walk cache was a hit."
531 },
532 {,
533 "EventCode": "0xF8A8", 478 "EventCode": "0xF8A8",
534 "EventName": "PM_DC_PREF_FUZZY_CONF", 479 "EventName": "PM_DC_PREF_FUZZY_CONF",
535 "BriefDescription": "A demand load referenced a line in an active fuzzy prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software.Fuzzy stream confirm (out of order effects, or pf cant keep up)" 480 "BriefDescription": "A demand load referenced a line in an active fuzzy prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software.Fuzzy stream confirm (out of order effects, or pf cant keep up)"
@@ -545,6 +490,11 @@
545 "BriefDescription": "Load tm L1 miss" 490 "BriefDescription": "Load tm L1 miss"
546 }, 491 },
547 {, 492 {,
493 "EventCode": "0xC880",
494 "EventName": "PM_LS1_LD_VECTOR_FIN",
495 "BriefDescription": ""
496 },
497 {,
548 "EventCode": "0x2894", 498 "EventCode": "0x2894",
549 "EventName": "PM_TM_OUTER_TEND", 499 "EventName": "PM_TM_OUTER_TEND",
550 "BriefDescription": "Completion time outer tend" 500 "BriefDescription": "Completion time outer tend"
@@ -565,21 +515,11 @@
565 "BriefDescription": "Marked derat reload (miss) for any page size" 515 "BriefDescription": "Marked derat reload (miss) for any page size"
566 }, 516 },
567 {, 517 {,
568 "EventCode": "0x160A0",
569 "EventName": "PM_L3_PF_MISS_L3",
570 "BriefDescription": "L3 PF missed in L3"
571 },
572 {,
573 "EventCode": "0x1C04A", 518 "EventCode": "0x1C04A",
574 "EventName": "PM_DATA_FROM_RL2L3_SHR", 519 "EventName": "PM_DATA_FROM_RL2L3_SHR",
575 "BriefDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to a demand load" 520 "BriefDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to a demand load"
576 }, 521 },
577 {, 522 {,
578 "EventCode": "0xD99C",
579 "EventName": "PM_MRK_LSU_FLUSH_UE",
580 "BriefDescription": "Correctable ECC error on reload data, reported at critical data forward time"
581 },
582 {,
583 "EventCode": "0x268B0", 523 "EventCode": "0x268B0",
584 "EventName": "PM_L3_P1_GRP_PUMP", 524 "EventName": "PM_L3_P1_GRP_PUMP",
585 "BriefDescription": "L3 PF sent with grp scope port 1, counts even retried requests" 525 "BriefDescription": "L3 PF sent with grp scope port 1, counts even retried requests"
@@ -630,11 +570,6 @@
630 "BriefDescription": "addrs only req to L2 only on the first one,Indication that Load footprint is not expanding" 570 "BriefDescription": "addrs only req to L2 only on the first one,Indication that Load footprint is not expanding"
631 }, 571 },
632 {, 572 {,
633 "EventCode": "0x5884",
634 "EventName": "PM_DECODE_LANES_NOT_AVAIL",
635 "BriefDescription": "Decode has something to transmit but dispatch lanes are not available"
636 },
637 {,
638 "EventCode": "0x3C042", 573 "EventCode": "0x3C042",
639 "EventName": "PM_DATA_FROM_L3_DISP_CONFLICT", 574 "EventName": "PM_DATA_FROM_L3_DISP_CONFLICT",
640 "BriefDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to a demand load" 575 "BriefDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to a demand load"
@@ -690,9 +625,9 @@
690 "BriefDescription": "False LHS match detected" 625 "BriefDescription": "False LHS match detected"
691 }, 626 },
692 {, 627 {,
693 "EventCode": "0xD9A4", 628 "EventCode": "0xF0B0",
694 "EventName": "PM_MRK_LSU_FLUSH_LARX_STCX", 629 "EventName": "PM_L3_LD_PREF",
695 "BriefDescription": "A larx is flushed because an older larx has an LMQ reservation for the same thread. A stcx is flushed because an older stcx is in the LMQ. The flush happens when the older larx/stcx relaunches" 630 "BriefDescription": "L3 load prefetch, sourced from a hardware or software stream, was sent to the nest"
696 }, 631 },
697 {, 632 {,
698 "EventCode": "0x4D012", 633 "EventCode": "0x4D012",
@@ -715,9 +650,9 @@
715 "BriefDescription": "All successful Ld/St dispatches for this thread that were an L2 miss (excludes i_l2mru_tch_reqs)" 650 "BriefDescription": "All successful Ld/St dispatches for this thread that were an L2 miss (excludes i_l2mru_tch_reqs)"
716 }, 651 },
717 {, 652 {,
718 "EventCode": "0xF8B8", 653 "EventCode": "0x160A0",
719 "EventName": "PM_LS1_UNALIGNED_ST", 654 "EventName": "PM_L3_PF_MISS_L3",
720 "BriefDescription": "Store instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the Store of that size. If the Store wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty" 655 "BriefDescription": "L3 PF missed in L3"
721 }, 656 },
722 {, 657 {,
723 "EventCode": "0x408C", 658 "EventCode": "0x408C",
@@ -765,11 +700,6 @@
765 "BriefDescription": "Completion time nested tend" 700 "BriefDescription": "Completion time nested tend"
766 }, 701 },
767 {, 702 {,
768 "EventCode": "0x36084",
769 "EventName": "PM_L2_RCST_DISP",
770 "BriefDescription": "All D-side store dispatch attempts for this thread"
771 },
772 {,
773 "EventCode": "0x368A0", 703 "EventCode": "0x368A0",
774 "EventName": "PM_L3_PF_OFF_CHIP_CACHE", 704 "EventName": "PM_L3_PF_OFF_CHIP_CACHE",
775 "BriefDescription": "L3 PF from Off chip cache" 705 "BriefDescription": "L3 PF from Off chip cache"
@@ -830,11 +760,6 @@
830 "BriefDescription": "Rotating sample of 16 snoop valids" 760 "BriefDescription": "Rotating sample of 16 snoop valids"
831 }, 761 },
832 {, 762 {,
833 "EventCode": "0x16084",
834 "EventName": "PM_L2_RCLD_DISP",
835 "BriefDescription": "All I-or-D side load dispatch attempts for this thread (excludes i_l2mru_tch_reqs)"
836 },
837 {,
838 "EventCode": "0x1608C", 763 "EventCode": "0x1608C",
839 "EventName": "PM_RC0_BUSY", 764 "EventName": "PM_RC0_BUSY",
840 "BriefDescription": "RC mach 0 Busy. Used by PMU to sample ave RC lifetime (mach0 used as sample point)" 765 "BriefDescription": "RC mach 0 Busy. Used by PMU to sample ave RC lifetime (mach0 used as sample point)"
@@ -842,7 +767,7 @@
842 {, 767 {,
843 "EventCode": "0x36082", 768 "EventCode": "0x36082",
844 "EventName": "PM_L2_LD_DISP", 769 "EventName": "PM_L2_LD_DISP",
845 "BriefDescription": "All successful I-or-D side load dispatches for this thread (excludes i_l2mru_tch_reqs)." 770 "BriefDescription": "All successful I-or-D side load dispatches for this thread (excludes i_l2mru_tch_reqs)"
846 }, 771 },
847 {, 772 {,
848 "EventCode": "0xF8B0", 773 "EventCode": "0xF8B0",
@@ -905,11 +830,6 @@
905 "BriefDescription": "Instruction prefetch requests" 830 "BriefDescription": "Instruction prefetch requests"
906 }, 831 },
907 {, 832 {,
908 "EventCode": "0xC898",
909 "EventName": "PM_LS3_UNALIGNED_LD",
910 "BriefDescription": "Load instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the load of that size. If the load wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty"
911 },
912 {,
913 "EventCode": "0x488C", 833 "EventCode": "0x488C",
914 "EventName": "PM_IC_PREF_WRITE", 834 "EventName": "PM_IC_PREF_WRITE",
915 "BriefDescription": "Instruction prefetch written into IL1" 835 "BriefDescription": "Instruction prefetch written into IL1"
@@ -1017,7 +937,7 @@
1017 {, 937 {,
1018 "EventCode": "0x3E05E", 938 "EventCode": "0x3E05E",
1019 "EventName": "PM_L3_CO_MEPF", 939 "EventName": "PM_L3_CO_MEPF",
1020 "BriefDescription": "L3 castouts in Mepf state for this thread" 940 "BriefDescription": "L3 CO of line in Mep state (includes casthrough to memory). The Mepf state indicates that a line was brought in to satisfy an L3 prefetch request"
1021 }, 941 },
1022 {, 942 {,
1023 "EventCode": "0x460A2", 943 "EventCode": "0x460A2",
@@ -1205,11 +1125,6 @@
1205 "BriefDescription": "Non transactional conflict from LSU, gets reported to TEXASR" 1125 "BriefDescription": "Non transactional conflict from LSU, gets reported to TEXASR"
1206 }, 1126 },
1207 {, 1127 {,
1208 "EventCode": "0xD198",
1209 "EventName": "PM_MRK_LSU_FLUSH_ATOMIC",
1210 "BriefDescription": "Quad-word loads (lq) are considered atomic because they always span at least 2 slices. If a snoop or store from another thread changes the data the load is accessing between the 2 or 3 pieces of the lq instruction, the lq will be flushed"
1211 },
1212 {,
1213 "EventCode": "0x201E0", 1128 "EventCode": "0x201E0",
1214 "EventName": "PM_MRK_DATA_FROM_MEMORY", 1129 "EventName": "PM_MRK_DATA_FROM_MEMORY",
1215 "BriefDescription": "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load" 1130 "BriefDescription": "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load"
@@ -1295,11 +1210,6 @@
1295 "BriefDescription": "Ict empty for this thread due to dispatch holds because the History Buffer was full. Could be GPR/VSR/VMR/FPR/CR/XVF; CR; XVF (XER/VSCR/FPSCR)" 1210 "BriefDescription": "Ict empty for this thread due to dispatch holds because the History Buffer was full. Could be GPR/VSR/VMR/FPR/CR/XVF; CR; XVF (XER/VSCR/FPSCR)"
1296 }, 1211 },
1297 {, 1212 {,
1298 "EventCode": "0xC894",
1299 "EventName": "PM_LS1_UNALIGNED_LD",
1300 "BriefDescription": "Load instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the load of that size. If the load wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty"
1301 },
1302 {,
1303 "EventCode": "0x360A2", 1213 "EventCode": "0x360A2",
1304 "EventName": "PM_L3_L2_CO_HIT", 1214 "EventName": "PM_L3_L2_CO_HIT",
1305 "BriefDescription": "L2 CO hits" 1215 "BriefDescription": "L2 CO hits"
@@ -1325,11 +1235,6 @@
1325 "BriefDescription": "L2 Castouts - Shared (Tx,Sx)" 1235 "BriefDescription": "L2 Castouts - Shared (Tx,Sx)"
1326 }, 1236 },
1327 {, 1237 {,
1328 "EventCode": "0xD884",
1329 "EventName": "PM_LSU3_SET_MPRED",
1330 "BriefDescription": "Set prediction(set-p) miss. The entry was not found in the Set prediction table"
1331 },
1332 {,
1333 "EventCode": "0x26092", 1238 "EventCode": "0x26092",
1334 "EventName": "PM_L2_LD_MISS_64B", 1239 "EventName": "PM_L2_LD_MISS_64B",
1335 "BriefDescription": "All successful D-side load dispatches that were an L2 miss (NOT Sx,Tx,Mx) for this thread and the RC calculated the request should be for 64B(i.e., M=1)" 1240 "BriefDescription": "All successful D-side load dispatches that were an L2 miss (NOT Sx,Tx,Mx) for this thread and the RC calculated the request should be for 64B(i.e., M=1)"
@@ -1362,12 +1267,12 @@
1362 {, 1267 {,
1363 "EventCode": "0xD8A8", 1268 "EventCode": "0xD8A8",
1364 "EventName": "PM_ISLB_MISS", 1269 "EventName": "PM_ISLB_MISS",
1365 "BriefDescription": "Instruction SLB miss - Total of all segment sizes" 1270 "BriefDescription": "Instruction SLB Miss - Total of all segment sizes"
1366 }, 1271 },
1367 {, 1272 {,
1368 "EventCode": "0xD19C", 1273 "EventCode": "0x368AE",
1369 "EventName": "PM_MRK_LSU_FLUSH_RELAUNCH_MISS", 1274 "EventName": "PM_L3_P1_CO_RTY",
1370 "BriefDescription": "If a load that has already returned data and has to relaunch for any reason then gets a miss (erat, setp, data cache), it will often be flushed at relaunch time because the data might be inconsistent" 1275 "BriefDescription": "L3 CO received retry port 1 (memory only), every retry counted"
1371 }, 1276 },
1372 {, 1277 {,
1373 "EventCode": "0x260A2", 1278 "EventCode": "0x260A2",
@@ -1385,6 +1290,11 @@
1385 "BriefDescription": "Completion stall because the ISU is updating the TEXASR to keep track of the nested tbegin. This is a short delay, and it includes ROT" 1290 "BriefDescription": "Completion stall because the ISU is updating the TEXASR to keep track of the nested tbegin. This is a short delay, and it includes ROT"
1386 }, 1291 },
1387 {, 1292 {,
1293 "EventCode": "0xC084",
1294 "EventName": "PM_LS2_LD_VECTOR_FIN",
1295 "BriefDescription": ""
1296 },
1297 {,
1388 "EventCode": "0x1608E", 1298 "EventCode": "0x1608E",
1389 "EventName": "PM_ST_CAUSED_FAIL", 1299 "EventName": "PM_ST_CAUSED_FAIL",
1390 "BriefDescription": "Non-TM Store caused any thread to fail" 1300 "BriefDescription": "Non-TM Store caused any thread to fail"
@@ -1410,11 +1320,6 @@
1410 "BriefDescription": "Continuous 16 cycle (2to1) window where this signals rotates thru sampling each CO machine busy. PMU uses this wave to then do 16 cyc count to sample total number of machs running" 1320 "BriefDescription": "Continuous 16 cycle (2to1) window where this signals rotates thru sampling each CO machine busy. PMU uses this wave to then do 16 cyc count to sample total number of machs running"
1411 }, 1321 },
1412 {, 1322 {,
1413 "EventCode": "0xD084",
1414 "EventName": "PM_LSU2_SET_MPRED",
1415 "BriefDescription": "Set prediction(set-p) miss. The entry was not found in the Set prediction table"
1416 },
1417 {,
1418 "EventCode": "0x48B8", 1323 "EventCode": "0x48B8",
1419 "EventName": "PM_BR_MPRED_TAKEN_TA", 1324 "EventName": "PM_BR_MPRED_TAKEN_TA",
1420 "BriefDescription": "Conditional Branch Completed that was Mispredicted due to the Target Address Prediction from the Count Cache or Link Stack. Only XL-form branches that resolved Taken set this event." 1325 "BriefDescription": "Conditional Branch Completed that was Mispredicted due to the Target Address Prediction from the Count Cache or Link Stack. Only XL-form branches that resolved Taken set this event."
@@ -1450,29 +1355,24 @@
1450 "BriefDescription": "A demand load referenced a line in an active strided prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software." 1355 "BriefDescription": "A demand load referenced a line in an active strided prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software."
1451 }, 1356 },
1452 {, 1357 {,
1358 "EventCode": "0x36084",
1359 "EventName": "PM_L2_RCST_DISP",
1360 "BriefDescription": "All D-side store dispatch attempts for this thread"
1361 },
1362 {,
1453 "EventCode": "0x45054", 1363 "EventCode": "0x45054",
1454 "EventName": "PM_FMA_CMPL", 1364 "EventName": "PM_FMA_CMPL",
1455 "BriefDescription": "two flops operation completed (fmadd, fnmadd, fmsub, fnmsub) Scalar instructions only. " 1365 "BriefDescription": "two flops operation completed (fmadd, fnmadd, fmsub, fnmsub) Scalar instructions only. "
1456 }, 1366 },
1457 {, 1367 {,
1458 "EventCode": "0x5090",
1459 "EventName": "PM_SHL_ST_DISABLE",
1460 "BriefDescription": "Store-Hit-Load Table Read Hit with entry Disabled (entry was disabled due to the entry shown to not prevent the flush)"
1461 },
1462 {,
1463 "EventCode": "0x201E8", 1368 "EventCode": "0x201E8",
1464 "EventName": "PM_THRESH_EXC_512", 1369 "EventName": "PM_THRESH_EXC_512",
1465 "BriefDescription": "Threshold counter exceeded a value of 512" 1370 "BriefDescription": "Threshold counter exceeded a value of 512"
1466 }, 1371 },
1467 {, 1372 {,
1468 "EventCode": "0x5084",
1469 "EventName": "PM_DECODE_FUSION_EXT_ADD",
1470 "BriefDescription": "32-bit extended addition"
1471 },
1472 {,
1473 "EventCode": "0x36080", 1373 "EventCode": "0x36080",
1474 "EventName": "PM_L2_INST", 1374 "EventName": "PM_L2_INST",
1475 "BriefDescription": "All successful I-side dispatches for this thread (excludes i_l2mru_tch reqs)." 1375 "BriefDescription": "All successful I-side dispatches for this thread (excludes i_l2mru_tch reqs)"
1476 }, 1376 },
1477 {, 1377 {,
1478 "EventCode": "0x3504C", 1378 "EventCode": "0x3504C",
@@ -1555,21 +1455,11 @@
1555 "BriefDescription": "Memory Read With Intent to Modify for this thread" 1455 "BriefDescription": "Memory Read With Intent to Modify for this thread"
1556 }, 1456 },
1557 {, 1457 {,
1558 "EventCode": "0x26882",
1559 "EventName": "PM_L2_DC_INV",
1560 "BriefDescription": "D-cache invalidates sent over the reload bus to the core"
1561 },
1562 {,
1563 "EventCode": "0xC090", 1458 "EventCode": "0xC090",
1564 "EventName": "PM_LSU_STCX", 1459 "EventName": "PM_LSU_STCX",
1565 "BriefDescription": "STCX sent to nest, i.e. total" 1460 "BriefDescription": "STCX sent to nest, i.e. total"
1566 }, 1461 },
1567 {, 1462 {,
1568 "EventCode": "0xD080",
1569 "EventName": "PM_LSU0_SET_MPRED",
1570 "BriefDescription": "Set prediction(set-p) miss. The entry was not found in the Set prediction table"
1571 },
1572 {,
1573 "EventCode": "0x2C120", 1463 "EventCode": "0x2C120",
1574 "EventName": "PM_MRK_DATA_FROM_L2_NO_CONFLICT", 1464 "EventName": "PM_MRK_DATA_FROM_L2_NO_CONFLICT",
1575 "BriefDescription": "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load" 1465 "BriefDescription": "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load"
@@ -1610,11 +1500,6 @@
1610 "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L2 without conflict due to a instruction side request" 1500 "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L2 without conflict due to a instruction side request"
1611 }, 1501 },
1612 {, 1502 {,
1613 "EventCode": "0xD9A0",
1614 "EventName": "PM_MRK_LSU_FLUSH_LHL_SHL",
1615 "BriefDescription": "The instruction was flushed because of a sequential load/store consistency. If a load or store hits on an older load that has either been snooped (for loads) or has stale data (for stores)."
1616 },
1617 {,
1618 "EventCode": "0x35042", 1503 "EventCode": "0x35042",
1619 "EventName": "PM_IPTEG_FROM_L3_DISP_CONFLICT", 1504 "EventName": "PM_IPTEG_FROM_L3_DISP_CONFLICT",
1620 "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 with dispatch conflict due to a instruction side request" 1505 "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 with dispatch conflict due to a instruction side request"
@@ -1692,7 +1577,7 @@
1692 {, 1577 {,
1693 "EventCode": "0x2001A", 1578 "EventCode": "0x2001A",
1694 "EventName": "PM_NTC_ALL_FIN", 1579 "EventName": "PM_NTC_ALL_FIN",
1695 "BriefDescription": "Cycles after all instructions have finished to group completed" 1580 "BriefDescription": "Cycles after instruction finished to instruction completed."
1696 }, 1581 },
1697 {, 1582 {,
1698 "EventCode": "0x3005A", 1583 "EventCode": "0x3005A",
@@ -1710,6 +1595,11 @@
1710 "BriefDescription": "ls1 l1 tm cam cancel" 1595 "BriefDescription": "ls1 l1 tm cam cancel"
1711 }, 1596 },
1712 {, 1597 {,
1598 "EventCode": "0x268AE",
1599 "EventName": "PM_L3_P3_PF_RTY",
1600 "BriefDescription": "L3 PF received retry port 3, every retry counted"
1601 },
1602 {,
1713 "EventCode": "0xE884", 1603 "EventCode": "0xE884",
1714 "EventName": "PM_LS1_ERAT_MISS_PREF", 1604 "EventName": "PM_LS1_ERAT_MISS_PREF",
1715 "BriefDescription": "LS1 Erat miss due to prefetch" 1605 "BriefDescription": "LS1 Erat miss due to prefetch"
@@ -1742,7 +1632,7 @@
1742 {, 1632 {,
1743 "EventCode": "0x160B6", 1633 "EventCode": "0x160B6",
1744 "EventName": "PM_L3_WI0_BUSY", 1634 "EventName": "PM_L3_WI0_BUSY",
1745 "BriefDescription": "Rotating sample of 8 WI valid" 1635 "BriefDescription": "Rotating sample of 8 WI valid (duplicate)"
1746 }, 1636 },
1747 {, 1637 {,
1748 "EventCode": "0x368AC", 1638 "EventCode": "0x368AC",
@@ -1790,9 +1680,9 @@
1790 "BriefDescription": "L2 guess system (VGS or RNS) and guess was correct (ie data beyond-group)" 1680 "BriefDescription": "L2 guess system (VGS or RNS) and guess was correct (ie data beyond-group)"
1791 }, 1681 },
1792 {, 1682 {,
1793 "EventCode": "0x589C", 1683 "EventCode": "0x260AE",
1794 "EventName": "PM_PTESYNC", 1684 "EventName": "PM_L3_P2_PF_RTY",
1795 "BriefDescription": "ptesync instruction counted when the instruction is decoded and transmitted" 1685 "BriefDescription": "L3 PF received retry port 2, every retry counted"
1796 }, 1686 },
1797 {, 1687 {,
1798 "EventCode": "0x26086", 1688 "EventCode": "0x26086",
@@ -1825,6 +1715,11 @@
1825 "BriefDescription": "Store-Hit-Load Table Read Hit with entry Enabled" 1715 "BriefDescription": "Store-Hit-Load Table Read Hit with entry Enabled"
1826 }, 1716 },
1827 {, 1717 {,
1718 "EventCode": "0x46882",
1719 "EventName": "PM_L2_ST_HIT",
1720 "BriefDescription": "All successful D-side store dispatches for this thread that were L2 hits"
1721 },
1722 {,
1828 "EventCode": "0x360AC", 1723 "EventCode": "0x360AC",
1829 "EventName": "PM_L3_SN0_BUSY", 1724 "EventName": "PM_L3_SN0_BUSY",
1830 "BriefDescription": "Lifetime, sample of snooper machine 0 valid" 1725 "BriefDescription": "Lifetime, sample of snooper machine 0 valid"
@@ -1845,11 +1740,6 @@
1845 "BriefDescription": "All successful D-Side Store dispatches that were an L2 miss for this thread" 1740 "BriefDescription": "All successful D-Side Store dispatches that were an L2 miss for this thread"
1846 }, 1741 },
1847 {, 1742 {,
1848 "EventCode": "0xF8B4",
1849 "EventName": "PM_DC_PREF_XCONS_ALLOC",
1850 "BriefDescription": "Prefetch stream allocated in the Ultra conservative phase by either the hardware prefetch mechanism or software prefetch"
1851 },
1852 {,
1853 "EventCode": "0x35048", 1743 "EventCode": "0x35048",
1854 "EventName": "PM_IPTEG_FROM_DL2L3_SHR", 1744 "EventName": "PM_IPTEG_FROM_DL2L3_SHR",
1855 "BriefDescription": "A Page Table Entry was loaded into the TLB with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a instruction side request" 1745 "BriefDescription": "A Page Table Entry was loaded into the TLB with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a instruction side request"
@@ -1970,11 +1860,6 @@
1970 "BriefDescription": "Cycles thread running at priority level 2 or 3" 1860 "BriefDescription": "Cycles thread running at priority level 2 or 3"
1971 }, 1861 },
1972 {, 1862 {,
1973 "EventCode": "0x10134",
1974 "EventName": "PM_MRK_ST_DONE_L2",
1975 "BriefDescription": "marked store completed in L2 ( RC machine done)"
1976 },
1977 {,
1978 "EventCode": "0x368B2", 1863 "EventCode": "0x368B2",
1979 "EventName": "PM_L3_GRP_GUESS_WRONG_HIGH", 1864 "EventName": "PM_L3_GRP_GUESS_WRONG_HIGH",
1980 "BriefDescription": "Initial scope=group (GS or NNS) but data from local node. Prediction too high" 1865 "BriefDescription": "Initial scope=group (GS or NNS) but data from local node. Prediction too high"
@@ -2005,11 +1890,6 @@
2005 "BriefDescription": "L2 guess grp (GS or NNS) and guess was not correct (ie data on-chip OR beyond-group)" 1890 "BriefDescription": "L2 guess grp (GS or NNS) and guess was not correct (ie data on-chip OR beyond-group)"
2006 }, 1891 },
2007 {, 1892 {,
2008 "EventCode": "0x368AE",
2009 "EventName": "PM_L3_P1_CO_RTY",
2010 "BriefDescription": "L3 CO received retry port 1 (memory only), every retry counted"
2011 },
2012 {,
2013 "EventCode": "0xC0AC", 1893 "EventCode": "0xC0AC",
2014 "EventName": "PM_LSU_FLUSH_EMSH", 1894 "EventName": "PM_LSU_FLUSH_EMSH",
2015 "BriefDescription": "An ERAT miss was detected after a set-p hit. Erat tracker indicates fail due to tlbmiss and the instruction gets flushed because the instruction was working on the wrong address" 1895 "BriefDescription": "An ERAT miss was detected after a set-p hit. Erat tracker indicates fail due to tlbmiss and the instruction gets flushed because the instruction was working on the wrong address"
@@ -2035,11 +1915,6 @@
2035 "BriefDescription": "RC requests that were on group (aka nodel) pump attempts" 1915 "BriefDescription": "RC requests that were on group (aka nodel) pump attempts"
2036 }, 1916 },
2037 {, 1917 {,
2038 "EventCode": "0xF0B0",
2039 "EventName": "PM_L3_LD_PREF",
2040 "BriefDescription": "L3 load prefetch, sourced from a hardware or software stream, was sent to the nest"
2041 },
2042 {,
2043 "EventCode": "0x16080", 1918 "EventCode": "0x16080",
2044 "EventName": "PM_L2_LD", 1919 "EventName": "PM_L2_LD",
2045 "BriefDescription": "All successful D-side Load dispatches for this thread (L2 miss + L2 hits)" 1920 "BriefDescription": "All successful D-side Load dispatches for this thread (L2 miss + L2 hits)"
@@ -2050,6 +1925,11 @@
2050 "BriefDescription": "Math flop instruction completed" 1925 "BriefDescription": "Math flop instruction completed"
2051 }, 1926 },
2052 {, 1927 {,
1928 "EventCode": "0xC080",
1929 "EventName": "PM_LS0_LD_VECTOR_FIN",
1930 "BriefDescription": ""
1931 },
1932 {,
2053 "EventCode": "0x368B0", 1933 "EventCode": "0x368B0",
2054 "EventName": "PM_L3_P1_SYS_PUMP", 1934 "EventName": "PM_L3_P1_SYS_PUMP",
2055 "BriefDescription": "L3 PF sent with sys scope port 1, counts even retried requests" 1935 "BriefDescription": "L3 PF sent with sys scope port 1, counts even retried requests"
@@ -2120,11 +2000,6 @@
2120 "BriefDescription": "Conditional Branch Completed in which the HW correctly predicted the direction as taken. Counted at completion time" 2000 "BriefDescription": "Conditional Branch Completed in which the HW correctly predicted the direction as taken. Counted at completion time"
2121 }, 2001 },
2122 {, 2002 {,
2123 "EventCode": "0xF0B8",
2124 "EventName": "PM_LS0_UNALIGNED_ST",
2125 "BriefDescription": "Store instructions whose data crosses a double-word boundary, which causes it to require an additional slice than than what normally would be required of the Store of that size. If the Store wraps from slice 3 to slice 0, thee is an additional 3-cycle penalty"
2126 },
2127 {,
2128 "EventCode": "0x20132", 2003 "EventCode": "0x20132",
2129 "EventName": "PM_MRK_DFU_FIN", 2004 "EventName": "PM_MRK_DFU_FIN",
2130 "BriefDescription": "Decimal Unit marked Instruction Finish" 2005 "BriefDescription": "Decimal Unit marked Instruction Finish"
@@ -2140,6 +2015,11 @@
2140 "BriefDescription": "Effective Address alias flush : no EA match but Real Address match. If the data has not yet been returned for this load, the instruction will just be rejected, but if it has returned data, it will be flushed" 2015 "BriefDescription": "Effective Address alias flush : no EA match but Real Address match. If the data has not yet been returned for this load, the instruction will just be rejected, but if it has returned data, it will be flushed"
2141 }, 2016 },
2142 {, 2017 {,
2018 "EventCode": "0x16084",
2019 "EventName": "PM_L2_RCLD_DISP",
2020 "BriefDescription": "All I-or-D side load dispatch attempts for this thread (excludes i_l2mru_tch_reqs)"
2021 },
2022 {,
2143 "EventCode": "0x3F150", 2023 "EventCode": "0x3F150",
2144 "EventName": "PM_MRK_ST_DRAIN_TO_L2DISP_CYC", 2024 "EventName": "PM_MRK_ST_DRAIN_TO_L2DISP_CYC",
2145 "BriefDescription": "cycles to drain st from core to L2" 2025 "BriefDescription": "cycles to drain st from core to L2"
@@ -2225,11 +2105,6 @@
2225 "BriefDescription": "Prefetch Canceled due to page boundary" 2105 "BriefDescription": "Prefetch Canceled due to page boundary"
2226 }, 2106 },
2227 {, 2107 {,
2228 "EventCode": "0xF09C",
2229 "EventName": "PM_SLB_TABLEWALK_CYC",
2230 "BriefDescription": "Cycles when a tablewalk is pending on this thread on the SLB table"
2231 },
2232 {,
2233 "EventCode": "0x460AA", 2108 "EventCode": "0x460AA",
2234 "EventName": "PM_L3_P0_CO_L31", 2109 "EventName": "PM_L3_P0_CO_L31",
2235 "BriefDescription": "L3 CO to L3.1 (LCO) port 0 with or without data" 2110 "BriefDescription": "L3 CO to L3.1 (LCO) port 0 with or without data"
@@ -2247,10 +2122,10 @@
2247 {, 2122 {,
2248 "EventCode": "0x46082", 2123 "EventCode": "0x46082",
2249 "EventName": "PM_L2_ST_DISP", 2124 "EventName": "PM_L2_ST_DISP",
2250 "BriefDescription": "All successful D-side store dispatches for this thread " 2125 "BriefDescription": "All successful D-side store dispatches for this thread (L2 miss + L2 hits)"
2251 }, 2126 },
2252 {, 2127 {,
2253 "EventCode": "0x4609E", 2128 "EventCode": "0x36880",
2254 "EventName": "PM_L2_INST_MISS", 2129 "EventName": "PM_L2_INST_MISS",
2255 "BriefDescription": "All successful I-side dispatches that were an L2 miss for this thread (excludes i_l2mru_tch reqs)" 2130 "BriefDescription": "All successful I-side dispatches that were an L2 miss for this thread (excludes i_l2mru_tch reqs)"
2256 }, 2131 },
@@ -2340,9 +2215,9 @@
2340 "BriefDescription": "All ISU rejects" 2215 "BriefDescription": "All ISU rejects"
2341 }, 2216 },
2342 {, 2217 {,
2343 "EventCode": "0x46882", 2218 "EventCode": "0xC884",
2344 "EventName": "PM_L2_ST_HIT", 2219 "EventName": "PM_LS3_LD_VECTOR_FIN",
2345 "BriefDescription": "All successful D-side store dispatches for this thread that were L2 hits" 2220 "BriefDescription": ""
2346 }, 2221 },
2347 {, 2222 {,
2348 "EventCode": "0x360A8", 2223 "EventCode": "0x360A8",
@@ -2360,11 +2235,6 @@
2360 "BriefDescription": "Asserts when a i=1 store op is sent to the nest. No record of issue pipe (LS0/LS1) is maintained so this is for both pipes. Probably don't need separate LS0 and LS1" 2235 "BriefDescription": "Asserts when a i=1 store op is sent to the nest. No record of issue pipe (LS0/LS1) is maintained so this is for both pipes. Probably don't need separate LS0 and LS1"
2361 }, 2236 },
2362 {, 2237 {,
2363 "EventCode": "0xD880",
2364 "EventName": "PM_LSU1_SET_MPRED",
2365 "BriefDescription": "Set prediction(set-p) miss. The entry was not found in the Set prediction table"
2366 },
2367 {,
2368 "EventCode": "0xD0B8", 2238 "EventCode": "0xD0B8",
2369 "EventName": "PM_LSU_LMQ_FULL_CYC", 2239 "EventName": "PM_LSU_LMQ_FULL_CYC",
2370 "BriefDescription": "Counts the number of cycles the LMQ is full" 2240 "BriefDescription": "Counts the number of cycles the LMQ is full"
@@ -2389,4 +2259,4 @@
2389 "EventName": "PM_L3_PF_USAGE", 2259 "EventName": "PM_L3_PF_USAGE",
2390 "BriefDescription": "Rotating sample of 32 PF actives" 2260 "BriefDescription": "Rotating sample of 32 PF actives"
2391 } 2261 }
2392] 2262] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/pipeline.json b/tools/perf/pmu-events/arch/powerpc/power9/pipeline.json
index bc2db636dabf..5af1abbe82c4 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/pipeline.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/pipeline.json
@@ -125,6 +125,11 @@
125 "BriefDescription": "Overflow from counter 5" 125 "BriefDescription": "Overflow from counter 5"
126 }, 126 },
127 {, 127 {,
128 "EventCode": "0x4505E",
129 "EventName": "PM_FLOP_CMPL",
130 "BriefDescription": "Floating Point Operation Finished"
131 },
132 {,
128 "EventCode": "0x2C018", 133 "EventCode": "0x2C018",
129 "EventName": "PM_CMPLU_STALL_DMISS_L21_L31", 134 "EventName": "PM_CMPLU_STALL_DMISS_L21_L31",
130 "BriefDescription": "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3)" 135 "BriefDescription": "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3)"
@@ -390,11 +395,6 @@
390 "BriefDescription": "Ict empty for this thread due to branch mispred" 395 "BriefDescription": "Ict empty for this thread due to branch mispred"
391 }, 396 },
392 {, 397 {,
393 "EventCode": "0x3405E",
394 "EventName": "PM_IFETCH_THROTTLE",
395 "BriefDescription": "Cycles in which Instruction fetch throttle was active."
396 },
397 {,
398 "EventCode": "0x1F148", 398 "EventCode": "0x1F148",
399 "EventName": "PM_MRK_DPTEG_FROM_ON_CHIP_CACHE", 399 "EventName": "PM_MRK_DPTEG_FROM_ON_CHIP_CACHE",
400 "BriefDescription": "A Page Table Entry was loaded into the TLB either shared or modified data from another core's L2/L3 on the same chip due to a marked data side request.. When using Radix Page Translation, this count excludes PDE reloads. Only PTE reloads are included" 400 "BriefDescription": "A Page Table Entry was loaded into the TLB either shared or modified data from another core's L2/L3 on the same chip due to a marked data side request.. When using Radix Page Translation, this count excludes PDE reloads. Only PTE reloads are included"
@@ -422,7 +422,7 @@
422 {, 422 {,
423 "EventCode": "0xD0A8", 423 "EventCode": "0xD0A8",
424 "EventName": "PM_DSLB_MISS", 424 "EventName": "PM_DSLB_MISS",
425 "BriefDescription": "Data SLB Miss - Total of all segment sizes" 425 "BriefDescription": "gate_and(sd_pc_c0_comp_valid AND sd_pc_c0_comp_thread(0:1)=tid,sd_pc_c0_comp_ppc_count(0:3)) + gate_and(sd_pc_c1_comp_valid AND sd_pc_c1_comp_thread(0:1)=tid,sd_pc_c1_comp_ppc_count(0:3))"
426 }, 426 },
427 {, 427 {,
428 "EventCode": "0x4C058", 428 "EventCode": "0x4C058",
@@ -549,4 +549,4 @@
549 "EventName": "PM_MRK_DATA_FROM_L21_SHR_CYC", 549 "EventName": "PM_MRK_DATA_FROM_L21_SHR_CYC",
550 "BriefDescription": "Duration in cycles to reload with Shared (S) data from another core's L2 on the same chip due to a marked load" 550 "BriefDescription": "Duration in cycles to reload with Shared (S) data from another core's L2 on the same chip due to a marked load"
551 } 551 }
552] 552] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/pmc.json b/tools/perf/pmu-events/arch/powerpc/power9/pmc.json
index 3ef8a10aac86..d0b89f930567 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/pmc.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/pmc.json
@@ -119,4 +119,4 @@
119 "EventName": "PM_1FLOP_CMPL", 119 "EventName": "PM_1FLOP_CMPL",
120 "BriefDescription": "one flop (fadd, fmul, fsub, fcmp, fsel, fabs, fnabs, fres, fsqrte, fneg) operation completed" 120 "BriefDescription": "one flop (fadd, fmul, fsub, fcmp, fsel, fabs, fnabs, fres, fsqrte, fneg) operation completed"
121 } 121 }
122] 122] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/powerpc/power9/translation.json b/tools/perf/pmu-events/arch/powerpc/power9/translation.json
index 8c0f12024afa..bc8e03d7a6b0 100644
--- a/tools/perf/pmu-events/arch/powerpc/power9/translation.json
+++ b/tools/perf/pmu-events/arch/powerpc/power9/translation.json
@@ -90,11 +90,6 @@
90 "BriefDescription": "stcx failed" 90 "BriefDescription": "stcx failed"
91 }, 91 },
92 {, 92 {,
93 "EventCode": "0x20112",
94 "EventName": "PM_MRK_NTF_FIN",
95 "BriefDescription": "Marked next to finish instruction finished"
96 },
97 {,
98 "EventCode": "0x300F0", 93 "EventCode": "0x300F0",
99 "EventName": "PM_ST_MISS_L1", 94 "EventName": "PM_ST_MISS_L1",
100 "BriefDescription": "Store Missed L1" 95 "BriefDescription": "Store Missed L1"
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/cache.json b/tools/perf/pmu-events/arch/x86/broadwell/cache.json
index 73688a9dab2a..bba3152ec54a 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/cache.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/cache.json
@@ -10,13 +10,30 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.",
14 "EventCode": "0x24", 13 "EventCode": "0x24",
15 "Counter": "0,1,2,3", 14 "Counter": "0,1,2,3",
16 "UMask": "0x41", 15 "UMask": "0x22",
17 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT", 16 "EventName": "L2_RQSTS.RFO_MISS",
18 "SampleAfterValue": "200003", 17 "SampleAfterValue": "200003",
19 "BriefDescription": "Demand Data Read requests that hit L2 cache", 18 "BriefDescription": "RFO requests that miss L2 cache.",
19 "CounterHTOff": "0,1,2,3,4,5,6,7"
20 },
21 {
22 "EventCode": "0x24",
23 "Counter": "0,1,2,3",
24 "UMask": "0x24",
25 "EventName": "L2_RQSTS.CODE_RD_MISS",
26 "SampleAfterValue": "200003",
27 "BriefDescription": "L2 cache misses when fetching instructions.",
28 "CounterHTOff": "0,1,2,3,4,5,6,7"
29 },
30 {
31 "EventCode": "0x24",
32 "Counter": "0,1,2,3",
33 "UMask": "0x27",
34 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
35 "SampleAfterValue": "200003",
36 "BriefDescription": "Demand requests that miss L2 cache.",
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 37 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 38 },
22 { 39 {
@@ -30,6 +47,43 @@
30 "CounterHTOff": "0,1,2,3,4,5,6,7" 47 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 }, 48 },
32 { 49 {
50 "EventCode": "0x24",
51 "Counter": "0,1,2,3",
52 "UMask": "0x3f",
53 "EventName": "L2_RQSTS.MISS",
54 "SampleAfterValue": "200003",
55 "BriefDescription": "All requests that miss L2 cache.",
56 "CounterHTOff": "0,1,2,3,4,5,6,7"
57 },
58 {
59 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.",
60 "EventCode": "0x24",
61 "Counter": "0,1,2,3",
62 "UMask": "0x41",
63 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT",
64 "SampleAfterValue": "200003",
65 "BriefDescription": "Demand Data Read requests that hit L2 cache",
66 "CounterHTOff": "0,1,2,3,4,5,6,7"
67 },
68 {
69 "EventCode": "0x24",
70 "Counter": "0,1,2,3",
71 "UMask": "0x42",
72 "EventName": "L2_RQSTS.RFO_HIT",
73 "SampleAfterValue": "200003",
74 "BriefDescription": "RFO requests that hit L2 cache.",
75 "CounterHTOff": "0,1,2,3,4,5,6,7"
76 },
77 {
78 "EventCode": "0x24",
79 "Counter": "0,1,2,3",
80 "UMask": "0x44",
81 "EventName": "L2_RQSTS.CODE_RD_HIT",
82 "SampleAfterValue": "200003",
83 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
84 "CounterHTOff": "0,1,2,3,4,5,6,7"
85 },
86 {
33 "PublicDescription": "This event counts the number of requests from the L2 hardware prefetchers that hit L2 cache. L3 prefetch new types.", 87 "PublicDescription": "This event counts the number of requests from the L2 hardware prefetchers that hit L2 cache. L3 prefetch new types.",
34 "EventCode": "0x24", 88 "EventCode": "0x24",
35 "Counter": "0,1,2,3", 89 "Counter": "0,1,2,3",
@@ -70,6 +124,15 @@
70 "CounterHTOff": "0,1,2,3,4,5,6,7" 124 "CounterHTOff": "0,1,2,3,4,5,6,7"
71 }, 125 },
72 { 126 {
127 "EventCode": "0x24",
128 "Counter": "0,1,2,3",
129 "UMask": "0xe7",
130 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
131 "SampleAfterValue": "200003",
132 "BriefDescription": "Demand requests to L2 cache.",
133 "CounterHTOff": "0,1,2,3,4,5,6,7"
134 },
135 {
73 "PublicDescription": "This event counts the total number of requests from the L2 hardware prefetchers.", 136 "PublicDescription": "This event counts the total number of requests from the L2 hardware prefetchers.",
74 "EventCode": "0x24", 137 "EventCode": "0x24",
75 "Counter": "0,1,2,3", 138 "Counter": "0,1,2,3",
@@ -80,6 +143,15 @@
80 "CounterHTOff": "0,1,2,3,4,5,6,7" 143 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 }, 144 },
82 { 145 {
146 "EventCode": "0x24",
147 "Counter": "0,1,2,3",
148 "UMask": "0xff",
149 "EventName": "L2_RQSTS.REFERENCES",
150 "SampleAfterValue": "200003",
151 "BriefDescription": "All L2 requests.",
152 "CounterHTOff": "0,1,2,3,4,5,6,7"
153 },
154 {
83 "PublicDescription": "This event counts the number of WB requests that hit L2 cache.", 155 "PublicDescription": "This event counts the number of WB requests that hit L2 cache.",
84 "EventCode": "0x27", 156 "EventCode": "0x27",
85 "Counter": "0,1,2,3", 157 "Counter": "0,1,2,3",
@@ -131,6 +203,27 @@
131 "CounterHTOff": "2" 203 "CounterHTOff": "2"
132 }, 204 },
133 { 205 {
206 "EventCode": "0x48",
207 "Counter": "2",
208 "UMask": "0x1",
209 "AnyThread": "1",
210 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
211 "SampleAfterValue": "2000003",
212 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
213 "CounterMask": "1",
214 "CounterHTOff": "2"
215 },
216 {
217 "EventCode": "0x48",
218 "Counter": "0,1,2,3",
219 "UMask": "0x2",
220 "EventName": "L1D_PEND_MISS.FB_FULL",
221 "SampleAfterValue": "2000003",
222 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
223 "CounterMask": "1",
224 "CounterHTOff": "0,1,2,3,4,5,6,7"
225 },
226 {
134 "PublicDescription": "This event counts L1D data line replacements including opportunistic replacements, and replacements that require stall-for-replace or block-for-replace.", 227 "PublicDescription": "This event counts L1D data line replacements including opportunistic replacements, and replacements that require stall-for-replace or block-for-replace.",
135 "EventCode": "0x51", 228 "EventCode": "0x51",
136 "Counter": "0,1,2,3", 229 "Counter": "0,1,2,3",
@@ -152,7 +245,30 @@
152 "CounterHTOff": "0,1,2,3,4,5,6,7" 245 "CounterHTOff": "0,1,2,3,4,5,6,7"
153 }, 246 },
154 { 247 {
155 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The \"Offcore outstanding\" state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.", 248 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).",
249 "EventCode": "0x60",
250 "Counter": "0,1,2,3",
251 "UMask": "0x1",
252 "Errata": "BDM76",
253 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
254 "SampleAfterValue": "2000003",
255 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
256 "CounterMask": "1",
257 "CounterHTOff": "0,1,2,3,4,5,6,7"
258 },
259 {
260 "EventCode": "0x60",
261 "Counter": "0,1,2,3",
262 "UMask": "0x1",
263 "Errata": "BDM76",
264 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
265 "SampleAfterValue": "2000003",
266 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
267 "CounterMask": "6",
268 "CounterHTOff": "0,1,2,3,4,5,6,7"
269 },
270 {
271 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The Offcore outstanding state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
156 "EventCode": "0x60", 272 "EventCode": "0x60",
157 "Counter": "0,1,2,3", 273 "Counter": "0,1,2,3",
158 "UMask": "0x2", 274 "UMask": "0x2",
@@ -174,26 +290,26 @@
174 "CounterHTOff": "0,1,2,3,4,5,6,7" 290 "CounterHTOff": "0,1,2,3,4,5,6,7"
175 }, 291 },
176 { 292 {
177 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.", 293 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The Offcore outstanding state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
178 "EventCode": "0x60", 294 "EventCode": "0x60",
179 "Counter": "0,1,2,3", 295 "Counter": "0,1,2,3",
180 "UMask": "0x8", 296 "UMask": "0x4",
181 "Errata": "BDM76", 297 "Errata": "BDM76",
182 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 298 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
183 "SampleAfterValue": "2000003", 299 "SampleAfterValue": "2000003",
184 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore", 300 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
301 "CounterMask": "1",
185 "CounterHTOff": "0,1,2,3,4,5,6,7" 302 "CounterHTOff": "0,1,2,3,4,5,6,7"
186 }, 303 },
187 { 304 {
188 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).", 305 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
189 "EventCode": "0x60", 306 "EventCode": "0x60",
190 "Counter": "0,1,2,3", 307 "Counter": "0,1,2,3",
191 "UMask": "0x1", 308 "UMask": "0x8",
192 "Errata": "BDM76", 309 "Errata": "BDM76",
193 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD", 310 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
194 "SampleAfterValue": "2000003", 311 "SampleAfterValue": "2000003",
195 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore", 312 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
196 "CounterMask": "1",
197 "CounterHTOff": "0,1,2,3,4,5,6,7" 313 "CounterHTOff": "0,1,2,3,4,5,6,7"
198 }, 314 },
199 { 315 {
@@ -209,18 +325,6 @@
209 "CounterHTOff": "0,1,2,3,4,5,6,7" 325 "CounterHTOff": "0,1,2,3,4,5,6,7"
210 }, 326 },
211 { 327 {
212 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The \"Offcore outstanding\" state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
213 "EventCode": "0x60",
214 "Counter": "0,1,2,3",
215 "UMask": "0x4",
216 "Errata": "BDM76",
217 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
218 "SampleAfterValue": "2000003",
219 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
220 "CounterMask": "1",
221 "CounterHTOff": "0,1,2,3,4,5,6,7"
222 },
223 {
224 "PublicDescription": "This event counts the number of cycles when the L1D is locked. It is a superset of the 0x1 mask (BUS_LOCK_CLOCKS.BUS_LOCK_DURATION).", 328 "PublicDescription": "This event counts the number of cycles when the L1D is locked. It is a superset of the 0x1 mask (BUS_LOCK_CLOCKS.BUS_LOCK_DURATION).",
225 "EventCode": "0x63", 329 "EventCode": "0x63",
226 "Counter": "0,1,2,3", 330 "Counter": "0,1,2,3",
@@ -261,7 +365,7 @@
261 "CounterHTOff": "0,1,2,3,4,5,6,7" 365 "CounterHTOff": "0,1,2,3,4,5,6,7"
262 }, 366 },
263 { 367 {
264 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable \"Demands\" and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.", 368 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable Demands and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.",
265 "EventCode": "0xB0", 369 "EventCode": "0xB0",
266 "Counter": "0,1,2,3", 370 "Counter": "0,1,2,3",
267 "UMask": "0x8", 371 "UMask": "0x8",
@@ -281,152 +385,161 @@
281 "CounterHTOff": "0,1,2,3,4,5,6,7" 385 "CounterHTOff": "0,1,2,3,4,5,6,7"
282 }, 386 },
283 { 387 {
388 "EventCode": "0xB7, 0xBB",
389 "Counter": "0,1,2,3",
390 "UMask": "0x1",
391 "EventName": "OFFCORE_RESPONSE",
392 "SampleAfterValue": "100003",
393 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
394 "CounterHTOff": "0,1,2,3"
395 },
396 {
284 "PEBS": "1", 397 "PEBS": "1",
285 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts load uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.", 398 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.",
286 "EventCode": "0xD0", 399 "EventCode": "0xD0",
287 "Counter": "0,1,2,3", 400 "Counter": "0,1,2,3",
288 "UMask": "0x11", 401 "UMask": "0x11",
289 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS", 402 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS",
290 "SampleAfterValue": "100003", 403 "SampleAfterValue": "100003",
291 "BriefDescription": "Retired load uops that miss the STLB.", 404 "BriefDescription": "Retired load uops that miss the STLB. (Precise Event - PEBS)",
292 "CounterHTOff": "0,1,2,3", 405 "CounterHTOff": "0,1,2,3",
293 "Data_LA": "1" 406 "Data_LA": "1"
294 }, 407 },
295 { 408 {
296 "PEBS": "1", 409 "PEBS": "1",
297 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts store uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.", 410 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts store uops true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.",
298 "EventCode": "0xD0", 411 "EventCode": "0xD0",
299 "Counter": "0,1,2,3", 412 "Counter": "0,1,2,3",
300 "UMask": "0x12", 413 "UMask": "0x12",
301 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 414 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
302 "SampleAfterValue": "100003", 415 "SampleAfterValue": "100003",
303 "BriefDescription": "Retired store uops that miss the STLB.", 416 "BriefDescription": "Retired store uops that miss the STLB. (Precise Event - PEBS)",
304 "CounterHTOff": "0,1,2,3", 417 "CounterHTOff": "0,1,2,3",
305 "Data_LA": "1", 418 "Data_LA": "1",
306 "L1_Hit_Indication": "1" 419 "L1_Hit_Indication": "1"
307 }, 420 },
308 { 421 {
309 "PEBS": "1", 422 "PEBS": "1",
310 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts load uops with locked access retired to the architected path.", 423 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops with locked access retired to the architected path.",
311 "EventCode": "0xD0", 424 "EventCode": "0xD0",
312 "Counter": "0,1,2,3", 425 "Counter": "0,1,2,3",
313 "UMask": "0x21", 426 "UMask": "0x21",
314 "Errata": "BDM35", 427 "Errata": "BDM35",
315 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 428 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
316 "SampleAfterValue": "100007", 429 "SampleAfterValue": "100007",
317 "BriefDescription": "Retired load uops with locked access.", 430 "BriefDescription": "Retired load uops with locked access. (Precise Event - PEBS)",
318 "CounterHTOff": "0,1,2,3", 431 "CounterHTOff": "0,1,2,3",
319 "Data_LA": "1" 432 "Data_LA": "1"
320 }, 433 },
321 { 434 {
322 "PEBS": "1", 435 "PEBS": "1",
323 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts line-splitted load uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).", 436 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts line-splitted load uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).",
324 "EventCode": "0xD0", 437 "EventCode": "0xD0",
325 "Counter": "0,1,2,3", 438 "Counter": "0,1,2,3",
326 "UMask": "0x41", 439 "UMask": "0x41",
327 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 440 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
328 "SampleAfterValue": "100003", 441 "SampleAfterValue": "100003",
329 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 442 "BriefDescription": "Retired load uops that split across a cacheline boundary.(Precise Event - PEBS)",
330 "CounterHTOff": "0,1,2,3", 443 "CounterHTOff": "0,1,2,3",
331 "Data_LA": "1" 444 "Data_LA": "1"
332 }, 445 },
333 { 446 {
334 "PEBS": "1", 447 "PEBS": "1",
335 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts line-splitted store uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).", 448 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts line-splitted store uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).",
336 "EventCode": "0xD0", 449 "EventCode": "0xD0",
337 "Counter": "0,1,2,3", 450 "Counter": "0,1,2,3",
338 "UMask": "0x42", 451 "UMask": "0x42",
339 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 452 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
340 "SampleAfterValue": "100003", 453 "SampleAfterValue": "100003",
341 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 454 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event - PEBS)",
342 "CounterHTOff": "0,1,2,3", 455 "CounterHTOff": "0,1,2,3",
343 "Data_LA": "1", 456 "Data_LA": "1",
344 "L1_Hit_Indication": "1" 457 "L1_Hit_Indication": "1"
345 }, 458 },
346 { 459 {
347 "PEBS": "1", 460 "PEBS": "1",
348 "PublicDescription": "This event counts load uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event counts AVX-256bit load/store double-pump memory uops as a single uop at retirement. This event also counts SW prefetches.", 461 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event ?ounts AVX-256bit load/store double-pump memory uops as a single uop at retirement. This event also counts SW prefetches.",
349 "EventCode": "0xD0", 462 "EventCode": "0xD0",
350 "Counter": "0,1,2,3", 463 "Counter": "0,1,2,3",
351 "UMask": "0x81", 464 "UMask": "0x81",
352 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 465 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
353 "SampleAfterValue": "2000003", 466 "SampleAfterValue": "2000003",
354 "BriefDescription": "All retired load uops.", 467 "BriefDescription": "All retired load uops. (Precise Event - PEBS)",
355 "CounterHTOff": "0,1,2,3", 468 "CounterHTOff": "0,1,2,3",
356 "Data_LA": "1" 469 "Data_LA": "1"
357 }, 470 },
358 { 471 {
359 "PEBS": "1", 472 "PEBS": "1",
360 "PublicDescription": "This event counts store uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event counts AVX-256bit load/store double-pump memory uops as a single uop at retirement.", 473 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts store uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event ?ounts AVX-256bit load/store double-pump memory uops as a single uop at retirement.",
361 "EventCode": "0xD0", 474 "EventCode": "0xD0",
362 "Counter": "0,1,2,3", 475 "Counter": "0,1,2,3",
363 "UMask": "0x82", 476 "UMask": "0x82",
364 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 477 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
365 "SampleAfterValue": "2000003", 478 "SampleAfterValue": "2000003",
366 "BriefDescription": "All retired store uops.", 479 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event - PEBS)",
367 "CounterHTOff": "0,1,2,3", 480 "CounterHTOff": "0,1,2,3",
368 "Data_LA": "1", 481 "Data_LA": "1",
369 "L1_Hit_Indication": "1" 482 "L1_Hit_Indication": "1"
370 }, 483 },
371 { 484 {
372 "PEBS": "1", 485 "PEBS": "1",
373 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the nearest-level (L1) cache.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load. This event also counts SW prefetches independent of the actual data source.", 486 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data source were hits in the nearest-level (L1) cache.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load. This event also counts SW prefetches independent of the actual data source.",
374 "EventCode": "0xD1", 487 "EventCode": "0xD1",
375 "Counter": "0,1,2,3", 488 "Counter": "0,1,2,3",
376 "UMask": "0x1", 489 "UMask": "0x1",
377 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT", 490 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT",
378 "SampleAfterValue": "2000003", 491 "SampleAfterValue": "2000003",
379 "BriefDescription": "Retired load uops with L1 cache hits as data sources.", 492 "BriefDescription": "Retired load uops with L1 cache hits as data sources. (Precise Event - PEBS)",
380 "CounterHTOff": "0,1,2,3", 493 "CounterHTOff": "0,1,2,3",
381 "Data_LA": "1" 494 "Data_LA": "1"
382 }, 495 },
383 { 496 {
384 "PEBS": "1", 497 "PEBS": "1",
385 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the mid-level (L2) cache.", 498 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were hits in the mid-level (L2) cache.",
386 "EventCode": "0xD1", 499 "EventCode": "0xD1",
387 "Counter": "0,1,2,3", 500 "Counter": "0,1,2,3",
388 "UMask": "0x2", 501 "UMask": "0x2",
389 "Errata": "BDM35", 502 "Errata": "BDM35",
390 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 503 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT",
391 "SampleAfterValue": "100003", 504 "SampleAfterValue": "100003",
392 "BriefDescription": "Retired load uops with L2 cache hits as data sources.", 505 "BriefDescription": "Retired load uops with L2 cache hits as data sources. (Precise Event - PEBS)",
393 "CounterHTOff": "0,1,2,3", 506 "CounterHTOff": "0,1,2,3",
394 "Data_LA": "1" 507 "Data_LA": "1"
395 }, 508 },
396 { 509 {
397 "PEBS": "1", 510 "PEBS": "1",
398 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were data hits in the last-level (L3) cache without snoops required.", 511 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were data hits in the last-level (L3) cache without snoops required.",
399 "EventCode": "0xD1", 512 "EventCode": "0xD1",
400 "Counter": "0,1,2,3", 513 "Counter": "0,1,2,3",
401 "UMask": "0x4", 514 "UMask": "0x4",
402 "Errata": "BDM100", 515 "Errata": "BDM100",
403 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT", 516 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT",
404 "SampleAfterValue": "50021", 517 "SampleAfterValue": "50021",
405 "BriefDescription": "Retired load uops which data sources were data hits in L3 without snoops required.", 518 "BriefDescription": "Hit in last-level (L3) cache. Excludes Unknown data-source. (Precise Event - PEBS)",
406 "CounterHTOff": "0,1,2,3", 519 "CounterHTOff": "0,1,2,3",
407 "Data_LA": "1" 520 "Data_LA": "1"
408 }, 521 },
409 { 522 {
410 "PEBS": "1", 523 "PEBS": "1",
411 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were misses in the nearest-level (L1) cache. Counting excludes unknown and UC data source.", 524 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were misses in the nearest-level (L1) cache. Counting excludes unknown and UC data source.",
412 "EventCode": "0xD1", 525 "EventCode": "0xD1",
413 "Counter": "0,1,2,3", 526 "Counter": "0,1,2,3",
414 "UMask": "0x8", 527 "UMask": "0x8",
415 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 528 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
416 "SampleAfterValue": "100003", 529 "SampleAfterValue": "100003",
417 "BriefDescription": "Retired load uops misses in L1 cache as data sources.", 530 "BriefDescription": "Retired load uops misses in L1 cache as data sources. Uses PEBS.",
418 "CounterHTOff": "0,1,2,3", 531 "CounterHTOff": "0,1,2,3",
419 "Data_LA": "1" 532 "Data_LA": "1"
420 }, 533 },
421 { 534 {
422 "PEBS": "1", 535 "PEBS": "1",
423 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were misses in the mid-level (L2) cache. Counting excludes unknown and UC data source.", 536 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were misses in the mid-level (L2) cache. Counting excludes unknown and UC data source.",
424 "EventCode": "0xD1", 537 "EventCode": "0xD1",
425 "Counter": "0,1,2,3", 538 "Counter": "0,1,2,3",
426 "UMask": "0x10", 539 "UMask": "0x10",
427 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 540 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
428 "SampleAfterValue": "50021", 541 "SampleAfterValue": "50021",
429 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 542 "BriefDescription": "Retired load uops with L2 cache misses as data sources. Uses PEBS.",
430 "CounterHTOff": "0,1,2,3", 543 "CounterHTOff": "0,1,2,3",
431 "Data_LA": "1" 544 "Data_LA": "1"
432 }, 545 },
@@ -438,84 +551,83 @@
438 "Errata": "BDM100, BDE70", 551 "Errata": "BDM100, BDE70",
439 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_MISS", 552 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_MISS",
440 "SampleAfterValue": "100007", 553 "SampleAfterValue": "100007",
441 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source.", 554 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source. (Precise Event - PEBS).",
442 "CounterHTOff": "0,1,2,3", 555 "CounterHTOff": "0,1,2,3",
443 "Data_LA": "1" 556 "Data_LA": "1"
444 }, 557 },
445 { 558 {
446 "PEBS": "1", 559 "PEBS": "1",
447 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were load uops missed L1 but hit a fill buffer due to a preceding miss to the same cache line with the data not ready.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load.", 560 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were load uops missed L1 but hit a fill buffer due to a preceding miss to the same cache line with the data not ready.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load.",
448 "EventCode": "0xD1", 561 "EventCode": "0xD1",
449 "Counter": "0,1,2,3", 562 "Counter": "0,1,2,3",
450 "UMask": "0x40", 563 "UMask": "0x40",
451 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB", 564 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB",
452 "SampleAfterValue": "100003", 565 "SampleAfterValue": "100003",
453 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.", 566 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready. (Precise Event - PEBS)",
454 "CounterHTOff": "0,1,2,3", 567 "CounterHTOff": "0,1,2,3",
455 "Data_LA": "1" 568 "Data_LA": "1"
456 }, 569 },
457 { 570 {
458 "PEBS": "1", 571 "PEBS": "1",
459 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were L3 Hit and a cross-core snoop missed in the on-pkg core cache.", 572 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were L3 Hit and a cross-core snoop missed in the on-pkg core cache.",
460 "EventCode": "0xD2", 573 "EventCode": "0xD2",
461 "Counter": "0,1,2,3", 574 "Counter": "0,1,2,3",
462 "UMask": "0x1", 575 "UMask": "0x1",
463 "Errata": "BDM100", 576 "Errata": "BDM100",
464 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS", 577 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS",
465 "SampleAfterValue": "20011", 578 "SampleAfterValue": "20011",
466 "BriefDescription": "Retired load uops which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.", 579 "BriefDescription": "Retired load uops which data sources were L3 hit and cross-core snoop missed in on-pkg core cache. (Precise Event - PEBS)",
467 "CounterHTOff": "0,1,2,3", 580 "CounterHTOff": "0,1,2,3",
468 "Data_LA": "1" 581 "Data_LA": "1"
469 }, 582 },
470 { 583 {
471 "PEBS": "1", 584 "PEBS": "1",
472 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were L3 hit and a cross-core snoop hit in the on-pkg core cache.", 585 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were L3 hit and a cross-core snoop hit in the on-pkg core cache.",
473 "EventCode": "0xD2", 586 "EventCode": "0xD2",
474 "Counter": "0,1,2,3", 587 "Counter": "0,1,2,3",
475 "UMask": "0x2", 588 "UMask": "0x2",
476 "Errata": "BDM100", 589 "Errata": "BDM100",
477 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT", 590 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT",
478 "SampleAfterValue": "20011", 591 "SampleAfterValue": "20011",
479 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache.", 592 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache. (Precise Event - PEBS)",
480 "CounterHTOff": "0,1,2,3", 593 "CounterHTOff": "0,1,2,3",
481 "Data_LA": "1" 594 "Data_LA": "1"
482 }, 595 },
483 { 596 {
484 "PEBS": "1", 597 "PEBS": "1",
485 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were HitM responses from a core on same socket (shared L3).", 598 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were HitM responses from a core on same socket (shared L3).",
486 "EventCode": "0xD2", 599 "EventCode": "0xD2",
487 "Counter": "0,1,2,3", 600 "Counter": "0,1,2,3",
488 "UMask": "0x4", 601 "UMask": "0x4",
489 "Errata": "BDM100", 602 "Errata": "BDM100",
490 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM", 603 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM",
491 "SampleAfterValue": "20011", 604 "SampleAfterValue": "20011",
492 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3.", 605 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3. (Precise Event - PEBS)",
493 "CounterHTOff": "0,1,2,3", 606 "CounterHTOff": "0,1,2,3",
494 "Data_LA": "1" 607 "Data_LA": "1"
495 }, 608 },
496 { 609 {
497 "PEBS": "1", 610 "PEBS": "1",
498 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the last-level (L3) cache without snoops required.", 611 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were hits in the last-level (L3) cache without snoops required.",
499 "EventCode": "0xD2", 612 "EventCode": "0xD2",
500 "Counter": "0,1,2,3", 613 "Counter": "0,1,2,3",
501 "UMask": "0x8", 614 "UMask": "0x8",
502 "Errata": "BDM100", 615 "Errata": "BDM100",
503 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE", 616 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE",
504 "SampleAfterValue": "100003", 617 "SampleAfterValue": "100003",
505 "BriefDescription": "Retired load uops which data sources were hits in L3 without snoops required.", 618 "BriefDescription": "Retired load uops which data sources were hits in L3 without snoops required. (Precise Event - PEBS)",
506 "CounterHTOff": "0,1,2,3", 619 "CounterHTOff": "0,1,2,3",
507 "Data_LA": "1" 620 "Data_LA": "1"
508 }, 621 },
509 { 622 {
510 "PEBS": "1", 623 "PEBS": "1",
511 "PublicDescription": "Retired load uop whose Data Source was: local DRAM either Snoop not needed or Snoop Miss (RspI).", 624 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches. This is a precise event.",
512 "EventCode": "0xD3", 625 "EventCode": "0xD3",
513 "Counter": "0,1,2,3", 626 "Counter": "0,1,2,3",
514 "UMask": "0x1", 627 "UMask": "0x1",
515 "Errata": "BDE70, BDM100", 628 "Errata": "BDE70, BDM100",
516 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM", 629 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM",
517 "SampleAfterValue": "100007", 630 "SampleAfterValue": "100007",
518 "BriefDescription": "Data from local DRAM either Snoop not needed or Snoop Miss (RspI)",
519 "CounterHTOff": "0,1,2,3", 631 "CounterHTOff": "0,1,2,3",
520 "Data_LA": "1" 632 "Data_LA": "1"
521 }, 633 },
@@ -659,119 +771,7 @@
659 "CounterHTOff": "0,1,2,3,4,5,6,7" 771 "CounterHTOff": "0,1,2,3,4,5,6,7"
660 }, 772 },
661 { 773 {
662 "EventCode": "0x24", 774 "PublicDescription": "Counts demand data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
663 "Counter": "0,1,2,3",
664 "UMask": "0x42",
665 "EventName": "L2_RQSTS.RFO_HIT",
666 "SampleAfterValue": "200003",
667 "BriefDescription": "RFO requests that hit L2 cache.",
668 "CounterHTOff": "0,1,2,3,4,5,6,7"
669 },
670 {
671 "EventCode": "0x24",
672 "Counter": "0,1,2,3",
673 "UMask": "0x22",
674 "EventName": "L2_RQSTS.RFO_MISS",
675 "SampleAfterValue": "200003",
676 "BriefDescription": "RFO requests that miss L2 cache.",
677 "CounterHTOff": "0,1,2,3,4,5,6,7"
678 },
679 {
680 "EventCode": "0x24",
681 "Counter": "0,1,2,3",
682 "UMask": "0x44",
683 "EventName": "L2_RQSTS.CODE_RD_HIT",
684 "SampleAfterValue": "200003",
685 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
686 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 },
688 {
689 "EventCode": "0x24",
690 "Counter": "0,1,2,3",
691 "UMask": "0x24",
692 "EventName": "L2_RQSTS.CODE_RD_MISS",
693 "SampleAfterValue": "200003",
694 "BriefDescription": "L2 cache misses when fetching instructions.",
695 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 },
697 {
698 "EventCode": "0x24",
699 "Counter": "0,1,2,3",
700 "UMask": "0x27",
701 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
702 "SampleAfterValue": "200003",
703 "BriefDescription": "Demand requests that miss L2 cache.",
704 "CounterHTOff": "0,1,2,3,4,5,6,7"
705 },
706 {
707 "EventCode": "0x24",
708 "Counter": "0,1,2,3",
709 "UMask": "0xe7",
710 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
711 "SampleAfterValue": "200003",
712 "BriefDescription": "Demand requests to L2 cache.",
713 "CounterHTOff": "0,1,2,3,4,5,6,7"
714 },
715 {
716 "EventCode": "0x24",
717 "Counter": "0,1,2,3",
718 "UMask": "0x3f",
719 "EventName": "L2_RQSTS.MISS",
720 "SampleAfterValue": "200003",
721 "BriefDescription": "All requests that miss L2 cache.",
722 "CounterHTOff": "0,1,2,3,4,5,6,7"
723 },
724 {
725 "EventCode": "0x24",
726 "Counter": "0,1,2,3",
727 "UMask": "0xff",
728 "EventName": "L2_RQSTS.REFERENCES",
729 "SampleAfterValue": "200003",
730 "BriefDescription": "All L2 requests.",
731 "CounterHTOff": "0,1,2,3,4,5,6,7"
732 },
733 {
734 "EventCode": "0xB7, 0xBB",
735 "Counter": "0,1,2,3",
736 "UMask": "0x1",
737 "EventName": "OFFCORE_RESPONSE",
738 "SampleAfterValue": "100003",
739 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
740 "CounterHTOff": "0,1,2,3"
741 },
742 {
743 "EventCode": "0x60",
744 "Counter": "0,1,2,3",
745 "UMask": "0x1",
746 "Errata": "BDM76",
747 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
748 "SampleAfterValue": "2000003",
749 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
750 "CounterMask": "6",
751 "CounterHTOff": "0,1,2,3,4,5,6,7"
752 },
753 {
754 "EventCode": "0x48",
755 "Counter": "2",
756 "UMask": "0x1",
757 "AnyThread": "1",
758 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
759 "SampleAfterValue": "2000003",
760 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
761 "CounterMask": "1",
762 "CounterHTOff": "2"
763 },
764 {
765 "EventCode": "0x48",
766 "Counter": "0,1,2,3",
767 "UMask": "0x2",
768 "EventName": "L1D_PEND_MISS.FB_FULL",
769 "SampleAfterValue": "2000003",
770 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
771 "CounterMask": "1",
772 "CounterHTOff": "0,1,2,3,4,5,6,7"
773 },
774 {
775 "EventCode": "0xB7, 0xBB", 775 "EventCode": "0xB7, 0xBB",
776 "MSRValue": "0x0000010001 ", 776 "MSRValue": "0x0000010001 ",
777 "Counter": "0,1,2,3", 777 "Counter": "0,1,2,3",
@@ -784,6 +784,7 @@
784 "CounterHTOff": "0,1,2,3" 784 "CounterHTOff": "0,1,2,3"
785 }, 785 },
786 { 786 {
787 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
787 "EventCode": "0xB7, 0xBB", 788 "EventCode": "0xB7, 0xBB",
788 "MSRValue": "0x0080020001 ", 789 "MSRValue": "0x0080020001 ",
789 "Counter": "0,1,2,3", 790 "Counter": "0,1,2,3",
@@ -796,6 +797,7 @@
796 "CounterHTOff": "0,1,2,3" 797 "CounterHTOff": "0,1,2,3"
797 }, 798 },
798 { 799 {
800 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
799 "EventCode": "0xB7, 0xBB", 801 "EventCode": "0xB7, 0xBB",
800 "MSRValue": "0x0100020001 ", 802 "MSRValue": "0x0100020001 ",
801 "Counter": "0,1,2,3", 803 "Counter": "0,1,2,3",
@@ -808,6 +810,7 @@
808 "CounterHTOff": "0,1,2,3" 810 "CounterHTOff": "0,1,2,3"
809 }, 811 },
810 { 812 {
813 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
811 "EventCode": "0xB7, 0xBB", 814 "EventCode": "0xB7, 0xBB",
812 "MSRValue": "0x0200020001 ", 815 "MSRValue": "0x0200020001 ",
813 "Counter": "0,1,2,3", 816 "Counter": "0,1,2,3",
@@ -820,6 +823,7 @@
820 "CounterHTOff": "0,1,2,3" 823 "CounterHTOff": "0,1,2,3"
821 }, 824 },
822 { 825 {
826 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
823 "EventCode": "0xB7, 0xBB", 827 "EventCode": "0xB7, 0xBB",
824 "MSRValue": "0x0400020001 ", 828 "MSRValue": "0x0400020001 ",
825 "Counter": "0,1,2,3", 829 "Counter": "0,1,2,3",
@@ -832,6 +836,7 @@
832 "CounterHTOff": "0,1,2,3" 836 "CounterHTOff": "0,1,2,3"
833 }, 837 },
834 { 838 {
839 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
835 "EventCode": "0xB7, 0xBB", 840 "EventCode": "0xB7, 0xBB",
836 "MSRValue": "0x1000020001 ", 841 "MSRValue": "0x1000020001 ",
837 "Counter": "0,1,2,3", 842 "Counter": "0,1,2,3",
@@ -844,6 +849,7 @@
844 "CounterHTOff": "0,1,2,3" 849 "CounterHTOff": "0,1,2,3"
845 }, 850 },
846 { 851 {
852 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
847 "EventCode": "0xB7, 0xBB", 853 "EventCode": "0xB7, 0xBB",
848 "MSRValue": "0x3f80020001 ", 854 "MSRValue": "0x3f80020001 ",
849 "Counter": "0,1,2,3", 855 "Counter": "0,1,2,3",
@@ -856,6 +862,7 @@
856 "CounterHTOff": "0,1,2,3" 862 "CounterHTOff": "0,1,2,3"
857 }, 863 },
858 { 864 {
865 "PublicDescription": "Counts demand data reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
859 "EventCode": "0xB7, 0xBB", 866 "EventCode": "0xB7, 0xBB",
860 "MSRValue": "0x00803c0001 ", 867 "MSRValue": "0x00803c0001 ",
861 "Counter": "0,1,2,3", 868 "Counter": "0,1,2,3",
@@ -868,6 +875,7 @@
868 "CounterHTOff": "0,1,2,3" 875 "CounterHTOff": "0,1,2,3"
869 }, 876 },
870 { 877 {
878 "PublicDescription": "Counts demand data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
871 "EventCode": "0xB7, 0xBB", 879 "EventCode": "0xB7, 0xBB",
872 "MSRValue": "0x01003c0001 ", 880 "MSRValue": "0x01003c0001 ",
873 "Counter": "0,1,2,3", 881 "Counter": "0,1,2,3",
@@ -880,6 +888,7 @@
880 "CounterHTOff": "0,1,2,3" 888 "CounterHTOff": "0,1,2,3"
881 }, 889 },
882 { 890 {
891 "PublicDescription": "Counts demand data reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
883 "EventCode": "0xB7, 0xBB", 892 "EventCode": "0xB7, 0xBB",
884 "MSRValue": "0x02003c0001 ", 893 "MSRValue": "0x02003c0001 ",
885 "Counter": "0,1,2,3", 894 "Counter": "0,1,2,3",
@@ -892,6 +901,7 @@
892 "CounterHTOff": "0,1,2,3" 901 "CounterHTOff": "0,1,2,3"
893 }, 902 },
894 { 903 {
904 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
895 "EventCode": "0xB7, 0xBB", 905 "EventCode": "0xB7, 0xBB",
896 "MSRValue": "0x04003c0001 ", 906 "MSRValue": "0x04003c0001 ",
897 "Counter": "0,1,2,3", 907 "Counter": "0,1,2,3",
@@ -904,6 +914,7 @@
904 "CounterHTOff": "0,1,2,3" 914 "CounterHTOff": "0,1,2,3"
905 }, 915 },
906 { 916 {
917 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
907 "EventCode": "0xB7, 0xBB", 918 "EventCode": "0xB7, 0xBB",
908 "MSRValue": "0x10003c0001 ", 919 "MSRValue": "0x10003c0001 ",
909 "Counter": "0,1,2,3", 920 "Counter": "0,1,2,3",
@@ -916,6 +927,7 @@
916 "CounterHTOff": "0,1,2,3" 927 "CounterHTOff": "0,1,2,3"
917 }, 928 },
918 { 929 {
930 "PublicDescription": "Counts demand data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
919 "EventCode": "0xB7, 0xBB", 931 "EventCode": "0xB7, 0xBB",
920 "MSRValue": "0x3f803c0001 ", 932 "MSRValue": "0x3f803c0001 ",
921 "Counter": "0,1,2,3", 933 "Counter": "0,1,2,3",
@@ -928,6 +940,7 @@
928 "CounterHTOff": "0,1,2,3" 940 "CounterHTOff": "0,1,2,3"
929 }, 941 },
930 { 942 {
943 "PublicDescription": "Counts all demand data writes (RFOs) that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
931 "EventCode": "0xB7, 0xBB", 944 "EventCode": "0xB7, 0xBB",
932 "MSRValue": "0x0000010002 ", 945 "MSRValue": "0x0000010002 ",
933 "Counter": "0,1,2,3", 946 "Counter": "0,1,2,3",
@@ -940,6 +953,7 @@
940 "CounterHTOff": "0,1,2,3" 953 "CounterHTOff": "0,1,2,3"
941 }, 954 },
942 { 955 {
956 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
943 "EventCode": "0xB7, 0xBB", 957 "EventCode": "0xB7, 0xBB",
944 "MSRValue": "0x00803c0002 ", 958 "MSRValue": "0x00803c0002 ",
945 "Counter": "0,1,2,3", 959 "Counter": "0,1,2,3",
@@ -952,6 +966,7 @@
952 "CounterHTOff": "0,1,2,3" 966 "CounterHTOff": "0,1,2,3"
953 }, 967 },
954 { 968 {
969 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
955 "EventCode": "0xB7, 0xBB", 970 "EventCode": "0xB7, 0xBB",
956 "MSRValue": "0x01003c0002 ", 971 "MSRValue": "0x01003c0002 ",
957 "Counter": "0,1,2,3", 972 "Counter": "0,1,2,3",
@@ -964,6 +979,7 @@
964 "CounterHTOff": "0,1,2,3" 979 "CounterHTOff": "0,1,2,3"
965 }, 980 },
966 { 981 {
982 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
967 "EventCode": "0xB7, 0xBB", 983 "EventCode": "0xB7, 0xBB",
968 "MSRValue": "0x02003c0002 ", 984 "MSRValue": "0x02003c0002 ",
969 "Counter": "0,1,2,3", 985 "Counter": "0,1,2,3",
@@ -976,6 +992,7 @@
976 "CounterHTOff": "0,1,2,3" 992 "CounterHTOff": "0,1,2,3"
977 }, 993 },
978 { 994 {
995 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
979 "EventCode": "0xB7, 0xBB", 996 "EventCode": "0xB7, 0xBB",
980 "MSRValue": "0x04003c0002 ", 997 "MSRValue": "0x04003c0002 ",
981 "Counter": "0,1,2,3", 998 "Counter": "0,1,2,3",
@@ -988,6 +1005,7 @@
988 "CounterHTOff": "0,1,2,3" 1005 "CounterHTOff": "0,1,2,3"
989 }, 1006 },
990 { 1007 {
1008 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
991 "EventCode": "0xB7, 0xBB", 1009 "EventCode": "0xB7, 0xBB",
992 "MSRValue": "0x10003c0002 ", 1010 "MSRValue": "0x10003c0002 ",
993 "Counter": "0,1,2,3", 1011 "Counter": "0,1,2,3",
@@ -1000,6 +1018,7 @@
1000 "CounterHTOff": "0,1,2,3" 1018 "CounterHTOff": "0,1,2,3"
1001 }, 1019 },
1002 { 1020 {
1021 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1003 "EventCode": "0xB7, 0xBB", 1022 "EventCode": "0xB7, 0xBB",
1004 "MSRValue": "0x3f803c0002 ", 1023 "MSRValue": "0x3f803c0002 ",
1005 "Counter": "0,1,2,3", 1024 "Counter": "0,1,2,3",
@@ -1012,6 +1031,7 @@
1012 "CounterHTOff": "0,1,2,3" 1031 "CounterHTOff": "0,1,2,3"
1013 }, 1032 },
1014 { 1033 {
1034 "PublicDescription": "Counts all demand code reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1015 "EventCode": "0xB7, 0xBB", 1035 "EventCode": "0xB7, 0xBB",
1016 "MSRValue": "0x0000010004 ", 1036 "MSRValue": "0x0000010004 ",
1017 "Counter": "0,1,2,3", 1037 "Counter": "0,1,2,3",
@@ -1024,6 +1044,7 @@
1024 "CounterHTOff": "0,1,2,3" 1044 "CounterHTOff": "0,1,2,3"
1025 }, 1045 },
1026 { 1046 {
1047 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1027 "EventCode": "0xB7, 0xBB", 1048 "EventCode": "0xB7, 0xBB",
1028 "MSRValue": "0x0080020004 ", 1049 "MSRValue": "0x0080020004 ",
1029 "Counter": "0,1,2,3", 1050 "Counter": "0,1,2,3",
@@ -1036,6 +1057,7 @@
1036 "CounterHTOff": "0,1,2,3" 1057 "CounterHTOff": "0,1,2,3"
1037 }, 1058 },
1038 { 1059 {
1060 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1039 "EventCode": "0xB7, 0xBB", 1061 "EventCode": "0xB7, 0xBB",
1040 "MSRValue": "0x0100020004 ", 1062 "MSRValue": "0x0100020004 ",
1041 "Counter": "0,1,2,3", 1063 "Counter": "0,1,2,3",
@@ -1048,6 +1070,7 @@
1048 "CounterHTOff": "0,1,2,3" 1070 "CounterHTOff": "0,1,2,3"
1049 }, 1071 },
1050 { 1072 {
1073 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1051 "EventCode": "0xB7, 0xBB", 1074 "EventCode": "0xB7, 0xBB",
1052 "MSRValue": "0x0200020004 ", 1075 "MSRValue": "0x0200020004 ",
1053 "Counter": "0,1,2,3", 1076 "Counter": "0,1,2,3",
@@ -1060,6 +1083,7 @@
1060 "CounterHTOff": "0,1,2,3" 1083 "CounterHTOff": "0,1,2,3"
1061 }, 1084 },
1062 { 1085 {
1086 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1063 "EventCode": "0xB7, 0xBB", 1087 "EventCode": "0xB7, 0xBB",
1064 "MSRValue": "0x0400020004 ", 1088 "MSRValue": "0x0400020004 ",
1065 "Counter": "0,1,2,3", 1089 "Counter": "0,1,2,3",
@@ -1072,6 +1096,7 @@
1072 "CounterHTOff": "0,1,2,3" 1096 "CounterHTOff": "0,1,2,3"
1073 }, 1097 },
1074 { 1098 {
1099 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1075 "EventCode": "0xB7, 0xBB", 1100 "EventCode": "0xB7, 0xBB",
1076 "MSRValue": "0x1000020004 ", 1101 "MSRValue": "0x1000020004 ",
1077 "Counter": "0,1,2,3", 1102 "Counter": "0,1,2,3",
@@ -1084,6 +1109,7 @@
1084 "CounterHTOff": "0,1,2,3" 1109 "CounterHTOff": "0,1,2,3"
1085 }, 1110 },
1086 { 1111 {
1112 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1087 "EventCode": "0xB7, 0xBB", 1113 "EventCode": "0xB7, 0xBB",
1088 "MSRValue": "0x3f80020004 ", 1114 "MSRValue": "0x3f80020004 ",
1089 "Counter": "0,1,2,3", 1115 "Counter": "0,1,2,3",
@@ -1096,6 +1122,7 @@
1096 "CounterHTOff": "0,1,2,3" 1122 "CounterHTOff": "0,1,2,3"
1097 }, 1123 },
1098 { 1124 {
1125 "PublicDescription": "Counts all demand code reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1099 "EventCode": "0xB7, 0xBB", 1126 "EventCode": "0xB7, 0xBB",
1100 "MSRValue": "0x00803c0004 ", 1127 "MSRValue": "0x00803c0004 ",
1101 "Counter": "0,1,2,3", 1128 "Counter": "0,1,2,3",
@@ -1108,6 +1135,7 @@
1108 "CounterHTOff": "0,1,2,3" 1135 "CounterHTOff": "0,1,2,3"
1109 }, 1136 },
1110 { 1137 {
1138 "PublicDescription": "Counts all demand code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1111 "EventCode": "0xB7, 0xBB", 1139 "EventCode": "0xB7, 0xBB",
1112 "MSRValue": "0x01003c0004 ", 1140 "MSRValue": "0x01003c0004 ",
1113 "Counter": "0,1,2,3", 1141 "Counter": "0,1,2,3",
@@ -1120,6 +1148,7 @@
1120 "CounterHTOff": "0,1,2,3" 1148 "CounterHTOff": "0,1,2,3"
1121 }, 1149 },
1122 { 1150 {
1151 "PublicDescription": "Counts all demand code reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1123 "EventCode": "0xB7, 0xBB", 1152 "EventCode": "0xB7, 0xBB",
1124 "MSRValue": "0x02003c0004 ", 1153 "MSRValue": "0x02003c0004 ",
1125 "Counter": "0,1,2,3", 1154 "Counter": "0,1,2,3",
@@ -1132,6 +1161,7 @@
1132 "CounterHTOff": "0,1,2,3" 1161 "CounterHTOff": "0,1,2,3"
1133 }, 1162 },
1134 { 1163 {
1164 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1135 "EventCode": "0xB7, 0xBB", 1165 "EventCode": "0xB7, 0xBB",
1136 "MSRValue": "0x04003c0004 ", 1166 "MSRValue": "0x04003c0004 ",
1137 "Counter": "0,1,2,3", 1167 "Counter": "0,1,2,3",
@@ -1144,6 +1174,7 @@
1144 "CounterHTOff": "0,1,2,3" 1174 "CounterHTOff": "0,1,2,3"
1145 }, 1175 },
1146 { 1176 {
1177 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1147 "EventCode": "0xB7, 0xBB", 1178 "EventCode": "0xB7, 0xBB",
1148 "MSRValue": "0x10003c0004 ", 1179 "MSRValue": "0x10003c0004 ",
1149 "Counter": "0,1,2,3", 1180 "Counter": "0,1,2,3",
@@ -1156,6 +1187,7 @@
1156 "CounterHTOff": "0,1,2,3" 1187 "CounterHTOff": "0,1,2,3"
1157 }, 1188 },
1158 { 1189 {
1190 "PublicDescription": "Counts all demand code reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1159 "EventCode": "0xB7, 0xBB", 1191 "EventCode": "0xB7, 0xBB",
1160 "MSRValue": "0x3f803c0004 ", 1192 "MSRValue": "0x3f803c0004 ",
1161 "Counter": "0,1,2,3", 1193 "Counter": "0,1,2,3",
@@ -1168,6 +1200,7 @@
1168 "CounterHTOff": "0,1,2,3" 1200 "CounterHTOff": "0,1,2,3"
1169 }, 1201 },
1170 { 1202 {
1203 "PublicDescription": "Counts writebacks (modified to exclusive) that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1171 "EventCode": "0xB7, 0xBB", 1204 "EventCode": "0xB7, 0xBB",
1172 "MSRValue": "0x0000010008 ", 1205 "MSRValue": "0x0000010008 ",
1173 "Counter": "0,1,2,3", 1206 "Counter": "0,1,2,3",
@@ -1180,6 +1213,7 @@
1180 "CounterHTOff": "0,1,2,3" 1213 "CounterHTOff": "0,1,2,3"
1181 }, 1214 },
1182 { 1215 {
1216 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1183 "EventCode": "0xB7, 0xBB", 1217 "EventCode": "0xB7, 0xBB",
1184 "MSRValue": "0x0080020008 ", 1218 "MSRValue": "0x0080020008 ",
1185 "Counter": "0,1,2,3", 1219 "Counter": "0,1,2,3",
@@ -1192,6 +1226,7 @@
1192 "CounterHTOff": "0,1,2,3" 1226 "CounterHTOff": "0,1,2,3"
1193 }, 1227 },
1194 { 1228 {
1229 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1195 "EventCode": "0xB7, 0xBB", 1230 "EventCode": "0xB7, 0xBB",
1196 "MSRValue": "0x0100020008 ", 1231 "MSRValue": "0x0100020008 ",
1197 "Counter": "0,1,2,3", 1232 "Counter": "0,1,2,3",
@@ -1204,6 +1239,7 @@
1204 "CounterHTOff": "0,1,2,3" 1239 "CounterHTOff": "0,1,2,3"
1205 }, 1240 },
1206 { 1241 {
1242 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1207 "EventCode": "0xB7, 0xBB", 1243 "EventCode": "0xB7, 0xBB",
1208 "MSRValue": "0x0200020008 ", 1244 "MSRValue": "0x0200020008 ",
1209 "Counter": "0,1,2,3", 1245 "Counter": "0,1,2,3",
@@ -1216,6 +1252,7 @@
1216 "CounterHTOff": "0,1,2,3" 1252 "CounterHTOff": "0,1,2,3"
1217 }, 1253 },
1218 { 1254 {
1255 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1219 "EventCode": "0xB7, 0xBB", 1256 "EventCode": "0xB7, 0xBB",
1220 "MSRValue": "0x0400020008 ", 1257 "MSRValue": "0x0400020008 ",
1221 "Counter": "0,1,2,3", 1258 "Counter": "0,1,2,3",
@@ -1228,6 +1265,7 @@
1228 "CounterHTOff": "0,1,2,3" 1265 "CounterHTOff": "0,1,2,3"
1229 }, 1266 },
1230 { 1267 {
1268 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1231 "EventCode": "0xB7, 0xBB", 1269 "EventCode": "0xB7, 0xBB",
1232 "MSRValue": "0x1000020008 ", 1270 "MSRValue": "0x1000020008 ",
1233 "Counter": "0,1,2,3", 1271 "Counter": "0,1,2,3",
@@ -1240,6 +1278,7 @@
1240 "CounterHTOff": "0,1,2,3" 1278 "CounterHTOff": "0,1,2,3"
1241 }, 1279 },
1242 { 1280 {
1281 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1243 "EventCode": "0xB7, 0xBB", 1282 "EventCode": "0xB7, 0xBB",
1244 "MSRValue": "0x3f80020008 ", 1283 "MSRValue": "0x3f80020008 ",
1245 "Counter": "0,1,2,3", 1284 "Counter": "0,1,2,3",
@@ -1252,6 +1291,7 @@
1252 "CounterHTOff": "0,1,2,3" 1291 "CounterHTOff": "0,1,2,3"
1253 }, 1292 },
1254 { 1293 {
1294 "PublicDescription": "Counts writebacks (modified to exclusive) that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1255 "EventCode": "0xB7, 0xBB", 1295 "EventCode": "0xB7, 0xBB",
1256 "MSRValue": "0x00803c0008 ", 1296 "MSRValue": "0x00803c0008 ",
1257 "Counter": "0,1,2,3", 1297 "Counter": "0,1,2,3",
@@ -1264,6 +1304,7 @@
1264 "CounterHTOff": "0,1,2,3" 1304 "CounterHTOff": "0,1,2,3"
1265 }, 1305 },
1266 { 1306 {
1307 "PublicDescription": "Counts writebacks (modified to exclusive) that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1267 "EventCode": "0xB7, 0xBB", 1308 "EventCode": "0xB7, 0xBB",
1268 "MSRValue": "0x01003c0008 ", 1309 "MSRValue": "0x01003c0008 ",
1269 "Counter": "0,1,2,3", 1310 "Counter": "0,1,2,3",
@@ -1276,6 +1317,7 @@
1276 "CounterHTOff": "0,1,2,3" 1317 "CounterHTOff": "0,1,2,3"
1277 }, 1318 },
1278 { 1319 {
1320 "PublicDescription": "Counts writebacks (modified to exclusive) that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1279 "EventCode": "0xB7, 0xBB", 1321 "EventCode": "0xB7, 0xBB",
1280 "MSRValue": "0x02003c0008 ", 1322 "MSRValue": "0x02003c0008 ",
1281 "Counter": "0,1,2,3", 1323 "Counter": "0,1,2,3",
@@ -1288,6 +1330,7 @@
1288 "CounterHTOff": "0,1,2,3" 1330 "CounterHTOff": "0,1,2,3"
1289 }, 1331 },
1290 { 1332 {
1333 "PublicDescription": "Counts writebacks (modified to exclusive) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1291 "EventCode": "0xB7, 0xBB", 1334 "EventCode": "0xB7, 0xBB",
1292 "MSRValue": "0x04003c0008 ", 1335 "MSRValue": "0x04003c0008 ",
1293 "Counter": "0,1,2,3", 1336 "Counter": "0,1,2,3",
@@ -1300,6 +1343,7 @@
1300 "CounterHTOff": "0,1,2,3" 1343 "CounterHTOff": "0,1,2,3"
1301 }, 1344 },
1302 { 1345 {
1346 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1303 "EventCode": "0xB7, 0xBB", 1347 "EventCode": "0xB7, 0xBB",
1304 "MSRValue": "0x10003c0008 ", 1348 "MSRValue": "0x10003c0008 ",
1305 "Counter": "0,1,2,3", 1349 "Counter": "0,1,2,3",
@@ -1312,6 +1356,7 @@
1312 "CounterHTOff": "0,1,2,3" 1356 "CounterHTOff": "0,1,2,3"
1313 }, 1357 },
1314 { 1358 {
1359 "PublicDescription": "Counts writebacks (modified to exclusive) that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1315 "EventCode": "0xB7, 0xBB", 1360 "EventCode": "0xB7, 0xBB",
1316 "MSRValue": "0x3f803c0008 ", 1361 "MSRValue": "0x3f803c0008 ",
1317 "Counter": "0,1,2,3", 1362 "Counter": "0,1,2,3",
@@ -1324,6 +1369,7 @@
1324 "CounterHTOff": "0,1,2,3" 1369 "CounterHTOff": "0,1,2,3"
1325 }, 1370 },
1326 { 1371 {
1372 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1327 "EventCode": "0xB7, 0xBB", 1373 "EventCode": "0xB7, 0xBB",
1328 "MSRValue": "0x0000010010 ", 1374 "MSRValue": "0x0000010010 ",
1329 "Counter": "0,1,2,3", 1375 "Counter": "0,1,2,3",
@@ -1336,6 +1382,7 @@
1336 "CounterHTOff": "0,1,2,3" 1382 "CounterHTOff": "0,1,2,3"
1337 }, 1383 },
1338 { 1384 {
1385 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1339 "EventCode": "0xB7, 0xBB", 1386 "EventCode": "0xB7, 0xBB",
1340 "MSRValue": "0x0080020010 ", 1387 "MSRValue": "0x0080020010 ",
1341 "Counter": "0,1,2,3", 1388 "Counter": "0,1,2,3",
@@ -1348,6 +1395,7 @@
1348 "CounterHTOff": "0,1,2,3" 1395 "CounterHTOff": "0,1,2,3"
1349 }, 1396 },
1350 { 1397 {
1398 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1351 "EventCode": "0xB7, 0xBB", 1399 "EventCode": "0xB7, 0xBB",
1352 "MSRValue": "0x0100020010 ", 1400 "MSRValue": "0x0100020010 ",
1353 "Counter": "0,1,2,3", 1401 "Counter": "0,1,2,3",
@@ -1360,6 +1408,7 @@
1360 "CounterHTOff": "0,1,2,3" 1408 "CounterHTOff": "0,1,2,3"
1361 }, 1409 },
1362 { 1410 {
1411 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1363 "EventCode": "0xB7, 0xBB", 1412 "EventCode": "0xB7, 0xBB",
1364 "MSRValue": "0x0200020010 ", 1413 "MSRValue": "0x0200020010 ",
1365 "Counter": "0,1,2,3", 1414 "Counter": "0,1,2,3",
@@ -1372,6 +1421,7 @@
1372 "CounterHTOff": "0,1,2,3" 1421 "CounterHTOff": "0,1,2,3"
1373 }, 1422 },
1374 { 1423 {
1424 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1375 "EventCode": "0xB7, 0xBB", 1425 "EventCode": "0xB7, 0xBB",
1376 "MSRValue": "0x0400020010 ", 1426 "MSRValue": "0x0400020010 ",
1377 "Counter": "0,1,2,3", 1427 "Counter": "0,1,2,3",
@@ -1384,6 +1434,7 @@
1384 "CounterHTOff": "0,1,2,3" 1434 "CounterHTOff": "0,1,2,3"
1385 }, 1435 },
1386 { 1436 {
1437 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1387 "EventCode": "0xB7, 0xBB", 1438 "EventCode": "0xB7, 0xBB",
1388 "MSRValue": "0x1000020010 ", 1439 "MSRValue": "0x1000020010 ",
1389 "Counter": "0,1,2,3", 1440 "Counter": "0,1,2,3",
@@ -1396,6 +1447,7 @@
1396 "CounterHTOff": "0,1,2,3" 1447 "CounterHTOff": "0,1,2,3"
1397 }, 1448 },
1398 { 1449 {
1450 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1399 "EventCode": "0xB7, 0xBB", 1451 "EventCode": "0xB7, 0xBB",
1400 "MSRValue": "0x3f80020010 ", 1452 "MSRValue": "0x3f80020010 ",
1401 "Counter": "0,1,2,3", 1453 "Counter": "0,1,2,3",
@@ -1408,6 +1460,7 @@
1408 "CounterHTOff": "0,1,2,3" 1460 "CounterHTOff": "0,1,2,3"
1409 }, 1461 },
1410 { 1462 {
1463 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1411 "EventCode": "0xB7, 0xBB", 1464 "EventCode": "0xB7, 0xBB",
1412 "MSRValue": "0x00803c0010 ", 1465 "MSRValue": "0x00803c0010 ",
1413 "Counter": "0,1,2,3", 1466 "Counter": "0,1,2,3",
@@ -1420,6 +1473,7 @@
1420 "CounterHTOff": "0,1,2,3" 1473 "CounterHTOff": "0,1,2,3"
1421 }, 1474 },
1422 { 1475 {
1476 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1423 "EventCode": "0xB7, 0xBB", 1477 "EventCode": "0xB7, 0xBB",
1424 "MSRValue": "0x01003c0010 ", 1478 "MSRValue": "0x01003c0010 ",
1425 "Counter": "0,1,2,3", 1479 "Counter": "0,1,2,3",
@@ -1432,6 +1486,7 @@
1432 "CounterHTOff": "0,1,2,3" 1486 "CounterHTOff": "0,1,2,3"
1433 }, 1487 },
1434 { 1488 {
1489 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1435 "EventCode": "0xB7, 0xBB", 1490 "EventCode": "0xB7, 0xBB",
1436 "MSRValue": "0x02003c0010 ", 1491 "MSRValue": "0x02003c0010 ",
1437 "Counter": "0,1,2,3", 1492 "Counter": "0,1,2,3",
@@ -1444,6 +1499,7 @@
1444 "CounterHTOff": "0,1,2,3" 1499 "CounterHTOff": "0,1,2,3"
1445 }, 1500 },
1446 { 1501 {
1502 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1447 "EventCode": "0xB7, 0xBB", 1503 "EventCode": "0xB7, 0xBB",
1448 "MSRValue": "0x04003c0010 ", 1504 "MSRValue": "0x04003c0010 ",
1449 "Counter": "0,1,2,3", 1505 "Counter": "0,1,2,3",
@@ -1456,6 +1512,7 @@
1456 "CounterHTOff": "0,1,2,3" 1512 "CounterHTOff": "0,1,2,3"
1457 }, 1513 },
1458 { 1514 {
1515 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1459 "EventCode": "0xB7, 0xBB", 1516 "EventCode": "0xB7, 0xBB",
1460 "MSRValue": "0x10003c0010 ", 1517 "MSRValue": "0x10003c0010 ",
1461 "Counter": "0,1,2,3", 1518 "Counter": "0,1,2,3",
@@ -1468,6 +1525,7 @@
1468 "CounterHTOff": "0,1,2,3" 1525 "CounterHTOff": "0,1,2,3"
1469 }, 1526 },
1470 { 1527 {
1528 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1471 "EventCode": "0xB7, 0xBB", 1529 "EventCode": "0xB7, 0xBB",
1472 "MSRValue": "0x3f803c0010 ", 1530 "MSRValue": "0x3f803c0010 ",
1473 "Counter": "0,1,2,3", 1531 "Counter": "0,1,2,3",
@@ -1480,6 +1538,7 @@
1480 "CounterHTOff": "0,1,2,3" 1538 "CounterHTOff": "0,1,2,3"
1481 }, 1539 },
1482 { 1540 {
1541 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1483 "EventCode": "0xB7, 0xBB", 1542 "EventCode": "0xB7, 0xBB",
1484 "MSRValue": "0x0000010020 ", 1543 "MSRValue": "0x0000010020 ",
1485 "Counter": "0,1,2,3", 1544 "Counter": "0,1,2,3",
@@ -1492,6 +1551,7 @@
1492 "CounterHTOff": "0,1,2,3" 1551 "CounterHTOff": "0,1,2,3"
1493 }, 1552 },
1494 { 1553 {
1554 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1495 "EventCode": "0xB7, 0xBB", 1555 "EventCode": "0xB7, 0xBB",
1496 "MSRValue": "0x0080020020 ", 1556 "MSRValue": "0x0080020020 ",
1497 "Counter": "0,1,2,3", 1557 "Counter": "0,1,2,3",
@@ -1504,6 +1564,7 @@
1504 "CounterHTOff": "0,1,2,3" 1564 "CounterHTOff": "0,1,2,3"
1505 }, 1565 },
1506 { 1566 {
1567 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1507 "EventCode": "0xB7, 0xBB", 1568 "EventCode": "0xB7, 0xBB",
1508 "MSRValue": "0x0100020020 ", 1569 "MSRValue": "0x0100020020 ",
1509 "Counter": "0,1,2,3", 1570 "Counter": "0,1,2,3",
@@ -1516,6 +1577,7 @@
1516 "CounterHTOff": "0,1,2,3" 1577 "CounterHTOff": "0,1,2,3"
1517 }, 1578 },
1518 { 1579 {
1580 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1519 "EventCode": "0xB7, 0xBB", 1581 "EventCode": "0xB7, 0xBB",
1520 "MSRValue": "0x0200020020 ", 1582 "MSRValue": "0x0200020020 ",
1521 "Counter": "0,1,2,3", 1583 "Counter": "0,1,2,3",
@@ -1528,6 +1590,7 @@
1528 "CounterHTOff": "0,1,2,3" 1590 "CounterHTOff": "0,1,2,3"
1529 }, 1591 },
1530 { 1592 {
1593 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1531 "EventCode": "0xB7, 0xBB", 1594 "EventCode": "0xB7, 0xBB",
1532 "MSRValue": "0x0400020020 ", 1595 "MSRValue": "0x0400020020 ",
1533 "Counter": "0,1,2,3", 1596 "Counter": "0,1,2,3",
@@ -1540,6 +1603,7 @@
1540 "CounterHTOff": "0,1,2,3" 1603 "CounterHTOff": "0,1,2,3"
1541 }, 1604 },
1542 { 1605 {
1606 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1543 "EventCode": "0xB7, 0xBB", 1607 "EventCode": "0xB7, 0xBB",
1544 "MSRValue": "0x1000020020 ", 1608 "MSRValue": "0x1000020020 ",
1545 "Counter": "0,1,2,3", 1609 "Counter": "0,1,2,3",
@@ -1552,6 +1616,7 @@
1552 "CounterHTOff": "0,1,2,3" 1616 "CounterHTOff": "0,1,2,3"
1553 }, 1617 },
1554 { 1618 {
1619 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1555 "EventCode": "0xB7, 0xBB", 1620 "EventCode": "0xB7, 0xBB",
1556 "MSRValue": "0x3f80020020 ", 1621 "MSRValue": "0x3f80020020 ",
1557 "Counter": "0,1,2,3", 1622 "Counter": "0,1,2,3",
@@ -1564,6 +1629,7 @@
1564 "CounterHTOff": "0,1,2,3" 1629 "CounterHTOff": "0,1,2,3"
1565 }, 1630 },
1566 { 1631 {
1632 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1567 "EventCode": "0xB7, 0xBB", 1633 "EventCode": "0xB7, 0xBB",
1568 "MSRValue": "0x00803c0020 ", 1634 "MSRValue": "0x00803c0020 ",
1569 "Counter": "0,1,2,3", 1635 "Counter": "0,1,2,3",
@@ -1576,6 +1642,7 @@
1576 "CounterHTOff": "0,1,2,3" 1642 "CounterHTOff": "0,1,2,3"
1577 }, 1643 },
1578 { 1644 {
1645 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1579 "EventCode": "0xB7, 0xBB", 1646 "EventCode": "0xB7, 0xBB",
1580 "MSRValue": "0x01003c0020 ", 1647 "MSRValue": "0x01003c0020 ",
1581 "Counter": "0,1,2,3", 1648 "Counter": "0,1,2,3",
@@ -1588,6 +1655,7 @@
1588 "CounterHTOff": "0,1,2,3" 1655 "CounterHTOff": "0,1,2,3"
1589 }, 1656 },
1590 { 1657 {
1658 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1591 "EventCode": "0xB7, 0xBB", 1659 "EventCode": "0xB7, 0xBB",
1592 "MSRValue": "0x02003c0020 ", 1660 "MSRValue": "0x02003c0020 ",
1593 "Counter": "0,1,2,3", 1661 "Counter": "0,1,2,3",
@@ -1600,6 +1668,7 @@
1600 "CounterHTOff": "0,1,2,3" 1668 "CounterHTOff": "0,1,2,3"
1601 }, 1669 },
1602 { 1670 {
1671 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1603 "EventCode": "0xB7, 0xBB", 1672 "EventCode": "0xB7, 0xBB",
1604 "MSRValue": "0x04003c0020 ", 1673 "MSRValue": "0x04003c0020 ",
1605 "Counter": "0,1,2,3", 1674 "Counter": "0,1,2,3",
@@ -1612,6 +1681,7 @@
1612 "CounterHTOff": "0,1,2,3" 1681 "CounterHTOff": "0,1,2,3"
1613 }, 1682 },
1614 { 1683 {
1684 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1615 "EventCode": "0xB7, 0xBB", 1685 "EventCode": "0xB7, 0xBB",
1616 "MSRValue": "0x10003c0020 ", 1686 "MSRValue": "0x10003c0020 ",
1617 "Counter": "0,1,2,3", 1687 "Counter": "0,1,2,3",
@@ -1624,6 +1694,7 @@
1624 "CounterHTOff": "0,1,2,3" 1694 "CounterHTOff": "0,1,2,3"
1625 }, 1695 },
1626 { 1696 {
1697 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1627 "EventCode": "0xB7, 0xBB", 1698 "EventCode": "0xB7, 0xBB",
1628 "MSRValue": "0x3f803c0020 ", 1699 "MSRValue": "0x3f803c0020 ",
1629 "Counter": "0,1,2,3", 1700 "Counter": "0,1,2,3",
@@ -1636,6 +1707,7 @@
1636 "CounterHTOff": "0,1,2,3" 1707 "CounterHTOff": "0,1,2,3"
1637 }, 1708 },
1638 { 1709 {
1710 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1639 "EventCode": "0xB7, 0xBB", 1711 "EventCode": "0xB7, 0xBB",
1640 "MSRValue": "0x0000010040 ", 1712 "MSRValue": "0x0000010040 ",
1641 "Counter": "0,1,2,3", 1713 "Counter": "0,1,2,3",
@@ -1648,6 +1720,7 @@
1648 "CounterHTOff": "0,1,2,3" 1720 "CounterHTOff": "0,1,2,3"
1649 }, 1721 },
1650 { 1722 {
1723 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1651 "EventCode": "0xB7, 0xBB", 1724 "EventCode": "0xB7, 0xBB",
1652 "MSRValue": "0x0080020040 ", 1725 "MSRValue": "0x0080020040 ",
1653 "Counter": "0,1,2,3", 1726 "Counter": "0,1,2,3",
@@ -1660,6 +1733,7 @@
1660 "CounterHTOff": "0,1,2,3" 1733 "CounterHTOff": "0,1,2,3"
1661 }, 1734 },
1662 { 1735 {
1736 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1663 "EventCode": "0xB7, 0xBB", 1737 "EventCode": "0xB7, 0xBB",
1664 "MSRValue": "0x0100020040 ", 1738 "MSRValue": "0x0100020040 ",
1665 "Counter": "0,1,2,3", 1739 "Counter": "0,1,2,3",
@@ -1672,6 +1746,7 @@
1672 "CounterHTOff": "0,1,2,3" 1746 "CounterHTOff": "0,1,2,3"
1673 }, 1747 },
1674 { 1748 {
1749 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1675 "EventCode": "0xB7, 0xBB", 1750 "EventCode": "0xB7, 0xBB",
1676 "MSRValue": "0x0200020040 ", 1751 "MSRValue": "0x0200020040 ",
1677 "Counter": "0,1,2,3", 1752 "Counter": "0,1,2,3",
@@ -1684,6 +1759,7 @@
1684 "CounterHTOff": "0,1,2,3" 1759 "CounterHTOff": "0,1,2,3"
1685 }, 1760 },
1686 { 1761 {
1762 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1687 "EventCode": "0xB7, 0xBB", 1763 "EventCode": "0xB7, 0xBB",
1688 "MSRValue": "0x0400020040 ", 1764 "MSRValue": "0x0400020040 ",
1689 "Counter": "0,1,2,3", 1765 "Counter": "0,1,2,3",
@@ -1696,6 +1772,7 @@
1696 "CounterHTOff": "0,1,2,3" 1772 "CounterHTOff": "0,1,2,3"
1697 }, 1773 },
1698 { 1774 {
1775 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1699 "EventCode": "0xB7, 0xBB", 1776 "EventCode": "0xB7, 0xBB",
1700 "MSRValue": "0x1000020040 ", 1777 "MSRValue": "0x1000020040 ",
1701 "Counter": "0,1,2,3", 1778 "Counter": "0,1,2,3",
@@ -1708,6 +1785,7 @@
1708 "CounterHTOff": "0,1,2,3" 1785 "CounterHTOff": "0,1,2,3"
1709 }, 1786 },
1710 { 1787 {
1788 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1711 "EventCode": "0xB7, 0xBB", 1789 "EventCode": "0xB7, 0xBB",
1712 "MSRValue": "0x3f80020040 ", 1790 "MSRValue": "0x3f80020040 ",
1713 "Counter": "0,1,2,3", 1791 "Counter": "0,1,2,3",
@@ -1720,6 +1798,7 @@
1720 "CounterHTOff": "0,1,2,3" 1798 "CounterHTOff": "0,1,2,3"
1721 }, 1799 },
1722 { 1800 {
1801 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1723 "EventCode": "0xB7, 0xBB", 1802 "EventCode": "0xB7, 0xBB",
1724 "MSRValue": "0x00803c0040 ", 1803 "MSRValue": "0x00803c0040 ",
1725 "Counter": "0,1,2,3", 1804 "Counter": "0,1,2,3",
@@ -1732,6 +1811,7 @@
1732 "CounterHTOff": "0,1,2,3" 1811 "CounterHTOff": "0,1,2,3"
1733 }, 1812 },
1734 { 1813 {
1814 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1735 "EventCode": "0xB7, 0xBB", 1815 "EventCode": "0xB7, 0xBB",
1736 "MSRValue": "0x01003c0040 ", 1816 "MSRValue": "0x01003c0040 ",
1737 "Counter": "0,1,2,3", 1817 "Counter": "0,1,2,3",
@@ -1744,6 +1824,7 @@
1744 "CounterHTOff": "0,1,2,3" 1824 "CounterHTOff": "0,1,2,3"
1745 }, 1825 },
1746 { 1826 {
1827 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1747 "EventCode": "0xB7, 0xBB", 1828 "EventCode": "0xB7, 0xBB",
1748 "MSRValue": "0x02003c0040 ", 1829 "MSRValue": "0x02003c0040 ",
1749 "Counter": "0,1,2,3", 1830 "Counter": "0,1,2,3",
@@ -1756,6 +1837,7 @@
1756 "CounterHTOff": "0,1,2,3" 1837 "CounterHTOff": "0,1,2,3"
1757 }, 1838 },
1758 { 1839 {
1840 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1759 "EventCode": "0xB7, 0xBB", 1841 "EventCode": "0xB7, 0xBB",
1760 "MSRValue": "0x04003c0040 ", 1842 "MSRValue": "0x04003c0040 ",
1761 "Counter": "0,1,2,3", 1843 "Counter": "0,1,2,3",
@@ -1768,6 +1850,7 @@
1768 "CounterHTOff": "0,1,2,3" 1850 "CounterHTOff": "0,1,2,3"
1769 }, 1851 },
1770 { 1852 {
1853 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1771 "EventCode": "0xB7, 0xBB", 1854 "EventCode": "0xB7, 0xBB",
1772 "MSRValue": "0x10003c0040 ", 1855 "MSRValue": "0x10003c0040 ",
1773 "Counter": "0,1,2,3", 1856 "Counter": "0,1,2,3",
@@ -1780,6 +1863,7 @@
1780 "CounterHTOff": "0,1,2,3" 1863 "CounterHTOff": "0,1,2,3"
1781 }, 1864 },
1782 { 1865 {
1866 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1783 "EventCode": "0xB7, 0xBB", 1867 "EventCode": "0xB7, 0xBB",
1784 "MSRValue": "0x3f803c0040 ", 1868 "MSRValue": "0x3f803c0040 ",
1785 "Counter": "0,1,2,3", 1869 "Counter": "0,1,2,3",
@@ -1792,6 +1876,7 @@
1792 "CounterHTOff": "0,1,2,3" 1876 "CounterHTOff": "0,1,2,3"
1793 }, 1877 },
1794 { 1878 {
1879 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1795 "EventCode": "0xB7, 0xBB", 1880 "EventCode": "0xB7, 0xBB",
1796 "MSRValue": "0x0000010080 ", 1881 "MSRValue": "0x0000010080 ",
1797 "Counter": "0,1,2,3", 1882 "Counter": "0,1,2,3",
@@ -1804,6 +1889,7 @@
1804 "CounterHTOff": "0,1,2,3" 1889 "CounterHTOff": "0,1,2,3"
1805 }, 1890 },
1806 { 1891 {
1892 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1807 "EventCode": "0xB7, 0xBB", 1893 "EventCode": "0xB7, 0xBB",
1808 "MSRValue": "0x0080020080 ", 1894 "MSRValue": "0x0080020080 ",
1809 "Counter": "0,1,2,3", 1895 "Counter": "0,1,2,3",
@@ -1816,6 +1902,7 @@
1816 "CounterHTOff": "0,1,2,3" 1902 "CounterHTOff": "0,1,2,3"
1817 }, 1903 },
1818 { 1904 {
1905 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1819 "EventCode": "0xB7, 0xBB", 1906 "EventCode": "0xB7, 0xBB",
1820 "MSRValue": "0x0100020080 ", 1907 "MSRValue": "0x0100020080 ",
1821 "Counter": "0,1,2,3", 1908 "Counter": "0,1,2,3",
@@ -1828,6 +1915,7 @@
1828 "CounterHTOff": "0,1,2,3" 1915 "CounterHTOff": "0,1,2,3"
1829 }, 1916 },
1830 { 1917 {
1918 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1831 "EventCode": "0xB7, 0xBB", 1919 "EventCode": "0xB7, 0xBB",
1832 "MSRValue": "0x0200020080 ", 1920 "MSRValue": "0x0200020080 ",
1833 "Counter": "0,1,2,3", 1921 "Counter": "0,1,2,3",
@@ -1840,6 +1928,7 @@
1840 "CounterHTOff": "0,1,2,3" 1928 "CounterHTOff": "0,1,2,3"
1841 }, 1929 },
1842 { 1930 {
1931 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1843 "EventCode": "0xB7, 0xBB", 1932 "EventCode": "0xB7, 0xBB",
1844 "MSRValue": "0x0400020080 ", 1933 "MSRValue": "0x0400020080 ",
1845 "Counter": "0,1,2,3", 1934 "Counter": "0,1,2,3",
@@ -1852,6 +1941,7 @@
1852 "CounterHTOff": "0,1,2,3" 1941 "CounterHTOff": "0,1,2,3"
1853 }, 1942 },
1854 { 1943 {
1944 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1855 "EventCode": "0xB7, 0xBB", 1945 "EventCode": "0xB7, 0xBB",
1856 "MSRValue": "0x1000020080 ", 1946 "MSRValue": "0x1000020080 ",
1857 "Counter": "0,1,2,3", 1947 "Counter": "0,1,2,3",
@@ -1864,6 +1954,7 @@
1864 "CounterHTOff": "0,1,2,3" 1954 "CounterHTOff": "0,1,2,3"
1865 }, 1955 },
1866 { 1956 {
1957 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1867 "EventCode": "0xB7, 0xBB", 1958 "EventCode": "0xB7, 0xBB",
1868 "MSRValue": "0x3f80020080 ", 1959 "MSRValue": "0x3f80020080 ",
1869 "Counter": "0,1,2,3", 1960 "Counter": "0,1,2,3",
@@ -1876,6 +1967,7 @@
1876 "CounterHTOff": "0,1,2,3" 1967 "CounterHTOff": "0,1,2,3"
1877 }, 1968 },
1878 { 1969 {
1970 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1879 "EventCode": "0xB7, 0xBB", 1971 "EventCode": "0xB7, 0xBB",
1880 "MSRValue": "0x00803c0080 ", 1972 "MSRValue": "0x00803c0080 ",
1881 "Counter": "0,1,2,3", 1973 "Counter": "0,1,2,3",
@@ -1888,6 +1980,7 @@
1888 "CounterHTOff": "0,1,2,3" 1980 "CounterHTOff": "0,1,2,3"
1889 }, 1981 },
1890 { 1982 {
1983 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1891 "EventCode": "0xB7, 0xBB", 1984 "EventCode": "0xB7, 0xBB",
1892 "MSRValue": "0x01003c0080 ", 1985 "MSRValue": "0x01003c0080 ",
1893 "Counter": "0,1,2,3", 1986 "Counter": "0,1,2,3",
@@ -1900,6 +1993,7 @@
1900 "CounterHTOff": "0,1,2,3" 1993 "CounterHTOff": "0,1,2,3"
1901 }, 1994 },
1902 { 1995 {
1996 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1903 "EventCode": "0xB7, 0xBB", 1997 "EventCode": "0xB7, 0xBB",
1904 "MSRValue": "0x02003c0080 ", 1998 "MSRValue": "0x02003c0080 ",
1905 "Counter": "0,1,2,3", 1999 "Counter": "0,1,2,3",
@@ -1912,6 +2006,7 @@
1912 "CounterHTOff": "0,1,2,3" 2006 "CounterHTOff": "0,1,2,3"
1913 }, 2007 },
1914 { 2008 {
2009 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1915 "EventCode": "0xB7, 0xBB", 2010 "EventCode": "0xB7, 0xBB",
1916 "MSRValue": "0x04003c0080 ", 2011 "MSRValue": "0x04003c0080 ",
1917 "Counter": "0,1,2,3", 2012 "Counter": "0,1,2,3",
@@ -1924,6 +2019,7 @@
1924 "CounterHTOff": "0,1,2,3" 2019 "CounterHTOff": "0,1,2,3"
1925 }, 2020 },
1926 { 2021 {
2022 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1927 "EventCode": "0xB7, 0xBB", 2023 "EventCode": "0xB7, 0xBB",
1928 "MSRValue": "0x10003c0080 ", 2024 "MSRValue": "0x10003c0080 ",
1929 "Counter": "0,1,2,3", 2025 "Counter": "0,1,2,3",
@@ -1936,6 +2032,7 @@
1936 "CounterHTOff": "0,1,2,3" 2032 "CounterHTOff": "0,1,2,3"
1937 }, 2033 },
1938 { 2034 {
2035 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1939 "EventCode": "0xB7, 0xBB", 2036 "EventCode": "0xB7, 0xBB",
1940 "MSRValue": "0x3f803c0080 ", 2037 "MSRValue": "0x3f803c0080 ",
1941 "Counter": "0,1,2,3", 2038 "Counter": "0,1,2,3",
@@ -1948,6 +2045,7 @@
1948 "CounterHTOff": "0,1,2,3" 2045 "CounterHTOff": "0,1,2,3"
1949 }, 2046 },
1950 { 2047 {
2048 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1951 "EventCode": "0xB7, 0xBB", 2049 "EventCode": "0xB7, 0xBB",
1952 "MSRValue": "0x0000010100 ", 2050 "MSRValue": "0x0000010100 ",
1953 "Counter": "0,1,2,3", 2051 "Counter": "0,1,2,3",
@@ -1960,6 +2058,7 @@
1960 "CounterHTOff": "0,1,2,3" 2058 "CounterHTOff": "0,1,2,3"
1961 }, 2059 },
1962 { 2060 {
2061 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1963 "EventCode": "0xB7, 0xBB", 2062 "EventCode": "0xB7, 0xBB",
1964 "MSRValue": "0x0080020100 ", 2063 "MSRValue": "0x0080020100 ",
1965 "Counter": "0,1,2,3", 2064 "Counter": "0,1,2,3",
@@ -1972,6 +2071,7 @@
1972 "CounterHTOff": "0,1,2,3" 2071 "CounterHTOff": "0,1,2,3"
1973 }, 2072 },
1974 { 2073 {
2074 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1975 "EventCode": "0xB7, 0xBB", 2075 "EventCode": "0xB7, 0xBB",
1976 "MSRValue": "0x0100020100 ", 2076 "MSRValue": "0x0100020100 ",
1977 "Counter": "0,1,2,3", 2077 "Counter": "0,1,2,3",
@@ -1984,6 +2084,7 @@
1984 "CounterHTOff": "0,1,2,3" 2084 "CounterHTOff": "0,1,2,3"
1985 }, 2085 },
1986 { 2086 {
2087 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1987 "EventCode": "0xB7, 0xBB", 2088 "EventCode": "0xB7, 0xBB",
1988 "MSRValue": "0x0200020100 ", 2089 "MSRValue": "0x0200020100 ",
1989 "Counter": "0,1,2,3", 2090 "Counter": "0,1,2,3",
@@ -1996,6 +2097,7 @@
1996 "CounterHTOff": "0,1,2,3" 2097 "CounterHTOff": "0,1,2,3"
1997 }, 2098 },
1998 { 2099 {
2100 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1999 "EventCode": "0xB7, 0xBB", 2101 "EventCode": "0xB7, 0xBB",
2000 "MSRValue": "0x0400020100 ", 2102 "MSRValue": "0x0400020100 ",
2001 "Counter": "0,1,2,3", 2103 "Counter": "0,1,2,3",
@@ -2008,6 +2110,7 @@
2008 "CounterHTOff": "0,1,2,3" 2110 "CounterHTOff": "0,1,2,3"
2009 }, 2111 },
2010 { 2112 {
2113 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2011 "EventCode": "0xB7, 0xBB", 2114 "EventCode": "0xB7, 0xBB",
2012 "MSRValue": "0x1000020100 ", 2115 "MSRValue": "0x1000020100 ",
2013 "Counter": "0,1,2,3", 2116 "Counter": "0,1,2,3",
@@ -2020,6 +2123,7 @@
2020 "CounterHTOff": "0,1,2,3" 2123 "CounterHTOff": "0,1,2,3"
2021 }, 2124 },
2022 { 2125 {
2126 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2023 "EventCode": "0xB7, 0xBB", 2127 "EventCode": "0xB7, 0xBB",
2024 "MSRValue": "0x3f80020100 ", 2128 "MSRValue": "0x3f80020100 ",
2025 "Counter": "0,1,2,3", 2129 "Counter": "0,1,2,3",
@@ -2032,6 +2136,7 @@
2032 "CounterHTOff": "0,1,2,3" 2136 "CounterHTOff": "0,1,2,3"
2033 }, 2137 },
2034 { 2138 {
2139 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2035 "EventCode": "0xB7, 0xBB", 2140 "EventCode": "0xB7, 0xBB",
2036 "MSRValue": "0x00803c0100 ", 2141 "MSRValue": "0x00803c0100 ",
2037 "Counter": "0,1,2,3", 2142 "Counter": "0,1,2,3",
@@ -2044,6 +2149,7 @@
2044 "CounterHTOff": "0,1,2,3" 2149 "CounterHTOff": "0,1,2,3"
2045 }, 2150 },
2046 { 2151 {
2152 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2047 "EventCode": "0xB7, 0xBB", 2153 "EventCode": "0xB7, 0xBB",
2048 "MSRValue": "0x01003c0100 ", 2154 "MSRValue": "0x01003c0100 ",
2049 "Counter": "0,1,2,3", 2155 "Counter": "0,1,2,3",
@@ -2056,6 +2162,7 @@
2056 "CounterHTOff": "0,1,2,3" 2162 "CounterHTOff": "0,1,2,3"
2057 }, 2163 },
2058 { 2164 {
2165 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2059 "EventCode": "0xB7, 0xBB", 2166 "EventCode": "0xB7, 0xBB",
2060 "MSRValue": "0x02003c0100 ", 2167 "MSRValue": "0x02003c0100 ",
2061 "Counter": "0,1,2,3", 2168 "Counter": "0,1,2,3",
@@ -2068,6 +2175,7 @@
2068 "CounterHTOff": "0,1,2,3" 2175 "CounterHTOff": "0,1,2,3"
2069 }, 2176 },
2070 { 2177 {
2178 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2071 "EventCode": "0xB7, 0xBB", 2179 "EventCode": "0xB7, 0xBB",
2072 "MSRValue": "0x04003c0100 ", 2180 "MSRValue": "0x04003c0100 ",
2073 "Counter": "0,1,2,3", 2181 "Counter": "0,1,2,3",
@@ -2080,6 +2188,7 @@
2080 "CounterHTOff": "0,1,2,3" 2188 "CounterHTOff": "0,1,2,3"
2081 }, 2189 },
2082 { 2190 {
2191 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2083 "EventCode": "0xB7, 0xBB", 2192 "EventCode": "0xB7, 0xBB",
2084 "MSRValue": "0x10003c0100 ", 2193 "MSRValue": "0x10003c0100 ",
2085 "Counter": "0,1,2,3", 2194 "Counter": "0,1,2,3",
@@ -2092,6 +2201,7 @@
2092 "CounterHTOff": "0,1,2,3" 2201 "CounterHTOff": "0,1,2,3"
2093 }, 2202 },
2094 { 2203 {
2204 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2095 "EventCode": "0xB7, 0xBB", 2205 "EventCode": "0xB7, 0xBB",
2096 "MSRValue": "0x3f803c0100 ", 2206 "MSRValue": "0x3f803c0100 ",
2097 "Counter": "0,1,2,3", 2207 "Counter": "0,1,2,3",
@@ -2104,6 +2214,7 @@
2104 "CounterHTOff": "0,1,2,3" 2214 "CounterHTOff": "0,1,2,3"
2105 }, 2215 },
2106 { 2216 {
2217 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2107 "EventCode": "0xB7, 0xBB", 2218 "EventCode": "0xB7, 0xBB",
2108 "MSRValue": "0x0000010200 ", 2219 "MSRValue": "0x0000010200 ",
2109 "Counter": "0,1,2,3", 2220 "Counter": "0,1,2,3",
@@ -2116,6 +2227,7 @@
2116 "CounterHTOff": "0,1,2,3" 2227 "CounterHTOff": "0,1,2,3"
2117 }, 2228 },
2118 { 2229 {
2230 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2119 "EventCode": "0xB7, 0xBB", 2231 "EventCode": "0xB7, 0xBB",
2120 "MSRValue": "0x0080020200 ", 2232 "MSRValue": "0x0080020200 ",
2121 "Counter": "0,1,2,3", 2233 "Counter": "0,1,2,3",
@@ -2128,6 +2240,7 @@
2128 "CounterHTOff": "0,1,2,3" 2240 "CounterHTOff": "0,1,2,3"
2129 }, 2241 },
2130 { 2242 {
2243 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2131 "EventCode": "0xB7, 0xBB", 2244 "EventCode": "0xB7, 0xBB",
2132 "MSRValue": "0x0100020200 ", 2245 "MSRValue": "0x0100020200 ",
2133 "Counter": "0,1,2,3", 2246 "Counter": "0,1,2,3",
@@ -2140,6 +2253,7 @@
2140 "CounterHTOff": "0,1,2,3" 2253 "CounterHTOff": "0,1,2,3"
2141 }, 2254 },
2142 { 2255 {
2256 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2143 "EventCode": "0xB7, 0xBB", 2257 "EventCode": "0xB7, 0xBB",
2144 "MSRValue": "0x0200020200 ", 2258 "MSRValue": "0x0200020200 ",
2145 "Counter": "0,1,2,3", 2259 "Counter": "0,1,2,3",
@@ -2152,6 +2266,7 @@
2152 "CounterHTOff": "0,1,2,3" 2266 "CounterHTOff": "0,1,2,3"
2153 }, 2267 },
2154 { 2268 {
2269 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2155 "EventCode": "0xB7, 0xBB", 2270 "EventCode": "0xB7, 0xBB",
2156 "MSRValue": "0x0400020200 ", 2271 "MSRValue": "0x0400020200 ",
2157 "Counter": "0,1,2,3", 2272 "Counter": "0,1,2,3",
@@ -2164,6 +2279,7 @@
2164 "CounterHTOff": "0,1,2,3" 2279 "CounterHTOff": "0,1,2,3"
2165 }, 2280 },
2166 { 2281 {
2282 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2167 "EventCode": "0xB7, 0xBB", 2283 "EventCode": "0xB7, 0xBB",
2168 "MSRValue": "0x1000020200 ", 2284 "MSRValue": "0x1000020200 ",
2169 "Counter": "0,1,2,3", 2285 "Counter": "0,1,2,3",
@@ -2176,6 +2292,7 @@
2176 "CounterHTOff": "0,1,2,3" 2292 "CounterHTOff": "0,1,2,3"
2177 }, 2293 },
2178 { 2294 {
2295 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2179 "EventCode": "0xB7, 0xBB", 2296 "EventCode": "0xB7, 0xBB",
2180 "MSRValue": "0x3f80020200 ", 2297 "MSRValue": "0x3f80020200 ",
2181 "Counter": "0,1,2,3", 2298 "Counter": "0,1,2,3",
@@ -2188,6 +2305,7 @@
2188 "CounterHTOff": "0,1,2,3" 2305 "CounterHTOff": "0,1,2,3"
2189 }, 2306 },
2190 { 2307 {
2308 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2191 "EventCode": "0xB7, 0xBB", 2309 "EventCode": "0xB7, 0xBB",
2192 "MSRValue": "0x00803c0200 ", 2310 "MSRValue": "0x00803c0200 ",
2193 "Counter": "0,1,2,3", 2311 "Counter": "0,1,2,3",
@@ -2200,6 +2318,7 @@
2200 "CounterHTOff": "0,1,2,3" 2318 "CounterHTOff": "0,1,2,3"
2201 }, 2319 },
2202 { 2320 {
2321 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2203 "EventCode": "0xB7, 0xBB", 2322 "EventCode": "0xB7, 0xBB",
2204 "MSRValue": "0x01003c0200 ", 2323 "MSRValue": "0x01003c0200 ",
2205 "Counter": "0,1,2,3", 2324 "Counter": "0,1,2,3",
@@ -2212,6 +2331,7 @@
2212 "CounterHTOff": "0,1,2,3" 2331 "CounterHTOff": "0,1,2,3"
2213 }, 2332 },
2214 { 2333 {
2334 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2215 "EventCode": "0xB7, 0xBB", 2335 "EventCode": "0xB7, 0xBB",
2216 "MSRValue": "0x02003c0200 ", 2336 "MSRValue": "0x02003c0200 ",
2217 "Counter": "0,1,2,3", 2337 "Counter": "0,1,2,3",
@@ -2224,6 +2344,7 @@
2224 "CounterHTOff": "0,1,2,3" 2344 "CounterHTOff": "0,1,2,3"
2225 }, 2345 },
2226 { 2346 {
2347 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2227 "EventCode": "0xB7, 0xBB", 2348 "EventCode": "0xB7, 0xBB",
2228 "MSRValue": "0x04003c0200 ", 2349 "MSRValue": "0x04003c0200 ",
2229 "Counter": "0,1,2,3", 2350 "Counter": "0,1,2,3",
@@ -2236,6 +2357,7 @@
2236 "CounterHTOff": "0,1,2,3" 2357 "CounterHTOff": "0,1,2,3"
2237 }, 2358 },
2238 { 2359 {
2360 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2239 "EventCode": "0xB7, 0xBB", 2361 "EventCode": "0xB7, 0xBB",
2240 "MSRValue": "0x10003c0200 ", 2362 "MSRValue": "0x10003c0200 ",
2241 "Counter": "0,1,2,3", 2363 "Counter": "0,1,2,3",
@@ -2248,6 +2370,7 @@
2248 "CounterHTOff": "0,1,2,3" 2370 "CounterHTOff": "0,1,2,3"
2249 }, 2371 },
2250 { 2372 {
2373 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2251 "EventCode": "0xB7, 0xBB", 2374 "EventCode": "0xB7, 0xBB",
2252 "MSRValue": "0x3f803c0200 ", 2375 "MSRValue": "0x3f803c0200 ",
2253 "Counter": "0,1,2,3", 2376 "Counter": "0,1,2,3",
@@ -2260,6 +2383,7 @@
2260 "CounterHTOff": "0,1,2,3" 2383 "CounterHTOff": "0,1,2,3"
2261 }, 2384 },
2262 { 2385 {
2386 "PublicDescription": "Counts any other requests that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2263 "EventCode": "0xB7, 0xBB", 2387 "EventCode": "0xB7, 0xBB",
2264 "MSRValue": "0x0000018000 ", 2388 "MSRValue": "0x0000018000 ",
2265 "Counter": "0,1,2,3", 2389 "Counter": "0,1,2,3",
@@ -2272,6 +2396,7 @@
2272 "CounterHTOff": "0,1,2,3" 2396 "CounterHTOff": "0,1,2,3"
2273 }, 2397 },
2274 { 2398 {
2399 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2275 "EventCode": "0xB7, 0xBB", 2400 "EventCode": "0xB7, 0xBB",
2276 "MSRValue": "0x0080028000 ", 2401 "MSRValue": "0x0080028000 ",
2277 "Counter": "0,1,2,3", 2402 "Counter": "0,1,2,3",
@@ -2284,6 +2409,7 @@
2284 "CounterHTOff": "0,1,2,3" 2409 "CounterHTOff": "0,1,2,3"
2285 }, 2410 },
2286 { 2411 {
2412 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2287 "EventCode": "0xB7, 0xBB", 2413 "EventCode": "0xB7, 0xBB",
2288 "MSRValue": "0x0100028000 ", 2414 "MSRValue": "0x0100028000 ",
2289 "Counter": "0,1,2,3", 2415 "Counter": "0,1,2,3",
@@ -2296,6 +2422,7 @@
2296 "CounterHTOff": "0,1,2,3" 2422 "CounterHTOff": "0,1,2,3"
2297 }, 2423 },
2298 { 2424 {
2425 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2299 "EventCode": "0xB7, 0xBB", 2426 "EventCode": "0xB7, 0xBB",
2300 "MSRValue": "0x0200028000 ", 2427 "MSRValue": "0x0200028000 ",
2301 "Counter": "0,1,2,3", 2428 "Counter": "0,1,2,3",
@@ -2308,6 +2435,7 @@
2308 "CounterHTOff": "0,1,2,3" 2435 "CounterHTOff": "0,1,2,3"
2309 }, 2436 },
2310 { 2437 {
2438 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2311 "EventCode": "0xB7, 0xBB", 2439 "EventCode": "0xB7, 0xBB",
2312 "MSRValue": "0x0400028000 ", 2440 "MSRValue": "0x0400028000 ",
2313 "Counter": "0,1,2,3", 2441 "Counter": "0,1,2,3",
@@ -2320,6 +2448,7 @@
2320 "CounterHTOff": "0,1,2,3" 2448 "CounterHTOff": "0,1,2,3"
2321 }, 2449 },
2322 { 2450 {
2451 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2323 "EventCode": "0xB7, 0xBB", 2452 "EventCode": "0xB7, 0xBB",
2324 "MSRValue": "0x1000028000 ", 2453 "MSRValue": "0x1000028000 ",
2325 "Counter": "0,1,2,3", 2454 "Counter": "0,1,2,3",
@@ -2332,6 +2461,7 @@
2332 "CounterHTOff": "0,1,2,3" 2461 "CounterHTOff": "0,1,2,3"
2333 }, 2462 },
2334 { 2463 {
2464 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2335 "EventCode": "0xB7, 0xBB", 2465 "EventCode": "0xB7, 0xBB",
2336 "MSRValue": "0x3f80028000 ", 2466 "MSRValue": "0x3f80028000 ",
2337 "Counter": "0,1,2,3", 2467 "Counter": "0,1,2,3",
@@ -2344,6 +2474,7 @@
2344 "CounterHTOff": "0,1,2,3" 2474 "CounterHTOff": "0,1,2,3"
2345 }, 2475 },
2346 { 2476 {
2477 "PublicDescription": "Counts any other requests that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2347 "EventCode": "0xB7, 0xBB", 2478 "EventCode": "0xB7, 0xBB",
2348 "MSRValue": "0x00803c8000 ", 2479 "MSRValue": "0x00803c8000 ",
2349 "Counter": "0,1,2,3", 2480 "Counter": "0,1,2,3",
@@ -2356,6 +2487,7 @@
2356 "CounterHTOff": "0,1,2,3" 2487 "CounterHTOff": "0,1,2,3"
2357 }, 2488 },
2358 { 2489 {
2490 "PublicDescription": "Counts any other requests that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2359 "EventCode": "0xB7, 0xBB", 2491 "EventCode": "0xB7, 0xBB",
2360 "MSRValue": "0x01003c8000 ", 2492 "MSRValue": "0x01003c8000 ",
2361 "Counter": "0,1,2,3", 2493 "Counter": "0,1,2,3",
@@ -2368,6 +2500,7 @@
2368 "CounterHTOff": "0,1,2,3" 2500 "CounterHTOff": "0,1,2,3"
2369 }, 2501 },
2370 { 2502 {
2503 "PublicDescription": "Counts any other requests that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2371 "EventCode": "0xB7, 0xBB", 2504 "EventCode": "0xB7, 0xBB",
2372 "MSRValue": "0x02003c8000 ", 2505 "MSRValue": "0x02003c8000 ",
2373 "Counter": "0,1,2,3", 2506 "Counter": "0,1,2,3",
@@ -2380,6 +2513,7 @@
2380 "CounterHTOff": "0,1,2,3" 2513 "CounterHTOff": "0,1,2,3"
2381 }, 2514 },
2382 { 2515 {
2516 "PublicDescription": "Counts any other requests that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2383 "EventCode": "0xB7, 0xBB", 2517 "EventCode": "0xB7, 0xBB",
2384 "MSRValue": "0x04003c8000 ", 2518 "MSRValue": "0x04003c8000 ",
2385 "Counter": "0,1,2,3", 2519 "Counter": "0,1,2,3",
@@ -2392,6 +2526,7 @@
2392 "CounterHTOff": "0,1,2,3" 2526 "CounterHTOff": "0,1,2,3"
2393 }, 2527 },
2394 { 2528 {
2529 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2395 "EventCode": "0xB7, 0xBB", 2530 "EventCode": "0xB7, 0xBB",
2396 "MSRValue": "0x10003c8000 ", 2531 "MSRValue": "0x10003c8000 ",
2397 "Counter": "0,1,2,3", 2532 "Counter": "0,1,2,3",
@@ -2404,6 +2539,7 @@
2404 "CounterHTOff": "0,1,2,3" 2539 "CounterHTOff": "0,1,2,3"
2405 }, 2540 },
2406 { 2541 {
2542 "PublicDescription": "Counts any other requests that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2407 "EventCode": "0xB7, 0xBB", 2543 "EventCode": "0xB7, 0xBB",
2408 "MSRValue": "0x3f803c8000 ", 2544 "MSRValue": "0x3f803c8000 ",
2409 "Counter": "0,1,2,3", 2545 "Counter": "0,1,2,3",
@@ -2416,6 +2552,7 @@
2416 "CounterHTOff": "0,1,2,3" 2552 "CounterHTOff": "0,1,2,3"
2417 }, 2553 },
2418 { 2554 {
2555 "PublicDescription": "Counts all prefetch data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2419 "EventCode": "0xB7, 0xBB", 2556 "EventCode": "0xB7, 0xBB",
2420 "MSRValue": "0x0000010090 ", 2557 "MSRValue": "0x0000010090 ",
2421 "Counter": "0,1,2,3", 2558 "Counter": "0,1,2,3",
@@ -2428,6 +2565,7 @@
2428 "CounterHTOff": "0,1,2,3" 2565 "CounterHTOff": "0,1,2,3"
2429 }, 2566 },
2430 { 2567 {
2568 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2431 "EventCode": "0xB7, 0xBB", 2569 "EventCode": "0xB7, 0xBB",
2432 "MSRValue": "0x0080020090 ", 2570 "MSRValue": "0x0080020090 ",
2433 "Counter": "0,1,2,3", 2571 "Counter": "0,1,2,3",
@@ -2440,6 +2578,7 @@
2440 "CounterHTOff": "0,1,2,3" 2578 "CounterHTOff": "0,1,2,3"
2441 }, 2579 },
2442 { 2580 {
2581 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2443 "EventCode": "0xB7, 0xBB", 2582 "EventCode": "0xB7, 0xBB",
2444 "MSRValue": "0x0100020090 ", 2583 "MSRValue": "0x0100020090 ",
2445 "Counter": "0,1,2,3", 2584 "Counter": "0,1,2,3",
@@ -2452,6 +2591,7 @@
2452 "CounterHTOff": "0,1,2,3" 2591 "CounterHTOff": "0,1,2,3"
2453 }, 2592 },
2454 { 2593 {
2594 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2455 "EventCode": "0xB7, 0xBB", 2595 "EventCode": "0xB7, 0xBB",
2456 "MSRValue": "0x0200020090 ", 2596 "MSRValue": "0x0200020090 ",
2457 "Counter": "0,1,2,3", 2597 "Counter": "0,1,2,3",
@@ -2464,6 +2604,7 @@
2464 "CounterHTOff": "0,1,2,3" 2604 "CounterHTOff": "0,1,2,3"
2465 }, 2605 },
2466 { 2606 {
2607 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2467 "EventCode": "0xB7, 0xBB", 2608 "EventCode": "0xB7, 0xBB",
2468 "MSRValue": "0x0400020090 ", 2609 "MSRValue": "0x0400020090 ",
2469 "Counter": "0,1,2,3", 2610 "Counter": "0,1,2,3",
@@ -2476,6 +2617,7 @@
2476 "CounterHTOff": "0,1,2,3" 2617 "CounterHTOff": "0,1,2,3"
2477 }, 2618 },
2478 { 2619 {
2620 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2479 "EventCode": "0xB7, 0xBB", 2621 "EventCode": "0xB7, 0xBB",
2480 "MSRValue": "0x1000020090 ", 2622 "MSRValue": "0x1000020090 ",
2481 "Counter": "0,1,2,3", 2623 "Counter": "0,1,2,3",
@@ -2488,6 +2630,7 @@
2488 "CounterHTOff": "0,1,2,3" 2630 "CounterHTOff": "0,1,2,3"
2489 }, 2631 },
2490 { 2632 {
2633 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2491 "EventCode": "0xB7, 0xBB", 2634 "EventCode": "0xB7, 0xBB",
2492 "MSRValue": "0x3f80020090 ", 2635 "MSRValue": "0x3f80020090 ",
2493 "Counter": "0,1,2,3", 2636 "Counter": "0,1,2,3",
@@ -2500,6 +2643,7 @@
2500 "CounterHTOff": "0,1,2,3" 2643 "CounterHTOff": "0,1,2,3"
2501 }, 2644 },
2502 { 2645 {
2646 "PublicDescription": "Counts all prefetch data reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2503 "EventCode": "0xB7, 0xBB", 2647 "EventCode": "0xB7, 0xBB",
2504 "MSRValue": "0x00803c0090 ", 2648 "MSRValue": "0x00803c0090 ",
2505 "Counter": "0,1,2,3", 2649 "Counter": "0,1,2,3",
@@ -2512,6 +2656,7 @@
2512 "CounterHTOff": "0,1,2,3" 2656 "CounterHTOff": "0,1,2,3"
2513 }, 2657 },
2514 { 2658 {
2659 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2515 "EventCode": "0xB7, 0xBB", 2660 "EventCode": "0xB7, 0xBB",
2516 "MSRValue": "0x01003c0090 ", 2661 "MSRValue": "0x01003c0090 ",
2517 "Counter": "0,1,2,3", 2662 "Counter": "0,1,2,3",
@@ -2524,6 +2669,7 @@
2524 "CounterHTOff": "0,1,2,3" 2669 "CounterHTOff": "0,1,2,3"
2525 }, 2670 },
2526 { 2671 {
2672 "PublicDescription": "Counts all prefetch data reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2527 "EventCode": "0xB7, 0xBB", 2673 "EventCode": "0xB7, 0xBB",
2528 "MSRValue": "0x02003c0090 ", 2674 "MSRValue": "0x02003c0090 ",
2529 "Counter": "0,1,2,3", 2675 "Counter": "0,1,2,3",
@@ -2536,6 +2682,7 @@
2536 "CounterHTOff": "0,1,2,3" 2682 "CounterHTOff": "0,1,2,3"
2537 }, 2683 },
2538 { 2684 {
2685 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2539 "EventCode": "0xB7, 0xBB", 2686 "EventCode": "0xB7, 0xBB",
2540 "MSRValue": "0x04003c0090 ", 2687 "MSRValue": "0x04003c0090 ",
2541 "Counter": "0,1,2,3", 2688 "Counter": "0,1,2,3",
@@ -2548,6 +2695,7 @@
2548 "CounterHTOff": "0,1,2,3" 2695 "CounterHTOff": "0,1,2,3"
2549 }, 2696 },
2550 { 2697 {
2698 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2551 "EventCode": "0xB7, 0xBB", 2699 "EventCode": "0xB7, 0xBB",
2552 "MSRValue": "0x10003c0090 ", 2700 "MSRValue": "0x10003c0090 ",
2553 "Counter": "0,1,2,3", 2701 "Counter": "0,1,2,3",
@@ -2560,6 +2708,7 @@
2560 "CounterHTOff": "0,1,2,3" 2708 "CounterHTOff": "0,1,2,3"
2561 }, 2709 },
2562 { 2710 {
2711 "PublicDescription": "Counts all prefetch data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2563 "EventCode": "0xB7, 0xBB", 2712 "EventCode": "0xB7, 0xBB",
2564 "MSRValue": "0x3f803c0090 ", 2713 "MSRValue": "0x3f803c0090 ",
2565 "Counter": "0,1,2,3", 2714 "Counter": "0,1,2,3",
@@ -2572,6 +2721,7 @@
2572 "CounterHTOff": "0,1,2,3" 2721 "CounterHTOff": "0,1,2,3"
2573 }, 2722 },
2574 { 2723 {
2724 "PublicDescription": "Counts prefetch RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2575 "EventCode": "0xB7, 0xBB", 2725 "EventCode": "0xB7, 0xBB",
2576 "MSRValue": "0x0000010120 ", 2726 "MSRValue": "0x0000010120 ",
2577 "Counter": "0,1,2,3", 2727 "Counter": "0,1,2,3",
@@ -2584,6 +2734,7 @@
2584 "CounterHTOff": "0,1,2,3" 2734 "CounterHTOff": "0,1,2,3"
2585 }, 2735 },
2586 { 2736 {
2737 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2587 "EventCode": "0xB7, 0xBB", 2738 "EventCode": "0xB7, 0xBB",
2588 "MSRValue": "0x0080020120 ", 2739 "MSRValue": "0x0080020120 ",
2589 "Counter": "0,1,2,3", 2740 "Counter": "0,1,2,3",
@@ -2596,6 +2747,7 @@
2596 "CounterHTOff": "0,1,2,3" 2747 "CounterHTOff": "0,1,2,3"
2597 }, 2748 },
2598 { 2749 {
2750 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2599 "EventCode": "0xB7, 0xBB", 2751 "EventCode": "0xB7, 0xBB",
2600 "MSRValue": "0x0100020120 ", 2752 "MSRValue": "0x0100020120 ",
2601 "Counter": "0,1,2,3", 2753 "Counter": "0,1,2,3",
@@ -2608,6 +2760,7 @@
2608 "CounterHTOff": "0,1,2,3" 2760 "CounterHTOff": "0,1,2,3"
2609 }, 2761 },
2610 { 2762 {
2763 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2611 "EventCode": "0xB7, 0xBB", 2764 "EventCode": "0xB7, 0xBB",
2612 "MSRValue": "0x0200020120 ", 2765 "MSRValue": "0x0200020120 ",
2613 "Counter": "0,1,2,3", 2766 "Counter": "0,1,2,3",
@@ -2620,6 +2773,7 @@
2620 "CounterHTOff": "0,1,2,3" 2773 "CounterHTOff": "0,1,2,3"
2621 }, 2774 },
2622 { 2775 {
2776 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2623 "EventCode": "0xB7, 0xBB", 2777 "EventCode": "0xB7, 0xBB",
2624 "MSRValue": "0x0400020120 ", 2778 "MSRValue": "0x0400020120 ",
2625 "Counter": "0,1,2,3", 2779 "Counter": "0,1,2,3",
@@ -2632,6 +2786,7 @@
2632 "CounterHTOff": "0,1,2,3" 2786 "CounterHTOff": "0,1,2,3"
2633 }, 2787 },
2634 { 2788 {
2789 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2635 "EventCode": "0xB7, 0xBB", 2790 "EventCode": "0xB7, 0xBB",
2636 "MSRValue": "0x1000020120 ", 2791 "MSRValue": "0x1000020120 ",
2637 "Counter": "0,1,2,3", 2792 "Counter": "0,1,2,3",
@@ -2644,6 +2799,7 @@
2644 "CounterHTOff": "0,1,2,3" 2799 "CounterHTOff": "0,1,2,3"
2645 }, 2800 },
2646 { 2801 {
2802 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2647 "EventCode": "0xB7, 0xBB", 2803 "EventCode": "0xB7, 0xBB",
2648 "MSRValue": "0x3f80020120 ", 2804 "MSRValue": "0x3f80020120 ",
2649 "Counter": "0,1,2,3", 2805 "Counter": "0,1,2,3",
@@ -2656,6 +2812,7 @@
2656 "CounterHTOff": "0,1,2,3" 2812 "CounterHTOff": "0,1,2,3"
2657 }, 2813 },
2658 { 2814 {
2815 "PublicDescription": "Counts prefetch RFOs that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2659 "EventCode": "0xB7, 0xBB", 2816 "EventCode": "0xB7, 0xBB",
2660 "MSRValue": "0x00803c0120 ", 2817 "MSRValue": "0x00803c0120 ",
2661 "Counter": "0,1,2,3", 2818 "Counter": "0,1,2,3",
@@ -2668,6 +2825,7 @@
2668 "CounterHTOff": "0,1,2,3" 2825 "CounterHTOff": "0,1,2,3"
2669 }, 2826 },
2670 { 2827 {
2828 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2671 "EventCode": "0xB7, 0xBB", 2829 "EventCode": "0xB7, 0xBB",
2672 "MSRValue": "0x01003c0120 ", 2830 "MSRValue": "0x01003c0120 ",
2673 "Counter": "0,1,2,3", 2831 "Counter": "0,1,2,3",
@@ -2680,6 +2838,7 @@
2680 "CounterHTOff": "0,1,2,3" 2838 "CounterHTOff": "0,1,2,3"
2681 }, 2839 },
2682 { 2840 {
2841 "PublicDescription": "Counts prefetch RFOs that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2683 "EventCode": "0xB7, 0xBB", 2842 "EventCode": "0xB7, 0xBB",
2684 "MSRValue": "0x02003c0120 ", 2843 "MSRValue": "0x02003c0120 ",
2685 "Counter": "0,1,2,3", 2844 "Counter": "0,1,2,3",
@@ -2692,6 +2851,7 @@
2692 "CounterHTOff": "0,1,2,3" 2851 "CounterHTOff": "0,1,2,3"
2693 }, 2852 },
2694 { 2853 {
2854 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2695 "EventCode": "0xB7, 0xBB", 2855 "EventCode": "0xB7, 0xBB",
2696 "MSRValue": "0x04003c0120 ", 2856 "MSRValue": "0x04003c0120 ",
2697 "Counter": "0,1,2,3", 2857 "Counter": "0,1,2,3",
@@ -2704,6 +2864,7 @@
2704 "CounterHTOff": "0,1,2,3" 2864 "CounterHTOff": "0,1,2,3"
2705 }, 2865 },
2706 { 2866 {
2867 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2707 "EventCode": "0xB7, 0xBB", 2868 "EventCode": "0xB7, 0xBB",
2708 "MSRValue": "0x10003c0120 ", 2869 "MSRValue": "0x10003c0120 ",
2709 "Counter": "0,1,2,3", 2870 "Counter": "0,1,2,3",
@@ -2716,6 +2877,7 @@
2716 "CounterHTOff": "0,1,2,3" 2877 "CounterHTOff": "0,1,2,3"
2717 }, 2878 },
2718 { 2879 {
2880 "PublicDescription": "Counts prefetch RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2719 "EventCode": "0xB7, 0xBB", 2881 "EventCode": "0xB7, 0xBB",
2720 "MSRValue": "0x3f803c0120 ", 2882 "MSRValue": "0x3f803c0120 ",
2721 "Counter": "0,1,2,3", 2883 "Counter": "0,1,2,3",
@@ -2728,6 +2890,7 @@
2728 "CounterHTOff": "0,1,2,3" 2890 "CounterHTOff": "0,1,2,3"
2729 }, 2891 },
2730 { 2892 {
2893 "PublicDescription": "Counts all prefetch code reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2731 "EventCode": "0xB7, 0xBB", 2894 "EventCode": "0xB7, 0xBB",
2732 "MSRValue": "0x0000010240 ", 2895 "MSRValue": "0x0000010240 ",
2733 "Counter": "0,1,2,3", 2896 "Counter": "0,1,2,3",
@@ -2740,6 +2903,7 @@
2740 "CounterHTOff": "0,1,2,3" 2903 "CounterHTOff": "0,1,2,3"
2741 }, 2904 },
2742 { 2905 {
2906 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2743 "EventCode": "0xB7, 0xBB", 2907 "EventCode": "0xB7, 0xBB",
2744 "MSRValue": "0x0080020240 ", 2908 "MSRValue": "0x0080020240 ",
2745 "Counter": "0,1,2,3", 2909 "Counter": "0,1,2,3",
@@ -2752,6 +2916,7 @@
2752 "CounterHTOff": "0,1,2,3" 2916 "CounterHTOff": "0,1,2,3"
2753 }, 2917 },
2754 { 2918 {
2919 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2755 "EventCode": "0xB7, 0xBB", 2920 "EventCode": "0xB7, 0xBB",
2756 "MSRValue": "0x0100020240 ", 2921 "MSRValue": "0x0100020240 ",
2757 "Counter": "0,1,2,3", 2922 "Counter": "0,1,2,3",
@@ -2764,6 +2929,7 @@
2764 "CounterHTOff": "0,1,2,3" 2929 "CounterHTOff": "0,1,2,3"
2765 }, 2930 },
2766 { 2931 {
2932 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2767 "EventCode": "0xB7, 0xBB", 2933 "EventCode": "0xB7, 0xBB",
2768 "MSRValue": "0x0200020240 ", 2934 "MSRValue": "0x0200020240 ",
2769 "Counter": "0,1,2,3", 2935 "Counter": "0,1,2,3",
@@ -2776,6 +2942,7 @@
2776 "CounterHTOff": "0,1,2,3" 2942 "CounterHTOff": "0,1,2,3"
2777 }, 2943 },
2778 { 2944 {
2945 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2779 "EventCode": "0xB7, 0xBB", 2946 "EventCode": "0xB7, 0xBB",
2780 "MSRValue": "0x0400020240 ", 2947 "MSRValue": "0x0400020240 ",
2781 "Counter": "0,1,2,3", 2948 "Counter": "0,1,2,3",
@@ -2788,6 +2955,7 @@
2788 "CounterHTOff": "0,1,2,3" 2955 "CounterHTOff": "0,1,2,3"
2789 }, 2956 },
2790 { 2957 {
2958 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2791 "EventCode": "0xB7, 0xBB", 2959 "EventCode": "0xB7, 0xBB",
2792 "MSRValue": "0x1000020240 ", 2960 "MSRValue": "0x1000020240 ",
2793 "Counter": "0,1,2,3", 2961 "Counter": "0,1,2,3",
@@ -2800,6 +2968,7 @@
2800 "CounterHTOff": "0,1,2,3" 2968 "CounterHTOff": "0,1,2,3"
2801 }, 2969 },
2802 { 2970 {
2971 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2803 "EventCode": "0xB7, 0xBB", 2972 "EventCode": "0xB7, 0xBB",
2804 "MSRValue": "0x3f80020240 ", 2973 "MSRValue": "0x3f80020240 ",
2805 "Counter": "0,1,2,3", 2974 "Counter": "0,1,2,3",
@@ -2812,6 +2981,7 @@
2812 "CounterHTOff": "0,1,2,3" 2981 "CounterHTOff": "0,1,2,3"
2813 }, 2982 },
2814 { 2983 {
2984 "PublicDescription": "Counts all prefetch code reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2815 "EventCode": "0xB7, 0xBB", 2985 "EventCode": "0xB7, 0xBB",
2816 "MSRValue": "0x00803c0240 ", 2986 "MSRValue": "0x00803c0240 ",
2817 "Counter": "0,1,2,3", 2987 "Counter": "0,1,2,3",
@@ -2824,6 +2994,7 @@
2824 "CounterHTOff": "0,1,2,3" 2994 "CounterHTOff": "0,1,2,3"
2825 }, 2995 },
2826 { 2996 {
2997 "PublicDescription": "Counts all prefetch code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2827 "EventCode": "0xB7, 0xBB", 2998 "EventCode": "0xB7, 0xBB",
2828 "MSRValue": "0x01003c0240 ", 2999 "MSRValue": "0x01003c0240 ",
2829 "Counter": "0,1,2,3", 3000 "Counter": "0,1,2,3",
@@ -2836,6 +3007,7 @@
2836 "CounterHTOff": "0,1,2,3" 3007 "CounterHTOff": "0,1,2,3"
2837 }, 3008 },
2838 { 3009 {
3010 "PublicDescription": "Counts all prefetch code reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2839 "EventCode": "0xB7, 0xBB", 3011 "EventCode": "0xB7, 0xBB",
2840 "MSRValue": "0x02003c0240 ", 3012 "MSRValue": "0x02003c0240 ",
2841 "Counter": "0,1,2,3", 3013 "Counter": "0,1,2,3",
@@ -2848,6 +3020,7 @@
2848 "CounterHTOff": "0,1,2,3" 3020 "CounterHTOff": "0,1,2,3"
2849 }, 3021 },
2850 { 3022 {
3023 "PublicDescription": "Counts all prefetch code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2851 "EventCode": "0xB7, 0xBB", 3024 "EventCode": "0xB7, 0xBB",
2852 "MSRValue": "0x04003c0240 ", 3025 "MSRValue": "0x04003c0240 ",
2853 "Counter": "0,1,2,3", 3026 "Counter": "0,1,2,3",
@@ -2860,6 +3033,7 @@
2860 "CounterHTOff": "0,1,2,3" 3033 "CounterHTOff": "0,1,2,3"
2861 }, 3034 },
2862 { 3035 {
3036 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2863 "EventCode": "0xB7, 0xBB", 3037 "EventCode": "0xB7, 0xBB",
2864 "MSRValue": "0x10003c0240 ", 3038 "MSRValue": "0x10003c0240 ",
2865 "Counter": "0,1,2,3", 3039 "Counter": "0,1,2,3",
@@ -2872,6 +3046,7 @@
2872 "CounterHTOff": "0,1,2,3" 3046 "CounterHTOff": "0,1,2,3"
2873 }, 3047 },
2874 { 3048 {
3049 "PublicDescription": "Counts all prefetch code reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2875 "EventCode": "0xB7, 0xBB", 3050 "EventCode": "0xB7, 0xBB",
2876 "MSRValue": "0x3f803c0240 ", 3051 "MSRValue": "0x3f803c0240 ",
2877 "Counter": "0,1,2,3", 3052 "Counter": "0,1,2,3",
@@ -2884,6 +3059,7 @@
2884 "CounterHTOff": "0,1,2,3" 3059 "CounterHTOff": "0,1,2,3"
2885 }, 3060 },
2886 { 3061 {
3062 "PublicDescription": "Counts all demand & prefetch data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2887 "EventCode": "0xB7, 0xBB", 3063 "EventCode": "0xB7, 0xBB",
2888 "MSRValue": "0x0000010091 ", 3064 "MSRValue": "0x0000010091 ",
2889 "Counter": "0,1,2,3", 3065 "Counter": "0,1,2,3",
@@ -2896,6 +3072,7 @@
2896 "CounterHTOff": "0,1,2,3" 3072 "CounterHTOff": "0,1,2,3"
2897 }, 3073 },
2898 { 3074 {
3075 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2899 "EventCode": "0xB7, 0xBB", 3076 "EventCode": "0xB7, 0xBB",
2900 "MSRValue": "0x0080020091 ", 3077 "MSRValue": "0x0080020091 ",
2901 "Counter": "0,1,2,3", 3078 "Counter": "0,1,2,3",
@@ -2908,6 +3085,7 @@
2908 "CounterHTOff": "0,1,2,3" 3085 "CounterHTOff": "0,1,2,3"
2909 }, 3086 },
2910 { 3087 {
3088 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2911 "EventCode": "0xB7, 0xBB", 3089 "EventCode": "0xB7, 0xBB",
2912 "MSRValue": "0x0100020091 ", 3090 "MSRValue": "0x0100020091 ",
2913 "Counter": "0,1,2,3", 3091 "Counter": "0,1,2,3",
@@ -2920,6 +3098,7 @@
2920 "CounterHTOff": "0,1,2,3" 3098 "CounterHTOff": "0,1,2,3"
2921 }, 3099 },
2922 { 3100 {
3101 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2923 "EventCode": "0xB7, 0xBB", 3102 "EventCode": "0xB7, 0xBB",
2924 "MSRValue": "0x0200020091 ", 3103 "MSRValue": "0x0200020091 ",
2925 "Counter": "0,1,2,3", 3104 "Counter": "0,1,2,3",
@@ -2932,6 +3111,7 @@
2932 "CounterHTOff": "0,1,2,3" 3111 "CounterHTOff": "0,1,2,3"
2933 }, 3112 },
2934 { 3113 {
3114 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2935 "EventCode": "0xB7, 0xBB", 3115 "EventCode": "0xB7, 0xBB",
2936 "MSRValue": "0x0400020091 ", 3116 "MSRValue": "0x0400020091 ",
2937 "Counter": "0,1,2,3", 3117 "Counter": "0,1,2,3",
@@ -2944,6 +3124,7 @@
2944 "CounterHTOff": "0,1,2,3" 3124 "CounterHTOff": "0,1,2,3"
2945 }, 3125 },
2946 { 3126 {
3127 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2947 "EventCode": "0xB7, 0xBB", 3128 "EventCode": "0xB7, 0xBB",
2948 "MSRValue": "0x1000020091 ", 3129 "MSRValue": "0x1000020091 ",
2949 "Counter": "0,1,2,3", 3130 "Counter": "0,1,2,3",
@@ -2956,6 +3137,7 @@
2956 "CounterHTOff": "0,1,2,3" 3137 "CounterHTOff": "0,1,2,3"
2957 }, 3138 },
2958 { 3139 {
3140 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2959 "EventCode": "0xB7, 0xBB", 3141 "EventCode": "0xB7, 0xBB",
2960 "MSRValue": "0x3f80020091 ", 3142 "MSRValue": "0x3f80020091 ",
2961 "Counter": "0,1,2,3", 3143 "Counter": "0,1,2,3",
@@ -2968,6 +3150,7 @@
2968 "CounterHTOff": "0,1,2,3" 3150 "CounterHTOff": "0,1,2,3"
2969 }, 3151 },
2970 { 3152 {
3153 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2971 "EventCode": "0xB7, 0xBB", 3154 "EventCode": "0xB7, 0xBB",
2972 "MSRValue": "0x00803c0091 ", 3155 "MSRValue": "0x00803c0091 ",
2973 "Counter": "0,1,2,3", 3156 "Counter": "0,1,2,3",
@@ -2980,6 +3163,7 @@
2980 "CounterHTOff": "0,1,2,3" 3163 "CounterHTOff": "0,1,2,3"
2981 }, 3164 },
2982 { 3165 {
3166 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2983 "EventCode": "0xB7, 0xBB", 3167 "EventCode": "0xB7, 0xBB",
2984 "MSRValue": "0x01003c0091 ", 3168 "MSRValue": "0x01003c0091 ",
2985 "Counter": "0,1,2,3", 3169 "Counter": "0,1,2,3",
@@ -2992,6 +3176,7 @@
2992 "CounterHTOff": "0,1,2,3" 3176 "CounterHTOff": "0,1,2,3"
2993 }, 3177 },
2994 { 3178 {
3179 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2995 "EventCode": "0xB7, 0xBB", 3180 "EventCode": "0xB7, 0xBB",
2996 "MSRValue": "0x02003c0091 ", 3181 "MSRValue": "0x02003c0091 ",
2997 "Counter": "0,1,2,3", 3182 "Counter": "0,1,2,3",
@@ -3004,6 +3189,7 @@
3004 "CounterHTOff": "0,1,2,3" 3189 "CounterHTOff": "0,1,2,3"
3005 }, 3190 },
3006 { 3191 {
3192 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3007 "EventCode": "0xB7, 0xBB", 3193 "EventCode": "0xB7, 0xBB",
3008 "MSRValue": "0x04003c0091 ", 3194 "MSRValue": "0x04003c0091 ",
3009 "Counter": "0,1,2,3", 3195 "Counter": "0,1,2,3",
@@ -3016,6 +3202,7 @@
3016 "CounterHTOff": "0,1,2,3" 3202 "CounterHTOff": "0,1,2,3"
3017 }, 3203 },
3018 { 3204 {
3205 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3019 "EventCode": "0xB7, 0xBB", 3206 "EventCode": "0xB7, 0xBB",
3020 "MSRValue": "0x10003c0091 ", 3207 "MSRValue": "0x10003c0091 ",
3021 "Counter": "0,1,2,3", 3208 "Counter": "0,1,2,3",
@@ -3028,6 +3215,7 @@
3028 "CounterHTOff": "0,1,2,3" 3215 "CounterHTOff": "0,1,2,3"
3029 }, 3216 },
3030 { 3217 {
3218 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3031 "EventCode": "0xB7, 0xBB", 3219 "EventCode": "0xB7, 0xBB",
3032 "MSRValue": "0x3f803c0091 ", 3220 "MSRValue": "0x3f803c0091 ",
3033 "Counter": "0,1,2,3", 3221 "Counter": "0,1,2,3",
@@ -3040,6 +3228,7 @@
3040 "CounterHTOff": "0,1,2,3" 3228 "CounterHTOff": "0,1,2,3"
3041 }, 3229 },
3042 { 3230 {
3231 "PublicDescription": "Counts all demand & prefetch RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3043 "EventCode": "0xB7, 0xBB", 3232 "EventCode": "0xB7, 0xBB",
3044 "MSRValue": "0x0000010122 ", 3233 "MSRValue": "0x0000010122 ",
3045 "Counter": "0,1,2,3", 3234 "Counter": "0,1,2,3",
@@ -3052,6 +3241,7 @@
3052 "CounterHTOff": "0,1,2,3" 3241 "CounterHTOff": "0,1,2,3"
3053 }, 3242 },
3054 { 3243 {
3244 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3055 "EventCode": "0xB7, 0xBB", 3245 "EventCode": "0xB7, 0xBB",
3056 "MSRValue": "0x0080020122 ", 3246 "MSRValue": "0x0080020122 ",
3057 "Counter": "0,1,2,3", 3247 "Counter": "0,1,2,3",
@@ -3064,6 +3254,7 @@
3064 "CounterHTOff": "0,1,2,3" 3254 "CounterHTOff": "0,1,2,3"
3065 }, 3255 },
3066 { 3256 {
3257 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3067 "EventCode": "0xB7, 0xBB", 3258 "EventCode": "0xB7, 0xBB",
3068 "MSRValue": "0x0100020122 ", 3259 "MSRValue": "0x0100020122 ",
3069 "Counter": "0,1,2,3", 3260 "Counter": "0,1,2,3",
@@ -3076,6 +3267,7 @@
3076 "CounterHTOff": "0,1,2,3" 3267 "CounterHTOff": "0,1,2,3"
3077 }, 3268 },
3078 { 3269 {
3270 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3079 "EventCode": "0xB7, 0xBB", 3271 "EventCode": "0xB7, 0xBB",
3080 "MSRValue": "0x0200020122 ", 3272 "MSRValue": "0x0200020122 ",
3081 "Counter": "0,1,2,3", 3273 "Counter": "0,1,2,3",
@@ -3088,6 +3280,7 @@
3088 "CounterHTOff": "0,1,2,3" 3280 "CounterHTOff": "0,1,2,3"
3089 }, 3281 },
3090 { 3282 {
3283 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3091 "EventCode": "0xB7, 0xBB", 3284 "EventCode": "0xB7, 0xBB",
3092 "MSRValue": "0x0400020122 ", 3285 "MSRValue": "0x0400020122 ",
3093 "Counter": "0,1,2,3", 3286 "Counter": "0,1,2,3",
@@ -3100,6 +3293,7 @@
3100 "CounterHTOff": "0,1,2,3" 3293 "CounterHTOff": "0,1,2,3"
3101 }, 3294 },
3102 { 3295 {
3296 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3103 "EventCode": "0xB7, 0xBB", 3297 "EventCode": "0xB7, 0xBB",
3104 "MSRValue": "0x1000020122 ", 3298 "MSRValue": "0x1000020122 ",
3105 "Counter": "0,1,2,3", 3299 "Counter": "0,1,2,3",
@@ -3112,6 +3306,7 @@
3112 "CounterHTOff": "0,1,2,3" 3306 "CounterHTOff": "0,1,2,3"
3113 }, 3307 },
3114 { 3308 {
3309 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3115 "EventCode": "0xB7, 0xBB", 3310 "EventCode": "0xB7, 0xBB",
3116 "MSRValue": "0x3f80020122 ", 3311 "MSRValue": "0x3f80020122 ",
3117 "Counter": "0,1,2,3", 3312 "Counter": "0,1,2,3",
@@ -3124,6 +3319,7 @@
3124 "CounterHTOff": "0,1,2,3" 3319 "CounterHTOff": "0,1,2,3"
3125 }, 3320 },
3126 { 3321 {
3322 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3127 "EventCode": "0xB7, 0xBB", 3323 "EventCode": "0xB7, 0xBB",
3128 "MSRValue": "0x00803c0122 ", 3324 "MSRValue": "0x00803c0122 ",
3129 "Counter": "0,1,2,3", 3325 "Counter": "0,1,2,3",
@@ -3136,6 +3332,7 @@
3136 "CounterHTOff": "0,1,2,3" 3332 "CounterHTOff": "0,1,2,3"
3137 }, 3333 },
3138 { 3334 {
3335 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3139 "EventCode": "0xB7, 0xBB", 3336 "EventCode": "0xB7, 0xBB",
3140 "MSRValue": "0x01003c0122 ", 3337 "MSRValue": "0x01003c0122 ",
3141 "Counter": "0,1,2,3", 3338 "Counter": "0,1,2,3",
@@ -3148,6 +3345,7 @@
3148 "CounterHTOff": "0,1,2,3" 3345 "CounterHTOff": "0,1,2,3"
3149 }, 3346 },
3150 { 3347 {
3348 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3151 "EventCode": "0xB7, 0xBB", 3349 "EventCode": "0xB7, 0xBB",
3152 "MSRValue": "0x02003c0122 ", 3350 "MSRValue": "0x02003c0122 ",
3153 "Counter": "0,1,2,3", 3351 "Counter": "0,1,2,3",
@@ -3160,6 +3358,7 @@
3160 "CounterHTOff": "0,1,2,3" 3358 "CounterHTOff": "0,1,2,3"
3161 }, 3359 },
3162 { 3360 {
3361 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3163 "EventCode": "0xB7, 0xBB", 3362 "EventCode": "0xB7, 0xBB",
3164 "MSRValue": "0x04003c0122 ", 3363 "MSRValue": "0x04003c0122 ",
3165 "Counter": "0,1,2,3", 3364 "Counter": "0,1,2,3",
@@ -3172,6 +3371,7 @@
3172 "CounterHTOff": "0,1,2,3" 3371 "CounterHTOff": "0,1,2,3"
3173 }, 3372 },
3174 { 3373 {
3374 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3175 "EventCode": "0xB7, 0xBB", 3375 "EventCode": "0xB7, 0xBB",
3176 "MSRValue": "0x10003c0122 ", 3376 "MSRValue": "0x10003c0122 ",
3177 "Counter": "0,1,2,3", 3377 "Counter": "0,1,2,3",
@@ -3184,6 +3384,7 @@
3184 "CounterHTOff": "0,1,2,3" 3384 "CounterHTOff": "0,1,2,3"
3185 }, 3385 },
3186 { 3386 {
3387 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3187 "EventCode": "0xB7, 0xBB", 3388 "EventCode": "0xB7, 0xBB",
3188 "MSRValue": "0x3f803c0122 ", 3389 "MSRValue": "0x3f803c0122 ",
3189 "Counter": "0,1,2,3", 3390 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/floating-point.json b/tools/perf/pmu-events/arch/x86/broadwell/floating-point.json
index 102bfb808199..689d478dae93 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/floating-point.json
@@ -1,6 +1,6 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of transitions from AVX-256 to legacy SSE when penalty is applicable.", 3 "PublicDescription": "This event counts the number of transitions from AVX-256 to legacy SSE when penalty is applicable.",
4 "EventCode": "0xC1", 4 "EventCode": "0xC1",
5 "Counter": "0,1,2,3", 5 "Counter": "0,1,2,3",
6 "UMask": "0x8", 6 "UMask": "0x8",
@@ -11,7 +11,7 @@
11 "CounterHTOff": "0,1,2,3,4,5,6,7" 11 "CounterHTOff": "0,1,2,3,4,5,6,7"
12 }, 12 },
13 { 13 {
14 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of transitions from legacy SSE to AVX-256 when penalty is applicable.", 14 "PublicDescription": "This event counts the number of transitions from legacy SSE to AVX-256 when penalty is applicable.",
15 "EventCode": "0xC1", 15 "EventCode": "0xC1",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "UMask": "0x10", 17 "UMask": "0x10",
@@ -22,7 +22,6 @@
22 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
23 }, 23 },
24 { 24 {
25 "PEBS": "1",
26 "EventCode": "0xC7", 25 "EventCode": "0xC7",
27 "Counter": "0,1,2,3", 26 "Counter": "0,1,2,3",
28 "UMask": "0x1", 27 "UMask": "0x1",
@@ -32,7 +31,6 @@
32 "CounterHTOff": "0,1,2,3" 31 "CounterHTOff": "0,1,2,3"
33 }, 32 },
34 { 33 {
35 "PEBS": "1",
36 "EventCode": "0xC7", 34 "EventCode": "0xC7",
37 "Counter": "0,1,2,3", 35 "Counter": "0,1,2,3",
38 "UMask": "0x2", 36 "UMask": "0x2",
@@ -42,7 +40,15 @@
42 "CounterHTOff": "0,1,2,3" 40 "CounterHTOff": "0,1,2,3"
43 }, 41 },
44 { 42 {
45 "PEBS": "1", 43 "EventCode": "0xC7",
44 "Counter": "0,1,2,3",
45 "UMask": "0x3",
46 "EventName": "FP_ARITH_INST_RETIRED.SCALAR",
47 "SampleAfterValue": "2000003",
48 "BriefDescription": "Number of SSE/AVX computational scalar floating-point instructions retired. Applies to SSE* and AVX* scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
49 "CounterHTOff": "0,1,2,3"
50 },
51 {
46 "EventCode": "0xC7", 52 "EventCode": "0xC7",
47 "Counter": "0,1,2,3", 53 "Counter": "0,1,2,3",
48 "UMask": "0x4", 54 "UMask": "0x4",
@@ -52,7 +58,6 @@
52 "CounterHTOff": "0,1,2,3" 58 "CounterHTOff": "0,1,2,3"
53 }, 59 },
54 { 60 {
55 "PEBS": "1",
56 "EventCode": "0xC7", 61 "EventCode": "0xC7",
57 "Counter": "0,1,2,3", 62 "Counter": "0,1,2,3",
58 "UMask": "0x8", 63 "UMask": "0x8",
@@ -62,7 +67,6 @@
62 "CounterHTOff": "0,1,2,3" 67 "CounterHTOff": "0,1,2,3"
63 }, 68 },
64 { 69 {
65 "PEBS": "1",
66 "EventCode": "0xC7", 70 "EventCode": "0xC7",
67 "Counter": "0,1,2,3", 71 "Counter": "0,1,2,3",
68 "UMask": "0x10", 72 "UMask": "0x10",
@@ -72,7 +76,43 @@
72 "CounterHTOff": "0,1,2,3" 76 "CounterHTOff": "0,1,2,3"
73 }, 77 },
74 { 78 {
75 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of x87 floating point (FP) micro-code assist (numeric overflow/underflow, inexact result) when the output value (destination register) is invalid.", 79 "EventCode": "0xC7",
80 "Counter": "0,1,2,3",
81 "UMask": "0x15",
82 "EventName": "FP_ARITH_INST_RETIRED.DOUBLE",
83 "SampleAfterValue": "2000006",
84 "BriefDescription": "Number of SSE/AVX computational double precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
85 "CounterHTOff": "0,1,2,3"
86 },
87 {
88 "EventCode": "0xc7",
89 "Counter": "0,1,2,3",
90 "UMask": "0x20",
91 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE",
92 "SampleAfterValue": "2000003",
93 "BriefDescription": "Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired. Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
94 "CounterHTOff": "0,1,2,3"
95 },
96 {
97 "EventCode": "0xC7",
98 "Counter": "0,1,2,3",
99 "UMask": "0x2a",
100 "EventName": "FP_ARITH_INST_RETIRED.SINGLE",
101 "SampleAfterValue": "2000005",
102 "BriefDescription": "Number of SSE/AVX computational single precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
103 "CounterHTOff": "0,1,2,3"
104 },
105 {
106 "EventCode": "0xC7",
107 "Counter": "0,1,2,3",
108 "UMask": "0x3c",
109 "EventName": "FP_ARITH_INST_RETIRED.PACKED",
110 "SampleAfterValue": "2000004",
111 "BriefDescription": "Number of SSE/AVX computational packed floating-point instructions retired. Applies to SSE* and AVX*, packed, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
112 "CounterHTOff": "0,1,2,3"
113 },
114 {
115 "PublicDescription": "This event counts the number of x87 floating point (FP) micro-code assist (numeric overflow/underflow, inexact result) when the output value (destination register) is invalid.",
76 "EventCode": "0xCA", 116 "EventCode": "0xCA",
77 "Counter": "0,1,2,3", 117 "Counter": "0,1,2,3",
78 "UMask": "0x2", 118 "UMask": "0x2",
@@ -82,7 +122,7 @@
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 122 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 123 },
84 { 124 {
85 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts x87 floating point (FP) micro-code assist (invalid operation, denormal operand, SNaN operand) when the input value (one of the source operands to an FP instruction) is invalid.", 125 "PublicDescription": "This event counts x87 floating point (FP) micro-code assist (invalid operation, denormal operand, SNaN operand) when the input value (one of the source operands to an FP instruction) is invalid.",
86 "EventCode": "0xCA", 126 "EventCode": "0xCA",
87 "Counter": "0,1,2,3", 127 "Counter": "0,1,2,3",
88 "UMask": "0x4", 128 "UMask": "0x4",
@@ -92,7 +132,7 @@
92 "CounterHTOff": "0,1,2,3,4,5,6,7" 132 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 }, 133 },
94 { 134 {
95 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of SSE* floating point (FP) micro-code assist (numeric overflow/underflow) when the output value (destination register) is invalid. Counting covers only cases involving penalties that require micro-code assist intervention.", 135 "PublicDescription": "This event counts the number of SSE* floating point (FP) micro-code assist (numeric overflow/underflow) when the output value (destination register) is invalid. Counting covers only cases involving penalties that require micro-code assist intervention.",
96 "EventCode": "0xCA", 136 "EventCode": "0xCA",
97 "Counter": "0,1,2,3", 137 "Counter": "0,1,2,3",
98 "UMask": "0x8", 138 "UMask": "0x8",
@@ -102,7 +142,7 @@
102 "CounterHTOff": "0,1,2,3,4,5,6,7" 142 "CounterHTOff": "0,1,2,3,4,5,6,7"
103 }, 143 },
104 { 144 {
105 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts any input SSE* FP assist - invalid operation, denormal operand, dividing by zero, SNaN operand. Counting includes only cases involving penalties that required micro-code assist intervention.", 145 "PublicDescription": "This event counts any input SSE* FP assist - invalid operation, denormal operand, dividing by zero, SNaN operand. Counting includes only cases involving penalties that required micro-code assist intervention.",
106 "EventCode": "0xCA", 146 "EventCode": "0xCA",
107 "Counter": "0,1,2,3", 147 "Counter": "0,1,2,3",
108 "UMask": "0x10", 148 "UMask": "0x10",
@@ -121,51 +161,5 @@
121 "BriefDescription": "Cycles with any input/output SSE or FP assist", 161 "BriefDescription": "Cycles with any input/output SSE or FP assist",
122 "CounterMask": "1", 162 "CounterMask": "1",
123 "CounterHTOff": "0,1,2,3" 163 "CounterHTOff": "0,1,2,3"
124 },
125 {
126 "PEBS": "1",
127 "EventCode": "0xc7",
128 "Counter": "0,1,2,3",
129 "UMask": "0x20",
130 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE",
131 "SampleAfterValue": "2000003",
132 "BriefDescription": "Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired. Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
133 "CounterHTOff": "0,1,2,3"
134 },
135 {
136 "EventCode": "0xC7",
137 "Counter": "0,1,2,3",
138 "UMask": "0x3",
139 "EventName": "FP_ARITH_INST_RETIRED.SCALAR",
140 "SampleAfterValue": "2000003",
141 "BriefDescription": "Number of SSE/AVX computational scalar floating-point instructions retired. Applies to SSE* and AVX* scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
142 "CounterHTOff": "0,1,2,3"
143 },
144 {
145 "EventCode": "0xC7",
146 "Counter": "0,1,2,3",
147 "UMask": "0x3c",
148 "EventName": "FP_ARITH_INST_RETIRED.PACKED",
149 "SampleAfterValue": "2000004",
150 "BriefDescription": "Number of SSE/AVX computational packed floating-point instructions retired. Applies to SSE* and AVX*, packed, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
151 "CounterHTOff": "0,1,2,3"
152 },
153 {
154 "EventCode": "0xC7",
155 "Counter": "0,1,2,3",
156 "UMask": "0x2a",
157 "EventName": "FP_ARITH_INST_RETIRED.SINGLE",
158 "SampleAfterValue": "2000005",
159 "BriefDescription": "Number of SSE/AVX computational single precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
160 "CounterHTOff": "0,1,2,3"
161 },
162 {
163 "EventCode": "0xC7",
164 "Counter": "0,1,2,3",
165 "UMask": "0x15",
166 "EventName": "FP_ARITH_INST_RETIRED.DOUBLE",
167 "SampleAfterValue": "2000006",
168 "BriefDescription": "Number of SSE/AVX computational double precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
169 "CounterHTOff": "0,1,2,3"
170 } 164 }
171] \ No newline at end of file 165] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/frontend.json b/tools/perf/pmu-events/arch/x86/broadwell/frontend.json
index b0cdf1f097a0..7142c76d7f11 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/frontend.json
@@ -10,7 +10,7 @@
10 "CounterHTOff": "0,1,2,3" 10 "CounterHTOff": "0,1,2,3"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 13 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
14 "EventCode": "0x79", 14 "EventCode": "0x79",
15 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
16 "UMask": "0x4", 16 "UMask": "0x4",
@@ -20,80 +20,49 @@
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 23 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ.",
24 "EventCode": "0x79", 24 "EventCode": "0x79",
25 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
26 "UMask": "0x8", 26 "UMask": "0x4",
27 "EventName": "IDQ.DSB_UOPS", 27 "EventName": "IDQ.MITE_CYCLES",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
33 "PublicDescription": "This event counts the number of uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.",
34 "EventCode": "0x79",
35 "Counter": "0,1,2,3",
36 "UMask": "0x10",
37 "EventName": "IDQ.MS_DSB_UOPS",
38 "SampleAfterValue": "2000003",
39 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 },
42 {
43 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.",
44 "EventCode": "0x79",
45 "Counter": "0,1,2,3",
46 "UMask": "0x20",
47 "EventName": "IDQ.MS_MITE_UOPS",
48 "SampleAfterValue": "2000003",
49 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
53 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
54 "EventCode": "0x79",
55 "Counter": "0,1,2,3",
56 "UMask": "0x30",
57 "EventName": "IDQ.MS_UOPS",
58 "SampleAfterValue": "2000003", 28 "SampleAfterValue": "2000003",
59 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 29 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path",
30 "CounterMask": "1",
60 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 }, 32 },
62 { 33 {
63 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.", 34 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
64 "EventCode": "0x79", 35 "EventCode": "0x79",
65 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
66 "UMask": "0x30", 37 "UMask": "0x8",
67 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
68 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
69 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 40 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
70 "CounterMask": "1",
71 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
72 }, 42 },
73 { 43 {
74 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ.", 44 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
75 "EventCode": "0x79", 45 "EventCode": "0x79",
76 "Counter": "0,1,2,3", 46 "Counter": "0,1,2,3",
77 "UMask": "0x4", 47 "UMask": "0x8",
78 "EventName": "IDQ.MITE_CYCLES", 48 "EventName": "IDQ.DSB_CYCLES",
79 "SampleAfterValue": "2000003", 49 "SampleAfterValue": "2000003",
80 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path", 50 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path",
81 "CounterMask": "1", 51 "CounterMask": "1",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 52 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 53 },
84 { 54 {
85 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 55 "PublicDescription": "This event counts the number of uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
86 "EventCode": "0x79", 56 "EventCode": "0x79",
87 "Counter": "0,1,2,3", 57 "Counter": "0,1,2,3",
88 "UMask": "0x8", 58 "UMask": "0x10",
89 "EventName": "IDQ.DSB_CYCLES", 59 "EventName": "IDQ.MS_DSB_UOPS",
90 "SampleAfterValue": "2000003", 60 "SampleAfterValue": "2000003",
91 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path", 61 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
92 "CounterMask": "1",
93 "CounterHTOff": "0,1,2,3,4,5,6,7" 62 "CounterHTOff": "0,1,2,3,4,5,6,7"
94 }, 63 },
95 { 64 {
96 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.", 65 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
97 "EventCode": "0x79", 66 "EventCode": "0x79",
98 "Counter": "0,1,2,3", 67 "Counter": "0,1,2,3",
99 "UMask": "0x10", 68 "UMask": "0x10",
@@ -104,7 +73,7 @@
104 "CounterHTOff": "0,1,2,3,4,5,6,7" 73 "CounterHTOff": "0,1,2,3,4,5,6,7"
105 }, 74 },
106 { 75 {
107 "PublicDescription": "This event counts the number of deliveries to Instruction Decode Queue (IDQ) initiated by Decode Stream Buffer (DSB) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.", 76 "PublicDescription": "This event counts the number of deliveries to Instruction Decode Queue (IDQ) initiated by Decode Stream Buffer (DSB) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
108 "EventCode": "0x79", 77 "EventCode": "0x79",
109 "Counter": "0,1,2,3", 78 "Counter": "0,1,2,3",
110 "UMask": "0x10", 79 "UMask": "0x10",
@@ -116,7 +85,7 @@
116 "CounterHTOff": "0,1,2,3,4,5,6,7" 85 "CounterHTOff": "0,1,2,3,4,5,6,7"
117 }, 86 },
118 { 87 {
119 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 88 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
120 "EventCode": "0x79", 89 "EventCode": "0x79",
121 "Counter": "0,1,2,3", 90 "Counter": "0,1,2,3",
122 "UMask": "0x18", 91 "UMask": "0x18",
@@ -127,7 +96,7 @@
127 "CounterHTOff": "0,1,2,3,4,5,6,7" 96 "CounterHTOff": "0,1,2,3,4,5,6,7"
128 }, 97 },
129 { 98 {
130 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 99 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
131 "EventCode": "0x79", 100 "EventCode": "0x79",
132 "Counter": "0,1,2,3", 101 "Counter": "0,1,2,3",
133 "UMask": "0x18", 102 "UMask": "0x18",
@@ -138,7 +107,17 @@
138 "CounterHTOff": "0,1,2,3,4,5,6,7" 107 "CounterHTOff": "0,1,2,3,4,5,6,7"
139 }, 108 },
140 { 109 {
141 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 110 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ.",
111 "EventCode": "0x79",
112 "Counter": "0,1,2,3",
113 "UMask": "0x20",
114 "EventName": "IDQ.MS_MITE_UOPS",
115 "SampleAfterValue": "2000003",
116 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
117 "CounterHTOff": "0,1,2,3,4,5,6,7"
118 },
119 {
120 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
142 "EventCode": "0x79", 121 "EventCode": "0x79",
143 "Counter": "0,1,2,3", 122 "Counter": "0,1,2,3",
144 "UMask": "0x24", 123 "UMask": "0x24",
@@ -149,7 +128,7 @@
149 "CounterHTOff": "0,1,2,3,4,5,6,7" 128 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 }, 129 },
151 { 130 {
152 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 131 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
153 "EventCode": "0x79", 132 "EventCode": "0x79",
154 "Counter": "0,1,2,3", 133 "Counter": "0,1,2,3",
155 "UMask": "0x24", 134 "UMask": "0x24",
@@ -160,7 +139,39 @@
160 "CounterHTOff": "0,1,2,3,4,5,6,7" 139 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 }, 140 },
162 { 141 {
163 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 142 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
143 "EventCode": "0x79",
144 "Counter": "0,1,2,3",
145 "UMask": "0x30",
146 "EventName": "IDQ.MS_UOPS",
147 "SampleAfterValue": "2000003",
148 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
149 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 },
151 {
152 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
153 "EventCode": "0x79",
154 "Counter": "0,1,2,3",
155 "UMask": "0x30",
156 "EventName": "IDQ.MS_CYCLES",
157 "SampleAfterValue": "2000003",
158 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
159 "CounterMask": "1",
160 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 },
162 {
163 "EventCode": "0x79",
164 "Counter": "0,1,2,3",
165 "UMask": "0x30",
166 "EdgeDetect": "1",
167 "EventName": "IDQ.MS_SWITCHES",
168 "SampleAfterValue": "2000003",
169 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
170 "CounterMask": "1",
171 "CounterHTOff": "0,1,2,3,4,5,6,7"
172 },
173 {
174 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
164 "EventCode": "0x79", 175 "EventCode": "0x79",
165 "Counter": "0,1,2,3", 176 "Counter": "0,1,2,3",
166 "UMask": "0x3c", 177 "UMask": "0x3c",
@@ -200,7 +211,7 @@
200 "CounterHTOff": "0,1,2,3,4,5,6,7" 211 "CounterHTOff": "0,1,2,3,4,5,6,7"
201 }, 212 },
202 { 213 {
203 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding ?4 ? x? when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread;\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions); \n c. Instruction Decode Queue (IDQ) delivers four uops.", 214 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding 4 x when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread;\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions); \n c. Instruction Decode Queue (IDQ) delivers four uops.",
204 "EventCode": "0x9C", 215 "EventCode": "0x9C",
205 "Counter": "0,1,2,3", 216 "Counter": "0,1,2,3",
206 "UMask": "0x1", 217 "UMask": "0x1",
@@ -263,7 +274,7 @@
263 "CounterHTOff": "0,1,2,3" 274 "CounterHTOff": "0,1,2,3"
264 }, 275 },
265 { 276 {
266 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 0?2 cycles.", 277 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 02 cycles.",
267 "EventCode": "0xAB", 278 "EventCode": "0xAB",
268 "Counter": "0,1,2,3", 279 "Counter": "0,1,2,3",
269 "UMask": "0x2", 280 "UMask": "0x2",
@@ -271,16 +282,5 @@
271 "SampleAfterValue": "2000003", 282 "SampleAfterValue": "2000003",
272 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.", 283 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.",
273 "CounterHTOff": "0,1,2,3,4,5,6,7" 284 "CounterHTOff": "0,1,2,3,4,5,6,7"
274 },
275 {
276 "EventCode": "0x79",
277 "Counter": "0,1,2,3",
278 "UMask": "0x30",
279 "EdgeDetect": "1",
280 "EventName": "IDQ.MS_SWITCHES",
281 "SampleAfterValue": "2000003",
282 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
283 "CounterMask": "1",
284 "CounterHTOff": "0,1,2,3,4,5,6,7"
285 } 285 }
286] \ No newline at end of file 286] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/memory.json b/tools/perf/pmu-events/arch/x86/broadwell/memory.json
index ff5416d29d0d..c9154cebbdf0 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/memory.json
@@ -90,7 +90,6 @@
90 "CounterHTOff": "0,1,2,3,4,5,6,7" 90 "CounterHTOff": "0,1,2,3,4,5,6,7"
91 }, 91 },
92 { 92 {
93 "PublicDescription": "Unfriendly TSX abort triggered by a flowmarker.",
94 "EventCode": "0x5d", 93 "EventCode": "0x5d",
95 "Counter": "0,1,2,3", 94 "Counter": "0,1,2,3",
96 "UMask": "0x1", 95 "UMask": "0x1",
@@ -170,13 +169,13 @@
170 }, 169 },
171 { 170 {
172 "PEBS": "1", 171 "PEBS": "1",
173 "PublicDescription": "Number of times HLE abort was triggered.", 172 "PublicDescription": "Number of times HLE abort was triggered (PEBS).",
174 "EventCode": "0xc8", 173 "EventCode": "0xc8",
175 "Counter": "0,1,2,3", 174 "Counter": "0,1,2,3",
176 "UMask": "0x4", 175 "UMask": "0x4",
177 "EventName": "HLE_RETIRED.ABORTED", 176 "EventName": "HLE_RETIRED.ABORTED",
178 "SampleAfterValue": "2000003", 177 "SampleAfterValue": "2000003",
179 "BriefDescription": "Number of times HLE abort was triggered", 178 "BriefDescription": "Number of times HLE abort was triggered (PEBS)",
180 "CounterHTOff": "0,1,2,3,4,5,6,7" 179 "CounterHTOff": "0,1,2,3,4,5,6,7"
181 }, 180 },
182 { 181 {
@@ -251,13 +250,13 @@
251 }, 250 },
252 { 251 {
253 "PEBS": "1", 252 "PEBS": "1",
254 "PublicDescription": "Number of times RTM abort was triggered .", 253 "PublicDescription": "Number of times RTM abort was triggered (PEBS).",
255 "EventCode": "0xc9", 254 "EventCode": "0xc9",
256 "Counter": "0,1,2,3", 255 "Counter": "0,1,2,3",
257 "UMask": "0x4", 256 "UMask": "0x4",
258 "EventName": "RTM_RETIRED.ABORTED", 257 "EventName": "RTM_RETIRED.ABORTED",
259 "SampleAfterValue": "2000003", 258 "SampleAfterValue": "2000003",
260 "BriefDescription": "Number of times RTM abort was triggered", 259 "BriefDescription": "Number of times RTM abort was triggered (PEBS)",
261 "CounterHTOff": "0,1,2,3" 260 "CounterHTOff": "0,1,2,3"
262 }, 261 },
263 { 262 {
@@ -431,6 +430,7 @@
431 "CounterHTOff": "3" 430 "CounterHTOff": "3"
432 }, 431 },
433 { 432 {
433 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
434 "EventCode": "0xB7, 0xBB", 434 "EventCode": "0xB7, 0xBB",
435 "MSRValue": "0x2000020001 ", 435 "MSRValue": "0x2000020001 ",
436 "Counter": "0,1,2,3", 436 "Counter": "0,1,2,3",
@@ -443,6 +443,7 @@
443 "CounterHTOff": "0,1,2,3" 443 "CounterHTOff": "0,1,2,3"
444 }, 444 },
445 { 445 {
446 "PublicDescription": "Counts demand data reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
446 "EventCode": "0xB7, 0xBB", 447 "EventCode": "0xB7, 0xBB",
447 "MSRValue": "0x20003c0001 ", 448 "MSRValue": "0x20003c0001 ",
448 "Counter": "0,1,2,3", 449 "Counter": "0,1,2,3",
@@ -455,6 +456,7 @@
455 "CounterHTOff": "0,1,2,3" 456 "CounterHTOff": "0,1,2,3"
456 }, 457 },
457 { 458 {
459 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
458 "EventCode": "0xB7, 0xBB", 460 "EventCode": "0xB7, 0xBB",
459 "MSRValue": "0x0084000001 ", 461 "MSRValue": "0x0084000001 ",
460 "Counter": "0,1,2,3", 462 "Counter": "0,1,2,3",
@@ -467,6 +469,7 @@
467 "CounterHTOff": "0,1,2,3" 469 "CounterHTOff": "0,1,2,3"
468 }, 470 },
469 { 471 {
472 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
470 "EventCode": "0xB7, 0xBB", 473 "EventCode": "0xB7, 0xBB",
471 "MSRValue": "0x0104000001 ", 474 "MSRValue": "0x0104000001 ",
472 "Counter": "0,1,2,3", 475 "Counter": "0,1,2,3",
@@ -479,6 +482,7 @@
479 "CounterHTOff": "0,1,2,3" 482 "CounterHTOff": "0,1,2,3"
480 }, 483 },
481 { 484 {
485 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
482 "EventCode": "0xB7, 0xBB", 486 "EventCode": "0xB7, 0xBB",
483 "MSRValue": "0x0204000001 ", 487 "MSRValue": "0x0204000001 ",
484 "Counter": "0,1,2,3", 488 "Counter": "0,1,2,3",
@@ -491,6 +495,7 @@
491 "CounterHTOff": "0,1,2,3" 495 "CounterHTOff": "0,1,2,3"
492 }, 496 },
493 { 497 {
498 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
494 "EventCode": "0xB7, 0xBB", 499 "EventCode": "0xB7, 0xBB",
495 "MSRValue": "0x0404000001 ", 500 "MSRValue": "0x0404000001 ",
496 "Counter": "0,1,2,3", 501 "Counter": "0,1,2,3",
@@ -503,6 +508,7 @@
503 "CounterHTOff": "0,1,2,3" 508 "CounterHTOff": "0,1,2,3"
504 }, 509 },
505 { 510 {
511 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
506 "EventCode": "0xB7, 0xBB", 512 "EventCode": "0xB7, 0xBB",
507 "MSRValue": "0x1004000001 ", 513 "MSRValue": "0x1004000001 ",
508 "Counter": "0,1,2,3", 514 "Counter": "0,1,2,3",
@@ -515,6 +521,7 @@
515 "CounterHTOff": "0,1,2,3" 521 "CounterHTOff": "0,1,2,3"
516 }, 522 },
517 { 523 {
524 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
518 "EventCode": "0xB7, 0xBB", 525 "EventCode": "0xB7, 0xBB",
519 "MSRValue": "0x2004000001 ", 526 "MSRValue": "0x2004000001 ",
520 "Counter": "0,1,2,3", 527 "Counter": "0,1,2,3",
@@ -527,6 +534,7 @@
527 "CounterHTOff": "0,1,2,3" 534 "CounterHTOff": "0,1,2,3"
528 }, 535 },
529 { 536 {
537 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
530 "EventCode": "0xB7, 0xBB", 538 "EventCode": "0xB7, 0xBB",
531 "MSRValue": "0x3f84000001 ", 539 "MSRValue": "0x3f84000001 ",
532 "Counter": "0,1,2,3", 540 "Counter": "0,1,2,3",
@@ -539,6 +547,7 @@
539 "CounterHTOff": "0,1,2,3" 547 "CounterHTOff": "0,1,2,3"
540 }, 548 },
541 { 549 {
550 "PublicDescription": "Counts demand data reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
542 "EventCode": "0xB7, 0xBB", 551 "EventCode": "0xB7, 0xBB",
543 "MSRValue": "0x00bc000001 ", 552 "MSRValue": "0x00bc000001 ",
544 "Counter": "0,1,2,3", 553 "Counter": "0,1,2,3",
@@ -551,6 +560,7 @@
551 "CounterHTOff": "0,1,2,3" 560 "CounterHTOff": "0,1,2,3"
552 }, 561 },
553 { 562 {
563 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
554 "EventCode": "0xB7, 0xBB", 564 "EventCode": "0xB7, 0xBB",
555 "MSRValue": "0x013c000001 ", 565 "MSRValue": "0x013c000001 ",
556 "Counter": "0,1,2,3", 566 "Counter": "0,1,2,3",
@@ -563,6 +573,7 @@
563 "CounterHTOff": "0,1,2,3" 573 "CounterHTOff": "0,1,2,3"
564 }, 574 },
565 { 575 {
576 "PublicDescription": "Counts demand data reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
566 "EventCode": "0xB7, 0xBB", 577 "EventCode": "0xB7, 0xBB",
567 "MSRValue": "0x023c000001 ", 578 "MSRValue": "0x023c000001 ",
568 "Counter": "0,1,2,3", 579 "Counter": "0,1,2,3",
@@ -575,6 +586,7 @@
575 "CounterHTOff": "0,1,2,3" 586 "CounterHTOff": "0,1,2,3"
576 }, 587 },
577 { 588 {
589 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
578 "EventCode": "0xB7, 0xBB", 590 "EventCode": "0xB7, 0xBB",
579 "MSRValue": "0x043c000001 ", 591 "MSRValue": "0x043c000001 ",
580 "Counter": "0,1,2,3", 592 "Counter": "0,1,2,3",
@@ -587,6 +599,7 @@
587 "CounterHTOff": "0,1,2,3" 599 "CounterHTOff": "0,1,2,3"
588 }, 600 },
589 { 601 {
602 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
590 "EventCode": "0xB7, 0xBB", 603 "EventCode": "0xB7, 0xBB",
591 "MSRValue": "0x20003c0002 ", 604 "MSRValue": "0x20003c0002 ",
592 "Counter": "0,1,2,3", 605 "Counter": "0,1,2,3",
@@ -599,6 +612,7 @@
599 "CounterHTOff": "0,1,2,3" 612 "CounterHTOff": "0,1,2,3"
600 }, 613 },
601 { 614 {
615 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
602 "EventCode": "0xB7, 0xBB", 616 "EventCode": "0xB7, 0xBB",
603 "MSRValue": "0x3f84000002 ", 617 "MSRValue": "0x3f84000002 ",
604 "Counter": "0,1,2,3", 618 "Counter": "0,1,2,3",
@@ -611,6 +625,7 @@
611 "CounterHTOff": "0,1,2,3" 625 "CounterHTOff": "0,1,2,3"
612 }, 626 },
613 { 627 {
628 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
614 "EventCode": "0xB7, 0xBB", 629 "EventCode": "0xB7, 0xBB",
615 "MSRValue": "0x00bc000002 ", 630 "MSRValue": "0x00bc000002 ",
616 "Counter": "0,1,2,3", 631 "Counter": "0,1,2,3",
@@ -623,6 +638,7 @@
623 "CounterHTOff": "0,1,2,3" 638 "CounterHTOff": "0,1,2,3"
624 }, 639 },
625 { 640 {
641 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
626 "EventCode": "0xB7, 0xBB", 642 "EventCode": "0xB7, 0xBB",
627 "MSRValue": "0x013c000002 ", 643 "MSRValue": "0x013c000002 ",
628 "Counter": "0,1,2,3", 644 "Counter": "0,1,2,3",
@@ -635,6 +651,7 @@
635 "CounterHTOff": "0,1,2,3" 651 "CounterHTOff": "0,1,2,3"
636 }, 652 },
637 { 653 {
654 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
638 "EventCode": "0xB7, 0xBB", 655 "EventCode": "0xB7, 0xBB",
639 "MSRValue": "0x023c000002 ", 656 "MSRValue": "0x023c000002 ",
640 "Counter": "0,1,2,3", 657 "Counter": "0,1,2,3",
@@ -647,6 +664,7 @@
647 "CounterHTOff": "0,1,2,3" 664 "CounterHTOff": "0,1,2,3"
648 }, 665 },
649 { 666 {
667 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
650 "EventCode": "0xB7, 0xBB", 668 "EventCode": "0xB7, 0xBB",
651 "MSRValue": "0x043c000002 ", 669 "MSRValue": "0x043c000002 ",
652 "Counter": "0,1,2,3", 670 "Counter": "0,1,2,3",
@@ -659,6 +677,7 @@
659 "CounterHTOff": "0,1,2,3" 677 "CounterHTOff": "0,1,2,3"
660 }, 678 },
661 { 679 {
680 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
662 "EventCode": "0xB7, 0xBB", 681 "EventCode": "0xB7, 0xBB",
663 "MSRValue": "0x2000020004 ", 682 "MSRValue": "0x2000020004 ",
664 "Counter": "0,1,2,3", 683 "Counter": "0,1,2,3",
@@ -671,6 +690,7 @@
671 "CounterHTOff": "0,1,2,3" 690 "CounterHTOff": "0,1,2,3"
672 }, 691 },
673 { 692 {
693 "PublicDescription": "Counts all demand code reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
674 "EventCode": "0xB7, 0xBB", 694 "EventCode": "0xB7, 0xBB",
675 "MSRValue": "0x20003c0004 ", 695 "MSRValue": "0x20003c0004 ",
676 "Counter": "0,1,2,3", 696 "Counter": "0,1,2,3",
@@ -683,6 +703,7 @@
683 "CounterHTOff": "0,1,2,3" 703 "CounterHTOff": "0,1,2,3"
684 }, 704 },
685 { 705 {
706 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
686 "EventCode": "0xB7, 0xBB", 707 "EventCode": "0xB7, 0xBB",
687 "MSRValue": "0x0084000004 ", 708 "MSRValue": "0x0084000004 ",
688 "Counter": "0,1,2,3", 709 "Counter": "0,1,2,3",
@@ -695,6 +716,7 @@
695 "CounterHTOff": "0,1,2,3" 716 "CounterHTOff": "0,1,2,3"
696 }, 717 },
697 { 718 {
719 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
698 "EventCode": "0xB7, 0xBB", 720 "EventCode": "0xB7, 0xBB",
699 "MSRValue": "0x0104000004 ", 721 "MSRValue": "0x0104000004 ",
700 "Counter": "0,1,2,3", 722 "Counter": "0,1,2,3",
@@ -707,6 +729,7 @@
707 "CounterHTOff": "0,1,2,3" 729 "CounterHTOff": "0,1,2,3"
708 }, 730 },
709 { 731 {
732 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
710 "EventCode": "0xB7, 0xBB", 733 "EventCode": "0xB7, 0xBB",
711 "MSRValue": "0x0204000004 ", 734 "MSRValue": "0x0204000004 ",
712 "Counter": "0,1,2,3", 735 "Counter": "0,1,2,3",
@@ -719,6 +742,7 @@
719 "CounterHTOff": "0,1,2,3" 742 "CounterHTOff": "0,1,2,3"
720 }, 743 },
721 { 744 {
745 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
722 "EventCode": "0xB7, 0xBB", 746 "EventCode": "0xB7, 0xBB",
723 "MSRValue": "0x0404000004 ", 747 "MSRValue": "0x0404000004 ",
724 "Counter": "0,1,2,3", 748 "Counter": "0,1,2,3",
@@ -731,6 +755,7 @@
731 "CounterHTOff": "0,1,2,3" 755 "CounterHTOff": "0,1,2,3"
732 }, 756 },
733 { 757 {
758 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
734 "EventCode": "0xB7, 0xBB", 759 "EventCode": "0xB7, 0xBB",
735 "MSRValue": "0x1004000004 ", 760 "MSRValue": "0x1004000004 ",
736 "Counter": "0,1,2,3", 761 "Counter": "0,1,2,3",
@@ -743,6 +768,7 @@
743 "CounterHTOff": "0,1,2,3" 768 "CounterHTOff": "0,1,2,3"
744 }, 769 },
745 { 770 {
771 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
746 "EventCode": "0xB7, 0xBB", 772 "EventCode": "0xB7, 0xBB",
747 "MSRValue": "0x2004000004 ", 773 "MSRValue": "0x2004000004 ",
748 "Counter": "0,1,2,3", 774 "Counter": "0,1,2,3",
@@ -755,6 +781,7 @@
755 "CounterHTOff": "0,1,2,3" 781 "CounterHTOff": "0,1,2,3"
756 }, 782 },
757 { 783 {
784 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
758 "EventCode": "0xB7, 0xBB", 785 "EventCode": "0xB7, 0xBB",
759 "MSRValue": "0x3f84000004 ", 786 "MSRValue": "0x3f84000004 ",
760 "Counter": "0,1,2,3", 787 "Counter": "0,1,2,3",
@@ -767,6 +794,7 @@
767 "CounterHTOff": "0,1,2,3" 794 "CounterHTOff": "0,1,2,3"
768 }, 795 },
769 { 796 {
797 "PublicDescription": "Counts all demand code reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
770 "EventCode": "0xB7, 0xBB", 798 "EventCode": "0xB7, 0xBB",
771 "MSRValue": "0x00bc000004 ", 799 "MSRValue": "0x00bc000004 ",
772 "Counter": "0,1,2,3", 800 "Counter": "0,1,2,3",
@@ -779,6 +807,7 @@
779 "CounterHTOff": "0,1,2,3" 807 "CounterHTOff": "0,1,2,3"
780 }, 808 },
781 { 809 {
810 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
782 "EventCode": "0xB7, 0xBB", 811 "EventCode": "0xB7, 0xBB",
783 "MSRValue": "0x013c000004 ", 812 "MSRValue": "0x013c000004 ",
784 "Counter": "0,1,2,3", 813 "Counter": "0,1,2,3",
@@ -791,6 +820,7 @@
791 "CounterHTOff": "0,1,2,3" 820 "CounterHTOff": "0,1,2,3"
792 }, 821 },
793 { 822 {
823 "PublicDescription": "Counts all demand code reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
794 "EventCode": "0xB7, 0xBB", 824 "EventCode": "0xB7, 0xBB",
795 "MSRValue": "0x023c000004 ", 825 "MSRValue": "0x023c000004 ",
796 "Counter": "0,1,2,3", 826 "Counter": "0,1,2,3",
@@ -803,6 +833,7 @@
803 "CounterHTOff": "0,1,2,3" 833 "CounterHTOff": "0,1,2,3"
804 }, 834 },
805 { 835 {
836 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
806 "EventCode": "0xB7, 0xBB", 837 "EventCode": "0xB7, 0xBB",
807 "MSRValue": "0x043c000004 ", 838 "MSRValue": "0x043c000004 ",
808 "Counter": "0,1,2,3", 839 "Counter": "0,1,2,3",
@@ -815,6 +846,7 @@
815 "CounterHTOff": "0,1,2,3" 846 "CounterHTOff": "0,1,2,3"
816 }, 847 },
817 { 848 {
849 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
818 "EventCode": "0xB7, 0xBB", 850 "EventCode": "0xB7, 0xBB",
819 "MSRValue": "0x2000020008 ", 851 "MSRValue": "0x2000020008 ",
820 "Counter": "0,1,2,3", 852 "Counter": "0,1,2,3",
@@ -827,6 +859,7 @@
827 "CounterHTOff": "0,1,2,3" 859 "CounterHTOff": "0,1,2,3"
828 }, 860 },
829 { 861 {
862 "PublicDescription": "Counts writebacks (modified to exclusive) that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
830 "EventCode": "0xB7, 0xBB", 863 "EventCode": "0xB7, 0xBB",
831 "MSRValue": "0x20003c0008 ", 864 "MSRValue": "0x20003c0008 ",
832 "Counter": "0,1,2,3", 865 "Counter": "0,1,2,3",
@@ -839,6 +872,7 @@
839 "CounterHTOff": "0,1,2,3" 872 "CounterHTOff": "0,1,2,3"
840 }, 873 },
841 { 874 {
875 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
842 "EventCode": "0xB7, 0xBB", 876 "EventCode": "0xB7, 0xBB",
843 "MSRValue": "0x0084000008 ", 877 "MSRValue": "0x0084000008 ",
844 "Counter": "0,1,2,3", 878 "Counter": "0,1,2,3",
@@ -851,6 +885,7 @@
851 "CounterHTOff": "0,1,2,3" 885 "CounterHTOff": "0,1,2,3"
852 }, 886 },
853 { 887 {
888 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
854 "EventCode": "0xB7, 0xBB", 889 "EventCode": "0xB7, 0xBB",
855 "MSRValue": "0x0104000008 ", 890 "MSRValue": "0x0104000008 ",
856 "Counter": "0,1,2,3", 891 "Counter": "0,1,2,3",
@@ -863,6 +898,7 @@
863 "CounterHTOff": "0,1,2,3" 898 "CounterHTOff": "0,1,2,3"
864 }, 899 },
865 { 900 {
901 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
866 "EventCode": "0xB7, 0xBB", 902 "EventCode": "0xB7, 0xBB",
867 "MSRValue": "0x0204000008 ", 903 "MSRValue": "0x0204000008 ",
868 "Counter": "0,1,2,3", 904 "Counter": "0,1,2,3",
@@ -875,6 +911,7 @@
875 "CounterHTOff": "0,1,2,3" 911 "CounterHTOff": "0,1,2,3"
876 }, 912 },
877 { 913 {
914 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
878 "EventCode": "0xB7, 0xBB", 915 "EventCode": "0xB7, 0xBB",
879 "MSRValue": "0x0404000008 ", 916 "MSRValue": "0x0404000008 ",
880 "Counter": "0,1,2,3", 917 "Counter": "0,1,2,3",
@@ -887,6 +924,7 @@
887 "CounterHTOff": "0,1,2,3" 924 "CounterHTOff": "0,1,2,3"
888 }, 925 },
889 { 926 {
927 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
890 "EventCode": "0xB7, 0xBB", 928 "EventCode": "0xB7, 0xBB",
891 "MSRValue": "0x1004000008 ", 929 "MSRValue": "0x1004000008 ",
892 "Counter": "0,1,2,3", 930 "Counter": "0,1,2,3",
@@ -899,6 +937,7 @@
899 "CounterHTOff": "0,1,2,3" 937 "CounterHTOff": "0,1,2,3"
900 }, 938 },
901 { 939 {
940 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
902 "EventCode": "0xB7, 0xBB", 941 "EventCode": "0xB7, 0xBB",
903 "MSRValue": "0x2004000008 ", 942 "MSRValue": "0x2004000008 ",
904 "Counter": "0,1,2,3", 943 "Counter": "0,1,2,3",
@@ -911,6 +950,7 @@
911 "CounterHTOff": "0,1,2,3" 950 "CounterHTOff": "0,1,2,3"
912 }, 951 },
913 { 952 {
953 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
914 "EventCode": "0xB7, 0xBB", 954 "EventCode": "0xB7, 0xBB",
915 "MSRValue": "0x3f84000008 ", 955 "MSRValue": "0x3f84000008 ",
916 "Counter": "0,1,2,3", 956 "Counter": "0,1,2,3",
@@ -923,6 +963,7 @@
923 "CounterHTOff": "0,1,2,3" 963 "CounterHTOff": "0,1,2,3"
924 }, 964 },
925 { 965 {
966 "PublicDescription": "Counts writebacks (modified to exclusive) that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
926 "EventCode": "0xB7, 0xBB", 967 "EventCode": "0xB7, 0xBB",
927 "MSRValue": "0x00bc000008 ", 968 "MSRValue": "0x00bc000008 ",
928 "Counter": "0,1,2,3", 969 "Counter": "0,1,2,3",
@@ -935,6 +976,7 @@
935 "CounterHTOff": "0,1,2,3" 976 "CounterHTOff": "0,1,2,3"
936 }, 977 },
937 { 978 {
979 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
938 "EventCode": "0xB7, 0xBB", 980 "EventCode": "0xB7, 0xBB",
939 "MSRValue": "0x013c000008 ", 981 "MSRValue": "0x013c000008 ",
940 "Counter": "0,1,2,3", 982 "Counter": "0,1,2,3",
@@ -947,6 +989,7 @@
947 "CounterHTOff": "0,1,2,3" 989 "CounterHTOff": "0,1,2,3"
948 }, 990 },
949 { 991 {
992 "PublicDescription": "Counts writebacks (modified to exclusive) that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
950 "EventCode": "0xB7, 0xBB", 993 "EventCode": "0xB7, 0xBB",
951 "MSRValue": "0x023c000008 ", 994 "MSRValue": "0x023c000008 ",
952 "Counter": "0,1,2,3", 995 "Counter": "0,1,2,3",
@@ -959,6 +1002,7 @@
959 "CounterHTOff": "0,1,2,3" 1002 "CounterHTOff": "0,1,2,3"
960 }, 1003 },
961 { 1004 {
1005 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
962 "EventCode": "0xB7, 0xBB", 1006 "EventCode": "0xB7, 0xBB",
963 "MSRValue": "0x043c000008 ", 1007 "MSRValue": "0x043c000008 ",
964 "Counter": "0,1,2,3", 1008 "Counter": "0,1,2,3",
@@ -971,6 +1015,7 @@
971 "CounterHTOff": "0,1,2,3" 1015 "CounterHTOff": "0,1,2,3"
972 }, 1016 },
973 { 1017 {
1018 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
974 "EventCode": "0xB7, 0xBB", 1019 "EventCode": "0xB7, 0xBB",
975 "MSRValue": "0x2000020010 ", 1020 "MSRValue": "0x2000020010 ",
976 "Counter": "0,1,2,3", 1021 "Counter": "0,1,2,3",
@@ -983,6 +1028,7 @@
983 "CounterHTOff": "0,1,2,3" 1028 "CounterHTOff": "0,1,2,3"
984 }, 1029 },
985 { 1030 {
1031 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
986 "EventCode": "0xB7, 0xBB", 1032 "EventCode": "0xB7, 0xBB",
987 "MSRValue": "0x20003c0010 ", 1033 "MSRValue": "0x20003c0010 ",
988 "Counter": "0,1,2,3", 1034 "Counter": "0,1,2,3",
@@ -995,6 +1041,7 @@
995 "CounterHTOff": "0,1,2,3" 1041 "CounterHTOff": "0,1,2,3"
996 }, 1042 },
997 { 1043 {
1044 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
998 "EventCode": "0xB7, 0xBB", 1045 "EventCode": "0xB7, 0xBB",
999 "MSRValue": "0x0084000010 ", 1046 "MSRValue": "0x0084000010 ",
1000 "Counter": "0,1,2,3", 1047 "Counter": "0,1,2,3",
@@ -1007,6 +1054,7 @@
1007 "CounterHTOff": "0,1,2,3" 1054 "CounterHTOff": "0,1,2,3"
1008 }, 1055 },
1009 { 1056 {
1057 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1010 "EventCode": "0xB7, 0xBB", 1058 "EventCode": "0xB7, 0xBB",
1011 "MSRValue": "0x0104000010 ", 1059 "MSRValue": "0x0104000010 ",
1012 "Counter": "0,1,2,3", 1060 "Counter": "0,1,2,3",
@@ -1019,6 +1067,7 @@
1019 "CounterHTOff": "0,1,2,3" 1067 "CounterHTOff": "0,1,2,3"
1020 }, 1068 },
1021 { 1069 {
1070 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1022 "EventCode": "0xB7, 0xBB", 1071 "EventCode": "0xB7, 0xBB",
1023 "MSRValue": "0x0204000010 ", 1072 "MSRValue": "0x0204000010 ",
1024 "Counter": "0,1,2,3", 1073 "Counter": "0,1,2,3",
@@ -1031,6 +1080,7 @@
1031 "CounterHTOff": "0,1,2,3" 1080 "CounterHTOff": "0,1,2,3"
1032 }, 1081 },
1033 { 1082 {
1083 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1034 "EventCode": "0xB7, 0xBB", 1084 "EventCode": "0xB7, 0xBB",
1035 "MSRValue": "0x0404000010 ", 1085 "MSRValue": "0x0404000010 ",
1036 "Counter": "0,1,2,3", 1086 "Counter": "0,1,2,3",
@@ -1043,6 +1093,7 @@
1043 "CounterHTOff": "0,1,2,3" 1093 "CounterHTOff": "0,1,2,3"
1044 }, 1094 },
1045 { 1095 {
1096 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1046 "EventCode": "0xB7, 0xBB", 1097 "EventCode": "0xB7, 0xBB",
1047 "MSRValue": "0x1004000010 ", 1098 "MSRValue": "0x1004000010 ",
1048 "Counter": "0,1,2,3", 1099 "Counter": "0,1,2,3",
@@ -1055,6 +1106,7 @@
1055 "CounterHTOff": "0,1,2,3" 1106 "CounterHTOff": "0,1,2,3"
1056 }, 1107 },
1057 { 1108 {
1109 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1058 "EventCode": "0xB7, 0xBB", 1110 "EventCode": "0xB7, 0xBB",
1059 "MSRValue": "0x2004000010 ", 1111 "MSRValue": "0x2004000010 ",
1060 "Counter": "0,1,2,3", 1112 "Counter": "0,1,2,3",
@@ -1067,6 +1119,7 @@
1067 "CounterHTOff": "0,1,2,3" 1119 "CounterHTOff": "0,1,2,3"
1068 }, 1120 },
1069 { 1121 {
1122 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1070 "EventCode": "0xB7, 0xBB", 1123 "EventCode": "0xB7, 0xBB",
1071 "MSRValue": "0x3f84000010 ", 1124 "MSRValue": "0x3f84000010 ",
1072 "Counter": "0,1,2,3", 1125 "Counter": "0,1,2,3",
@@ -1079,6 +1132,7 @@
1079 "CounterHTOff": "0,1,2,3" 1132 "CounterHTOff": "0,1,2,3"
1080 }, 1133 },
1081 { 1134 {
1135 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1082 "EventCode": "0xB7, 0xBB", 1136 "EventCode": "0xB7, 0xBB",
1083 "MSRValue": "0x00bc000010 ", 1137 "MSRValue": "0x00bc000010 ",
1084 "Counter": "0,1,2,3", 1138 "Counter": "0,1,2,3",
@@ -1091,6 +1145,7 @@
1091 "CounterHTOff": "0,1,2,3" 1145 "CounterHTOff": "0,1,2,3"
1092 }, 1146 },
1093 { 1147 {
1148 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1094 "EventCode": "0xB7, 0xBB", 1149 "EventCode": "0xB7, 0xBB",
1095 "MSRValue": "0x013c000010 ", 1150 "MSRValue": "0x013c000010 ",
1096 "Counter": "0,1,2,3", 1151 "Counter": "0,1,2,3",
@@ -1103,6 +1158,7 @@
1103 "CounterHTOff": "0,1,2,3" 1158 "CounterHTOff": "0,1,2,3"
1104 }, 1159 },
1105 { 1160 {
1161 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1106 "EventCode": "0xB7, 0xBB", 1162 "EventCode": "0xB7, 0xBB",
1107 "MSRValue": "0x023c000010 ", 1163 "MSRValue": "0x023c000010 ",
1108 "Counter": "0,1,2,3", 1164 "Counter": "0,1,2,3",
@@ -1115,6 +1171,7 @@
1115 "CounterHTOff": "0,1,2,3" 1171 "CounterHTOff": "0,1,2,3"
1116 }, 1172 },
1117 { 1173 {
1174 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1118 "EventCode": "0xB7, 0xBB", 1175 "EventCode": "0xB7, 0xBB",
1119 "MSRValue": "0x043c000010 ", 1176 "MSRValue": "0x043c000010 ",
1120 "Counter": "0,1,2,3", 1177 "Counter": "0,1,2,3",
@@ -1127,6 +1184,7 @@
1127 "CounterHTOff": "0,1,2,3" 1184 "CounterHTOff": "0,1,2,3"
1128 }, 1185 },
1129 { 1186 {
1187 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1130 "EventCode": "0xB7, 0xBB", 1188 "EventCode": "0xB7, 0xBB",
1131 "MSRValue": "0x2000020020 ", 1189 "MSRValue": "0x2000020020 ",
1132 "Counter": "0,1,2,3", 1190 "Counter": "0,1,2,3",
@@ -1139,6 +1197,7 @@
1139 "CounterHTOff": "0,1,2,3" 1197 "CounterHTOff": "0,1,2,3"
1140 }, 1198 },
1141 { 1199 {
1200 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1142 "EventCode": "0xB7, 0xBB", 1201 "EventCode": "0xB7, 0xBB",
1143 "MSRValue": "0x20003c0020 ", 1202 "MSRValue": "0x20003c0020 ",
1144 "Counter": "0,1,2,3", 1203 "Counter": "0,1,2,3",
@@ -1151,6 +1210,7 @@
1151 "CounterHTOff": "0,1,2,3" 1210 "CounterHTOff": "0,1,2,3"
1152 }, 1211 },
1153 { 1212 {
1213 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1154 "EventCode": "0xB7, 0xBB", 1214 "EventCode": "0xB7, 0xBB",
1155 "MSRValue": "0x0084000020 ", 1215 "MSRValue": "0x0084000020 ",
1156 "Counter": "0,1,2,3", 1216 "Counter": "0,1,2,3",
@@ -1163,6 +1223,7 @@
1163 "CounterHTOff": "0,1,2,3" 1223 "CounterHTOff": "0,1,2,3"
1164 }, 1224 },
1165 { 1225 {
1226 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1166 "EventCode": "0xB7, 0xBB", 1227 "EventCode": "0xB7, 0xBB",
1167 "MSRValue": "0x0104000020 ", 1228 "MSRValue": "0x0104000020 ",
1168 "Counter": "0,1,2,3", 1229 "Counter": "0,1,2,3",
@@ -1175,6 +1236,7 @@
1175 "CounterHTOff": "0,1,2,3" 1236 "CounterHTOff": "0,1,2,3"
1176 }, 1237 },
1177 { 1238 {
1239 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1178 "EventCode": "0xB7, 0xBB", 1240 "EventCode": "0xB7, 0xBB",
1179 "MSRValue": "0x0204000020 ", 1241 "MSRValue": "0x0204000020 ",
1180 "Counter": "0,1,2,3", 1242 "Counter": "0,1,2,3",
@@ -1187,6 +1249,7 @@
1187 "CounterHTOff": "0,1,2,3" 1249 "CounterHTOff": "0,1,2,3"
1188 }, 1250 },
1189 { 1251 {
1252 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1190 "EventCode": "0xB7, 0xBB", 1253 "EventCode": "0xB7, 0xBB",
1191 "MSRValue": "0x0404000020 ", 1254 "MSRValue": "0x0404000020 ",
1192 "Counter": "0,1,2,3", 1255 "Counter": "0,1,2,3",
@@ -1199,6 +1262,7 @@
1199 "CounterHTOff": "0,1,2,3" 1262 "CounterHTOff": "0,1,2,3"
1200 }, 1263 },
1201 { 1264 {
1265 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1202 "EventCode": "0xB7, 0xBB", 1266 "EventCode": "0xB7, 0xBB",
1203 "MSRValue": "0x1004000020 ", 1267 "MSRValue": "0x1004000020 ",
1204 "Counter": "0,1,2,3", 1268 "Counter": "0,1,2,3",
@@ -1211,6 +1275,7 @@
1211 "CounterHTOff": "0,1,2,3" 1275 "CounterHTOff": "0,1,2,3"
1212 }, 1276 },
1213 { 1277 {
1278 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1214 "EventCode": "0xB7, 0xBB", 1279 "EventCode": "0xB7, 0xBB",
1215 "MSRValue": "0x2004000020 ", 1280 "MSRValue": "0x2004000020 ",
1216 "Counter": "0,1,2,3", 1281 "Counter": "0,1,2,3",
@@ -1223,6 +1288,7 @@
1223 "CounterHTOff": "0,1,2,3" 1288 "CounterHTOff": "0,1,2,3"
1224 }, 1289 },
1225 { 1290 {
1291 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1226 "EventCode": "0xB7, 0xBB", 1292 "EventCode": "0xB7, 0xBB",
1227 "MSRValue": "0x3f84000020 ", 1293 "MSRValue": "0x3f84000020 ",
1228 "Counter": "0,1,2,3", 1294 "Counter": "0,1,2,3",
@@ -1235,6 +1301,7 @@
1235 "CounterHTOff": "0,1,2,3" 1301 "CounterHTOff": "0,1,2,3"
1236 }, 1302 },
1237 { 1303 {
1304 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1238 "EventCode": "0xB7, 0xBB", 1305 "EventCode": "0xB7, 0xBB",
1239 "MSRValue": "0x00bc000020 ", 1306 "MSRValue": "0x00bc000020 ",
1240 "Counter": "0,1,2,3", 1307 "Counter": "0,1,2,3",
@@ -1247,6 +1314,7 @@
1247 "CounterHTOff": "0,1,2,3" 1314 "CounterHTOff": "0,1,2,3"
1248 }, 1315 },
1249 { 1316 {
1317 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1250 "EventCode": "0xB7, 0xBB", 1318 "EventCode": "0xB7, 0xBB",
1251 "MSRValue": "0x013c000020 ", 1319 "MSRValue": "0x013c000020 ",
1252 "Counter": "0,1,2,3", 1320 "Counter": "0,1,2,3",
@@ -1259,6 +1327,7 @@
1259 "CounterHTOff": "0,1,2,3" 1327 "CounterHTOff": "0,1,2,3"
1260 }, 1328 },
1261 { 1329 {
1330 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1262 "EventCode": "0xB7, 0xBB", 1331 "EventCode": "0xB7, 0xBB",
1263 "MSRValue": "0x023c000020 ", 1332 "MSRValue": "0x023c000020 ",
1264 "Counter": "0,1,2,3", 1333 "Counter": "0,1,2,3",
@@ -1271,6 +1340,7 @@
1271 "CounterHTOff": "0,1,2,3" 1340 "CounterHTOff": "0,1,2,3"
1272 }, 1341 },
1273 { 1342 {
1343 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1274 "EventCode": "0xB7, 0xBB", 1344 "EventCode": "0xB7, 0xBB",
1275 "MSRValue": "0x043c000020 ", 1345 "MSRValue": "0x043c000020 ",
1276 "Counter": "0,1,2,3", 1346 "Counter": "0,1,2,3",
@@ -1283,6 +1353,7 @@
1283 "CounterHTOff": "0,1,2,3" 1353 "CounterHTOff": "0,1,2,3"
1284 }, 1354 },
1285 { 1355 {
1356 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1286 "EventCode": "0xB7, 0xBB", 1357 "EventCode": "0xB7, 0xBB",
1287 "MSRValue": "0x2000020040 ", 1358 "MSRValue": "0x2000020040 ",
1288 "Counter": "0,1,2,3", 1359 "Counter": "0,1,2,3",
@@ -1295,6 +1366,7 @@
1295 "CounterHTOff": "0,1,2,3" 1366 "CounterHTOff": "0,1,2,3"
1296 }, 1367 },
1297 { 1368 {
1369 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1298 "EventCode": "0xB7, 0xBB", 1370 "EventCode": "0xB7, 0xBB",
1299 "MSRValue": "0x20003c0040 ", 1371 "MSRValue": "0x20003c0040 ",
1300 "Counter": "0,1,2,3", 1372 "Counter": "0,1,2,3",
@@ -1307,6 +1379,7 @@
1307 "CounterHTOff": "0,1,2,3" 1379 "CounterHTOff": "0,1,2,3"
1308 }, 1380 },
1309 { 1381 {
1382 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1310 "EventCode": "0xB7, 0xBB", 1383 "EventCode": "0xB7, 0xBB",
1311 "MSRValue": "0x0084000040 ", 1384 "MSRValue": "0x0084000040 ",
1312 "Counter": "0,1,2,3", 1385 "Counter": "0,1,2,3",
@@ -1319,6 +1392,7 @@
1319 "CounterHTOff": "0,1,2,3" 1392 "CounterHTOff": "0,1,2,3"
1320 }, 1393 },
1321 { 1394 {
1395 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1322 "EventCode": "0xB7, 0xBB", 1396 "EventCode": "0xB7, 0xBB",
1323 "MSRValue": "0x0104000040 ", 1397 "MSRValue": "0x0104000040 ",
1324 "Counter": "0,1,2,3", 1398 "Counter": "0,1,2,3",
@@ -1331,6 +1405,7 @@
1331 "CounterHTOff": "0,1,2,3" 1405 "CounterHTOff": "0,1,2,3"
1332 }, 1406 },
1333 { 1407 {
1408 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1334 "EventCode": "0xB7, 0xBB", 1409 "EventCode": "0xB7, 0xBB",
1335 "MSRValue": "0x0204000040 ", 1410 "MSRValue": "0x0204000040 ",
1336 "Counter": "0,1,2,3", 1411 "Counter": "0,1,2,3",
@@ -1343,6 +1418,7 @@
1343 "CounterHTOff": "0,1,2,3" 1418 "CounterHTOff": "0,1,2,3"
1344 }, 1419 },
1345 { 1420 {
1421 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1346 "EventCode": "0xB7, 0xBB", 1422 "EventCode": "0xB7, 0xBB",
1347 "MSRValue": "0x0404000040 ", 1423 "MSRValue": "0x0404000040 ",
1348 "Counter": "0,1,2,3", 1424 "Counter": "0,1,2,3",
@@ -1355,6 +1431,7 @@
1355 "CounterHTOff": "0,1,2,3" 1431 "CounterHTOff": "0,1,2,3"
1356 }, 1432 },
1357 { 1433 {
1434 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1358 "EventCode": "0xB7, 0xBB", 1435 "EventCode": "0xB7, 0xBB",
1359 "MSRValue": "0x1004000040 ", 1436 "MSRValue": "0x1004000040 ",
1360 "Counter": "0,1,2,3", 1437 "Counter": "0,1,2,3",
@@ -1367,6 +1444,7 @@
1367 "CounterHTOff": "0,1,2,3" 1444 "CounterHTOff": "0,1,2,3"
1368 }, 1445 },
1369 { 1446 {
1447 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1370 "EventCode": "0xB7, 0xBB", 1448 "EventCode": "0xB7, 0xBB",
1371 "MSRValue": "0x2004000040 ", 1449 "MSRValue": "0x2004000040 ",
1372 "Counter": "0,1,2,3", 1450 "Counter": "0,1,2,3",
@@ -1379,6 +1457,7 @@
1379 "CounterHTOff": "0,1,2,3" 1457 "CounterHTOff": "0,1,2,3"
1380 }, 1458 },
1381 { 1459 {
1460 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1382 "EventCode": "0xB7, 0xBB", 1461 "EventCode": "0xB7, 0xBB",
1383 "MSRValue": "0x3f84000040 ", 1462 "MSRValue": "0x3f84000040 ",
1384 "Counter": "0,1,2,3", 1463 "Counter": "0,1,2,3",
@@ -1391,6 +1470,7 @@
1391 "CounterHTOff": "0,1,2,3" 1470 "CounterHTOff": "0,1,2,3"
1392 }, 1471 },
1393 { 1472 {
1473 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1394 "EventCode": "0xB7, 0xBB", 1474 "EventCode": "0xB7, 0xBB",
1395 "MSRValue": "0x00bc000040 ", 1475 "MSRValue": "0x00bc000040 ",
1396 "Counter": "0,1,2,3", 1476 "Counter": "0,1,2,3",
@@ -1403,6 +1483,7 @@
1403 "CounterHTOff": "0,1,2,3" 1483 "CounterHTOff": "0,1,2,3"
1404 }, 1484 },
1405 { 1485 {
1486 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1406 "EventCode": "0xB7, 0xBB", 1487 "EventCode": "0xB7, 0xBB",
1407 "MSRValue": "0x013c000040 ", 1488 "MSRValue": "0x013c000040 ",
1408 "Counter": "0,1,2,3", 1489 "Counter": "0,1,2,3",
@@ -1415,6 +1496,7 @@
1415 "CounterHTOff": "0,1,2,3" 1496 "CounterHTOff": "0,1,2,3"
1416 }, 1497 },
1417 { 1498 {
1499 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1418 "EventCode": "0xB7, 0xBB", 1500 "EventCode": "0xB7, 0xBB",
1419 "MSRValue": "0x023c000040 ", 1501 "MSRValue": "0x023c000040 ",
1420 "Counter": "0,1,2,3", 1502 "Counter": "0,1,2,3",
@@ -1427,6 +1509,7 @@
1427 "CounterHTOff": "0,1,2,3" 1509 "CounterHTOff": "0,1,2,3"
1428 }, 1510 },
1429 { 1511 {
1512 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1430 "EventCode": "0xB7, 0xBB", 1513 "EventCode": "0xB7, 0xBB",
1431 "MSRValue": "0x043c000040 ", 1514 "MSRValue": "0x043c000040 ",
1432 "Counter": "0,1,2,3", 1515 "Counter": "0,1,2,3",
@@ -1439,6 +1522,7 @@
1439 "CounterHTOff": "0,1,2,3" 1522 "CounterHTOff": "0,1,2,3"
1440 }, 1523 },
1441 { 1524 {
1525 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1442 "EventCode": "0xB7, 0xBB", 1526 "EventCode": "0xB7, 0xBB",
1443 "MSRValue": "0x2000020080 ", 1527 "MSRValue": "0x2000020080 ",
1444 "Counter": "0,1,2,3", 1528 "Counter": "0,1,2,3",
@@ -1451,6 +1535,7 @@
1451 "CounterHTOff": "0,1,2,3" 1535 "CounterHTOff": "0,1,2,3"
1452 }, 1536 },
1453 { 1537 {
1538 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1454 "EventCode": "0xB7, 0xBB", 1539 "EventCode": "0xB7, 0xBB",
1455 "MSRValue": "0x20003c0080 ", 1540 "MSRValue": "0x20003c0080 ",
1456 "Counter": "0,1,2,3", 1541 "Counter": "0,1,2,3",
@@ -1463,6 +1548,7 @@
1463 "CounterHTOff": "0,1,2,3" 1548 "CounterHTOff": "0,1,2,3"
1464 }, 1549 },
1465 { 1550 {
1551 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1466 "EventCode": "0xB7, 0xBB", 1552 "EventCode": "0xB7, 0xBB",
1467 "MSRValue": "0x0084000080 ", 1553 "MSRValue": "0x0084000080 ",
1468 "Counter": "0,1,2,3", 1554 "Counter": "0,1,2,3",
@@ -1475,6 +1561,7 @@
1475 "CounterHTOff": "0,1,2,3" 1561 "CounterHTOff": "0,1,2,3"
1476 }, 1562 },
1477 { 1563 {
1564 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1478 "EventCode": "0xB7, 0xBB", 1565 "EventCode": "0xB7, 0xBB",
1479 "MSRValue": "0x0104000080 ", 1566 "MSRValue": "0x0104000080 ",
1480 "Counter": "0,1,2,3", 1567 "Counter": "0,1,2,3",
@@ -1487,6 +1574,7 @@
1487 "CounterHTOff": "0,1,2,3" 1574 "CounterHTOff": "0,1,2,3"
1488 }, 1575 },
1489 { 1576 {
1577 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1490 "EventCode": "0xB7, 0xBB", 1578 "EventCode": "0xB7, 0xBB",
1491 "MSRValue": "0x0204000080 ", 1579 "MSRValue": "0x0204000080 ",
1492 "Counter": "0,1,2,3", 1580 "Counter": "0,1,2,3",
@@ -1499,6 +1587,7 @@
1499 "CounterHTOff": "0,1,2,3" 1587 "CounterHTOff": "0,1,2,3"
1500 }, 1588 },
1501 { 1589 {
1590 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1502 "EventCode": "0xB7, 0xBB", 1591 "EventCode": "0xB7, 0xBB",
1503 "MSRValue": "0x0404000080 ", 1592 "MSRValue": "0x0404000080 ",
1504 "Counter": "0,1,2,3", 1593 "Counter": "0,1,2,3",
@@ -1511,6 +1600,7 @@
1511 "CounterHTOff": "0,1,2,3" 1600 "CounterHTOff": "0,1,2,3"
1512 }, 1601 },
1513 { 1602 {
1603 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1514 "EventCode": "0xB7, 0xBB", 1604 "EventCode": "0xB7, 0xBB",
1515 "MSRValue": "0x1004000080 ", 1605 "MSRValue": "0x1004000080 ",
1516 "Counter": "0,1,2,3", 1606 "Counter": "0,1,2,3",
@@ -1523,6 +1613,7 @@
1523 "CounterHTOff": "0,1,2,3" 1613 "CounterHTOff": "0,1,2,3"
1524 }, 1614 },
1525 { 1615 {
1616 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1526 "EventCode": "0xB7, 0xBB", 1617 "EventCode": "0xB7, 0xBB",
1527 "MSRValue": "0x2004000080 ", 1618 "MSRValue": "0x2004000080 ",
1528 "Counter": "0,1,2,3", 1619 "Counter": "0,1,2,3",
@@ -1535,6 +1626,7 @@
1535 "CounterHTOff": "0,1,2,3" 1626 "CounterHTOff": "0,1,2,3"
1536 }, 1627 },
1537 { 1628 {
1629 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1538 "EventCode": "0xB7, 0xBB", 1630 "EventCode": "0xB7, 0xBB",
1539 "MSRValue": "0x3f84000080 ", 1631 "MSRValue": "0x3f84000080 ",
1540 "Counter": "0,1,2,3", 1632 "Counter": "0,1,2,3",
@@ -1547,6 +1639,7 @@
1547 "CounterHTOff": "0,1,2,3" 1639 "CounterHTOff": "0,1,2,3"
1548 }, 1640 },
1549 { 1641 {
1642 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1550 "EventCode": "0xB7, 0xBB", 1643 "EventCode": "0xB7, 0xBB",
1551 "MSRValue": "0x00bc000080 ", 1644 "MSRValue": "0x00bc000080 ",
1552 "Counter": "0,1,2,3", 1645 "Counter": "0,1,2,3",
@@ -1559,6 +1652,7 @@
1559 "CounterHTOff": "0,1,2,3" 1652 "CounterHTOff": "0,1,2,3"
1560 }, 1653 },
1561 { 1654 {
1655 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1562 "EventCode": "0xB7, 0xBB", 1656 "EventCode": "0xB7, 0xBB",
1563 "MSRValue": "0x013c000080 ", 1657 "MSRValue": "0x013c000080 ",
1564 "Counter": "0,1,2,3", 1658 "Counter": "0,1,2,3",
@@ -1571,6 +1665,7 @@
1571 "CounterHTOff": "0,1,2,3" 1665 "CounterHTOff": "0,1,2,3"
1572 }, 1666 },
1573 { 1667 {
1668 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1574 "EventCode": "0xB7, 0xBB", 1669 "EventCode": "0xB7, 0xBB",
1575 "MSRValue": "0x023c000080 ", 1670 "MSRValue": "0x023c000080 ",
1576 "Counter": "0,1,2,3", 1671 "Counter": "0,1,2,3",
@@ -1583,6 +1678,7 @@
1583 "CounterHTOff": "0,1,2,3" 1678 "CounterHTOff": "0,1,2,3"
1584 }, 1679 },
1585 { 1680 {
1681 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1586 "EventCode": "0xB7, 0xBB", 1682 "EventCode": "0xB7, 0xBB",
1587 "MSRValue": "0x043c000080 ", 1683 "MSRValue": "0x043c000080 ",
1588 "Counter": "0,1,2,3", 1684 "Counter": "0,1,2,3",
@@ -1595,6 +1691,7 @@
1595 "CounterHTOff": "0,1,2,3" 1691 "CounterHTOff": "0,1,2,3"
1596 }, 1692 },
1597 { 1693 {
1694 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1598 "EventCode": "0xB7, 0xBB", 1695 "EventCode": "0xB7, 0xBB",
1599 "MSRValue": "0x2000020100 ", 1696 "MSRValue": "0x2000020100 ",
1600 "Counter": "0,1,2,3", 1697 "Counter": "0,1,2,3",
@@ -1607,6 +1704,7 @@
1607 "CounterHTOff": "0,1,2,3" 1704 "CounterHTOff": "0,1,2,3"
1608 }, 1705 },
1609 { 1706 {
1707 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1610 "EventCode": "0xB7, 0xBB", 1708 "EventCode": "0xB7, 0xBB",
1611 "MSRValue": "0x20003c0100 ", 1709 "MSRValue": "0x20003c0100 ",
1612 "Counter": "0,1,2,3", 1710 "Counter": "0,1,2,3",
@@ -1619,6 +1717,7 @@
1619 "CounterHTOff": "0,1,2,3" 1717 "CounterHTOff": "0,1,2,3"
1620 }, 1718 },
1621 { 1719 {
1720 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1622 "EventCode": "0xB7, 0xBB", 1721 "EventCode": "0xB7, 0xBB",
1623 "MSRValue": "0x0084000100 ", 1722 "MSRValue": "0x0084000100 ",
1624 "Counter": "0,1,2,3", 1723 "Counter": "0,1,2,3",
@@ -1631,6 +1730,7 @@
1631 "CounterHTOff": "0,1,2,3" 1730 "CounterHTOff": "0,1,2,3"
1632 }, 1731 },
1633 { 1732 {
1733 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1634 "EventCode": "0xB7, 0xBB", 1734 "EventCode": "0xB7, 0xBB",
1635 "MSRValue": "0x0104000100 ", 1735 "MSRValue": "0x0104000100 ",
1636 "Counter": "0,1,2,3", 1736 "Counter": "0,1,2,3",
@@ -1643,6 +1743,7 @@
1643 "CounterHTOff": "0,1,2,3" 1743 "CounterHTOff": "0,1,2,3"
1644 }, 1744 },
1645 { 1745 {
1746 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1646 "EventCode": "0xB7, 0xBB", 1747 "EventCode": "0xB7, 0xBB",
1647 "MSRValue": "0x0204000100 ", 1748 "MSRValue": "0x0204000100 ",
1648 "Counter": "0,1,2,3", 1749 "Counter": "0,1,2,3",
@@ -1655,6 +1756,7 @@
1655 "CounterHTOff": "0,1,2,3" 1756 "CounterHTOff": "0,1,2,3"
1656 }, 1757 },
1657 { 1758 {
1759 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1658 "EventCode": "0xB7, 0xBB", 1760 "EventCode": "0xB7, 0xBB",
1659 "MSRValue": "0x0404000100 ", 1761 "MSRValue": "0x0404000100 ",
1660 "Counter": "0,1,2,3", 1762 "Counter": "0,1,2,3",
@@ -1667,6 +1769,7 @@
1667 "CounterHTOff": "0,1,2,3" 1769 "CounterHTOff": "0,1,2,3"
1668 }, 1770 },
1669 { 1771 {
1772 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1670 "EventCode": "0xB7, 0xBB", 1773 "EventCode": "0xB7, 0xBB",
1671 "MSRValue": "0x1004000100 ", 1774 "MSRValue": "0x1004000100 ",
1672 "Counter": "0,1,2,3", 1775 "Counter": "0,1,2,3",
@@ -1679,6 +1782,7 @@
1679 "CounterHTOff": "0,1,2,3" 1782 "CounterHTOff": "0,1,2,3"
1680 }, 1783 },
1681 { 1784 {
1785 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1682 "EventCode": "0xB7, 0xBB", 1786 "EventCode": "0xB7, 0xBB",
1683 "MSRValue": "0x2004000100 ", 1787 "MSRValue": "0x2004000100 ",
1684 "Counter": "0,1,2,3", 1788 "Counter": "0,1,2,3",
@@ -1691,6 +1795,7 @@
1691 "CounterHTOff": "0,1,2,3" 1795 "CounterHTOff": "0,1,2,3"
1692 }, 1796 },
1693 { 1797 {
1798 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1694 "EventCode": "0xB7, 0xBB", 1799 "EventCode": "0xB7, 0xBB",
1695 "MSRValue": "0x3f84000100 ", 1800 "MSRValue": "0x3f84000100 ",
1696 "Counter": "0,1,2,3", 1801 "Counter": "0,1,2,3",
@@ -1703,6 +1808,7 @@
1703 "CounterHTOff": "0,1,2,3" 1808 "CounterHTOff": "0,1,2,3"
1704 }, 1809 },
1705 { 1810 {
1811 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1706 "EventCode": "0xB7, 0xBB", 1812 "EventCode": "0xB7, 0xBB",
1707 "MSRValue": "0x00bc000100 ", 1813 "MSRValue": "0x00bc000100 ",
1708 "Counter": "0,1,2,3", 1814 "Counter": "0,1,2,3",
@@ -1715,6 +1821,7 @@
1715 "CounterHTOff": "0,1,2,3" 1821 "CounterHTOff": "0,1,2,3"
1716 }, 1822 },
1717 { 1823 {
1824 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1718 "EventCode": "0xB7, 0xBB", 1825 "EventCode": "0xB7, 0xBB",
1719 "MSRValue": "0x013c000100 ", 1826 "MSRValue": "0x013c000100 ",
1720 "Counter": "0,1,2,3", 1827 "Counter": "0,1,2,3",
@@ -1727,6 +1834,7 @@
1727 "CounterHTOff": "0,1,2,3" 1834 "CounterHTOff": "0,1,2,3"
1728 }, 1835 },
1729 { 1836 {
1837 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1730 "EventCode": "0xB7, 0xBB", 1838 "EventCode": "0xB7, 0xBB",
1731 "MSRValue": "0x023c000100 ", 1839 "MSRValue": "0x023c000100 ",
1732 "Counter": "0,1,2,3", 1840 "Counter": "0,1,2,3",
@@ -1739,6 +1847,7 @@
1739 "CounterHTOff": "0,1,2,3" 1847 "CounterHTOff": "0,1,2,3"
1740 }, 1848 },
1741 { 1849 {
1850 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1742 "EventCode": "0xB7, 0xBB", 1851 "EventCode": "0xB7, 0xBB",
1743 "MSRValue": "0x043c000100 ", 1852 "MSRValue": "0x043c000100 ",
1744 "Counter": "0,1,2,3", 1853 "Counter": "0,1,2,3",
@@ -1751,6 +1860,7 @@
1751 "CounterHTOff": "0,1,2,3" 1860 "CounterHTOff": "0,1,2,3"
1752 }, 1861 },
1753 { 1862 {
1863 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1754 "EventCode": "0xB7, 0xBB", 1864 "EventCode": "0xB7, 0xBB",
1755 "MSRValue": "0x2000020200 ", 1865 "MSRValue": "0x2000020200 ",
1756 "Counter": "0,1,2,3", 1866 "Counter": "0,1,2,3",
@@ -1763,6 +1873,7 @@
1763 "CounterHTOff": "0,1,2,3" 1873 "CounterHTOff": "0,1,2,3"
1764 }, 1874 },
1765 { 1875 {
1876 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1766 "EventCode": "0xB7, 0xBB", 1877 "EventCode": "0xB7, 0xBB",
1767 "MSRValue": "0x20003c0200 ", 1878 "MSRValue": "0x20003c0200 ",
1768 "Counter": "0,1,2,3", 1879 "Counter": "0,1,2,3",
@@ -1775,6 +1886,7 @@
1775 "CounterHTOff": "0,1,2,3" 1886 "CounterHTOff": "0,1,2,3"
1776 }, 1887 },
1777 { 1888 {
1889 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1778 "EventCode": "0xB7, 0xBB", 1890 "EventCode": "0xB7, 0xBB",
1779 "MSRValue": "0x0084000200 ", 1891 "MSRValue": "0x0084000200 ",
1780 "Counter": "0,1,2,3", 1892 "Counter": "0,1,2,3",
@@ -1787,6 +1899,7 @@
1787 "CounterHTOff": "0,1,2,3" 1899 "CounterHTOff": "0,1,2,3"
1788 }, 1900 },
1789 { 1901 {
1902 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1790 "EventCode": "0xB7, 0xBB", 1903 "EventCode": "0xB7, 0xBB",
1791 "MSRValue": "0x0104000200 ", 1904 "MSRValue": "0x0104000200 ",
1792 "Counter": "0,1,2,3", 1905 "Counter": "0,1,2,3",
@@ -1799,6 +1912,7 @@
1799 "CounterHTOff": "0,1,2,3" 1912 "CounterHTOff": "0,1,2,3"
1800 }, 1913 },
1801 { 1914 {
1915 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1802 "EventCode": "0xB7, 0xBB", 1916 "EventCode": "0xB7, 0xBB",
1803 "MSRValue": "0x0204000200 ", 1917 "MSRValue": "0x0204000200 ",
1804 "Counter": "0,1,2,3", 1918 "Counter": "0,1,2,3",
@@ -1811,6 +1925,7 @@
1811 "CounterHTOff": "0,1,2,3" 1925 "CounterHTOff": "0,1,2,3"
1812 }, 1926 },
1813 { 1927 {
1928 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1814 "EventCode": "0xB7, 0xBB", 1929 "EventCode": "0xB7, 0xBB",
1815 "MSRValue": "0x0404000200 ", 1930 "MSRValue": "0x0404000200 ",
1816 "Counter": "0,1,2,3", 1931 "Counter": "0,1,2,3",
@@ -1823,6 +1938,7 @@
1823 "CounterHTOff": "0,1,2,3" 1938 "CounterHTOff": "0,1,2,3"
1824 }, 1939 },
1825 { 1940 {
1941 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1826 "EventCode": "0xB7, 0xBB", 1942 "EventCode": "0xB7, 0xBB",
1827 "MSRValue": "0x1004000200 ", 1943 "MSRValue": "0x1004000200 ",
1828 "Counter": "0,1,2,3", 1944 "Counter": "0,1,2,3",
@@ -1835,6 +1951,7 @@
1835 "CounterHTOff": "0,1,2,3" 1951 "CounterHTOff": "0,1,2,3"
1836 }, 1952 },
1837 { 1953 {
1954 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1838 "EventCode": "0xB7, 0xBB", 1955 "EventCode": "0xB7, 0xBB",
1839 "MSRValue": "0x2004000200 ", 1956 "MSRValue": "0x2004000200 ",
1840 "Counter": "0,1,2,3", 1957 "Counter": "0,1,2,3",
@@ -1847,6 +1964,7 @@
1847 "CounterHTOff": "0,1,2,3" 1964 "CounterHTOff": "0,1,2,3"
1848 }, 1965 },
1849 { 1966 {
1967 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1850 "EventCode": "0xB7, 0xBB", 1968 "EventCode": "0xB7, 0xBB",
1851 "MSRValue": "0x3f84000200 ", 1969 "MSRValue": "0x3f84000200 ",
1852 "Counter": "0,1,2,3", 1970 "Counter": "0,1,2,3",
@@ -1859,6 +1977,7 @@
1859 "CounterHTOff": "0,1,2,3" 1977 "CounterHTOff": "0,1,2,3"
1860 }, 1978 },
1861 { 1979 {
1980 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1862 "EventCode": "0xB7, 0xBB", 1981 "EventCode": "0xB7, 0xBB",
1863 "MSRValue": "0x00bc000200 ", 1982 "MSRValue": "0x00bc000200 ",
1864 "Counter": "0,1,2,3", 1983 "Counter": "0,1,2,3",
@@ -1871,6 +1990,7 @@
1871 "CounterHTOff": "0,1,2,3" 1990 "CounterHTOff": "0,1,2,3"
1872 }, 1991 },
1873 { 1992 {
1993 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1874 "EventCode": "0xB7, 0xBB", 1994 "EventCode": "0xB7, 0xBB",
1875 "MSRValue": "0x013c000200 ", 1995 "MSRValue": "0x013c000200 ",
1876 "Counter": "0,1,2,3", 1996 "Counter": "0,1,2,3",
@@ -1883,6 +2003,7 @@
1883 "CounterHTOff": "0,1,2,3" 2003 "CounterHTOff": "0,1,2,3"
1884 }, 2004 },
1885 { 2005 {
2006 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1886 "EventCode": "0xB7, 0xBB", 2007 "EventCode": "0xB7, 0xBB",
1887 "MSRValue": "0x023c000200 ", 2008 "MSRValue": "0x023c000200 ",
1888 "Counter": "0,1,2,3", 2009 "Counter": "0,1,2,3",
@@ -1895,6 +2016,7 @@
1895 "CounterHTOff": "0,1,2,3" 2016 "CounterHTOff": "0,1,2,3"
1896 }, 2017 },
1897 { 2018 {
2019 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1898 "EventCode": "0xB7, 0xBB", 2020 "EventCode": "0xB7, 0xBB",
1899 "MSRValue": "0x043c000200 ", 2021 "MSRValue": "0x043c000200 ",
1900 "Counter": "0,1,2,3", 2022 "Counter": "0,1,2,3",
@@ -1907,6 +2029,7 @@
1907 "CounterHTOff": "0,1,2,3" 2029 "CounterHTOff": "0,1,2,3"
1908 }, 2030 },
1909 { 2031 {
2032 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1910 "EventCode": "0xB7, 0xBB", 2033 "EventCode": "0xB7, 0xBB",
1911 "MSRValue": "0x2000028000 ", 2034 "MSRValue": "0x2000028000 ",
1912 "Counter": "0,1,2,3", 2035 "Counter": "0,1,2,3",
@@ -1919,6 +2042,7 @@
1919 "CounterHTOff": "0,1,2,3" 2042 "CounterHTOff": "0,1,2,3"
1920 }, 2043 },
1921 { 2044 {
2045 "PublicDescription": "Counts any other requests that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1922 "EventCode": "0xB7, 0xBB", 2046 "EventCode": "0xB7, 0xBB",
1923 "MSRValue": "0x20003c8000 ", 2047 "MSRValue": "0x20003c8000 ",
1924 "Counter": "0,1,2,3", 2048 "Counter": "0,1,2,3",
@@ -1931,6 +2055,7 @@
1931 "CounterHTOff": "0,1,2,3" 2055 "CounterHTOff": "0,1,2,3"
1932 }, 2056 },
1933 { 2057 {
2058 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1934 "EventCode": "0xB7, 0xBB", 2059 "EventCode": "0xB7, 0xBB",
1935 "MSRValue": "0x0084008000 ", 2060 "MSRValue": "0x0084008000 ",
1936 "Counter": "0,1,2,3", 2061 "Counter": "0,1,2,3",
@@ -1943,6 +2068,7 @@
1943 "CounterHTOff": "0,1,2,3" 2068 "CounterHTOff": "0,1,2,3"
1944 }, 2069 },
1945 { 2070 {
2071 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1946 "EventCode": "0xB7, 0xBB", 2072 "EventCode": "0xB7, 0xBB",
1947 "MSRValue": "0x0104008000 ", 2073 "MSRValue": "0x0104008000 ",
1948 "Counter": "0,1,2,3", 2074 "Counter": "0,1,2,3",
@@ -1955,6 +2081,7 @@
1955 "CounterHTOff": "0,1,2,3" 2081 "CounterHTOff": "0,1,2,3"
1956 }, 2082 },
1957 { 2083 {
2084 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1958 "EventCode": "0xB7, 0xBB", 2085 "EventCode": "0xB7, 0xBB",
1959 "MSRValue": "0x0204008000 ", 2086 "MSRValue": "0x0204008000 ",
1960 "Counter": "0,1,2,3", 2087 "Counter": "0,1,2,3",
@@ -1967,6 +2094,7 @@
1967 "CounterHTOff": "0,1,2,3" 2094 "CounterHTOff": "0,1,2,3"
1968 }, 2095 },
1969 { 2096 {
2097 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1970 "EventCode": "0xB7, 0xBB", 2098 "EventCode": "0xB7, 0xBB",
1971 "MSRValue": "0x0404008000 ", 2099 "MSRValue": "0x0404008000 ",
1972 "Counter": "0,1,2,3", 2100 "Counter": "0,1,2,3",
@@ -1979,6 +2107,7 @@
1979 "CounterHTOff": "0,1,2,3" 2107 "CounterHTOff": "0,1,2,3"
1980 }, 2108 },
1981 { 2109 {
2110 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1982 "EventCode": "0xB7, 0xBB", 2111 "EventCode": "0xB7, 0xBB",
1983 "MSRValue": "0x1004008000 ", 2112 "MSRValue": "0x1004008000 ",
1984 "Counter": "0,1,2,3", 2113 "Counter": "0,1,2,3",
@@ -1991,6 +2120,7 @@
1991 "CounterHTOff": "0,1,2,3" 2120 "CounterHTOff": "0,1,2,3"
1992 }, 2121 },
1993 { 2122 {
2123 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1994 "EventCode": "0xB7, 0xBB", 2124 "EventCode": "0xB7, 0xBB",
1995 "MSRValue": "0x2004008000 ", 2125 "MSRValue": "0x2004008000 ",
1996 "Counter": "0,1,2,3", 2126 "Counter": "0,1,2,3",
@@ -2003,6 +2133,7 @@
2003 "CounterHTOff": "0,1,2,3" 2133 "CounterHTOff": "0,1,2,3"
2004 }, 2134 },
2005 { 2135 {
2136 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2006 "EventCode": "0xB7, 0xBB", 2137 "EventCode": "0xB7, 0xBB",
2007 "MSRValue": "0x3f84008000 ", 2138 "MSRValue": "0x3f84008000 ",
2008 "Counter": "0,1,2,3", 2139 "Counter": "0,1,2,3",
@@ -2015,6 +2146,7 @@
2015 "CounterHTOff": "0,1,2,3" 2146 "CounterHTOff": "0,1,2,3"
2016 }, 2147 },
2017 { 2148 {
2149 "PublicDescription": "Counts any other requests that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2018 "EventCode": "0xB7, 0xBB", 2150 "EventCode": "0xB7, 0xBB",
2019 "MSRValue": "0x00bc008000 ", 2151 "MSRValue": "0x00bc008000 ",
2020 "Counter": "0,1,2,3", 2152 "Counter": "0,1,2,3",
@@ -2027,6 +2159,7 @@
2027 "CounterHTOff": "0,1,2,3" 2159 "CounterHTOff": "0,1,2,3"
2028 }, 2160 },
2029 { 2161 {
2162 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2030 "EventCode": "0xB7, 0xBB", 2163 "EventCode": "0xB7, 0xBB",
2031 "MSRValue": "0x013c008000 ", 2164 "MSRValue": "0x013c008000 ",
2032 "Counter": "0,1,2,3", 2165 "Counter": "0,1,2,3",
@@ -2039,6 +2172,7 @@
2039 "CounterHTOff": "0,1,2,3" 2172 "CounterHTOff": "0,1,2,3"
2040 }, 2173 },
2041 { 2174 {
2175 "PublicDescription": "Counts any other requests that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2042 "EventCode": "0xB7, 0xBB", 2176 "EventCode": "0xB7, 0xBB",
2043 "MSRValue": "0x023c008000 ", 2177 "MSRValue": "0x023c008000 ",
2044 "Counter": "0,1,2,3", 2178 "Counter": "0,1,2,3",
@@ -2051,6 +2185,7 @@
2051 "CounterHTOff": "0,1,2,3" 2185 "CounterHTOff": "0,1,2,3"
2052 }, 2186 },
2053 { 2187 {
2188 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2054 "EventCode": "0xB7, 0xBB", 2189 "EventCode": "0xB7, 0xBB",
2055 "MSRValue": "0x043c008000 ", 2190 "MSRValue": "0x043c008000 ",
2056 "Counter": "0,1,2,3", 2191 "Counter": "0,1,2,3",
@@ -2063,6 +2198,7 @@
2063 "CounterHTOff": "0,1,2,3" 2198 "CounterHTOff": "0,1,2,3"
2064 }, 2199 },
2065 { 2200 {
2201 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2066 "EventCode": "0xB7, 0xBB", 2202 "EventCode": "0xB7, 0xBB",
2067 "MSRValue": "0x2000020090 ", 2203 "MSRValue": "0x2000020090 ",
2068 "Counter": "0,1,2,3", 2204 "Counter": "0,1,2,3",
@@ -2075,6 +2211,7 @@
2075 "CounterHTOff": "0,1,2,3" 2211 "CounterHTOff": "0,1,2,3"
2076 }, 2212 },
2077 { 2213 {
2214 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2078 "EventCode": "0xB7, 0xBB", 2215 "EventCode": "0xB7, 0xBB",
2079 "MSRValue": "0x20003c0090 ", 2216 "MSRValue": "0x20003c0090 ",
2080 "Counter": "0,1,2,3", 2217 "Counter": "0,1,2,3",
@@ -2087,6 +2224,7 @@
2087 "CounterHTOff": "0,1,2,3" 2224 "CounterHTOff": "0,1,2,3"
2088 }, 2225 },
2089 { 2226 {
2227 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2090 "EventCode": "0xB7, 0xBB", 2228 "EventCode": "0xB7, 0xBB",
2091 "MSRValue": "0x0084000090 ", 2229 "MSRValue": "0x0084000090 ",
2092 "Counter": "0,1,2,3", 2230 "Counter": "0,1,2,3",
@@ -2099,6 +2237,7 @@
2099 "CounterHTOff": "0,1,2,3" 2237 "CounterHTOff": "0,1,2,3"
2100 }, 2238 },
2101 { 2239 {
2240 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2102 "EventCode": "0xB7, 0xBB", 2241 "EventCode": "0xB7, 0xBB",
2103 "MSRValue": "0x0104000090 ", 2242 "MSRValue": "0x0104000090 ",
2104 "Counter": "0,1,2,3", 2243 "Counter": "0,1,2,3",
@@ -2111,6 +2250,7 @@
2111 "CounterHTOff": "0,1,2,3" 2250 "CounterHTOff": "0,1,2,3"
2112 }, 2251 },
2113 { 2252 {
2253 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2114 "EventCode": "0xB7, 0xBB", 2254 "EventCode": "0xB7, 0xBB",
2115 "MSRValue": "0x0204000090 ", 2255 "MSRValue": "0x0204000090 ",
2116 "Counter": "0,1,2,3", 2256 "Counter": "0,1,2,3",
@@ -2123,6 +2263,7 @@
2123 "CounterHTOff": "0,1,2,3" 2263 "CounterHTOff": "0,1,2,3"
2124 }, 2264 },
2125 { 2265 {
2266 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2126 "EventCode": "0xB7, 0xBB", 2267 "EventCode": "0xB7, 0xBB",
2127 "MSRValue": "0x0404000090 ", 2268 "MSRValue": "0x0404000090 ",
2128 "Counter": "0,1,2,3", 2269 "Counter": "0,1,2,3",
@@ -2135,6 +2276,7 @@
2135 "CounterHTOff": "0,1,2,3" 2276 "CounterHTOff": "0,1,2,3"
2136 }, 2277 },
2137 { 2278 {
2279 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2138 "EventCode": "0xB7, 0xBB", 2280 "EventCode": "0xB7, 0xBB",
2139 "MSRValue": "0x1004000090 ", 2281 "MSRValue": "0x1004000090 ",
2140 "Counter": "0,1,2,3", 2282 "Counter": "0,1,2,3",
@@ -2147,6 +2289,7 @@
2147 "CounterHTOff": "0,1,2,3" 2289 "CounterHTOff": "0,1,2,3"
2148 }, 2290 },
2149 { 2291 {
2292 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2150 "EventCode": "0xB7, 0xBB", 2293 "EventCode": "0xB7, 0xBB",
2151 "MSRValue": "0x2004000090 ", 2294 "MSRValue": "0x2004000090 ",
2152 "Counter": "0,1,2,3", 2295 "Counter": "0,1,2,3",
@@ -2159,6 +2302,7 @@
2159 "CounterHTOff": "0,1,2,3" 2302 "CounterHTOff": "0,1,2,3"
2160 }, 2303 },
2161 { 2304 {
2305 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2162 "EventCode": "0xB7, 0xBB", 2306 "EventCode": "0xB7, 0xBB",
2163 "MSRValue": "0x3f84000090 ", 2307 "MSRValue": "0x3f84000090 ",
2164 "Counter": "0,1,2,3", 2308 "Counter": "0,1,2,3",
@@ -2171,6 +2315,7 @@
2171 "CounterHTOff": "0,1,2,3" 2315 "CounterHTOff": "0,1,2,3"
2172 }, 2316 },
2173 { 2317 {
2318 "PublicDescription": "Counts all prefetch data reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2174 "EventCode": "0xB7, 0xBB", 2319 "EventCode": "0xB7, 0xBB",
2175 "MSRValue": "0x00bc000090 ", 2320 "MSRValue": "0x00bc000090 ",
2176 "Counter": "0,1,2,3", 2321 "Counter": "0,1,2,3",
@@ -2183,6 +2328,7 @@
2183 "CounterHTOff": "0,1,2,3" 2328 "CounterHTOff": "0,1,2,3"
2184 }, 2329 },
2185 { 2330 {
2331 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2186 "EventCode": "0xB7, 0xBB", 2332 "EventCode": "0xB7, 0xBB",
2187 "MSRValue": "0x013c000090 ", 2333 "MSRValue": "0x013c000090 ",
2188 "Counter": "0,1,2,3", 2334 "Counter": "0,1,2,3",
@@ -2195,6 +2341,7 @@
2195 "CounterHTOff": "0,1,2,3" 2341 "CounterHTOff": "0,1,2,3"
2196 }, 2342 },
2197 { 2343 {
2344 "PublicDescription": "Counts all prefetch data reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2198 "EventCode": "0xB7, 0xBB", 2345 "EventCode": "0xB7, 0xBB",
2199 "MSRValue": "0x023c000090 ", 2346 "MSRValue": "0x023c000090 ",
2200 "Counter": "0,1,2,3", 2347 "Counter": "0,1,2,3",
@@ -2207,6 +2354,7 @@
2207 "CounterHTOff": "0,1,2,3" 2354 "CounterHTOff": "0,1,2,3"
2208 }, 2355 },
2209 { 2356 {
2357 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2210 "EventCode": "0xB7, 0xBB", 2358 "EventCode": "0xB7, 0xBB",
2211 "MSRValue": "0x043c000090 ", 2359 "MSRValue": "0x043c000090 ",
2212 "Counter": "0,1,2,3", 2360 "Counter": "0,1,2,3",
@@ -2219,6 +2367,7 @@
2219 "CounterHTOff": "0,1,2,3" 2367 "CounterHTOff": "0,1,2,3"
2220 }, 2368 },
2221 { 2369 {
2370 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2222 "EventCode": "0xB7, 0xBB", 2371 "EventCode": "0xB7, 0xBB",
2223 "MSRValue": "0x2000020120 ", 2372 "MSRValue": "0x2000020120 ",
2224 "Counter": "0,1,2,3", 2373 "Counter": "0,1,2,3",
@@ -2231,6 +2380,7 @@
2231 "CounterHTOff": "0,1,2,3" 2380 "CounterHTOff": "0,1,2,3"
2232 }, 2381 },
2233 { 2382 {
2383 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2234 "EventCode": "0xB7, 0xBB", 2384 "EventCode": "0xB7, 0xBB",
2235 "MSRValue": "0x20003c0120 ", 2385 "MSRValue": "0x20003c0120 ",
2236 "Counter": "0,1,2,3", 2386 "Counter": "0,1,2,3",
@@ -2243,6 +2393,7 @@
2243 "CounterHTOff": "0,1,2,3" 2393 "CounterHTOff": "0,1,2,3"
2244 }, 2394 },
2245 { 2395 {
2396 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2246 "EventCode": "0xB7, 0xBB", 2397 "EventCode": "0xB7, 0xBB",
2247 "MSRValue": "0x0084000120 ", 2398 "MSRValue": "0x0084000120 ",
2248 "Counter": "0,1,2,3", 2399 "Counter": "0,1,2,3",
@@ -2255,6 +2406,7 @@
2255 "CounterHTOff": "0,1,2,3" 2406 "CounterHTOff": "0,1,2,3"
2256 }, 2407 },
2257 { 2408 {
2409 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2258 "EventCode": "0xB7, 0xBB", 2410 "EventCode": "0xB7, 0xBB",
2259 "MSRValue": "0x0104000120 ", 2411 "MSRValue": "0x0104000120 ",
2260 "Counter": "0,1,2,3", 2412 "Counter": "0,1,2,3",
@@ -2267,6 +2419,7 @@
2267 "CounterHTOff": "0,1,2,3" 2419 "CounterHTOff": "0,1,2,3"
2268 }, 2420 },
2269 { 2421 {
2422 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2270 "EventCode": "0xB7, 0xBB", 2423 "EventCode": "0xB7, 0xBB",
2271 "MSRValue": "0x0204000120 ", 2424 "MSRValue": "0x0204000120 ",
2272 "Counter": "0,1,2,3", 2425 "Counter": "0,1,2,3",
@@ -2279,6 +2432,7 @@
2279 "CounterHTOff": "0,1,2,3" 2432 "CounterHTOff": "0,1,2,3"
2280 }, 2433 },
2281 { 2434 {
2435 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2282 "EventCode": "0xB7, 0xBB", 2436 "EventCode": "0xB7, 0xBB",
2283 "MSRValue": "0x0404000120 ", 2437 "MSRValue": "0x0404000120 ",
2284 "Counter": "0,1,2,3", 2438 "Counter": "0,1,2,3",
@@ -2291,6 +2445,7 @@
2291 "CounterHTOff": "0,1,2,3" 2445 "CounterHTOff": "0,1,2,3"
2292 }, 2446 },
2293 { 2447 {
2448 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2294 "EventCode": "0xB7, 0xBB", 2449 "EventCode": "0xB7, 0xBB",
2295 "MSRValue": "0x1004000120 ", 2450 "MSRValue": "0x1004000120 ",
2296 "Counter": "0,1,2,3", 2451 "Counter": "0,1,2,3",
@@ -2303,6 +2458,7 @@
2303 "CounterHTOff": "0,1,2,3" 2458 "CounterHTOff": "0,1,2,3"
2304 }, 2459 },
2305 { 2460 {
2461 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2306 "EventCode": "0xB7, 0xBB", 2462 "EventCode": "0xB7, 0xBB",
2307 "MSRValue": "0x2004000120 ", 2463 "MSRValue": "0x2004000120 ",
2308 "Counter": "0,1,2,3", 2464 "Counter": "0,1,2,3",
@@ -2315,6 +2471,7 @@
2315 "CounterHTOff": "0,1,2,3" 2471 "CounterHTOff": "0,1,2,3"
2316 }, 2472 },
2317 { 2473 {
2474 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2318 "EventCode": "0xB7, 0xBB", 2475 "EventCode": "0xB7, 0xBB",
2319 "MSRValue": "0x3f84000120 ", 2476 "MSRValue": "0x3f84000120 ",
2320 "Counter": "0,1,2,3", 2477 "Counter": "0,1,2,3",
@@ -2327,6 +2484,7 @@
2327 "CounterHTOff": "0,1,2,3" 2484 "CounterHTOff": "0,1,2,3"
2328 }, 2485 },
2329 { 2486 {
2487 "PublicDescription": "Counts prefetch RFOs that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2330 "EventCode": "0xB7, 0xBB", 2488 "EventCode": "0xB7, 0xBB",
2331 "MSRValue": "0x00bc000120 ", 2489 "MSRValue": "0x00bc000120 ",
2332 "Counter": "0,1,2,3", 2490 "Counter": "0,1,2,3",
@@ -2339,6 +2497,7 @@
2339 "CounterHTOff": "0,1,2,3" 2497 "CounterHTOff": "0,1,2,3"
2340 }, 2498 },
2341 { 2499 {
2500 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2342 "EventCode": "0xB7, 0xBB", 2501 "EventCode": "0xB7, 0xBB",
2343 "MSRValue": "0x013c000120 ", 2502 "MSRValue": "0x013c000120 ",
2344 "Counter": "0,1,2,3", 2503 "Counter": "0,1,2,3",
@@ -2351,6 +2510,7 @@
2351 "CounterHTOff": "0,1,2,3" 2510 "CounterHTOff": "0,1,2,3"
2352 }, 2511 },
2353 { 2512 {
2513 "PublicDescription": "Counts prefetch RFOs that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2354 "EventCode": "0xB7, 0xBB", 2514 "EventCode": "0xB7, 0xBB",
2355 "MSRValue": "0x023c000120 ", 2515 "MSRValue": "0x023c000120 ",
2356 "Counter": "0,1,2,3", 2516 "Counter": "0,1,2,3",
@@ -2363,6 +2523,7 @@
2363 "CounterHTOff": "0,1,2,3" 2523 "CounterHTOff": "0,1,2,3"
2364 }, 2524 },
2365 { 2525 {
2526 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2366 "EventCode": "0xB7, 0xBB", 2527 "EventCode": "0xB7, 0xBB",
2367 "MSRValue": "0x043c000120 ", 2528 "MSRValue": "0x043c000120 ",
2368 "Counter": "0,1,2,3", 2529 "Counter": "0,1,2,3",
@@ -2375,6 +2536,7 @@
2375 "CounterHTOff": "0,1,2,3" 2536 "CounterHTOff": "0,1,2,3"
2376 }, 2537 },
2377 { 2538 {
2539 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2378 "EventCode": "0xB7, 0xBB", 2540 "EventCode": "0xB7, 0xBB",
2379 "MSRValue": "0x2000020240 ", 2541 "MSRValue": "0x2000020240 ",
2380 "Counter": "0,1,2,3", 2542 "Counter": "0,1,2,3",
@@ -2387,6 +2549,7 @@
2387 "CounterHTOff": "0,1,2,3" 2549 "CounterHTOff": "0,1,2,3"
2388 }, 2550 },
2389 { 2551 {
2552 "PublicDescription": "Counts all prefetch code reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2390 "EventCode": "0xB7, 0xBB", 2553 "EventCode": "0xB7, 0xBB",
2391 "MSRValue": "0x20003c0240 ", 2554 "MSRValue": "0x20003c0240 ",
2392 "Counter": "0,1,2,3", 2555 "Counter": "0,1,2,3",
@@ -2399,6 +2562,7 @@
2399 "CounterHTOff": "0,1,2,3" 2562 "CounterHTOff": "0,1,2,3"
2400 }, 2563 },
2401 { 2564 {
2565 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2402 "EventCode": "0xB7, 0xBB", 2566 "EventCode": "0xB7, 0xBB",
2403 "MSRValue": "0x0084000240 ", 2567 "MSRValue": "0x0084000240 ",
2404 "Counter": "0,1,2,3", 2568 "Counter": "0,1,2,3",
@@ -2411,6 +2575,7 @@
2411 "CounterHTOff": "0,1,2,3" 2575 "CounterHTOff": "0,1,2,3"
2412 }, 2576 },
2413 { 2577 {
2578 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2414 "EventCode": "0xB7, 0xBB", 2579 "EventCode": "0xB7, 0xBB",
2415 "MSRValue": "0x0104000240 ", 2580 "MSRValue": "0x0104000240 ",
2416 "Counter": "0,1,2,3", 2581 "Counter": "0,1,2,3",
@@ -2423,6 +2588,7 @@
2423 "CounterHTOff": "0,1,2,3" 2588 "CounterHTOff": "0,1,2,3"
2424 }, 2589 },
2425 { 2590 {
2591 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2426 "EventCode": "0xB7, 0xBB", 2592 "EventCode": "0xB7, 0xBB",
2427 "MSRValue": "0x0204000240 ", 2593 "MSRValue": "0x0204000240 ",
2428 "Counter": "0,1,2,3", 2594 "Counter": "0,1,2,3",
@@ -2435,6 +2601,7 @@
2435 "CounterHTOff": "0,1,2,3" 2601 "CounterHTOff": "0,1,2,3"
2436 }, 2602 },
2437 { 2603 {
2604 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2438 "EventCode": "0xB7, 0xBB", 2605 "EventCode": "0xB7, 0xBB",
2439 "MSRValue": "0x0404000240 ", 2606 "MSRValue": "0x0404000240 ",
2440 "Counter": "0,1,2,3", 2607 "Counter": "0,1,2,3",
@@ -2447,6 +2614,7 @@
2447 "CounterHTOff": "0,1,2,3" 2614 "CounterHTOff": "0,1,2,3"
2448 }, 2615 },
2449 { 2616 {
2617 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2450 "EventCode": "0xB7, 0xBB", 2618 "EventCode": "0xB7, 0xBB",
2451 "MSRValue": "0x1004000240 ", 2619 "MSRValue": "0x1004000240 ",
2452 "Counter": "0,1,2,3", 2620 "Counter": "0,1,2,3",
@@ -2459,6 +2627,7 @@
2459 "CounterHTOff": "0,1,2,3" 2627 "CounterHTOff": "0,1,2,3"
2460 }, 2628 },
2461 { 2629 {
2630 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2462 "EventCode": "0xB7, 0xBB", 2631 "EventCode": "0xB7, 0xBB",
2463 "MSRValue": "0x2004000240 ", 2632 "MSRValue": "0x2004000240 ",
2464 "Counter": "0,1,2,3", 2633 "Counter": "0,1,2,3",
@@ -2471,6 +2640,7 @@
2471 "CounterHTOff": "0,1,2,3" 2640 "CounterHTOff": "0,1,2,3"
2472 }, 2641 },
2473 { 2642 {
2643 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2474 "EventCode": "0xB7, 0xBB", 2644 "EventCode": "0xB7, 0xBB",
2475 "MSRValue": "0x3f84000240 ", 2645 "MSRValue": "0x3f84000240 ",
2476 "Counter": "0,1,2,3", 2646 "Counter": "0,1,2,3",
@@ -2483,6 +2653,7 @@
2483 "CounterHTOff": "0,1,2,3" 2653 "CounterHTOff": "0,1,2,3"
2484 }, 2654 },
2485 { 2655 {
2656 "PublicDescription": "Counts all prefetch code reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2486 "EventCode": "0xB7, 0xBB", 2657 "EventCode": "0xB7, 0xBB",
2487 "MSRValue": "0x00bc000240 ", 2658 "MSRValue": "0x00bc000240 ",
2488 "Counter": "0,1,2,3", 2659 "Counter": "0,1,2,3",
@@ -2495,6 +2666,7 @@
2495 "CounterHTOff": "0,1,2,3" 2666 "CounterHTOff": "0,1,2,3"
2496 }, 2667 },
2497 { 2668 {
2669 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2498 "EventCode": "0xB7, 0xBB", 2670 "EventCode": "0xB7, 0xBB",
2499 "MSRValue": "0x013c000240 ", 2671 "MSRValue": "0x013c000240 ",
2500 "Counter": "0,1,2,3", 2672 "Counter": "0,1,2,3",
@@ -2507,6 +2679,7 @@
2507 "CounterHTOff": "0,1,2,3" 2679 "CounterHTOff": "0,1,2,3"
2508 }, 2680 },
2509 { 2681 {
2682 "PublicDescription": "Counts all prefetch code reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2510 "EventCode": "0xB7, 0xBB", 2683 "EventCode": "0xB7, 0xBB",
2511 "MSRValue": "0x023c000240 ", 2684 "MSRValue": "0x023c000240 ",
2512 "Counter": "0,1,2,3", 2685 "Counter": "0,1,2,3",
@@ -2519,6 +2692,7 @@
2519 "CounterHTOff": "0,1,2,3" 2692 "CounterHTOff": "0,1,2,3"
2520 }, 2693 },
2521 { 2694 {
2695 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2522 "EventCode": "0xB7, 0xBB", 2696 "EventCode": "0xB7, 0xBB",
2523 "MSRValue": "0x043c000240 ", 2697 "MSRValue": "0x043c000240 ",
2524 "Counter": "0,1,2,3", 2698 "Counter": "0,1,2,3",
@@ -2531,6 +2705,7 @@
2531 "CounterHTOff": "0,1,2,3" 2705 "CounterHTOff": "0,1,2,3"
2532 }, 2706 },
2533 { 2707 {
2708 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2534 "EventCode": "0xB7, 0xBB", 2709 "EventCode": "0xB7, 0xBB",
2535 "MSRValue": "0x2000020091 ", 2710 "MSRValue": "0x2000020091 ",
2536 "Counter": "0,1,2,3", 2711 "Counter": "0,1,2,3",
@@ -2543,6 +2718,7 @@
2543 "CounterHTOff": "0,1,2,3" 2718 "CounterHTOff": "0,1,2,3"
2544 }, 2719 },
2545 { 2720 {
2721 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2546 "EventCode": "0xB7, 0xBB", 2722 "EventCode": "0xB7, 0xBB",
2547 "MSRValue": "0x20003c0091 ", 2723 "MSRValue": "0x20003c0091 ",
2548 "Counter": "0,1,2,3", 2724 "Counter": "0,1,2,3",
@@ -2555,6 +2731,7 @@
2555 "CounterHTOff": "0,1,2,3" 2731 "CounterHTOff": "0,1,2,3"
2556 }, 2732 },
2557 { 2733 {
2734 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2558 "EventCode": "0xB7, 0xBB", 2735 "EventCode": "0xB7, 0xBB",
2559 "MSRValue": "0x0084000091 ", 2736 "MSRValue": "0x0084000091 ",
2560 "Counter": "0,1,2,3", 2737 "Counter": "0,1,2,3",
@@ -2567,6 +2744,7 @@
2567 "CounterHTOff": "0,1,2,3" 2744 "CounterHTOff": "0,1,2,3"
2568 }, 2745 },
2569 { 2746 {
2747 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2570 "EventCode": "0xB7, 0xBB", 2748 "EventCode": "0xB7, 0xBB",
2571 "MSRValue": "0x0104000091 ", 2749 "MSRValue": "0x0104000091 ",
2572 "Counter": "0,1,2,3", 2750 "Counter": "0,1,2,3",
@@ -2579,6 +2757,7 @@
2579 "CounterHTOff": "0,1,2,3" 2757 "CounterHTOff": "0,1,2,3"
2580 }, 2758 },
2581 { 2759 {
2760 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2582 "EventCode": "0xB7, 0xBB", 2761 "EventCode": "0xB7, 0xBB",
2583 "MSRValue": "0x0204000091 ", 2762 "MSRValue": "0x0204000091 ",
2584 "Counter": "0,1,2,3", 2763 "Counter": "0,1,2,3",
@@ -2591,6 +2770,7 @@
2591 "CounterHTOff": "0,1,2,3" 2770 "CounterHTOff": "0,1,2,3"
2592 }, 2771 },
2593 { 2772 {
2773 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2594 "EventCode": "0xB7, 0xBB", 2774 "EventCode": "0xB7, 0xBB",
2595 "MSRValue": "0x0404000091 ", 2775 "MSRValue": "0x0404000091 ",
2596 "Counter": "0,1,2,3", 2776 "Counter": "0,1,2,3",
@@ -2603,6 +2783,7 @@
2603 "CounterHTOff": "0,1,2,3" 2783 "CounterHTOff": "0,1,2,3"
2604 }, 2784 },
2605 { 2785 {
2786 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2606 "EventCode": "0xB7, 0xBB", 2787 "EventCode": "0xB7, 0xBB",
2607 "MSRValue": "0x1004000091 ", 2788 "MSRValue": "0x1004000091 ",
2608 "Counter": "0,1,2,3", 2789 "Counter": "0,1,2,3",
@@ -2615,6 +2796,7 @@
2615 "CounterHTOff": "0,1,2,3" 2796 "CounterHTOff": "0,1,2,3"
2616 }, 2797 },
2617 { 2798 {
2799 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2618 "EventCode": "0xB7, 0xBB", 2800 "EventCode": "0xB7, 0xBB",
2619 "MSRValue": "0x2004000091 ", 2801 "MSRValue": "0x2004000091 ",
2620 "Counter": "0,1,2,3", 2802 "Counter": "0,1,2,3",
@@ -2627,6 +2809,7 @@
2627 "CounterHTOff": "0,1,2,3" 2809 "CounterHTOff": "0,1,2,3"
2628 }, 2810 },
2629 { 2811 {
2812 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2630 "EventCode": "0xB7, 0xBB", 2813 "EventCode": "0xB7, 0xBB",
2631 "MSRValue": "0x3f84000091 ", 2814 "MSRValue": "0x3f84000091 ",
2632 "Counter": "0,1,2,3", 2815 "Counter": "0,1,2,3",
@@ -2639,6 +2822,7 @@
2639 "CounterHTOff": "0,1,2,3" 2822 "CounterHTOff": "0,1,2,3"
2640 }, 2823 },
2641 { 2824 {
2825 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2642 "EventCode": "0xB7, 0xBB", 2826 "EventCode": "0xB7, 0xBB",
2643 "MSRValue": "0x00bc000091 ", 2827 "MSRValue": "0x00bc000091 ",
2644 "Counter": "0,1,2,3", 2828 "Counter": "0,1,2,3",
@@ -2651,6 +2835,7 @@
2651 "CounterHTOff": "0,1,2,3" 2835 "CounterHTOff": "0,1,2,3"
2652 }, 2836 },
2653 { 2837 {
2838 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2654 "EventCode": "0xB7, 0xBB", 2839 "EventCode": "0xB7, 0xBB",
2655 "MSRValue": "0x013c000091 ", 2840 "MSRValue": "0x013c000091 ",
2656 "Counter": "0,1,2,3", 2841 "Counter": "0,1,2,3",
@@ -2663,6 +2848,7 @@
2663 "CounterHTOff": "0,1,2,3" 2848 "CounterHTOff": "0,1,2,3"
2664 }, 2849 },
2665 { 2850 {
2851 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2666 "EventCode": "0xB7, 0xBB", 2852 "EventCode": "0xB7, 0xBB",
2667 "MSRValue": "0x023c000091 ", 2853 "MSRValue": "0x023c000091 ",
2668 "Counter": "0,1,2,3", 2854 "Counter": "0,1,2,3",
@@ -2675,6 +2861,7 @@
2675 "CounterHTOff": "0,1,2,3" 2861 "CounterHTOff": "0,1,2,3"
2676 }, 2862 },
2677 { 2863 {
2864 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2678 "EventCode": "0xB7, 0xBB", 2865 "EventCode": "0xB7, 0xBB",
2679 "MSRValue": "0x043c000091 ", 2866 "MSRValue": "0x043c000091 ",
2680 "Counter": "0,1,2,3", 2867 "Counter": "0,1,2,3",
@@ -2687,6 +2874,7 @@
2687 "CounterHTOff": "0,1,2,3" 2874 "CounterHTOff": "0,1,2,3"
2688 }, 2875 },
2689 { 2876 {
2877 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2690 "EventCode": "0xB7, 0xBB", 2878 "EventCode": "0xB7, 0xBB",
2691 "MSRValue": "0x2000020122 ", 2879 "MSRValue": "0x2000020122 ",
2692 "Counter": "0,1,2,3", 2880 "Counter": "0,1,2,3",
@@ -2699,6 +2887,7 @@
2699 "CounterHTOff": "0,1,2,3" 2887 "CounterHTOff": "0,1,2,3"
2700 }, 2888 },
2701 { 2889 {
2890 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the target was non-DRAM system address. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2702 "EventCode": "0xB7, 0xBB", 2891 "EventCode": "0xB7, 0xBB",
2703 "MSRValue": "0x20003c0122 ", 2892 "MSRValue": "0x20003c0122 ",
2704 "Counter": "0,1,2,3", 2893 "Counter": "0,1,2,3",
@@ -2711,6 +2900,7 @@
2711 "CounterHTOff": "0,1,2,3" 2900 "CounterHTOff": "0,1,2,3"
2712 }, 2901 },
2713 { 2902 {
2903 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2714 "EventCode": "0xB7, 0xBB", 2904 "EventCode": "0xB7, 0xBB",
2715 "MSRValue": "0x0084000122 ", 2905 "MSRValue": "0x0084000122 ",
2716 "Counter": "0,1,2,3", 2906 "Counter": "0,1,2,3",
@@ -2723,6 +2913,7 @@
2723 "CounterHTOff": "0,1,2,3" 2913 "CounterHTOff": "0,1,2,3"
2724 }, 2914 },
2725 { 2915 {
2916 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2726 "EventCode": "0xB7, 0xBB", 2917 "EventCode": "0xB7, 0xBB",
2727 "MSRValue": "0x0104000122 ", 2918 "MSRValue": "0x0104000122 ",
2728 "Counter": "0,1,2,3", 2919 "Counter": "0,1,2,3",
@@ -2735,6 +2926,7 @@
2735 "CounterHTOff": "0,1,2,3" 2926 "CounterHTOff": "0,1,2,3"
2736 }, 2927 },
2737 { 2928 {
2929 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2738 "EventCode": "0xB7, 0xBB", 2930 "EventCode": "0xB7, 0xBB",
2739 "MSRValue": "0x0204000122 ", 2931 "MSRValue": "0x0204000122 ",
2740 "Counter": "0,1,2,3", 2932 "Counter": "0,1,2,3",
@@ -2747,6 +2939,7 @@
2747 "CounterHTOff": "0,1,2,3" 2939 "CounterHTOff": "0,1,2,3"
2748 }, 2940 },
2749 { 2941 {
2942 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2750 "EventCode": "0xB7, 0xBB", 2943 "EventCode": "0xB7, 0xBB",
2751 "MSRValue": "0x0404000122 ", 2944 "MSRValue": "0x0404000122 ",
2752 "Counter": "0,1,2,3", 2945 "Counter": "0,1,2,3",
@@ -2759,6 +2952,7 @@
2759 "CounterHTOff": "0,1,2,3" 2952 "CounterHTOff": "0,1,2,3"
2760 }, 2953 },
2761 { 2954 {
2955 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2762 "EventCode": "0xB7, 0xBB", 2956 "EventCode": "0xB7, 0xBB",
2763 "MSRValue": "0x1004000122 ", 2957 "MSRValue": "0x1004000122 ",
2764 "Counter": "0,1,2,3", 2958 "Counter": "0,1,2,3",
@@ -2771,6 +2965,7 @@
2771 "CounterHTOff": "0,1,2,3" 2965 "CounterHTOff": "0,1,2,3"
2772 }, 2966 },
2773 { 2967 {
2968 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2774 "EventCode": "0xB7, 0xBB", 2969 "EventCode": "0xB7, 0xBB",
2775 "MSRValue": "0x2004000122 ", 2970 "MSRValue": "0x2004000122 ",
2776 "Counter": "0,1,2,3", 2971 "Counter": "0,1,2,3",
@@ -2783,6 +2978,7 @@
2783 "CounterHTOff": "0,1,2,3" 2978 "CounterHTOff": "0,1,2,3"
2784 }, 2979 },
2785 { 2980 {
2981 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2786 "EventCode": "0xB7, 0xBB", 2982 "EventCode": "0xB7, 0xBB",
2787 "MSRValue": "0x3f84000122 ", 2983 "MSRValue": "0x3f84000122 ",
2788 "Counter": "0,1,2,3", 2984 "Counter": "0,1,2,3",
@@ -2795,6 +2991,7 @@
2795 "CounterHTOff": "0,1,2,3" 2991 "CounterHTOff": "0,1,2,3"
2796 }, 2992 },
2797 { 2993 {
2994 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 with no details on snoop-related information. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2798 "EventCode": "0xB7, 0xBB", 2995 "EventCode": "0xB7, 0xBB",
2799 "MSRValue": "0x00bc000122 ", 2996 "MSRValue": "0x00bc000122 ",
2800 "Counter": "0,1,2,3", 2997 "Counter": "0,1,2,3",
@@ -2807,6 +3004,7 @@
2807 "CounterHTOff": "0,1,2,3" 3004 "CounterHTOff": "0,1,2,3"
2808 }, 3005 },
2809 { 3006 {
3007 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2810 "EventCode": "0xB7, 0xBB", 3008 "EventCode": "0xB7, 0xBB",
2811 "MSRValue": "0x013c000122 ", 3009 "MSRValue": "0x013c000122 ",
2812 "Counter": "0,1,2,3", 3010 "Counter": "0,1,2,3",
@@ -2819,6 +3017,7 @@
2819 "CounterHTOff": "0,1,2,3" 3017 "CounterHTOff": "0,1,2,3"
2820 }, 3018 },
2821 { 3019 {
3020 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 with a snoop miss response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2822 "EventCode": "0xB7, 0xBB", 3021 "EventCode": "0xB7, 0xBB",
2823 "MSRValue": "0x023c000122 ", 3022 "MSRValue": "0x023c000122 ",
2824 "Counter": "0,1,2,3", 3023 "Counter": "0,1,2,3",
@@ -2831,6 +3030,7 @@
2831 "CounterHTOff": "0,1,2,3" 3030 "CounterHTOff": "0,1,2,3"
2832 }, 3031 },
2833 { 3032 {
3033 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2834 "EventCode": "0xB7, 0xBB", 3034 "EventCode": "0xB7, 0xBB",
2835 "MSRValue": "0x043c000122 ", 3035 "MSRValue": "0x043c000122 ",
2836 "Counter": "0,1,2,3", 3036 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/other.json b/tools/perf/pmu-events/arch/x86/broadwell/other.json
index edf14f0d0eaf..4f829c5febbe 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/other.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "This event counts unhalted core cycles during which the thread is in rings 1, 2, or 3.",
14 "EventCode": "0x5C",
15 "Counter": "0,1,2,3",
16 "UMask": "0x2",
17 "EventName": "CPL_CYCLES.RING123",
18 "SampleAfterValue": "2000003",
19 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "PublicDescription": "This event counts when there is a transition from ring 1,2 or 3 to ring0.", 13 "PublicDescription": "This event counts when there is a transition from ring 1,2 or 3 to ring0.",
24 "EventCode": "0x5C", 14 "EventCode": "0x5C",
25 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
@@ -32,6 +22,16 @@
32 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 }, 23 },
34 { 24 {
25 "PublicDescription": "This event counts unhalted core cycles during which the thread is in rings 1, 2, or 3.",
26 "EventCode": "0x5C",
27 "Counter": "0,1,2,3",
28 "UMask": "0x2",
29 "EventName": "CPL_CYCLES.RING123",
30 "SampleAfterValue": "2000003",
31 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
32 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 },
34 {
35 "PublicDescription": "This event counts cycles in which the L1 and L2 are locked due to a UC lock or split lock. A lock is asserted in case of locked memory access, due to noncacheable memory, locked operation that spans two cache lines, or a page walk from the noncacheable page table. L1D and L2 locks have a very high performance penalty and it is highly recommended to avoid such access.", 35 "PublicDescription": "This event counts cycles in which the L1 and L2 are locked due to a UC lock or split lock. A lock is asserted in case of locked memory access, due to noncacheable memory, locked operation that spans two cache lines, or a page walk from the noncacheable page table. L1D and L2 locks have a very high performance penalty and it is highly recommended to avoid such access.",
36 "EventCode": "0x63", 36 "EventCode": "0x63",
37 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/pipeline.json b/tools/perf/pmu-events/arch/x86/broadwell/pipeline.json
index 78913ae87703..97c5d0784c6c 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/pipeline.json
@@ -2,32 +2,42 @@
2 { 2 {
3 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 3 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
4 "EventCode": "0x00", 4 "EventCode": "0x00",
5 "Counter": "Fixed counter 1", 5 "Counter": "Fixed counter 0",
6 "UMask": "0x1", 6 "UMask": "0x1",
7 "EventName": "INST_RETIRED.ANY", 7 "EventName": "INST_RETIRED.ANY",
8 "SampleAfterValue": "2000003", 8 "SampleAfterValue": "2000003",
9 "BriefDescription": "Instructions retired from execution.", 9 "BriefDescription": "Instructions retired from execution.",
10 "CounterHTOff": "Fixed counter 1" 10 "CounterHTOff": "Fixed counter 0"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.", 13 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.",
14 "EventCode": "0x00", 14 "EventCode": "0x00",
15 "Counter": "Fixed counter 2", 15 "Counter": "Fixed counter 1",
16 "UMask": "0x2", 16 "UMask": "0x2",
17 "EventName": "CPU_CLK_UNHALTED.THREAD", 17 "EventName": "CPU_CLK_UNHALTED.THREAD",
18 "SampleAfterValue": "2000003", 18 "SampleAfterValue": "2000003",
19 "BriefDescription": "Core cycles when the thread is not in halt state", 19 "BriefDescription": "Core cycles when the thread is not in halt state",
20 "CounterHTOff": "Fixed counter 2" 20 "CounterHTOff": "Fixed counter 1"
21 },
22 {
23 "EventCode": "0x00",
24 "Counter": "Fixed counter 1",
25 "UMask": "0x2",
26 "AnyThread": "1",
27 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
30 "CounterHTOff": "Fixed counter 1"
21 }, 31 },
22 { 32 {
23 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. \nNote: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. This event is clocked by base clock (100 Mhz) on Sandy Bridge. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.", 33 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. \nNote: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. This event is clocked by base clock (100 Mhz) on Sandy Bridge. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.",
24 "EventCode": "0x00", 34 "EventCode": "0x00",
25 "Counter": "Fixed counter 3", 35 "Counter": "Fixed counter 2",
26 "UMask": "0x3", 36 "UMask": "0x3",
27 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 37 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
28 "SampleAfterValue": "2000003", 38 "SampleAfterValue": "2000003",
29 "BriefDescription": "Reference cycles when the core is not in halt state.", 39 "BriefDescription": "Reference cycles when the core is not in halt state.",
30 "CounterHTOff": "Fixed counter 3" 40 "CounterHTOff": "Fixed counter 2"
31 }, 41 },
32 { 42 {
33 "PublicDescription": "This event counts how many times the load operation got the true Block-on-Store blocking code preventing store forwarding. This includes cases when:\n - preceding store conflicts with the load (incomplete overlap);\n - store forwarding is impossible due to u-arch limitations;\n - preceding lock RMW operations are not forwarded;\n - store has the no-forward bit set (uncacheable/page-split/masked stores);\n - all-blocking stores are used (mostly, fences and port I/O);\nand others.\nThe most common case is a load blocked due to its address range overlapping with a preceding smaller uncompleted store. Note: This event does not take into account cases of out-of-SW-control (for example, SbTailHit), unknown physical STA, and cases of blocking loads on store due to being non-WB memory type or a lock. These cases are covered by other events.\nSee the table of not supported store forwards in the Optimization Guide.", 43 "PublicDescription": "This event counts how many times the load operation got the true Block-on-Store blocking code preventing store forwarding. This includes cases when:\n - preceding store conflicts with the load (incomplete overlap);\n - store forwarding is impossible due to u-arch limitations;\n - preceding lock RMW operations are not forwarded;\n - store has the no-forward bit set (uncacheable/page-split/masked stores);\n - all-blocking stores are used (mostly, fences and port I/O);\nand others.\nThe most common case is a load blocked due to its address range overlapping with a preceding smaller uncompleted store. Note: This event does not take into account cases of out-of-SW-control (for example, SbTailHit), unknown physical STA, and cases of blocking loads on store due to being non-WB memory type or a lock. These cases are covered by other events.\nSee the table of not supported store forwards in the Optimization Guide.",
@@ -59,27 +69,38 @@
59 "CounterHTOff": "0,1,2,3,4,5,6,7" 69 "CounterHTOff": "0,1,2,3,4,5,6,7"
60 }, 70 },
61 { 71 {
62 "PublicDescription": "This event counts the number of cycles during which Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the current thread. This also includes the cycles during which the Allocator is serving another thread.", 72 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.",
63 "EventCode": "0x0D", 73 "EventCode": "0x0D",
64 "Counter": "0,1,2,3", 74 "Counter": "0,1,2,3",
65 "UMask": "0x8", 75 "UMask": "0x3",
66 "EventName": "INT_MISC.RAT_STALL_CYCLES", 76 "EventName": "INT_MISC.RECOVERY_CYCLES",
67 "SampleAfterValue": "2000003", 77 "SampleAfterValue": "2000003",
68 "BriefDescription": "Cycles when Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the thread", 78 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)",
79 "CounterMask": "1",
69 "CounterHTOff": "0,1,2,3,4,5,6,7" 80 "CounterHTOff": "0,1,2,3,4,5,6,7"
70 }, 81 },
71 { 82 {
72 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.",
73 "EventCode": "0x0D", 83 "EventCode": "0x0D",
74 "Counter": "0,1,2,3", 84 "Counter": "0,1,2,3",
75 "UMask": "0x3", 85 "UMask": "0x3",
76 "EventName": "INT_MISC.RECOVERY_CYCLES", 86 "AnyThread": "1",
87 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
77 "SampleAfterValue": "2000003", 88 "SampleAfterValue": "2000003",
78 "BriefDescription": "Number of cycles waiting for the checkpoints in Resource Allocation Table (RAT) to be recovered after Nuke due to all other cases except JEClear (e.g. whenever a ucode assist is needed like SSE exception, memory disambiguation, etc...)", 89 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
79 "CounterMask": "1", 90 "CounterMask": "1",
80 "CounterHTOff": "0,1,2,3,4,5,6,7" 91 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 }, 92 },
82 { 93 {
94 "PublicDescription": "This event counts the number of cycles during which Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the current thread. This also includes the cycles during which the Allocator is serving another thread.",
95 "EventCode": "0x0D",
96 "Counter": "0,1,2,3",
97 "UMask": "0x8",
98 "EventName": "INT_MISC.RAT_STALL_CYCLES",
99 "SampleAfterValue": "2000003",
100 "BriefDescription": "Cycles when Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the thread",
101 "CounterHTOff": "0,1,2,3,4,5,6,7"
102 },
103 {
83 "PublicDescription": "This event counts the number of Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS).", 104 "PublicDescription": "This event counts the number of Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS).",
84 "EventCode": "0x0E", 105 "EventCode": "0x0E",
85 "Counter": "0,1,2,3", 106 "Counter": "0,1,2,3",
@@ -90,6 +111,18 @@
90 "CounterHTOff": "0,1,2,3,4,5,6,7" 111 "CounterHTOff": "0,1,2,3,4,5,6,7"
91 }, 112 },
92 { 113 {
114 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
115 "EventCode": "0x0E",
116 "Invert": "1",
117 "Counter": "0,1,2,3",
118 "UMask": "0x1",
119 "EventName": "UOPS_ISSUED.STALL_CYCLES",
120 "SampleAfterValue": "2000003",
121 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
122 "CounterMask": "1",
123 "CounterHTOff": "0,1,2,3"
124 },
125 {
93 "PublicDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive\n added by GSR u-arch.", 126 "PublicDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive\n added by GSR u-arch.",
94 "EventCode": "0x0E", 127 "EventCode": "0x0E",
95 "Counter": "0,1,2,3", 128 "Counter": "0,1,2,3",
@@ -118,18 +151,6 @@
118 "CounterHTOff": "0,1,2,3,4,5,6,7" 151 "CounterHTOff": "0,1,2,3,4,5,6,7"
119 }, 152 },
120 { 153 {
121 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
122 "EventCode": "0x0E",
123 "Invert": "1",
124 "Counter": "0,1,2,3",
125 "UMask": "0x1",
126 "EventName": "UOPS_ISSUED.STALL_CYCLES",
127 "SampleAfterValue": "2000003",
128 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
129 "CounterMask": "1",
130 "CounterHTOff": "0,1,2,3"
131 },
132 {
133 "PublicDescription": "This event counts the number of the divide operations executed. Uses edge-detect and a cmask value of 1 on ARITH.FPU_DIV_ACTIVE to get the number of the divide operations executed.", 154 "PublicDescription": "This event counts the number of the divide operations executed. Uses edge-detect and a cmask value of 1 on ARITH.FPU_DIV_ACTIVE to get the number of the divide operations executed.",
134 "EventCode": "0x14", 155 "EventCode": "0x14",
135 "Counter": "0,1,2,3", 156 "Counter": "0,1,2,3",
@@ -140,6 +161,26 @@
140 "CounterHTOff": "0,1,2,3,4,5,6,7" 161 "CounterHTOff": "0,1,2,3,4,5,6,7"
141 }, 162 },
142 { 163 {
164 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
165 "EventCode": "0x3C",
166 "Counter": "0,1,2,3",
167 "UMask": "0x0",
168 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
169 "SampleAfterValue": "2000003",
170 "BriefDescription": "Thread cycles when thread is not in halt state",
171 "CounterHTOff": "0,1,2,3,4,5,6,7"
172 },
173 {
174 "EventCode": "0x3C",
175 "Counter": "0,1,2,3",
176 "UMask": "0x0",
177 "AnyThread": "1",
178 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
179 "SampleAfterValue": "2000003",
180 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
181 "CounterHTOff": "0,1,2,3,4,5,6,7"
182 },
183 {
143 "PublicDescription": "This is a fixed-frequency event programmed to general counters. It counts when the core is unhalted at 100 Mhz.", 184 "PublicDescription": "This is a fixed-frequency event programmed to general counters. It counts when the core is unhalted at 100 Mhz.",
144 "EventCode": "0x3C", 185 "EventCode": "0x3C",
145 "Counter": "0,1,2,3", 186 "Counter": "0,1,2,3",
@@ -150,6 +191,36 @@
150 "CounterHTOff": "0,1,2,3,4,5,6,7" 191 "CounterHTOff": "0,1,2,3,4,5,6,7"
151 }, 192 },
152 { 193 {
194 "EventCode": "0x3C",
195 "Counter": "0,1,2,3",
196 "UMask": "0x1",
197 "AnyThread": "1",
198 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
199 "SampleAfterValue": "2000003",
200 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
201 "CounterHTOff": "0,1,2,3,4,5,6,7"
202 },
203 {
204 "PublicDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate).",
205 "EventCode": "0x3C",
206 "Counter": "0,1,2,3",
207 "UMask": "0x1",
208 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
209 "SampleAfterValue": "2000003",
210 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
211 "CounterHTOff": "0,1,2,3,4,5,6,7"
212 },
213 {
214 "EventCode": "0x3C",
215 "Counter": "0,1,2,3",
216 "UMask": "0x1",
217 "AnyThread": "1",
218 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
219 "SampleAfterValue": "2000003",
220 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
221 "CounterHTOff": "0,1,2,3,4,5,6,7"
222 },
223 {
153 "EventCode": "0x3c", 224 "EventCode": "0x3c",
154 "Counter": "0,1,2,3", 225 "Counter": "0,1,2,3",
155 "UMask": "0x2", 226 "UMask": "0x2",
@@ -159,6 +230,15 @@
159 "CounterHTOff": "0,1,2,3" 230 "CounterHTOff": "0,1,2,3"
160 }, 231 },
161 { 232 {
233 "EventCode": "0x3C",
234 "Counter": "0,1,2,3",
235 "UMask": "0x2",
236 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
237 "SampleAfterValue": "2000003",
238 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
239 "CounterHTOff": "0,1,2,3,4,5,6,7"
240 },
241 {
162 "PublicDescription": "This event counts all not software-prefetch load dispatches that hit the fill buffer (FB) allocated for the software prefetch. It can also be incremented by some lock instructions. So it should only be used with profiling so that the locks can be excluded by asm inspection of the nearby instructions.", 242 "PublicDescription": "This event counts all not software-prefetch load dispatches that hit the fill buffer (FB) allocated for the software prefetch. It can also be incremented by some lock instructions. So it should only be used with profiling so that the locks can be excluded by asm inspection of the nearby instructions.",
163 "EventCode": "0x4c", 243 "EventCode": "0x4c",
164 "Counter": "0,1,2,3", 244 "Counter": "0,1,2,3",
@@ -225,6 +305,18 @@
225 "CounterHTOff": "0,1,2,3,4,5,6,7" 305 "CounterHTOff": "0,1,2,3,4,5,6,7"
226 }, 306 },
227 { 307 {
308 "EventCode": "0x5E",
309 "Invert": "1",
310 "Counter": "0,1,2,3",
311 "UMask": "0x1",
312 "EdgeDetect": "1",
313 "EventName": "RS_EVENTS.EMPTY_END",
314 "SampleAfterValue": "200003",
315 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
316 "CounterMask": "1",
317 "CounterHTOff": "0,1,2,3,4,5,6,7"
318 },
319 {
228 "PublicDescription": "This event counts stalls occured due to changing prefix length (66, 67 or REX.W when they change the length of the decoded instruction). Occurrences counting is proportional to the number of prefixes in a 16B-line. This may result in the following penalties: three-cycle penalty for each LCP in a 16-byte chunk.", 320 "PublicDescription": "This event counts stalls occured due to changing prefix length (66, 67 or REX.W when they change the length of the decoded instruction). Occurrences counting is proportional to the number of prefixes in a 16B-line. This may result in the following penalties: three-cycle penalty for each LCP in a 16-byte chunk.",
229 "EventCode": "0x87", 321 "EventCode": "0x87",
230 "Counter": "0,1,2,3", 322 "Counter": "0,1,2,3",
@@ -405,6 +497,15 @@
405 "CounterHTOff": "0,1,2,3,4,5,6,7" 497 "CounterHTOff": "0,1,2,3,4,5,6,7"
406 }, 498 },
407 { 499 {
500 "EventCode": "0x89",
501 "Counter": "0,1,2,3",
502 "UMask": "0xa0",
503 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
504 "SampleAfterValue": "200003",
505 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
506 "CounterHTOff": "0,1,2,3,4,5,6,7"
507 },
508 {
408 "PublicDescription": "This event counts both taken and not taken speculative and retired mispredicted macro conditional branch instructions.", 509 "PublicDescription": "This event counts both taken and not taken speculative and retired mispredicted macro conditional branch instructions.",
409 "EventCode": "0x89", 510 "EventCode": "0x89",
410 "Counter": "0,1,2,3", 511 "Counter": "0,1,2,3",
@@ -435,6 +536,16 @@
435 "CounterHTOff": "0,1,2,3,4,5,6,7" 536 "CounterHTOff": "0,1,2,3,4,5,6,7"
436 }, 537 },
437 { 538 {
539 "PublicDescription": "This event counts the number of micro-operations cancelled after they were dispatched from the scheduler to the execution units when the total number of physical register read ports across all dispatch ports exceeds the read bandwidth of the physical register file. The SIMD_PRF subevent applies to the following instructions: VDPPS, DPPS, VPCMPESTRI, PCMPESTRI, VPCMPESTRM, PCMPESTRM, VFMADD*, VFMADDSUB*, VFMSUB*, VMSUBADD*, VFNMADD*, VFNMSUB*. See the Broadwell Optimization Guide for more information.",
540 "EventCode": "0xA0",
541 "Counter": "0,1,2,3",
542 "UMask": "0x3",
543 "EventName": "UOP_DISPATCHES_CANCELLED.SIMD_PRF",
544 "SampleAfterValue": "2000003",
545 "BriefDescription": "Micro-op dispatches cancelled due to insufficient SIMD physical register file read ports",
546 "CounterHTOff": "0,1,2,3"
547 },
548 {
438 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.", 549 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
439 "EventCode": "0xA1", 550 "EventCode": "0xA1",
440 "Counter": "0,1,2,3", 551 "Counter": "0,1,2,3",
@@ -445,6 +556,26 @@
445 "CounterHTOff": "0,1,2,3,4,5,6,7" 556 "CounterHTOff": "0,1,2,3,4,5,6,7"
446 }, 557 },
447 { 558 {
559 "EventCode": "0xA1",
560 "Counter": "0,1,2,3",
561 "UMask": "0x1",
562 "AnyThread": "1",
563 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
564 "SampleAfterValue": "2000003",
565 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
566 "CounterHTOff": "0,1,2,3,4,5,6,7"
567 },
568 {
569 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
570 "EventCode": "0xA1",
571 "Counter": "0,1,2,3",
572 "UMask": "0x1",
573 "EventName": "UOPS_EXECUTED_PORT.PORT_0",
574 "SampleAfterValue": "2000003",
575 "BriefDescription": "Cycles per thread when uops are executed in port 0",
576 "CounterHTOff": "0,1,2,3,4,5,6,7"
577 },
578 {
448 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.", 579 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
449 "EventCode": "0xA1", 580 "EventCode": "0xA1",
450 "Counter": "0,1,2,3", 581 "Counter": "0,1,2,3",
@@ -455,6 +586,26 @@
455 "CounterHTOff": "0,1,2,3,4,5,6,7" 586 "CounterHTOff": "0,1,2,3,4,5,6,7"
456 }, 587 },
457 { 588 {
589 "EventCode": "0xA1",
590 "Counter": "0,1,2,3",
591 "UMask": "0x2",
592 "AnyThread": "1",
593 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
594 "SampleAfterValue": "2000003",
595 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
596 "CounterHTOff": "0,1,2,3,4,5,6,7"
597 },
598 {
599 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
600 "EventCode": "0xA1",
601 "Counter": "0,1,2,3",
602 "UMask": "0x2",
603 "EventName": "UOPS_EXECUTED_PORT.PORT_1",
604 "SampleAfterValue": "2000003",
605 "BriefDescription": "Cycles per thread when uops are executed in port 1",
606 "CounterHTOff": "0,1,2,3,4,5,6,7"
607 },
608 {
458 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.", 609 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
459 "EventCode": "0xA1", 610 "EventCode": "0xA1",
460 "Counter": "0,1,2,3", 611 "Counter": "0,1,2,3",
@@ -465,6 +616,26 @@
465 "CounterHTOff": "0,1,2,3,4,5,6,7" 616 "CounterHTOff": "0,1,2,3,4,5,6,7"
466 }, 617 },
467 { 618 {
619 "EventCode": "0xA1",
620 "Counter": "0,1,2,3",
621 "UMask": "0x4",
622 "AnyThread": "1",
623 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
624 "SampleAfterValue": "2000003",
625 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
626 "CounterHTOff": "0,1,2,3,4,5,6,7"
627 },
628 {
629 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
630 "EventCode": "0xA1",
631 "Counter": "0,1,2,3",
632 "UMask": "0x4",
633 "EventName": "UOPS_EXECUTED_PORT.PORT_2",
634 "SampleAfterValue": "2000003",
635 "BriefDescription": "Cycles per thread when uops are executed in port 2",
636 "CounterHTOff": "0,1,2,3,4,5,6,7"
637 },
638 {
468 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.", 639 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
469 "EventCode": "0xA1", 640 "EventCode": "0xA1",
470 "Counter": "0,1,2,3", 641 "Counter": "0,1,2,3",
@@ -475,6 +646,26 @@
475 "CounterHTOff": "0,1,2,3,4,5,6,7" 646 "CounterHTOff": "0,1,2,3,4,5,6,7"
476 }, 647 },
477 { 648 {
649 "EventCode": "0xA1",
650 "Counter": "0,1,2,3",
651 "UMask": "0x8",
652 "AnyThread": "1",
653 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
654 "SampleAfterValue": "2000003",
655 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
656 "CounterHTOff": "0,1,2,3,4,5,6,7"
657 },
658 {
659 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
660 "EventCode": "0xA1",
661 "Counter": "0,1,2,3",
662 "UMask": "0x8",
663 "EventName": "UOPS_EXECUTED_PORT.PORT_3",
664 "SampleAfterValue": "2000003",
665 "BriefDescription": "Cycles per thread when uops are executed in port 3",
666 "CounterHTOff": "0,1,2,3,4,5,6,7"
667 },
668 {
478 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.", 669 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
479 "EventCode": "0xA1", 670 "EventCode": "0xA1",
480 "Counter": "0,1,2,3", 671 "Counter": "0,1,2,3",
@@ -485,6 +676,26 @@
485 "CounterHTOff": "0,1,2,3,4,5,6,7" 676 "CounterHTOff": "0,1,2,3,4,5,6,7"
486 }, 677 },
487 { 678 {
679 "EventCode": "0xA1",
680 "Counter": "0,1,2,3",
681 "UMask": "0x10",
682 "AnyThread": "1",
683 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
684 "SampleAfterValue": "2000003",
685 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
686 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 },
688 {
689 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
690 "EventCode": "0xA1",
691 "Counter": "0,1,2,3",
692 "UMask": "0x10",
693 "EventName": "UOPS_EXECUTED_PORT.PORT_4",
694 "SampleAfterValue": "2000003",
695 "BriefDescription": "Cycles per thread when uops are executed in port 4",
696 "CounterHTOff": "0,1,2,3,4,5,6,7"
697 },
698 {
488 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.", 699 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
489 "EventCode": "0xA1", 700 "EventCode": "0xA1",
490 "Counter": "0,1,2,3", 701 "Counter": "0,1,2,3",
@@ -495,6 +706,26 @@
495 "CounterHTOff": "0,1,2,3,4,5,6,7" 706 "CounterHTOff": "0,1,2,3,4,5,6,7"
496 }, 707 },
497 { 708 {
709 "EventCode": "0xA1",
710 "Counter": "0,1,2,3",
711 "UMask": "0x20",
712 "AnyThread": "1",
713 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
714 "SampleAfterValue": "2000003",
715 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
716 "CounterHTOff": "0,1,2,3,4,5,6,7"
717 },
718 {
719 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
720 "EventCode": "0xA1",
721 "Counter": "0,1,2,3",
722 "UMask": "0x20",
723 "EventName": "UOPS_EXECUTED_PORT.PORT_5",
724 "SampleAfterValue": "2000003",
725 "BriefDescription": "Cycles per thread when uops are executed in port 5",
726 "CounterHTOff": "0,1,2,3,4,5,6,7"
727 },
728 {
498 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.", 729 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
499 "EventCode": "0xA1", 730 "EventCode": "0xA1",
500 "Counter": "0,1,2,3", 731 "Counter": "0,1,2,3",
@@ -505,6 +736,26 @@
505 "CounterHTOff": "0,1,2,3,4,5,6,7" 736 "CounterHTOff": "0,1,2,3,4,5,6,7"
506 }, 737 },
507 { 738 {
739 "EventCode": "0xA1",
740 "Counter": "0,1,2,3",
741 "UMask": "0x40",
742 "AnyThread": "1",
743 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
744 "SampleAfterValue": "2000003",
745 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
746 "CounterHTOff": "0,1,2,3,4,5,6,7"
747 },
748 {
749 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
750 "EventCode": "0xA1",
751 "Counter": "0,1,2,3",
752 "UMask": "0x40",
753 "EventName": "UOPS_EXECUTED_PORT.PORT_6",
754 "SampleAfterValue": "2000003",
755 "BriefDescription": "Cycles per thread when uops are executed in port 6",
756 "CounterHTOff": "0,1,2,3,4,5,6,7"
757 },
758 {
508 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.", 759 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
509 "EventCode": "0xA1", 760 "EventCode": "0xA1",
510 "Counter": "0,1,2,3", 761 "Counter": "0,1,2,3",
@@ -515,6 +766,26 @@
515 "CounterHTOff": "0,1,2,3,4,5,6,7" 766 "CounterHTOff": "0,1,2,3,4,5,6,7"
516 }, 767 },
517 { 768 {
769 "EventCode": "0xA1",
770 "Counter": "0,1,2,3",
771 "UMask": "0x80",
772 "AnyThread": "1",
773 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
774 "SampleAfterValue": "2000003",
775 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
776 "CounterHTOff": "0,1,2,3,4,5,6,7"
777 },
778 {
779 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
780 "EventCode": "0xA1",
781 "Counter": "0,1,2,3",
782 "UMask": "0x80",
783 "EventName": "UOPS_EXECUTED_PORT.PORT_7",
784 "SampleAfterValue": "2000003",
785 "BriefDescription": "Cycles per thread when uops are executed in port 7",
786 "CounterHTOff": "0,1,2,3,4,5,6,7"
787 },
788 {
518 "PublicDescription": "This event counts resource-related stall cycles. Reasons for stalls can be as follows:\n - *any* u-arch structure got full (LB, SB, RS, ROB, BOB, LM, Physical Register Reclaim Table (PRRT), or Physical History Table (PHT) slots)\n - *any* u-arch structure got empty (like INT/SIMD FreeLists)\n - FPU control word (FPCW), MXCSR\nand others. This counts cycles that the pipeline backend blocked uop delivery from the front end.", 789 "PublicDescription": "This event counts resource-related stall cycles. Reasons for stalls can be as follows:\n - *any* u-arch structure got full (LB, SB, RS, ROB, BOB, LM, Physical Register Reclaim Table (PRRT), or Physical History Table (PHT) slots)\n - *any* u-arch structure got empty (like INT/SIMD FreeLists)\n - FPU control word (FPCW), MXCSR\nand others. This counts cycles that the pipeline backend blocked uop delivery from the front end.",
519 "EventCode": "0xA2", 790 "EventCode": "0xA2",
520 "Counter": "0,1,2,3", 791 "Counter": "0,1,2,3",
@@ -566,15 +837,14 @@
566 "CounterHTOff": "0,1,2,3,4,5,6,7" 837 "CounterHTOff": "0,1,2,3,4,5,6,7"
567 }, 838 },
568 { 839 {
569 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request missing the L1 data cache.",
570 "EventCode": "0xA3", 840 "EventCode": "0xA3",
571 "Counter": "2", 841 "Counter": "0,1,2,3",
572 "UMask": "0x8", 842 "UMask": "0x1",
573 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING", 843 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
574 "SampleAfterValue": "2000003", 844 "SampleAfterValue": "2000003",
575 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.", 845 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
576 "CounterMask": "8", 846 "CounterMask": "1",
577 "CounterHTOff": "2" 847 "CounterHTOff": "0,1,2,3,4,5,6,7"
578 }, 848 },
579 { 849 {
580 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request (that is cycles with non-completed load waiting for its data from memory subsystem).", 850 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request (that is cycles with non-completed load waiting for its data from memory subsystem).",
@@ -588,17 +858,37 @@
588 "CounterHTOff": "0,1,2,3,4,5,6,7" 858 "CounterHTOff": "0,1,2,3,4,5,6,7"
589 }, 859 },
590 { 860 {
861 "EventCode": "0xA3",
862 "Counter": "0,1,2,3",
863 "UMask": "0x2",
864 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
865 "SampleAfterValue": "2000003",
866 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
867 "CounterMask": "2",
868 "CounterHTOff": "0,1,2,3"
869 },
870 {
591 "PublicDescription": "Counts number of cycles nothing is executed on any execution port.", 871 "PublicDescription": "Counts number of cycles nothing is executed on any execution port.",
592 "EventCode": "0xA3", 872 "EventCode": "0xA3",
593 "Counter": "0,1,2,3", 873 "Counter": "0,1,2,3",
594 "UMask": "0x4", 874 "UMask": "0x4",
595 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 875 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
596 "SampleAfterValue": "2000003", 876 "SampleAfterValue": "2000003",
597 "BriefDescription": "Total execution stalls", 877 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
598 "CounterMask": "4", 878 "CounterMask": "4",
599 "CounterHTOff": "0,1,2,3" 879 "CounterHTOff": "0,1,2,3"
600 }, 880 },
601 { 881 {
882 "EventCode": "0xA3",
883 "Counter": "0,1,2,3",
884 "UMask": "0x4",
885 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
886 "SampleAfterValue": "2000003",
887 "BriefDescription": "Total execution stalls.",
888 "CounterMask": "4",
889 "CounterHTOff": "0,1,2,3,4,5,6,7"
890 },
891 {
602 "PublicDescription": "Counts number of cycles nothing is executed on any execution port, while there was at least one pending demand* load request missing the L2 cache.(as a footprint) * includes also L1 HW prefetch requests that may or may not be required by demands.", 892 "PublicDescription": "Counts number of cycles nothing is executed on any execution port, while there was at least one pending demand* load request missing the L2 cache.(as a footprint) * includes also L1 HW prefetch requests that may or may not be required by demands.",
603 "EventCode": "0xA3", 893 "EventCode": "0xA3",
604 "Counter": "0,1,2,3", 894 "Counter": "0,1,2,3",
@@ -610,6 +900,16 @@
610 "CounterHTOff": "0,1,2,3" 900 "CounterHTOff": "0,1,2,3"
611 }, 901 },
612 { 902 {
903 "EventCode": "0xA3",
904 "Counter": "0,1,2,3",
905 "UMask": "0x5",
906 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
907 "SampleAfterValue": "2000003",
908 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
909 "CounterMask": "5",
910 "CounterHTOff": "0,1,2,3,4,5,6,7"
911 },
912 {
613 "PublicDescription": "Counts number of cycles nothing is executed on any execution port, while there was at least one pending demand load request.", 913 "PublicDescription": "Counts number of cycles nothing is executed on any execution port, while there was at least one pending demand load request.",
614 "EventCode": "0xA3", 914 "EventCode": "0xA3",
615 "Counter": "0,1,2,3", 915 "Counter": "0,1,2,3",
@@ -621,6 +921,37 @@
621 "CounterHTOff": "0,1,2,3" 921 "CounterHTOff": "0,1,2,3"
622 }, 922 },
623 { 923 {
924 "EventCode": "0xA3",
925 "Counter": "0,1,2,3",
926 "UMask": "0x6",
927 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
928 "SampleAfterValue": "2000003",
929 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
930 "CounterMask": "6",
931 "CounterHTOff": "0,1,2,3,4,5,6,7"
932 },
933 {
934 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request missing the L1 data cache.",
935 "EventCode": "0xA3",
936 "Counter": "2",
937 "UMask": "0x8",
938 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
939 "SampleAfterValue": "2000003",
940 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
941 "CounterMask": "8",
942 "CounterHTOff": "2"
943 },
944 {
945 "EventCode": "0xA3",
946 "Counter": "2",
947 "UMask": "0x8",
948 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
949 "SampleAfterValue": "2000003",
950 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
951 "CounterMask": "8",
952 "CounterHTOff": "2"
953 },
954 {
624 "PublicDescription": "Counts number of cycles nothing is executed on any execution port, while there was at least one pending demand load request missing the L1 data cache.", 955 "PublicDescription": "Counts number of cycles nothing is executed on any execution port, while there was at least one pending demand load request missing the L1 data cache.",
625 "EventCode": "0xA3", 956 "EventCode": "0xA3",
626 "Counter": "2", 957 "Counter": "2",
@@ -632,7 +963,16 @@
632 "CounterHTOff": "2" 963 "CounterHTOff": "2"
633 }, 964 },
634 { 965 {
635 "PublicDescription": "Number of Uops delivered by the LSD. ", 966 "EventCode": "0xA3",
967 "Counter": "2",
968 "UMask": "0xc",
969 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
970 "SampleAfterValue": "2000003",
971 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
972 "CounterMask": "12",
973 "CounterHTOff": "2"
974 },
975 {
636 "EventCode": "0xA8", 976 "EventCode": "0xA8",
637 "Counter": "0,1,2,3", 977 "Counter": "0,1,2,3",
638 "UMask": "0x1", 978 "UMask": "0x1",
@@ -642,6 +982,26 @@
642 "CounterHTOff": "0,1,2,3,4,5,6,7" 982 "CounterHTOff": "0,1,2,3,4,5,6,7"
643 }, 983 },
644 { 984 {
985 "EventCode": "0xA8",
986 "Counter": "0,1,2,3",
987 "UMask": "0x1",
988 "EventName": "LSD.CYCLES_4_UOPS",
989 "SampleAfterValue": "2000003",
990 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
991 "CounterMask": "4",
992 "CounterHTOff": "0,1,2,3,4,5,6,7"
993 },
994 {
995 "EventCode": "0xA8",
996 "Counter": "0,1,2,3",
997 "UMask": "0x1",
998 "EventName": "LSD.CYCLES_ACTIVE",
999 "SampleAfterValue": "2000003",
1000 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
1001 "CounterMask": "1",
1002 "CounterHTOff": "0,1,2,3,4,5,6,7"
1003 },
1004 {
645 "PublicDescription": "Number of uops to be executed per-thread each cycle.", 1005 "PublicDescription": "Number of uops to be executed per-thread each cycle.",
646 "EventCode": "0xB1", 1006 "EventCode": "0xB1",
647 "Counter": "0,1,2,3", 1007 "Counter": "0,1,2,3",
@@ -652,6 +1012,58 @@
652 "CounterHTOff": "0,1,2,3,4,5,6,7" 1012 "CounterHTOff": "0,1,2,3,4,5,6,7"
653 }, 1013 },
654 { 1014 {
1015 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.",
1016 "EventCode": "0xB1",
1017 "Invert": "1",
1018 "Counter": "0,1,2,3",
1019 "UMask": "0x1",
1020 "EventName": "UOPS_EXECUTED.STALL_CYCLES",
1021 "SampleAfterValue": "2000003",
1022 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
1023 "CounterMask": "1",
1024 "CounterHTOff": "0,1,2,3"
1025 },
1026 {
1027 "EventCode": "0xB1",
1028 "Counter": "0,1,2,3",
1029 "UMask": "0x1",
1030 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1031 "SampleAfterValue": "2000003",
1032 "BriefDescription": "Cycles where at least 1 uop was executed per-thread.",
1033 "CounterMask": "1",
1034 "CounterHTOff": "0,1,2,3"
1035 },
1036 {
1037 "EventCode": "0xB1",
1038 "Counter": "0,1,2,3",
1039 "UMask": "0x1",
1040 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1041 "SampleAfterValue": "2000003",
1042 "BriefDescription": "Cycles where at least 2 uops were executed per-thread.",
1043 "CounterMask": "2",
1044 "CounterHTOff": "0,1,2,3"
1045 },
1046 {
1047 "EventCode": "0xB1",
1048 "Counter": "0,1,2,3",
1049 "UMask": "0x1",
1050 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1051 "SampleAfterValue": "2000003",
1052 "BriefDescription": "Cycles where at least 3 uops were executed per-thread.",
1053 "CounterMask": "3",
1054 "CounterHTOff": "0,1,2,3"
1055 },
1056 {
1057 "EventCode": "0xB1",
1058 "Counter": "0,1,2,3",
1059 "UMask": "0x1",
1060 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
1061 "SampleAfterValue": "2000003",
1062 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
1063 "CounterMask": "4",
1064 "CounterHTOff": "0,1,2,3"
1065 },
1066 {
655 "PublicDescription": "Number of uops executed from any thread.", 1067 "PublicDescription": "Number of uops executed from any thread.",
656 "EventCode": "0xB1", 1068 "EventCode": "0xB1",
657 "Counter": "0,1,2,3", 1069 "Counter": "0,1,2,3",
@@ -662,36 +1074,64 @@
662 "CounterHTOff": "0,1,2,3,4,5,6,7" 1074 "CounterHTOff": "0,1,2,3,4,5,6,7"
663 }, 1075 },
664 { 1076 {
665 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.", 1077 "EventCode": "0xb1",
666 "EventCode": "0xB1",
667 "Invert": "1",
668 "Counter": "0,1,2,3", 1078 "Counter": "0,1,2,3",
669 "UMask": "0x1", 1079 "UMask": "0x2",
670 "EventName": "UOPS_EXECUTED.STALL_CYCLES", 1080 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
671 "SampleAfterValue": "2000003", 1081 "SampleAfterValue": "2000003",
672 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.", 1082 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
673 "CounterMask": "1", 1083 "CounterMask": "1",
674 "CounterHTOff": "0,1,2,3" 1084 "CounterHTOff": "0,1,2,3,4,5,6,7"
675 }, 1085 },
676 { 1086 {
677 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).", 1087 "EventCode": "0xb1",
678 "EventCode": "0xC0",
679 "Counter": "0,1,2,3", 1088 "Counter": "0,1,2,3",
680 "UMask": "0x0", 1089 "UMask": "0x2",
681 "Errata": "BDM61", 1090 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
682 "EventName": "INST_RETIRED.ANY_P",
683 "SampleAfterValue": "2000003", 1091 "SampleAfterValue": "2000003",
684 "BriefDescription": "Number of instructions retired. General Counter - architectural event", 1092 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1093 "CounterMask": "2",
685 "CounterHTOff": "0,1,2,3,4,5,6,7" 1094 "CounterHTOff": "0,1,2,3,4,5,6,7"
686 }, 1095 },
687 { 1096 {
688 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.", 1097 "EventCode": "0xb1",
689 "EventCode": "0xC0",
690 "Counter": "0,1,2,3", 1098 "Counter": "0,1,2,3",
691 "UMask": "0x2", 1099 "UMask": "0x2",
692 "EventName": "INST_RETIRED.X87", 1100 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
693 "SampleAfterValue": "2000003", 1101 "SampleAfterValue": "2000003",
694 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions:", 1102 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1103 "CounterMask": "3",
1104 "CounterHTOff": "0,1,2,3,4,5,6,7"
1105 },
1106 {
1107 "EventCode": "0xb1",
1108 "Counter": "0,1,2,3",
1109 "UMask": "0x2",
1110 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1111 "SampleAfterValue": "2000003",
1112 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1113 "CounterMask": "4",
1114 "CounterHTOff": "0,1,2,3,4,5,6,7"
1115 },
1116 {
1117 "EventCode": "0xb1",
1118 "Invert": "1",
1119 "Counter": "0,1,2,3",
1120 "UMask": "0x2",
1121 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1122 "SampleAfterValue": "2000003",
1123 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1124 "CounterHTOff": "0,1,2,3,4,5,6,7"
1125 },
1126 {
1127 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).",
1128 "EventCode": "0xC0",
1129 "Counter": "0,1,2,3",
1130 "UMask": "0x0",
1131 "Errata": "BDM61",
1132 "EventName": "INST_RETIRED.ANY_P",
1133 "SampleAfterValue": "2000003",
1134 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
695 "CounterHTOff": "0,1,2,3,4,5,6,7" 1135 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 }, 1136 },
697 { 1137 {
@@ -707,6 +1147,16 @@
707 "CounterHTOff": "1" 1147 "CounterHTOff": "1"
708 }, 1148 },
709 { 1149 {
1150 "PublicDescription": "This event counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.",
1151 "EventCode": "0xC0",
1152 "Counter": "0,1,2,3",
1153 "UMask": "0x2",
1154 "EventName": "INST_RETIRED.X87",
1155 "SampleAfterValue": "2000003",
1156 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions:",
1157 "CounterHTOff": "0,1,2,3,4,5,6,7"
1158 },
1159 {
710 "EventCode": "0xC1", 1160 "EventCode": "0xC1",
711 "Counter": "0,1,2,3", 1161 "Counter": "0,1,2,3",
712 "UMask": "0x40", 1162 "UMask": "0x40",
@@ -717,29 +1167,18 @@
717 }, 1167 },
718 { 1168 {
719 "PEBS": "1", 1169 "PEBS": "1",
720 "PublicDescription": "This event counts all actually retired uops. Counting increments by two for micro-fused uops, and by one for macro-fused and other uops. Maximal increment value for one cycle is eight.", 1170 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts all actually retired uops. Counting increments by two for micro-fused uops, and by one for macro-fused and other uops. Maximal increment value for one cycle is eight.",
721 "EventCode": "0xC2", 1171 "EventCode": "0xC2",
722 "Counter": "0,1,2,3", 1172 "Counter": "0,1,2,3",
723 "UMask": "0x1", 1173 "UMask": "0x1",
724 "EventName": "UOPS_RETIRED.ALL", 1174 "EventName": "UOPS_RETIRED.ALL",
725 "SampleAfterValue": "2000003", 1175 "SampleAfterValue": "2000003",
726 "BriefDescription": "Actually retired uops.", 1176 "BriefDescription": "Actually retired uops. (Precise Event - PEBS)",
727 "CounterHTOff": "0,1,2,3,4,5,6,7", 1177 "CounterHTOff": "0,1,2,3,4,5,6,7",
728 "Data_LA": "1" 1178 "Data_LA": "1"
729 }, 1179 },
730 { 1180 {
731 "PEBS": "1", 1181 "PublicDescription": "This event counts cycles without actually retired uops.",
732 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of retirement slots used.",
733 "EventCode": "0xC2",
734 "Counter": "0,1,2,3",
735 "UMask": "0x2",
736 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
737 "SampleAfterValue": "2000003",
738 "BriefDescription": "Retirement slots used.",
739 "CounterHTOff": "0,1,2,3,4,5,6,7"
740 },
741 {
742 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts cycles without actually retired uops.",
743 "EventCode": "0xC2", 1182 "EventCode": "0xC2",
744 "Invert": "1", 1183 "Invert": "1",
745 "Counter": "0,1,2,3", 1184 "Counter": "0,1,2,3",
@@ -763,6 +1202,17 @@
763 "CounterHTOff": "0,1,2,3" 1202 "CounterHTOff": "0,1,2,3"
764 }, 1203 },
765 { 1204 {
1205 "PEBS": "1",
1206 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts the number of retirement slots used.",
1207 "EventCode": "0xC2",
1208 "Counter": "0,1,2,3",
1209 "UMask": "0x2",
1210 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1211 "SampleAfterValue": "2000003",
1212 "BriefDescription": "Retirement slots used. (Precise Event - PEBS)",
1213 "CounterHTOff": "0,1,2,3,4,5,6,7"
1214 },
1215 {
766 "PublicDescription": "This event counts both thread-specific (TS) and all-thread (AT) nukes.", 1216 "PublicDescription": "This event counts both thread-specific (TS) and all-thread (AT) nukes.",
767 "EventCode": "0xC3", 1217 "EventCode": "0xC3",
768 "Counter": "0,1,2,3", 1218 "Counter": "0,1,2,3",
@@ -773,6 +1223,17 @@
773 "CounterHTOff": "0,1,2,3,4,5,6,7" 1223 "CounterHTOff": "0,1,2,3,4,5,6,7"
774 }, 1224 },
775 { 1225 {
1226 "EventCode": "0xC3",
1227 "Counter": "0,1,2,3",
1228 "UMask": "0x1",
1229 "EdgeDetect": "1",
1230 "EventName": "MACHINE_CLEARS.COUNT",
1231 "SampleAfterValue": "100003",
1232 "BriefDescription": "Number of machine clears (nukes) of any type.",
1233 "CounterMask": "1",
1234 "CounterHTOff": "0,1,2,3,4,5,6,7"
1235 },
1236 {
776 "PublicDescription": "This event counts self-modifying code (SMC) detected, which causes a machine clear.", 1237 "PublicDescription": "This event counts self-modifying code (SMC) detected, which causes a machine clear.",
777 "EventCode": "0xC3", 1238 "EventCode": "0xC3",
778 "Counter": "0,1,2,3", 1239 "Counter": "0,1,2,3",
@@ -793,50 +1254,73 @@
793 "CounterHTOff": "0,1,2,3,4,5,6,7" 1254 "CounterHTOff": "0,1,2,3,4,5,6,7"
794 }, 1255 },
795 { 1256 {
1257 "PublicDescription": "This event counts all (macro) branch instructions retired.",
1258 "EventCode": "0xC4",
1259 "Counter": "0,1,2,3",
1260 "UMask": "0x0",
1261 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1262 "SampleAfterValue": "400009",
1263 "BriefDescription": "All (macro) branch instructions retired.",
1264 "CounterHTOff": "0,1,2,3,4,5,6,7"
1265 },
1266 {
796 "PEBS": "1", 1267 "PEBS": "1",
797 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts conditional branch instructions retired.", 1268 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts conditional branch instructions retired.",
798 "EventCode": "0xC4", 1269 "EventCode": "0xC4",
799 "Counter": "0,1,2,3", 1270 "Counter": "0,1,2,3",
800 "UMask": "0x1", 1271 "UMask": "0x1",
801 "EventName": "BR_INST_RETIRED.CONDITIONAL", 1272 "EventName": "BR_INST_RETIRED.CONDITIONAL",
802 "SampleAfterValue": "400009", 1273 "SampleAfterValue": "400009",
803 "BriefDescription": "Conditional branch instructions retired.", 1274 "BriefDescription": "Conditional branch instructions retired. (Precise Event - PEBS)",
804 "CounterHTOff": "0,1,2,3,4,5,6,7" 1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
805 }, 1276 },
806 { 1277 {
807 "PEBS": "1", 1278 "PEBS": "1",
808 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts both direct and indirect near call instructions retired.", 1279 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect near call instructions retired.",
809 "EventCode": "0xC4", 1280 "EventCode": "0xC4",
810 "Counter": "0,1,2,3", 1281 "Counter": "0,1,2,3",
811 "UMask": "0x2", 1282 "UMask": "0x2",
812 "EventName": "BR_INST_RETIRED.NEAR_CALL", 1283 "EventName": "BR_INST_RETIRED.NEAR_CALL",
813 "SampleAfterValue": "100007", 1284 "SampleAfterValue": "100007",
814 "BriefDescription": "Direct and indirect near call instructions retired.", 1285 "BriefDescription": "Direct and indirect near call instructions retired. (Precise Event - PEBS)",
815 "CounterHTOff": "0,1,2,3,4,5,6,7" 1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
816 }, 1287 },
817 { 1288 {
818 "PublicDescription": "This event counts all (macro) branch instructions retired.", 1289 "PEBS": "1",
1290 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect macro near call instructions retired (captured in ring 3).",
819 "EventCode": "0xC4", 1291 "EventCode": "0xC4",
820 "Counter": "0,1,2,3", 1292 "Counter": "0,1,2,3",
821 "UMask": "0x0", 1293 "UMask": "0x2",
822 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1294 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
823 "SampleAfterValue": "400009", 1295 "SampleAfterValue": "100007",
824 "BriefDescription": "All (macro) branch instructions retired.", 1296 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3). (Precise Event - PEBS)",
825 "CounterHTOff": "0,1,2,3,4,5,6,7" 1297 "CounterHTOff": "0,1,2,3,4,5,6,7"
826 }, 1298 },
827 { 1299 {
1300 "PEBS": "2",
1301 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
1302 "EventCode": "0xC4",
1303 "Counter": "0,1,2,3",
1304 "UMask": "0x4",
1305 "Errata": "BDW98",
1306 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
1307 "SampleAfterValue": "400009",
1308 "BriefDescription": "All (macro) branch instructions retired. (Precise Event - PEBS)",
1309 "CounterHTOff": "0,1,2,3"
1310 },
1311 {
828 "PEBS": "1", 1312 "PEBS": "1",
829 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts return instructions retired.", 1313 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts return instructions retired.",
830 "EventCode": "0xC4", 1314 "EventCode": "0xC4",
831 "Counter": "0,1,2,3", 1315 "Counter": "0,1,2,3",
832 "UMask": "0x8", 1316 "UMask": "0x8",
833 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 1317 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
834 "SampleAfterValue": "100007", 1318 "SampleAfterValue": "100007",
835 "BriefDescription": "Return instructions retired.", 1319 "BriefDescription": "Return instructions retired. (Precise Event - PEBS)",
836 "CounterHTOff": "0,1,2,3,4,5,6,7" 1320 "CounterHTOff": "0,1,2,3,4,5,6,7"
837 }, 1321 },
838 { 1322 {
839 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts not taken branch instructions retired.", 1323 "PublicDescription": "This event counts not taken branch instructions retired.",
840 "EventCode": "0xC4", 1324 "EventCode": "0xC4",
841 "Counter": "0,1,2,3", 1325 "Counter": "0,1,2,3",
842 "UMask": "0x10", 1326 "UMask": "0x10",
@@ -847,17 +1331,17 @@
847 }, 1331 },
848 { 1332 {
849 "PEBS": "1", 1333 "PEBS": "1",
850 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts taken branch instructions retired.", 1334 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts taken branch instructions retired.",
851 "EventCode": "0xC4", 1335 "EventCode": "0xC4",
852 "Counter": "0,1,2,3", 1336 "Counter": "0,1,2,3",
853 "UMask": "0x20", 1337 "UMask": "0x20",
854 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 1338 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
855 "SampleAfterValue": "400009", 1339 "SampleAfterValue": "400009",
856 "BriefDescription": "Taken branch instructions retired.", 1340 "BriefDescription": "Taken branch instructions retired. (Precise Event - PEBS)",
857 "CounterHTOff": "0,1,2,3,4,5,6,7" 1341 "CounterHTOff": "0,1,2,3,4,5,6,7"
858 }, 1342 },
859 { 1343 {
860 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts far branch instructions retired.", 1344 "PublicDescription": "This event counts far branch instructions retired.",
861 "EventCode": "0xC4", 1345 "EventCode": "0xC4",
862 "Counter": "0,1,2,3", 1346 "Counter": "0,1,2,3",
863 "UMask": "0x40", 1347 "UMask": "0x40",
@@ -868,29 +1352,6 @@
868 "CounterHTOff": "0,1,2,3,4,5,6,7" 1352 "CounterHTOff": "0,1,2,3,4,5,6,7"
869 }, 1353 },
870 { 1354 {
871 "PEBS": "2",
872 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
873 "EventCode": "0xC4",
874 "Counter": "0,1,2,3",
875 "UMask": "0x4",
876 "Errata": "BDW98",
877 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
878 "SampleAfterValue": "400009",
879 "BriefDescription": "All (macro) branch instructions retired. (Precise Event - PEBS)",
880 "CounterHTOff": "0,1,2,3"
881 },
882 {
883 "PEBS": "1",
884 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted conditional branch instructions retired.",
885 "EventCode": "0xC5",
886 "Counter": "0,1,2,3",
887 "UMask": "0x1",
888 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
889 "SampleAfterValue": "400009",
890 "BriefDescription": "Mispredicted conditional branch instructions retired.",
891 "CounterHTOff": "0,1,2,3,4,5,6,7"
892 },
893 {
894 "PublicDescription": "This event counts all mispredicted macro branch instructions retired.", 1355 "PublicDescription": "This event counts all mispredicted macro branch instructions retired.",
895 "EventCode": "0xC5", 1356 "EventCode": "0xC5",
896 "Counter": "0,1,2,3", 1357 "Counter": "0,1,2,3",
@@ -902,13 +1363,13 @@
902 }, 1363 },
903 { 1364 {
904 "PEBS": "1", 1365 "PEBS": "1",
905 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted return instructions retired.", 1366 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted conditional branch instructions retired.",
906 "EventCode": "0xC5", 1367 "EventCode": "0xC5",
907 "Counter": "0,1,2,3", 1368 "Counter": "0,1,2,3",
908 "UMask": "0x8", 1369 "UMask": "0x1",
909 "EventName": "BR_MISP_RETIRED.RET", 1370 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
910 "SampleAfterValue": "100007", 1371 "SampleAfterValue": "400009",
911 "BriefDescription": "This event counts the number of mispredicted ret instructions retired. Non PEBS", 1372 "BriefDescription": "Mispredicted conditional branch instructions retired. (Precise Event - PEBS)",
912 "CounterHTOff": "0,1,2,3,4,5,6,7" 1373 "CounterHTOff": "0,1,2,3,4,5,6,7"
913 }, 1374 },
914 { 1375 {
@@ -923,164 +1384,36 @@
923 "CounterHTOff": "0,1,2,3" 1384 "CounterHTOff": "0,1,2,3"
924 }, 1385 },
925 { 1386 {
926 "PublicDescription": "This event counts cases of saving new LBR records by hardware. This assumes proper enabling of LBRs and takes into account LBR filtering done by the LBR_SELECT register.", 1387 "PEBS": "1",
927 "EventCode": "0xCC", 1388 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted return instructions retired.",
928 "Counter": "0,1,2,3", 1389 "EventCode": "0xC5",
929 "UMask": "0x20",
930 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
931 "SampleAfterValue": "2000003",
932 "BriefDescription": "Count cases of saving new LBR",
933 "CounterHTOff": "0,1,2,3,4,5,6,7"
934 },
935 {
936 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
937 "EventCode": "0x3C",
938 "Counter": "0,1,2,3",
939 "UMask": "0x0",
940 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
941 "SampleAfterValue": "2000003",
942 "BriefDescription": "Thread cycles when thread is not in halt state",
943 "CounterHTOff": "0,1,2,3,4,5,6,7"
944 },
945 {
946 "EventCode": "0x89",
947 "Counter": "0,1,2,3",
948 "UMask": "0xa0",
949 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
950 "SampleAfterValue": "200003",
951 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
952 "CounterHTOff": "0,1,2,3,4,5,6,7"
953 },
954 {
955 "EventCode": "0xA1",
956 "Counter": "0,1,2,3",
957 "UMask": "0x1",
958 "AnyThread": "1",
959 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
960 "SampleAfterValue": "2000003",
961 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
962 "CounterHTOff": "0,1,2,3,4,5,6,7"
963 },
964 {
965 "EventCode": "0xA1",
966 "Counter": "0,1,2,3",
967 "UMask": "0x2",
968 "AnyThread": "1",
969 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
970 "SampleAfterValue": "2000003",
971 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
972 "CounterHTOff": "0,1,2,3,4,5,6,7"
973 },
974 {
975 "EventCode": "0xA1",
976 "Counter": "0,1,2,3",
977 "UMask": "0x4",
978 "AnyThread": "1",
979 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
980 "SampleAfterValue": "2000003",
981 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
982 "CounterHTOff": "0,1,2,3,4,5,6,7"
983 },
984 {
985 "EventCode": "0xA1",
986 "Counter": "0,1,2,3", 1390 "Counter": "0,1,2,3",
987 "UMask": "0x8", 1391 "UMask": "0x8",
988 "AnyThread": "1", 1392 "EventName": "BR_MISP_RETIRED.RET",
989 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE", 1393 "SampleAfterValue": "100007",
990 "SampleAfterValue": "2000003", 1394 "BriefDescription": "This event counts the number of mispredicted ret instructions retired.(Precise Event)",
991 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
992 "CounterHTOff": "0,1,2,3,4,5,6,7"
993 },
994 {
995 "EventCode": "0xA1",
996 "Counter": "0,1,2,3",
997 "UMask": "0x10",
998 "AnyThread": "1",
999 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
1000 "SampleAfterValue": "2000003",
1001 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
1002 "CounterHTOff": "0,1,2,3,4,5,6,7"
1003 },
1004 {
1005 "EventCode": "0xA1",
1006 "Counter": "0,1,2,3",
1007 "UMask": "0x20",
1008 "AnyThread": "1",
1009 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
1010 "SampleAfterValue": "2000003",
1011 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
1012 "CounterHTOff": "0,1,2,3,4,5,6,7"
1013 },
1014 {
1015 "EventCode": "0xA1",
1016 "Counter": "0,1,2,3",
1017 "UMask": "0x40",
1018 "AnyThread": "1",
1019 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
1020 "SampleAfterValue": "2000003",
1021 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
1022 "CounterHTOff": "0,1,2,3,4,5,6,7"
1023 },
1024 {
1025 "EventCode": "0xA1",
1026 "Counter": "0,1,2,3",
1027 "UMask": "0x80",
1028 "AnyThread": "1",
1029 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
1030 "SampleAfterValue": "2000003",
1031 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
1032 "CounterHTOff": "0,1,2,3,4,5,6,7" 1395 "CounterHTOff": "0,1,2,3,4,5,6,7"
1033 }, 1396 },
1034 { 1397 {
1035 "PEBS": "1", 1398 "PEBS": "1",
1036 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken.", 1399 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken. (Precise Event - PEBS).",
1037 "EventCode": "0xC5", 1400 "EventCode": "0xC5",
1038 "Counter": "0,1,2,3", 1401 "Counter": "0,1,2,3",
1039 "UMask": "0x20", 1402 "UMask": "0x20",
1040 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 1403 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
1041 "SampleAfterValue": "400009", 1404 "SampleAfterValue": "400009",
1042 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.", 1405 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken. (Precise Event - PEBS).",
1043 "CounterHTOff": "0,1,2,3,4,5,6,7" 1406 "CounterHTOff": "0,1,2,3,4,5,6,7"
1044 }, 1407 },
1045 { 1408 {
1046 "EventCode": "0xB1", 1409 "PublicDescription": "This event counts cases of saving new LBR records by hardware. This assumes proper enabling of LBRs and takes into account LBR filtering done by the LBR_SELECT register.",
1047 "Counter": "0,1,2,3", 1410 "EventCode": "0xCC",
1048 "UMask": "0x1",
1049 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1050 "SampleAfterValue": "2000003",
1051 "BriefDescription": "Cycles where at least 1 uop was executed per-thread.",
1052 "CounterMask": "1",
1053 "CounterHTOff": "0,1,2,3"
1054 },
1055 {
1056 "EventCode": "0xB1",
1057 "Counter": "0,1,2,3",
1058 "UMask": "0x1",
1059 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1060 "SampleAfterValue": "2000003",
1061 "BriefDescription": "Cycles where at least 2 uops were executed per-thread.",
1062 "CounterMask": "2",
1063 "CounterHTOff": "0,1,2,3"
1064 },
1065 {
1066 "EventCode": "0xB1",
1067 "Counter": "0,1,2,3",
1068 "UMask": "0x1",
1069 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1070 "SampleAfterValue": "2000003",
1071 "BriefDescription": "Cycles where at least 3 uops were executed per-thread.",
1072 "CounterMask": "3",
1073 "CounterHTOff": "0,1,2,3"
1074 },
1075 {
1076 "EventCode": "0xB1",
1077 "Counter": "0,1,2,3", 1411 "Counter": "0,1,2,3",
1078 "UMask": "0x1", 1412 "UMask": "0x20",
1079 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC", 1413 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
1080 "SampleAfterValue": "2000003", 1414 "SampleAfterValue": "2000003",
1081 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.", 1415 "BriefDescription": "Count cases of saving new LBR",
1082 "CounterMask": "4", 1416 "CounterHTOff": "0,1,2,3,4,5,6,7"
1083 "CounterHTOff": "0,1,2,3"
1084 }, 1417 },
1085 { 1418 {
1086 "EventCode": "0xe6", 1419 "EventCode": "0xe6",
@@ -1090,328 +1423,5 @@
1090 "SampleAfterValue": "100003", 1423 "SampleAfterValue": "100003",
1091 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.", 1424 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.",
1092 "CounterHTOff": "0,1,2,3,4,5,6,7" 1425 "CounterHTOff": "0,1,2,3,4,5,6,7"
1093 },
1094 {
1095 "EventCode": "0xA3",
1096 "Counter": "2",
1097 "UMask": "0x8",
1098 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
1099 "SampleAfterValue": "2000003",
1100 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
1101 "CounterMask": "8",
1102 "CounterHTOff": "2"
1103 },
1104 {
1105 "EventCode": "0xA3",
1106 "Counter": "0,1,2,3",
1107 "UMask": "0x1",
1108 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
1109 "SampleAfterValue": "2000003",
1110 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
1111 "CounterMask": "1",
1112 "CounterHTOff": "0,1,2,3,4,5,6,7"
1113 },
1114 {
1115 "EventCode": "0xA3",
1116 "Counter": "0,1,2,3",
1117 "UMask": "0x2",
1118 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
1119 "SampleAfterValue": "2000003",
1120 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
1121 "CounterMask": "2",
1122 "CounterHTOff": "0,1,2,3"
1123 },
1124 {
1125 "EventCode": "0xA3",
1126 "Counter": "0,1,2,3",
1127 "UMask": "0x4",
1128 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
1129 "SampleAfterValue": "2000003",
1130 "BriefDescription": "Total execution stalls.",
1131 "CounterMask": "4",
1132 "CounterHTOff": "0,1,2,3,4,5,6,7"
1133 },
1134 {
1135 "EventCode": "0xA3",
1136 "Counter": "2",
1137 "UMask": "0xc",
1138 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
1139 "SampleAfterValue": "2000003",
1140 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
1141 "CounterMask": "12",
1142 "CounterHTOff": "2"
1143 },
1144 {
1145 "EventCode": "0xA3",
1146 "Counter": "0,1,2,3",
1147 "UMask": "0x5",
1148 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
1149 "SampleAfterValue": "2000003",
1150 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
1151 "CounterMask": "5",
1152 "CounterHTOff": "0,1,2,3,4,5,6,7"
1153 },
1154 {
1155 "EventCode": "0xA3",
1156 "Counter": "0,1,2,3",
1157 "UMask": "0x6",
1158 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
1159 "SampleAfterValue": "2000003",
1160 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
1161 "CounterMask": "6",
1162 "CounterHTOff": "0,1,2,3,4,5,6,7"
1163 },
1164 {
1165 "EventCode": "0xC3",
1166 "Counter": "0,1,2,3",
1167 "UMask": "0x1",
1168 "EdgeDetect": "1",
1169 "EventName": "MACHINE_CLEARS.COUNT",
1170 "SampleAfterValue": "100003",
1171 "BriefDescription": "Number of machine clears (nukes) of any type.",
1172 "CounterMask": "1",
1173 "CounterHTOff": "0,1,2,3,4,5,6,7"
1174 },
1175 {
1176 "EventCode": "0xA8",
1177 "Counter": "0,1,2,3",
1178 "UMask": "0x1",
1179 "EventName": "LSD.CYCLES_4_UOPS",
1180 "SampleAfterValue": "2000003",
1181 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1182 "CounterMask": "4",
1183 "CounterHTOff": "0,1,2,3,4,5,6,7"
1184 },
1185 {
1186 "EventCode": "0x5E",
1187 "Invert": "1",
1188 "Counter": "0,1,2,3",
1189 "UMask": "0x1",
1190 "EdgeDetect": "1",
1191 "EventName": "RS_EVENTS.EMPTY_END",
1192 "SampleAfterValue": "200003",
1193 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1194 "CounterMask": "1",
1195 "CounterHTOff": "0,1,2,3,4,5,6,7"
1196 },
1197 {
1198 "EventCode": "0xA8",
1199 "Counter": "0,1,2,3",
1200 "UMask": "0x1",
1201 "EventName": "LSD.CYCLES_ACTIVE",
1202 "SampleAfterValue": "2000003",
1203 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
1204 "CounterMask": "1",
1205 "CounterHTOff": "0,1,2,3,4,5,6,7"
1206 },
1207 {
1208 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
1209 "EventCode": "0xA1",
1210 "Counter": "0,1,2,3",
1211 "UMask": "0x1",
1212 "EventName": "UOPS_EXECUTED_PORT.PORT_0",
1213 "SampleAfterValue": "2000003",
1214 "BriefDescription": "Cycles per thread when uops are executed in port 0",
1215 "CounterHTOff": "0,1,2,3,4,5,6,7"
1216 },
1217 {
1218 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
1219 "EventCode": "0xA1",
1220 "Counter": "0,1,2,3",
1221 "UMask": "0x2",
1222 "EventName": "UOPS_EXECUTED_PORT.PORT_1",
1223 "SampleAfterValue": "2000003",
1224 "BriefDescription": "Cycles per thread when uops are executed in port 1",
1225 "CounterHTOff": "0,1,2,3,4,5,6,7"
1226 },
1227 {
1228 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
1229 "EventCode": "0xA1",
1230 "Counter": "0,1,2,3",
1231 "UMask": "0x4",
1232 "EventName": "UOPS_EXECUTED_PORT.PORT_2",
1233 "SampleAfterValue": "2000003",
1234 "BriefDescription": "Cycles per thread when uops are executed in port 2",
1235 "CounterHTOff": "0,1,2,3,4,5,6,7"
1236 },
1237 {
1238 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
1239 "EventCode": "0xA1",
1240 "Counter": "0,1,2,3",
1241 "UMask": "0x8",
1242 "EventName": "UOPS_EXECUTED_PORT.PORT_3",
1243 "SampleAfterValue": "2000003",
1244 "BriefDescription": "Cycles per thread when uops are executed in port 3",
1245 "CounterHTOff": "0,1,2,3,4,5,6,7"
1246 },
1247 {
1248 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
1249 "EventCode": "0xA1",
1250 "Counter": "0,1,2,3",
1251 "UMask": "0x10",
1252 "EventName": "UOPS_EXECUTED_PORT.PORT_4",
1253 "SampleAfterValue": "2000003",
1254 "BriefDescription": "Cycles per thread when uops are executed in port 4",
1255 "CounterHTOff": "0,1,2,3,4,5,6,7"
1256 },
1257 {
1258 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
1259 "EventCode": "0xA1",
1260 "Counter": "0,1,2,3",
1261 "UMask": "0x20",
1262 "EventName": "UOPS_EXECUTED_PORT.PORT_5",
1263 "SampleAfterValue": "2000003",
1264 "BriefDescription": "Cycles per thread when uops are executed in port 5",
1265 "CounterHTOff": "0,1,2,3,4,5,6,7"
1266 },
1267 {
1268 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
1269 "EventCode": "0xA1",
1270 "Counter": "0,1,2,3",
1271 "UMask": "0x40",
1272 "EventName": "UOPS_EXECUTED_PORT.PORT_6",
1273 "SampleAfterValue": "2000003",
1274 "BriefDescription": "Cycles per thread when uops are executed in port 6",
1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
1276 },
1277 {
1278 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
1279 "EventCode": "0xA1",
1280 "Counter": "0,1,2,3",
1281 "UMask": "0x80",
1282 "EventName": "UOPS_EXECUTED_PORT.PORT_7",
1283 "SampleAfterValue": "2000003",
1284 "BriefDescription": "Cycles per thread when uops are executed in port 7",
1285 "CounterHTOff": "0,1,2,3,4,5,6,7"
1286 },
1287 {
1288 "PublicDescription": "This event counts the number of micro-operations cancelled after they were dispatched from the scheduler to the execution units when the total number of physical register read ports across all dispatch ports exceeds the read bandwidth of the physical register file. The SIMD_PRF subevent applies to the following instructions: VDPPS, DPPS, VPCMPESTRI, PCMPESTRI, VPCMPESTRM, PCMPESTRM, VFMADD*, VFMADDSUB*, VFMSUB*, VMSUBADD*, VFNMADD*, VFNMSUB*. See the Broadwell Optimization Guide for more information.",
1289 "EventCode": "0xA0",
1290 "Counter": "0,1,2,3",
1291 "UMask": "0x3",
1292 "EventName": "UOP_DISPATCHES_CANCELLED.SIMD_PRF",
1293 "SampleAfterValue": "2000003",
1294 "BriefDescription": "Micro-op dispatches cancelled due to insufficient SIMD physical register file read ports",
1295 "CounterHTOff": "0,1,2,3"
1296 },
1297 {
1298 "EventCode": "0x00",
1299 "Counter": "Fixed counter 2",
1300 "UMask": "0x2",
1301 "AnyThread": "1",
1302 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1303 "SampleAfterValue": "2000003",
1304 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1305 "CounterHTOff": "Fixed counter 2"
1306 },
1307 {
1308 "EventCode": "0x3C",
1309 "Counter": "0,1,2,3",
1310 "UMask": "0x0",
1311 "AnyThread": "1",
1312 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1313 "SampleAfterValue": "2000003",
1314 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1315 "CounterHTOff": "0,1,2,3,4,5,6,7"
1316 },
1317 {
1318 "EventCode": "0x3C",
1319 "Counter": "0,1,2,3",
1320 "UMask": "0x1",
1321 "AnyThread": "1",
1322 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1323 "SampleAfterValue": "2000003",
1324 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1325 "CounterHTOff": "0,1,2,3,4,5,6,7"
1326 },
1327 {
1328 "EventCode": "0x0D",
1329 "Counter": "0,1,2,3",
1330 "UMask": "0x3",
1331 "AnyThread": "1",
1332 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1333 "SampleAfterValue": "2000003",
1334 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1335 "CounterMask": "1",
1336 "CounterHTOff": "0,1,2,3,4,5,6,7"
1337 },
1338 {
1339 "EventCode": "0xb1",
1340 "Counter": "0,1,2,3",
1341 "UMask": "0x2",
1342 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1343 "SampleAfterValue": "2000003",
1344 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1345 "CounterMask": "1",
1346 "CounterHTOff": "0,1,2,3,4,5,6,7"
1347 },
1348 {
1349 "EventCode": "0xb1",
1350 "Counter": "0,1,2,3",
1351 "UMask": "0x2",
1352 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1353 "SampleAfterValue": "2000003",
1354 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1355 "CounterMask": "2",
1356 "CounterHTOff": "0,1,2,3,4,5,6,7"
1357 },
1358 {
1359 "EventCode": "0xb1",
1360 "Counter": "0,1,2,3",
1361 "UMask": "0x2",
1362 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1363 "SampleAfterValue": "2000003",
1364 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1365 "CounterMask": "3",
1366 "CounterHTOff": "0,1,2,3,4,5,6,7"
1367 },
1368 {
1369 "EventCode": "0xb1",
1370 "Counter": "0,1,2,3",
1371 "UMask": "0x2",
1372 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1373 "SampleAfterValue": "2000003",
1374 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1375 "CounterMask": "4",
1376 "CounterHTOff": "0,1,2,3,4,5,6,7"
1377 },
1378 {
1379 "EventCode": "0xb1",
1380 "Invert": "1",
1381 "Counter": "0,1,2,3",
1382 "UMask": "0x2",
1383 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1384 "SampleAfterValue": "2000003",
1385 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1386 "CounterHTOff": "0,1,2,3,4,5,6,7"
1387 },
1388 {
1389 "PublicDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate).",
1390 "EventCode": "0x3C",
1391 "Counter": "0,1,2,3",
1392 "UMask": "0x1",
1393 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1394 "SampleAfterValue": "2000003",
1395 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1396 "CounterHTOff": "0,1,2,3,4,5,6,7"
1397 },
1398 {
1399 "EventCode": "0x3C",
1400 "Counter": "0,1,2,3",
1401 "UMask": "0x1",
1402 "AnyThread": "1",
1403 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1404 "SampleAfterValue": "2000003",
1405 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1406 "CounterHTOff": "0,1,2,3,4,5,6,7"
1407 },
1408 {
1409 "EventCode": "0x3C",
1410 "Counter": "0,1,2,3",
1411 "UMask": "0x2",
1412 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1413 "SampleAfterValue": "2000003",
1414 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1415 "CounterHTOff": "0,1,2,3,4,5,6,7"
1416 } 1426 }
1417] \ No newline at end of file 1427] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwell/virtual-memory.json b/tools/perf/pmu-events/arch/x86/broadwell/virtual-memory.json
index 4301e6fbc5eb..2a015e4c7e21 100644
--- a/tools/perf/pmu-events/arch/x86/broadwell/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwell/virtual-memory.json
@@ -44,6 +44,16 @@
44 "CounterHTOff": "0,1,2,3,4,5,6,7" 44 "CounterHTOff": "0,1,2,3,4,5,6,7"
45 }, 45 },
46 { 46 {
47 "EventCode": "0x08",
48 "Counter": "0,1,2,3",
49 "UMask": "0xe",
50 "Errata": "BDM69",
51 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
52 "SampleAfterValue": "100003",
53 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
54 "CounterHTOff": "0,1,2,3,4,5,6,7"
55 },
56 {
47 "PublicDescription": "This event counts the number of cycles while PMH is busy with the page walk.", 57 "PublicDescription": "This event counts the number of cycles while PMH is busy with the page walk.",
48 "EventCode": "0x08", 58 "EventCode": "0x08",
49 "Counter": "0,1,2,3", 59 "Counter": "0,1,2,3",
@@ -73,6 +83,15 @@
73 "CounterHTOff": "0,1,2,3,4,5,6,7" 83 "CounterHTOff": "0,1,2,3,4,5,6,7"
74 }, 84 },
75 { 85 {
86 "EventCode": "0x08",
87 "Counter": "0,1,2,3",
88 "UMask": "0x60",
89 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
90 "SampleAfterValue": "2000003",
91 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks.",
92 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 },
94 {
76 "PublicDescription": "This event counts store misses in all DTLB levels that cause page walks of any page size (4K/2M/4M/1G).", 95 "PublicDescription": "This event counts store misses in all DTLB levels that cause page walks of any page size (4K/2M/4M/1G).",
77 "EventCode": "0x49", 96 "EventCode": "0x49",
78 "Counter": "0,1,2,3", 97 "Counter": "0,1,2,3",
@@ -117,6 +136,16 @@
117 "CounterHTOff": "0,1,2,3,4,5,6,7" 136 "CounterHTOff": "0,1,2,3,4,5,6,7"
118 }, 137 },
119 { 138 {
139 "EventCode": "0x49",
140 "Counter": "0,1,2,3",
141 "UMask": "0xe",
142 "Errata": "BDM69",
143 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
144 "SampleAfterValue": "100003",
145 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks.",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
120 "PublicDescription": "This event counts the number of cycles while PMH is busy with the page walk.", 149 "PublicDescription": "This event counts the number of cycles while PMH is busy with the page walk.",
121 "EventCode": "0x49", 150 "EventCode": "0x49",
122 "Counter": "0,1,2,3", 151 "Counter": "0,1,2,3",
@@ -146,6 +175,15 @@
146 "CounterHTOff": "0,1,2,3,4,5,6,7" 175 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 }, 176 },
148 { 177 {
178 "EventCode": "0x49",
179 "Counter": "0,1,2,3",
180 "UMask": "0x60",
181 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
182 "SampleAfterValue": "100003",
183 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
184 "CounterHTOff": "0,1,2,3,4,5,6,7"
185 },
186 {
149 "PublicDescription": "This event counts cycles for an extended page table walk. The Extended Page directory cache differs from standard TLB caches by the operating system that use it. Virtual machine operating systems use the extended page directory cache, while guest operating systems use the standard TLB caches.", 187 "PublicDescription": "This event counts cycles for an extended page table walk. The Extended Page directory cache differs from standard TLB caches by the operating system that use it. Virtual machine operating systems use the extended page directory cache, while guest operating systems use the standard TLB caches.",
150 "EventCode": "0x4F", 188 "EventCode": "0x4F",
151 "Counter": "0,1,2,3", 189 "Counter": "0,1,2,3",
@@ -200,6 +238,16 @@
200 "CounterHTOff": "0,1,2,3,4,5,6,7" 238 "CounterHTOff": "0,1,2,3,4,5,6,7"
201 }, 239 },
202 { 240 {
241 "EventCode": "0x85",
242 "Counter": "0,1,2,3",
243 "UMask": "0xe",
244 "Errata": "BDM69",
245 "EventName": "ITLB_MISSES.WALK_COMPLETED",
246 "SampleAfterValue": "100003",
247 "BriefDescription": "Misses in all ITLB levels that cause completed page walks.",
248 "CounterHTOff": "0,1,2,3,4,5,6,7"
249 },
250 {
203 "PublicDescription": "This event counts the number of cycles while PMH is busy with the page walk.", 251 "PublicDescription": "This event counts the number of cycles while PMH is busy with the page walk.",
204 "EventCode": "0x85", 252 "EventCode": "0x85",
205 "Counter": "0,1,2,3", 253 "Counter": "0,1,2,3",
@@ -229,6 +277,15 @@
229 "CounterHTOff": "0,1,2,3,4,5,6,7" 277 "CounterHTOff": "0,1,2,3,4,5,6,7"
230 }, 278 },
231 { 279 {
280 "EventCode": "0x85",
281 "Counter": "0,1,2,3",
282 "UMask": "0x60",
283 "EventName": "ITLB_MISSES.STLB_HIT",
284 "SampleAfterValue": "100003",
285 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks.",
286 "CounterHTOff": "0,1,2,3,4,5,6,7"
287 },
288 {
232 "PublicDescription": "This event counts the number of flushes of the big or small ITLB pages. Counting include both TLB Flush (covering all sets) and TLB Set Clear (set-specific).", 289 "PublicDescription": "This event counts the number of flushes of the big or small ITLB pages. Counting include both TLB Flush (covering all sets) and TLB Set Clear (set-specific).",
233 "EventCode": "0xAE", 290 "EventCode": "0xAE",
234 "Counter": "0,1,2,3", 291 "Counter": "0,1,2,3",
@@ -251,61 +308,61 @@
251 { 308 {
252 "EventCode": "0xBC", 309 "EventCode": "0xBC",
253 "Counter": "0,1,2,3", 310 "Counter": "0,1,2,3",
254 "UMask": "0x21", 311 "UMask": "0x12",
255 "Errata": "BDM69, BDM98", 312 "Errata": "BDM69, BDM98",
256 "EventName": "PAGE_WALKER_LOADS.ITLB_L1", 313 "EventName": "PAGE_WALKER_LOADS.DTLB_L2",
257 "SampleAfterValue": "2000003", 314 "SampleAfterValue": "2000003",
258 "BriefDescription": "Number of ITLB page walker hits in the L1+FB.", 315 "BriefDescription": "Number of DTLB page walker hits in the L2.",
259 "CounterHTOff": "0,1,2,3" 316 "CounterHTOff": "0,1,2,3"
260 }, 317 },
261 { 318 {
262 "EventCode": "0xBC", 319 "EventCode": "0xBC",
263 "Counter": "0,1,2,3", 320 "Counter": "0,1,2,3",
264 "UMask": "0x12", 321 "UMask": "0x14",
265 "Errata": "BDM69, BDM98", 322 "Errata": "BDM69, BDM98",
266 "EventName": "PAGE_WALKER_LOADS.DTLB_L2", 323 "EventName": "PAGE_WALKER_LOADS.DTLB_L3",
267 "SampleAfterValue": "2000003", 324 "SampleAfterValue": "2000003",
268 "BriefDescription": "Number of DTLB page walker hits in the L2.", 325 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP.",
269 "CounterHTOff": "0,1,2,3" 326 "CounterHTOff": "0,1,2,3"
270 }, 327 },
271 { 328 {
272 "EventCode": "0xBC", 329 "EventCode": "0xBC",
273 "Counter": "0,1,2,3", 330 "Counter": "0,1,2,3",
274 "UMask": "0x22", 331 "UMask": "0x18",
275 "Errata": "BDM69, BDM98", 332 "Errata": "BDM69, BDM98",
276 "EventName": "PAGE_WALKER_LOADS.ITLB_L2", 333 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY",
277 "SampleAfterValue": "2000003", 334 "SampleAfterValue": "2000003",
278 "BriefDescription": "Number of ITLB page walker hits in the L2.", 335 "BriefDescription": "Number of DTLB page walker hits in Memory.",
279 "CounterHTOff": "0,1,2,3" 336 "CounterHTOff": "0,1,2,3"
280 }, 337 },
281 { 338 {
282 "EventCode": "0xBC", 339 "EventCode": "0xBC",
283 "Counter": "0,1,2,3", 340 "Counter": "0,1,2,3",
284 "UMask": "0x14", 341 "UMask": "0x21",
285 "Errata": "BDM69, BDM98", 342 "Errata": "BDM69, BDM98",
286 "EventName": "PAGE_WALKER_LOADS.DTLB_L3", 343 "EventName": "PAGE_WALKER_LOADS.ITLB_L1",
287 "SampleAfterValue": "2000003", 344 "SampleAfterValue": "2000003",
288 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP.", 345 "BriefDescription": "Number of ITLB page walker hits in the L1+FB.",
289 "CounterHTOff": "0,1,2,3" 346 "CounterHTOff": "0,1,2,3"
290 }, 347 },
291 { 348 {
292 "EventCode": "0xBC", 349 "EventCode": "0xBC",
293 "Counter": "0,1,2,3", 350 "Counter": "0,1,2,3",
294 "UMask": "0x24", 351 "UMask": "0x22",
295 "Errata": "BDM69, BDM98", 352 "Errata": "BDM69, BDM98",
296 "EventName": "PAGE_WALKER_LOADS.ITLB_L3", 353 "EventName": "PAGE_WALKER_LOADS.ITLB_L2",
297 "SampleAfterValue": "2000003", 354 "SampleAfterValue": "2000003",
298 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP.", 355 "BriefDescription": "Number of ITLB page walker hits in the L2.",
299 "CounterHTOff": "0,1,2,3" 356 "CounterHTOff": "0,1,2,3"
300 }, 357 },
301 { 358 {
302 "EventCode": "0xBC", 359 "EventCode": "0xBC",
303 "Counter": "0,1,2,3", 360 "Counter": "0,1,2,3",
304 "UMask": "0x18", 361 "UMask": "0x24",
305 "Errata": "BDM69, BDM98", 362 "Errata": "BDM69, BDM98",
306 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY", 363 "EventName": "PAGE_WALKER_LOADS.ITLB_L3",
307 "SampleAfterValue": "2000003", 364 "SampleAfterValue": "2000003",
308 "BriefDescription": "Number of DTLB page walker hits in Memory.", 365 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP.",
309 "CounterHTOff": "0,1,2,3" 366 "CounterHTOff": "0,1,2,3"
310 }, 367 },
311 { 368 {
@@ -327,62 +384,5 @@
327 "SampleAfterValue": "100007", 384 "SampleAfterValue": "100007",
328 "BriefDescription": "STLB flush attempts", 385 "BriefDescription": "STLB flush attempts",
329 "CounterHTOff": "0,1,2,3,4,5,6,7" 386 "CounterHTOff": "0,1,2,3,4,5,6,7"
330 },
331 {
332 "EventCode": "0x08",
333 "Counter": "0,1,2,3",
334 "UMask": "0xe",
335 "Errata": "BDM69",
336 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
337 "SampleAfterValue": "100003",
338 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
339 "CounterHTOff": "0,1,2,3,4,5,6,7"
340 },
341 {
342 "EventCode": "0x08",
343 "Counter": "0,1,2,3",
344 "UMask": "0x60",
345 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
346 "SampleAfterValue": "2000003",
347 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks.",
348 "CounterHTOff": "0,1,2,3,4,5,6,7"
349 },
350 {
351 "EventCode": "0x49",
352 "Counter": "0,1,2,3",
353 "UMask": "0xe",
354 "Errata": "BDM69",
355 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
356 "SampleAfterValue": "100003",
357 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks.",
358 "CounterHTOff": "0,1,2,3,4,5,6,7"
359 },
360 {
361 "EventCode": "0x49",
362 "Counter": "0,1,2,3",
363 "UMask": "0x60",
364 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
365 "SampleAfterValue": "100003",
366 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
367 "CounterHTOff": "0,1,2,3,4,5,6,7"
368 },
369 {
370 "EventCode": "0x85",
371 "Counter": "0,1,2,3",
372 "UMask": "0xe",
373 "Errata": "BDM69",
374 "EventName": "ITLB_MISSES.WALK_COMPLETED",
375 "SampleAfterValue": "100003",
376 "BriefDescription": "Misses in all ITLB levels that cause completed page walks.",
377 "CounterHTOff": "0,1,2,3,4,5,6,7"
378 },
379 {
380 "EventCode": "0x85",
381 "Counter": "0,1,2,3",
382 "UMask": "0x60",
383 "EventName": "ITLB_MISSES.STLB_HIT",
384 "SampleAfterValue": "100003",
385 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks.",
386 "CounterHTOff": "0,1,2,3,4,5,6,7"
387 } 387 }
388] \ No newline at end of file 388] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/cache.json b/tools/perf/pmu-events/arch/x86/broadwellde/cache.json
index 36fe398029b9..bf243fe2a0ec 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/cache.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/cache.json
@@ -11,11 +11,28 @@
11 }, 11 },
12 { 12 {
13 "EventCode": "0x24", 13 "EventCode": "0x24",
14 "UMask": "0x41", 14 "UMask": "0x22",
15 "BriefDescription": "Demand Data Read requests that hit L2 cache", 15 "BriefDescription": "RFO requests that miss L2 cache.",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT", 17 "EventName": "L2_RQSTS.RFO_MISS",
18 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.", 18 "SampleAfterValue": "200003",
19 "CounterHTOff": "0,1,2,3,4,5,6,7"
20 },
21 {
22 "EventCode": "0x24",
23 "UMask": "0x24",
24 "BriefDescription": "L2 cache misses when fetching instructions.",
25 "Counter": "0,1,2,3",
26 "EventName": "L2_RQSTS.CODE_RD_MISS",
27 "SampleAfterValue": "200003",
28 "CounterHTOff": "0,1,2,3,4,5,6,7"
29 },
30 {
31 "EventCode": "0x24",
32 "UMask": "0x27",
33 "BriefDescription": "Demand requests that miss L2 cache.",
34 "Counter": "0,1,2,3",
35 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
19 "SampleAfterValue": "200003", 36 "SampleAfterValue": "200003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 37 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 38 },
@@ -31,6 +48,43 @@
31 }, 48 },
32 { 49 {
33 "EventCode": "0x24", 50 "EventCode": "0x24",
51 "UMask": "0x3f",
52 "BriefDescription": "All requests that miss L2 cache.",
53 "Counter": "0,1,2,3",
54 "EventName": "L2_RQSTS.MISS",
55 "SampleAfterValue": "200003",
56 "CounterHTOff": "0,1,2,3,4,5,6,7"
57 },
58 {
59 "EventCode": "0x24",
60 "UMask": "0x41",
61 "BriefDescription": "Demand Data Read requests that hit L2 cache",
62 "Counter": "0,1,2,3",
63 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT",
64 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.",
65 "SampleAfterValue": "200003",
66 "CounterHTOff": "0,1,2,3,4,5,6,7"
67 },
68 {
69 "EventCode": "0x24",
70 "UMask": "0x42",
71 "BriefDescription": "RFO requests that hit L2 cache.",
72 "Counter": "0,1,2,3",
73 "EventName": "L2_RQSTS.RFO_HIT",
74 "SampleAfterValue": "200003",
75 "CounterHTOff": "0,1,2,3,4,5,6,7"
76 },
77 {
78 "EventCode": "0x24",
79 "UMask": "0x44",
80 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
81 "Counter": "0,1,2,3",
82 "EventName": "L2_RQSTS.CODE_RD_HIT",
83 "SampleAfterValue": "200003",
84 "CounterHTOff": "0,1,2,3,4,5,6,7"
85 },
86 {
87 "EventCode": "0x24",
34 "UMask": "0x50", 88 "UMask": "0x50",
35 "BriefDescription": "L2 prefetch requests that hit L2 cache", 89 "BriefDescription": "L2 prefetch requests that hit L2 cache",
36 "Counter": "0,1,2,3", 90 "Counter": "0,1,2,3",
@@ -71,6 +125,15 @@
71 }, 125 },
72 { 126 {
73 "EventCode": "0x24", 127 "EventCode": "0x24",
128 "UMask": "0xe7",
129 "BriefDescription": "Demand requests to L2 cache.",
130 "Counter": "0,1,2,3",
131 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
132 "SampleAfterValue": "200003",
133 "CounterHTOff": "0,1,2,3,4,5,6,7"
134 },
135 {
136 "EventCode": "0x24",
74 "UMask": "0xf8", 137 "UMask": "0xf8",
75 "BriefDescription": "Requests from L2 hardware prefetchers", 138 "BriefDescription": "Requests from L2 hardware prefetchers",
76 "Counter": "0,1,2,3", 139 "Counter": "0,1,2,3",
@@ -80,6 +143,15 @@
80 "CounterHTOff": "0,1,2,3,4,5,6,7" 143 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 }, 144 },
82 { 145 {
146 "EventCode": "0x24",
147 "UMask": "0xff",
148 "BriefDescription": "All L2 requests.",
149 "Counter": "0,1,2,3",
150 "EventName": "L2_RQSTS.REFERENCES",
151 "SampleAfterValue": "200003",
152 "CounterHTOff": "0,1,2,3,4,5,6,7"
153 },
154 {
83 "EventCode": "0x27", 155 "EventCode": "0x27",
84 "UMask": "0x50", 156 "UMask": "0x50",
85 "BriefDescription": "Not rejected writebacks that hit L2 cache", 157 "BriefDescription": "Not rejected writebacks that hit L2 cache",
@@ -131,6 +203,27 @@
131 "CounterHTOff": "2" 203 "CounterHTOff": "2"
132 }, 204 },
133 { 205 {
206 "EventCode": "0x48",
207 "UMask": "0x1",
208 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
209 "Counter": "2",
210 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
211 "AnyThread": "1",
212 "CounterMask": "1",
213 "SampleAfterValue": "2000003",
214 "CounterHTOff": "2"
215 },
216 {
217 "EventCode": "0x48",
218 "UMask": "0x2",
219 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
220 "Counter": "0,1,2,3",
221 "EventName": "L1D_PEND_MISS.FB_FULL",
222 "CounterMask": "1",
223 "SampleAfterValue": "2000003",
224 "CounterHTOff": "0,1,2,3,4,5,6,7"
225 },
226 {
134 "EventCode": "0x51", 227 "EventCode": "0x51",
135 "UMask": "0x1", 228 "UMask": "0x1",
136 "BriefDescription": "L1D data line replacements", 229 "BriefDescription": "L1D data line replacements",
@@ -153,12 +246,35 @@
153 }, 246 },
154 { 247 {
155 "EventCode": "0x60", 248 "EventCode": "0x60",
249 "UMask": "0x1",
250 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
251 "Counter": "0,1,2,3",
252 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
253 "CounterMask": "1",
254 "Errata": "BDM76",
255 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).",
256 "SampleAfterValue": "2000003",
257 "CounterHTOff": "0,1,2,3,4,5,6,7"
258 },
259 {
260 "EventCode": "0x60",
261 "UMask": "0x1",
262 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
263 "Counter": "0,1,2,3",
264 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
265 "CounterMask": "6",
266 "Errata": "BDM76",
267 "SampleAfterValue": "2000003",
268 "CounterHTOff": "0,1,2,3,4,5,6,7"
269 },
270 {
271 "EventCode": "0x60",
156 "UMask": "0x2", 272 "UMask": "0x2",
157 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 273 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
158 "Counter": "0,1,2,3", 274 "Counter": "0,1,2,3",
159 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", 275 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
160 "Errata": "BDM76", 276 "Errata": "BDM76",
161 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The \"Offcore outstanding\" state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.", 277 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The Offcore outstanding state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
162 "SampleAfterValue": "2000003", 278 "SampleAfterValue": "2000003",
163 "CounterHTOff": "0,1,2,3,4,5,6,7" 279 "CounterHTOff": "0,1,2,3,4,5,6,7"
164 }, 280 },
@@ -175,24 +291,24 @@
175 }, 291 },
176 { 292 {
177 "EventCode": "0x60", 293 "EventCode": "0x60",
178 "UMask": "0x8", 294 "UMask": "0x4",
179 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore", 295 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
180 "Counter": "0,1,2,3", 296 "Counter": "0,1,2,3",
181 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 297 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
298 "CounterMask": "1",
182 "Errata": "BDM76", 299 "Errata": "BDM76",
183 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.", 300 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The Offcore outstanding state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
184 "SampleAfterValue": "2000003", 301 "SampleAfterValue": "2000003",
185 "CounterHTOff": "0,1,2,3,4,5,6,7" 302 "CounterHTOff": "0,1,2,3,4,5,6,7"
186 }, 303 },
187 { 304 {
188 "EventCode": "0x60", 305 "EventCode": "0x60",
189 "UMask": "0x1", 306 "UMask": "0x8",
190 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore", 307 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
191 "Counter": "0,1,2,3", 308 "Counter": "0,1,2,3",
192 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD", 309 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
193 "CounterMask": "1",
194 "Errata": "BDM76", 310 "Errata": "BDM76",
195 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).", 311 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
196 "SampleAfterValue": "2000003", 312 "SampleAfterValue": "2000003",
197 "CounterHTOff": "0,1,2,3,4,5,6,7" 313 "CounterHTOff": "0,1,2,3,4,5,6,7"
198 }, 314 },
@@ -209,18 +325,6 @@
209 "CounterHTOff": "0,1,2,3,4,5,6,7" 325 "CounterHTOff": "0,1,2,3,4,5,6,7"
210 }, 326 },
211 { 327 {
212 "EventCode": "0x60",
213 "UMask": "0x4",
214 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
215 "Counter": "0,1,2,3",
216 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
217 "CounterMask": "1",
218 "Errata": "BDM76",
219 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The \"Offcore outstanding\" state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
220 "SampleAfterValue": "2000003",
221 "CounterHTOff": "0,1,2,3,4,5,6,7"
222 },
223 {
224 "EventCode": "0x63", 328 "EventCode": "0x63",
225 "UMask": "0x2", 329 "UMask": "0x2",
226 "BriefDescription": "Cycles when L1D is locked", 330 "BriefDescription": "Cycles when L1D is locked",
@@ -266,7 +370,7 @@
266 "BriefDescription": "Demand and prefetch data reads", 370 "BriefDescription": "Demand and prefetch data reads",
267 "Counter": "0,1,2,3", 371 "Counter": "0,1,2,3",
268 "EventName": "OFFCORE_REQUESTS.ALL_DATA_RD", 372 "EventName": "OFFCORE_REQUESTS.ALL_DATA_RD",
269 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable \"Demands\" and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.", 373 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable Demands and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.",
270 "SampleAfterValue": "100003", 374 "SampleAfterValue": "100003",
271 "CounterHTOff": "0,1,2,3,4,5,6,7" 375 "CounterHTOff": "0,1,2,3,4,5,6,7"
272 }, 376 },
@@ -281,26 +385,35 @@
281 "CounterHTOff": "0,1,2,3,4,5,6,7" 385 "CounterHTOff": "0,1,2,3,4,5,6,7"
282 }, 386 },
283 { 387 {
388 "EventCode": "0xB7, 0xBB",
389 "UMask": "0x1",
390 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
391 "Counter": "0,1,2,3",
392 "EventName": "OFFCORE_RESPONSE",
393 "SampleAfterValue": "100003",
394 "CounterHTOff": "0,1,2,3"
395 },
396 {
284 "EventCode": "0xD0", 397 "EventCode": "0xD0",
285 "UMask": "0x11", 398 "UMask": "0x11",
286 "BriefDescription": "Retired load uops that miss the STLB.", 399 "BriefDescription": "Retired load uops that miss the STLB. (Precise Event - PEBS)",
287 "Data_LA": "1", 400 "Data_LA": "1",
288 "PEBS": "1", 401 "PEBS": "1",
289 "Counter": "0,1,2,3", 402 "Counter": "0,1,2,3",
290 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS", 403 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS",
291 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts load uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.", 404 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.",
292 "SampleAfterValue": "100003", 405 "SampleAfterValue": "100003",
293 "CounterHTOff": "0,1,2,3" 406 "CounterHTOff": "0,1,2,3"
294 }, 407 },
295 { 408 {
296 "EventCode": "0xD0", 409 "EventCode": "0xD0",
297 "UMask": "0x12", 410 "UMask": "0x12",
298 "BriefDescription": "Retired store uops that miss the STLB.", 411 "BriefDescription": "Retired store uops that miss the STLB. (Precise Event - PEBS)",
299 "Data_LA": "1", 412 "Data_LA": "1",
300 "PEBS": "1", 413 "PEBS": "1",
301 "Counter": "0,1,2,3", 414 "Counter": "0,1,2,3",
302 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 415 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
303 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts store uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.", 416 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts store uops true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.",
304 "SampleAfterValue": "100003", 417 "SampleAfterValue": "100003",
305 "L1_Hit_Indication": "1", 418 "L1_Hit_Indication": "1",
306 "CounterHTOff": "0,1,2,3" 419 "CounterHTOff": "0,1,2,3"
@@ -308,37 +421,37 @@
308 { 421 {
309 "EventCode": "0xD0", 422 "EventCode": "0xD0",
310 "UMask": "0x21", 423 "UMask": "0x21",
311 "BriefDescription": "Retired load uops with locked access.", 424 "BriefDescription": "Retired load uops with locked access. (Precise Event - PEBS)",
312 "Data_LA": "1", 425 "Data_LA": "1",
313 "PEBS": "1", 426 "PEBS": "1",
314 "Counter": "0,1,2,3", 427 "Counter": "0,1,2,3",
315 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 428 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
316 "Errata": "BDM35", 429 "Errata": "BDM35",
317 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts load uops with locked access retired to the architected path.", 430 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops with locked access retired to the architected path.",
318 "SampleAfterValue": "100007", 431 "SampleAfterValue": "100007",
319 "CounterHTOff": "0,1,2,3" 432 "CounterHTOff": "0,1,2,3"
320 }, 433 },
321 { 434 {
322 "EventCode": "0xD0", 435 "EventCode": "0xD0",
323 "UMask": "0x41", 436 "UMask": "0x41",
324 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 437 "BriefDescription": "Retired load uops that split across a cacheline boundary.(Precise Event - PEBS)",
325 "Data_LA": "1", 438 "Data_LA": "1",
326 "PEBS": "1", 439 "PEBS": "1",
327 "Counter": "0,1,2,3", 440 "Counter": "0,1,2,3",
328 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 441 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
329 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts line-splitted load uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).", 442 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts line-splitted load uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).",
330 "SampleAfterValue": "100003", 443 "SampleAfterValue": "100003",
331 "CounterHTOff": "0,1,2,3" 444 "CounterHTOff": "0,1,2,3"
332 }, 445 },
333 { 446 {
334 "EventCode": "0xD0", 447 "EventCode": "0xD0",
335 "UMask": "0x42", 448 "UMask": "0x42",
336 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 449 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event - PEBS)",
337 "Data_LA": "1", 450 "Data_LA": "1",
338 "PEBS": "1", 451 "PEBS": "1",
339 "Counter": "0,1,2,3", 452 "Counter": "0,1,2,3",
340 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 453 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
341 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts line-splitted store uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).", 454 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts line-splitted store uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).",
342 "SampleAfterValue": "100003", 455 "SampleAfterValue": "100003",
343 "L1_Hit_Indication": "1", 456 "L1_Hit_Indication": "1",
344 "CounterHTOff": "0,1,2,3" 457 "CounterHTOff": "0,1,2,3"
@@ -346,24 +459,24 @@
346 { 459 {
347 "EventCode": "0xD0", 460 "EventCode": "0xD0",
348 "UMask": "0x81", 461 "UMask": "0x81",
349 "BriefDescription": "All retired load uops.", 462 "BriefDescription": "All retired load uops. (Precise Event - PEBS)",
350 "Data_LA": "1", 463 "Data_LA": "1",
351 "PEBS": "1", 464 "PEBS": "1",
352 "Counter": "0,1,2,3", 465 "Counter": "0,1,2,3",
353 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 466 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
354 "PublicDescription": "This event counts load uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event counts AVX-256bit load/store double-pump memory uops as a single uop at retirement. This event also counts SW prefetches.", 467 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event ?ounts AVX-256bit load/store double-pump memory uops as a single uop at retirement. This event also counts SW prefetches.",
355 "SampleAfterValue": "2000003", 468 "SampleAfterValue": "2000003",
356 "CounterHTOff": "0,1,2,3" 469 "CounterHTOff": "0,1,2,3"
357 }, 470 },
358 { 471 {
359 "EventCode": "0xD0", 472 "EventCode": "0xD0",
360 "UMask": "0x82", 473 "UMask": "0x82",
361 "BriefDescription": "All retired store uops.", 474 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event - PEBS)",
362 "Data_LA": "1", 475 "Data_LA": "1",
363 "PEBS": "1", 476 "PEBS": "1",
364 "Counter": "0,1,2,3", 477 "Counter": "0,1,2,3",
365 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 478 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
366 "PublicDescription": "This event counts store uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event counts AVX-256bit load/store double-pump memory uops as a single uop at retirement.", 479 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts store uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event ?ounts AVX-256bit load/store double-pump memory uops as a single uop at retirement.",
367 "SampleAfterValue": "2000003", 480 "SampleAfterValue": "2000003",
368 "L1_Hit_Indication": "1", 481 "L1_Hit_Indication": "1",
369 "CounterHTOff": "0,1,2,3" 482 "CounterHTOff": "0,1,2,3"
@@ -371,69 +484,69 @@
371 { 484 {
372 "EventCode": "0xD1", 485 "EventCode": "0xD1",
373 "UMask": "0x1", 486 "UMask": "0x1",
374 "BriefDescription": "Retired load uops with L1 cache hits as data sources.", 487 "BriefDescription": "Retired load uops with L1 cache hits as data sources. (Precise Event - PEBS)",
375 "Data_LA": "1", 488 "Data_LA": "1",
376 "PEBS": "1", 489 "PEBS": "1",
377 "Counter": "0,1,2,3", 490 "Counter": "0,1,2,3",
378 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT", 491 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT",
379 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the nearest-level (L1) cache.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load. This event also counts SW prefetches independent of the actual data source.", 492 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data source were hits in the nearest-level (L1) cache.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load. This event also counts SW prefetches independent of the actual data source.",
380 "SampleAfterValue": "2000003", 493 "SampleAfterValue": "2000003",
381 "CounterHTOff": "0,1,2,3" 494 "CounterHTOff": "0,1,2,3"
382 }, 495 },
383 { 496 {
384 "EventCode": "0xD1", 497 "EventCode": "0xD1",
385 "UMask": "0x2", 498 "UMask": "0x2",
386 "BriefDescription": "Retired load uops with L2 cache hits as data sources.", 499 "BriefDescription": "Retired load uops with L2 cache hits as data sources. (Precise Event - PEBS)",
387 "Data_LA": "1", 500 "Data_LA": "1",
388 "PEBS": "1", 501 "PEBS": "1",
389 "Counter": "0,1,2,3", 502 "Counter": "0,1,2,3",
390 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 503 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT",
391 "Errata": "BDM35", 504 "Errata": "BDM35",
392 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the mid-level (L2) cache.", 505 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were hits in the mid-level (L2) cache.",
393 "SampleAfterValue": "100003", 506 "SampleAfterValue": "100003",
394 "CounterHTOff": "0,1,2,3" 507 "CounterHTOff": "0,1,2,3"
395 }, 508 },
396 { 509 {
397 "EventCode": "0xD1", 510 "EventCode": "0xD1",
398 "UMask": "0x4", 511 "UMask": "0x4",
399 "BriefDescription": "Retired load uops which data sources were data hits in L3 without snoops required.", 512 "BriefDescription": "Hit in last-level (L3) cache. Excludes Unknown data-source. (Precise Event - PEBS)",
400 "Data_LA": "1", 513 "Data_LA": "1",
401 "PEBS": "1", 514 "PEBS": "1",
402 "Counter": "0,1,2,3", 515 "Counter": "0,1,2,3",
403 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT", 516 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT",
404 "Errata": "BDM100", 517 "Errata": "BDM100",
405 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were data hits in the last-level (L3) cache without snoops required.", 518 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were data hits in the last-level (L3) cache without snoops required.",
406 "SampleAfterValue": "50021", 519 "SampleAfterValue": "50021",
407 "CounterHTOff": "0,1,2,3" 520 "CounterHTOff": "0,1,2,3"
408 }, 521 },
409 { 522 {
410 "EventCode": "0xD1", 523 "EventCode": "0xD1",
411 "UMask": "0x8", 524 "UMask": "0x8",
412 "BriefDescription": "Retired load uops misses in L1 cache as data sources.", 525 "BriefDescription": "Retired load uops misses in L1 cache as data sources. Uses PEBS.",
413 "Data_LA": "1", 526 "Data_LA": "1",
414 "PEBS": "1", 527 "PEBS": "1",
415 "Counter": "0,1,2,3", 528 "Counter": "0,1,2,3",
416 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 529 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
417 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were misses in the nearest-level (L1) cache. Counting excludes unknown and UC data source.", 530 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were misses in the nearest-level (L1) cache. Counting excludes unknown and UC data source.",
418 "SampleAfterValue": "100003", 531 "SampleAfterValue": "100003",
419 "CounterHTOff": "0,1,2,3" 532 "CounterHTOff": "0,1,2,3"
420 }, 533 },
421 { 534 {
422 "EventCode": "0xD1", 535 "EventCode": "0xD1",
423 "UMask": "0x10", 536 "UMask": "0x10",
424 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 537 "BriefDescription": "Retired load uops with L2 cache misses as data sources. Uses PEBS.",
425 "Data_LA": "1", 538 "Data_LA": "1",
426 "PEBS": "1", 539 "PEBS": "1",
427 "Counter": "0,1,2,3", 540 "Counter": "0,1,2,3",
428 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 541 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
429 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were misses in the mid-level (L2) cache. Counting excludes unknown and UC data source.", 542 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were misses in the mid-level (L2) cache. Counting excludes unknown and UC data source.",
430 "SampleAfterValue": "50021", 543 "SampleAfterValue": "50021",
431 "CounterHTOff": "0,1,2,3" 544 "CounterHTOff": "0,1,2,3"
432 }, 545 },
433 { 546 {
434 "EventCode": "0xD1", 547 "EventCode": "0xD1",
435 "UMask": "0x20", 548 "UMask": "0x20",
436 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source.", 549 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source. (Precise Event - PEBS).",
437 "Data_LA": "1", 550 "Data_LA": "1",
438 "PEBS": "1", 551 "PEBS": "1",
439 "Counter": "0,1,2,3", 552 "Counter": "0,1,2,3",
@@ -445,77 +558,112 @@
445 { 558 {
446 "EventCode": "0xD1", 559 "EventCode": "0xD1",
447 "UMask": "0x40", 560 "UMask": "0x40",
448 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.", 561 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready. (Precise Event - PEBS)",
449 "Data_LA": "1", 562 "Data_LA": "1",
450 "PEBS": "1", 563 "PEBS": "1",
451 "Counter": "0,1,2,3", 564 "Counter": "0,1,2,3",
452 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB", 565 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB",
453 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were load uops missed L1 but hit a fill buffer due to a preceding miss to the same cache line with the data not ready.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load.", 566 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were load uops missed L1 but hit a fill buffer due to a preceding miss to the same cache line with the data not ready.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load.",
454 "SampleAfterValue": "100003", 567 "SampleAfterValue": "100003",
455 "CounterHTOff": "0,1,2,3" 568 "CounterHTOff": "0,1,2,3"
456 }, 569 },
457 { 570 {
458 "EventCode": "0xD2", 571 "EventCode": "0xD2",
459 "UMask": "0x1", 572 "UMask": "0x1",
460 "BriefDescription": "Retired load uops which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.", 573 "BriefDescription": "Retired load uops which data sources were L3 hit and cross-core snoop missed in on-pkg core cache. (Precise Event - PEBS)",
461 "Data_LA": "1", 574 "Data_LA": "1",
462 "PEBS": "1", 575 "PEBS": "1",
463 "Counter": "0,1,2,3", 576 "Counter": "0,1,2,3",
464 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS", 577 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS",
465 "Errata": "BDM100", 578 "Errata": "BDM100",
466 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were L3 Hit and a cross-core snoop missed in the on-pkg core cache.", 579 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were L3 Hit and a cross-core snoop missed in the on-pkg core cache.",
467 "SampleAfterValue": "20011", 580 "SampleAfterValue": "20011",
468 "CounterHTOff": "0,1,2,3" 581 "CounterHTOff": "0,1,2,3"
469 }, 582 },
470 { 583 {
471 "EventCode": "0xD2", 584 "EventCode": "0xD2",
472 "UMask": "0x2", 585 "UMask": "0x2",
473 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache.", 586 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache. (Precise Event - PEBS)",
474 "Data_LA": "1", 587 "Data_LA": "1",
475 "PEBS": "1", 588 "PEBS": "1",
476 "Counter": "0,1,2,3", 589 "Counter": "0,1,2,3",
477 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT", 590 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT",
478 "Errata": "BDM100", 591 "Errata": "BDM100",
479 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were L3 hit and a cross-core snoop hit in the on-pkg core cache.", 592 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were L3 hit and a cross-core snoop hit in the on-pkg core cache.",
480 "SampleAfterValue": "20011", 593 "SampleAfterValue": "20011",
481 "CounterHTOff": "0,1,2,3" 594 "CounterHTOff": "0,1,2,3"
482 }, 595 },
483 { 596 {
484 "EventCode": "0xD2", 597 "EventCode": "0xD2",
485 "UMask": "0x4", 598 "UMask": "0x4",
486 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3.", 599 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3. (Precise Event - PEBS)",
487 "Data_LA": "1", 600 "Data_LA": "1",
488 "PEBS": "1", 601 "PEBS": "1",
489 "Counter": "0,1,2,3", 602 "Counter": "0,1,2,3",
490 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM", 603 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM",
491 "Errata": "BDM100", 604 "Errata": "BDM100",
492 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were HitM responses from a core on same socket (shared L3).", 605 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were HitM responses from a core on same socket (shared L3).",
493 "SampleAfterValue": "20011", 606 "SampleAfterValue": "20011",
494 "CounterHTOff": "0,1,2,3" 607 "CounterHTOff": "0,1,2,3"
495 }, 608 },
496 { 609 {
497 "EventCode": "0xD2", 610 "EventCode": "0xD2",
498 "UMask": "0x8", 611 "UMask": "0x8",
499 "BriefDescription": "Retired load uops which data sources were hits in L3 without snoops required.", 612 "BriefDescription": "Retired load uops which data sources were hits in L3 without snoops required. (Precise Event - PEBS)",
500 "Data_LA": "1", 613 "Data_LA": "1",
501 "PEBS": "1", 614 "PEBS": "1",
502 "Counter": "0,1,2,3", 615 "Counter": "0,1,2,3",
503 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE", 616 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE",
504 "Errata": "BDM100", 617 "Errata": "BDM100",
505 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the last-level (L3) cache without snoops required.", 618 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were hits in the last-level (L3) cache without snoops required.",
506 "SampleAfterValue": "100003", 619 "SampleAfterValue": "100003",
507 "CounterHTOff": "0,1,2,3" 620 "CounterHTOff": "0,1,2,3"
508 }, 621 },
509 { 622 {
510 "EventCode": "0xD3", 623 "EventCode": "0xD3",
511 "UMask": "0x1", 624 "UMask": "0x1",
512 "BriefDescription": "Data from local DRAM either Snoop not needed or Snoop Miss (RspI)",
513 "Data_LA": "1", 625 "Data_LA": "1",
514 "PEBS": "1", 626 "PEBS": "1",
515 "Counter": "0,1,2,3", 627 "Counter": "0,1,2,3",
516 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM", 628 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM",
517 "Errata": "BDE70, BDM100", 629 "Errata": "BDE70, BDM100",
518 "PublicDescription": "Retired load uop whose Data Source was: local DRAM either Snoop not needed or Snoop Miss (RspI).", 630 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches. This is a precise event.",
631 "SampleAfterValue": "100007",
632 "CounterHTOff": "0,1,2,3"
633 },
634 {
635 "EventCode": "0xD3",
636 "UMask": "0x4",
637 "BriefDescription": "Retired load uop whose Data Source was: remote DRAM either Snoop not needed or Snoop Miss (RspI) (Precise Event)",
638 "Data_LA": "1",
639 "PEBS": "1",
640 "Counter": "0,1,2,3",
641 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.REMOTE_DRAM",
642 "Errata": "BDE70",
643 "SampleAfterValue": "100007",
644 "CounterHTOff": "0,1,2,3"
645 },
646 {
647 "EventCode": "0xD3",
648 "UMask": "0x10",
649 "BriefDescription": "Retired load uop whose Data Source was: Remote cache HITM (Precise Event)",
650 "Data_LA": "1",
651 "PEBS": "1",
652 "Counter": "0,1,2,3",
653 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.REMOTE_HITM",
654 "Errata": "BDE70",
655 "SampleAfterValue": "100007",
656 "CounterHTOff": "0,1,2,3"
657 },
658 {
659 "EventCode": "0xD3",
660 "UMask": "0x20",
661 "BriefDescription": "Retired load uop whose Data Source was: forwarded from remote cache (Precise Event)",
662 "Data_LA": "1",
663 "PEBS": "1",
664 "Counter": "0,1,2,3",
665 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.REMOTE_FWD",
666 "Errata": "BDE70",
519 "SampleAfterValue": "100007", 667 "SampleAfterValue": "100007",
520 "CounterHTOff": "0,1,2,3" 668 "CounterHTOff": "0,1,2,3"
521 }, 669 },
@@ -657,118 +805,5 @@
657 "PublicDescription": "This event counts the number of split locks in the super queue.", 805 "PublicDescription": "This event counts the number of split locks in the super queue.",
658 "SampleAfterValue": "100003", 806 "SampleAfterValue": "100003",
659 "CounterHTOff": "0,1,2,3,4,5,6,7" 807 "CounterHTOff": "0,1,2,3,4,5,6,7"
660 },
661 {
662 "EventCode": "0x24",
663 "UMask": "0x42",
664 "BriefDescription": "RFO requests that hit L2 cache.",
665 "Counter": "0,1,2,3",
666 "EventName": "L2_RQSTS.RFO_HIT",
667 "SampleAfterValue": "200003",
668 "CounterHTOff": "0,1,2,3,4,5,6,7"
669 },
670 {
671 "EventCode": "0x24",
672 "UMask": "0x22",
673 "BriefDescription": "RFO requests that miss L2 cache.",
674 "Counter": "0,1,2,3",
675 "EventName": "L2_RQSTS.RFO_MISS",
676 "SampleAfterValue": "200003",
677 "CounterHTOff": "0,1,2,3,4,5,6,7"
678 },
679 {
680 "EventCode": "0x24",
681 "UMask": "0x44",
682 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
683 "Counter": "0,1,2,3",
684 "EventName": "L2_RQSTS.CODE_RD_HIT",
685 "SampleAfterValue": "200003",
686 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 },
688 {
689 "EventCode": "0x24",
690 "UMask": "0x24",
691 "BriefDescription": "L2 cache misses when fetching instructions.",
692 "Counter": "0,1,2,3",
693 "EventName": "L2_RQSTS.CODE_RD_MISS",
694 "SampleAfterValue": "200003",
695 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 },
697 {
698 "EventCode": "0x24",
699 "UMask": "0x27",
700 "BriefDescription": "Demand requests that miss L2 cache.",
701 "Counter": "0,1,2,3",
702 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
703 "SampleAfterValue": "200003",
704 "CounterHTOff": "0,1,2,3,4,5,6,7"
705 },
706 {
707 "EventCode": "0x24",
708 "UMask": "0xe7",
709 "BriefDescription": "Demand requests to L2 cache.",
710 "Counter": "0,1,2,3",
711 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
712 "SampleAfterValue": "200003",
713 "CounterHTOff": "0,1,2,3,4,5,6,7"
714 },
715 {
716 "EventCode": "0x24",
717 "UMask": "0x3f",
718 "BriefDescription": "All requests that miss L2 cache.",
719 "Counter": "0,1,2,3",
720 "EventName": "L2_RQSTS.MISS",
721 "SampleAfterValue": "200003",
722 "CounterHTOff": "0,1,2,3,4,5,6,7"
723 },
724 {
725 "EventCode": "0x24",
726 "UMask": "0xff",
727 "BriefDescription": "All L2 requests.",
728 "Counter": "0,1,2,3",
729 "EventName": "L2_RQSTS.REFERENCES",
730 "SampleAfterValue": "200003",
731 "CounterHTOff": "0,1,2,3,4,5,6,7"
732 },
733 {
734 "EventCode": "0xB7, 0xBB",
735 "UMask": "0x1",
736 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
737 "Counter": "0,1,2,3",
738 "EventName": "OFFCORE_RESPONSE",
739 "SampleAfterValue": "100003",
740 "CounterHTOff": "0,1,2,3"
741 },
742 {
743 "EventCode": "0x60",
744 "UMask": "0x1",
745 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
746 "Counter": "0,1,2,3",
747 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
748 "CounterMask": "6",
749 "Errata": "BDM76",
750 "SampleAfterValue": "2000003",
751 "CounterHTOff": "0,1,2,3,4,5,6,7"
752 },
753 {
754 "EventCode": "0x48",
755 "UMask": "0x1",
756 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
757 "Counter": "2",
758 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
759 "AnyThread": "1",
760 "CounterMask": "1",
761 "SampleAfterValue": "2000003",
762 "CounterHTOff": "2"
763 },
764 {
765 "EventCode": "0x48",
766 "UMask": "0x2",
767 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
768 "Counter": "0,1,2,3",
769 "EventName": "L1D_PEND_MISS.FB_FULL",
770 "CounterMask": "1",
771 "SampleAfterValue": "2000003",
772 "CounterHTOff": "0,1,2,3,4,5,6,7"
773 } 808 }
774] \ No newline at end of file 809] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/floating-point.json b/tools/perf/pmu-events/arch/x86/broadwellde/floating-point.json
index 4ae1ea24f22f..d7b9d9c9c518 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/floating-point.json
@@ -6,7 +6,7 @@
6 "Counter": "0,1,2,3", 6 "Counter": "0,1,2,3",
7 "EventName": "OTHER_ASSISTS.AVX_TO_SSE", 7 "EventName": "OTHER_ASSISTS.AVX_TO_SSE",
8 "Errata": "BDM30", 8 "Errata": "BDM30",
9 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of transitions from AVX-256 to legacy SSE when penalty is applicable.", 9 "PublicDescription": "This event counts the number of transitions from AVX-256 to legacy SSE when penalty is applicable.",
10 "SampleAfterValue": "100003", 10 "SampleAfterValue": "100003",
11 "CounterHTOff": "0,1,2,3,4,5,6,7" 11 "CounterHTOff": "0,1,2,3,4,5,6,7"
12 }, 12 },
@@ -17,7 +17,7 @@
17 "Counter": "0,1,2,3", 17 "Counter": "0,1,2,3",
18 "EventName": "OTHER_ASSISTS.SSE_TO_AVX", 18 "EventName": "OTHER_ASSISTS.SSE_TO_AVX",
19 "Errata": "BDM30", 19 "Errata": "BDM30",
20 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of transitions from legacy SSE to AVX-256 when penalty is applicable.", 20 "PublicDescription": "This event counts the number of transitions from legacy SSE to AVX-256 when penalty is applicable.",
21 "SampleAfterValue": "100003", 21 "SampleAfterValue": "100003",
22 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
23 }, 23 },
@@ -25,7 +25,6 @@
25 "EventCode": "0xC7", 25 "EventCode": "0xC7",
26 "UMask": "0x1", 26 "UMask": "0x1",
27 "BriefDescription": "Number of SSE/AVX computational scalar double precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 27 "BriefDescription": "Number of SSE/AVX computational scalar double precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
28 "PEBS": "1",
29 "Counter": "0,1,2,3", 28 "Counter": "0,1,2,3",
30 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_DOUBLE", 29 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_DOUBLE",
31 "SampleAfterValue": "2000003", 30 "SampleAfterValue": "2000003",
@@ -35,7 +34,6 @@
35 "EventCode": "0xC7", 34 "EventCode": "0xC7",
36 "UMask": "0x2", 35 "UMask": "0x2",
37 "BriefDescription": "Number of SSE/AVX computational scalar single precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 36 "BriefDescription": "Number of SSE/AVX computational scalar single precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
38 "PEBS": "1",
39 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
40 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_SINGLE", 38 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_SINGLE",
41 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
@@ -43,9 +41,17 @@
43 }, 41 },
44 { 42 {
45 "EventCode": "0xC7", 43 "EventCode": "0xC7",
44 "UMask": "0x3",
45 "BriefDescription": "Number of SSE/AVX computational scalar floating-point instructions retired. Applies to SSE* and AVX* scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
46 "Counter": "0,1,2,3",
47 "EventName": "FP_ARITH_INST_RETIRED.SCALAR",
48 "SampleAfterValue": "2000003",
49 "CounterHTOff": "0,1,2,3"
50 },
51 {
52 "EventCode": "0xC7",
46 "UMask": "0x4", 53 "UMask": "0x4",
47 "BriefDescription": "Number of SSE/AVX computational 128-bit packed double precision floating-point instructions retired. Each count represents 2 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 54 "BriefDescription": "Number of SSE/AVX computational 128-bit packed double precision floating-point instructions retired. Each count represents 2 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
48 "PEBS": "1",
49 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
50 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_DOUBLE", 56 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_DOUBLE",
51 "SampleAfterValue": "2000003", 57 "SampleAfterValue": "2000003",
@@ -55,7 +61,6 @@
55 "EventCode": "0xC7", 61 "EventCode": "0xC7",
56 "UMask": "0x8", 62 "UMask": "0x8",
57 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 63 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
58 "PEBS": "1",
59 "Counter": "0,1,2,3", 64 "Counter": "0,1,2,3",
60 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE", 65 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE",
61 "SampleAfterValue": "2000003", 66 "SampleAfterValue": "2000003",
@@ -65,19 +70,54 @@
65 "EventCode": "0xC7", 70 "EventCode": "0xC7",
66 "UMask": "0x10", 71 "UMask": "0x10",
67 "BriefDescription": "Number of SSE/AVX computational 256-bit packed double precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 72 "BriefDescription": "Number of SSE/AVX computational 256-bit packed double precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
68 "PEBS": "1",
69 "Counter": "0,1,2,3", 73 "Counter": "0,1,2,3",
70 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE", 74 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE",
71 "SampleAfterValue": "2000003", 75 "SampleAfterValue": "2000003",
72 "CounterHTOff": "0,1,2,3" 76 "CounterHTOff": "0,1,2,3"
73 }, 77 },
74 { 78 {
79 "EventCode": "0xC7",
80 "UMask": "0x15",
81 "BriefDescription": "Number of SSE/AVX computational double precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
82 "Counter": "0,1,2,3",
83 "EventName": "FP_ARITH_INST_RETIRED.DOUBLE",
84 "SampleAfterValue": "2000006",
85 "CounterHTOff": "0,1,2,3"
86 },
87 {
88 "EventCode": "0xc7",
89 "UMask": "0x20",
90 "BriefDescription": "Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired. Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
91 "Counter": "0,1,2,3",
92 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE",
93 "SampleAfterValue": "2000003",
94 "CounterHTOff": "0,1,2,3"
95 },
96 {
97 "EventCode": "0xC7",
98 "UMask": "0x2a",
99 "BriefDescription": "Number of SSE/AVX computational single precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
100 "Counter": "0,1,2,3",
101 "EventName": "FP_ARITH_INST_RETIRED.SINGLE",
102 "SampleAfterValue": "2000005",
103 "CounterHTOff": "0,1,2,3"
104 },
105 {
106 "EventCode": "0xC7",
107 "UMask": "0x3c",
108 "BriefDescription": "Number of SSE/AVX computational packed floating-point instructions retired. Applies to SSE* and AVX*, packed, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
109 "Counter": "0,1,2,3",
110 "EventName": "FP_ARITH_INST_RETIRED.PACKED",
111 "SampleAfterValue": "2000004",
112 "CounterHTOff": "0,1,2,3"
113 },
114 {
75 "EventCode": "0xCA", 115 "EventCode": "0xCA",
76 "UMask": "0x2", 116 "UMask": "0x2",
77 "BriefDescription": "Number of X87 assists due to output value.", 117 "BriefDescription": "Number of X87 assists due to output value.",
78 "Counter": "0,1,2,3", 118 "Counter": "0,1,2,3",
79 "EventName": "FP_ASSIST.X87_OUTPUT", 119 "EventName": "FP_ASSIST.X87_OUTPUT",
80 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of x87 floating point (FP) micro-code assist (numeric overflow/underflow, inexact result) when the output value (destination register) is invalid.", 120 "PublicDescription": "This event counts the number of x87 floating point (FP) micro-code assist (numeric overflow/underflow, inexact result) when the output value (destination register) is invalid.",
81 "SampleAfterValue": "100003", 121 "SampleAfterValue": "100003",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 122 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 123 },
@@ -87,7 +127,7 @@
87 "BriefDescription": "Number of X87 assists due to input value.", 127 "BriefDescription": "Number of X87 assists due to input value.",
88 "Counter": "0,1,2,3", 128 "Counter": "0,1,2,3",
89 "EventName": "FP_ASSIST.X87_INPUT", 129 "EventName": "FP_ASSIST.X87_INPUT",
90 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts x87 floating point (FP) micro-code assist (invalid operation, denormal operand, SNaN operand) when the input value (one of the source operands to an FP instruction) is invalid.", 130 "PublicDescription": "This event counts x87 floating point (FP) micro-code assist (invalid operation, denormal operand, SNaN operand) when the input value (one of the source operands to an FP instruction) is invalid.",
91 "SampleAfterValue": "100003", 131 "SampleAfterValue": "100003",
92 "CounterHTOff": "0,1,2,3,4,5,6,7" 132 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 }, 133 },
@@ -97,7 +137,7 @@
97 "BriefDescription": "Number of SIMD FP assists due to Output values", 137 "BriefDescription": "Number of SIMD FP assists due to Output values",
98 "Counter": "0,1,2,3", 138 "Counter": "0,1,2,3",
99 "EventName": "FP_ASSIST.SIMD_OUTPUT", 139 "EventName": "FP_ASSIST.SIMD_OUTPUT",
100 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of SSE* floating point (FP) micro-code assist (numeric overflow/underflow) when the output value (destination register) is invalid. Counting covers only cases involving penalties that require micro-code assist intervention.", 140 "PublicDescription": "This event counts the number of SSE* floating point (FP) micro-code assist (numeric overflow/underflow) when the output value (destination register) is invalid. Counting covers only cases involving penalties that require micro-code assist intervention.",
101 "SampleAfterValue": "100003", 141 "SampleAfterValue": "100003",
102 "CounterHTOff": "0,1,2,3,4,5,6,7" 142 "CounterHTOff": "0,1,2,3,4,5,6,7"
103 }, 143 },
@@ -107,7 +147,7 @@
107 "BriefDescription": "Number of SIMD FP assists due to input values", 147 "BriefDescription": "Number of SIMD FP assists due to input values",
108 "Counter": "0,1,2,3", 148 "Counter": "0,1,2,3",
109 "EventName": "FP_ASSIST.SIMD_INPUT", 149 "EventName": "FP_ASSIST.SIMD_INPUT",
110 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts any input SSE* FP assist - invalid operation, denormal operand, dividing by zero, SNaN operand. Counting includes only cases involving penalties that required micro-code assist intervention.", 150 "PublicDescription": "This event counts any input SSE* FP assist - invalid operation, denormal operand, dividing by zero, SNaN operand. Counting includes only cases involving penalties that required micro-code assist intervention.",
111 "SampleAfterValue": "100003", 151 "SampleAfterValue": "100003",
112 "CounterHTOff": "0,1,2,3,4,5,6,7" 152 "CounterHTOff": "0,1,2,3,4,5,6,7"
113 }, 153 },
@@ -121,51 +161,5 @@
121 "PublicDescription": "This event counts cycles with any input and output SSE or x87 FP assist. If an input and output assist are detected on the same cycle the event increments by 1.", 161 "PublicDescription": "This event counts cycles with any input and output SSE or x87 FP assist. If an input and output assist are detected on the same cycle the event increments by 1.",
122 "SampleAfterValue": "100003", 162 "SampleAfterValue": "100003",
123 "CounterHTOff": "0,1,2,3" 163 "CounterHTOff": "0,1,2,3"
124 },
125 {
126 "EventCode": "0xc7",
127 "UMask": "0x20",
128 "BriefDescription": "Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired. Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
129 "PEBS": "1",
130 "Counter": "0,1,2,3",
131 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE",
132 "SampleAfterValue": "2000003",
133 "CounterHTOff": "0,1,2,3"
134 },
135 {
136 "EventCode": "0xC7",
137 "UMask": "0x3",
138 "BriefDescription": "Number of SSE/AVX computational scalar floating-point instructions retired. Applies to SSE* and AVX* scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
139 "Counter": "0,1,2,3",
140 "EventName": "FP_ARITH_INST_RETIRED.SCALAR",
141 "SampleAfterValue": "2000003",
142 "CounterHTOff": "0,1,2,3"
143 },
144 {
145 "EventCode": "0xC7",
146 "UMask": "0x3c",
147 "BriefDescription": "Number of SSE/AVX computational packed floating-point instructions retired. Applies to SSE* and AVX*, packed, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
148 "Counter": "0,1,2,3",
149 "EventName": "FP_ARITH_INST_RETIRED.PACKED",
150 "SampleAfterValue": "2000004",
151 "CounterHTOff": "0,1,2,3"
152 },
153 {
154 "EventCode": "0xC7",
155 "UMask": "0x2a",
156 "BriefDescription": "Number of SSE/AVX computational single precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
157 "Counter": "0,1,2,3",
158 "EventName": "FP_ARITH_INST_RETIRED.SINGLE",
159 "SampleAfterValue": "2000005",
160 "CounterHTOff": "0,1,2,3"
161 },
162 {
163 "EventCode": "0xC7",
164 "UMask": "0x15",
165 "BriefDescription": "Number of SSE/AVX computational double precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
166 "Counter": "0,1,2,3",
167 "EventName": "FP_ARITH_INST_RETIRED.DOUBLE",
168 "SampleAfterValue": "2000006",
169 "CounterHTOff": "0,1,2,3"
170 } 164 }
171] \ No newline at end of file 165] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/frontend.json b/tools/perf/pmu-events/arch/x86/broadwellde/frontend.json
index 06bf0a40e568..72781e1e3362 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/frontend.json
@@ -15,80 +15,49 @@
15 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path", 15 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "EventName": "IDQ.MITE_UOPS", 17 "EventName": "IDQ.MITE_UOPS",
18 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 18 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "EventCode": "0x79", 23 "EventCode": "0x79",
24 "UMask": "0x8", 24 "UMask": "0x4",
25 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path", 25 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path",
26 "Counter": "0,1,2,3",
27 "EventName": "IDQ.DSB_UOPS",
28 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.",
29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
33 "EventCode": "0x79",
34 "UMask": "0x10",
35 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
36 "Counter": "0,1,2,3",
37 "EventName": "IDQ.MS_DSB_UOPS",
38 "PublicDescription": "This event counts the number of uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.",
39 "SampleAfterValue": "2000003",
40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 },
42 {
43 "EventCode": "0x79",
44 "UMask": "0x20",
45 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
46 "Counter": "0,1,2,3",
47 "EventName": "IDQ.MS_MITE_UOPS",
48 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.",
49 "SampleAfterValue": "2000003",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
53 "EventCode": "0x79",
54 "UMask": "0x30",
55 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
56 "Counter": "0,1,2,3", 26 "Counter": "0,1,2,3",
57 "EventName": "IDQ.MS_UOPS", 27 "EventName": "IDQ.MITE_CYCLES",
58 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.", 28 "CounterMask": "1",
29 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ.",
59 "SampleAfterValue": "2000003", 30 "SampleAfterValue": "2000003",
60 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 }, 32 },
62 { 33 {
63 "EventCode": "0x79", 34 "EventCode": "0x79",
64 "UMask": "0x30", 35 "UMask": "0x8",
65 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 36 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
66 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
67 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
68 "CounterMask": "1", 39 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
69 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
70 "SampleAfterValue": "2000003", 40 "SampleAfterValue": "2000003",
71 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
72 }, 42 },
73 { 43 {
74 "EventCode": "0x79", 44 "EventCode": "0x79",
75 "UMask": "0x4", 45 "UMask": "0x8",
76 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path", 46 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path",
77 "Counter": "0,1,2,3", 47 "Counter": "0,1,2,3",
78 "EventName": "IDQ.MITE_CYCLES", 48 "EventName": "IDQ.DSB_CYCLES",
79 "CounterMask": "1", 49 "CounterMask": "1",
80 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ.", 50 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
81 "SampleAfterValue": "2000003", 51 "SampleAfterValue": "2000003",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 52 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 53 },
84 { 54 {
85 "EventCode": "0x79", 55 "EventCode": "0x79",
86 "UMask": "0x8", 56 "UMask": "0x10",
87 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path", 57 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
88 "Counter": "0,1,2,3", 58 "Counter": "0,1,2,3",
89 "EventName": "IDQ.DSB_CYCLES", 59 "EventName": "IDQ.MS_DSB_UOPS",
90 "CounterMask": "1", 60 "PublicDescription": "This event counts the number of uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
91 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.",
92 "SampleAfterValue": "2000003", 61 "SampleAfterValue": "2000003",
93 "CounterHTOff": "0,1,2,3,4,5,6,7" 62 "CounterHTOff": "0,1,2,3,4,5,6,7"
94 }, 63 },
@@ -99,7 +68,7 @@
99 "Counter": "0,1,2,3", 68 "Counter": "0,1,2,3",
100 "EventName": "IDQ.MS_DSB_CYCLES", 69 "EventName": "IDQ.MS_DSB_CYCLES",
101 "CounterMask": "1", 70 "CounterMask": "1",
102 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.", 71 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
103 "SampleAfterValue": "2000003", 72 "SampleAfterValue": "2000003",
104 "CounterHTOff": "0,1,2,3,4,5,6,7" 73 "CounterHTOff": "0,1,2,3,4,5,6,7"
105 }, 74 },
@@ -111,7 +80,7 @@
111 "Counter": "0,1,2,3", 80 "Counter": "0,1,2,3",
112 "EventName": "IDQ.MS_DSB_OCCUR", 81 "EventName": "IDQ.MS_DSB_OCCUR",
113 "CounterMask": "1", 82 "CounterMask": "1",
114 "PublicDescription": "This event counts the number of deliveries to Instruction Decode Queue (IDQ) initiated by Decode Stream Buffer (DSB) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.", 83 "PublicDescription": "This event counts the number of deliveries to Instruction Decode Queue (IDQ) initiated by Decode Stream Buffer (DSB) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
115 "SampleAfterValue": "2000003", 84 "SampleAfterValue": "2000003",
116 "CounterHTOff": "0,1,2,3,4,5,6,7" 85 "CounterHTOff": "0,1,2,3,4,5,6,7"
117 }, 86 },
@@ -122,7 +91,7 @@
122 "Counter": "0,1,2,3", 91 "Counter": "0,1,2,3",
123 "EventName": "IDQ.ALL_DSB_CYCLES_4_UOPS", 92 "EventName": "IDQ.ALL_DSB_CYCLES_4_UOPS",
124 "CounterMask": "4", 93 "CounterMask": "4",
125 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 94 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
126 "SampleAfterValue": "2000003", 95 "SampleAfterValue": "2000003",
127 "CounterHTOff": "0,1,2,3,4,5,6,7" 96 "CounterHTOff": "0,1,2,3,4,5,6,7"
128 }, 97 },
@@ -133,7 +102,17 @@
133 "Counter": "0,1,2,3", 102 "Counter": "0,1,2,3",
134 "EventName": "IDQ.ALL_DSB_CYCLES_ANY_UOPS", 103 "EventName": "IDQ.ALL_DSB_CYCLES_ANY_UOPS",
135 "CounterMask": "1", 104 "CounterMask": "1",
136 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 105 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
106 "SampleAfterValue": "2000003",
107 "CounterHTOff": "0,1,2,3,4,5,6,7"
108 },
109 {
110 "EventCode": "0x79",
111 "UMask": "0x20",
112 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
113 "Counter": "0,1,2,3",
114 "EventName": "IDQ.MS_MITE_UOPS",
115 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ.",
137 "SampleAfterValue": "2000003", 116 "SampleAfterValue": "2000003",
138 "CounterHTOff": "0,1,2,3,4,5,6,7" 117 "CounterHTOff": "0,1,2,3,4,5,6,7"
139 }, 118 },
@@ -144,7 +123,7 @@
144 "Counter": "0,1,2,3", 123 "Counter": "0,1,2,3",
145 "EventName": "IDQ.ALL_MITE_CYCLES_4_UOPS", 124 "EventName": "IDQ.ALL_MITE_CYCLES_4_UOPS",
146 "CounterMask": "4", 125 "CounterMask": "4",
147 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 126 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
148 "SampleAfterValue": "2000003", 127 "SampleAfterValue": "2000003",
149 "CounterHTOff": "0,1,2,3,4,5,6,7" 128 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 }, 129 },
@@ -155,7 +134,39 @@
155 "Counter": "0,1,2,3", 134 "Counter": "0,1,2,3",
156 "EventName": "IDQ.ALL_MITE_CYCLES_ANY_UOPS", 135 "EventName": "IDQ.ALL_MITE_CYCLES_ANY_UOPS",
157 "CounterMask": "1", 136 "CounterMask": "1",
158 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 137 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
138 "SampleAfterValue": "2000003",
139 "CounterHTOff": "0,1,2,3,4,5,6,7"
140 },
141 {
142 "EventCode": "0x79",
143 "UMask": "0x30",
144 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
145 "Counter": "0,1,2,3",
146 "EventName": "IDQ.MS_UOPS",
147 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
148 "SampleAfterValue": "2000003",
149 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 },
151 {
152 "EventCode": "0x79",
153 "UMask": "0x30",
154 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
155 "Counter": "0,1,2,3",
156 "EventName": "IDQ.MS_CYCLES",
157 "CounterMask": "1",
158 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
159 "SampleAfterValue": "2000003",
160 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 },
162 {
163 "EdgeDetect": "1",
164 "EventCode": "0x79",
165 "UMask": "0x30",
166 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
167 "Counter": "0,1,2,3",
168 "EventName": "IDQ.MS_SWITCHES",
169 "CounterMask": "1",
159 "SampleAfterValue": "2000003", 170 "SampleAfterValue": "2000003",
160 "CounterHTOff": "0,1,2,3,4,5,6,7" 171 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 }, 172 },
@@ -165,7 +176,7 @@
165 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path", 176 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path",
166 "Counter": "0,1,2,3", 177 "Counter": "0,1,2,3",
167 "EventName": "IDQ.MITE_ALL_UOPS", 178 "EventName": "IDQ.MITE_ALL_UOPS",
168 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 179 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
169 "SampleAfterValue": "2000003", 180 "SampleAfterValue": "2000003",
170 "CounterHTOff": "0,1,2,3,4,5,6,7" 181 "CounterHTOff": "0,1,2,3,4,5,6,7"
171 }, 182 },
@@ -205,7 +216,7 @@
205 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled", 216 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled",
206 "Counter": "0,1,2,3", 217 "Counter": "0,1,2,3",
207 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE", 218 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE",
208 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding ?4 ? x? when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread;\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions); \n c. Instruction Decode Queue (IDQ) delivers four uops.", 219 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding 4 x when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread;\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions); \n c. Instruction Decode Queue (IDQ) delivers four uops.",
209 "SampleAfterValue": "2000003", 220 "SampleAfterValue": "2000003",
210 "CounterHTOff": "0,1,2,3" 221 "CounterHTOff": "0,1,2,3"
211 }, 222 },
@@ -268,18 +279,7 @@
268 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.", 279 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.",
269 "Counter": "0,1,2,3", 280 "Counter": "0,1,2,3",
270 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES", 281 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES",
271 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 0?2 cycles.", 282 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 02 cycles.",
272 "SampleAfterValue": "2000003",
273 "CounterHTOff": "0,1,2,3,4,5,6,7"
274 },
275 {
276 "EdgeDetect": "1",
277 "EventCode": "0x79",
278 "UMask": "0x30",
279 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
280 "Counter": "0,1,2,3",
281 "EventName": "IDQ.MS_SWITCHES",
282 "CounterMask": "1",
283 "SampleAfterValue": "2000003", 283 "SampleAfterValue": "2000003",
284 "CounterHTOff": "0,1,2,3,4,5,6,7" 284 "CounterHTOff": "0,1,2,3,4,5,6,7"
285 } 285 }
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/memory.json b/tools/perf/pmu-events/arch/x86/broadwellde/memory.json
index cfa1e5876ec3..e44f73c24ac8 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/memory.json
@@ -95,7 +95,6 @@
95 "BriefDescription": "Counts the number of times a class of instructions that may cause a transactional abort was executed. Since this is the count of execution, it may not always cause a transactional abort.", 95 "BriefDescription": "Counts the number of times a class of instructions that may cause a transactional abort was executed. Since this is the count of execution, it may not always cause a transactional abort.",
96 "Counter": "0,1,2,3", 96 "Counter": "0,1,2,3",
97 "EventName": "TX_EXEC.MISC1", 97 "EventName": "TX_EXEC.MISC1",
98 "PublicDescription": "Unfriendly TSX abort triggered by a flowmarker.",
99 "SampleAfterValue": "2000003", 98 "SampleAfterValue": "2000003",
100 "CounterHTOff": "0,1,2,3,4,5,6,7" 99 "CounterHTOff": "0,1,2,3,4,5,6,7"
101 }, 100 },
@@ -171,11 +170,11 @@
171 { 170 {
172 "EventCode": "0xc8", 171 "EventCode": "0xc8",
173 "UMask": "0x4", 172 "UMask": "0x4",
174 "BriefDescription": "Number of times HLE abort was triggered", 173 "BriefDescription": "Number of times HLE abort was triggered (PEBS)",
175 "PEBS": "1", 174 "PEBS": "1",
176 "Counter": "0,1,2,3", 175 "Counter": "0,1,2,3",
177 "EventName": "HLE_RETIRED.ABORTED", 176 "EventName": "HLE_RETIRED.ABORTED",
178 "PublicDescription": "Number of times HLE abort was triggered.", 177 "PublicDescription": "Number of times HLE abort was triggered (PEBS).",
179 "SampleAfterValue": "2000003", 178 "SampleAfterValue": "2000003",
180 "CounterHTOff": "0,1,2,3,4,5,6,7" 179 "CounterHTOff": "0,1,2,3,4,5,6,7"
181 }, 180 },
@@ -252,11 +251,11 @@
252 { 251 {
253 "EventCode": "0xc9", 252 "EventCode": "0xc9",
254 "UMask": "0x4", 253 "UMask": "0x4",
255 "BriefDescription": "Number of times RTM abort was triggered", 254 "BriefDescription": "Number of times RTM abort was triggered (PEBS)",
256 "PEBS": "1", 255 "PEBS": "1",
257 "Counter": "0,1,2,3", 256 "Counter": "0,1,2,3",
258 "EventName": "RTM_RETIRED.ABORTED", 257 "EventName": "RTM_RETIRED.ABORTED",
259 "PublicDescription": "Number of times RTM abort was triggered .", 258 "PublicDescription": "Number of times RTM abort was triggered (PEBS).",
260 "SampleAfterValue": "2000003", 259 "SampleAfterValue": "2000003",
261 "CounterHTOff": "0,1,2,3" 260 "CounterHTOff": "0,1,2,3"
262 }, 261 },
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/other.json b/tools/perf/pmu-events/arch/x86/broadwellde/other.json
index 718fcb1db2ee..4475249ea9da 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/other.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "EventCode": "0x5C",
14 "UMask": "0x2",
15 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
16 "Counter": "0,1,2,3",
17 "EventName": "CPL_CYCLES.RING123",
18 "PublicDescription": "This event counts unhalted core cycles during which the thread is in rings 1, 2, or 3.",
19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "EdgeDetect": "1", 13 "EdgeDetect": "1",
24 "EventCode": "0x5C", 14 "EventCode": "0x5C",
25 "UMask": "0x1", 15 "UMask": "0x1",
@@ -32,6 +22,16 @@
32 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 }, 23 },
34 { 24 {
25 "EventCode": "0x5C",
26 "UMask": "0x2",
27 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
28 "Counter": "0,1,2,3",
29 "EventName": "CPL_CYCLES.RING123",
30 "PublicDescription": "This event counts unhalted core cycles during which the thread is in rings 1, 2, or 3.",
31 "SampleAfterValue": "2000003",
32 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 },
34 {
35 "EventCode": "0x63", 35 "EventCode": "0x63",
36 "UMask": "0x1", 36 "UMask": "0x1",
37 "BriefDescription": "Cycles when L1 and L2 are locked due to UC or split lock", 37 "BriefDescription": "Cycles when L1 and L2 are locked due to UC or split lock",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/pipeline.json b/tools/perf/pmu-events/arch/x86/broadwellde/pipeline.json
index 02b4e1035f2d..920c89da9111 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/pipeline.json
@@ -3,31 +3,41 @@
3 "EventCode": "0x00", 3 "EventCode": "0x00",
4 "UMask": "0x1", 4 "UMask": "0x1",
5 "BriefDescription": "Instructions retired from execution.", 5 "BriefDescription": "Instructions retired from execution.",
6 "Counter": "Fixed counter 1", 6 "Counter": "Fixed counter 0",
7 "EventName": "INST_RETIRED.ANY", 7 "EventName": "INST_RETIRED.ANY",
8 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 8 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
9 "SampleAfterValue": "2000003", 9 "SampleAfterValue": "2000003",
10 "CounterHTOff": "Fixed counter 1" 10 "CounterHTOff": "Fixed counter 0"
11 }, 11 },
12 { 12 {
13 "EventCode": "0x00", 13 "EventCode": "0x00",
14 "UMask": "0x2", 14 "UMask": "0x2",
15 "BriefDescription": "Core cycles when the thread is not in halt state", 15 "BriefDescription": "Core cycles when the thread is not in halt state",
16 "Counter": "Fixed counter 2", 16 "Counter": "Fixed counter 1",
17 "EventName": "CPU_CLK_UNHALTED.THREAD", 17 "EventName": "CPU_CLK_UNHALTED.THREAD",
18 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.", 18 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "Fixed counter 2" 20 "CounterHTOff": "Fixed counter 1"
21 },
22 {
23 "EventCode": "0x00",
24 "UMask": "0x2",
25 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
26 "Counter": "Fixed counter 1",
27 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
28 "AnyThread": "1",
29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "Fixed counter 1"
21 }, 31 },
22 { 32 {
23 "EventCode": "0x00", 33 "EventCode": "0x00",
24 "UMask": "0x3", 34 "UMask": "0x3",
25 "BriefDescription": "Reference cycles when the core is not in halt state.", 35 "BriefDescription": "Reference cycles when the core is not in halt state.",
26 "Counter": "Fixed counter 3", 36 "Counter": "Fixed counter 2",
27 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 37 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
28 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. \nNote: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. This event is clocked by base clock (100 Mhz) on Sandy Bridge. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.", 38 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. \nNote: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. This event is clocked by base clock (100 Mhz) on Sandy Bridge. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.",
29 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
30 "CounterHTOff": "Fixed counter 3" 40 "CounterHTOff": "Fixed counter 2"
31 }, 41 },
32 { 42 {
33 "EventCode": "0x03", 43 "EventCode": "0x03",
@@ -60,22 +70,33 @@
60 }, 70 },
61 { 71 {
62 "EventCode": "0x0D", 72 "EventCode": "0x0D",
63 "UMask": "0x8", 73 "UMask": "0x3",
64 "BriefDescription": "Cycles when Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the thread", 74 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)",
65 "Counter": "0,1,2,3", 75 "Counter": "0,1,2,3",
66 "EventName": "INT_MISC.RAT_STALL_CYCLES", 76 "EventName": "INT_MISC.RECOVERY_CYCLES",
67 "PublicDescription": "This event counts the number of cycles during which Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the current thread. This also includes the cycles during which the Allocator is serving another thread.", 77 "CounterMask": "1",
78 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.",
68 "SampleAfterValue": "2000003", 79 "SampleAfterValue": "2000003",
69 "CounterHTOff": "0,1,2,3,4,5,6,7" 80 "CounterHTOff": "0,1,2,3,4,5,6,7"
70 }, 81 },
71 { 82 {
72 "EventCode": "0x0D", 83 "EventCode": "0x0D",
73 "UMask": "0x3", 84 "UMask": "0x3",
74 "BriefDescription": "Number of cycles waiting for the checkpoints in Resource Allocation Table (RAT) to be recovered after Nuke due to all other cases except JEClear (e.g. whenever a ucode assist is needed like SSE exception, memory disambiguation, etc...)", 85 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
75 "Counter": "0,1,2,3", 86 "Counter": "0,1,2,3",
76 "EventName": "INT_MISC.RECOVERY_CYCLES", 87 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
88 "AnyThread": "1",
77 "CounterMask": "1", 89 "CounterMask": "1",
78 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.", 90 "SampleAfterValue": "2000003",
91 "CounterHTOff": "0,1,2,3,4,5,6,7"
92 },
93 {
94 "EventCode": "0x0D",
95 "UMask": "0x8",
96 "BriefDescription": "Cycles when Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the thread",
97 "Counter": "0,1,2,3",
98 "EventName": "INT_MISC.RAT_STALL_CYCLES",
99 "PublicDescription": "This event counts the number of cycles during which Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the current thread. This also includes the cycles during which the Allocator is serving another thread.",
79 "SampleAfterValue": "2000003", 100 "SampleAfterValue": "2000003",
80 "CounterHTOff": "0,1,2,3,4,5,6,7" 101 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 }, 102 },
@@ -90,6 +111,18 @@
90 "CounterHTOff": "0,1,2,3,4,5,6,7" 111 "CounterHTOff": "0,1,2,3,4,5,6,7"
91 }, 112 },
92 { 113 {
114 "Invert": "1",
115 "EventCode": "0x0E",
116 "UMask": "0x1",
117 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
118 "Counter": "0,1,2,3",
119 "EventName": "UOPS_ISSUED.STALL_CYCLES",
120 "CounterMask": "1",
121 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
122 "SampleAfterValue": "2000003",
123 "CounterHTOff": "0,1,2,3"
124 },
125 {
93 "EventCode": "0x0E", 126 "EventCode": "0x0E",
94 "UMask": "0x10", 127 "UMask": "0x10",
95 "BriefDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive; added by GSR u-arch.", 128 "BriefDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive; added by GSR u-arch.",
@@ -118,18 +151,6 @@
118 "CounterHTOff": "0,1,2,3,4,5,6,7" 151 "CounterHTOff": "0,1,2,3,4,5,6,7"
119 }, 152 },
120 { 153 {
121 "Invert": "1",
122 "EventCode": "0x0E",
123 "UMask": "0x1",
124 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
125 "Counter": "0,1,2,3",
126 "EventName": "UOPS_ISSUED.STALL_CYCLES",
127 "CounterMask": "1",
128 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
129 "SampleAfterValue": "2000003",
130 "CounterHTOff": "0,1,2,3"
131 },
132 {
133 "EventCode": "0x14", 154 "EventCode": "0x14",
134 "UMask": "0x1", 155 "UMask": "0x1",
135 "BriefDescription": "Cycles when divider is busy executing divide operations", 156 "BriefDescription": "Cycles when divider is busy executing divide operations",
@@ -141,6 +162,26 @@
141 }, 162 },
142 { 163 {
143 "EventCode": "0x3C", 164 "EventCode": "0x3C",
165 "UMask": "0x0",
166 "BriefDescription": "Thread cycles when thread is not in halt state",
167 "Counter": "0,1,2,3",
168 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
169 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
170 "SampleAfterValue": "2000003",
171 "CounterHTOff": "0,1,2,3,4,5,6,7"
172 },
173 {
174 "EventCode": "0x3C",
175 "UMask": "0x0",
176 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
177 "Counter": "0,1,2,3",
178 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
179 "AnyThread": "1",
180 "SampleAfterValue": "2000003",
181 "CounterHTOff": "0,1,2,3,4,5,6,7"
182 },
183 {
184 "EventCode": "0x3C",
144 "UMask": "0x1", 185 "UMask": "0x1",
145 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)", 186 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
146 "Counter": "0,1,2,3", 187 "Counter": "0,1,2,3",
@@ -150,6 +191,36 @@
150 "CounterHTOff": "0,1,2,3,4,5,6,7" 191 "CounterHTOff": "0,1,2,3,4,5,6,7"
151 }, 192 },
152 { 193 {
194 "EventCode": "0x3C",
195 "UMask": "0x1",
196 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
197 "Counter": "0,1,2,3",
198 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
199 "AnyThread": "1",
200 "SampleAfterValue": "2000003",
201 "CounterHTOff": "0,1,2,3,4,5,6,7"
202 },
203 {
204 "EventCode": "0x3C",
205 "UMask": "0x1",
206 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
207 "Counter": "0,1,2,3",
208 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
209 "PublicDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate).",
210 "SampleAfterValue": "2000003",
211 "CounterHTOff": "0,1,2,3,4,5,6,7"
212 },
213 {
214 "EventCode": "0x3C",
215 "UMask": "0x1",
216 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
217 "Counter": "0,1,2,3",
218 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
219 "AnyThread": "1",
220 "SampleAfterValue": "2000003",
221 "CounterHTOff": "0,1,2,3,4,5,6,7"
222 },
223 {
153 "EventCode": "0x3c", 224 "EventCode": "0x3c",
154 "UMask": "0x2", 225 "UMask": "0x2",
155 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.", 226 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
@@ -159,6 +230,15 @@
159 "CounterHTOff": "0,1,2,3" 230 "CounterHTOff": "0,1,2,3"
160 }, 231 },
161 { 232 {
233 "EventCode": "0x3C",
234 "UMask": "0x2",
235 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
236 "Counter": "0,1,2,3",
237 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
238 "SampleAfterValue": "2000003",
239 "CounterHTOff": "0,1,2,3,4,5,6,7"
240 },
241 {
162 "EventCode": "0x4c", 242 "EventCode": "0x4c",
163 "UMask": "0x1", 243 "UMask": "0x1",
164 "BriefDescription": "Not software-prefetch load dispatches that hit FB allocated for software prefetch", 244 "BriefDescription": "Not software-prefetch load dispatches that hit FB allocated for software prefetch",
@@ -225,6 +305,18 @@
225 "CounterHTOff": "0,1,2,3,4,5,6,7" 305 "CounterHTOff": "0,1,2,3,4,5,6,7"
226 }, 306 },
227 { 307 {
308 "EdgeDetect": "1",
309 "Invert": "1",
310 "EventCode": "0x5E",
311 "UMask": "0x1",
312 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
313 "Counter": "0,1,2,3",
314 "EventName": "RS_EVENTS.EMPTY_END",
315 "CounterMask": "1",
316 "SampleAfterValue": "200003",
317 "CounterHTOff": "0,1,2,3,4,5,6,7"
318 },
319 {
228 "EventCode": "0x87", 320 "EventCode": "0x87",
229 "UMask": "0x1", 321 "UMask": "0x1",
230 "BriefDescription": "Stalls caused by changing prefix length of the instruction.", 322 "BriefDescription": "Stalls caused by changing prefix length of the instruction.",
@@ -406,6 +498,15 @@
406 }, 498 },
407 { 499 {
408 "EventCode": "0x89", 500 "EventCode": "0x89",
501 "UMask": "0xa0",
502 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
503 "Counter": "0,1,2,3",
504 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
505 "SampleAfterValue": "200003",
506 "CounterHTOff": "0,1,2,3,4,5,6,7"
507 },
508 {
509 "EventCode": "0x89",
409 "UMask": "0xc1", 510 "UMask": "0xc1",
410 "BriefDescription": "Speculative and retired mispredicted macro conditional branches", 511 "BriefDescription": "Speculative and retired mispredicted macro conditional branches",
411 "Counter": "0,1,2,3", 512 "Counter": "0,1,2,3",
@@ -435,6 +536,16 @@
435 "CounterHTOff": "0,1,2,3,4,5,6,7" 536 "CounterHTOff": "0,1,2,3,4,5,6,7"
436 }, 537 },
437 { 538 {
539 "EventCode": "0xA0",
540 "UMask": "0x3",
541 "BriefDescription": "Micro-op dispatches cancelled due to insufficient SIMD physical register file read ports",
542 "Counter": "0,1,2,3",
543 "EventName": "UOP_DISPATCHES_CANCELLED.SIMD_PRF",
544 "PublicDescription": "This event counts the number of micro-operations cancelled after they were dispatched from the scheduler to the execution units when the total number of physical register read ports across all dispatch ports exceeds the read bandwidth of the physical register file. The SIMD_PRF subevent applies to the following instructions: VDPPS, DPPS, VPCMPESTRI, PCMPESTRI, VPCMPESTRM, PCMPESTRM, VFMADD*, VFMADDSUB*, VFMSUB*, VMSUBADD*, VFNMADD*, VFNMSUB*. See the Broadwell Optimization Guide for more information.",
545 "SampleAfterValue": "2000003",
546 "CounterHTOff": "0,1,2,3"
547 },
548 {
438 "EventCode": "0xA1", 549 "EventCode": "0xA1",
439 "UMask": "0x1", 550 "UMask": "0x1",
440 "BriefDescription": "Cycles per thread when uops are executed in port 0", 551 "BriefDescription": "Cycles per thread when uops are executed in port 0",
@@ -446,6 +557,26 @@
446 }, 557 },
447 { 558 {
448 "EventCode": "0xA1", 559 "EventCode": "0xA1",
560 "UMask": "0x1",
561 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
562 "Counter": "0,1,2,3",
563 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
564 "AnyThread": "1",
565 "SampleAfterValue": "2000003",
566 "CounterHTOff": "0,1,2,3,4,5,6,7"
567 },
568 {
569 "EventCode": "0xA1",
570 "UMask": "0x1",
571 "BriefDescription": "Cycles per thread when uops are executed in port 0",
572 "Counter": "0,1,2,3",
573 "EventName": "UOPS_EXECUTED_PORT.PORT_0",
574 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
575 "SampleAfterValue": "2000003",
576 "CounterHTOff": "0,1,2,3,4,5,6,7"
577 },
578 {
579 "EventCode": "0xA1",
449 "UMask": "0x2", 580 "UMask": "0x2",
450 "BriefDescription": "Cycles per thread when uops are executed in port 1", 581 "BriefDescription": "Cycles per thread when uops are executed in port 1",
451 "Counter": "0,1,2,3", 582 "Counter": "0,1,2,3",
@@ -456,6 +587,26 @@
456 }, 587 },
457 { 588 {
458 "EventCode": "0xA1", 589 "EventCode": "0xA1",
590 "UMask": "0x2",
591 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
592 "Counter": "0,1,2,3",
593 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
594 "AnyThread": "1",
595 "SampleAfterValue": "2000003",
596 "CounterHTOff": "0,1,2,3,4,5,6,7"
597 },
598 {
599 "EventCode": "0xA1",
600 "UMask": "0x2",
601 "BriefDescription": "Cycles per thread when uops are executed in port 1",
602 "Counter": "0,1,2,3",
603 "EventName": "UOPS_EXECUTED_PORT.PORT_1",
604 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
605 "SampleAfterValue": "2000003",
606 "CounterHTOff": "0,1,2,3,4,5,6,7"
607 },
608 {
609 "EventCode": "0xA1",
459 "UMask": "0x4", 610 "UMask": "0x4",
460 "BriefDescription": "Cycles per thread when uops are executed in port 2", 611 "BriefDescription": "Cycles per thread when uops are executed in port 2",
461 "Counter": "0,1,2,3", 612 "Counter": "0,1,2,3",
@@ -466,6 +617,26 @@
466 }, 617 },
467 { 618 {
468 "EventCode": "0xA1", 619 "EventCode": "0xA1",
620 "UMask": "0x4",
621 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
622 "Counter": "0,1,2,3",
623 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
624 "AnyThread": "1",
625 "SampleAfterValue": "2000003",
626 "CounterHTOff": "0,1,2,3,4,5,6,7"
627 },
628 {
629 "EventCode": "0xA1",
630 "UMask": "0x4",
631 "BriefDescription": "Cycles per thread when uops are executed in port 2",
632 "Counter": "0,1,2,3",
633 "EventName": "UOPS_EXECUTED_PORT.PORT_2",
634 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
635 "SampleAfterValue": "2000003",
636 "CounterHTOff": "0,1,2,3,4,5,6,7"
637 },
638 {
639 "EventCode": "0xA1",
469 "UMask": "0x8", 640 "UMask": "0x8",
470 "BriefDescription": "Cycles per thread when uops are executed in port 3", 641 "BriefDescription": "Cycles per thread when uops are executed in port 3",
471 "Counter": "0,1,2,3", 642 "Counter": "0,1,2,3",
@@ -476,6 +647,26 @@
476 }, 647 },
477 { 648 {
478 "EventCode": "0xA1", 649 "EventCode": "0xA1",
650 "UMask": "0x8",
651 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
652 "Counter": "0,1,2,3",
653 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
654 "AnyThread": "1",
655 "SampleAfterValue": "2000003",
656 "CounterHTOff": "0,1,2,3,4,5,6,7"
657 },
658 {
659 "EventCode": "0xA1",
660 "UMask": "0x8",
661 "BriefDescription": "Cycles per thread when uops are executed in port 3",
662 "Counter": "0,1,2,3",
663 "EventName": "UOPS_EXECUTED_PORT.PORT_3",
664 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
665 "SampleAfterValue": "2000003",
666 "CounterHTOff": "0,1,2,3,4,5,6,7"
667 },
668 {
669 "EventCode": "0xA1",
479 "UMask": "0x10", 670 "UMask": "0x10",
480 "BriefDescription": "Cycles per thread when uops are executed in port 4", 671 "BriefDescription": "Cycles per thread when uops are executed in port 4",
481 "Counter": "0,1,2,3", 672 "Counter": "0,1,2,3",
@@ -486,6 +677,26 @@
486 }, 677 },
487 { 678 {
488 "EventCode": "0xA1", 679 "EventCode": "0xA1",
680 "UMask": "0x10",
681 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
682 "Counter": "0,1,2,3",
683 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
684 "AnyThread": "1",
685 "SampleAfterValue": "2000003",
686 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 },
688 {
689 "EventCode": "0xA1",
690 "UMask": "0x10",
691 "BriefDescription": "Cycles per thread when uops are executed in port 4",
692 "Counter": "0,1,2,3",
693 "EventName": "UOPS_EXECUTED_PORT.PORT_4",
694 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
695 "SampleAfterValue": "2000003",
696 "CounterHTOff": "0,1,2,3,4,5,6,7"
697 },
698 {
699 "EventCode": "0xA1",
489 "UMask": "0x20", 700 "UMask": "0x20",
490 "BriefDescription": "Cycles per thread when uops are executed in port 5", 701 "BriefDescription": "Cycles per thread when uops are executed in port 5",
491 "Counter": "0,1,2,3", 702 "Counter": "0,1,2,3",
@@ -496,6 +707,26 @@
496 }, 707 },
497 { 708 {
498 "EventCode": "0xA1", 709 "EventCode": "0xA1",
710 "UMask": "0x20",
711 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
712 "Counter": "0,1,2,3",
713 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
714 "AnyThread": "1",
715 "SampleAfterValue": "2000003",
716 "CounterHTOff": "0,1,2,3,4,5,6,7"
717 },
718 {
719 "EventCode": "0xA1",
720 "UMask": "0x20",
721 "BriefDescription": "Cycles per thread when uops are executed in port 5",
722 "Counter": "0,1,2,3",
723 "EventName": "UOPS_EXECUTED_PORT.PORT_5",
724 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
725 "SampleAfterValue": "2000003",
726 "CounterHTOff": "0,1,2,3,4,5,6,7"
727 },
728 {
729 "EventCode": "0xA1",
499 "UMask": "0x40", 730 "UMask": "0x40",
500 "BriefDescription": "Cycles per thread when uops are executed in port 6", 731 "BriefDescription": "Cycles per thread when uops are executed in port 6",
501 "Counter": "0,1,2,3", 732 "Counter": "0,1,2,3",
@@ -506,6 +737,26 @@
506 }, 737 },
507 { 738 {
508 "EventCode": "0xA1", 739 "EventCode": "0xA1",
740 "UMask": "0x40",
741 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
742 "Counter": "0,1,2,3",
743 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
744 "AnyThread": "1",
745 "SampleAfterValue": "2000003",
746 "CounterHTOff": "0,1,2,3,4,5,6,7"
747 },
748 {
749 "EventCode": "0xA1",
750 "UMask": "0x40",
751 "BriefDescription": "Cycles per thread when uops are executed in port 6",
752 "Counter": "0,1,2,3",
753 "EventName": "UOPS_EXECUTED_PORT.PORT_6",
754 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
755 "SampleAfterValue": "2000003",
756 "CounterHTOff": "0,1,2,3,4,5,6,7"
757 },
758 {
759 "EventCode": "0xA1",
509 "UMask": "0x80", 760 "UMask": "0x80",
510 "BriefDescription": "Cycles per thread when uops are executed in port 7", 761 "BriefDescription": "Cycles per thread when uops are executed in port 7",
511 "Counter": "0,1,2,3", 762 "Counter": "0,1,2,3",
@@ -515,6 +766,26 @@
515 "CounterHTOff": "0,1,2,3,4,5,6,7" 766 "CounterHTOff": "0,1,2,3,4,5,6,7"
516 }, 767 },
517 { 768 {
769 "EventCode": "0xA1",
770 "UMask": "0x80",
771 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
772 "Counter": "0,1,2,3",
773 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
774 "AnyThread": "1",
775 "SampleAfterValue": "2000003",
776 "CounterHTOff": "0,1,2,3,4,5,6,7"
777 },
778 {
779 "EventCode": "0xA1",
780 "UMask": "0x80",
781 "BriefDescription": "Cycles per thread when uops are executed in port 7",
782 "Counter": "0,1,2,3",
783 "EventName": "UOPS_EXECUTED_PORT.PORT_7",
784 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
785 "SampleAfterValue": "2000003",
786 "CounterHTOff": "0,1,2,3,4,5,6,7"
787 },
788 {
518 "EventCode": "0xA2", 789 "EventCode": "0xA2",
519 "UMask": "0x1", 790 "UMask": "0x1",
520 "BriefDescription": "Resource-related stall cycles", 791 "BriefDescription": "Resource-related stall cycles",
@@ -567,14 +838,13 @@
567 }, 838 },
568 { 839 {
569 "EventCode": "0xA3", 840 "EventCode": "0xA3",
570 "UMask": "0x8", 841 "UMask": "0x1",
571 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.", 842 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
572 "Counter": "2", 843 "Counter": "0,1,2,3",
573 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING", 844 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
574 "CounterMask": "8", 845 "CounterMask": "1",
575 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request missing the L1 data cache.",
576 "SampleAfterValue": "2000003", 846 "SampleAfterValue": "2000003",
577 "CounterHTOff": "2" 847 "CounterHTOff": "0,1,2,3,4,5,6,7"
578 }, 848 },
579 { 849 {
580 "EventCode": "0xA3", 850 "EventCode": "0xA3",
@@ -589,8 +859,18 @@
589 }, 859 },
590 { 860 {
591 "EventCode": "0xA3", 861 "EventCode": "0xA3",
862 "UMask": "0x2",
863 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
864 "Counter": "0,1,2,3",
865 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
866 "CounterMask": "2",
867 "SampleAfterValue": "2000003",
868 "CounterHTOff": "0,1,2,3"
869 },
870 {
871 "EventCode": "0xA3",
592 "UMask": "0x4", 872 "UMask": "0x4",
593 "BriefDescription": "Total execution stalls", 873 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
594 "Counter": "0,1,2,3", 874 "Counter": "0,1,2,3",
595 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 875 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
596 "CounterMask": "4", 876 "CounterMask": "4",
@@ -600,6 +880,16 @@
600 }, 880 },
601 { 881 {
602 "EventCode": "0xA3", 882 "EventCode": "0xA3",
883 "UMask": "0x4",
884 "BriefDescription": "Total execution stalls.",
885 "Counter": "0,1,2,3",
886 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
887 "CounterMask": "4",
888 "SampleAfterValue": "2000003",
889 "CounterHTOff": "0,1,2,3,4,5,6,7"
890 },
891 {
892 "EventCode": "0xA3",
603 "UMask": "0x5", 893 "UMask": "0x5",
604 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.", 894 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
605 "Counter": "0,1,2,3", 895 "Counter": "0,1,2,3",
@@ -611,6 +901,16 @@
611 }, 901 },
612 { 902 {
613 "EventCode": "0xA3", 903 "EventCode": "0xA3",
904 "UMask": "0x5",
905 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
906 "Counter": "0,1,2,3",
907 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
908 "CounterMask": "5",
909 "SampleAfterValue": "2000003",
910 "CounterHTOff": "0,1,2,3,4,5,6,7"
911 },
912 {
913 "EventCode": "0xA3",
614 "UMask": "0x6", 914 "UMask": "0x6",
615 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.", 915 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
616 "Counter": "0,1,2,3", 916 "Counter": "0,1,2,3",
@@ -622,6 +922,37 @@
622 }, 922 },
623 { 923 {
624 "EventCode": "0xA3", 924 "EventCode": "0xA3",
925 "UMask": "0x6",
926 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
927 "Counter": "0,1,2,3",
928 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
929 "CounterMask": "6",
930 "SampleAfterValue": "2000003",
931 "CounterHTOff": "0,1,2,3,4,5,6,7"
932 },
933 {
934 "EventCode": "0xA3",
935 "UMask": "0x8",
936 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
937 "Counter": "2",
938 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
939 "CounterMask": "8",
940 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request missing the L1 data cache.",
941 "SampleAfterValue": "2000003",
942 "CounterHTOff": "2"
943 },
944 {
945 "EventCode": "0xA3",
946 "UMask": "0x8",
947 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
948 "Counter": "2",
949 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
950 "CounterMask": "8",
951 "SampleAfterValue": "2000003",
952 "CounterHTOff": "2"
953 },
954 {
955 "EventCode": "0xA3",
625 "UMask": "0xc", 956 "UMask": "0xc",
626 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.", 957 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
627 "Counter": "2", 958 "Counter": "2",
@@ -632,12 +963,41 @@
632 "CounterHTOff": "2" 963 "CounterHTOff": "2"
633 }, 964 },
634 { 965 {
966 "EventCode": "0xA3",
967 "UMask": "0xc",
968 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
969 "Counter": "2",
970 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
971 "CounterMask": "12",
972 "SampleAfterValue": "2000003",
973 "CounterHTOff": "2"
974 },
975 {
635 "EventCode": "0xA8", 976 "EventCode": "0xA8",
636 "UMask": "0x1", 977 "UMask": "0x1",
637 "BriefDescription": "Number of Uops delivered by the LSD.", 978 "BriefDescription": "Number of Uops delivered by the LSD.",
638 "Counter": "0,1,2,3", 979 "Counter": "0,1,2,3",
639 "EventName": "LSD.UOPS", 980 "EventName": "LSD.UOPS",
640 "PublicDescription": "Number of Uops delivered by the LSD. ", 981 "SampleAfterValue": "2000003",
982 "CounterHTOff": "0,1,2,3,4,5,6,7"
983 },
984 {
985 "EventCode": "0xA8",
986 "UMask": "0x1",
987 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
988 "Counter": "0,1,2,3",
989 "EventName": "LSD.CYCLES_4_UOPS",
990 "CounterMask": "4",
991 "SampleAfterValue": "2000003",
992 "CounterHTOff": "0,1,2,3,4,5,6,7"
993 },
994 {
995 "EventCode": "0xA8",
996 "UMask": "0x1",
997 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
998 "Counter": "0,1,2,3",
999 "EventName": "LSD.CYCLES_ACTIVE",
1000 "CounterMask": "1",
641 "SampleAfterValue": "2000003", 1001 "SampleAfterValue": "2000003",
642 "CounterHTOff": "0,1,2,3,4,5,6,7" 1002 "CounterHTOff": "0,1,2,3,4,5,6,7"
643 }, 1003 },
@@ -652,6 +1012,58 @@
652 "CounterHTOff": "0,1,2,3,4,5,6,7" 1012 "CounterHTOff": "0,1,2,3,4,5,6,7"
653 }, 1013 },
654 { 1014 {
1015 "Invert": "1",
1016 "EventCode": "0xB1",
1017 "UMask": "0x1",
1018 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
1019 "Counter": "0,1,2,3",
1020 "EventName": "UOPS_EXECUTED.STALL_CYCLES",
1021 "CounterMask": "1",
1022 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.",
1023 "SampleAfterValue": "2000003",
1024 "CounterHTOff": "0,1,2,3"
1025 },
1026 {
1027 "EventCode": "0xB1",
1028 "UMask": "0x1",
1029 "BriefDescription": "Cycles where at least 1 uop was executed per-thread.",
1030 "Counter": "0,1,2,3",
1031 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1032 "CounterMask": "1",
1033 "SampleAfterValue": "2000003",
1034 "CounterHTOff": "0,1,2,3"
1035 },
1036 {
1037 "EventCode": "0xB1",
1038 "UMask": "0x1",
1039 "BriefDescription": "Cycles where at least 2 uops were executed per-thread.",
1040 "Counter": "0,1,2,3",
1041 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1042 "CounterMask": "2",
1043 "SampleAfterValue": "2000003",
1044 "CounterHTOff": "0,1,2,3"
1045 },
1046 {
1047 "EventCode": "0xB1",
1048 "UMask": "0x1",
1049 "BriefDescription": "Cycles where at least 3 uops were executed per-thread.",
1050 "Counter": "0,1,2,3",
1051 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1052 "CounterMask": "3",
1053 "SampleAfterValue": "2000003",
1054 "CounterHTOff": "0,1,2,3"
1055 },
1056 {
1057 "EventCode": "0xB1",
1058 "UMask": "0x1",
1059 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
1060 "Counter": "0,1,2,3",
1061 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
1062 "CounterMask": "4",
1063 "SampleAfterValue": "2000003",
1064 "CounterHTOff": "0,1,2,3"
1065 },
1066 {
655 "EventCode": "0xB1", 1067 "EventCode": "0xB1",
656 "UMask": "0x2", 1068 "UMask": "0x2",
657 "BriefDescription": "Number of uops executed on the core.", 1069 "BriefDescription": "Number of uops executed on the core.",
@@ -662,35 +1074,63 @@
662 "CounterHTOff": "0,1,2,3,4,5,6,7" 1074 "CounterHTOff": "0,1,2,3,4,5,6,7"
663 }, 1075 },
664 { 1076 {
665 "Invert": "1", 1077 "EventCode": "0xb1",
666 "EventCode": "0xB1", 1078 "UMask": "0x2",
667 "UMask": "0x1", 1079 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
668 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
669 "Counter": "0,1,2,3", 1080 "Counter": "0,1,2,3",
670 "EventName": "UOPS_EXECUTED.STALL_CYCLES", 1081 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
671 "CounterMask": "1", 1082 "CounterMask": "1",
672 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.",
673 "SampleAfterValue": "2000003", 1083 "SampleAfterValue": "2000003",
674 "CounterHTOff": "0,1,2,3" 1084 "CounterHTOff": "0,1,2,3,4,5,6,7"
675 }, 1085 },
676 { 1086 {
677 "EventCode": "0xC0", 1087 "EventCode": "0xb1",
678 "UMask": "0x0", 1088 "UMask": "0x2",
679 "BriefDescription": "Number of instructions retired. General Counter - architectural event", 1089 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
680 "Counter": "0,1,2,3", 1090 "Counter": "0,1,2,3",
681 "EventName": "INST_RETIRED.ANY_P", 1091 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
682 "Errata": "BDM61", 1092 "CounterMask": "2",
683 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).",
684 "SampleAfterValue": "2000003", 1093 "SampleAfterValue": "2000003",
685 "CounterHTOff": "0,1,2,3,4,5,6,7" 1094 "CounterHTOff": "0,1,2,3,4,5,6,7"
686 }, 1095 },
687 { 1096 {
688 "EventCode": "0xC0", 1097 "EventCode": "0xb1",
689 "UMask": "0x2", 1098 "UMask": "0x2",
690 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions:", 1099 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
691 "Counter": "0,1,2,3", 1100 "Counter": "0,1,2,3",
692 "EventName": "INST_RETIRED.X87", 1101 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
693 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.", 1102 "CounterMask": "3",
1103 "SampleAfterValue": "2000003",
1104 "CounterHTOff": "0,1,2,3,4,5,6,7"
1105 },
1106 {
1107 "EventCode": "0xb1",
1108 "UMask": "0x2",
1109 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1110 "Counter": "0,1,2,3",
1111 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1112 "CounterMask": "4",
1113 "SampleAfterValue": "2000003",
1114 "CounterHTOff": "0,1,2,3,4,5,6,7"
1115 },
1116 {
1117 "Invert": "1",
1118 "EventCode": "0xb1",
1119 "UMask": "0x2",
1120 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1121 "Counter": "0,1,2,3",
1122 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1123 "SampleAfterValue": "2000003",
1124 "CounterHTOff": "0,1,2,3,4,5,6,7"
1125 },
1126 {
1127 "EventCode": "0xC0",
1128 "UMask": "0x0",
1129 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
1130 "Counter": "0,1,2,3",
1131 "EventName": "INST_RETIRED.ANY_P",
1132 "Errata": "BDM61",
1133 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).",
694 "SampleAfterValue": "2000003", 1134 "SampleAfterValue": "2000003",
695 "CounterHTOff": "0,1,2,3,4,5,6,7" 1135 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 }, 1136 },
@@ -707,6 +1147,16 @@
707 "CounterHTOff": "1" 1147 "CounterHTOff": "1"
708 }, 1148 },
709 { 1149 {
1150 "EventCode": "0xC0",
1151 "UMask": "0x2",
1152 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions:",
1153 "Counter": "0,1,2,3",
1154 "EventName": "INST_RETIRED.X87",
1155 "PublicDescription": "This event counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.",
1156 "SampleAfterValue": "2000003",
1157 "CounterHTOff": "0,1,2,3,4,5,6,7"
1158 },
1159 {
710 "EventCode": "0xC1", 1160 "EventCode": "0xC1",
711 "UMask": "0x40", 1161 "UMask": "0x40",
712 "BriefDescription": "Number of times any microcode assist is invoked by HW upon uop writeback.", 1162 "BriefDescription": "Number of times any microcode assist is invoked by HW upon uop writeback.",
@@ -718,23 +1168,12 @@
718 { 1168 {
719 "EventCode": "0xC2", 1169 "EventCode": "0xC2",
720 "UMask": "0x1", 1170 "UMask": "0x1",
721 "BriefDescription": "Actually retired uops.", 1171 "BriefDescription": "Actually retired uops. (Precise Event - PEBS)",
722 "Data_LA": "1", 1172 "Data_LA": "1",
723 "PEBS": "1", 1173 "PEBS": "1",
724 "Counter": "0,1,2,3", 1174 "Counter": "0,1,2,3",
725 "EventName": "UOPS_RETIRED.ALL", 1175 "EventName": "UOPS_RETIRED.ALL",
726 "PublicDescription": "This event counts all actually retired uops. Counting increments by two for micro-fused uops, and by one for macro-fused and other uops. Maximal increment value for one cycle is eight.", 1176 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts all actually retired uops. Counting increments by two for micro-fused uops, and by one for macro-fused and other uops. Maximal increment value for one cycle is eight.",
727 "SampleAfterValue": "2000003",
728 "CounterHTOff": "0,1,2,3,4,5,6,7"
729 },
730 {
731 "EventCode": "0xC2",
732 "UMask": "0x2",
733 "BriefDescription": "Retirement slots used.",
734 "PEBS": "1",
735 "Counter": "0,1,2,3",
736 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
737 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of retirement slots used.",
738 "SampleAfterValue": "2000003", 1177 "SampleAfterValue": "2000003",
739 "CounterHTOff": "0,1,2,3,4,5,6,7" 1178 "CounterHTOff": "0,1,2,3,4,5,6,7"
740 }, 1179 },
@@ -746,7 +1185,7 @@
746 "Counter": "0,1,2,3", 1185 "Counter": "0,1,2,3",
747 "EventName": "UOPS_RETIRED.STALL_CYCLES", 1186 "EventName": "UOPS_RETIRED.STALL_CYCLES",
748 "CounterMask": "1", 1187 "CounterMask": "1",
749 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts cycles without actually retired uops.", 1188 "PublicDescription": "This event counts cycles without actually retired uops.",
750 "SampleAfterValue": "2000003", 1189 "SampleAfterValue": "2000003",
751 "CounterHTOff": "0,1,2,3" 1190 "CounterHTOff": "0,1,2,3"
752 }, 1191 },
@@ -763,6 +1202,17 @@
763 "CounterHTOff": "0,1,2,3" 1202 "CounterHTOff": "0,1,2,3"
764 }, 1203 },
765 { 1204 {
1205 "EventCode": "0xC2",
1206 "UMask": "0x2",
1207 "BriefDescription": "Retirement slots used. (Precise Event - PEBS)",
1208 "PEBS": "1",
1209 "Counter": "0,1,2,3",
1210 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1211 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts the number of retirement slots used.",
1212 "SampleAfterValue": "2000003",
1213 "CounterHTOff": "0,1,2,3,4,5,6,7"
1214 },
1215 {
766 "EventCode": "0xC3", 1216 "EventCode": "0xC3",
767 "UMask": "0x1", 1217 "UMask": "0x1",
768 "BriefDescription": "Cycles there was a Nuke. Account for both thread-specific and All Thread Nukes.", 1218 "BriefDescription": "Cycles there was a Nuke. Account for both thread-specific and All Thread Nukes.",
@@ -773,6 +1223,17 @@
773 "CounterHTOff": "0,1,2,3,4,5,6,7" 1223 "CounterHTOff": "0,1,2,3,4,5,6,7"
774 }, 1224 },
775 { 1225 {
1226 "EdgeDetect": "1",
1227 "EventCode": "0xC3",
1228 "UMask": "0x1",
1229 "BriefDescription": "Number of machine clears (nukes) of any type.",
1230 "Counter": "0,1,2,3",
1231 "EventName": "MACHINE_CLEARS.COUNT",
1232 "CounterMask": "1",
1233 "SampleAfterValue": "100003",
1234 "CounterHTOff": "0,1,2,3,4,5,6,7"
1235 },
1236 {
776 "EventCode": "0xC3", 1237 "EventCode": "0xC3",
777 "UMask": "0x4", 1238 "UMask": "0x4",
778 "BriefDescription": "Self-modifying code (SMC) detected.", 1239 "BriefDescription": "Self-modifying code (SMC) detected.",
@@ -794,44 +1255,67 @@
794 }, 1255 },
795 { 1256 {
796 "EventCode": "0xC4", 1257 "EventCode": "0xC4",
1258 "UMask": "0x0",
1259 "BriefDescription": "All (macro) branch instructions retired.",
1260 "Counter": "0,1,2,3",
1261 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1262 "PublicDescription": "This event counts all (macro) branch instructions retired.",
1263 "SampleAfterValue": "400009",
1264 "CounterHTOff": "0,1,2,3,4,5,6,7"
1265 },
1266 {
1267 "EventCode": "0xC4",
797 "UMask": "0x1", 1268 "UMask": "0x1",
798 "BriefDescription": "Conditional branch instructions retired.", 1269 "BriefDescription": "Conditional branch instructions retired. (Precise Event - PEBS)",
799 "PEBS": "1", 1270 "PEBS": "1",
800 "Counter": "0,1,2,3", 1271 "Counter": "0,1,2,3",
801 "EventName": "BR_INST_RETIRED.CONDITIONAL", 1272 "EventName": "BR_INST_RETIRED.CONDITIONAL",
802 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts conditional branch instructions retired.", 1273 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts conditional branch instructions retired.",
803 "SampleAfterValue": "400009", 1274 "SampleAfterValue": "400009",
804 "CounterHTOff": "0,1,2,3,4,5,6,7" 1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
805 }, 1276 },
806 { 1277 {
807 "EventCode": "0xC4", 1278 "EventCode": "0xC4",
808 "UMask": "0x2", 1279 "UMask": "0x2",
809 "BriefDescription": "Direct and indirect near call instructions retired.", 1280 "BriefDescription": "Direct and indirect near call instructions retired. (Precise Event - PEBS)",
810 "PEBS": "1", 1281 "PEBS": "1",
811 "Counter": "0,1,2,3", 1282 "Counter": "0,1,2,3",
812 "EventName": "BR_INST_RETIRED.NEAR_CALL", 1283 "EventName": "BR_INST_RETIRED.NEAR_CALL",
813 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts both direct and indirect near call instructions retired.", 1284 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect near call instructions retired.",
814 "SampleAfterValue": "100007", 1285 "SampleAfterValue": "100007",
815 "CounterHTOff": "0,1,2,3,4,5,6,7" 1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
816 }, 1287 },
817 { 1288 {
818 "EventCode": "0xC4", 1289 "EventCode": "0xC4",
819 "UMask": "0x0", 1290 "UMask": "0x2",
820 "BriefDescription": "All (macro) branch instructions retired.", 1291 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3). (Precise Event - PEBS)",
1292 "PEBS": "1",
821 "Counter": "0,1,2,3", 1293 "Counter": "0,1,2,3",
822 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1294 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
823 "PublicDescription": "This event counts all (macro) branch instructions retired.", 1295 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect macro near call instructions retired (captured in ring 3).",
824 "SampleAfterValue": "400009", 1296 "SampleAfterValue": "100007",
825 "CounterHTOff": "0,1,2,3,4,5,6,7" 1297 "CounterHTOff": "0,1,2,3,4,5,6,7"
826 }, 1298 },
827 { 1299 {
828 "EventCode": "0xC4", 1300 "EventCode": "0xC4",
1301 "UMask": "0x4",
1302 "BriefDescription": "All (macro) branch instructions retired. (Precise Event - PEBS)",
1303 "PEBS": "2",
1304 "Counter": "0,1,2,3",
1305 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
1306 "Errata": "BDW98",
1307 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
1308 "SampleAfterValue": "400009",
1309 "CounterHTOff": "0,1,2,3"
1310 },
1311 {
1312 "EventCode": "0xC4",
829 "UMask": "0x8", 1313 "UMask": "0x8",
830 "BriefDescription": "Return instructions retired.", 1314 "BriefDescription": "Return instructions retired. (Precise Event - PEBS)",
831 "PEBS": "1", 1315 "PEBS": "1",
832 "Counter": "0,1,2,3", 1316 "Counter": "0,1,2,3",
833 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 1317 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
834 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts return instructions retired.", 1318 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts return instructions retired.",
835 "SampleAfterValue": "100007", 1319 "SampleAfterValue": "100007",
836 "CounterHTOff": "0,1,2,3,4,5,6,7" 1320 "CounterHTOff": "0,1,2,3,4,5,6,7"
837 }, 1321 },
@@ -841,18 +1325,18 @@
841 "BriefDescription": "Not taken branch instructions retired.", 1325 "BriefDescription": "Not taken branch instructions retired.",
842 "Counter": "0,1,2,3", 1326 "Counter": "0,1,2,3",
843 "EventName": "BR_INST_RETIRED.NOT_TAKEN", 1327 "EventName": "BR_INST_RETIRED.NOT_TAKEN",
844 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts not taken branch instructions retired.", 1328 "PublicDescription": "This event counts not taken branch instructions retired.",
845 "SampleAfterValue": "400009", 1329 "SampleAfterValue": "400009",
846 "CounterHTOff": "0,1,2,3,4,5,6,7" 1330 "CounterHTOff": "0,1,2,3,4,5,6,7"
847 }, 1331 },
848 { 1332 {
849 "EventCode": "0xC4", 1333 "EventCode": "0xC4",
850 "UMask": "0x20", 1334 "UMask": "0x20",
851 "BriefDescription": "Taken branch instructions retired.", 1335 "BriefDescription": "Taken branch instructions retired. (Precise Event - PEBS)",
852 "PEBS": "1", 1336 "PEBS": "1",
853 "Counter": "0,1,2,3", 1337 "Counter": "0,1,2,3",
854 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 1338 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
855 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts taken branch instructions retired.", 1339 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts taken branch instructions retired.",
856 "SampleAfterValue": "400009", 1340 "SampleAfterValue": "400009",
857 "CounterHTOff": "0,1,2,3,4,5,6,7" 1341 "CounterHTOff": "0,1,2,3,4,5,6,7"
858 }, 1342 },
@@ -863,34 +1347,11 @@
863 "Counter": "0,1,2,3", 1347 "Counter": "0,1,2,3",
864 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 1348 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
865 "Errata": "BDW98", 1349 "Errata": "BDW98",
866 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts far branch instructions retired.", 1350 "PublicDescription": "This event counts far branch instructions retired.",
867 "SampleAfterValue": "100007", 1351 "SampleAfterValue": "100007",
868 "CounterHTOff": "0,1,2,3,4,5,6,7" 1352 "CounterHTOff": "0,1,2,3,4,5,6,7"
869 }, 1353 },
870 { 1354 {
871 "EventCode": "0xC4",
872 "UMask": "0x4",
873 "BriefDescription": "All (macro) branch instructions retired. (Precise Event - PEBS)",
874 "PEBS": "2",
875 "Counter": "0,1,2,3",
876 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
877 "Errata": "BDW98",
878 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
879 "SampleAfterValue": "400009",
880 "CounterHTOff": "0,1,2,3"
881 },
882 {
883 "EventCode": "0xC5",
884 "UMask": "0x1",
885 "BriefDescription": "Mispredicted conditional branch instructions retired.",
886 "PEBS": "1",
887 "Counter": "0,1,2,3",
888 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
889 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted conditional branch instructions retired.",
890 "SampleAfterValue": "400009",
891 "CounterHTOff": "0,1,2,3,4,5,6,7"
892 },
893 {
894 "EventCode": "0xC5", 1355 "EventCode": "0xC5",
895 "UMask": "0x0", 1356 "UMask": "0x0",
896 "BriefDescription": "All mispredicted macro branch instructions retired.", 1357 "BriefDescription": "All mispredicted macro branch instructions retired.",
@@ -902,13 +1363,13 @@
902 }, 1363 },
903 { 1364 {
904 "EventCode": "0xC5", 1365 "EventCode": "0xC5",
905 "UMask": "0x8", 1366 "UMask": "0x1",
906 "BriefDescription": "This event counts the number of mispredicted ret instructions retired. Non PEBS", 1367 "BriefDescription": "Mispredicted conditional branch instructions retired. (Precise Event - PEBS)",
907 "PEBS": "1", 1368 "PEBS": "1",
908 "Counter": "0,1,2,3", 1369 "Counter": "0,1,2,3",
909 "EventName": "BR_MISP_RETIRED.RET", 1370 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
910 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted return instructions retired.", 1371 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted conditional branch instructions retired.",
911 "SampleAfterValue": "100007", 1372 "SampleAfterValue": "400009",
912 "CounterHTOff": "0,1,2,3,4,5,6,7" 1373 "CounterHTOff": "0,1,2,3,4,5,6,7"
913 }, 1374 },
914 { 1375 {
@@ -923,164 +1384,36 @@
923 "CounterHTOff": "0,1,2,3" 1384 "CounterHTOff": "0,1,2,3"
924 }, 1385 },
925 { 1386 {
926 "EventCode": "0xCC", 1387 "EventCode": "0xC5",
927 "UMask": "0x20",
928 "BriefDescription": "Count cases of saving new LBR",
929 "Counter": "0,1,2,3",
930 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
931 "PublicDescription": "This event counts cases of saving new LBR records by hardware. This assumes proper enabling of LBRs and takes into account LBR filtering done by the LBR_SELECT register.",
932 "SampleAfterValue": "2000003",
933 "CounterHTOff": "0,1,2,3,4,5,6,7"
934 },
935 {
936 "EventCode": "0x3C",
937 "UMask": "0x0",
938 "BriefDescription": "Thread cycles when thread is not in halt state",
939 "Counter": "0,1,2,3",
940 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
941 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
942 "SampleAfterValue": "2000003",
943 "CounterHTOff": "0,1,2,3,4,5,6,7"
944 },
945 {
946 "EventCode": "0x89",
947 "UMask": "0xa0",
948 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
949 "Counter": "0,1,2,3",
950 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
951 "SampleAfterValue": "200003",
952 "CounterHTOff": "0,1,2,3,4,5,6,7"
953 },
954 {
955 "EventCode": "0xA1",
956 "UMask": "0x1",
957 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
958 "Counter": "0,1,2,3",
959 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
960 "AnyThread": "1",
961 "SampleAfterValue": "2000003",
962 "CounterHTOff": "0,1,2,3,4,5,6,7"
963 },
964 {
965 "EventCode": "0xA1",
966 "UMask": "0x2",
967 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
968 "Counter": "0,1,2,3",
969 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
970 "AnyThread": "1",
971 "SampleAfterValue": "2000003",
972 "CounterHTOff": "0,1,2,3,4,5,6,7"
973 },
974 {
975 "EventCode": "0xA1",
976 "UMask": "0x4",
977 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
978 "Counter": "0,1,2,3",
979 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
980 "AnyThread": "1",
981 "SampleAfterValue": "2000003",
982 "CounterHTOff": "0,1,2,3,4,5,6,7"
983 },
984 {
985 "EventCode": "0xA1",
986 "UMask": "0x8", 1388 "UMask": "0x8",
987 "BriefDescription": "Cycles per core when uops are dispatched to port 3.", 1389 "BriefDescription": "This event counts the number of mispredicted ret instructions retired.(Precise Event)",
988 "Counter": "0,1,2,3", 1390 "PEBS": "1",
989 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
990 "AnyThread": "1",
991 "SampleAfterValue": "2000003",
992 "CounterHTOff": "0,1,2,3,4,5,6,7"
993 },
994 {
995 "EventCode": "0xA1",
996 "UMask": "0x10",
997 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
998 "Counter": "0,1,2,3",
999 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
1000 "AnyThread": "1",
1001 "SampleAfterValue": "2000003",
1002 "CounterHTOff": "0,1,2,3,4,5,6,7"
1003 },
1004 {
1005 "EventCode": "0xA1",
1006 "UMask": "0x20",
1007 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
1008 "Counter": "0,1,2,3",
1009 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
1010 "AnyThread": "1",
1011 "SampleAfterValue": "2000003",
1012 "CounterHTOff": "0,1,2,3,4,5,6,7"
1013 },
1014 {
1015 "EventCode": "0xA1",
1016 "UMask": "0x40",
1017 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
1018 "Counter": "0,1,2,3",
1019 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
1020 "AnyThread": "1",
1021 "SampleAfterValue": "2000003",
1022 "CounterHTOff": "0,1,2,3,4,5,6,7"
1023 },
1024 {
1025 "EventCode": "0xA1",
1026 "UMask": "0x80",
1027 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
1028 "Counter": "0,1,2,3", 1391 "Counter": "0,1,2,3",
1029 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE", 1392 "EventName": "BR_MISP_RETIRED.RET",
1030 "AnyThread": "1", 1393 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted return instructions retired.",
1031 "SampleAfterValue": "2000003", 1394 "SampleAfterValue": "100007",
1032 "CounterHTOff": "0,1,2,3,4,5,6,7" 1395 "CounterHTOff": "0,1,2,3,4,5,6,7"
1033 }, 1396 },
1034 { 1397 {
1035 "EventCode": "0xC5", 1398 "EventCode": "0xC5",
1036 "UMask": "0x20", 1399 "UMask": "0x20",
1037 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.", 1400 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken. (Precise Event - PEBS).",
1038 "PEBS": "1", 1401 "PEBS": "1",
1039 "Counter": "0,1,2,3", 1402 "Counter": "0,1,2,3",
1040 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 1403 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
1041 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken.", 1404 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken. (Precise Event - PEBS).",
1042 "SampleAfterValue": "400009", 1405 "SampleAfterValue": "400009",
1043 "CounterHTOff": "0,1,2,3,4,5,6,7" 1406 "CounterHTOff": "0,1,2,3,4,5,6,7"
1044 }, 1407 },
1045 { 1408 {
1046 "EventCode": "0xB1", 1409 "EventCode": "0xCC",
1047 "UMask": "0x1", 1410 "UMask": "0x20",
1048 "BriefDescription": "Cycles where at least 1 uop was executed per-thread.", 1411 "BriefDescription": "Count cases of saving new LBR",
1049 "Counter": "0,1,2,3",
1050 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1051 "CounterMask": "1",
1052 "SampleAfterValue": "2000003",
1053 "CounterHTOff": "0,1,2,3"
1054 },
1055 {
1056 "EventCode": "0xB1",
1057 "UMask": "0x1",
1058 "BriefDescription": "Cycles where at least 2 uops were executed per-thread.",
1059 "Counter": "0,1,2,3",
1060 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1061 "CounterMask": "2",
1062 "SampleAfterValue": "2000003",
1063 "CounterHTOff": "0,1,2,3"
1064 },
1065 {
1066 "EventCode": "0xB1",
1067 "UMask": "0x1",
1068 "BriefDescription": "Cycles where at least 3 uops were executed per-thread.",
1069 "Counter": "0,1,2,3",
1070 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1071 "CounterMask": "3",
1072 "SampleAfterValue": "2000003",
1073 "CounterHTOff": "0,1,2,3"
1074 },
1075 {
1076 "EventCode": "0xB1",
1077 "UMask": "0x1",
1078 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
1079 "Counter": "0,1,2,3", 1412 "Counter": "0,1,2,3",
1080 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC", 1413 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
1081 "CounterMask": "4", 1414 "PublicDescription": "This event counts cases of saving new LBR records by hardware. This assumes proper enabling of LBRs and takes into account LBR filtering done by the LBR_SELECT register.",
1082 "SampleAfterValue": "2000003", 1415 "SampleAfterValue": "2000003",
1083 "CounterHTOff": "0,1,2,3" 1416 "CounterHTOff": "0,1,2,3,4,5,6,7"
1084 }, 1417 },
1085 { 1418 {
1086 "EventCode": "0xe6", 1419 "EventCode": "0xe6",
@@ -1090,328 +1423,5 @@
1090 "EventName": "BACLEARS.ANY", 1423 "EventName": "BACLEARS.ANY",
1091 "SampleAfterValue": "100003", 1424 "SampleAfterValue": "100003",
1092 "CounterHTOff": "0,1,2,3,4,5,6,7" 1425 "CounterHTOff": "0,1,2,3,4,5,6,7"
1093 },
1094 {
1095 "EventCode": "0xA3",
1096 "UMask": "0x8",
1097 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
1098 "Counter": "2",
1099 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
1100 "CounterMask": "8",
1101 "SampleAfterValue": "2000003",
1102 "CounterHTOff": "2"
1103 },
1104 {
1105 "EventCode": "0xA3",
1106 "UMask": "0x1",
1107 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
1108 "Counter": "0,1,2,3",
1109 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
1110 "CounterMask": "1",
1111 "SampleAfterValue": "2000003",
1112 "CounterHTOff": "0,1,2,3,4,5,6,7"
1113 },
1114 {
1115 "EventCode": "0xA3",
1116 "UMask": "0x2",
1117 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
1118 "Counter": "0,1,2,3",
1119 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
1120 "CounterMask": "2",
1121 "SampleAfterValue": "2000003",
1122 "CounterHTOff": "0,1,2,3"
1123 },
1124 {
1125 "EventCode": "0xA3",
1126 "UMask": "0x4",
1127 "BriefDescription": "Total execution stalls.",
1128 "Counter": "0,1,2,3",
1129 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
1130 "CounterMask": "4",
1131 "SampleAfterValue": "2000003",
1132 "CounterHTOff": "0,1,2,3,4,5,6,7"
1133 },
1134 {
1135 "EventCode": "0xA3",
1136 "UMask": "0xc",
1137 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
1138 "Counter": "2",
1139 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
1140 "CounterMask": "12",
1141 "SampleAfterValue": "2000003",
1142 "CounterHTOff": "2"
1143 },
1144 {
1145 "EventCode": "0xA3",
1146 "UMask": "0x5",
1147 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
1148 "Counter": "0,1,2,3",
1149 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
1150 "CounterMask": "5",
1151 "SampleAfterValue": "2000003",
1152 "CounterHTOff": "0,1,2,3,4,5,6,7"
1153 },
1154 {
1155 "EventCode": "0xA3",
1156 "UMask": "0x6",
1157 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
1158 "Counter": "0,1,2,3",
1159 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
1160 "CounterMask": "6",
1161 "SampleAfterValue": "2000003",
1162 "CounterHTOff": "0,1,2,3,4,5,6,7"
1163 },
1164 {
1165 "EdgeDetect": "1",
1166 "EventCode": "0xC3",
1167 "UMask": "0x1",
1168 "BriefDescription": "Number of machine clears (nukes) of any type.",
1169 "Counter": "0,1,2,3",
1170 "EventName": "MACHINE_CLEARS.COUNT",
1171 "CounterMask": "1",
1172 "SampleAfterValue": "100003",
1173 "CounterHTOff": "0,1,2,3,4,5,6,7"
1174 },
1175 {
1176 "EventCode": "0xA8",
1177 "UMask": "0x1",
1178 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1179 "Counter": "0,1,2,3",
1180 "EventName": "LSD.CYCLES_4_UOPS",
1181 "CounterMask": "4",
1182 "SampleAfterValue": "2000003",
1183 "CounterHTOff": "0,1,2,3,4,5,6,7"
1184 },
1185 {
1186 "EdgeDetect": "1",
1187 "Invert": "1",
1188 "EventCode": "0x5E",
1189 "UMask": "0x1",
1190 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1191 "Counter": "0,1,2,3",
1192 "EventName": "RS_EVENTS.EMPTY_END",
1193 "CounterMask": "1",
1194 "SampleAfterValue": "200003",
1195 "CounterHTOff": "0,1,2,3,4,5,6,7"
1196 },
1197 {
1198 "EventCode": "0xA8",
1199 "UMask": "0x1",
1200 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
1201 "Counter": "0,1,2,3",
1202 "EventName": "LSD.CYCLES_ACTIVE",
1203 "CounterMask": "1",
1204 "SampleAfterValue": "2000003",
1205 "CounterHTOff": "0,1,2,3,4,5,6,7"
1206 },
1207 {
1208 "EventCode": "0xA1",
1209 "UMask": "0x1",
1210 "BriefDescription": "Cycles per thread when uops are executed in port 0",
1211 "Counter": "0,1,2,3",
1212 "EventName": "UOPS_EXECUTED_PORT.PORT_0",
1213 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
1214 "SampleAfterValue": "2000003",
1215 "CounterHTOff": "0,1,2,3,4,5,6,7"
1216 },
1217 {
1218 "EventCode": "0xA1",
1219 "UMask": "0x2",
1220 "BriefDescription": "Cycles per thread when uops are executed in port 1",
1221 "Counter": "0,1,2,3",
1222 "EventName": "UOPS_EXECUTED_PORT.PORT_1",
1223 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
1224 "SampleAfterValue": "2000003",
1225 "CounterHTOff": "0,1,2,3,4,5,6,7"
1226 },
1227 {
1228 "EventCode": "0xA1",
1229 "UMask": "0x4",
1230 "BriefDescription": "Cycles per thread when uops are executed in port 2",
1231 "Counter": "0,1,2,3",
1232 "EventName": "UOPS_EXECUTED_PORT.PORT_2",
1233 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
1234 "SampleAfterValue": "2000003",
1235 "CounterHTOff": "0,1,2,3,4,5,6,7"
1236 },
1237 {
1238 "EventCode": "0xA1",
1239 "UMask": "0x8",
1240 "BriefDescription": "Cycles per thread when uops are executed in port 3",
1241 "Counter": "0,1,2,3",
1242 "EventName": "UOPS_EXECUTED_PORT.PORT_3",
1243 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
1244 "SampleAfterValue": "2000003",
1245 "CounterHTOff": "0,1,2,3,4,5,6,7"
1246 },
1247 {
1248 "EventCode": "0xA1",
1249 "UMask": "0x10",
1250 "BriefDescription": "Cycles per thread when uops are executed in port 4",
1251 "Counter": "0,1,2,3",
1252 "EventName": "UOPS_EXECUTED_PORT.PORT_4",
1253 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
1254 "SampleAfterValue": "2000003",
1255 "CounterHTOff": "0,1,2,3,4,5,6,7"
1256 },
1257 {
1258 "EventCode": "0xA1",
1259 "UMask": "0x20",
1260 "BriefDescription": "Cycles per thread when uops are executed in port 5",
1261 "Counter": "0,1,2,3",
1262 "EventName": "UOPS_EXECUTED_PORT.PORT_5",
1263 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
1264 "SampleAfterValue": "2000003",
1265 "CounterHTOff": "0,1,2,3,4,5,6,7"
1266 },
1267 {
1268 "EventCode": "0xA1",
1269 "UMask": "0x40",
1270 "BriefDescription": "Cycles per thread when uops are executed in port 6",
1271 "Counter": "0,1,2,3",
1272 "EventName": "UOPS_EXECUTED_PORT.PORT_6",
1273 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
1274 "SampleAfterValue": "2000003",
1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
1276 },
1277 {
1278 "EventCode": "0xA1",
1279 "UMask": "0x80",
1280 "BriefDescription": "Cycles per thread when uops are executed in port 7",
1281 "Counter": "0,1,2,3",
1282 "EventName": "UOPS_EXECUTED_PORT.PORT_7",
1283 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
1284 "SampleAfterValue": "2000003",
1285 "CounterHTOff": "0,1,2,3,4,5,6,7"
1286 },
1287 {
1288 "EventCode": "0xA0",
1289 "UMask": "0x3",
1290 "BriefDescription": "Micro-op dispatches cancelled due to insufficient SIMD physical register file read ports",
1291 "Counter": "0,1,2,3",
1292 "EventName": "UOP_DISPATCHES_CANCELLED.SIMD_PRF",
1293 "PublicDescription": "This event counts the number of micro-operations cancelled after they were dispatched from the scheduler to the execution units when the total number of physical register read ports across all dispatch ports exceeds the read bandwidth of the physical register file. The SIMD_PRF subevent applies to the following instructions: VDPPS, DPPS, VPCMPESTRI, PCMPESTRI, VPCMPESTRM, PCMPESTRM, VFMADD*, VFMADDSUB*, VFMSUB*, VMSUBADD*, VFNMADD*, VFNMSUB*. See the Broadwell Optimization Guide for more information.",
1294 "SampleAfterValue": "2000003",
1295 "CounterHTOff": "0,1,2,3"
1296 },
1297 {
1298 "EventCode": "0x00",
1299 "UMask": "0x2",
1300 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1301 "Counter": "Fixed counter 2",
1302 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1303 "AnyThread": "1",
1304 "SampleAfterValue": "2000003",
1305 "CounterHTOff": "Fixed counter 2"
1306 },
1307 {
1308 "EventCode": "0x3C",
1309 "UMask": "0x0",
1310 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1311 "Counter": "0,1,2,3",
1312 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1313 "AnyThread": "1",
1314 "SampleAfterValue": "2000003",
1315 "CounterHTOff": "0,1,2,3,4,5,6,7"
1316 },
1317 {
1318 "EventCode": "0x3C",
1319 "UMask": "0x1",
1320 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1321 "Counter": "0,1,2,3",
1322 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1323 "AnyThread": "1",
1324 "SampleAfterValue": "2000003",
1325 "CounterHTOff": "0,1,2,3,4,5,6,7"
1326 },
1327 {
1328 "EventCode": "0x0D",
1329 "UMask": "0x3",
1330 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1331 "Counter": "0,1,2,3",
1332 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1333 "AnyThread": "1",
1334 "CounterMask": "1",
1335 "SampleAfterValue": "2000003",
1336 "CounterHTOff": "0,1,2,3,4,5,6,7"
1337 },
1338 {
1339 "EventCode": "0xb1",
1340 "UMask": "0x2",
1341 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1342 "Counter": "0,1,2,3",
1343 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1344 "CounterMask": "1",
1345 "SampleAfterValue": "2000003",
1346 "CounterHTOff": "0,1,2,3,4,5,6,7"
1347 },
1348 {
1349 "EventCode": "0xb1",
1350 "UMask": "0x2",
1351 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1352 "Counter": "0,1,2,3",
1353 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1354 "CounterMask": "2",
1355 "SampleAfterValue": "2000003",
1356 "CounterHTOff": "0,1,2,3,4,5,6,7"
1357 },
1358 {
1359 "EventCode": "0xb1",
1360 "UMask": "0x2",
1361 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1362 "Counter": "0,1,2,3",
1363 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1364 "CounterMask": "3",
1365 "SampleAfterValue": "2000003",
1366 "CounterHTOff": "0,1,2,3,4,5,6,7"
1367 },
1368 {
1369 "EventCode": "0xb1",
1370 "UMask": "0x2",
1371 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1372 "Counter": "0,1,2,3",
1373 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1374 "CounterMask": "4",
1375 "SampleAfterValue": "2000003",
1376 "CounterHTOff": "0,1,2,3,4,5,6,7"
1377 },
1378 {
1379 "Invert": "1",
1380 "EventCode": "0xb1",
1381 "UMask": "0x2",
1382 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1383 "Counter": "0,1,2,3",
1384 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1385 "SampleAfterValue": "2000003",
1386 "CounterHTOff": "0,1,2,3,4,5,6,7"
1387 },
1388 {
1389 "EventCode": "0x3C",
1390 "UMask": "0x1",
1391 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1392 "Counter": "0,1,2,3",
1393 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1394 "PublicDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate).",
1395 "SampleAfterValue": "2000003",
1396 "CounterHTOff": "0,1,2,3,4,5,6,7"
1397 },
1398 {
1399 "EventCode": "0x3C",
1400 "UMask": "0x1",
1401 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1402 "Counter": "0,1,2,3",
1403 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1404 "AnyThread": "1",
1405 "SampleAfterValue": "2000003",
1406 "CounterHTOff": "0,1,2,3,4,5,6,7"
1407 },
1408 {
1409 "EventCode": "0x3C",
1410 "UMask": "0x2",
1411 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1412 "Counter": "0,1,2,3",
1413 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1414 "SampleAfterValue": "2000003",
1415 "CounterHTOff": "0,1,2,3,4,5,6,7"
1416 } 1426 }
1417] \ No newline at end of file 1427] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/virtual-memory.json b/tools/perf/pmu-events/arch/x86/broadwellde/virtual-memory.json
index 5ce8b67ba076..7d79c707c6d1 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/virtual-memory.json
@@ -45,6 +45,16 @@
45 }, 45 },
46 { 46 {
47 "EventCode": "0x08", 47 "EventCode": "0x08",
48 "UMask": "0xe",
49 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
50 "Counter": "0,1,2,3",
51 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
52 "Errata": "BDM69",
53 "SampleAfterValue": "100003",
54 "CounterHTOff": "0,1,2,3,4,5,6,7"
55 },
56 {
57 "EventCode": "0x08",
48 "UMask": "0x10", 58 "UMask": "0x10",
49 "BriefDescription": "Cycles when PMH is busy with page walks", 59 "BriefDescription": "Cycles when PMH is busy with page walks",
50 "Counter": "0,1,2,3", 60 "Counter": "0,1,2,3",
@@ -73,6 +83,15 @@
73 "CounterHTOff": "0,1,2,3,4,5,6,7" 83 "CounterHTOff": "0,1,2,3,4,5,6,7"
74 }, 84 },
75 { 85 {
86 "EventCode": "0x08",
87 "UMask": "0x60",
88 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks.",
89 "Counter": "0,1,2,3",
90 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
91 "SampleAfterValue": "2000003",
92 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 },
94 {
76 "EventCode": "0x49", 95 "EventCode": "0x49",
77 "UMask": "0x1", 96 "UMask": "0x1",
78 "BriefDescription": "Store misses in all DTLB levels that cause page walks", 97 "BriefDescription": "Store misses in all DTLB levels that cause page walks",
@@ -118,6 +137,16 @@
118 }, 137 },
119 { 138 {
120 "EventCode": "0x49", 139 "EventCode": "0x49",
140 "UMask": "0xe",
141 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks.",
142 "Counter": "0,1,2,3",
143 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
144 "Errata": "BDM69",
145 "SampleAfterValue": "100003",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
149 "EventCode": "0x49",
121 "UMask": "0x10", 150 "UMask": "0x10",
122 "BriefDescription": "Cycles when PMH is busy with page walks", 151 "BriefDescription": "Cycles when PMH is busy with page walks",
123 "Counter": "0,1,2,3", 152 "Counter": "0,1,2,3",
@@ -146,6 +175,15 @@
146 "CounterHTOff": "0,1,2,3,4,5,6,7" 175 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 }, 176 },
148 { 177 {
178 "EventCode": "0x49",
179 "UMask": "0x60",
180 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
181 "Counter": "0,1,2,3",
182 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
183 "SampleAfterValue": "100003",
184 "CounterHTOff": "0,1,2,3,4,5,6,7"
185 },
186 {
149 "EventCode": "0x4F", 187 "EventCode": "0x4F",
150 "UMask": "0x10", 188 "UMask": "0x10",
151 "BriefDescription": "Cycle count for an Extended Page table walk.", 189 "BriefDescription": "Cycle count for an Extended Page table walk.",
@@ -201,6 +239,16 @@
201 }, 239 },
202 { 240 {
203 "EventCode": "0x85", 241 "EventCode": "0x85",
242 "UMask": "0xe",
243 "BriefDescription": "Misses in all ITLB levels that cause completed page walks.",
244 "Counter": "0,1,2,3",
245 "EventName": "ITLB_MISSES.WALK_COMPLETED",
246 "Errata": "BDM69",
247 "SampleAfterValue": "100003",
248 "CounterHTOff": "0,1,2,3,4,5,6,7"
249 },
250 {
251 "EventCode": "0x85",
204 "UMask": "0x10", 252 "UMask": "0x10",
205 "BriefDescription": "Cycles when PMH is busy with page walks", 253 "BriefDescription": "Cycles when PMH is busy with page walks",
206 "Counter": "0,1,2,3", 254 "Counter": "0,1,2,3",
@@ -229,6 +277,15 @@
229 "CounterHTOff": "0,1,2,3,4,5,6,7" 277 "CounterHTOff": "0,1,2,3,4,5,6,7"
230 }, 278 },
231 { 279 {
280 "EventCode": "0x85",
281 "UMask": "0x60",
282 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks.",
283 "Counter": "0,1,2,3",
284 "EventName": "ITLB_MISSES.STLB_HIT",
285 "SampleAfterValue": "100003",
286 "CounterHTOff": "0,1,2,3,4,5,6,7"
287 },
288 {
232 "EventCode": "0xAE", 289 "EventCode": "0xAE",
233 "UMask": "0x1", 290 "UMask": "0x1",
234 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.", 291 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.",
@@ -250,60 +307,60 @@
250 }, 307 },
251 { 308 {
252 "EventCode": "0xBC", 309 "EventCode": "0xBC",
253 "UMask": "0x21", 310 "UMask": "0x12",
254 "BriefDescription": "Number of ITLB page walker hits in the L1+FB.", 311 "BriefDescription": "Number of DTLB page walker hits in the L2.",
255 "Counter": "0,1,2,3", 312 "Counter": "0,1,2,3",
256 "EventName": "PAGE_WALKER_LOADS.ITLB_L1", 313 "EventName": "PAGE_WALKER_LOADS.DTLB_L2",
257 "Errata": "BDM69, BDM98", 314 "Errata": "BDM69, BDM98",
258 "SampleAfterValue": "2000003", 315 "SampleAfterValue": "2000003",
259 "CounterHTOff": "0,1,2,3" 316 "CounterHTOff": "0,1,2,3"
260 }, 317 },
261 { 318 {
262 "EventCode": "0xBC", 319 "EventCode": "0xBC",
263 "UMask": "0x12", 320 "UMask": "0x14",
264 "BriefDescription": "Number of DTLB page walker hits in the L2.", 321 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP.",
265 "Counter": "0,1,2,3", 322 "Counter": "0,1,2,3",
266 "EventName": "PAGE_WALKER_LOADS.DTLB_L2", 323 "EventName": "PAGE_WALKER_LOADS.DTLB_L3",
267 "Errata": "BDM69, BDM98", 324 "Errata": "BDM69, BDM98",
268 "SampleAfterValue": "2000003", 325 "SampleAfterValue": "2000003",
269 "CounterHTOff": "0,1,2,3" 326 "CounterHTOff": "0,1,2,3"
270 }, 327 },
271 { 328 {
272 "EventCode": "0xBC", 329 "EventCode": "0xBC",
273 "UMask": "0x22", 330 "UMask": "0x18",
274 "BriefDescription": "Number of ITLB page walker hits in the L2.", 331 "BriefDescription": "Number of DTLB page walker hits in Memory.",
275 "Counter": "0,1,2,3", 332 "Counter": "0,1,2,3",
276 "EventName": "PAGE_WALKER_LOADS.ITLB_L2", 333 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY",
277 "Errata": "BDM69, BDM98", 334 "Errata": "BDM69, BDM98",
278 "SampleAfterValue": "2000003", 335 "SampleAfterValue": "2000003",
279 "CounterHTOff": "0,1,2,3" 336 "CounterHTOff": "0,1,2,3"
280 }, 337 },
281 { 338 {
282 "EventCode": "0xBC", 339 "EventCode": "0xBC",
283 "UMask": "0x14", 340 "UMask": "0x21",
284 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP.", 341 "BriefDescription": "Number of ITLB page walker hits in the L1+FB.",
285 "Counter": "0,1,2,3", 342 "Counter": "0,1,2,3",
286 "EventName": "PAGE_WALKER_LOADS.DTLB_L3", 343 "EventName": "PAGE_WALKER_LOADS.ITLB_L1",
287 "Errata": "BDM69, BDM98", 344 "Errata": "BDM69, BDM98",
288 "SampleAfterValue": "2000003", 345 "SampleAfterValue": "2000003",
289 "CounterHTOff": "0,1,2,3" 346 "CounterHTOff": "0,1,2,3"
290 }, 347 },
291 { 348 {
292 "EventCode": "0xBC", 349 "EventCode": "0xBC",
293 "UMask": "0x24", 350 "UMask": "0x22",
294 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP.", 351 "BriefDescription": "Number of ITLB page walker hits in the L2.",
295 "Counter": "0,1,2,3", 352 "Counter": "0,1,2,3",
296 "EventName": "PAGE_WALKER_LOADS.ITLB_L3", 353 "EventName": "PAGE_WALKER_LOADS.ITLB_L2",
297 "Errata": "BDM69, BDM98", 354 "Errata": "BDM69, BDM98",
298 "SampleAfterValue": "2000003", 355 "SampleAfterValue": "2000003",
299 "CounterHTOff": "0,1,2,3" 356 "CounterHTOff": "0,1,2,3"
300 }, 357 },
301 { 358 {
302 "EventCode": "0xBC", 359 "EventCode": "0xBC",
303 "UMask": "0x18", 360 "UMask": "0x24",
304 "BriefDescription": "Number of DTLB page walker hits in Memory.", 361 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP.",
305 "Counter": "0,1,2,3", 362 "Counter": "0,1,2,3",
306 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY", 363 "EventName": "PAGE_WALKER_LOADS.ITLB_L3",
307 "Errata": "BDM69, BDM98", 364 "Errata": "BDM69, BDM98",
308 "SampleAfterValue": "2000003", 365 "SampleAfterValue": "2000003",
309 "CounterHTOff": "0,1,2,3" 366 "CounterHTOff": "0,1,2,3"
@@ -327,62 +384,5 @@
327 "PublicDescription": "This event counts the number of any STLB flush attempts (such as entire, VPID, PCID, InvPage, CR3 write, and so on).", 384 "PublicDescription": "This event counts the number of any STLB flush attempts (such as entire, VPID, PCID, InvPage, CR3 write, and so on).",
328 "SampleAfterValue": "100007", 385 "SampleAfterValue": "100007",
329 "CounterHTOff": "0,1,2,3,4,5,6,7" 386 "CounterHTOff": "0,1,2,3,4,5,6,7"
330 },
331 {
332 "EventCode": "0x08",
333 "UMask": "0xe",
334 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
335 "Counter": "0,1,2,3",
336 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
337 "Errata": "BDM69",
338 "SampleAfterValue": "100003",
339 "CounterHTOff": "0,1,2,3,4,5,6,7"
340 },
341 {
342 "EventCode": "0x08",
343 "UMask": "0x60",
344 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks.",
345 "Counter": "0,1,2,3",
346 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
347 "SampleAfterValue": "2000003",
348 "CounterHTOff": "0,1,2,3,4,5,6,7"
349 },
350 {
351 "EventCode": "0x49",
352 "UMask": "0xe",
353 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks.",
354 "Counter": "0,1,2,3",
355 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
356 "Errata": "BDM69",
357 "SampleAfterValue": "100003",
358 "CounterHTOff": "0,1,2,3,4,5,6,7"
359 },
360 {
361 "EventCode": "0x49",
362 "UMask": "0x60",
363 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
364 "Counter": "0,1,2,3",
365 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
366 "SampleAfterValue": "100003",
367 "CounterHTOff": "0,1,2,3,4,5,6,7"
368 },
369 {
370 "EventCode": "0x85",
371 "UMask": "0xe",
372 "BriefDescription": "Misses in all ITLB levels that cause completed page walks.",
373 "Counter": "0,1,2,3",
374 "EventName": "ITLB_MISSES.WALK_COMPLETED",
375 "Errata": "BDM69",
376 "SampleAfterValue": "100003",
377 "CounterHTOff": "0,1,2,3,4,5,6,7"
378 },
379 {
380 "EventCode": "0x85",
381 "UMask": "0x60",
382 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks.",
383 "Counter": "0,1,2,3",
384 "EventName": "ITLB_MISSES.STLB_HIT",
385 "SampleAfterValue": "100003",
386 "CounterHTOff": "0,1,2,3,4,5,6,7"
387 } 387 }
388] \ No newline at end of file 388] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/cache.json b/tools/perf/pmu-events/arch/x86/broadwellx/cache.json
index d1d043829b95..bf0c51272068 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/cache.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/cache.json
@@ -11,11 +11,28 @@
11 }, 11 },
12 { 12 {
13 "EventCode": "0x24", 13 "EventCode": "0x24",
14 "UMask": "0x41", 14 "UMask": "0x22",
15 "BriefDescription": "Demand Data Read requests that hit L2 cache", 15 "BriefDescription": "RFO requests that miss L2 cache.",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT", 17 "EventName": "L2_RQSTS.RFO_MISS",
18 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.", 18 "SampleAfterValue": "200003",
19 "CounterHTOff": "0,1,2,3,4,5,6,7"
20 },
21 {
22 "EventCode": "0x24",
23 "UMask": "0x24",
24 "BriefDescription": "L2 cache misses when fetching instructions.",
25 "Counter": "0,1,2,3",
26 "EventName": "L2_RQSTS.CODE_RD_MISS",
27 "SampleAfterValue": "200003",
28 "CounterHTOff": "0,1,2,3,4,5,6,7"
29 },
30 {
31 "EventCode": "0x24",
32 "UMask": "0x27",
33 "BriefDescription": "Demand requests that miss L2 cache.",
34 "Counter": "0,1,2,3",
35 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
19 "SampleAfterValue": "200003", 36 "SampleAfterValue": "200003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 37 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 38 },
@@ -31,6 +48,43 @@
31 }, 48 },
32 { 49 {
33 "EventCode": "0x24", 50 "EventCode": "0x24",
51 "UMask": "0x3f",
52 "BriefDescription": "All requests that miss L2 cache.",
53 "Counter": "0,1,2,3",
54 "EventName": "L2_RQSTS.MISS",
55 "SampleAfterValue": "200003",
56 "CounterHTOff": "0,1,2,3,4,5,6,7"
57 },
58 {
59 "EventCode": "0x24",
60 "UMask": "0x41",
61 "BriefDescription": "Demand Data Read requests that hit L2 cache",
62 "Counter": "0,1,2,3",
63 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT",
64 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.",
65 "SampleAfterValue": "200003",
66 "CounterHTOff": "0,1,2,3,4,5,6,7"
67 },
68 {
69 "EventCode": "0x24",
70 "UMask": "0x42",
71 "BriefDescription": "RFO requests that hit L2 cache.",
72 "Counter": "0,1,2,3",
73 "EventName": "L2_RQSTS.RFO_HIT",
74 "SampleAfterValue": "200003",
75 "CounterHTOff": "0,1,2,3,4,5,6,7"
76 },
77 {
78 "EventCode": "0x24",
79 "UMask": "0x44",
80 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
81 "Counter": "0,1,2,3",
82 "EventName": "L2_RQSTS.CODE_RD_HIT",
83 "SampleAfterValue": "200003",
84 "CounterHTOff": "0,1,2,3,4,5,6,7"
85 },
86 {
87 "EventCode": "0x24",
34 "UMask": "0x50", 88 "UMask": "0x50",
35 "BriefDescription": "L2 prefetch requests that hit L2 cache", 89 "BriefDescription": "L2 prefetch requests that hit L2 cache",
36 "Counter": "0,1,2,3", 90 "Counter": "0,1,2,3",
@@ -71,6 +125,15 @@
71 }, 125 },
72 { 126 {
73 "EventCode": "0x24", 127 "EventCode": "0x24",
128 "UMask": "0xe7",
129 "BriefDescription": "Demand requests to L2 cache.",
130 "Counter": "0,1,2,3",
131 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
132 "SampleAfterValue": "200003",
133 "CounterHTOff": "0,1,2,3,4,5,6,7"
134 },
135 {
136 "EventCode": "0x24",
74 "UMask": "0xf8", 137 "UMask": "0xf8",
75 "BriefDescription": "Requests from L2 hardware prefetchers", 138 "BriefDescription": "Requests from L2 hardware prefetchers",
76 "Counter": "0,1,2,3", 139 "Counter": "0,1,2,3",
@@ -80,6 +143,15 @@
80 "CounterHTOff": "0,1,2,3,4,5,6,7" 143 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 }, 144 },
82 { 145 {
146 "EventCode": "0x24",
147 "UMask": "0xff",
148 "BriefDescription": "All L2 requests.",
149 "Counter": "0,1,2,3",
150 "EventName": "L2_RQSTS.REFERENCES",
151 "SampleAfterValue": "200003",
152 "CounterHTOff": "0,1,2,3,4,5,6,7"
153 },
154 {
83 "EventCode": "0x27", 155 "EventCode": "0x27",
84 "UMask": "0x50", 156 "UMask": "0x50",
85 "BriefDescription": "Not rejected writebacks that hit L2 cache", 157 "BriefDescription": "Not rejected writebacks that hit L2 cache",
@@ -131,6 +203,27 @@
131 "CounterHTOff": "2" 203 "CounterHTOff": "2"
132 }, 204 },
133 { 205 {
206 "EventCode": "0x48",
207 "UMask": "0x1",
208 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
209 "Counter": "2",
210 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
211 "AnyThread": "1",
212 "CounterMask": "1",
213 "SampleAfterValue": "2000003",
214 "CounterHTOff": "2"
215 },
216 {
217 "EventCode": "0x48",
218 "UMask": "0x2",
219 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
220 "Counter": "0,1,2,3",
221 "EventName": "L1D_PEND_MISS.FB_FULL",
222 "CounterMask": "1",
223 "SampleAfterValue": "2000003",
224 "CounterHTOff": "0,1,2,3,4,5,6,7"
225 },
226 {
134 "EventCode": "0x51", 227 "EventCode": "0x51",
135 "UMask": "0x1", 228 "UMask": "0x1",
136 "BriefDescription": "L1D data line replacements", 229 "BriefDescription": "L1D data line replacements",
@@ -153,12 +246,35 @@
153 }, 246 },
154 { 247 {
155 "EventCode": "0x60", 248 "EventCode": "0x60",
249 "UMask": "0x1",
250 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
251 "Counter": "0,1,2,3",
252 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
253 "CounterMask": "1",
254 "Errata": "BDM76",
255 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).",
256 "SampleAfterValue": "2000003",
257 "CounterHTOff": "0,1,2,3,4,5,6,7"
258 },
259 {
260 "EventCode": "0x60",
261 "UMask": "0x1",
262 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
263 "Counter": "0,1,2,3",
264 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
265 "CounterMask": "6",
266 "Errata": "BDM76",
267 "SampleAfterValue": "2000003",
268 "CounterHTOff": "0,1,2,3,4,5,6,7"
269 },
270 {
271 "EventCode": "0x60",
156 "UMask": "0x2", 272 "UMask": "0x2",
157 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 273 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
158 "Counter": "0,1,2,3", 274 "Counter": "0,1,2,3",
159 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", 275 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
160 "Errata": "BDM76", 276 "Errata": "BDM76",
161 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The \"Offcore outstanding\" state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.", 277 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The Offcore outstanding state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
162 "SampleAfterValue": "2000003", 278 "SampleAfterValue": "2000003",
163 "CounterHTOff": "0,1,2,3,4,5,6,7" 279 "CounterHTOff": "0,1,2,3,4,5,6,7"
164 }, 280 },
@@ -175,24 +291,24 @@
175 }, 291 },
176 { 292 {
177 "EventCode": "0x60", 293 "EventCode": "0x60",
178 "UMask": "0x8", 294 "UMask": "0x4",
179 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore", 295 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
180 "Counter": "0,1,2,3", 296 "Counter": "0,1,2,3",
181 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 297 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
298 "CounterMask": "1",
182 "Errata": "BDM76", 299 "Errata": "BDM76",
183 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.", 300 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The Offcore outstanding state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
184 "SampleAfterValue": "2000003", 301 "SampleAfterValue": "2000003",
185 "CounterHTOff": "0,1,2,3,4,5,6,7" 302 "CounterHTOff": "0,1,2,3,4,5,6,7"
186 }, 303 },
187 { 304 {
188 "EventCode": "0x60", 305 "EventCode": "0x60",
189 "UMask": "0x1", 306 "UMask": "0x8",
190 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore", 307 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
191 "Counter": "0,1,2,3", 308 "Counter": "0,1,2,3",
192 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD", 309 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
193 "CounterMask": "1",
194 "Errata": "BDM76", 310 "Errata": "BDM76",
195 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).", 311 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
196 "SampleAfterValue": "2000003", 312 "SampleAfterValue": "2000003",
197 "CounterHTOff": "0,1,2,3,4,5,6,7" 313 "CounterHTOff": "0,1,2,3,4,5,6,7"
198 }, 314 },
@@ -209,18 +325,6 @@
209 "CounterHTOff": "0,1,2,3,4,5,6,7" 325 "CounterHTOff": "0,1,2,3,4,5,6,7"
210 }, 326 },
211 { 327 {
212 "EventCode": "0x60",
213 "UMask": "0x4",
214 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
215 "Counter": "0,1,2,3",
216 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
217 "CounterMask": "1",
218 "Errata": "BDM76",
219 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The \"Offcore outstanding\" state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
220 "SampleAfterValue": "2000003",
221 "CounterHTOff": "0,1,2,3,4,5,6,7"
222 },
223 {
224 "EventCode": "0x63", 328 "EventCode": "0x63",
225 "UMask": "0x2", 329 "UMask": "0x2",
226 "BriefDescription": "Cycles when L1D is locked", 330 "BriefDescription": "Cycles when L1D is locked",
@@ -266,7 +370,7 @@
266 "BriefDescription": "Demand and prefetch data reads", 370 "BriefDescription": "Demand and prefetch data reads",
267 "Counter": "0,1,2,3", 371 "Counter": "0,1,2,3",
268 "EventName": "OFFCORE_REQUESTS.ALL_DATA_RD", 372 "EventName": "OFFCORE_REQUESTS.ALL_DATA_RD",
269 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable \"Demands\" and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.", 373 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable Demands and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.",
270 "SampleAfterValue": "100003", 374 "SampleAfterValue": "100003",
271 "CounterHTOff": "0,1,2,3,4,5,6,7" 375 "CounterHTOff": "0,1,2,3,4,5,6,7"
272 }, 376 },
@@ -281,26 +385,35 @@
281 "CounterHTOff": "0,1,2,3,4,5,6,7" 385 "CounterHTOff": "0,1,2,3,4,5,6,7"
282 }, 386 },
283 { 387 {
388 "EventCode": "0xB7, 0xBB",
389 "UMask": "0x1",
390 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
391 "Counter": "0,1,2,3",
392 "EventName": "OFFCORE_RESPONSE",
393 "SampleAfterValue": "100003",
394 "CounterHTOff": "0,1,2,3"
395 },
396 {
284 "EventCode": "0xD0", 397 "EventCode": "0xD0",
285 "UMask": "0x11", 398 "UMask": "0x11",
286 "BriefDescription": "Retired load uops that miss the STLB.", 399 "BriefDescription": "Retired load uops that miss the STLB. (Precise Event - PEBS)",
287 "Data_LA": "1", 400 "Data_LA": "1",
288 "PEBS": "1", 401 "PEBS": "1",
289 "Counter": "0,1,2,3", 402 "Counter": "0,1,2,3",
290 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS", 403 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS",
291 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts load uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.", 404 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.",
292 "SampleAfterValue": "100003", 405 "SampleAfterValue": "100003",
293 "CounterHTOff": "0,1,2,3" 406 "CounterHTOff": "0,1,2,3"
294 }, 407 },
295 { 408 {
296 "EventCode": "0xD0", 409 "EventCode": "0xD0",
297 "UMask": "0x12", 410 "UMask": "0x12",
298 "BriefDescription": "Retired store uops that miss the STLB.", 411 "BriefDescription": "Retired store uops that miss the STLB. (Precise Event - PEBS)",
299 "Data_LA": "1", 412 "Data_LA": "1",
300 "PEBS": "1", 413 "PEBS": "1",
301 "Counter": "0,1,2,3", 414 "Counter": "0,1,2,3",
302 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 415 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
303 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts store uops with true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.", 416 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts store uops true STLB miss retired to the architected path. True STLB miss is an uop triggering page walk that gets completed without blocks, and later gets retired. This page walk can end up with or without a fault.",
304 "SampleAfterValue": "100003", 417 "SampleAfterValue": "100003",
305 "L1_Hit_Indication": "1", 418 "L1_Hit_Indication": "1",
306 "CounterHTOff": "0,1,2,3" 419 "CounterHTOff": "0,1,2,3"
@@ -308,37 +421,37 @@
308 { 421 {
309 "EventCode": "0xD0", 422 "EventCode": "0xD0",
310 "UMask": "0x21", 423 "UMask": "0x21",
311 "BriefDescription": "Retired load uops with locked access.", 424 "BriefDescription": "Retired load uops with locked access. (Precise Event - PEBS)",
312 "Data_LA": "1", 425 "Data_LA": "1",
313 "PEBS": "1", 426 "PEBS": "1",
314 "Counter": "0,1,2,3", 427 "Counter": "0,1,2,3",
315 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 428 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
316 "Errata": "BDM35", 429 "Errata": "BDM35",
317 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts load uops with locked access retired to the architected path.", 430 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops with locked access retired to the architected path.",
318 "SampleAfterValue": "100007", 431 "SampleAfterValue": "100007",
319 "CounterHTOff": "0,1,2,3" 432 "CounterHTOff": "0,1,2,3"
320 }, 433 },
321 { 434 {
322 "EventCode": "0xD0", 435 "EventCode": "0xD0",
323 "UMask": "0x41", 436 "UMask": "0x41",
324 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 437 "BriefDescription": "Retired load uops that split across a cacheline boundary.(Precise Event - PEBS)",
325 "Data_LA": "1", 438 "Data_LA": "1",
326 "PEBS": "1", 439 "PEBS": "1",
327 "Counter": "0,1,2,3", 440 "Counter": "0,1,2,3",
328 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 441 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
329 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts line-splitted load uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).", 442 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts line-splitted load uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).",
330 "SampleAfterValue": "100003", 443 "SampleAfterValue": "100003",
331 "CounterHTOff": "0,1,2,3" 444 "CounterHTOff": "0,1,2,3"
332 }, 445 },
333 { 446 {
334 "EventCode": "0xD0", 447 "EventCode": "0xD0",
335 "UMask": "0x42", 448 "UMask": "0x42",
336 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 449 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event - PEBS)",
337 "Data_LA": "1", 450 "Data_LA": "1",
338 "PEBS": "1", 451 "PEBS": "1",
339 "Counter": "0,1,2,3", 452 "Counter": "0,1,2,3",
340 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 453 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
341 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts line-splitted store uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).", 454 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts line-splitted store uops retired to the architected path. A line split is across 64B cache-line which includes a page split (4K).",
342 "SampleAfterValue": "100003", 455 "SampleAfterValue": "100003",
343 "L1_Hit_Indication": "1", 456 "L1_Hit_Indication": "1",
344 "CounterHTOff": "0,1,2,3" 457 "CounterHTOff": "0,1,2,3"
@@ -346,24 +459,24 @@
346 { 459 {
347 "EventCode": "0xD0", 460 "EventCode": "0xD0",
348 "UMask": "0x81", 461 "UMask": "0x81",
349 "BriefDescription": "All retired load uops.", 462 "BriefDescription": "All retired load uops. (Precise Event - PEBS)",
350 "Data_LA": "1", 463 "Data_LA": "1",
351 "PEBS": "1", 464 "PEBS": "1",
352 "Counter": "0,1,2,3", 465 "Counter": "0,1,2,3",
353 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 466 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
354 "PublicDescription": "This event counts load uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event counts AVX-256bit load/store double-pump memory uops as a single uop at retirement. This event also counts SW prefetches.", 467 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts load uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event ?ounts AVX-256bit load/store double-pump memory uops as a single uop at retirement. This event also counts SW prefetches.",
355 "SampleAfterValue": "2000003", 468 "SampleAfterValue": "2000003",
356 "CounterHTOff": "0,1,2,3" 469 "CounterHTOff": "0,1,2,3"
357 }, 470 },
358 { 471 {
359 "EventCode": "0xD0", 472 "EventCode": "0xD0",
360 "UMask": "0x82", 473 "UMask": "0x82",
361 "BriefDescription": "All retired store uops.", 474 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event - PEBS)",
362 "Data_LA": "1", 475 "Data_LA": "1",
363 "PEBS": "1", 476 "PEBS": "1",
364 "Counter": "0,1,2,3", 477 "Counter": "0,1,2,3",
365 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 478 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
366 "PublicDescription": "This event counts store uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event counts AVX-256bit load/store double-pump memory uops as a single uop at retirement.", 479 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts store uops retired to the architected path with a filter on bits 0 and 1 applied.\nNote: This event ?ounts AVX-256bit load/store double-pump memory uops as a single uop at retirement.",
367 "SampleAfterValue": "2000003", 480 "SampleAfterValue": "2000003",
368 "L1_Hit_Indication": "1", 481 "L1_Hit_Indication": "1",
369 "CounterHTOff": "0,1,2,3" 482 "CounterHTOff": "0,1,2,3"
@@ -371,69 +484,69 @@
371 { 484 {
372 "EventCode": "0xD1", 485 "EventCode": "0xD1",
373 "UMask": "0x1", 486 "UMask": "0x1",
374 "BriefDescription": "Retired load uops with L1 cache hits as data sources.", 487 "BriefDescription": "Retired load uops with L1 cache hits as data sources. (Precise Event - PEBS)",
375 "Data_LA": "1", 488 "Data_LA": "1",
376 "PEBS": "1", 489 "PEBS": "1",
377 "Counter": "0,1,2,3", 490 "Counter": "0,1,2,3",
378 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT", 491 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT",
379 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the nearest-level (L1) cache.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load. This event also counts SW prefetches independent of the actual data source.", 492 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data source were hits in the nearest-level (L1) cache.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load. This event also counts SW prefetches independent of the actual data source.",
380 "SampleAfterValue": "2000003", 493 "SampleAfterValue": "2000003",
381 "CounterHTOff": "0,1,2,3" 494 "CounterHTOff": "0,1,2,3"
382 }, 495 },
383 { 496 {
384 "EventCode": "0xD1", 497 "EventCode": "0xD1",
385 "UMask": "0x2", 498 "UMask": "0x2",
386 "BriefDescription": "Retired load uops with L2 cache hits as data sources.", 499 "BriefDescription": "Retired load uops with L2 cache hits as data sources. (Precise Event - PEBS)",
387 "Data_LA": "1", 500 "Data_LA": "1",
388 "PEBS": "1", 501 "PEBS": "1",
389 "Counter": "0,1,2,3", 502 "Counter": "0,1,2,3",
390 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 503 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT",
391 "Errata": "BDM35", 504 "Errata": "BDM35",
392 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the mid-level (L2) cache.", 505 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were hits in the mid-level (L2) cache.",
393 "SampleAfterValue": "100003", 506 "SampleAfterValue": "100003",
394 "CounterHTOff": "0,1,2,3" 507 "CounterHTOff": "0,1,2,3"
395 }, 508 },
396 { 509 {
397 "EventCode": "0xD1", 510 "EventCode": "0xD1",
398 "UMask": "0x4", 511 "UMask": "0x4",
399 "BriefDescription": "Retired load uops which data sources were data hits in L3 without snoops required.", 512 "BriefDescription": "Hit in last-level (L3) cache. Excludes Unknown data-source. (Precise Event - PEBS)",
400 "Data_LA": "1", 513 "Data_LA": "1",
401 "PEBS": "1", 514 "PEBS": "1",
402 "Counter": "0,1,2,3", 515 "Counter": "0,1,2,3",
403 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT", 516 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT",
404 "Errata": "BDM100", 517 "Errata": "BDM100",
405 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were data hits in the last-level (L3) cache without snoops required.", 518 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were data hits in the last-level (L3) cache without snoops required.",
406 "SampleAfterValue": "50021", 519 "SampleAfterValue": "50021",
407 "CounterHTOff": "0,1,2,3" 520 "CounterHTOff": "0,1,2,3"
408 }, 521 },
409 { 522 {
410 "EventCode": "0xD1", 523 "EventCode": "0xD1",
411 "UMask": "0x8", 524 "UMask": "0x8",
412 "BriefDescription": "Retired load uops misses in L1 cache as data sources.", 525 "BriefDescription": "Retired load uops misses in L1 cache as data sources. Uses PEBS.",
413 "Data_LA": "1", 526 "Data_LA": "1",
414 "PEBS": "1", 527 "PEBS": "1",
415 "Counter": "0,1,2,3", 528 "Counter": "0,1,2,3",
416 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 529 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
417 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were misses in the nearest-level (L1) cache. Counting excludes unknown and UC data source.", 530 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were misses in the nearest-level (L1) cache. Counting excludes unknown and UC data source.",
418 "SampleAfterValue": "100003", 531 "SampleAfterValue": "100003",
419 "CounterHTOff": "0,1,2,3" 532 "CounterHTOff": "0,1,2,3"
420 }, 533 },
421 { 534 {
422 "EventCode": "0xD1", 535 "EventCode": "0xD1",
423 "UMask": "0x10", 536 "UMask": "0x10",
424 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 537 "BriefDescription": "Retired load uops with L2 cache misses as data sources. Uses PEBS.",
425 "Data_LA": "1", 538 "Data_LA": "1",
426 "PEBS": "1", 539 "PEBS": "1",
427 "Counter": "0,1,2,3", 540 "Counter": "0,1,2,3",
428 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 541 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
429 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were misses in the mid-level (L2) cache. Counting excludes unknown and UC data source.", 542 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were misses in the mid-level (L2) cache. Counting excludes unknown and UC data source.",
430 "SampleAfterValue": "50021", 543 "SampleAfterValue": "50021",
431 "CounterHTOff": "0,1,2,3" 544 "CounterHTOff": "0,1,2,3"
432 }, 545 },
433 { 546 {
434 "EventCode": "0xD1", 547 "EventCode": "0xD1",
435 "UMask": "0x20", 548 "UMask": "0x20",
436 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source.", 549 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source. (Precise Event - PEBS).",
437 "Data_LA": "1", 550 "Data_LA": "1",
438 "PEBS": "1", 551 "PEBS": "1",
439 "Counter": "0,1,2,3", 552 "Counter": "0,1,2,3",
@@ -445,84 +558,83 @@
445 { 558 {
446 "EventCode": "0xD1", 559 "EventCode": "0xD1",
447 "UMask": "0x40", 560 "UMask": "0x40",
448 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.", 561 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready. (Precise Event - PEBS)",
449 "Data_LA": "1", 562 "Data_LA": "1",
450 "PEBS": "1", 563 "PEBS": "1",
451 "Counter": "0,1,2,3", 564 "Counter": "0,1,2,3",
452 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB", 565 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB",
453 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were load uops missed L1 but hit a fill buffer due to a preceding miss to the same cache line with the data not ready.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load.", 566 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were load uops missed L1 but hit a fill buffer due to a preceding miss to the same cache line with the data not ready.\nNote: Only two data-sources of L1/FB are applicable for AVX-256bit even though the corresponding AVX load could be serviced by a deeper level in the memory hierarchy. Data source is reported for the Low-half load.",
454 "SampleAfterValue": "100003", 567 "SampleAfterValue": "100003",
455 "CounterHTOff": "0,1,2,3" 568 "CounterHTOff": "0,1,2,3"
456 }, 569 },
457 { 570 {
458 "EventCode": "0xD2", 571 "EventCode": "0xD2",
459 "UMask": "0x1", 572 "UMask": "0x1",
460 "BriefDescription": "Retired load uops which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.", 573 "BriefDescription": "Retired load uops which data sources were L3 hit and cross-core snoop missed in on-pkg core cache. (Precise Event - PEBS)",
461 "Data_LA": "1", 574 "Data_LA": "1",
462 "PEBS": "1", 575 "PEBS": "1",
463 "Counter": "0,1,2,3", 576 "Counter": "0,1,2,3",
464 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS", 577 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS",
465 "Errata": "BDM100", 578 "Errata": "BDM100",
466 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were L3 Hit and a cross-core snoop missed in the on-pkg core cache.", 579 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were L3 Hit and a cross-core snoop missed in the on-pkg core cache.",
467 "SampleAfterValue": "20011", 580 "SampleAfterValue": "20011",
468 "CounterHTOff": "0,1,2,3" 581 "CounterHTOff": "0,1,2,3"
469 }, 582 },
470 { 583 {
471 "EventCode": "0xD2", 584 "EventCode": "0xD2",
472 "UMask": "0x2", 585 "UMask": "0x2",
473 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache.", 586 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache. (Precise Event - PEBS)",
474 "Data_LA": "1", 587 "Data_LA": "1",
475 "PEBS": "1", 588 "PEBS": "1",
476 "Counter": "0,1,2,3", 589 "Counter": "0,1,2,3",
477 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT", 590 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT",
478 "Errata": "BDM100", 591 "Errata": "BDM100",
479 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were L3 hit and a cross-core snoop hit in the on-pkg core cache.", 592 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were L3 hit and a cross-core snoop hit in the on-pkg core cache.",
480 "SampleAfterValue": "20011", 593 "SampleAfterValue": "20011",
481 "CounterHTOff": "0,1,2,3" 594 "CounterHTOff": "0,1,2,3"
482 }, 595 },
483 { 596 {
484 "EventCode": "0xD2", 597 "EventCode": "0xD2",
485 "UMask": "0x4", 598 "UMask": "0x4",
486 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3.", 599 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3. (Precise Event - PEBS)",
487 "Data_LA": "1", 600 "Data_LA": "1",
488 "PEBS": "1", 601 "PEBS": "1",
489 "Counter": "0,1,2,3", 602 "Counter": "0,1,2,3",
490 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM", 603 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM",
491 "Errata": "BDM100", 604 "Errata": "BDM100",
492 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were HitM responses from a core on same socket (shared L3).", 605 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were HitM responses from a core on same socket (shared L3).",
493 "SampleAfterValue": "20011", 606 "SampleAfterValue": "20011",
494 "CounterHTOff": "0,1,2,3" 607 "CounterHTOff": "0,1,2,3"
495 }, 608 },
496 { 609 {
497 "EventCode": "0xD2", 610 "EventCode": "0xD2",
498 "UMask": "0x8", 611 "UMask": "0x8",
499 "BriefDescription": "Retired load uops which data sources were hits in L3 without snoops required.", 612 "BriefDescription": "Retired load uops which data sources were hits in L3 without snoops required. (Precise Event - PEBS)",
500 "Data_LA": "1", 613 "Data_LA": "1",
501 "PEBS": "1", 614 "PEBS": "1",
502 "Counter": "0,1,2,3", 615 "Counter": "0,1,2,3",
503 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE", 616 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE",
504 "Errata": "BDM100", 617 "Errata": "BDM100",
505 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts retired load uops which data sources were hits in the last-level (L3) cache without snoops required.", 618 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts retired load uops which data sources were hits in the last-level (L3) cache without snoops required.",
506 "SampleAfterValue": "100003", 619 "SampleAfterValue": "100003",
507 "CounterHTOff": "0,1,2,3" 620 "CounterHTOff": "0,1,2,3"
508 }, 621 },
509 { 622 {
510 "EventCode": "0xD3", 623 "EventCode": "0xD3",
511 "UMask": "0x1", 624 "UMask": "0x1",
512 "BriefDescription": "Data from local DRAM either Snoop not needed or Snoop Miss (RspI)",
513 "Data_LA": "1", 625 "Data_LA": "1",
514 "PEBS": "1", 626 "PEBS": "1",
515 "Counter": "0,1,2,3", 627 "Counter": "0,1,2,3",
516 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM", 628 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM",
517 "Errata": "BDE70, BDM100", 629 "Errata": "BDE70, BDM100",
518 "PublicDescription": "Retired load uop whose Data Source was: local DRAM either Snoop not needed or Snoop Miss (RspI).", 630 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches. This is a precise event.",
519 "SampleAfterValue": "100007", 631 "SampleAfterValue": "100007",
520 "CounterHTOff": "0,1,2,3" 632 "CounterHTOff": "0,1,2,3"
521 }, 633 },
522 { 634 {
523 "EventCode": "0xD3", 635 "EventCode": "0xD3",
524 "UMask": "0x4", 636 "UMask": "0x4",
525 "BriefDescription": "Retired load uop whose Data Source was: remote DRAM either Snoop not needed or Snoop Miss (RspI)", 637 "BriefDescription": "Retired load uop whose Data Source was: remote DRAM either Snoop not needed or Snoop Miss (RspI) (Precise Event)",
526 "Data_LA": "1", 638 "Data_LA": "1",
527 "PEBS": "1", 639 "PEBS": "1",
528 "Counter": "0,1,2,3", 640 "Counter": "0,1,2,3",
@@ -534,7 +646,7 @@
534 { 646 {
535 "EventCode": "0xD3", 647 "EventCode": "0xD3",
536 "UMask": "0x10", 648 "UMask": "0x10",
537 "BriefDescription": "Retired load uop whose Data Source was: Remote cache HITM", 649 "BriefDescription": "Retired load uop whose Data Source was: Remote cache HITM (Precise Event)",
538 "Data_LA": "1", 650 "Data_LA": "1",
539 "PEBS": "1", 651 "PEBS": "1",
540 "Counter": "0,1,2,3", 652 "Counter": "0,1,2,3",
@@ -546,7 +658,7 @@
546 { 658 {
547 "EventCode": "0xD3", 659 "EventCode": "0xD3",
548 "UMask": "0x20", 660 "UMask": "0x20",
549 "BriefDescription": "Retired load uop whose Data Source was: forwarded from remote cache", 661 "BriefDescription": "Retired load uop whose Data Source was: forwarded from remote cache (Precise Event)",
550 "Data_LA": "1", 662 "Data_LA": "1",
551 "PEBS": "1", 663 "PEBS": "1",
552 "Counter": "0,1,2,3", 664 "Counter": "0,1,2,3",
@@ -695,119 +807,6 @@
695 "CounterHTOff": "0,1,2,3,4,5,6,7" 807 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 }, 808 },
697 { 809 {
698 "EventCode": "0x24",
699 "UMask": "0x42",
700 "BriefDescription": "RFO requests that hit L2 cache.",
701 "Counter": "0,1,2,3",
702 "EventName": "L2_RQSTS.RFO_HIT",
703 "SampleAfterValue": "200003",
704 "CounterHTOff": "0,1,2,3,4,5,6,7"
705 },
706 {
707 "EventCode": "0x24",
708 "UMask": "0x22",
709 "BriefDescription": "RFO requests that miss L2 cache.",
710 "Counter": "0,1,2,3",
711 "EventName": "L2_RQSTS.RFO_MISS",
712 "SampleAfterValue": "200003",
713 "CounterHTOff": "0,1,2,3,4,5,6,7"
714 },
715 {
716 "EventCode": "0x24",
717 "UMask": "0x44",
718 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
719 "Counter": "0,1,2,3",
720 "EventName": "L2_RQSTS.CODE_RD_HIT",
721 "SampleAfterValue": "200003",
722 "CounterHTOff": "0,1,2,3,4,5,6,7"
723 },
724 {
725 "EventCode": "0x24",
726 "UMask": "0x24",
727 "BriefDescription": "L2 cache misses when fetching instructions.",
728 "Counter": "0,1,2,3",
729 "EventName": "L2_RQSTS.CODE_RD_MISS",
730 "SampleAfterValue": "200003",
731 "CounterHTOff": "0,1,2,3,4,5,6,7"
732 },
733 {
734 "EventCode": "0x24",
735 "UMask": "0x27",
736 "BriefDescription": "Demand requests that miss L2 cache.",
737 "Counter": "0,1,2,3",
738 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
739 "SampleAfterValue": "200003",
740 "CounterHTOff": "0,1,2,3,4,5,6,7"
741 },
742 {
743 "EventCode": "0x24",
744 "UMask": "0xe7",
745 "BriefDescription": "Demand requests to L2 cache.",
746 "Counter": "0,1,2,3",
747 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
748 "SampleAfterValue": "200003",
749 "CounterHTOff": "0,1,2,3,4,5,6,7"
750 },
751 {
752 "EventCode": "0x24",
753 "UMask": "0x3f",
754 "BriefDescription": "All requests that miss L2 cache.",
755 "Counter": "0,1,2,3",
756 "EventName": "L2_RQSTS.MISS",
757 "SampleAfterValue": "200003",
758 "CounterHTOff": "0,1,2,3,4,5,6,7"
759 },
760 {
761 "EventCode": "0x24",
762 "UMask": "0xff",
763 "BriefDescription": "All L2 requests.",
764 "Counter": "0,1,2,3",
765 "EventName": "L2_RQSTS.REFERENCES",
766 "SampleAfterValue": "200003",
767 "CounterHTOff": "0,1,2,3,4,5,6,7"
768 },
769 {
770 "EventCode": "0xB7, 0xBB",
771 "UMask": "0x1",
772 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
773 "Counter": "0,1,2,3",
774 "EventName": "OFFCORE_RESPONSE",
775 "SampleAfterValue": "100003",
776 "CounterHTOff": "0,1,2,3"
777 },
778 {
779 "EventCode": "0x60",
780 "UMask": "0x1",
781 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
782 "Counter": "0,1,2,3",
783 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
784 "CounterMask": "6",
785 "Errata": "BDM76",
786 "SampleAfterValue": "2000003",
787 "CounterHTOff": "0,1,2,3,4,5,6,7"
788 },
789 {
790 "EventCode": "0x48",
791 "UMask": "0x1",
792 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
793 "Counter": "2",
794 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
795 "AnyThread": "1",
796 "CounterMask": "1",
797 "SampleAfterValue": "2000003",
798 "CounterHTOff": "2"
799 },
800 {
801 "EventCode": "0x48",
802 "UMask": "0x2",
803 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
804 "Counter": "0,1,2,3",
805 "EventName": "L1D_PEND_MISS.FB_FULL",
806 "CounterMask": "1",
807 "SampleAfterValue": "2000003",
808 "CounterHTOff": "0,1,2,3,4,5,6,7"
809 },
810 {
811 "Offcore": "1", 810 "Offcore": "1",
812 "EventCode": "0xB7, 0xBB", 811 "EventCode": "0xB7, 0xBB",
813 "UMask": "0x1", 812 "UMask": "0x1",
@@ -816,6 +815,7 @@
816 "Counter": "0,1,2,3", 815 "Counter": "0,1,2,3",
817 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_HIT.ANY_RESPONSE", 816 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_HIT.ANY_RESPONSE",
818 "MSRIndex": "0x1a6,0x1a7", 817 "MSRIndex": "0x1a6,0x1a7",
818 "PublicDescription": "Counts all requests that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
819 "SampleAfterValue": "100003", 819 "SampleAfterValue": "100003",
820 "CounterHTOff": "0,1,2,3" 820 "CounterHTOff": "0,1,2,3"
821 }, 821 },
@@ -828,6 +828,7 @@
828 "Counter": "0,1,2,3", 828 "Counter": "0,1,2,3",
829 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HITM_OTHER_CORE", 829 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HITM_OTHER_CORE",
830 "MSRIndex": "0x1a6,0x1a7", 830 "MSRIndex": "0x1a6,0x1a7",
831 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
831 "SampleAfterValue": "100003", 832 "SampleAfterValue": "100003",
832 "CounterHTOff": "0,1,2,3" 833 "CounterHTOff": "0,1,2,3"
833 }, 834 },
@@ -840,6 +841,7 @@
840 "Counter": "0,1,2,3", 841 "Counter": "0,1,2,3",
841 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 842 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
842 "MSRIndex": "0x1a6,0x1a7", 843 "MSRIndex": "0x1a6,0x1a7",
844 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
843 "SampleAfterValue": "100003", 845 "SampleAfterValue": "100003",
844 "CounterHTOff": "0,1,2,3" 846 "CounterHTOff": "0,1,2,3"
845 }, 847 },
@@ -852,6 +854,7 @@
852 "Counter": "0,1,2,3", 854 "Counter": "0,1,2,3",
853 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 855 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
854 "MSRIndex": "0x1a6,0x1a7", 856 "MSRIndex": "0x1a6,0x1a7",
857 "PublicDescription": "Counts all demand & prefetch code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
855 "SampleAfterValue": "100003", 858 "SampleAfterValue": "100003",
856 "CounterHTOff": "0,1,2,3" 859 "CounterHTOff": "0,1,2,3"
857 }, 860 },
@@ -864,6 +867,7 @@
864 "Counter": "0,1,2,3", 867 "Counter": "0,1,2,3",
865 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HITM_OTHER_CORE", 868 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HITM_OTHER_CORE",
866 "MSRIndex": "0x1a6,0x1a7", 869 "MSRIndex": "0x1a6,0x1a7",
870 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
867 "SampleAfterValue": "100003", 871 "SampleAfterValue": "100003",
868 "CounterHTOff": "0,1,2,3" 872 "CounterHTOff": "0,1,2,3"
869 }, 873 },
@@ -876,6 +880,7 @@
876 "Counter": "0,1,2,3", 880 "Counter": "0,1,2,3",
877 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 881 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
878 "MSRIndex": "0x1a6,0x1a7", 882 "MSRIndex": "0x1a6,0x1a7",
883 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
879 "SampleAfterValue": "100003", 884 "SampleAfterValue": "100003",
880 "CounterHTOff": "0,1,2,3" 885 "CounterHTOff": "0,1,2,3"
881 }, 886 },
@@ -888,6 +893,7 @@
888 "Counter": "0,1,2,3", 893 "Counter": "0,1,2,3",
889 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HITM_OTHER_CORE", 894 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HITM_OTHER_CORE",
890 "MSRIndex": "0x1a6,0x1a7", 895 "MSRIndex": "0x1a6,0x1a7",
896 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
891 "SampleAfterValue": "100003", 897 "SampleAfterValue": "100003",
892 "CounterHTOff": "0,1,2,3" 898 "CounterHTOff": "0,1,2,3"
893 }, 899 },
@@ -900,6 +906,7 @@
900 "Counter": "0,1,2,3", 906 "Counter": "0,1,2,3",
901 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 907 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
902 "MSRIndex": "0x1a6,0x1a7", 908 "MSRIndex": "0x1a6,0x1a7",
909 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
903 "SampleAfterValue": "100003", 910 "SampleAfterValue": "100003",
904 "CounterHTOff": "0,1,2,3" 911 "CounterHTOff": "0,1,2,3"
905 }, 912 },
@@ -912,6 +919,7 @@
912 "Counter": "0,1,2,3", 919 "Counter": "0,1,2,3",
913 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_HIT.ANY_RESPONSE", 920 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_HIT.ANY_RESPONSE",
914 "MSRIndex": "0x1a6,0x1a7", 921 "MSRIndex": "0x1a6,0x1a7",
922 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
915 "SampleAfterValue": "100003", 923 "SampleAfterValue": "100003",
916 "CounterHTOff": "0,1,2,3" 924 "CounterHTOff": "0,1,2,3"
917 }, 925 },
@@ -924,6 +932,7 @@
924 "Counter": "0,1,2,3", 932 "Counter": "0,1,2,3",
925 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_HIT.ANY_RESPONSE", 933 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_HIT.ANY_RESPONSE",
926 "MSRIndex": "0x1a6,0x1a7", 934 "MSRIndex": "0x1a6,0x1a7",
935 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
927 "SampleAfterValue": "100003", 936 "SampleAfterValue": "100003",
928 "CounterHTOff": "0,1,2,3" 937 "CounterHTOff": "0,1,2,3"
929 }, 938 },
@@ -936,6 +945,20 @@
936 "Counter": "0,1,2,3", 945 "Counter": "0,1,2,3",
937 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.HITM_OTHER_CORE", 946 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.HITM_OTHER_CORE",
938 "MSRIndex": "0x1a6,0x1a7", 947 "MSRIndex": "0x1a6,0x1a7",
948 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
949 "SampleAfterValue": "100003",
950 "CounterHTOff": "0,1,2,3"
951 },
952 {
953 "Offcore": "1",
954 "EventCode": "0xB7, 0xBB",
955 "UMask": "0x1",
956 "BriefDescription": "Counts all demand data writes (RFOs) that hit in the L3",
957 "MSRValue": "0x3f803c0002",
958 "Counter": "0,1,2,3",
959 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.ANY_RESPONSE",
960 "MSRIndex": "0x1a6,0x1a7",
961 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
939 "SampleAfterValue": "100003", 962 "SampleAfterValue": "100003",
940 "CounterHTOff": "0,1,2,3" 963 "CounterHTOff": "0,1,2,3"
941 } 964 }
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/floating-point.json b/tools/perf/pmu-events/arch/x86/broadwellx/floating-point.json
index 4ae1ea24f22f..d7b9d9c9c518 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/floating-point.json
@@ -6,7 +6,7 @@
6 "Counter": "0,1,2,3", 6 "Counter": "0,1,2,3",
7 "EventName": "OTHER_ASSISTS.AVX_TO_SSE", 7 "EventName": "OTHER_ASSISTS.AVX_TO_SSE",
8 "Errata": "BDM30", 8 "Errata": "BDM30",
9 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of transitions from AVX-256 to legacy SSE when penalty is applicable.", 9 "PublicDescription": "This event counts the number of transitions from AVX-256 to legacy SSE when penalty is applicable.",
10 "SampleAfterValue": "100003", 10 "SampleAfterValue": "100003",
11 "CounterHTOff": "0,1,2,3,4,5,6,7" 11 "CounterHTOff": "0,1,2,3,4,5,6,7"
12 }, 12 },
@@ -17,7 +17,7 @@
17 "Counter": "0,1,2,3", 17 "Counter": "0,1,2,3",
18 "EventName": "OTHER_ASSISTS.SSE_TO_AVX", 18 "EventName": "OTHER_ASSISTS.SSE_TO_AVX",
19 "Errata": "BDM30", 19 "Errata": "BDM30",
20 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of transitions from legacy SSE to AVX-256 when penalty is applicable.", 20 "PublicDescription": "This event counts the number of transitions from legacy SSE to AVX-256 when penalty is applicable.",
21 "SampleAfterValue": "100003", 21 "SampleAfterValue": "100003",
22 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
23 }, 23 },
@@ -25,7 +25,6 @@
25 "EventCode": "0xC7", 25 "EventCode": "0xC7",
26 "UMask": "0x1", 26 "UMask": "0x1",
27 "BriefDescription": "Number of SSE/AVX computational scalar double precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 27 "BriefDescription": "Number of SSE/AVX computational scalar double precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
28 "PEBS": "1",
29 "Counter": "0,1,2,3", 28 "Counter": "0,1,2,3",
30 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_DOUBLE", 29 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_DOUBLE",
31 "SampleAfterValue": "2000003", 30 "SampleAfterValue": "2000003",
@@ -35,7 +34,6 @@
35 "EventCode": "0xC7", 34 "EventCode": "0xC7",
36 "UMask": "0x2", 35 "UMask": "0x2",
37 "BriefDescription": "Number of SSE/AVX computational scalar single precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 36 "BriefDescription": "Number of SSE/AVX computational scalar single precision floating-point instructions retired. Each count represents 1 computation. Applies to SSE* and AVX* scalar single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
38 "PEBS": "1",
39 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
40 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_SINGLE", 38 "EventName": "FP_ARITH_INST_RETIRED.SCALAR_SINGLE",
41 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
@@ -43,9 +41,17 @@
43 }, 41 },
44 { 42 {
45 "EventCode": "0xC7", 43 "EventCode": "0xC7",
44 "UMask": "0x3",
45 "BriefDescription": "Number of SSE/AVX computational scalar floating-point instructions retired. Applies to SSE* and AVX* scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
46 "Counter": "0,1,2,3",
47 "EventName": "FP_ARITH_INST_RETIRED.SCALAR",
48 "SampleAfterValue": "2000003",
49 "CounterHTOff": "0,1,2,3"
50 },
51 {
52 "EventCode": "0xC7",
46 "UMask": "0x4", 53 "UMask": "0x4",
47 "BriefDescription": "Number of SSE/AVX computational 128-bit packed double precision floating-point instructions retired. Each count represents 2 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 54 "BriefDescription": "Number of SSE/AVX computational 128-bit packed double precision floating-point instructions retired. Each count represents 2 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
48 "PEBS": "1",
49 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
50 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_DOUBLE", 56 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_DOUBLE",
51 "SampleAfterValue": "2000003", 57 "SampleAfterValue": "2000003",
@@ -55,7 +61,6 @@
55 "EventCode": "0xC7", 61 "EventCode": "0xC7",
56 "UMask": "0x8", 62 "UMask": "0x8",
57 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 63 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
58 "PEBS": "1",
59 "Counter": "0,1,2,3", 64 "Counter": "0,1,2,3",
60 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE", 65 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE",
61 "SampleAfterValue": "2000003", 66 "SampleAfterValue": "2000003",
@@ -65,19 +70,54 @@
65 "EventCode": "0xC7", 70 "EventCode": "0xC7",
66 "UMask": "0x10", 71 "UMask": "0x10",
67 "BriefDescription": "Number of SSE/AVX computational 256-bit packed double precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.", 72 "BriefDescription": "Number of SSE/AVX computational 256-bit packed double precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed double precision floating-point instructions: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
68 "PEBS": "1",
69 "Counter": "0,1,2,3", 73 "Counter": "0,1,2,3",
70 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE", 74 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_DOUBLE",
71 "SampleAfterValue": "2000003", 75 "SampleAfterValue": "2000003",
72 "CounterHTOff": "0,1,2,3" 76 "CounterHTOff": "0,1,2,3"
73 }, 77 },
74 { 78 {
79 "EventCode": "0xC7",
80 "UMask": "0x15",
81 "BriefDescription": "Number of SSE/AVX computational double precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
82 "Counter": "0,1,2,3",
83 "EventName": "FP_ARITH_INST_RETIRED.DOUBLE",
84 "SampleAfterValue": "2000006",
85 "CounterHTOff": "0,1,2,3"
86 },
87 {
88 "EventCode": "0xc7",
89 "UMask": "0x20",
90 "BriefDescription": "Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired. Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
91 "Counter": "0,1,2,3",
92 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE",
93 "SampleAfterValue": "2000003",
94 "CounterHTOff": "0,1,2,3"
95 },
96 {
97 "EventCode": "0xC7",
98 "UMask": "0x2a",
99 "BriefDescription": "Number of SSE/AVX computational single precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
100 "Counter": "0,1,2,3",
101 "EventName": "FP_ARITH_INST_RETIRED.SINGLE",
102 "SampleAfterValue": "2000005",
103 "CounterHTOff": "0,1,2,3"
104 },
105 {
106 "EventCode": "0xC7",
107 "UMask": "0x3c",
108 "BriefDescription": "Number of SSE/AVX computational packed floating-point instructions retired. Applies to SSE* and AVX*, packed, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
109 "Counter": "0,1,2,3",
110 "EventName": "FP_ARITH_INST_RETIRED.PACKED",
111 "SampleAfterValue": "2000004",
112 "CounterHTOff": "0,1,2,3"
113 },
114 {
75 "EventCode": "0xCA", 115 "EventCode": "0xCA",
76 "UMask": "0x2", 116 "UMask": "0x2",
77 "BriefDescription": "Number of X87 assists due to output value.", 117 "BriefDescription": "Number of X87 assists due to output value.",
78 "Counter": "0,1,2,3", 118 "Counter": "0,1,2,3",
79 "EventName": "FP_ASSIST.X87_OUTPUT", 119 "EventName": "FP_ASSIST.X87_OUTPUT",
80 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of x87 floating point (FP) micro-code assist (numeric overflow/underflow, inexact result) when the output value (destination register) is invalid.", 120 "PublicDescription": "This event counts the number of x87 floating point (FP) micro-code assist (numeric overflow/underflow, inexact result) when the output value (destination register) is invalid.",
81 "SampleAfterValue": "100003", 121 "SampleAfterValue": "100003",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 122 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 123 },
@@ -87,7 +127,7 @@
87 "BriefDescription": "Number of X87 assists due to input value.", 127 "BriefDescription": "Number of X87 assists due to input value.",
88 "Counter": "0,1,2,3", 128 "Counter": "0,1,2,3",
89 "EventName": "FP_ASSIST.X87_INPUT", 129 "EventName": "FP_ASSIST.X87_INPUT",
90 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts x87 floating point (FP) micro-code assist (invalid operation, denormal operand, SNaN operand) when the input value (one of the source operands to an FP instruction) is invalid.", 130 "PublicDescription": "This event counts x87 floating point (FP) micro-code assist (invalid operation, denormal operand, SNaN operand) when the input value (one of the source operands to an FP instruction) is invalid.",
91 "SampleAfterValue": "100003", 131 "SampleAfterValue": "100003",
92 "CounterHTOff": "0,1,2,3,4,5,6,7" 132 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 }, 133 },
@@ -97,7 +137,7 @@
97 "BriefDescription": "Number of SIMD FP assists due to Output values", 137 "BriefDescription": "Number of SIMD FP assists due to Output values",
98 "Counter": "0,1,2,3", 138 "Counter": "0,1,2,3",
99 "EventName": "FP_ASSIST.SIMD_OUTPUT", 139 "EventName": "FP_ASSIST.SIMD_OUTPUT",
100 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of SSE* floating point (FP) micro-code assist (numeric overflow/underflow) when the output value (destination register) is invalid. Counting covers only cases involving penalties that require micro-code assist intervention.", 140 "PublicDescription": "This event counts the number of SSE* floating point (FP) micro-code assist (numeric overflow/underflow) when the output value (destination register) is invalid. Counting covers only cases involving penalties that require micro-code assist intervention.",
101 "SampleAfterValue": "100003", 141 "SampleAfterValue": "100003",
102 "CounterHTOff": "0,1,2,3,4,5,6,7" 142 "CounterHTOff": "0,1,2,3,4,5,6,7"
103 }, 143 },
@@ -107,7 +147,7 @@
107 "BriefDescription": "Number of SIMD FP assists due to input values", 147 "BriefDescription": "Number of SIMD FP assists due to input values",
108 "Counter": "0,1,2,3", 148 "Counter": "0,1,2,3",
109 "EventName": "FP_ASSIST.SIMD_INPUT", 149 "EventName": "FP_ASSIST.SIMD_INPUT",
110 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts any input SSE* FP assist - invalid operation, denormal operand, dividing by zero, SNaN operand. Counting includes only cases involving penalties that required micro-code assist intervention.", 150 "PublicDescription": "This event counts any input SSE* FP assist - invalid operation, denormal operand, dividing by zero, SNaN operand. Counting includes only cases involving penalties that required micro-code assist intervention.",
111 "SampleAfterValue": "100003", 151 "SampleAfterValue": "100003",
112 "CounterHTOff": "0,1,2,3,4,5,6,7" 152 "CounterHTOff": "0,1,2,3,4,5,6,7"
113 }, 153 },
@@ -121,51 +161,5 @@
121 "PublicDescription": "This event counts cycles with any input and output SSE or x87 FP assist. If an input and output assist are detected on the same cycle the event increments by 1.", 161 "PublicDescription": "This event counts cycles with any input and output SSE or x87 FP assist. If an input and output assist are detected on the same cycle the event increments by 1.",
122 "SampleAfterValue": "100003", 162 "SampleAfterValue": "100003",
123 "CounterHTOff": "0,1,2,3" 163 "CounterHTOff": "0,1,2,3"
124 },
125 {
126 "EventCode": "0xc7",
127 "UMask": "0x20",
128 "BriefDescription": "Number of SSE/AVX computational 256-bit packed single precision floating-point instructions retired. Each count represents 8 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
129 "PEBS": "1",
130 "Counter": "0,1,2,3",
131 "EventName": "FP_ARITH_INST_RETIRED.256B_PACKED_SINGLE",
132 "SampleAfterValue": "2000003",
133 "CounterHTOff": "0,1,2,3"
134 },
135 {
136 "EventCode": "0xC7",
137 "UMask": "0x3",
138 "BriefDescription": "Number of SSE/AVX computational scalar floating-point instructions retired. Applies to SSE* and AVX* scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT FM(N)ADD/SUB. FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
139 "Counter": "0,1,2,3",
140 "EventName": "FP_ARITH_INST_RETIRED.SCALAR",
141 "SampleAfterValue": "2000003",
142 "CounterHTOff": "0,1,2,3"
143 },
144 {
145 "EventCode": "0xC7",
146 "UMask": "0x3c",
147 "BriefDescription": "Number of SSE/AVX computational packed floating-point instructions retired. Applies to SSE* and AVX*, packed, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RSQRT RCP SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
148 "Counter": "0,1,2,3",
149 "EventName": "FP_ARITH_INST_RETIRED.PACKED",
150 "SampleAfterValue": "2000004",
151 "CounterHTOff": "0,1,2,3"
152 },
153 {
154 "EventCode": "0xC7",
155 "UMask": "0x2a",
156 "BriefDescription": "Number of SSE/AVX computational single precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
157 "Counter": "0,1,2,3",
158 "EventName": "FP_ARITH_INST_RETIRED.SINGLE",
159 "SampleAfterValue": "2000005",
160 "CounterHTOff": "0,1,2,3"
161 },
162 {
163 "EventCode": "0xC7",
164 "UMask": "0x15",
165 "BriefDescription": "Number of SSE/AVX computational double precision floating-point instructions retired. Applies to SSE* and AVX*scalar, double and single precision floating-point: ADD SUB MUL DIV MIN MAX SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ?.",
166 "Counter": "0,1,2,3",
167 "EventName": "FP_ARITH_INST_RETIRED.DOUBLE",
168 "SampleAfterValue": "2000006",
169 "CounterHTOff": "0,1,2,3"
170 } 164 }
171] \ No newline at end of file 165] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/frontend.json b/tools/perf/pmu-events/arch/x86/broadwellx/frontend.json
index 06bf0a40e568..72781e1e3362 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/frontend.json
@@ -15,80 +15,49 @@
15 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path", 15 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "EventName": "IDQ.MITE_UOPS", 17 "EventName": "IDQ.MITE_UOPS",
18 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 18 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "EventCode": "0x79", 23 "EventCode": "0x79",
24 "UMask": "0x8", 24 "UMask": "0x4",
25 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path", 25 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path",
26 "Counter": "0,1,2,3",
27 "EventName": "IDQ.DSB_UOPS",
28 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.",
29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
33 "EventCode": "0x79",
34 "UMask": "0x10",
35 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
36 "Counter": "0,1,2,3",
37 "EventName": "IDQ.MS_DSB_UOPS",
38 "PublicDescription": "This event counts the number of uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.",
39 "SampleAfterValue": "2000003",
40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 },
42 {
43 "EventCode": "0x79",
44 "UMask": "0x20",
45 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
46 "Counter": "0,1,2,3",
47 "EventName": "IDQ.MS_MITE_UOPS",
48 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.",
49 "SampleAfterValue": "2000003",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
53 "EventCode": "0x79",
54 "UMask": "0x30",
55 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
56 "Counter": "0,1,2,3", 26 "Counter": "0,1,2,3",
57 "EventName": "IDQ.MS_UOPS", 27 "EventName": "IDQ.MITE_CYCLES",
58 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.", 28 "CounterMask": "1",
29 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ.",
59 "SampleAfterValue": "2000003", 30 "SampleAfterValue": "2000003",
60 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 }, 32 },
62 { 33 {
63 "EventCode": "0x79", 34 "EventCode": "0x79",
64 "UMask": "0x30", 35 "UMask": "0x8",
65 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 36 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
66 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
67 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
68 "CounterMask": "1", 39 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
69 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may \"bypass\" the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
70 "SampleAfterValue": "2000003", 40 "SampleAfterValue": "2000003",
71 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
72 }, 42 },
73 { 43 {
74 "EventCode": "0x79", 44 "EventCode": "0x79",
75 "UMask": "0x4", 45 "UMask": "0x8",
76 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path", 46 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path",
77 "Counter": "0,1,2,3", 47 "Counter": "0,1,2,3",
78 "EventName": "IDQ.MITE_CYCLES", 48 "EventName": "IDQ.DSB_CYCLES",
79 "CounterMask": "1", 49 "CounterMask": "1",
80 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ.", 50 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
81 "SampleAfterValue": "2000003", 51 "SampleAfterValue": "2000003",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 52 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 53 },
84 { 54 {
85 "EventCode": "0x79", 55 "EventCode": "0x79",
86 "UMask": "0x8", 56 "UMask": "0x10",
87 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path", 57 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
88 "Counter": "0,1,2,3", 58 "Counter": "0,1,2,3",
89 "EventName": "IDQ.DSB_CYCLES", 59 "EventName": "IDQ.MS_DSB_UOPS",
90 "CounterMask": "1", 60 "PublicDescription": "This event counts the number of uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
91 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.",
92 "SampleAfterValue": "2000003", 61 "SampleAfterValue": "2000003",
93 "CounterHTOff": "0,1,2,3,4,5,6,7" 62 "CounterHTOff": "0,1,2,3,4,5,6,7"
94 }, 63 },
@@ -99,7 +68,7 @@
99 "Counter": "0,1,2,3", 68 "Counter": "0,1,2,3",
100 "EventName": "IDQ.MS_DSB_CYCLES", 69 "EventName": "IDQ.MS_DSB_CYCLES",
101 "CounterMask": "1", 70 "CounterMask": "1",
102 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.", 71 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
103 "SampleAfterValue": "2000003", 72 "SampleAfterValue": "2000003",
104 "CounterHTOff": "0,1,2,3,4,5,6,7" 73 "CounterHTOff": "0,1,2,3,4,5,6,7"
105 }, 74 },
@@ -111,7 +80,7 @@
111 "Counter": "0,1,2,3", 80 "Counter": "0,1,2,3",
112 "EventName": "IDQ.MS_DSB_OCCUR", 81 "EventName": "IDQ.MS_DSB_OCCUR",
113 "CounterMask": "1", 82 "CounterMask": "1",
114 "PublicDescription": "This event counts the number of deliveries to Instruction Decode Queue (IDQ) initiated by Decode Stream Buffer (DSB) while the Microcode Sequencer (MS) is busy. Counting includes uops that may \"bypass\" the IDQ.", 83 "PublicDescription": "This event counts the number of deliveries to Instruction Decode Queue (IDQ) initiated by Decode Stream Buffer (DSB) while the Microcode Sequencer (MS) is busy. Counting includes uops that may bypass the IDQ.",
115 "SampleAfterValue": "2000003", 84 "SampleAfterValue": "2000003",
116 "CounterHTOff": "0,1,2,3,4,5,6,7" 85 "CounterHTOff": "0,1,2,3,4,5,6,7"
117 }, 86 },
@@ -122,7 +91,7 @@
122 "Counter": "0,1,2,3", 91 "Counter": "0,1,2,3",
123 "EventName": "IDQ.ALL_DSB_CYCLES_4_UOPS", 92 "EventName": "IDQ.ALL_DSB_CYCLES_4_UOPS",
124 "CounterMask": "4", 93 "CounterMask": "4",
125 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 94 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
126 "SampleAfterValue": "2000003", 95 "SampleAfterValue": "2000003",
127 "CounterHTOff": "0,1,2,3,4,5,6,7" 96 "CounterHTOff": "0,1,2,3,4,5,6,7"
128 }, 97 },
@@ -133,7 +102,17 @@
133 "Counter": "0,1,2,3", 102 "Counter": "0,1,2,3",
134 "EventName": "IDQ.ALL_DSB_CYCLES_ANY_UOPS", 103 "EventName": "IDQ.ALL_DSB_CYCLES_ANY_UOPS",
135 "CounterMask": "1", 104 "CounterMask": "1",
136 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may \"bypass\" the IDQ.", 105 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may bypass the IDQ.",
106 "SampleAfterValue": "2000003",
107 "CounterHTOff": "0,1,2,3,4,5,6,7"
108 },
109 {
110 "EventCode": "0x79",
111 "UMask": "0x20",
112 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
113 "Counter": "0,1,2,3",
114 "EventName": "IDQ.MS_MITE_UOPS",
115 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ.",
137 "SampleAfterValue": "2000003", 116 "SampleAfterValue": "2000003",
138 "CounterHTOff": "0,1,2,3,4,5,6,7" 117 "CounterHTOff": "0,1,2,3,4,5,6,7"
139 }, 118 },
@@ -144,7 +123,7 @@
144 "Counter": "0,1,2,3", 123 "Counter": "0,1,2,3",
145 "EventName": "IDQ.ALL_MITE_CYCLES_4_UOPS", 124 "EventName": "IDQ.ALL_MITE_CYCLES_4_UOPS",
146 "CounterMask": "4", 125 "CounterMask": "4",
147 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 126 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
148 "SampleAfterValue": "2000003", 127 "SampleAfterValue": "2000003",
149 "CounterHTOff": "0,1,2,3,4,5,6,7" 128 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 }, 129 },
@@ -155,7 +134,39 @@
155 "Counter": "0,1,2,3", 134 "Counter": "0,1,2,3",
156 "EventName": "IDQ.ALL_MITE_CYCLES_ANY_UOPS", 135 "EventName": "IDQ.ALL_MITE_CYCLES_ANY_UOPS",
157 "CounterMask": "1", 136 "CounterMask": "1",
158 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 137 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
138 "SampleAfterValue": "2000003",
139 "CounterHTOff": "0,1,2,3,4,5,6,7"
140 },
141 {
142 "EventCode": "0x79",
143 "UMask": "0x30",
144 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
145 "Counter": "0,1,2,3",
146 "EventName": "IDQ.MS_UOPS",
147 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
148 "SampleAfterValue": "2000003",
149 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 },
151 {
152 "EventCode": "0x79",
153 "UMask": "0x30",
154 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
155 "Counter": "0,1,2,3",
156 "EventName": "IDQ.MS_CYCLES",
157 "CounterMask": "1",
158 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may bypass the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
159 "SampleAfterValue": "2000003",
160 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 },
162 {
163 "EdgeDetect": "1",
164 "EventCode": "0x79",
165 "UMask": "0x30",
166 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
167 "Counter": "0,1,2,3",
168 "EventName": "IDQ.MS_SWITCHES",
169 "CounterMask": "1",
159 "SampleAfterValue": "2000003", 170 "SampleAfterValue": "2000003",
160 "CounterHTOff": "0,1,2,3,4,5,6,7" 171 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 }, 172 },
@@ -165,7 +176,7 @@
165 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path", 176 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path",
166 "Counter": "0,1,2,3", 177 "Counter": "0,1,2,3",
167 "EventName": "IDQ.MITE_ALL_UOPS", 178 "EventName": "IDQ.MITE_ALL_UOPS",
168 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may \"bypass\" the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 179 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may bypass the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
169 "SampleAfterValue": "2000003", 180 "SampleAfterValue": "2000003",
170 "CounterHTOff": "0,1,2,3,4,5,6,7" 181 "CounterHTOff": "0,1,2,3,4,5,6,7"
171 }, 182 },
@@ -205,7 +216,7 @@
205 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled", 216 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled",
206 "Counter": "0,1,2,3", 217 "Counter": "0,1,2,3",
207 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE", 218 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE",
208 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding ?4 ? x? when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread;\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions); \n c. Instruction Decode Queue (IDQ) delivers four uops.", 219 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding 4 x when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread;\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions); \n c. Instruction Decode Queue (IDQ) delivers four uops.",
209 "SampleAfterValue": "2000003", 220 "SampleAfterValue": "2000003",
210 "CounterHTOff": "0,1,2,3" 221 "CounterHTOff": "0,1,2,3"
211 }, 222 },
@@ -268,18 +279,7 @@
268 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.", 279 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.",
269 "Counter": "0,1,2,3", 280 "Counter": "0,1,2,3",
270 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES", 281 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES",
271 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 0?2 cycles.", 282 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 02 cycles.",
272 "SampleAfterValue": "2000003",
273 "CounterHTOff": "0,1,2,3,4,5,6,7"
274 },
275 {
276 "EdgeDetect": "1",
277 "EventCode": "0x79",
278 "UMask": "0x30",
279 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
280 "Counter": "0,1,2,3",
281 "EventName": "IDQ.MS_SWITCHES",
282 "CounterMask": "1",
283 "SampleAfterValue": "2000003", 283 "SampleAfterValue": "2000003",
284 "CounterHTOff": "0,1,2,3,4,5,6,7" 284 "CounterHTOff": "0,1,2,3,4,5,6,7"
285 } 285 }
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/memory.json b/tools/perf/pmu-events/arch/x86/broadwellx/memory.json
index 1204ea8ff30d..d79a5cfea44b 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/memory.json
@@ -95,7 +95,6 @@
95 "BriefDescription": "Counts the number of times a class of instructions that may cause a transactional abort was executed. Since this is the count of execution, it may not always cause a transactional abort.", 95 "BriefDescription": "Counts the number of times a class of instructions that may cause a transactional abort was executed. Since this is the count of execution, it may not always cause a transactional abort.",
96 "Counter": "0,1,2,3", 96 "Counter": "0,1,2,3",
97 "EventName": "TX_EXEC.MISC1", 97 "EventName": "TX_EXEC.MISC1",
98 "PublicDescription": "Unfriendly TSX abort triggered by a flowmarker.",
99 "SampleAfterValue": "2000003", 98 "SampleAfterValue": "2000003",
100 "CounterHTOff": "0,1,2,3,4,5,6,7" 99 "CounterHTOff": "0,1,2,3,4,5,6,7"
101 }, 100 },
@@ -171,11 +170,11 @@
171 { 170 {
172 "EventCode": "0xc8", 171 "EventCode": "0xc8",
173 "UMask": "0x4", 172 "UMask": "0x4",
174 "BriefDescription": "Number of times HLE abort was triggered", 173 "BriefDescription": "Number of times HLE abort was triggered (PEBS)",
175 "PEBS": "1", 174 "PEBS": "1",
176 "Counter": "0,1,2,3", 175 "Counter": "0,1,2,3",
177 "EventName": "HLE_RETIRED.ABORTED", 176 "EventName": "HLE_RETIRED.ABORTED",
178 "PublicDescription": "Number of times HLE abort was triggered.", 177 "PublicDescription": "Number of times HLE abort was triggered (PEBS).",
179 "SampleAfterValue": "2000003", 178 "SampleAfterValue": "2000003",
180 "CounterHTOff": "0,1,2,3,4,5,6,7" 179 "CounterHTOff": "0,1,2,3,4,5,6,7"
181 }, 180 },
@@ -252,11 +251,11 @@
252 { 251 {
253 "EventCode": "0xc9", 252 "EventCode": "0xc9",
254 "UMask": "0x4", 253 "UMask": "0x4",
255 "BriefDescription": "Number of times RTM abort was triggered", 254 "BriefDescription": "Number of times RTM abort was triggered (PEBS)",
256 "PEBS": "1", 255 "PEBS": "1",
257 "Counter": "0,1,2,3", 256 "Counter": "0,1,2,3",
258 "EventName": "RTM_RETIRED.ABORTED", 257 "EventName": "RTM_RETIRED.ABORTED",
259 "PublicDescription": "Number of times RTM abort was triggered .", 258 "PublicDescription": "Number of times RTM abort was triggered (PEBS).",
260 "SampleAfterValue": "2000003", 259 "SampleAfterValue": "2000003",
261 "CounterHTOff": "0,1,2,3" 260 "CounterHTOff": "0,1,2,3"
262 }, 261 },
@@ -439,6 +438,7 @@
439 "Counter": "0,1,2,3", 438 "Counter": "0,1,2,3",
440 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_MISS.ANY_RESPONSE", 439 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_MISS.ANY_RESPONSE",
441 "MSRIndex": "0x1a6,0x1a7", 440 "MSRIndex": "0x1a6,0x1a7",
441 "PublicDescription": "Counts all requests that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
442 "SampleAfterValue": "100003", 442 "SampleAfterValue": "100003",
443 "CounterHTOff": "0,1,2,3" 443 "CounterHTOff": "0,1,2,3"
444 }, 444 },
@@ -451,6 +451,7 @@
451 "Counter": "0,1,2,3", 451 "Counter": "0,1,2,3",
452 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HIT_FORWARD", 452 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HIT_FORWARD",
453 "MSRIndex": "0x1a6,0x1a7", 453 "MSRIndex": "0x1a6,0x1a7",
454 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and clean or shared data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
454 "SampleAfterValue": "100003", 455 "SampleAfterValue": "100003",
455 "CounterHTOff": "0,1,2,3" 456 "CounterHTOff": "0,1,2,3"
456 }, 457 },
@@ -463,6 +464,7 @@
463 "Counter": "0,1,2,3", 464 "Counter": "0,1,2,3",
464 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HITM", 465 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HITM",
465 "MSRIndex": "0x1a6,0x1a7", 466 "MSRIndex": "0x1a6,0x1a7",
467 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the modified data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
466 "SampleAfterValue": "100003", 468 "SampleAfterValue": "100003",
467 "CounterHTOff": "0,1,2,3" 469 "CounterHTOff": "0,1,2,3"
468 }, 470 },
@@ -475,6 +477,7 @@
475 "Counter": "0,1,2,3", 477 "Counter": "0,1,2,3",
476 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_DRAM", 478 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_DRAM",
477 "MSRIndex": "0x1a6,0x1a7", 479 "MSRIndex": "0x1a6,0x1a7",
480 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the data is returned from remote dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
478 "SampleAfterValue": "100003", 481 "SampleAfterValue": "100003",
479 "CounterHTOff": "0,1,2,3" 482 "CounterHTOff": "0,1,2,3"
480 }, 483 },
@@ -487,6 +490,7 @@
487 "Counter": "0,1,2,3", 490 "Counter": "0,1,2,3",
488 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.LOCAL_DRAM", 491 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.LOCAL_DRAM",
489 "MSRIndex": "0x1a6,0x1a7", 492 "MSRIndex": "0x1a6,0x1a7",
493 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
490 "SampleAfterValue": "100003", 494 "SampleAfterValue": "100003",
491 "CounterHTOff": "0,1,2,3" 495 "CounterHTOff": "0,1,2,3"
492 }, 496 },
@@ -499,6 +503,7 @@
499 "Counter": "0,1,2,3", 503 "Counter": "0,1,2,3",
500 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.ANY_RESPONSE", 504 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.ANY_RESPONSE",
501 "MSRIndex": "0x1a6,0x1a7", 505 "MSRIndex": "0x1a6,0x1a7",
506 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
502 "SampleAfterValue": "100003", 507 "SampleAfterValue": "100003",
503 "CounterHTOff": "0,1,2,3" 508 "CounterHTOff": "0,1,2,3"
504 }, 509 },
@@ -511,6 +516,7 @@
511 "Counter": "0,1,2,3", 516 "Counter": "0,1,2,3",
512 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.LOCAL_DRAM", 517 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.LOCAL_DRAM",
513 "MSRIndex": "0x1a6,0x1a7", 518 "MSRIndex": "0x1a6,0x1a7",
519 "PublicDescription": "Counts all demand & prefetch code reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
514 "SampleAfterValue": "100003", 520 "SampleAfterValue": "100003",
515 "CounterHTOff": "0,1,2,3" 521 "CounterHTOff": "0,1,2,3"
516 }, 522 },
@@ -523,6 +529,7 @@
523 "Counter": "0,1,2,3", 529 "Counter": "0,1,2,3",
524 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.ANY_RESPONSE", 530 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.ANY_RESPONSE",
525 "MSRIndex": "0x1a6,0x1a7", 531 "MSRIndex": "0x1a6,0x1a7",
532 "PublicDescription": "Counts all demand & prefetch code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
526 "SampleAfterValue": "100003", 533 "SampleAfterValue": "100003",
527 "CounterHTOff": "0,1,2,3" 534 "CounterHTOff": "0,1,2,3"
528 }, 535 },
@@ -535,6 +542,7 @@
535 "Counter": "0,1,2,3", 542 "Counter": "0,1,2,3",
536 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.LOCAL_DRAM", 543 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.LOCAL_DRAM",
537 "MSRIndex": "0x1a6,0x1a7", 544 "MSRIndex": "0x1a6,0x1a7",
545 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
538 "SampleAfterValue": "100003", 546 "SampleAfterValue": "100003",
539 "CounterHTOff": "0,1,2,3" 547 "CounterHTOff": "0,1,2,3"
540 }, 548 },
@@ -547,6 +555,7 @@
547 "Counter": "0,1,2,3", 555 "Counter": "0,1,2,3",
548 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.ANY_RESPONSE", 556 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.ANY_RESPONSE",
549 "MSRIndex": "0x1a6,0x1a7", 557 "MSRIndex": "0x1a6,0x1a7",
558 "PublicDescription": "Counts all demand & prefetch RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
550 "SampleAfterValue": "100003", 559 "SampleAfterValue": "100003",
551 "CounterHTOff": "0,1,2,3" 560 "CounterHTOff": "0,1,2,3"
552 }, 561 },
@@ -559,6 +568,7 @@
559 "Counter": "0,1,2,3", 568 "Counter": "0,1,2,3",
560 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HIT_FORWARD", 569 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HIT_FORWARD",
561 "MSRIndex": "0x1a6,0x1a7", 570 "MSRIndex": "0x1a6,0x1a7",
571 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and clean or shared data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
562 "SampleAfterValue": "100003", 572 "SampleAfterValue": "100003",
563 "CounterHTOff": "0,1,2,3" 573 "CounterHTOff": "0,1,2,3"
564 }, 574 },
@@ -571,6 +581,7 @@
571 "Counter": "0,1,2,3", 581 "Counter": "0,1,2,3",
572 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HITM", 582 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HITM",
573 "MSRIndex": "0x1a6,0x1a7", 583 "MSRIndex": "0x1a6,0x1a7",
584 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the modified data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
574 "SampleAfterValue": "100003", 585 "SampleAfterValue": "100003",
575 "CounterHTOff": "0,1,2,3" 586 "CounterHTOff": "0,1,2,3"
576 }, 587 },
@@ -583,6 +594,7 @@
583 "Counter": "0,1,2,3", 594 "Counter": "0,1,2,3",
584 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_DRAM", 595 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_DRAM",
585 "MSRIndex": "0x1a6,0x1a7", 596 "MSRIndex": "0x1a6,0x1a7",
597 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from remote dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
586 "SampleAfterValue": "100003", 598 "SampleAfterValue": "100003",
587 "CounterHTOff": "0,1,2,3" 599 "CounterHTOff": "0,1,2,3"
588 }, 600 },
@@ -595,6 +607,7 @@
595 "Counter": "0,1,2,3", 607 "Counter": "0,1,2,3",
596 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.LOCAL_DRAM", 608 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.LOCAL_DRAM",
597 "MSRIndex": "0x1a6,0x1a7", 609 "MSRIndex": "0x1a6,0x1a7",
610 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
598 "SampleAfterValue": "100003", 611 "SampleAfterValue": "100003",
599 "CounterHTOff": "0,1,2,3" 612 "CounterHTOff": "0,1,2,3"
600 }, 613 },
@@ -607,6 +620,7 @@
607 "Counter": "0,1,2,3", 620 "Counter": "0,1,2,3",
608 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.ANY_RESPONSE", 621 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.ANY_RESPONSE",
609 "MSRIndex": "0x1a6,0x1a7", 622 "MSRIndex": "0x1a6,0x1a7",
623 "PublicDescription": "Counts all demand & prefetch data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
610 "SampleAfterValue": "100003", 624 "SampleAfterValue": "100003",
611 "CounterHTOff": "0,1,2,3" 625 "CounterHTOff": "0,1,2,3"
612 }, 626 },
@@ -619,6 +633,7 @@
619 "Counter": "0,1,2,3", 633 "Counter": "0,1,2,3",
620 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_MISS.ANY_RESPONSE", 634 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_MISS.ANY_RESPONSE",
621 "MSRIndex": "0x1a6,0x1a7", 635 "MSRIndex": "0x1a6,0x1a7",
636 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
622 "SampleAfterValue": "100003", 637 "SampleAfterValue": "100003",
623 "CounterHTOff": "0,1,2,3" 638 "CounterHTOff": "0,1,2,3"
624 }, 639 },
@@ -631,6 +646,7 @@
631 "Counter": "0,1,2,3", 646 "Counter": "0,1,2,3",
632 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_MISS.ANY_RESPONSE", 647 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_MISS.ANY_RESPONSE",
633 "MSRIndex": "0x1a6,0x1a7", 648 "MSRIndex": "0x1a6,0x1a7",
649 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
634 "SampleAfterValue": "100003", 650 "SampleAfterValue": "100003",
635 "CounterHTOff": "0,1,2,3" 651 "CounterHTOff": "0,1,2,3"
636 }, 652 },
@@ -643,6 +659,20 @@
643 "Counter": "0,1,2,3", 659 "Counter": "0,1,2,3",
644 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.REMOTE_HITM", 660 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.REMOTE_HITM",
645 "MSRIndex": "0x1a6,0x1a7", 661 "MSRIndex": "0x1a6,0x1a7",
662 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the modified data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
663 "SampleAfterValue": "100003",
664 "CounterHTOff": "0,1,2,3"
665 },
666 {
667 "Offcore": "1",
668 "EventCode": "0xB7, 0xBB",
669 "UMask": "0x1",
670 "BriefDescription": "Counts all demand data writes (RFOs) that miss in the L3",
671 "MSRValue": "0x3fbfc00002",
672 "Counter": "0,1,2,3",
673 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.ANY_RESPONSE",
674 "MSRIndex": "0x1a6,0x1a7",
675 "PublicDescription": "Counts all demand data writes (RFOs) that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
646 "SampleAfterValue": "100003", 676 "SampleAfterValue": "100003",
647 "CounterHTOff": "0,1,2,3" 677 "CounterHTOff": "0,1,2,3"
648 } 678 }
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/other.json b/tools/perf/pmu-events/arch/x86/broadwellx/other.json
index 718fcb1db2ee..4475249ea9da 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/other.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "EventCode": "0x5C",
14 "UMask": "0x2",
15 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
16 "Counter": "0,1,2,3",
17 "EventName": "CPL_CYCLES.RING123",
18 "PublicDescription": "This event counts unhalted core cycles during which the thread is in rings 1, 2, or 3.",
19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "EdgeDetect": "1", 13 "EdgeDetect": "1",
24 "EventCode": "0x5C", 14 "EventCode": "0x5C",
25 "UMask": "0x1", 15 "UMask": "0x1",
@@ -32,6 +22,16 @@
32 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 }, 23 },
34 { 24 {
25 "EventCode": "0x5C",
26 "UMask": "0x2",
27 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
28 "Counter": "0,1,2,3",
29 "EventName": "CPL_CYCLES.RING123",
30 "PublicDescription": "This event counts unhalted core cycles during which the thread is in rings 1, 2, or 3.",
31 "SampleAfterValue": "2000003",
32 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 },
34 {
35 "EventCode": "0x63", 35 "EventCode": "0x63",
36 "UMask": "0x1", 36 "UMask": "0x1",
37 "BriefDescription": "Cycles when L1 and L2 are locked due to UC or split lock", 37 "BriefDescription": "Cycles when L1 and L2 are locked due to UC or split lock",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/pipeline.json b/tools/perf/pmu-events/arch/x86/broadwellx/pipeline.json
index 02b4e1035f2d..920c89da9111 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/pipeline.json
@@ -3,31 +3,41 @@
3 "EventCode": "0x00", 3 "EventCode": "0x00",
4 "UMask": "0x1", 4 "UMask": "0x1",
5 "BriefDescription": "Instructions retired from execution.", 5 "BriefDescription": "Instructions retired from execution.",
6 "Counter": "Fixed counter 1", 6 "Counter": "Fixed counter 0",
7 "EventName": "INST_RETIRED.ANY", 7 "EventName": "INST_RETIRED.ANY",
8 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 8 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
9 "SampleAfterValue": "2000003", 9 "SampleAfterValue": "2000003",
10 "CounterHTOff": "Fixed counter 1" 10 "CounterHTOff": "Fixed counter 0"
11 }, 11 },
12 { 12 {
13 "EventCode": "0x00", 13 "EventCode": "0x00",
14 "UMask": "0x2", 14 "UMask": "0x2",
15 "BriefDescription": "Core cycles when the thread is not in halt state", 15 "BriefDescription": "Core cycles when the thread is not in halt state",
16 "Counter": "Fixed counter 2", 16 "Counter": "Fixed counter 1",
17 "EventName": "CPU_CLK_UNHALTED.THREAD", 17 "EventName": "CPU_CLK_UNHALTED.THREAD",
18 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.", 18 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "Fixed counter 2" 20 "CounterHTOff": "Fixed counter 1"
21 },
22 {
23 "EventCode": "0x00",
24 "UMask": "0x2",
25 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
26 "Counter": "Fixed counter 1",
27 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
28 "AnyThread": "1",
29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "Fixed counter 1"
21 }, 31 },
22 { 32 {
23 "EventCode": "0x00", 33 "EventCode": "0x00",
24 "UMask": "0x3", 34 "UMask": "0x3",
25 "BriefDescription": "Reference cycles when the core is not in halt state.", 35 "BriefDescription": "Reference cycles when the core is not in halt state.",
26 "Counter": "Fixed counter 3", 36 "Counter": "Fixed counter 2",
27 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 37 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
28 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. \nNote: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. This event is clocked by base clock (100 Mhz) on Sandy Bridge. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.", 38 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. \nNote: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. This event is clocked by base clock (100 Mhz) on Sandy Bridge. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.",
29 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
30 "CounterHTOff": "Fixed counter 3" 40 "CounterHTOff": "Fixed counter 2"
31 }, 41 },
32 { 42 {
33 "EventCode": "0x03", 43 "EventCode": "0x03",
@@ -60,22 +70,33 @@
60 }, 70 },
61 { 71 {
62 "EventCode": "0x0D", 72 "EventCode": "0x0D",
63 "UMask": "0x8", 73 "UMask": "0x3",
64 "BriefDescription": "Cycles when Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the thread", 74 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)",
65 "Counter": "0,1,2,3", 75 "Counter": "0,1,2,3",
66 "EventName": "INT_MISC.RAT_STALL_CYCLES", 76 "EventName": "INT_MISC.RECOVERY_CYCLES",
67 "PublicDescription": "This event counts the number of cycles during which Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the current thread. This also includes the cycles during which the Allocator is serving another thread.", 77 "CounterMask": "1",
78 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.",
68 "SampleAfterValue": "2000003", 79 "SampleAfterValue": "2000003",
69 "CounterHTOff": "0,1,2,3,4,5,6,7" 80 "CounterHTOff": "0,1,2,3,4,5,6,7"
70 }, 81 },
71 { 82 {
72 "EventCode": "0x0D", 83 "EventCode": "0x0D",
73 "UMask": "0x3", 84 "UMask": "0x3",
74 "BriefDescription": "Number of cycles waiting for the checkpoints in Resource Allocation Table (RAT) to be recovered after Nuke due to all other cases except JEClear (e.g. whenever a ucode assist is needed like SSE exception, memory disambiguation, etc...)", 85 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
75 "Counter": "0,1,2,3", 86 "Counter": "0,1,2,3",
76 "EventName": "INT_MISC.RECOVERY_CYCLES", 87 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
88 "AnyThread": "1",
77 "CounterMask": "1", 89 "CounterMask": "1",
78 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.", 90 "SampleAfterValue": "2000003",
91 "CounterHTOff": "0,1,2,3,4,5,6,7"
92 },
93 {
94 "EventCode": "0x0D",
95 "UMask": "0x8",
96 "BriefDescription": "Cycles when Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the thread",
97 "Counter": "0,1,2,3",
98 "EventName": "INT_MISC.RAT_STALL_CYCLES",
99 "PublicDescription": "This event counts the number of cycles during which Resource Allocation Table (RAT) external stall is sent to Instruction Decode Queue (IDQ) for the current thread. This also includes the cycles during which the Allocator is serving another thread.",
79 "SampleAfterValue": "2000003", 100 "SampleAfterValue": "2000003",
80 "CounterHTOff": "0,1,2,3,4,5,6,7" 101 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 }, 102 },
@@ -90,6 +111,18 @@
90 "CounterHTOff": "0,1,2,3,4,5,6,7" 111 "CounterHTOff": "0,1,2,3,4,5,6,7"
91 }, 112 },
92 { 113 {
114 "Invert": "1",
115 "EventCode": "0x0E",
116 "UMask": "0x1",
117 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
118 "Counter": "0,1,2,3",
119 "EventName": "UOPS_ISSUED.STALL_CYCLES",
120 "CounterMask": "1",
121 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
122 "SampleAfterValue": "2000003",
123 "CounterHTOff": "0,1,2,3"
124 },
125 {
93 "EventCode": "0x0E", 126 "EventCode": "0x0E",
94 "UMask": "0x10", 127 "UMask": "0x10",
95 "BriefDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive; added by GSR u-arch.", 128 "BriefDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive; added by GSR u-arch.",
@@ -118,18 +151,6 @@
118 "CounterHTOff": "0,1,2,3,4,5,6,7" 151 "CounterHTOff": "0,1,2,3,4,5,6,7"
119 }, 152 },
120 { 153 {
121 "Invert": "1",
122 "EventCode": "0x0E",
123 "UMask": "0x1",
124 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
125 "Counter": "0,1,2,3",
126 "EventName": "UOPS_ISSUED.STALL_CYCLES",
127 "CounterMask": "1",
128 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
129 "SampleAfterValue": "2000003",
130 "CounterHTOff": "0,1,2,3"
131 },
132 {
133 "EventCode": "0x14", 154 "EventCode": "0x14",
134 "UMask": "0x1", 155 "UMask": "0x1",
135 "BriefDescription": "Cycles when divider is busy executing divide operations", 156 "BriefDescription": "Cycles when divider is busy executing divide operations",
@@ -141,6 +162,26 @@
141 }, 162 },
142 { 163 {
143 "EventCode": "0x3C", 164 "EventCode": "0x3C",
165 "UMask": "0x0",
166 "BriefDescription": "Thread cycles when thread is not in halt state",
167 "Counter": "0,1,2,3",
168 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
169 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
170 "SampleAfterValue": "2000003",
171 "CounterHTOff": "0,1,2,3,4,5,6,7"
172 },
173 {
174 "EventCode": "0x3C",
175 "UMask": "0x0",
176 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
177 "Counter": "0,1,2,3",
178 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
179 "AnyThread": "1",
180 "SampleAfterValue": "2000003",
181 "CounterHTOff": "0,1,2,3,4,5,6,7"
182 },
183 {
184 "EventCode": "0x3C",
144 "UMask": "0x1", 185 "UMask": "0x1",
145 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)", 186 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
146 "Counter": "0,1,2,3", 187 "Counter": "0,1,2,3",
@@ -150,6 +191,36 @@
150 "CounterHTOff": "0,1,2,3,4,5,6,7" 191 "CounterHTOff": "0,1,2,3,4,5,6,7"
151 }, 192 },
152 { 193 {
194 "EventCode": "0x3C",
195 "UMask": "0x1",
196 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
197 "Counter": "0,1,2,3",
198 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
199 "AnyThread": "1",
200 "SampleAfterValue": "2000003",
201 "CounterHTOff": "0,1,2,3,4,5,6,7"
202 },
203 {
204 "EventCode": "0x3C",
205 "UMask": "0x1",
206 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
207 "Counter": "0,1,2,3",
208 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
209 "PublicDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate).",
210 "SampleAfterValue": "2000003",
211 "CounterHTOff": "0,1,2,3,4,5,6,7"
212 },
213 {
214 "EventCode": "0x3C",
215 "UMask": "0x1",
216 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
217 "Counter": "0,1,2,3",
218 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
219 "AnyThread": "1",
220 "SampleAfterValue": "2000003",
221 "CounterHTOff": "0,1,2,3,4,5,6,7"
222 },
223 {
153 "EventCode": "0x3c", 224 "EventCode": "0x3c",
154 "UMask": "0x2", 225 "UMask": "0x2",
155 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.", 226 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
@@ -159,6 +230,15 @@
159 "CounterHTOff": "0,1,2,3" 230 "CounterHTOff": "0,1,2,3"
160 }, 231 },
161 { 232 {
233 "EventCode": "0x3C",
234 "UMask": "0x2",
235 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
236 "Counter": "0,1,2,3",
237 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
238 "SampleAfterValue": "2000003",
239 "CounterHTOff": "0,1,2,3,4,5,6,7"
240 },
241 {
162 "EventCode": "0x4c", 242 "EventCode": "0x4c",
163 "UMask": "0x1", 243 "UMask": "0x1",
164 "BriefDescription": "Not software-prefetch load dispatches that hit FB allocated for software prefetch", 244 "BriefDescription": "Not software-prefetch load dispatches that hit FB allocated for software prefetch",
@@ -225,6 +305,18 @@
225 "CounterHTOff": "0,1,2,3,4,5,6,7" 305 "CounterHTOff": "0,1,2,3,4,5,6,7"
226 }, 306 },
227 { 307 {
308 "EdgeDetect": "1",
309 "Invert": "1",
310 "EventCode": "0x5E",
311 "UMask": "0x1",
312 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
313 "Counter": "0,1,2,3",
314 "EventName": "RS_EVENTS.EMPTY_END",
315 "CounterMask": "1",
316 "SampleAfterValue": "200003",
317 "CounterHTOff": "0,1,2,3,4,5,6,7"
318 },
319 {
228 "EventCode": "0x87", 320 "EventCode": "0x87",
229 "UMask": "0x1", 321 "UMask": "0x1",
230 "BriefDescription": "Stalls caused by changing prefix length of the instruction.", 322 "BriefDescription": "Stalls caused by changing prefix length of the instruction.",
@@ -406,6 +498,15 @@
406 }, 498 },
407 { 499 {
408 "EventCode": "0x89", 500 "EventCode": "0x89",
501 "UMask": "0xa0",
502 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
503 "Counter": "0,1,2,3",
504 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
505 "SampleAfterValue": "200003",
506 "CounterHTOff": "0,1,2,3,4,5,6,7"
507 },
508 {
509 "EventCode": "0x89",
409 "UMask": "0xc1", 510 "UMask": "0xc1",
410 "BriefDescription": "Speculative and retired mispredicted macro conditional branches", 511 "BriefDescription": "Speculative and retired mispredicted macro conditional branches",
411 "Counter": "0,1,2,3", 512 "Counter": "0,1,2,3",
@@ -435,6 +536,16 @@
435 "CounterHTOff": "0,1,2,3,4,5,6,7" 536 "CounterHTOff": "0,1,2,3,4,5,6,7"
436 }, 537 },
437 { 538 {
539 "EventCode": "0xA0",
540 "UMask": "0x3",
541 "BriefDescription": "Micro-op dispatches cancelled due to insufficient SIMD physical register file read ports",
542 "Counter": "0,1,2,3",
543 "EventName": "UOP_DISPATCHES_CANCELLED.SIMD_PRF",
544 "PublicDescription": "This event counts the number of micro-operations cancelled after they were dispatched from the scheduler to the execution units when the total number of physical register read ports across all dispatch ports exceeds the read bandwidth of the physical register file. The SIMD_PRF subevent applies to the following instructions: VDPPS, DPPS, VPCMPESTRI, PCMPESTRI, VPCMPESTRM, PCMPESTRM, VFMADD*, VFMADDSUB*, VFMSUB*, VMSUBADD*, VFNMADD*, VFNMSUB*. See the Broadwell Optimization Guide for more information.",
545 "SampleAfterValue": "2000003",
546 "CounterHTOff": "0,1,2,3"
547 },
548 {
438 "EventCode": "0xA1", 549 "EventCode": "0xA1",
439 "UMask": "0x1", 550 "UMask": "0x1",
440 "BriefDescription": "Cycles per thread when uops are executed in port 0", 551 "BriefDescription": "Cycles per thread when uops are executed in port 0",
@@ -446,6 +557,26 @@
446 }, 557 },
447 { 558 {
448 "EventCode": "0xA1", 559 "EventCode": "0xA1",
560 "UMask": "0x1",
561 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
562 "Counter": "0,1,2,3",
563 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
564 "AnyThread": "1",
565 "SampleAfterValue": "2000003",
566 "CounterHTOff": "0,1,2,3,4,5,6,7"
567 },
568 {
569 "EventCode": "0xA1",
570 "UMask": "0x1",
571 "BriefDescription": "Cycles per thread when uops are executed in port 0",
572 "Counter": "0,1,2,3",
573 "EventName": "UOPS_EXECUTED_PORT.PORT_0",
574 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
575 "SampleAfterValue": "2000003",
576 "CounterHTOff": "0,1,2,3,4,5,6,7"
577 },
578 {
579 "EventCode": "0xA1",
449 "UMask": "0x2", 580 "UMask": "0x2",
450 "BriefDescription": "Cycles per thread when uops are executed in port 1", 581 "BriefDescription": "Cycles per thread when uops are executed in port 1",
451 "Counter": "0,1,2,3", 582 "Counter": "0,1,2,3",
@@ -456,6 +587,26 @@
456 }, 587 },
457 { 588 {
458 "EventCode": "0xA1", 589 "EventCode": "0xA1",
590 "UMask": "0x2",
591 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
592 "Counter": "0,1,2,3",
593 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
594 "AnyThread": "1",
595 "SampleAfterValue": "2000003",
596 "CounterHTOff": "0,1,2,3,4,5,6,7"
597 },
598 {
599 "EventCode": "0xA1",
600 "UMask": "0x2",
601 "BriefDescription": "Cycles per thread when uops are executed in port 1",
602 "Counter": "0,1,2,3",
603 "EventName": "UOPS_EXECUTED_PORT.PORT_1",
604 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
605 "SampleAfterValue": "2000003",
606 "CounterHTOff": "0,1,2,3,4,5,6,7"
607 },
608 {
609 "EventCode": "0xA1",
459 "UMask": "0x4", 610 "UMask": "0x4",
460 "BriefDescription": "Cycles per thread when uops are executed in port 2", 611 "BriefDescription": "Cycles per thread when uops are executed in port 2",
461 "Counter": "0,1,2,3", 612 "Counter": "0,1,2,3",
@@ -466,6 +617,26 @@
466 }, 617 },
467 { 618 {
468 "EventCode": "0xA1", 619 "EventCode": "0xA1",
620 "UMask": "0x4",
621 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
622 "Counter": "0,1,2,3",
623 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
624 "AnyThread": "1",
625 "SampleAfterValue": "2000003",
626 "CounterHTOff": "0,1,2,3,4,5,6,7"
627 },
628 {
629 "EventCode": "0xA1",
630 "UMask": "0x4",
631 "BriefDescription": "Cycles per thread when uops are executed in port 2",
632 "Counter": "0,1,2,3",
633 "EventName": "UOPS_EXECUTED_PORT.PORT_2",
634 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
635 "SampleAfterValue": "2000003",
636 "CounterHTOff": "0,1,2,3,4,5,6,7"
637 },
638 {
639 "EventCode": "0xA1",
469 "UMask": "0x8", 640 "UMask": "0x8",
470 "BriefDescription": "Cycles per thread when uops are executed in port 3", 641 "BriefDescription": "Cycles per thread when uops are executed in port 3",
471 "Counter": "0,1,2,3", 642 "Counter": "0,1,2,3",
@@ -476,6 +647,26 @@
476 }, 647 },
477 { 648 {
478 "EventCode": "0xA1", 649 "EventCode": "0xA1",
650 "UMask": "0x8",
651 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
652 "Counter": "0,1,2,3",
653 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
654 "AnyThread": "1",
655 "SampleAfterValue": "2000003",
656 "CounterHTOff": "0,1,2,3,4,5,6,7"
657 },
658 {
659 "EventCode": "0xA1",
660 "UMask": "0x8",
661 "BriefDescription": "Cycles per thread when uops are executed in port 3",
662 "Counter": "0,1,2,3",
663 "EventName": "UOPS_EXECUTED_PORT.PORT_3",
664 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
665 "SampleAfterValue": "2000003",
666 "CounterHTOff": "0,1,2,3,4,5,6,7"
667 },
668 {
669 "EventCode": "0xA1",
479 "UMask": "0x10", 670 "UMask": "0x10",
480 "BriefDescription": "Cycles per thread when uops are executed in port 4", 671 "BriefDescription": "Cycles per thread when uops are executed in port 4",
481 "Counter": "0,1,2,3", 672 "Counter": "0,1,2,3",
@@ -486,6 +677,26 @@
486 }, 677 },
487 { 678 {
488 "EventCode": "0xA1", 679 "EventCode": "0xA1",
680 "UMask": "0x10",
681 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
682 "Counter": "0,1,2,3",
683 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
684 "AnyThread": "1",
685 "SampleAfterValue": "2000003",
686 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 },
688 {
689 "EventCode": "0xA1",
690 "UMask": "0x10",
691 "BriefDescription": "Cycles per thread when uops are executed in port 4",
692 "Counter": "0,1,2,3",
693 "EventName": "UOPS_EXECUTED_PORT.PORT_4",
694 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
695 "SampleAfterValue": "2000003",
696 "CounterHTOff": "0,1,2,3,4,5,6,7"
697 },
698 {
699 "EventCode": "0xA1",
489 "UMask": "0x20", 700 "UMask": "0x20",
490 "BriefDescription": "Cycles per thread when uops are executed in port 5", 701 "BriefDescription": "Cycles per thread when uops are executed in port 5",
491 "Counter": "0,1,2,3", 702 "Counter": "0,1,2,3",
@@ -496,6 +707,26 @@
496 }, 707 },
497 { 708 {
498 "EventCode": "0xA1", 709 "EventCode": "0xA1",
710 "UMask": "0x20",
711 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
712 "Counter": "0,1,2,3",
713 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
714 "AnyThread": "1",
715 "SampleAfterValue": "2000003",
716 "CounterHTOff": "0,1,2,3,4,5,6,7"
717 },
718 {
719 "EventCode": "0xA1",
720 "UMask": "0x20",
721 "BriefDescription": "Cycles per thread when uops are executed in port 5",
722 "Counter": "0,1,2,3",
723 "EventName": "UOPS_EXECUTED_PORT.PORT_5",
724 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
725 "SampleAfterValue": "2000003",
726 "CounterHTOff": "0,1,2,3,4,5,6,7"
727 },
728 {
729 "EventCode": "0xA1",
499 "UMask": "0x40", 730 "UMask": "0x40",
500 "BriefDescription": "Cycles per thread when uops are executed in port 6", 731 "BriefDescription": "Cycles per thread when uops are executed in port 6",
501 "Counter": "0,1,2,3", 732 "Counter": "0,1,2,3",
@@ -506,6 +737,26 @@
506 }, 737 },
507 { 738 {
508 "EventCode": "0xA1", 739 "EventCode": "0xA1",
740 "UMask": "0x40",
741 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
742 "Counter": "0,1,2,3",
743 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
744 "AnyThread": "1",
745 "SampleAfterValue": "2000003",
746 "CounterHTOff": "0,1,2,3,4,5,6,7"
747 },
748 {
749 "EventCode": "0xA1",
750 "UMask": "0x40",
751 "BriefDescription": "Cycles per thread when uops are executed in port 6",
752 "Counter": "0,1,2,3",
753 "EventName": "UOPS_EXECUTED_PORT.PORT_6",
754 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
755 "SampleAfterValue": "2000003",
756 "CounterHTOff": "0,1,2,3,4,5,6,7"
757 },
758 {
759 "EventCode": "0xA1",
509 "UMask": "0x80", 760 "UMask": "0x80",
510 "BriefDescription": "Cycles per thread when uops are executed in port 7", 761 "BriefDescription": "Cycles per thread when uops are executed in port 7",
511 "Counter": "0,1,2,3", 762 "Counter": "0,1,2,3",
@@ -515,6 +766,26 @@
515 "CounterHTOff": "0,1,2,3,4,5,6,7" 766 "CounterHTOff": "0,1,2,3,4,5,6,7"
516 }, 767 },
517 { 768 {
769 "EventCode": "0xA1",
770 "UMask": "0x80",
771 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
772 "Counter": "0,1,2,3",
773 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
774 "AnyThread": "1",
775 "SampleAfterValue": "2000003",
776 "CounterHTOff": "0,1,2,3,4,5,6,7"
777 },
778 {
779 "EventCode": "0xA1",
780 "UMask": "0x80",
781 "BriefDescription": "Cycles per thread when uops are executed in port 7",
782 "Counter": "0,1,2,3",
783 "EventName": "UOPS_EXECUTED_PORT.PORT_7",
784 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
785 "SampleAfterValue": "2000003",
786 "CounterHTOff": "0,1,2,3,4,5,6,7"
787 },
788 {
518 "EventCode": "0xA2", 789 "EventCode": "0xA2",
519 "UMask": "0x1", 790 "UMask": "0x1",
520 "BriefDescription": "Resource-related stall cycles", 791 "BriefDescription": "Resource-related stall cycles",
@@ -567,14 +838,13 @@
567 }, 838 },
568 { 839 {
569 "EventCode": "0xA3", 840 "EventCode": "0xA3",
570 "UMask": "0x8", 841 "UMask": "0x1",
571 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.", 842 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
572 "Counter": "2", 843 "Counter": "0,1,2,3",
573 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING", 844 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
574 "CounterMask": "8", 845 "CounterMask": "1",
575 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request missing the L1 data cache.",
576 "SampleAfterValue": "2000003", 846 "SampleAfterValue": "2000003",
577 "CounterHTOff": "2" 847 "CounterHTOff": "0,1,2,3,4,5,6,7"
578 }, 848 },
579 { 849 {
580 "EventCode": "0xA3", 850 "EventCode": "0xA3",
@@ -589,8 +859,18 @@
589 }, 859 },
590 { 860 {
591 "EventCode": "0xA3", 861 "EventCode": "0xA3",
862 "UMask": "0x2",
863 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
864 "Counter": "0,1,2,3",
865 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
866 "CounterMask": "2",
867 "SampleAfterValue": "2000003",
868 "CounterHTOff": "0,1,2,3"
869 },
870 {
871 "EventCode": "0xA3",
592 "UMask": "0x4", 872 "UMask": "0x4",
593 "BriefDescription": "Total execution stalls", 873 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
594 "Counter": "0,1,2,3", 874 "Counter": "0,1,2,3",
595 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 875 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
596 "CounterMask": "4", 876 "CounterMask": "4",
@@ -600,6 +880,16 @@
600 }, 880 },
601 { 881 {
602 "EventCode": "0xA3", 882 "EventCode": "0xA3",
883 "UMask": "0x4",
884 "BriefDescription": "Total execution stalls.",
885 "Counter": "0,1,2,3",
886 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
887 "CounterMask": "4",
888 "SampleAfterValue": "2000003",
889 "CounterHTOff": "0,1,2,3,4,5,6,7"
890 },
891 {
892 "EventCode": "0xA3",
603 "UMask": "0x5", 893 "UMask": "0x5",
604 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.", 894 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
605 "Counter": "0,1,2,3", 895 "Counter": "0,1,2,3",
@@ -611,6 +901,16 @@
611 }, 901 },
612 { 902 {
613 "EventCode": "0xA3", 903 "EventCode": "0xA3",
904 "UMask": "0x5",
905 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
906 "Counter": "0,1,2,3",
907 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
908 "CounterMask": "5",
909 "SampleAfterValue": "2000003",
910 "CounterHTOff": "0,1,2,3,4,5,6,7"
911 },
912 {
913 "EventCode": "0xA3",
614 "UMask": "0x6", 914 "UMask": "0x6",
615 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.", 915 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
616 "Counter": "0,1,2,3", 916 "Counter": "0,1,2,3",
@@ -622,6 +922,37 @@
622 }, 922 },
623 { 923 {
624 "EventCode": "0xA3", 924 "EventCode": "0xA3",
925 "UMask": "0x6",
926 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
927 "Counter": "0,1,2,3",
928 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
929 "CounterMask": "6",
930 "SampleAfterValue": "2000003",
931 "CounterHTOff": "0,1,2,3,4,5,6,7"
932 },
933 {
934 "EventCode": "0xA3",
935 "UMask": "0x8",
936 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
937 "Counter": "2",
938 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
939 "CounterMask": "8",
940 "PublicDescription": "Counts number of cycles the CPU has at least one pending demand load request missing the L1 data cache.",
941 "SampleAfterValue": "2000003",
942 "CounterHTOff": "2"
943 },
944 {
945 "EventCode": "0xA3",
946 "UMask": "0x8",
947 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
948 "Counter": "2",
949 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
950 "CounterMask": "8",
951 "SampleAfterValue": "2000003",
952 "CounterHTOff": "2"
953 },
954 {
955 "EventCode": "0xA3",
625 "UMask": "0xc", 956 "UMask": "0xc",
626 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.", 957 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
627 "Counter": "2", 958 "Counter": "2",
@@ -632,12 +963,41 @@
632 "CounterHTOff": "2" 963 "CounterHTOff": "2"
633 }, 964 },
634 { 965 {
966 "EventCode": "0xA3",
967 "UMask": "0xc",
968 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
969 "Counter": "2",
970 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
971 "CounterMask": "12",
972 "SampleAfterValue": "2000003",
973 "CounterHTOff": "2"
974 },
975 {
635 "EventCode": "0xA8", 976 "EventCode": "0xA8",
636 "UMask": "0x1", 977 "UMask": "0x1",
637 "BriefDescription": "Number of Uops delivered by the LSD.", 978 "BriefDescription": "Number of Uops delivered by the LSD.",
638 "Counter": "0,1,2,3", 979 "Counter": "0,1,2,3",
639 "EventName": "LSD.UOPS", 980 "EventName": "LSD.UOPS",
640 "PublicDescription": "Number of Uops delivered by the LSD. ", 981 "SampleAfterValue": "2000003",
982 "CounterHTOff": "0,1,2,3,4,5,6,7"
983 },
984 {
985 "EventCode": "0xA8",
986 "UMask": "0x1",
987 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
988 "Counter": "0,1,2,3",
989 "EventName": "LSD.CYCLES_4_UOPS",
990 "CounterMask": "4",
991 "SampleAfterValue": "2000003",
992 "CounterHTOff": "0,1,2,3,4,5,6,7"
993 },
994 {
995 "EventCode": "0xA8",
996 "UMask": "0x1",
997 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
998 "Counter": "0,1,2,3",
999 "EventName": "LSD.CYCLES_ACTIVE",
1000 "CounterMask": "1",
641 "SampleAfterValue": "2000003", 1001 "SampleAfterValue": "2000003",
642 "CounterHTOff": "0,1,2,3,4,5,6,7" 1002 "CounterHTOff": "0,1,2,3,4,5,6,7"
643 }, 1003 },
@@ -652,6 +1012,58 @@
652 "CounterHTOff": "0,1,2,3,4,5,6,7" 1012 "CounterHTOff": "0,1,2,3,4,5,6,7"
653 }, 1013 },
654 { 1014 {
1015 "Invert": "1",
1016 "EventCode": "0xB1",
1017 "UMask": "0x1",
1018 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
1019 "Counter": "0,1,2,3",
1020 "EventName": "UOPS_EXECUTED.STALL_CYCLES",
1021 "CounterMask": "1",
1022 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.",
1023 "SampleAfterValue": "2000003",
1024 "CounterHTOff": "0,1,2,3"
1025 },
1026 {
1027 "EventCode": "0xB1",
1028 "UMask": "0x1",
1029 "BriefDescription": "Cycles where at least 1 uop was executed per-thread.",
1030 "Counter": "0,1,2,3",
1031 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1032 "CounterMask": "1",
1033 "SampleAfterValue": "2000003",
1034 "CounterHTOff": "0,1,2,3"
1035 },
1036 {
1037 "EventCode": "0xB1",
1038 "UMask": "0x1",
1039 "BriefDescription": "Cycles where at least 2 uops were executed per-thread.",
1040 "Counter": "0,1,2,3",
1041 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1042 "CounterMask": "2",
1043 "SampleAfterValue": "2000003",
1044 "CounterHTOff": "0,1,2,3"
1045 },
1046 {
1047 "EventCode": "0xB1",
1048 "UMask": "0x1",
1049 "BriefDescription": "Cycles where at least 3 uops were executed per-thread.",
1050 "Counter": "0,1,2,3",
1051 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1052 "CounterMask": "3",
1053 "SampleAfterValue": "2000003",
1054 "CounterHTOff": "0,1,2,3"
1055 },
1056 {
1057 "EventCode": "0xB1",
1058 "UMask": "0x1",
1059 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
1060 "Counter": "0,1,2,3",
1061 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
1062 "CounterMask": "4",
1063 "SampleAfterValue": "2000003",
1064 "CounterHTOff": "0,1,2,3"
1065 },
1066 {
655 "EventCode": "0xB1", 1067 "EventCode": "0xB1",
656 "UMask": "0x2", 1068 "UMask": "0x2",
657 "BriefDescription": "Number of uops executed on the core.", 1069 "BriefDescription": "Number of uops executed on the core.",
@@ -662,35 +1074,63 @@
662 "CounterHTOff": "0,1,2,3,4,5,6,7" 1074 "CounterHTOff": "0,1,2,3,4,5,6,7"
663 }, 1075 },
664 { 1076 {
665 "Invert": "1", 1077 "EventCode": "0xb1",
666 "EventCode": "0xB1", 1078 "UMask": "0x2",
667 "UMask": "0x1", 1079 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
668 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
669 "Counter": "0,1,2,3", 1080 "Counter": "0,1,2,3",
670 "EventName": "UOPS_EXECUTED.STALL_CYCLES", 1081 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
671 "CounterMask": "1", 1082 "CounterMask": "1",
672 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.",
673 "SampleAfterValue": "2000003", 1083 "SampleAfterValue": "2000003",
674 "CounterHTOff": "0,1,2,3" 1084 "CounterHTOff": "0,1,2,3,4,5,6,7"
675 }, 1085 },
676 { 1086 {
677 "EventCode": "0xC0", 1087 "EventCode": "0xb1",
678 "UMask": "0x0", 1088 "UMask": "0x2",
679 "BriefDescription": "Number of instructions retired. General Counter - architectural event", 1089 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
680 "Counter": "0,1,2,3", 1090 "Counter": "0,1,2,3",
681 "EventName": "INST_RETIRED.ANY_P", 1091 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
682 "Errata": "BDM61", 1092 "CounterMask": "2",
683 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).",
684 "SampleAfterValue": "2000003", 1093 "SampleAfterValue": "2000003",
685 "CounterHTOff": "0,1,2,3,4,5,6,7" 1094 "CounterHTOff": "0,1,2,3,4,5,6,7"
686 }, 1095 },
687 { 1096 {
688 "EventCode": "0xC0", 1097 "EventCode": "0xb1",
689 "UMask": "0x2", 1098 "UMask": "0x2",
690 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions:", 1099 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
691 "Counter": "0,1,2,3", 1100 "Counter": "0,1,2,3",
692 "EventName": "INST_RETIRED.X87", 1101 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
693 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.", 1102 "CounterMask": "3",
1103 "SampleAfterValue": "2000003",
1104 "CounterHTOff": "0,1,2,3,4,5,6,7"
1105 },
1106 {
1107 "EventCode": "0xb1",
1108 "UMask": "0x2",
1109 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1110 "Counter": "0,1,2,3",
1111 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1112 "CounterMask": "4",
1113 "SampleAfterValue": "2000003",
1114 "CounterHTOff": "0,1,2,3,4,5,6,7"
1115 },
1116 {
1117 "Invert": "1",
1118 "EventCode": "0xb1",
1119 "UMask": "0x2",
1120 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1121 "Counter": "0,1,2,3",
1122 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1123 "SampleAfterValue": "2000003",
1124 "CounterHTOff": "0,1,2,3,4,5,6,7"
1125 },
1126 {
1127 "EventCode": "0xC0",
1128 "UMask": "0x0",
1129 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
1130 "Counter": "0,1,2,3",
1131 "EventName": "INST_RETIRED.ANY_P",
1132 "Errata": "BDM61",
1133 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).",
694 "SampleAfterValue": "2000003", 1134 "SampleAfterValue": "2000003",
695 "CounterHTOff": "0,1,2,3,4,5,6,7" 1135 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 }, 1136 },
@@ -707,6 +1147,16 @@
707 "CounterHTOff": "1" 1147 "CounterHTOff": "1"
708 }, 1148 },
709 { 1149 {
1150 "EventCode": "0xC0",
1151 "UMask": "0x2",
1152 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions:",
1153 "Counter": "0,1,2,3",
1154 "EventName": "INST_RETIRED.X87",
1155 "PublicDescription": "This event counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.",
1156 "SampleAfterValue": "2000003",
1157 "CounterHTOff": "0,1,2,3,4,5,6,7"
1158 },
1159 {
710 "EventCode": "0xC1", 1160 "EventCode": "0xC1",
711 "UMask": "0x40", 1161 "UMask": "0x40",
712 "BriefDescription": "Number of times any microcode assist is invoked by HW upon uop writeback.", 1162 "BriefDescription": "Number of times any microcode assist is invoked by HW upon uop writeback.",
@@ -718,23 +1168,12 @@
718 { 1168 {
719 "EventCode": "0xC2", 1169 "EventCode": "0xC2",
720 "UMask": "0x1", 1170 "UMask": "0x1",
721 "BriefDescription": "Actually retired uops.", 1171 "BriefDescription": "Actually retired uops. (Precise Event - PEBS)",
722 "Data_LA": "1", 1172 "Data_LA": "1",
723 "PEBS": "1", 1173 "PEBS": "1",
724 "Counter": "0,1,2,3", 1174 "Counter": "0,1,2,3",
725 "EventName": "UOPS_RETIRED.ALL", 1175 "EventName": "UOPS_RETIRED.ALL",
726 "PublicDescription": "This event counts all actually retired uops. Counting increments by two for micro-fused uops, and by one for macro-fused and other uops. Maximal increment value for one cycle is eight.", 1176 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts all actually retired uops. Counting increments by two for micro-fused uops, and by one for macro-fused and other uops. Maximal increment value for one cycle is eight.",
727 "SampleAfterValue": "2000003",
728 "CounterHTOff": "0,1,2,3,4,5,6,7"
729 },
730 {
731 "EventCode": "0xC2",
732 "UMask": "0x2",
733 "BriefDescription": "Retirement slots used.",
734 "PEBS": "1",
735 "Counter": "0,1,2,3",
736 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
737 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of retirement slots used.",
738 "SampleAfterValue": "2000003", 1177 "SampleAfterValue": "2000003",
739 "CounterHTOff": "0,1,2,3,4,5,6,7" 1178 "CounterHTOff": "0,1,2,3,4,5,6,7"
740 }, 1179 },
@@ -746,7 +1185,7 @@
746 "Counter": "0,1,2,3", 1185 "Counter": "0,1,2,3",
747 "EventName": "UOPS_RETIRED.STALL_CYCLES", 1186 "EventName": "UOPS_RETIRED.STALL_CYCLES",
748 "CounterMask": "1", 1187 "CounterMask": "1",
749 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts cycles without actually retired uops.", 1188 "PublicDescription": "This event counts cycles without actually retired uops.",
750 "SampleAfterValue": "2000003", 1189 "SampleAfterValue": "2000003",
751 "CounterHTOff": "0,1,2,3" 1190 "CounterHTOff": "0,1,2,3"
752 }, 1191 },
@@ -763,6 +1202,17 @@
763 "CounterHTOff": "0,1,2,3" 1202 "CounterHTOff": "0,1,2,3"
764 }, 1203 },
765 { 1204 {
1205 "EventCode": "0xC2",
1206 "UMask": "0x2",
1207 "BriefDescription": "Retirement slots used. (Precise Event - PEBS)",
1208 "PEBS": "1",
1209 "Counter": "0,1,2,3",
1210 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1211 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts the number of retirement slots used.",
1212 "SampleAfterValue": "2000003",
1213 "CounterHTOff": "0,1,2,3,4,5,6,7"
1214 },
1215 {
766 "EventCode": "0xC3", 1216 "EventCode": "0xC3",
767 "UMask": "0x1", 1217 "UMask": "0x1",
768 "BriefDescription": "Cycles there was a Nuke. Account for both thread-specific and All Thread Nukes.", 1218 "BriefDescription": "Cycles there was a Nuke. Account for both thread-specific and All Thread Nukes.",
@@ -773,6 +1223,17 @@
773 "CounterHTOff": "0,1,2,3,4,5,6,7" 1223 "CounterHTOff": "0,1,2,3,4,5,6,7"
774 }, 1224 },
775 { 1225 {
1226 "EdgeDetect": "1",
1227 "EventCode": "0xC3",
1228 "UMask": "0x1",
1229 "BriefDescription": "Number of machine clears (nukes) of any type.",
1230 "Counter": "0,1,2,3",
1231 "EventName": "MACHINE_CLEARS.COUNT",
1232 "CounterMask": "1",
1233 "SampleAfterValue": "100003",
1234 "CounterHTOff": "0,1,2,3,4,5,6,7"
1235 },
1236 {
776 "EventCode": "0xC3", 1237 "EventCode": "0xC3",
777 "UMask": "0x4", 1238 "UMask": "0x4",
778 "BriefDescription": "Self-modifying code (SMC) detected.", 1239 "BriefDescription": "Self-modifying code (SMC) detected.",
@@ -794,44 +1255,67 @@
794 }, 1255 },
795 { 1256 {
796 "EventCode": "0xC4", 1257 "EventCode": "0xC4",
1258 "UMask": "0x0",
1259 "BriefDescription": "All (macro) branch instructions retired.",
1260 "Counter": "0,1,2,3",
1261 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1262 "PublicDescription": "This event counts all (macro) branch instructions retired.",
1263 "SampleAfterValue": "400009",
1264 "CounterHTOff": "0,1,2,3,4,5,6,7"
1265 },
1266 {
1267 "EventCode": "0xC4",
797 "UMask": "0x1", 1268 "UMask": "0x1",
798 "BriefDescription": "Conditional branch instructions retired.", 1269 "BriefDescription": "Conditional branch instructions retired. (Precise Event - PEBS)",
799 "PEBS": "1", 1270 "PEBS": "1",
800 "Counter": "0,1,2,3", 1271 "Counter": "0,1,2,3",
801 "EventName": "BR_INST_RETIRED.CONDITIONAL", 1272 "EventName": "BR_INST_RETIRED.CONDITIONAL",
802 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts conditional branch instructions retired.", 1273 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts conditional branch instructions retired.",
803 "SampleAfterValue": "400009", 1274 "SampleAfterValue": "400009",
804 "CounterHTOff": "0,1,2,3,4,5,6,7" 1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
805 }, 1276 },
806 { 1277 {
807 "EventCode": "0xC4", 1278 "EventCode": "0xC4",
808 "UMask": "0x2", 1279 "UMask": "0x2",
809 "BriefDescription": "Direct and indirect near call instructions retired.", 1280 "BriefDescription": "Direct and indirect near call instructions retired. (Precise Event - PEBS)",
810 "PEBS": "1", 1281 "PEBS": "1",
811 "Counter": "0,1,2,3", 1282 "Counter": "0,1,2,3",
812 "EventName": "BR_INST_RETIRED.NEAR_CALL", 1283 "EventName": "BR_INST_RETIRED.NEAR_CALL",
813 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts both direct and indirect near call instructions retired.", 1284 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect near call instructions retired.",
814 "SampleAfterValue": "100007", 1285 "SampleAfterValue": "100007",
815 "CounterHTOff": "0,1,2,3,4,5,6,7" 1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
816 }, 1287 },
817 { 1288 {
818 "EventCode": "0xC4", 1289 "EventCode": "0xC4",
819 "UMask": "0x0", 1290 "UMask": "0x2",
820 "BriefDescription": "All (macro) branch instructions retired.", 1291 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3). (Precise Event - PEBS)",
1292 "PEBS": "1",
821 "Counter": "0,1,2,3", 1293 "Counter": "0,1,2,3",
822 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1294 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
823 "PublicDescription": "This event counts all (macro) branch instructions retired.", 1295 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect macro near call instructions retired (captured in ring 3).",
824 "SampleAfterValue": "400009", 1296 "SampleAfterValue": "100007",
825 "CounterHTOff": "0,1,2,3,4,5,6,7" 1297 "CounterHTOff": "0,1,2,3,4,5,6,7"
826 }, 1298 },
827 { 1299 {
828 "EventCode": "0xC4", 1300 "EventCode": "0xC4",
1301 "UMask": "0x4",
1302 "BriefDescription": "All (macro) branch instructions retired. (Precise Event - PEBS)",
1303 "PEBS": "2",
1304 "Counter": "0,1,2,3",
1305 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
1306 "Errata": "BDW98",
1307 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
1308 "SampleAfterValue": "400009",
1309 "CounterHTOff": "0,1,2,3"
1310 },
1311 {
1312 "EventCode": "0xC4",
829 "UMask": "0x8", 1313 "UMask": "0x8",
830 "BriefDescription": "Return instructions retired.", 1314 "BriefDescription": "Return instructions retired. (Precise Event - PEBS)",
831 "PEBS": "1", 1315 "PEBS": "1",
832 "Counter": "0,1,2,3", 1316 "Counter": "0,1,2,3",
833 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 1317 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
834 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts return instructions retired.", 1318 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts return instructions retired.",
835 "SampleAfterValue": "100007", 1319 "SampleAfterValue": "100007",
836 "CounterHTOff": "0,1,2,3,4,5,6,7" 1320 "CounterHTOff": "0,1,2,3,4,5,6,7"
837 }, 1321 },
@@ -841,18 +1325,18 @@
841 "BriefDescription": "Not taken branch instructions retired.", 1325 "BriefDescription": "Not taken branch instructions retired.",
842 "Counter": "0,1,2,3", 1326 "Counter": "0,1,2,3",
843 "EventName": "BR_INST_RETIRED.NOT_TAKEN", 1327 "EventName": "BR_INST_RETIRED.NOT_TAKEN",
844 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts not taken branch instructions retired.", 1328 "PublicDescription": "This event counts not taken branch instructions retired.",
845 "SampleAfterValue": "400009", 1329 "SampleAfterValue": "400009",
846 "CounterHTOff": "0,1,2,3,4,5,6,7" 1330 "CounterHTOff": "0,1,2,3,4,5,6,7"
847 }, 1331 },
848 { 1332 {
849 "EventCode": "0xC4", 1333 "EventCode": "0xC4",
850 "UMask": "0x20", 1334 "UMask": "0x20",
851 "BriefDescription": "Taken branch instructions retired.", 1335 "BriefDescription": "Taken branch instructions retired. (Precise Event - PEBS)",
852 "PEBS": "1", 1336 "PEBS": "1",
853 "Counter": "0,1,2,3", 1337 "Counter": "0,1,2,3",
854 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 1338 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
855 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts taken branch instructions retired.", 1339 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts taken branch instructions retired.",
856 "SampleAfterValue": "400009", 1340 "SampleAfterValue": "400009",
857 "CounterHTOff": "0,1,2,3,4,5,6,7" 1341 "CounterHTOff": "0,1,2,3,4,5,6,7"
858 }, 1342 },
@@ -863,34 +1347,11 @@
863 "Counter": "0,1,2,3", 1347 "Counter": "0,1,2,3",
864 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 1348 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
865 "Errata": "BDW98", 1349 "Errata": "BDW98",
866 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts far branch instructions retired.", 1350 "PublicDescription": "This event counts far branch instructions retired.",
867 "SampleAfterValue": "100007", 1351 "SampleAfterValue": "100007",
868 "CounterHTOff": "0,1,2,3,4,5,6,7" 1352 "CounterHTOff": "0,1,2,3,4,5,6,7"
869 }, 1353 },
870 { 1354 {
871 "EventCode": "0xC4",
872 "UMask": "0x4",
873 "BriefDescription": "All (macro) branch instructions retired. (Precise Event - PEBS)",
874 "PEBS": "2",
875 "Counter": "0,1,2,3",
876 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
877 "Errata": "BDW98",
878 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
879 "SampleAfterValue": "400009",
880 "CounterHTOff": "0,1,2,3"
881 },
882 {
883 "EventCode": "0xC5",
884 "UMask": "0x1",
885 "BriefDescription": "Mispredicted conditional branch instructions retired.",
886 "PEBS": "1",
887 "Counter": "0,1,2,3",
888 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
889 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted conditional branch instructions retired.",
890 "SampleAfterValue": "400009",
891 "CounterHTOff": "0,1,2,3,4,5,6,7"
892 },
893 {
894 "EventCode": "0xC5", 1355 "EventCode": "0xC5",
895 "UMask": "0x0", 1356 "UMask": "0x0",
896 "BriefDescription": "All mispredicted macro branch instructions retired.", 1357 "BriefDescription": "All mispredicted macro branch instructions retired.",
@@ -902,13 +1363,13 @@
902 }, 1363 },
903 { 1364 {
904 "EventCode": "0xC5", 1365 "EventCode": "0xC5",
905 "UMask": "0x8", 1366 "UMask": "0x1",
906 "BriefDescription": "This event counts the number of mispredicted ret instructions retired. Non PEBS", 1367 "BriefDescription": "Mispredicted conditional branch instructions retired. (Precise Event - PEBS)",
907 "PEBS": "1", 1368 "PEBS": "1",
908 "Counter": "0,1,2,3", 1369 "Counter": "0,1,2,3",
909 "EventName": "BR_MISP_RETIRED.RET", 1370 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
910 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted return instructions retired.", 1371 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted conditional branch instructions retired.",
911 "SampleAfterValue": "100007", 1372 "SampleAfterValue": "400009",
912 "CounterHTOff": "0,1,2,3,4,5,6,7" 1373 "CounterHTOff": "0,1,2,3,4,5,6,7"
913 }, 1374 },
914 { 1375 {
@@ -923,164 +1384,36 @@
923 "CounterHTOff": "0,1,2,3" 1384 "CounterHTOff": "0,1,2,3"
924 }, 1385 },
925 { 1386 {
926 "EventCode": "0xCC", 1387 "EventCode": "0xC5",
927 "UMask": "0x20",
928 "BriefDescription": "Count cases of saving new LBR",
929 "Counter": "0,1,2,3",
930 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
931 "PublicDescription": "This event counts cases of saving new LBR records by hardware. This assumes proper enabling of LBRs and takes into account LBR filtering done by the LBR_SELECT register.",
932 "SampleAfterValue": "2000003",
933 "CounterHTOff": "0,1,2,3,4,5,6,7"
934 },
935 {
936 "EventCode": "0x3C",
937 "UMask": "0x0",
938 "BriefDescription": "Thread cycles when thread is not in halt state",
939 "Counter": "0,1,2,3",
940 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
941 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
942 "SampleAfterValue": "2000003",
943 "CounterHTOff": "0,1,2,3,4,5,6,7"
944 },
945 {
946 "EventCode": "0x89",
947 "UMask": "0xa0",
948 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
949 "Counter": "0,1,2,3",
950 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
951 "SampleAfterValue": "200003",
952 "CounterHTOff": "0,1,2,3,4,5,6,7"
953 },
954 {
955 "EventCode": "0xA1",
956 "UMask": "0x1",
957 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
958 "Counter": "0,1,2,3",
959 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
960 "AnyThread": "1",
961 "SampleAfterValue": "2000003",
962 "CounterHTOff": "0,1,2,3,4,5,6,7"
963 },
964 {
965 "EventCode": "0xA1",
966 "UMask": "0x2",
967 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
968 "Counter": "0,1,2,3",
969 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
970 "AnyThread": "1",
971 "SampleAfterValue": "2000003",
972 "CounterHTOff": "0,1,2,3,4,5,6,7"
973 },
974 {
975 "EventCode": "0xA1",
976 "UMask": "0x4",
977 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
978 "Counter": "0,1,2,3",
979 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
980 "AnyThread": "1",
981 "SampleAfterValue": "2000003",
982 "CounterHTOff": "0,1,2,3,4,5,6,7"
983 },
984 {
985 "EventCode": "0xA1",
986 "UMask": "0x8", 1388 "UMask": "0x8",
987 "BriefDescription": "Cycles per core when uops are dispatched to port 3.", 1389 "BriefDescription": "This event counts the number of mispredicted ret instructions retired.(Precise Event)",
988 "Counter": "0,1,2,3", 1390 "PEBS": "1",
989 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
990 "AnyThread": "1",
991 "SampleAfterValue": "2000003",
992 "CounterHTOff": "0,1,2,3,4,5,6,7"
993 },
994 {
995 "EventCode": "0xA1",
996 "UMask": "0x10",
997 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
998 "Counter": "0,1,2,3",
999 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
1000 "AnyThread": "1",
1001 "SampleAfterValue": "2000003",
1002 "CounterHTOff": "0,1,2,3,4,5,6,7"
1003 },
1004 {
1005 "EventCode": "0xA1",
1006 "UMask": "0x20",
1007 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
1008 "Counter": "0,1,2,3",
1009 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
1010 "AnyThread": "1",
1011 "SampleAfterValue": "2000003",
1012 "CounterHTOff": "0,1,2,3,4,5,6,7"
1013 },
1014 {
1015 "EventCode": "0xA1",
1016 "UMask": "0x40",
1017 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
1018 "Counter": "0,1,2,3",
1019 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
1020 "AnyThread": "1",
1021 "SampleAfterValue": "2000003",
1022 "CounterHTOff": "0,1,2,3,4,5,6,7"
1023 },
1024 {
1025 "EventCode": "0xA1",
1026 "UMask": "0x80",
1027 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
1028 "Counter": "0,1,2,3", 1391 "Counter": "0,1,2,3",
1029 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE", 1392 "EventName": "BR_MISP_RETIRED.RET",
1030 "AnyThread": "1", 1393 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted return instructions retired.",
1031 "SampleAfterValue": "2000003", 1394 "SampleAfterValue": "100007",
1032 "CounterHTOff": "0,1,2,3,4,5,6,7" 1395 "CounterHTOff": "0,1,2,3,4,5,6,7"
1033 }, 1396 },
1034 { 1397 {
1035 "EventCode": "0xC5", 1398 "EventCode": "0xC5",
1036 "UMask": "0x20", 1399 "UMask": "0x20",
1037 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.", 1400 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken. (Precise Event - PEBS).",
1038 "PEBS": "1", 1401 "PEBS": "1",
1039 "Counter": "0,1,2,3", 1402 "Counter": "0,1,2,3",
1040 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 1403 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
1041 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken.", 1404 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken. (Precise Event - PEBS).",
1042 "SampleAfterValue": "400009", 1405 "SampleAfterValue": "400009",
1043 "CounterHTOff": "0,1,2,3,4,5,6,7" 1406 "CounterHTOff": "0,1,2,3,4,5,6,7"
1044 }, 1407 },
1045 { 1408 {
1046 "EventCode": "0xB1", 1409 "EventCode": "0xCC",
1047 "UMask": "0x1", 1410 "UMask": "0x20",
1048 "BriefDescription": "Cycles where at least 1 uop was executed per-thread.", 1411 "BriefDescription": "Count cases of saving new LBR",
1049 "Counter": "0,1,2,3",
1050 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1051 "CounterMask": "1",
1052 "SampleAfterValue": "2000003",
1053 "CounterHTOff": "0,1,2,3"
1054 },
1055 {
1056 "EventCode": "0xB1",
1057 "UMask": "0x1",
1058 "BriefDescription": "Cycles where at least 2 uops were executed per-thread.",
1059 "Counter": "0,1,2,3",
1060 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1061 "CounterMask": "2",
1062 "SampleAfterValue": "2000003",
1063 "CounterHTOff": "0,1,2,3"
1064 },
1065 {
1066 "EventCode": "0xB1",
1067 "UMask": "0x1",
1068 "BriefDescription": "Cycles where at least 3 uops were executed per-thread.",
1069 "Counter": "0,1,2,3",
1070 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1071 "CounterMask": "3",
1072 "SampleAfterValue": "2000003",
1073 "CounterHTOff": "0,1,2,3"
1074 },
1075 {
1076 "EventCode": "0xB1",
1077 "UMask": "0x1",
1078 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
1079 "Counter": "0,1,2,3", 1412 "Counter": "0,1,2,3",
1080 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC", 1413 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
1081 "CounterMask": "4", 1414 "PublicDescription": "This event counts cases of saving new LBR records by hardware. This assumes proper enabling of LBRs and takes into account LBR filtering done by the LBR_SELECT register.",
1082 "SampleAfterValue": "2000003", 1415 "SampleAfterValue": "2000003",
1083 "CounterHTOff": "0,1,2,3" 1416 "CounterHTOff": "0,1,2,3,4,5,6,7"
1084 }, 1417 },
1085 { 1418 {
1086 "EventCode": "0xe6", 1419 "EventCode": "0xe6",
@@ -1090,328 +1423,5 @@
1090 "EventName": "BACLEARS.ANY", 1423 "EventName": "BACLEARS.ANY",
1091 "SampleAfterValue": "100003", 1424 "SampleAfterValue": "100003",
1092 "CounterHTOff": "0,1,2,3,4,5,6,7" 1425 "CounterHTOff": "0,1,2,3,4,5,6,7"
1093 },
1094 {
1095 "EventCode": "0xA3",
1096 "UMask": "0x8",
1097 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
1098 "Counter": "2",
1099 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
1100 "CounterMask": "8",
1101 "SampleAfterValue": "2000003",
1102 "CounterHTOff": "2"
1103 },
1104 {
1105 "EventCode": "0xA3",
1106 "UMask": "0x1",
1107 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
1108 "Counter": "0,1,2,3",
1109 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
1110 "CounterMask": "1",
1111 "SampleAfterValue": "2000003",
1112 "CounterHTOff": "0,1,2,3,4,5,6,7"
1113 },
1114 {
1115 "EventCode": "0xA3",
1116 "UMask": "0x2",
1117 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
1118 "Counter": "0,1,2,3",
1119 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
1120 "CounterMask": "2",
1121 "SampleAfterValue": "2000003",
1122 "CounterHTOff": "0,1,2,3"
1123 },
1124 {
1125 "EventCode": "0xA3",
1126 "UMask": "0x4",
1127 "BriefDescription": "Total execution stalls.",
1128 "Counter": "0,1,2,3",
1129 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
1130 "CounterMask": "4",
1131 "SampleAfterValue": "2000003",
1132 "CounterHTOff": "0,1,2,3,4,5,6,7"
1133 },
1134 {
1135 "EventCode": "0xA3",
1136 "UMask": "0xc",
1137 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
1138 "Counter": "2",
1139 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
1140 "CounterMask": "12",
1141 "SampleAfterValue": "2000003",
1142 "CounterHTOff": "2"
1143 },
1144 {
1145 "EventCode": "0xA3",
1146 "UMask": "0x5",
1147 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
1148 "Counter": "0,1,2,3",
1149 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
1150 "CounterMask": "5",
1151 "SampleAfterValue": "2000003",
1152 "CounterHTOff": "0,1,2,3,4,5,6,7"
1153 },
1154 {
1155 "EventCode": "0xA3",
1156 "UMask": "0x6",
1157 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
1158 "Counter": "0,1,2,3",
1159 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
1160 "CounterMask": "6",
1161 "SampleAfterValue": "2000003",
1162 "CounterHTOff": "0,1,2,3,4,5,6,7"
1163 },
1164 {
1165 "EdgeDetect": "1",
1166 "EventCode": "0xC3",
1167 "UMask": "0x1",
1168 "BriefDescription": "Number of machine clears (nukes) of any type.",
1169 "Counter": "0,1,2,3",
1170 "EventName": "MACHINE_CLEARS.COUNT",
1171 "CounterMask": "1",
1172 "SampleAfterValue": "100003",
1173 "CounterHTOff": "0,1,2,3,4,5,6,7"
1174 },
1175 {
1176 "EventCode": "0xA8",
1177 "UMask": "0x1",
1178 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1179 "Counter": "0,1,2,3",
1180 "EventName": "LSD.CYCLES_4_UOPS",
1181 "CounterMask": "4",
1182 "SampleAfterValue": "2000003",
1183 "CounterHTOff": "0,1,2,3,4,5,6,7"
1184 },
1185 {
1186 "EdgeDetect": "1",
1187 "Invert": "1",
1188 "EventCode": "0x5E",
1189 "UMask": "0x1",
1190 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1191 "Counter": "0,1,2,3",
1192 "EventName": "RS_EVENTS.EMPTY_END",
1193 "CounterMask": "1",
1194 "SampleAfterValue": "200003",
1195 "CounterHTOff": "0,1,2,3,4,5,6,7"
1196 },
1197 {
1198 "EventCode": "0xA8",
1199 "UMask": "0x1",
1200 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
1201 "Counter": "0,1,2,3",
1202 "EventName": "LSD.CYCLES_ACTIVE",
1203 "CounterMask": "1",
1204 "SampleAfterValue": "2000003",
1205 "CounterHTOff": "0,1,2,3,4,5,6,7"
1206 },
1207 {
1208 "EventCode": "0xA1",
1209 "UMask": "0x1",
1210 "BriefDescription": "Cycles per thread when uops are executed in port 0",
1211 "Counter": "0,1,2,3",
1212 "EventName": "UOPS_EXECUTED_PORT.PORT_0",
1213 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.",
1214 "SampleAfterValue": "2000003",
1215 "CounterHTOff": "0,1,2,3,4,5,6,7"
1216 },
1217 {
1218 "EventCode": "0xA1",
1219 "UMask": "0x2",
1220 "BriefDescription": "Cycles per thread when uops are executed in port 1",
1221 "Counter": "0,1,2,3",
1222 "EventName": "UOPS_EXECUTED_PORT.PORT_1",
1223 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.",
1224 "SampleAfterValue": "2000003",
1225 "CounterHTOff": "0,1,2,3,4,5,6,7"
1226 },
1227 {
1228 "EventCode": "0xA1",
1229 "UMask": "0x4",
1230 "BriefDescription": "Cycles per thread when uops are executed in port 2",
1231 "Counter": "0,1,2,3",
1232 "EventName": "UOPS_EXECUTED_PORT.PORT_2",
1233 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.",
1234 "SampleAfterValue": "2000003",
1235 "CounterHTOff": "0,1,2,3,4,5,6,7"
1236 },
1237 {
1238 "EventCode": "0xA1",
1239 "UMask": "0x8",
1240 "BriefDescription": "Cycles per thread when uops are executed in port 3",
1241 "Counter": "0,1,2,3",
1242 "EventName": "UOPS_EXECUTED_PORT.PORT_3",
1243 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.",
1244 "SampleAfterValue": "2000003",
1245 "CounterHTOff": "0,1,2,3,4,5,6,7"
1246 },
1247 {
1248 "EventCode": "0xA1",
1249 "UMask": "0x10",
1250 "BriefDescription": "Cycles per thread when uops are executed in port 4",
1251 "Counter": "0,1,2,3",
1252 "EventName": "UOPS_EXECUTED_PORT.PORT_4",
1253 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.",
1254 "SampleAfterValue": "2000003",
1255 "CounterHTOff": "0,1,2,3,4,5,6,7"
1256 },
1257 {
1258 "EventCode": "0xA1",
1259 "UMask": "0x20",
1260 "BriefDescription": "Cycles per thread when uops are executed in port 5",
1261 "Counter": "0,1,2,3",
1262 "EventName": "UOPS_EXECUTED_PORT.PORT_5",
1263 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.",
1264 "SampleAfterValue": "2000003",
1265 "CounterHTOff": "0,1,2,3,4,5,6,7"
1266 },
1267 {
1268 "EventCode": "0xA1",
1269 "UMask": "0x40",
1270 "BriefDescription": "Cycles per thread when uops are executed in port 6",
1271 "Counter": "0,1,2,3",
1272 "EventName": "UOPS_EXECUTED_PORT.PORT_6",
1273 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.",
1274 "SampleAfterValue": "2000003",
1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
1276 },
1277 {
1278 "EventCode": "0xA1",
1279 "UMask": "0x80",
1280 "BriefDescription": "Cycles per thread when uops are executed in port 7",
1281 "Counter": "0,1,2,3",
1282 "EventName": "UOPS_EXECUTED_PORT.PORT_7",
1283 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.",
1284 "SampleAfterValue": "2000003",
1285 "CounterHTOff": "0,1,2,3,4,5,6,7"
1286 },
1287 {
1288 "EventCode": "0xA0",
1289 "UMask": "0x3",
1290 "BriefDescription": "Micro-op dispatches cancelled due to insufficient SIMD physical register file read ports",
1291 "Counter": "0,1,2,3",
1292 "EventName": "UOP_DISPATCHES_CANCELLED.SIMD_PRF",
1293 "PublicDescription": "This event counts the number of micro-operations cancelled after they were dispatched from the scheduler to the execution units when the total number of physical register read ports across all dispatch ports exceeds the read bandwidth of the physical register file. The SIMD_PRF subevent applies to the following instructions: VDPPS, DPPS, VPCMPESTRI, PCMPESTRI, VPCMPESTRM, PCMPESTRM, VFMADD*, VFMADDSUB*, VFMSUB*, VMSUBADD*, VFNMADD*, VFNMSUB*. See the Broadwell Optimization Guide for more information.",
1294 "SampleAfterValue": "2000003",
1295 "CounterHTOff": "0,1,2,3"
1296 },
1297 {
1298 "EventCode": "0x00",
1299 "UMask": "0x2",
1300 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1301 "Counter": "Fixed counter 2",
1302 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1303 "AnyThread": "1",
1304 "SampleAfterValue": "2000003",
1305 "CounterHTOff": "Fixed counter 2"
1306 },
1307 {
1308 "EventCode": "0x3C",
1309 "UMask": "0x0",
1310 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1311 "Counter": "0,1,2,3",
1312 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1313 "AnyThread": "1",
1314 "SampleAfterValue": "2000003",
1315 "CounterHTOff": "0,1,2,3,4,5,6,7"
1316 },
1317 {
1318 "EventCode": "0x3C",
1319 "UMask": "0x1",
1320 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1321 "Counter": "0,1,2,3",
1322 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1323 "AnyThread": "1",
1324 "SampleAfterValue": "2000003",
1325 "CounterHTOff": "0,1,2,3,4,5,6,7"
1326 },
1327 {
1328 "EventCode": "0x0D",
1329 "UMask": "0x3",
1330 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1331 "Counter": "0,1,2,3",
1332 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1333 "AnyThread": "1",
1334 "CounterMask": "1",
1335 "SampleAfterValue": "2000003",
1336 "CounterHTOff": "0,1,2,3,4,5,6,7"
1337 },
1338 {
1339 "EventCode": "0xb1",
1340 "UMask": "0x2",
1341 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1342 "Counter": "0,1,2,3",
1343 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1344 "CounterMask": "1",
1345 "SampleAfterValue": "2000003",
1346 "CounterHTOff": "0,1,2,3,4,5,6,7"
1347 },
1348 {
1349 "EventCode": "0xb1",
1350 "UMask": "0x2",
1351 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1352 "Counter": "0,1,2,3",
1353 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1354 "CounterMask": "2",
1355 "SampleAfterValue": "2000003",
1356 "CounterHTOff": "0,1,2,3,4,5,6,7"
1357 },
1358 {
1359 "EventCode": "0xb1",
1360 "UMask": "0x2",
1361 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1362 "Counter": "0,1,2,3",
1363 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1364 "CounterMask": "3",
1365 "SampleAfterValue": "2000003",
1366 "CounterHTOff": "0,1,2,3,4,5,6,7"
1367 },
1368 {
1369 "EventCode": "0xb1",
1370 "UMask": "0x2",
1371 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1372 "Counter": "0,1,2,3",
1373 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1374 "CounterMask": "4",
1375 "SampleAfterValue": "2000003",
1376 "CounterHTOff": "0,1,2,3,4,5,6,7"
1377 },
1378 {
1379 "Invert": "1",
1380 "EventCode": "0xb1",
1381 "UMask": "0x2",
1382 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1383 "Counter": "0,1,2,3",
1384 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1385 "SampleAfterValue": "2000003",
1386 "CounterHTOff": "0,1,2,3,4,5,6,7"
1387 },
1388 {
1389 "EventCode": "0x3C",
1390 "UMask": "0x1",
1391 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1392 "Counter": "0,1,2,3",
1393 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1394 "PublicDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate).",
1395 "SampleAfterValue": "2000003",
1396 "CounterHTOff": "0,1,2,3,4,5,6,7"
1397 },
1398 {
1399 "EventCode": "0x3C",
1400 "UMask": "0x1",
1401 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1402 "Counter": "0,1,2,3",
1403 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1404 "AnyThread": "1",
1405 "SampleAfterValue": "2000003",
1406 "CounterHTOff": "0,1,2,3,4,5,6,7"
1407 },
1408 {
1409 "EventCode": "0x3C",
1410 "UMask": "0x2",
1411 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1412 "Counter": "0,1,2,3",
1413 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1414 "SampleAfterValue": "2000003",
1415 "CounterHTOff": "0,1,2,3,4,5,6,7"
1416 } 1426 }
1417] \ No newline at end of file 1427] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/virtual-memory.json b/tools/perf/pmu-events/arch/x86/broadwellx/virtual-memory.json
index 5ce8b67ba076..7d79c707c6d1 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/virtual-memory.json
@@ -45,6 +45,16 @@
45 }, 45 },
46 { 46 {
47 "EventCode": "0x08", 47 "EventCode": "0x08",
48 "UMask": "0xe",
49 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
50 "Counter": "0,1,2,3",
51 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
52 "Errata": "BDM69",
53 "SampleAfterValue": "100003",
54 "CounterHTOff": "0,1,2,3,4,5,6,7"
55 },
56 {
57 "EventCode": "0x08",
48 "UMask": "0x10", 58 "UMask": "0x10",
49 "BriefDescription": "Cycles when PMH is busy with page walks", 59 "BriefDescription": "Cycles when PMH is busy with page walks",
50 "Counter": "0,1,2,3", 60 "Counter": "0,1,2,3",
@@ -73,6 +83,15 @@
73 "CounterHTOff": "0,1,2,3,4,5,6,7" 83 "CounterHTOff": "0,1,2,3,4,5,6,7"
74 }, 84 },
75 { 85 {
86 "EventCode": "0x08",
87 "UMask": "0x60",
88 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks.",
89 "Counter": "0,1,2,3",
90 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
91 "SampleAfterValue": "2000003",
92 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 },
94 {
76 "EventCode": "0x49", 95 "EventCode": "0x49",
77 "UMask": "0x1", 96 "UMask": "0x1",
78 "BriefDescription": "Store misses in all DTLB levels that cause page walks", 97 "BriefDescription": "Store misses in all DTLB levels that cause page walks",
@@ -118,6 +137,16 @@
118 }, 137 },
119 { 138 {
120 "EventCode": "0x49", 139 "EventCode": "0x49",
140 "UMask": "0xe",
141 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks.",
142 "Counter": "0,1,2,3",
143 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
144 "Errata": "BDM69",
145 "SampleAfterValue": "100003",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
149 "EventCode": "0x49",
121 "UMask": "0x10", 150 "UMask": "0x10",
122 "BriefDescription": "Cycles when PMH is busy with page walks", 151 "BriefDescription": "Cycles when PMH is busy with page walks",
123 "Counter": "0,1,2,3", 152 "Counter": "0,1,2,3",
@@ -146,6 +175,15 @@
146 "CounterHTOff": "0,1,2,3,4,5,6,7" 175 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 }, 176 },
148 { 177 {
178 "EventCode": "0x49",
179 "UMask": "0x60",
180 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
181 "Counter": "0,1,2,3",
182 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
183 "SampleAfterValue": "100003",
184 "CounterHTOff": "0,1,2,3,4,5,6,7"
185 },
186 {
149 "EventCode": "0x4F", 187 "EventCode": "0x4F",
150 "UMask": "0x10", 188 "UMask": "0x10",
151 "BriefDescription": "Cycle count for an Extended Page table walk.", 189 "BriefDescription": "Cycle count for an Extended Page table walk.",
@@ -201,6 +239,16 @@
201 }, 239 },
202 { 240 {
203 "EventCode": "0x85", 241 "EventCode": "0x85",
242 "UMask": "0xe",
243 "BriefDescription": "Misses in all ITLB levels that cause completed page walks.",
244 "Counter": "0,1,2,3",
245 "EventName": "ITLB_MISSES.WALK_COMPLETED",
246 "Errata": "BDM69",
247 "SampleAfterValue": "100003",
248 "CounterHTOff": "0,1,2,3,4,5,6,7"
249 },
250 {
251 "EventCode": "0x85",
204 "UMask": "0x10", 252 "UMask": "0x10",
205 "BriefDescription": "Cycles when PMH is busy with page walks", 253 "BriefDescription": "Cycles when PMH is busy with page walks",
206 "Counter": "0,1,2,3", 254 "Counter": "0,1,2,3",
@@ -229,6 +277,15 @@
229 "CounterHTOff": "0,1,2,3,4,5,6,7" 277 "CounterHTOff": "0,1,2,3,4,5,6,7"
230 }, 278 },
231 { 279 {
280 "EventCode": "0x85",
281 "UMask": "0x60",
282 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks.",
283 "Counter": "0,1,2,3",
284 "EventName": "ITLB_MISSES.STLB_HIT",
285 "SampleAfterValue": "100003",
286 "CounterHTOff": "0,1,2,3,4,5,6,7"
287 },
288 {
232 "EventCode": "0xAE", 289 "EventCode": "0xAE",
233 "UMask": "0x1", 290 "UMask": "0x1",
234 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.", 291 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.",
@@ -250,60 +307,60 @@
250 }, 307 },
251 { 308 {
252 "EventCode": "0xBC", 309 "EventCode": "0xBC",
253 "UMask": "0x21", 310 "UMask": "0x12",
254 "BriefDescription": "Number of ITLB page walker hits in the L1+FB.", 311 "BriefDescription": "Number of DTLB page walker hits in the L2.",
255 "Counter": "0,1,2,3", 312 "Counter": "0,1,2,3",
256 "EventName": "PAGE_WALKER_LOADS.ITLB_L1", 313 "EventName": "PAGE_WALKER_LOADS.DTLB_L2",
257 "Errata": "BDM69, BDM98", 314 "Errata": "BDM69, BDM98",
258 "SampleAfterValue": "2000003", 315 "SampleAfterValue": "2000003",
259 "CounterHTOff": "0,1,2,3" 316 "CounterHTOff": "0,1,2,3"
260 }, 317 },
261 { 318 {
262 "EventCode": "0xBC", 319 "EventCode": "0xBC",
263 "UMask": "0x12", 320 "UMask": "0x14",
264 "BriefDescription": "Number of DTLB page walker hits in the L2.", 321 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP.",
265 "Counter": "0,1,2,3", 322 "Counter": "0,1,2,3",
266 "EventName": "PAGE_WALKER_LOADS.DTLB_L2", 323 "EventName": "PAGE_WALKER_LOADS.DTLB_L3",
267 "Errata": "BDM69, BDM98", 324 "Errata": "BDM69, BDM98",
268 "SampleAfterValue": "2000003", 325 "SampleAfterValue": "2000003",
269 "CounterHTOff": "0,1,2,3" 326 "CounterHTOff": "0,1,2,3"
270 }, 327 },
271 { 328 {
272 "EventCode": "0xBC", 329 "EventCode": "0xBC",
273 "UMask": "0x22", 330 "UMask": "0x18",
274 "BriefDescription": "Number of ITLB page walker hits in the L2.", 331 "BriefDescription": "Number of DTLB page walker hits in Memory.",
275 "Counter": "0,1,2,3", 332 "Counter": "0,1,2,3",
276 "EventName": "PAGE_WALKER_LOADS.ITLB_L2", 333 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY",
277 "Errata": "BDM69, BDM98", 334 "Errata": "BDM69, BDM98",
278 "SampleAfterValue": "2000003", 335 "SampleAfterValue": "2000003",
279 "CounterHTOff": "0,1,2,3" 336 "CounterHTOff": "0,1,2,3"
280 }, 337 },
281 { 338 {
282 "EventCode": "0xBC", 339 "EventCode": "0xBC",
283 "UMask": "0x14", 340 "UMask": "0x21",
284 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP.", 341 "BriefDescription": "Number of ITLB page walker hits in the L1+FB.",
285 "Counter": "0,1,2,3", 342 "Counter": "0,1,2,3",
286 "EventName": "PAGE_WALKER_LOADS.DTLB_L3", 343 "EventName": "PAGE_WALKER_LOADS.ITLB_L1",
287 "Errata": "BDM69, BDM98", 344 "Errata": "BDM69, BDM98",
288 "SampleAfterValue": "2000003", 345 "SampleAfterValue": "2000003",
289 "CounterHTOff": "0,1,2,3" 346 "CounterHTOff": "0,1,2,3"
290 }, 347 },
291 { 348 {
292 "EventCode": "0xBC", 349 "EventCode": "0xBC",
293 "UMask": "0x24", 350 "UMask": "0x22",
294 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP.", 351 "BriefDescription": "Number of ITLB page walker hits in the L2.",
295 "Counter": "0,1,2,3", 352 "Counter": "0,1,2,3",
296 "EventName": "PAGE_WALKER_LOADS.ITLB_L3", 353 "EventName": "PAGE_WALKER_LOADS.ITLB_L2",
297 "Errata": "BDM69, BDM98", 354 "Errata": "BDM69, BDM98",
298 "SampleAfterValue": "2000003", 355 "SampleAfterValue": "2000003",
299 "CounterHTOff": "0,1,2,3" 356 "CounterHTOff": "0,1,2,3"
300 }, 357 },
301 { 358 {
302 "EventCode": "0xBC", 359 "EventCode": "0xBC",
303 "UMask": "0x18", 360 "UMask": "0x24",
304 "BriefDescription": "Number of DTLB page walker hits in Memory.", 361 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP.",
305 "Counter": "0,1,2,3", 362 "Counter": "0,1,2,3",
306 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY", 363 "EventName": "PAGE_WALKER_LOADS.ITLB_L3",
307 "Errata": "BDM69, BDM98", 364 "Errata": "BDM69, BDM98",
308 "SampleAfterValue": "2000003", 365 "SampleAfterValue": "2000003",
309 "CounterHTOff": "0,1,2,3" 366 "CounterHTOff": "0,1,2,3"
@@ -327,62 +384,5 @@
327 "PublicDescription": "This event counts the number of any STLB flush attempts (such as entire, VPID, PCID, InvPage, CR3 write, and so on).", 384 "PublicDescription": "This event counts the number of any STLB flush attempts (such as entire, VPID, PCID, InvPage, CR3 write, and so on).",
328 "SampleAfterValue": "100007", 385 "SampleAfterValue": "100007",
329 "CounterHTOff": "0,1,2,3,4,5,6,7" 386 "CounterHTOff": "0,1,2,3,4,5,6,7"
330 },
331 {
332 "EventCode": "0x08",
333 "UMask": "0xe",
334 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
335 "Counter": "0,1,2,3",
336 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
337 "Errata": "BDM69",
338 "SampleAfterValue": "100003",
339 "CounterHTOff": "0,1,2,3,4,5,6,7"
340 },
341 {
342 "EventCode": "0x08",
343 "UMask": "0x60",
344 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks.",
345 "Counter": "0,1,2,3",
346 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
347 "SampleAfterValue": "2000003",
348 "CounterHTOff": "0,1,2,3,4,5,6,7"
349 },
350 {
351 "EventCode": "0x49",
352 "UMask": "0xe",
353 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks.",
354 "Counter": "0,1,2,3",
355 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
356 "Errata": "BDM69",
357 "SampleAfterValue": "100003",
358 "CounterHTOff": "0,1,2,3,4,5,6,7"
359 },
360 {
361 "EventCode": "0x49",
362 "UMask": "0x60",
363 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
364 "Counter": "0,1,2,3",
365 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
366 "SampleAfterValue": "100003",
367 "CounterHTOff": "0,1,2,3,4,5,6,7"
368 },
369 {
370 "EventCode": "0x85",
371 "UMask": "0xe",
372 "BriefDescription": "Misses in all ITLB levels that cause completed page walks.",
373 "Counter": "0,1,2,3",
374 "EventName": "ITLB_MISSES.WALK_COMPLETED",
375 "Errata": "BDM69",
376 "SampleAfterValue": "100003",
377 "CounterHTOff": "0,1,2,3,4,5,6,7"
378 },
379 {
380 "EventCode": "0x85",
381 "UMask": "0x60",
382 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks.",
383 "Counter": "0,1,2,3",
384 "EventName": "ITLB_MISSES.STLB_HIT",
385 "SampleAfterValue": "100003",
386 "CounterHTOff": "0,1,2,3,4,5,6,7"
387 } 387 }
388] \ No newline at end of file 388] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/goldmont/cache.json b/tools/perf/pmu-events/arch/x86/goldmont/cache.json
index 4e02e1e5e70d..f8bbe087b0f8 100644
--- a/tools/perf/pmu-events/arch/x86/goldmont/cache.json
+++ b/tools/perf/pmu-events/arch/x86/goldmont/cache.json
@@ -1,6 +1,26 @@
1[ 1[
2 { 2 {
3 "CollectPEBSRecord": "1", 3 "CollectPEBSRecord": "1",
4 "PublicDescription": "Counts memory requests originating from the core that miss in the L2 cache.",
5 "EventCode": "0x2E",
6 "Counter": "0,1,2,3",
7 "UMask": "0x41",
8 "EventName": "LONGEST_LAT_CACHE.MISS",
9 "SampleAfterValue": "200003",
10 "BriefDescription": "L2 cache request misses"
11 },
12 {
13 "CollectPEBSRecord": "1",
14 "PublicDescription": "Counts memory requests originating from the core that reference a cache line in the L2 cache.",
15 "EventCode": "0x2E",
16 "Counter": "0,1,2,3",
17 "UMask": "0x4f",
18 "EventName": "LONGEST_LAT_CACHE.REFERENCE",
19 "SampleAfterValue": "200003",
20 "BriefDescription": "L2 cache requests"
21 },
22 {
23 "CollectPEBSRecord": "1",
4 "PublicDescription": "Counts the number of demand and prefetch transactions that the L2 XQ rejects due to a full or near full condition which likely indicates back pressure from the intra-die interconnect (IDI) fabric. The XQ may reject transactions from the L2Q (non-cacheable requests), L2 misses and L2 write-back victims.", 24 "PublicDescription": "Counts the number of demand and prefetch transactions that the L2 XQ rejects due to a full or near full condition which likely indicates back pressure from the intra-die interconnect (IDI) fabric. The XQ may reject transactions from the L2Q (non-cacheable requests), L2 misses and L2 write-back victims.",
5 "EventCode": "0x30", 25 "EventCode": "0x30",
6 "Counter": "0,1,2,3", 26 "Counter": "0,1,2,3",
@@ -11,120 +31,119 @@
11 }, 31 },
12 { 32 {
13 "CollectPEBSRecord": "1", 33 "CollectPEBSRecord": "1",
14 "PublicDescription": "Counts the number of demand and L1 prefetcher requests rejected by the L2Q due to a full or nearly full condition which likely indicates back pressure from L2Q. It also counts requests that would have gone directly to the XQ, but are rejected due to a full or nearly full condition, indicating back pressure from the IDI link. The L2Q may also reject transactions from a core to insure fairness between cores, or to delay a core's dirty eviction when the address conflicts with incoming external snoops.", 34 "PublicDescription": "Counts the number of demand and L1 prefetcher requests rejected by the L2Q due to a full or nearly full condition which likely indicates back pressure from L2Q. It also counts requests that would have gone directly to the XQ, but are rejected due to a full or nearly full condition, indicating back pressure from the IDI link. The L2Q may also reject transactions from a core to ensure fairness between cores, or to delay a core's dirty eviction when the address conflicts with incoming external snoops.",
15 "EventCode": "0x31", 35 "EventCode": "0x31",
16 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
17 "UMask": "0x0", 37 "UMask": "0x0",
18 "EventName": "CORE_REJECT_L2Q.ALL", 38 "EventName": "CORE_REJECT_L2Q.ALL",
19 "SampleAfterValue": "200003", 39 "SampleAfterValue": "200003",
20 "BriefDescription": "Requests rejected by the L2Q " 40 "BriefDescription": "Requests rejected by the L2Q"
21 }, 41 },
22 { 42 {
23 "CollectPEBSRecord": "1", 43 "CollectPEBSRecord": "1",
24 "PublicDescription": "Counts memory requests originating from the core that reference a cache line in the L2 cache.", 44 "PublicDescription": "Counts when a modified (dirty) cache line is evicted from the data L1 cache and needs to be written back to memory. No count will occur if the evicted line is clean, and hence does not require a writeback.",
25 "EventCode": "0x2E", 45 "EventCode": "0x51",
26 "Counter": "0,1,2,3", 46 "Counter": "0,1,2,3",
27 "UMask": "0x4f", 47 "UMask": "0x1",
28 "EventName": "LONGEST_LAT_CACHE.REFERENCE", 48 "EventName": "DL1.DIRTY_EVICTION",
29 "SampleAfterValue": "200003", 49 "SampleAfterValue": "200003",
30 "BriefDescription": "L2 cache requests" 50 "BriefDescription": "L1 Cache evictions for dirty data"
31 }, 51 },
32 { 52 {
33 "CollectPEBSRecord": "1", 53 "CollectPEBSRecord": "1",
34 "PublicDescription": "Counts memory requests originating from the core that miss in the L2 cache.", 54 "PublicDescription": "Counts cycles that fetch is stalled due to an outstanding ICache miss. That is, the decoder queue is able to accept bytes, but the fetch unit is unable to provide bytes due to an ICache miss. Note: this event is not the same as the total number of cycles spent retrieving instruction cache lines from the memory hierarchy.",
35 "EventCode": "0x2E", 55 "EventCode": "0x86",
36 "Counter": "0,1,2,3", 56 "Counter": "0,1,2,3",
37 "UMask": "0x41", 57 "UMask": "0x2",
38 "EventName": "LONGEST_LAT_CACHE.MISS", 58 "EventName": "FETCH_STALL.ICACHE_FILL_PENDING_CYCLES",
39 "SampleAfterValue": "200003", 59 "SampleAfterValue": "200003",
40 "BriefDescription": "L2 cache request misses" 60 "BriefDescription": "Cycles code-fetch stalled due to an outstanding ICache miss."
41 }, 61 },
42 { 62 {
43 "CollectPEBSRecord": "1", 63 "CollectPEBSRecord": "1",
44 "PublicDescription": "Counts cycles that an ICache miss is outstanding, and instruction fetch is stalled. That is, the decoder queue is able to accept bytes, but the fetch unit is unable to provide bytes, while an Icache miss outstanding. Note this event is not the same as cycles to retrieve an instruction due to an Icache miss. Rather, it is the part of the Instruction Cache (ICache) miss time where no bytes are available for the decoder.", 64 "EventCode": "0xB7",
45 "EventCode": "0x86",
46 "Counter": "0,1,2,3", 65 "Counter": "0,1,2,3",
47 "UMask": "0x2", 66 "UMask": "0x1",
48 "EventName": "FETCH_STALL.ICACHE_FILL_PENDING_CYCLES", 67 "EventName": "OFFCORE_RESPONSE",
49 "SampleAfterValue": "200003", 68 "SampleAfterValue": "100007",
50 "BriefDescription": "Cycles where code-fetch is stalled and an ICache miss is outstanding. This is not the same as an ICache Miss." 69 "BriefDescription": "Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)"
51 }, 70 },
52 { 71 {
53 "PEBS": "2", 72 "PEBS": "2",
54 "CollectPEBSRecord": "2", 73 "CollectPEBSRecord": "2",
55 "PublicDescription": "Counts the number of load uops retired.", 74 "PublicDescription": "Counts locked memory uops retired. This includes regular locks and bus locks. (To specifically count bus locks only, see the Offcore response event.) A locked access is one with a lock prefix, or an exchange to memory. See the SDM for a complete description of which memory load accesses are locks.",
56 "EventCode": "0xD0", 75 "EventCode": "0xD0",
57 "Counter": "0,1,2,3", 76 "Counter": "0,1,2,3",
58 "UMask": "0x81", 77 "UMask": "0x21",
59 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 78 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
60 "SampleAfterValue": "200003", 79 "SampleAfterValue": "200003",
61 "BriefDescription": "Load uops retired (Precise event capable)" 80 "BriefDescription": "Locked load uops retired (Precise event capable)"
62 }, 81 },
63 { 82 {
64 "PEBS": "2", 83 "PEBS": "2",
65 "CollectPEBSRecord": "2", 84 "CollectPEBSRecord": "2",
66 "PublicDescription": "Counts the number of store uops retired.", 85 "PublicDescription": "Counts load uops retired where the data requested spans a 64 byte cache line boundary.",
67 "EventCode": "0xD0", 86 "EventCode": "0xD0",
68 "Counter": "0,1,2,3", 87 "Counter": "0,1,2,3",
69 "UMask": "0x82", 88 "UMask": "0x41",
70 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 89 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
71 "SampleAfterValue": "200003", 90 "SampleAfterValue": "200003",
72 "BriefDescription": "Store uops retired (Precise event capable)" 91 "BriefDescription": "Load uops retired that split a cache-line (Precise event capable)"
73 }, 92 },
74 { 93 {
75 "PEBS": "2", 94 "PEBS": "2",
76 "CollectPEBSRecord": "2", 95 "CollectPEBSRecord": "2",
77 "PublicDescription": "Counts the number of memory uops retired that is either a loads or a store or both.", 96 "PublicDescription": "Counts store uops retired where the data requested spans a 64 byte cache line boundary.",
78 "EventCode": "0xD0", 97 "EventCode": "0xD0",
79 "Counter": "0,1,2,3", 98 "Counter": "0,1,2,3",
80 "UMask": "0x83", 99 "UMask": "0x42",
81 "EventName": "MEM_UOPS_RETIRED.ALL", 100 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
82 "SampleAfterValue": "200003", 101 "SampleAfterValue": "200003",
83 "BriefDescription": "Memory uops retired (Precise event capable)" 102 "BriefDescription": "Stores uops retired that split a cache-line (Precise event capable)"
84 }, 103 },
85 { 104 {
86 "PEBS": "2", 105 "PEBS": "2",
87 "CollectPEBSRecord": "2", 106 "CollectPEBSRecord": "2",
88 "PublicDescription": "Counts locked memory uops retired. This includes \"regular\" locks and bus locks. (To specifically count bus locks only, see the Offcore response event.) A locked access is one with a lock prefix, or an exchange to memory. See the SDM for a complete description of which memory load accesses are locks.", 107 "PublicDescription": "Counts memory uops retired where the data requested spans a 64 byte cache line boundary.",
89 "EventCode": "0xD0", 108 "EventCode": "0xD0",
90 "Counter": "0,1,2,3", 109 "Counter": "0,1,2,3",
91 "UMask": "0x21", 110 "UMask": "0x43",
92 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 111 "EventName": "MEM_UOPS_RETIRED.SPLIT",
93 "SampleAfterValue": "200003", 112 "SampleAfterValue": "200003",
94 "BriefDescription": "Locked load uops retired (Precise event capable)" 113 "BriefDescription": "Memory uops retired that split a cache-line (Precise event capable)"
95 }, 114 },
96 { 115 {
97 "PEBS": "2", 116 "PEBS": "2",
98 "CollectPEBSRecord": "2", 117 "CollectPEBSRecord": "2",
99 "PublicDescription": "Counts load uops retired where the data requested spans a 64 byte cache line boundary.", 118 "PublicDescription": "Counts the number of load uops retired.",
100 "EventCode": "0xD0", 119 "EventCode": "0xD0",
101 "Counter": "0,1,2,3", 120 "Counter": "0,1,2,3",
102 "UMask": "0x41", 121 "UMask": "0x81",
103 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 122 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
104 "SampleAfterValue": "200003", 123 "SampleAfterValue": "200003",
105 "BriefDescription": "Load uops retired that split a cache-line (Precise event capable)" 124 "BriefDescription": "Load uops retired (Precise event capable)"
106 }, 125 },
107 { 126 {
108 "PEBS": "2", 127 "PEBS": "2",
109 "CollectPEBSRecord": "2", 128 "CollectPEBSRecord": "2",
110 "PublicDescription": "Counts store uops retired where the data requested spans a 64 byte cache line boundary.", 129 "PublicDescription": "Counts the number of store uops retired.",
111 "EventCode": "0xD0", 130 "EventCode": "0xD0",
112 "Counter": "0,1,2,3", 131 "Counter": "0,1,2,3",
113 "UMask": "0x42", 132 "UMask": "0x82",
114 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 133 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
115 "SampleAfterValue": "200003", 134 "SampleAfterValue": "200003",
116 "BriefDescription": "Stores uops retired that split a cache-line (Precise event capable)" 135 "BriefDescription": "Store uops retired (Precise event capable)"
117 }, 136 },
118 { 137 {
119 "PEBS": "2", 138 "PEBS": "2",
120 "CollectPEBSRecord": "2", 139 "CollectPEBSRecord": "2",
121 "PublicDescription": "Counts memory uops retired where the data requested spans a 64 byte cache line boundary.", 140 "PublicDescription": "Counts the number of memory uops retired that is either a loads or a store or both.",
122 "EventCode": "0xD0", 141 "EventCode": "0xD0",
123 "Counter": "0,1,2,3", 142 "Counter": "0,1,2,3",
124 "UMask": "0x43", 143 "UMask": "0x83",
125 "EventName": "MEM_UOPS_RETIRED.SPLIT", 144 "EventName": "MEM_UOPS_RETIRED.ALL",
126 "SampleAfterValue": "200003", 145 "SampleAfterValue": "200003",
127 "BriefDescription": "Memory uops retired that split a cache-line (Precise event capable)" 146 "BriefDescription": "Memory uops retired (Precise event capable)"
128 }, 147 },
129 { 148 {
130 "PEBS": "2", 149 "PEBS": "2",
@@ -140,24 +159,24 @@
140 { 159 {
141 "PEBS": "2", 160 "PEBS": "2",
142 "CollectPEBSRecord": "2", 161 "CollectPEBSRecord": "2",
143 "PublicDescription": "Counts load uops retired that miss the L1 data cache.", 162 "PublicDescription": "Counts load uops retired that hit in the L2 cache.",
144 "EventCode": "0xD1", 163 "EventCode": "0xD1",
145 "Counter": "0,1,2,3", 164 "Counter": "0,1,2,3",
146 "UMask": "0x8", 165 "UMask": "0x2",
147 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 166 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT",
148 "SampleAfterValue": "200003", 167 "SampleAfterValue": "200003",
149 "BriefDescription": "Load uops retired that missed L1 data cache (Precise event capable)" 168 "BriefDescription": "Load uops retired that hit L2 (Precise event capable)"
150 }, 169 },
151 { 170 {
152 "PEBS": "2", 171 "PEBS": "2",
153 "CollectPEBSRecord": "2", 172 "CollectPEBSRecord": "2",
154 "PublicDescription": "Counts load uops retired that hit in the L2 cache.", 173 "PublicDescription": "Counts load uops retired that miss the L1 data cache.",
155 "EventCode": "0xD1", 174 "EventCode": "0xD1",
156 "Counter": "0,1,2,3", 175 "Counter": "0,1,2,3",
157 "UMask": "0x2", 176 "UMask": "0x8",
158 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 177 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
159 "SampleAfterValue": "200003", 178 "SampleAfterValue": "200003",
160 "BriefDescription": "Load uops retired that hit L2 (Precise event capable)" 179 "BriefDescription": "Load uops retired that missed L1 data cache (Precise event capable)"
161 }, 180 },
162 { 181 {
163 "PEBS": "2", 182 "PEBS": "2",
@@ -205,24 +224,20 @@
205 }, 224 },
206 { 225 {
207 "CollectPEBSRecord": "1", 226 "CollectPEBSRecord": "1",
208 "PublicDescription": "Counts when a modified (dirty) cache line is evicted from the data L1 cache and needs to be written back to memory. No count will occur if the evicted line is clean, and hence does not require a writeback.", 227 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
209 "EventCode": "0x51",
210 "Counter": "0,1,2,3",
211 "UMask": "0x1",
212 "EventName": "DL1.DIRTY_EVICTION",
213 "SampleAfterValue": "200003",
214 "BriefDescription": "L1 Cache evictions for dirty data"
215 },
216 {
217 "CollectPEBSRecord": "1",
218 "EventCode": "0xB7", 228 "EventCode": "0xB7",
229 "MSRValue": "0x40000032b7 ",
219 "Counter": "0,1,2,3", 230 "Counter": "0,1,2,3",
220 "UMask": "0x1", 231 "UMask": "0x1",
221 "EventName": "OFFCORE_RESPONSE", 232 "EventName": "OFFCORE_RESPONSE.ANY_READ.OUTSTANDING",
233 "MSRIndex": "0x1a6",
222 "SampleAfterValue": "100007", 234 "SampleAfterValue": "100007",
223 "BriefDescription": "Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)" 235 "BriefDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
236 "Offcore": "1"
224 }, 237 },
225 { 238 {
239 "CollectPEBSRecord": "1",
240 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
226 "EventCode": "0xB7", 241 "EventCode": "0xB7",
227 "MSRValue": "0x36000032b7 ", 242 "MSRValue": "0x36000032b7 ",
228 "Counter": "0,1,2,3", 243 "Counter": "0,1,2,3",
@@ -234,6 +249,8 @@
234 "Offcore": "1" 249 "Offcore": "1"
235 }, 250 },
236 { 251 {
252 "CollectPEBSRecord": "1",
253 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
237 "EventCode": "0xB7", 254 "EventCode": "0xB7",
238 "MSRValue": "0x10000032b7 ", 255 "MSRValue": "0x10000032b7 ",
239 "Counter": "0,1,2,3", 256 "Counter": "0,1,2,3",
@@ -245,6 +262,8 @@
245 "Offcore": "1" 262 "Offcore": "1"
246 }, 263 },
247 { 264 {
265 "CollectPEBSRecord": "1",
266 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
248 "EventCode": "0xB7", 267 "EventCode": "0xB7",
249 "MSRValue": "0x04000032b7 ", 268 "MSRValue": "0x04000032b7 ",
250 "Counter": "0,1,2,3", 269 "Counter": "0,1,2,3",
@@ -256,6 +275,8 @@
256 "Offcore": "1" 275 "Offcore": "1"
257 }, 276 },
258 { 277 {
278 "CollectPEBSRecord": "1",
279 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
259 "EventCode": "0xB7", 280 "EventCode": "0xB7",
260 "MSRValue": "0x02000032b7 ", 281 "MSRValue": "0x02000032b7 ",
261 "Counter": "0,1,2,3", 282 "Counter": "0,1,2,3",
@@ -267,6 +288,8 @@
267 "Offcore": "1" 288 "Offcore": "1"
268 }, 289 },
269 { 290 {
291 "CollectPEBSRecord": "1",
292 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
270 "EventCode": "0xB7", 293 "EventCode": "0xB7",
271 "MSRValue": "0x00000432b7 ", 294 "MSRValue": "0x00000432b7 ",
272 "Counter": "0,1,2,3", 295 "Counter": "0,1,2,3",
@@ -278,6 +301,34 @@
278 "Offcore": "1" 301 "Offcore": "1"
279 }, 302 },
280 { 303 {
304 "CollectPEBSRecord": "1",
305 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
306 "EventCode": "0xB7",
307 "MSRValue": "0x00000132b7 ",
308 "Counter": "0,1,2,3",
309 "UMask": "0x1",
310 "EventName": "OFFCORE_RESPONSE.ANY_READ.ANY_RESPONSE",
311 "MSRIndex": "0x1a6,0x1a7",
312 "SampleAfterValue": "100007",
313 "BriefDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that have any transaction responses from the uncore subsystem.",
314 "Offcore": "1"
315 },
316 {
317 "CollectPEBSRecord": "1",
318 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
319 "EventCode": "0xB7",
320 "MSRValue": "0x4000000022 ",
321 "Counter": "0,1,2,3",
322 "UMask": "0x1",
323 "EventName": "OFFCORE_RESPONSE.ANY_RFO.OUTSTANDING",
324 "MSRIndex": "0x1a6",
325 "SampleAfterValue": "100007",
326 "BriefDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
327 "Offcore": "1"
328 },
329 {
330 "CollectPEBSRecord": "1",
331 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
281 "EventCode": "0xB7", 332 "EventCode": "0xB7",
282 "MSRValue": "0x3600000022 ", 333 "MSRValue": "0x3600000022 ",
283 "Counter": "0,1,2,3", 334 "Counter": "0,1,2,3",
@@ -289,6 +340,8 @@
289 "Offcore": "1" 340 "Offcore": "1"
290 }, 341 },
291 { 342 {
343 "CollectPEBSRecord": "1",
344 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
292 "EventCode": "0xB7", 345 "EventCode": "0xB7",
293 "MSRValue": "0x1000000022 ", 346 "MSRValue": "0x1000000022 ",
294 "Counter": "0,1,2,3", 347 "Counter": "0,1,2,3",
@@ -300,6 +353,8 @@
300 "Offcore": "1" 353 "Offcore": "1"
301 }, 354 },
302 { 355 {
356 "CollectPEBSRecord": "1",
357 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
303 "EventCode": "0xB7", 358 "EventCode": "0xB7",
304 "MSRValue": "0x0400000022 ", 359 "MSRValue": "0x0400000022 ",
305 "Counter": "0,1,2,3", 360 "Counter": "0,1,2,3",
@@ -311,6 +366,8 @@
311 "Offcore": "1" 366 "Offcore": "1"
312 }, 367 },
313 { 368 {
369 "CollectPEBSRecord": "1",
370 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
314 "EventCode": "0xB7", 371 "EventCode": "0xB7",
315 "MSRValue": "0x0200000022 ", 372 "MSRValue": "0x0200000022 ",
316 "Counter": "0,1,2,3", 373 "Counter": "0,1,2,3",
@@ -322,6 +379,8 @@
322 "Offcore": "1" 379 "Offcore": "1"
323 }, 380 },
324 { 381 {
382 "CollectPEBSRecord": "1",
383 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
325 "EventCode": "0xB7", 384 "EventCode": "0xB7",
326 "MSRValue": "0x0000040022 ", 385 "MSRValue": "0x0000040022 ",
327 "Counter": "0,1,2,3", 386 "Counter": "0,1,2,3",
@@ -333,6 +392,34 @@
333 "Offcore": "1" 392 "Offcore": "1"
334 }, 393 },
335 { 394 {
395 "CollectPEBSRecord": "1",
396 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
397 "EventCode": "0xB7",
398 "MSRValue": "0x0000010022 ",
399 "Counter": "0,1,2,3",
400 "UMask": "0x1",
401 "EventName": "OFFCORE_RESPONSE.ANY_RFO.ANY_RESPONSE",
402 "MSRIndex": "0x1a6,0x1a7",
403 "SampleAfterValue": "100007",
404 "BriefDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that have any transaction responses from the uncore subsystem.",
405 "Offcore": "1"
406 },
407 {
408 "CollectPEBSRecord": "1",
409 "PublicDescription": "Counts data reads (demand & prefetch) that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
410 "EventCode": "0xB7",
411 "MSRValue": "0x4000003091",
412 "Counter": "0,1,2,3",
413 "UMask": "0x1",
414 "EventName": "OFFCORE_RESPONSE.ANY_DATA_RD.OUTSTANDING",
415 "MSRIndex": "0x1a6",
416 "SampleAfterValue": "100007",
417 "BriefDescription": "Counts data reads (demand & prefetch) that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
418 "Offcore": "1"
419 },
420 {
421 "CollectPEBSRecord": "1",
422 "PublicDescription": "Counts data reads (demand & prefetch) that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
336 "EventCode": "0xB7", 423 "EventCode": "0xB7",
337 "MSRValue": "0x3600003091", 424 "MSRValue": "0x3600003091",
338 "Counter": "0,1,2,3", 425 "Counter": "0,1,2,3",
@@ -344,6 +431,8 @@
344 "Offcore": "1" 431 "Offcore": "1"
345 }, 432 },
346 { 433 {
434 "CollectPEBSRecord": "1",
435 "PublicDescription": "Counts data reads (demand & prefetch) that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
347 "EventCode": "0xB7", 436 "EventCode": "0xB7",
348 "MSRValue": "0x1000003091", 437 "MSRValue": "0x1000003091",
349 "Counter": "0,1,2,3", 438 "Counter": "0,1,2,3",
@@ -355,6 +444,8 @@
355 "Offcore": "1" 444 "Offcore": "1"
356 }, 445 },
357 { 446 {
447 "CollectPEBSRecord": "1",
448 "PublicDescription": "Counts data reads (demand & prefetch) that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
358 "EventCode": "0xB7", 449 "EventCode": "0xB7",
359 "MSRValue": "0x0400003091", 450 "MSRValue": "0x0400003091",
360 "Counter": "0,1,2,3", 451 "Counter": "0,1,2,3",
@@ -366,6 +457,8 @@
366 "Offcore": "1" 457 "Offcore": "1"
367 }, 458 },
368 { 459 {
460 "CollectPEBSRecord": "1",
461 "PublicDescription": "Counts data reads (demand & prefetch) that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
369 "EventCode": "0xB7", 462 "EventCode": "0xB7",
370 "MSRValue": "0x0200003091", 463 "MSRValue": "0x0200003091",
371 "Counter": "0,1,2,3", 464 "Counter": "0,1,2,3",
@@ -377,6 +470,8 @@
377 "Offcore": "1" 470 "Offcore": "1"
378 }, 471 },
379 { 472 {
473 "CollectPEBSRecord": "1",
474 "PublicDescription": "Counts data reads (demand & prefetch) that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
380 "EventCode": "0xB7", 475 "EventCode": "0xB7",
381 "MSRValue": "0x0000043091", 476 "MSRValue": "0x0000043091",
382 "Counter": "0,1,2,3", 477 "Counter": "0,1,2,3",
@@ -388,6 +483,34 @@
388 "Offcore": "1" 483 "Offcore": "1"
389 }, 484 },
390 { 485 {
486 "CollectPEBSRecord": "1",
487 "PublicDescription": "Counts data reads (demand & prefetch) that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
488 "EventCode": "0xB7",
489 "MSRValue": "0x0000013091",
490 "Counter": "0,1,2,3",
491 "UMask": "0x1",
492 "EventName": "OFFCORE_RESPONSE.ANY_DATA_RD.ANY_RESPONSE",
493 "MSRIndex": "0x1a6,0x1a7",
494 "SampleAfterValue": "100007",
495 "BriefDescription": "Counts data reads (demand & prefetch) that have any transaction responses from the uncore subsystem.",
496 "Offcore": "1"
497 },
498 {
499 "CollectPEBSRecord": "1",
500 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
501 "EventCode": "0xB7",
502 "MSRValue": "0x4000003010 ",
503 "Counter": "0,1,2,3",
504 "UMask": "0x1",
505 "EventName": "OFFCORE_RESPONSE.ANY_PF_DATA_RD.OUTSTANDING",
506 "MSRIndex": "0x1a6",
507 "SampleAfterValue": "100007",
508 "BriefDescription": "Counts data reads generated by L1 or L2 prefetchers that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
509 "Offcore": "1"
510 },
511 {
512 "CollectPEBSRecord": "1",
513 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
391 "EventCode": "0xB7", 514 "EventCode": "0xB7",
392 "MSRValue": "0x3600003010 ", 515 "MSRValue": "0x3600003010 ",
393 "Counter": "0,1,2,3", 516 "Counter": "0,1,2,3",
@@ -399,6 +522,8 @@
399 "Offcore": "1" 522 "Offcore": "1"
400 }, 523 },
401 { 524 {
525 "CollectPEBSRecord": "1",
526 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
402 "EventCode": "0xB7", 527 "EventCode": "0xB7",
403 "MSRValue": "0x1000003010 ", 528 "MSRValue": "0x1000003010 ",
404 "Counter": "0,1,2,3", 529 "Counter": "0,1,2,3",
@@ -410,6 +535,8 @@
410 "Offcore": "1" 535 "Offcore": "1"
411 }, 536 },
412 { 537 {
538 "CollectPEBSRecord": "1",
539 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
413 "EventCode": "0xB7", 540 "EventCode": "0xB7",
414 "MSRValue": "0x0400003010 ", 541 "MSRValue": "0x0400003010 ",
415 "Counter": "0,1,2,3", 542 "Counter": "0,1,2,3",
@@ -421,6 +548,8 @@
421 "Offcore": "1" 548 "Offcore": "1"
422 }, 549 },
423 { 550 {
551 "CollectPEBSRecord": "1",
552 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
424 "EventCode": "0xB7", 553 "EventCode": "0xB7",
425 "MSRValue": "0x0200003010 ", 554 "MSRValue": "0x0200003010 ",
426 "Counter": "0,1,2,3", 555 "Counter": "0,1,2,3",
@@ -432,6 +561,8 @@
432 "Offcore": "1" 561 "Offcore": "1"
433 }, 562 },
434 { 563 {
564 "CollectPEBSRecord": "1",
565 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
435 "EventCode": "0xB7", 566 "EventCode": "0xB7",
436 "MSRValue": "0x0000043010 ", 567 "MSRValue": "0x0000043010 ",
437 "Counter": "0,1,2,3", 568 "Counter": "0,1,2,3",
@@ -443,6 +574,47 @@
443 "Offcore": "1" 574 "Offcore": "1"
444 }, 575 },
445 { 576 {
577 "CollectPEBSRecord": "1",
578 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
579 "EventCode": "0xB7",
580 "MSRValue": "0x0000013010 ",
581 "Counter": "0,1,2,3",
582 "UMask": "0x1",
583 "EventName": "OFFCORE_RESPONSE.ANY_PF_DATA_RD.ANY_RESPONSE",
584 "MSRIndex": "0x1a6,0x1a7",
585 "SampleAfterValue": "100007",
586 "BriefDescription": "Counts data reads generated by L1 or L2 prefetchers that have any transaction responses from the uncore subsystem.",
587 "Offcore": "1"
588 },
589 {
590 "CollectPEBSRecord": "1",
591 "PublicDescription": "Counts requests to the uncore subsystem that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
592 "EventCode": "0xB7",
593 "MSRValue": "0x4000008000 ",
594 "Counter": "0,1,2,3",
595 "UMask": "0x1",
596 "EventName": "OFFCORE_RESPONSE.ANY_REQUEST.OUTSTANDING",
597 "MSRIndex": "0x1a6",
598 "SampleAfterValue": "100007",
599 "BriefDescription": "Counts requests to the uncore subsystem that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
600 "Offcore": "1"
601 },
602 {
603 "CollectPEBSRecord": "1",
604 "PublicDescription": "Counts requests to the uncore subsystem that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
605 "EventCode": "0xB7",
606 "MSRValue": "0x3600008000 ",
607 "Counter": "0,1,2,3",
608 "UMask": "0x1",
609 "EventName": "OFFCORE_RESPONSE.ANY_REQUEST.L2_MISS.ANY",
610 "MSRIndex": "0x1a6,0x1a7",
611 "SampleAfterValue": "100007",
612 "BriefDescription": "Counts requests to the uncore subsystem that miss the L2 cache.",
613 "Offcore": "1"
614 },
615 {
616 "CollectPEBSRecord": "1",
617 "PublicDescription": "Counts requests to the uncore subsystem that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
446 "EventCode": "0xB7", 618 "EventCode": "0xB7",
447 "MSRValue": "0x1000008000 ", 619 "MSRValue": "0x1000008000 ",
448 "Counter": "0,1,2,3", 620 "Counter": "0,1,2,3",
@@ -454,6 +626,8 @@
454 "Offcore": "1" 626 "Offcore": "1"
455 }, 627 },
456 { 628 {
629 "CollectPEBSRecord": "1",
630 "PublicDescription": "Counts requests to the uncore subsystem that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
457 "EventCode": "0xB7", 631 "EventCode": "0xB7",
458 "MSRValue": "0x0400008000 ", 632 "MSRValue": "0x0400008000 ",
459 "Counter": "0,1,2,3", 633 "Counter": "0,1,2,3",
@@ -465,6 +639,8 @@
465 "Offcore": "1" 639 "Offcore": "1"
466 }, 640 },
467 { 641 {
642 "CollectPEBSRecord": "1",
643 "PublicDescription": "Counts requests to the uncore subsystem that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
468 "EventCode": "0xB7", 644 "EventCode": "0xB7",
469 "MSRValue": "0x0200008000 ", 645 "MSRValue": "0x0200008000 ",
470 "Counter": "0,1,2,3", 646 "Counter": "0,1,2,3",
@@ -476,6 +652,8 @@
476 "Offcore": "1" 652 "Offcore": "1"
477 }, 653 },
478 { 654 {
655 "CollectPEBSRecord": "1",
656 "PublicDescription": "Counts requests to the uncore subsystem that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
479 "EventCode": "0xB7", 657 "EventCode": "0xB7",
480 "MSRValue": "0x0000048000 ", 658 "MSRValue": "0x0000048000 ",
481 "Counter": "0,1,2,3", 659 "Counter": "0,1,2,3",
@@ -487,6 +665,8 @@
487 "Offcore": "1" 665 "Offcore": "1"
488 }, 666 },
489 { 667 {
668 "CollectPEBSRecord": "1",
669 "PublicDescription": "Counts requests to the uncore subsystem that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
490 "EventCode": "0xB7", 670 "EventCode": "0xB7",
491 "MSRValue": "0x0000018000 ", 671 "MSRValue": "0x0000018000 ",
492 "Counter": "0,1,2,3", 672 "Counter": "0,1,2,3",
@@ -498,6 +678,21 @@
498 "Offcore": "1" 678 "Offcore": "1"
499 }, 679 },
500 { 680 {
681 "CollectPEBSRecord": "1",
682 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
683 "EventCode": "0xB7",
684 "MSRValue": "0x4000004800 ",
685 "Counter": "0,1,2,3",
686 "UMask": "0x1",
687 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.OUTSTANDING",
688 "MSRIndex": "0x1a6",
689 "SampleAfterValue": "100007",
690 "BriefDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
691 "Offcore": "1"
692 },
693 {
694 "CollectPEBSRecord": "1",
695 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
501 "EventCode": "0xB7", 696 "EventCode": "0xB7",
502 "MSRValue": "0x3600004800 ", 697 "MSRValue": "0x3600004800 ",
503 "Counter": "0,1,2,3", 698 "Counter": "0,1,2,3",
@@ -509,6 +704,47 @@
509 "Offcore": "1" 704 "Offcore": "1"
510 }, 705 },
511 { 706 {
707 "CollectPEBSRecord": "1",
708 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
709 "EventCode": "0xB7",
710 "MSRValue": "0x1000004800 ",
711 "Counter": "0,1,2,3",
712 "UMask": "0x1",
713 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L2_MISS.HITM_OTHER_CORE",
714 "MSRIndex": "0x1a6,0x1a7",
715 "SampleAfterValue": "100007",
716 "BriefDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required.",
717 "Offcore": "1"
718 },
719 {
720 "CollectPEBSRecord": "1",
721 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
722 "EventCode": "0xB7",
723 "MSRValue": "0x0400004800 ",
724 "Counter": "0,1,2,3",
725 "UMask": "0x1",
726 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L2_MISS.HIT_OTHER_CORE_NO_FWD",
727 "MSRIndex": "0x1a6,0x1a7",
728 "SampleAfterValue": "100007",
729 "BriefDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required.",
730 "Offcore": "1"
731 },
732 {
733 "CollectPEBSRecord": "1",
734 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
735 "EventCode": "0xB7",
736 "MSRValue": "0x0200004800 ",
737 "Counter": "0,1,2,3",
738 "UMask": "0x1",
739 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L2_MISS.SNOOP_MISS_OR_NO_SNOOP_NEEDED",
740 "MSRIndex": "0x1a6,0x1a7",
741 "SampleAfterValue": "100007",
742 "BriefDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that true miss for the L2 cache with a snoop miss in the other processor module. ",
743 "Offcore": "1"
744 },
745 {
746 "CollectPEBSRecord": "1",
747 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
512 "EventCode": "0xB7", 748 "EventCode": "0xB7",
513 "MSRValue": "0x0000044800 ", 749 "MSRValue": "0x0000044800 ",
514 "Counter": "0,1,2,3", 750 "Counter": "0,1,2,3",
@@ -520,6 +756,34 @@
520 "Offcore": "1" 756 "Offcore": "1"
521 }, 757 },
522 { 758 {
759 "CollectPEBSRecord": "1",
760 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
761 "EventCode": "0xB7",
762 "MSRValue": "0x0000014800 ",
763 "Counter": "0,1,2,3",
764 "UMask": "0x1",
765 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.ANY_RESPONSE",
766 "MSRIndex": "0x1a6,0x1a7",
767 "SampleAfterValue": "100007",
768 "BriefDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that have any transaction responses from the uncore subsystem.",
769 "Offcore": "1"
770 },
771 {
772 "CollectPEBSRecord": "1",
773 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
774 "EventCode": "0xB7",
775 "MSRValue": "0x4000004000 ",
776 "Counter": "0,1,2,3",
777 "UMask": "0x1",
778 "EventName": "OFFCORE_RESPONSE.PARTIAL_STREAMING_STORES.OUTSTANDING",
779 "MSRIndex": "0x1a6",
780 "SampleAfterValue": "100007",
781 "BriefDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
782 "Offcore": "1"
783 },
784 {
785 "CollectPEBSRecord": "1",
786 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
523 "EventCode": "0xB7", 787 "EventCode": "0xB7",
524 "MSRValue": "0x3600004000 ", 788 "MSRValue": "0x3600004000 ",
525 "Counter": "0,1,2,3", 789 "Counter": "0,1,2,3",
@@ -531,6 +795,8 @@
531 "Offcore": "1" 795 "Offcore": "1"
532 }, 796 },
533 { 797 {
798 "CollectPEBSRecord": "1",
799 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
534 "EventCode": "0xB7", 800 "EventCode": "0xB7",
535 "MSRValue": "0x1000004000 ", 801 "MSRValue": "0x1000004000 ",
536 "Counter": "0,1,2,3", 802 "Counter": "0,1,2,3",
@@ -542,6 +808,8 @@
542 "Offcore": "1" 808 "Offcore": "1"
543 }, 809 },
544 { 810 {
811 "CollectPEBSRecord": "1",
812 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
545 "EventCode": "0xB7", 813 "EventCode": "0xB7",
546 "MSRValue": "0x0400004000 ", 814 "MSRValue": "0x0400004000 ",
547 "Counter": "0,1,2,3", 815 "Counter": "0,1,2,3",
@@ -553,6 +821,8 @@
553 "Offcore": "1" 821 "Offcore": "1"
554 }, 822 },
555 { 823 {
824 "CollectPEBSRecord": "1",
825 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
556 "EventCode": "0xB7", 826 "EventCode": "0xB7",
557 "MSRValue": "0x0200004000 ", 827 "MSRValue": "0x0200004000 ",
558 "Counter": "0,1,2,3", 828 "Counter": "0,1,2,3",
@@ -564,6 +834,8 @@
564 "Offcore": "1" 834 "Offcore": "1"
565 }, 835 },
566 { 836 {
837 "CollectPEBSRecord": "1",
838 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
567 "EventCode": "0xB7", 839 "EventCode": "0xB7",
568 "MSRValue": "0x0000044000 ", 840 "MSRValue": "0x0000044000 ",
569 "Counter": "0,1,2,3", 841 "Counter": "0,1,2,3",
@@ -575,6 +847,34 @@
575 "Offcore": "1" 847 "Offcore": "1"
576 }, 848 },
577 { 849 {
850 "CollectPEBSRecord": "1",
851 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
852 "EventCode": "0xB7",
853 "MSRValue": "0x0000014000 ",
854 "Counter": "0,1,2,3",
855 "UMask": "0x1",
856 "EventName": "OFFCORE_RESPONSE.PARTIAL_STREAMING_STORES.ANY_RESPONSE",
857 "MSRIndex": "0x1a6,0x1a7",
858 "SampleAfterValue": "100007",
859 "BriefDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that have any transaction responses from the uncore subsystem.",
860 "Offcore": "1"
861 },
862 {
863 "CollectPEBSRecord": "1",
864 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
865 "EventCode": "0xB7",
866 "MSRValue": "0x4000002000 ",
867 "Counter": "0,1,2,3",
868 "UMask": "0x1",
869 "EventName": "OFFCORE_RESPONSE.PF_L1_DATA_RD.OUTSTANDING",
870 "MSRIndex": "0x1a6",
871 "SampleAfterValue": "100007",
872 "BriefDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
873 "Offcore": "1"
874 },
875 {
876 "CollectPEBSRecord": "1",
877 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
578 "EventCode": "0xB7", 878 "EventCode": "0xB7",
579 "MSRValue": "0x3600002000 ", 879 "MSRValue": "0x3600002000 ",
580 "Counter": "0,1,2,3", 880 "Counter": "0,1,2,3",
@@ -586,6 +886,8 @@
586 "Offcore": "1" 886 "Offcore": "1"
587 }, 887 },
588 { 888 {
889 "CollectPEBSRecord": "1",
890 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
589 "EventCode": "0xB7", 891 "EventCode": "0xB7",
590 "MSRValue": "0x1000002000 ", 892 "MSRValue": "0x1000002000 ",
591 "Counter": "0,1,2,3", 893 "Counter": "0,1,2,3",
@@ -597,6 +899,8 @@
597 "Offcore": "1" 899 "Offcore": "1"
598 }, 900 },
599 { 901 {
902 "CollectPEBSRecord": "1",
903 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
600 "EventCode": "0xB7", 904 "EventCode": "0xB7",
601 "MSRValue": "0x0400002000 ", 905 "MSRValue": "0x0400002000 ",
602 "Counter": "0,1,2,3", 906 "Counter": "0,1,2,3",
@@ -608,6 +912,8 @@
608 "Offcore": "1" 912 "Offcore": "1"
609 }, 913 },
610 { 914 {
915 "CollectPEBSRecord": "1",
916 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
611 "EventCode": "0xB7", 917 "EventCode": "0xB7",
612 "MSRValue": "0x0200002000 ", 918 "MSRValue": "0x0200002000 ",
613 "Counter": "0,1,2,3", 919 "Counter": "0,1,2,3",
@@ -619,6 +925,8 @@
619 "Offcore": "1" 925 "Offcore": "1"
620 }, 926 },
621 { 927 {
928 "CollectPEBSRecord": "1",
929 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
622 "EventCode": "0xB7", 930 "EventCode": "0xB7",
623 "MSRValue": "0x0000042000 ", 931 "MSRValue": "0x0000042000 ",
624 "Counter": "0,1,2,3", 932 "Counter": "0,1,2,3",
@@ -630,6 +938,34 @@
630 "Offcore": "1" 938 "Offcore": "1"
631 }, 939 },
632 { 940 {
941 "CollectPEBSRecord": "1",
942 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
943 "EventCode": "0xB7",
944 "MSRValue": "0x0000012000 ",
945 "Counter": "0,1,2,3",
946 "UMask": "0x1",
947 "EventName": "OFFCORE_RESPONSE.PF_L1_DATA_RD.ANY_RESPONSE",
948 "MSRIndex": "0x1a6,0x1a7",
949 "SampleAfterValue": "100007",
950 "BriefDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that have any transaction responses from the uncore subsystem.",
951 "Offcore": "1"
952 },
953 {
954 "CollectPEBSRecord": "1",
955 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
956 "EventCode": "0xB7",
957 "MSRValue": "0x4000001000 ",
958 "Counter": "0,1,2,3",
959 "UMask": "0x1",
960 "EventName": "OFFCORE_RESPONSE.SW_PREFETCH.OUTSTANDING",
961 "MSRIndex": "0x1a6",
962 "SampleAfterValue": "100007",
963 "BriefDescription": "Counts data cache lines requests by software prefetch instructions that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
964 "Offcore": "1"
965 },
966 {
967 "CollectPEBSRecord": "1",
968 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
633 "EventCode": "0xB7", 969 "EventCode": "0xB7",
634 "MSRValue": "0x3600001000 ", 970 "MSRValue": "0x3600001000 ",
635 "Counter": "0,1,2,3", 971 "Counter": "0,1,2,3",
@@ -641,6 +977,8 @@
641 "Offcore": "1" 977 "Offcore": "1"
642 }, 978 },
643 { 979 {
980 "CollectPEBSRecord": "1",
981 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
644 "EventCode": "0xB7", 982 "EventCode": "0xB7",
645 "MSRValue": "0x1000001000 ", 983 "MSRValue": "0x1000001000 ",
646 "Counter": "0,1,2,3", 984 "Counter": "0,1,2,3",
@@ -652,6 +990,8 @@
652 "Offcore": "1" 990 "Offcore": "1"
653 }, 991 },
654 { 992 {
993 "CollectPEBSRecord": "1",
994 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
655 "EventCode": "0xB7", 995 "EventCode": "0xB7",
656 "MSRValue": "0x0400001000 ", 996 "MSRValue": "0x0400001000 ",
657 "Counter": "0,1,2,3", 997 "Counter": "0,1,2,3",
@@ -663,6 +1003,8 @@
663 "Offcore": "1" 1003 "Offcore": "1"
664 }, 1004 },
665 { 1005 {
1006 "CollectPEBSRecord": "1",
1007 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
666 "EventCode": "0xB7", 1008 "EventCode": "0xB7",
667 "MSRValue": "0x0200001000 ", 1009 "MSRValue": "0x0200001000 ",
668 "Counter": "0,1,2,3", 1010 "Counter": "0,1,2,3",
@@ -674,6 +1016,8 @@
674 "Offcore": "1" 1016 "Offcore": "1"
675 }, 1017 },
676 { 1018 {
1019 "CollectPEBSRecord": "1",
1020 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
677 "EventCode": "0xB7", 1021 "EventCode": "0xB7",
678 "MSRValue": "0x0000041000 ", 1022 "MSRValue": "0x0000041000 ",
679 "Counter": "0,1,2,3", 1023 "Counter": "0,1,2,3",
@@ -685,6 +1029,34 @@
685 "Offcore": "1" 1029 "Offcore": "1"
686 }, 1030 },
687 { 1031 {
1032 "CollectPEBSRecord": "1",
1033 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1034 "EventCode": "0xB7",
1035 "MSRValue": "0x0000011000 ",
1036 "Counter": "0,1,2,3",
1037 "UMask": "0x1",
1038 "EventName": "OFFCORE_RESPONSE.SW_PREFETCH.ANY_RESPONSE",
1039 "MSRIndex": "0x1a6,0x1a7",
1040 "SampleAfterValue": "100007",
1041 "BriefDescription": "Counts data cache lines requests by software prefetch instructions that have any transaction responses from the uncore subsystem.",
1042 "Offcore": "1"
1043 },
1044 {
1045 "CollectPEBSRecord": "1",
1046 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1047 "EventCode": "0xB7",
1048 "MSRValue": "0x4000000800 ",
1049 "Counter": "0,1,2,3",
1050 "UMask": "0x1",
1051 "EventName": "OFFCORE_RESPONSE.FULL_STREAMING_STORES.OUTSTANDING",
1052 "MSRIndex": "0x1a6",
1053 "SampleAfterValue": "100007",
1054 "BriefDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1055 "Offcore": "1"
1056 },
1057 {
1058 "CollectPEBSRecord": "1",
1059 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
688 "EventCode": "0xB7", 1060 "EventCode": "0xB7",
689 "MSRValue": "0x3600000800 ", 1061 "MSRValue": "0x3600000800 ",
690 "Counter": "0,1,2,3", 1062 "Counter": "0,1,2,3",
@@ -696,6 +1068,8 @@
696 "Offcore": "1" 1068 "Offcore": "1"
697 }, 1069 },
698 { 1070 {
1071 "CollectPEBSRecord": "1",
1072 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
699 "EventCode": "0xB7", 1073 "EventCode": "0xB7",
700 "MSRValue": "0x1000000800 ", 1074 "MSRValue": "0x1000000800 ",
701 "Counter": "0,1,2,3", 1075 "Counter": "0,1,2,3",
@@ -707,6 +1081,8 @@
707 "Offcore": "1" 1081 "Offcore": "1"
708 }, 1082 },
709 { 1083 {
1084 "CollectPEBSRecord": "1",
1085 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
710 "EventCode": "0xB7", 1086 "EventCode": "0xB7",
711 "MSRValue": "0x0400000800 ", 1087 "MSRValue": "0x0400000800 ",
712 "Counter": "0,1,2,3", 1088 "Counter": "0,1,2,3",
@@ -718,6 +1094,8 @@
718 "Offcore": "1" 1094 "Offcore": "1"
719 }, 1095 },
720 { 1096 {
1097 "CollectPEBSRecord": "1",
1098 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
721 "EventCode": "0xB7", 1099 "EventCode": "0xB7",
722 "MSRValue": "0x0200000800 ", 1100 "MSRValue": "0x0200000800 ",
723 "Counter": "0,1,2,3", 1101 "Counter": "0,1,2,3",
@@ -729,6 +1107,8 @@
729 "Offcore": "1" 1107 "Offcore": "1"
730 }, 1108 },
731 { 1109 {
1110 "CollectPEBSRecord": "1",
1111 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
732 "EventCode": "0xB7", 1112 "EventCode": "0xB7",
733 "MSRValue": "0x0000040800 ", 1113 "MSRValue": "0x0000040800 ",
734 "Counter": "0,1,2,3", 1114 "Counter": "0,1,2,3",
@@ -740,6 +1120,99 @@
740 "Offcore": "1" 1120 "Offcore": "1"
741 }, 1121 },
742 { 1122 {
1123 "CollectPEBSRecord": "1",
1124 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1125 "EventCode": "0xB7",
1126 "MSRValue": "0x0000010800 ",
1127 "Counter": "0,1,2,3",
1128 "UMask": "0x1",
1129 "EventName": "OFFCORE_RESPONSE.FULL_STREAMING_STORES.ANY_RESPONSE",
1130 "MSRIndex": "0x1a6,0x1a7",
1131 "SampleAfterValue": "100007",
1132 "BriefDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that have any transaction responses from the uncore subsystem.",
1133 "Offcore": "1"
1134 },
1135 {
1136 "CollectPEBSRecord": "1",
1137 "PublicDescription": "Counts bus lock and split lock requests that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1138 "EventCode": "0xB7",
1139 "MSRValue": "0x4000000400 ",
1140 "Counter": "0,1,2,3",
1141 "UMask": "0x1",
1142 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.OUTSTANDING",
1143 "MSRIndex": "0x1a6",
1144 "SampleAfterValue": "100007",
1145 "BriefDescription": "Counts bus lock and split lock requests that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1146 "Offcore": "1"
1147 },
1148 {
1149 "CollectPEBSRecord": "1",
1150 "PublicDescription": "Counts bus lock and split lock requests that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1151 "EventCode": "0xB7",
1152 "MSRValue": "0x3600000400 ",
1153 "Counter": "0,1,2,3",
1154 "UMask": "0x1",
1155 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.L2_MISS.ANY",
1156 "MSRIndex": "0x1a6,0x1a7",
1157 "SampleAfterValue": "100007",
1158 "BriefDescription": "Counts bus lock and split lock requests that miss the L2 cache.",
1159 "Offcore": "1"
1160 },
1161 {
1162 "CollectPEBSRecord": "1",
1163 "PublicDescription": "Counts bus lock and split lock requests that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1164 "EventCode": "0xB7",
1165 "MSRValue": "0x1000000400 ",
1166 "Counter": "0,1,2,3",
1167 "UMask": "0x1",
1168 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.L2_MISS.HITM_OTHER_CORE",
1169 "MSRIndex": "0x1a6,0x1a7",
1170 "SampleAfterValue": "100007",
1171 "BriefDescription": "Counts bus lock and split lock requests that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required.",
1172 "Offcore": "1"
1173 },
1174 {
1175 "CollectPEBSRecord": "1",
1176 "PublicDescription": "Counts bus lock and split lock requests that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1177 "EventCode": "0xB7",
1178 "MSRValue": "0x0400000400 ",
1179 "Counter": "0,1,2,3",
1180 "UMask": "0x1",
1181 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.L2_MISS.HIT_OTHER_CORE_NO_FWD",
1182 "MSRIndex": "0x1a6,0x1a7",
1183 "SampleAfterValue": "100007",
1184 "BriefDescription": "Counts bus lock and split lock requests that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required.",
1185 "Offcore": "1"
1186 },
1187 {
1188 "CollectPEBSRecord": "1",
1189 "PublicDescription": "Counts bus lock and split lock requests that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1190 "EventCode": "0xB7",
1191 "MSRValue": "0x0200000400 ",
1192 "Counter": "0,1,2,3",
1193 "UMask": "0x1",
1194 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.L2_MISS.SNOOP_MISS_OR_NO_SNOOP_NEEDED",
1195 "MSRIndex": "0x1a6,0x1a7",
1196 "SampleAfterValue": "100007",
1197 "BriefDescription": "Counts bus lock and split lock requests that true miss for the L2 cache with a snoop miss in the other processor module. ",
1198 "Offcore": "1"
1199 },
1200 {
1201 "CollectPEBSRecord": "1",
1202 "PublicDescription": "Counts bus lock and split lock requests that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1203 "EventCode": "0xB7",
1204 "MSRValue": "0x0000040400 ",
1205 "Counter": "0,1,2,3",
1206 "UMask": "0x1",
1207 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.L2_HIT",
1208 "MSRIndex": "0x1a6,0x1a7",
1209 "SampleAfterValue": "100007",
1210 "BriefDescription": "Counts bus lock and split lock requests that hit the L2 cache.",
1211 "Offcore": "1"
1212 },
1213 {
1214 "CollectPEBSRecord": "1",
1215 "PublicDescription": "Counts bus lock and split lock requests that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
743 "EventCode": "0xB7", 1216 "EventCode": "0xB7",
744 "MSRValue": "0x0000010400 ", 1217 "MSRValue": "0x0000010400 ",
745 "Counter": "0,1,2,3", 1218 "Counter": "0,1,2,3",
@@ -751,6 +1224,112 @@
751 "Offcore": "1" 1224 "Offcore": "1"
752 }, 1225 },
753 { 1226 {
1227 "CollectPEBSRecord": "1",
1228 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1229 "EventCode": "0xB7",
1230 "MSRValue": "0x4000000200 ",
1231 "Counter": "0,1,2,3",
1232 "UMask": "0x1",
1233 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.OUTSTANDING",
1234 "MSRIndex": "0x1a6",
1235 "SampleAfterValue": "100007",
1236 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1237 "Offcore": "1"
1238 },
1239 {
1240 "CollectPEBSRecord": "1",
1241 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1242 "EventCode": "0xB7",
1243 "MSRValue": "0x3600000200 ",
1244 "Counter": "0,1,2,3",
1245 "UMask": "0x1",
1246 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.L2_MISS.ANY",
1247 "MSRIndex": "0x1a6,0x1a7",
1248 "SampleAfterValue": "100007",
1249 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache.",
1250 "Offcore": "1"
1251 },
1252 {
1253 "CollectPEBSRecord": "1",
1254 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1255 "EventCode": "0xB7",
1256 "MSRValue": "0x1000000200 ",
1257 "Counter": "0,1,2,3",
1258 "UMask": "0x1",
1259 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.L2_MISS.HITM_OTHER_CORE",
1260 "MSRIndex": "0x1a6,0x1a7",
1261 "SampleAfterValue": "100007",
1262 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required.",
1263 "Offcore": "1"
1264 },
1265 {
1266 "CollectPEBSRecord": "1",
1267 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1268 "EventCode": "0xB7",
1269 "MSRValue": "0x0400000200 ",
1270 "Counter": "0,1,2,3",
1271 "UMask": "0x1",
1272 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.L2_MISS.HIT_OTHER_CORE_NO_FWD",
1273 "MSRIndex": "0x1a6,0x1a7",
1274 "SampleAfterValue": "100007",
1275 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required.",
1276 "Offcore": "1"
1277 },
1278 {
1279 "CollectPEBSRecord": "1",
1280 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1281 "EventCode": "0xB7",
1282 "MSRValue": "0x0200000200 ",
1283 "Counter": "0,1,2,3",
1284 "UMask": "0x1",
1285 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.L2_MISS.SNOOP_MISS_OR_NO_SNOOP_NEEDED",
1286 "MSRIndex": "0x1a6,0x1a7",
1287 "SampleAfterValue": "100007",
1288 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that true miss for the L2 cache with a snoop miss in the other processor module. ",
1289 "Offcore": "1"
1290 },
1291 {
1292 "CollectPEBSRecord": "1",
1293 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1294 "EventCode": "0xB7",
1295 "MSRValue": "0x0000040200 ",
1296 "Counter": "0,1,2,3",
1297 "UMask": "0x1",
1298 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.L2_HIT",
1299 "MSRIndex": "0x1a6,0x1a7",
1300 "SampleAfterValue": "100007",
1301 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that hit the L2 cache.",
1302 "Offcore": "1"
1303 },
1304 {
1305 "CollectPEBSRecord": "1",
1306 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1307 "EventCode": "0xB7",
1308 "MSRValue": "0x0000010200 ",
1309 "Counter": "0,1,2,3",
1310 "UMask": "0x1",
1311 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.ANY_RESPONSE",
1312 "MSRIndex": "0x1a6,0x1a7",
1313 "SampleAfterValue": "100007",
1314 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that have any transaction responses from the uncore subsystem.",
1315 "Offcore": "1"
1316 },
1317 {
1318 "CollectPEBSRecord": "1",
1319 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1320 "EventCode": "0xB7",
1321 "MSRValue": "0x4000000100 ",
1322 "Counter": "0,1,2,3",
1323 "UMask": "0x1",
1324 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.OUTSTANDING",
1325 "MSRIndex": "0x1a6",
1326 "SampleAfterValue": "100007",
1327 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1328 "Offcore": "1"
1329 },
1330 {
1331 "CollectPEBSRecord": "1",
1332 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
754 "EventCode": "0xB7", 1333 "EventCode": "0xB7",
755 "MSRValue": "0x3600000100 ", 1334 "MSRValue": "0x3600000100 ",
756 "Counter": "0,1,2,3", 1335 "Counter": "0,1,2,3",
@@ -762,6 +1341,86 @@
762 "Offcore": "1" 1341 "Offcore": "1"
763 }, 1342 },
764 { 1343 {
1344 "CollectPEBSRecord": "1",
1345 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1346 "EventCode": "0xB7",
1347 "MSRValue": "0x1000000100 ",
1348 "Counter": "0,1,2,3",
1349 "UMask": "0x1",
1350 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.L2_MISS.HITM_OTHER_CORE",
1351 "MSRIndex": "0x1a6,0x1a7",
1352 "SampleAfterValue": "100007",
1353 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required.",
1354 "Offcore": "1"
1355 },
1356 {
1357 "CollectPEBSRecord": "1",
1358 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1359 "EventCode": "0xB7",
1360 "MSRValue": "0x0400000100 ",
1361 "Counter": "0,1,2,3",
1362 "UMask": "0x1",
1363 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.L2_MISS.HIT_OTHER_CORE_NO_FWD",
1364 "MSRIndex": "0x1a6,0x1a7",
1365 "SampleAfterValue": "100007",
1366 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required.",
1367 "Offcore": "1"
1368 },
1369 {
1370 "CollectPEBSRecord": "1",
1371 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1372 "EventCode": "0xB7",
1373 "MSRValue": "0x0200000100 ",
1374 "Counter": "0,1,2,3",
1375 "UMask": "0x1",
1376 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.L2_MISS.SNOOP_MISS_OR_NO_SNOOP_NEEDED",
1377 "MSRIndex": "0x1a6,0x1a7",
1378 "SampleAfterValue": "100007",
1379 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that true miss for the L2 cache with a snoop miss in the other processor module. ",
1380 "Offcore": "1"
1381 },
1382 {
1383 "CollectPEBSRecord": "1",
1384 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1385 "EventCode": "0xB7",
1386 "MSRValue": "0x0000040100 ",
1387 "Counter": "0,1,2,3",
1388 "UMask": "0x1",
1389 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.L2_HIT",
1390 "MSRIndex": "0x1a6,0x1a7",
1391 "SampleAfterValue": "100007",
1392 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that hit the L2 cache.",
1393 "Offcore": "1"
1394 },
1395 {
1396 "CollectPEBSRecord": "1",
1397 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1398 "EventCode": "0xB7",
1399 "MSRValue": "0x0000010100 ",
1400 "Counter": "0,1,2,3",
1401 "UMask": "0x1",
1402 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.ANY_RESPONSE",
1403 "MSRIndex": "0x1a6,0x1a7",
1404 "SampleAfterValue": "100007",
1405 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that have any transaction responses from the uncore subsystem.",
1406 "Offcore": "1"
1407 },
1408 {
1409 "CollectPEBSRecord": "1",
1410 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1411 "EventCode": "0xB7",
1412 "MSRValue": "0x4000000080 ",
1413 "Counter": "0,1,2,3",
1414 "UMask": "0x1",
1415 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.OUTSTANDING",
1416 "MSRIndex": "0x1a6",
1417 "SampleAfterValue": "100007",
1418 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1419 "Offcore": "1"
1420 },
1421 {
1422 "CollectPEBSRecord": "1",
1423 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
765 "EventCode": "0xB7", 1424 "EventCode": "0xB7",
766 "MSRValue": "0x3600000080 ", 1425 "MSRValue": "0x3600000080 ",
767 "Counter": "0,1,2,3", 1426 "Counter": "0,1,2,3",
@@ -773,6 +1432,86 @@
773 "Offcore": "1" 1432 "Offcore": "1"
774 }, 1433 },
775 { 1434 {
1435 "CollectPEBSRecord": "1",
1436 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1437 "EventCode": "0xB7",
1438 "MSRValue": "0x1000000080 ",
1439 "Counter": "0,1,2,3",
1440 "UMask": "0x1",
1441 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.L2_MISS.HITM_OTHER_CORE",
1442 "MSRIndex": "0x1a6,0x1a7",
1443 "SampleAfterValue": "100007",
1444 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required.",
1445 "Offcore": "1"
1446 },
1447 {
1448 "CollectPEBSRecord": "1",
1449 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1450 "EventCode": "0xB7",
1451 "MSRValue": "0x0400000080 ",
1452 "Counter": "0,1,2,3",
1453 "UMask": "0x1",
1454 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.L2_MISS.HIT_OTHER_CORE_NO_FWD",
1455 "MSRIndex": "0x1a6,0x1a7",
1456 "SampleAfterValue": "100007",
1457 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required.",
1458 "Offcore": "1"
1459 },
1460 {
1461 "CollectPEBSRecord": "1",
1462 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1463 "EventCode": "0xB7",
1464 "MSRValue": "0x0200000080 ",
1465 "Counter": "0,1,2,3",
1466 "UMask": "0x1",
1467 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.L2_MISS.SNOOP_MISS_OR_NO_SNOOP_NEEDED",
1468 "MSRIndex": "0x1a6,0x1a7",
1469 "SampleAfterValue": "100007",
1470 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that true miss for the L2 cache with a snoop miss in the other processor module. ",
1471 "Offcore": "1"
1472 },
1473 {
1474 "CollectPEBSRecord": "1",
1475 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1476 "EventCode": "0xB7",
1477 "MSRValue": "0x0000040080 ",
1478 "Counter": "0,1,2,3",
1479 "UMask": "0x1",
1480 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.L2_HIT",
1481 "MSRIndex": "0x1a6,0x1a7",
1482 "SampleAfterValue": "100007",
1483 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that hit the L2 cache.",
1484 "Offcore": "1"
1485 },
1486 {
1487 "CollectPEBSRecord": "1",
1488 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1489 "EventCode": "0xB7",
1490 "MSRValue": "0x0000010080 ",
1491 "Counter": "0,1,2,3",
1492 "UMask": "0x1",
1493 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.ANY_RESPONSE",
1494 "MSRIndex": "0x1a6,0x1a7",
1495 "SampleAfterValue": "100007",
1496 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that have any transaction responses from the uncore subsystem.",
1497 "Offcore": "1"
1498 },
1499 {
1500 "CollectPEBSRecord": "1",
1501 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1502 "EventCode": "0xB7",
1503 "MSRValue": "0x4000000020 ",
1504 "Counter": "0,1,2,3",
1505 "UMask": "0x1",
1506 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.OUTSTANDING",
1507 "MSRIndex": "0x1a6",
1508 "SampleAfterValue": "100007",
1509 "BriefDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1510 "Offcore": "1"
1511 },
1512 {
1513 "CollectPEBSRecord": "1",
1514 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
776 "EventCode": "0xB7", 1515 "EventCode": "0xB7",
777 "MSRValue": "0x3600000020 ", 1516 "MSRValue": "0x3600000020 ",
778 "Counter": "0,1,2,3", 1517 "Counter": "0,1,2,3",
@@ -784,6 +1523,8 @@
784 "Offcore": "1" 1523 "Offcore": "1"
785 }, 1524 },
786 { 1525 {
1526 "CollectPEBSRecord": "1",
1527 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
787 "EventCode": "0xB7", 1528 "EventCode": "0xB7",
788 "MSRValue": "0x1000000020 ", 1529 "MSRValue": "0x1000000020 ",
789 "Counter": "0,1,2,3", 1530 "Counter": "0,1,2,3",
@@ -795,6 +1536,8 @@
795 "Offcore": "1" 1536 "Offcore": "1"
796 }, 1537 },
797 { 1538 {
1539 "CollectPEBSRecord": "1",
1540 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
798 "EventCode": "0xB7", 1541 "EventCode": "0xB7",
799 "MSRValue": "0x0400000020 ", 1542 "MSRValue": "0x0400000020 ",
800 "Counter": "0,1,2,3", 1543 "Counter": "0,1,2,3",
@@ -806,6 +1549,8 @@
806 "Offcore": "1" 1549 "Offcore": "1"
807 }, 1550 },
808 { 1551 {
1552 "CollectPEBSRecord": "1",
1553 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
809 "EventCode": "0xB7", 1554 "EventCode": "0xB7",
810 "MSRValue": "0x0200000020 ", 1555 "MSRValue": "0x0200000020 ",
811 "Counter": "0,1,2,3", 1556 "Counter": "0,1,2,3",
@@ -817,6 +1562,8 @@
817 "Offcore": "1" 1562 "Offcore": "1"
818 }, 1563 },
819 { 1564 {
1565 "CollectPEBSRecord": "1",
1566 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
820 "EventCode": "0xB7", 1567 "EventCode": "0xB7",
821 "MSRValue": "0x0000040020 ", 1568 "MSRValue": "0x0000040020 ",
822 "Counter": "0,1,2,3", 1569 "Counter": "0,1,2,3",
@@ -828,6 +1575,34 @@
828 "Offcore": "1" 1575 "Offcore": "1"
829 }, 1576 },
830 { 1577 {
1578 "CollectPEBSRecord": "1",
1579 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1580 "EventCode": "0xB7",
1581 "MSRValue": "0x0000010020 ",
1582 "Counter": "0,1,2,3",
1583 "UMask": "0x1",
1584 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.ANY_RESPONSE",
1585 "MSRIndex": "0x1a6,0x1a7",
1586 "SampleAfterValue": "100007",
1587 "BriefDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that have any transaction responses from the uncore subsystem.",
1588 "Offcore": "1"
1589 },
1590 {
1591 "CollectPEBSRecord": "1",
1592 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1593 "EventCode": "0xB7",
1594 "MSRValue": "0x4000000010 ",
1595 "Counter": "0,1,2,3",
1596 "UMask": "0x1",
1597 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.OUTSTANDING",
1598 "MSRIndex": "0x1a6",
1599 "SampleAfterValue": "100007",
1600 "BriefDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1601 "Offcore": "1"
1602 },
1603 {
1604 "CollectPEBSRecord": "1",
1605 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
831 "EventCode": "0xB7", 1606 "EventCode": "0xB7",
832 "MSRValue": "0x3600000010 ", 1607 "MSRValue": "0x3600000010 ",
833 "Counter": "0,1,2,3", 1608 "Counter": "0,1,2,3",
@@ -839,6 +1614,8 @@
839 "Offcore": "1" 1614 "Offcore": "1"
840 }, 1615 },
841 { 1616 {
1617 "CollectPEBSRecord": "1",
1618 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
842 "EventCode": "0xB7", 1619 "EventCode": "0xB7",
843 "MSRValue": "0x1000000010 ", 1620 "MSRValue": "0x1000000010 ",
844 "Counter": "0,1,2,3", 1621 "Counter": "0,1,2,3",
@@ -850,6 +1627,8 @@
850 "Offcore": "1" 1627 "Offcore": "1"
851 }, 1628 },
852 { 1629 {
1630 "CollectPEBSRecord": "1",
1631 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
853 "EventCode": "0xB7", 1632 "EventCode": "0xB7",
854 "MSRValue": "0x0400000010 ", 1633 "MSRValue": "0x0400000010 ",
855 "Counter": "0,1,2,3", 1634 "Counter": "0,1,2,3",
@@ -861,6 +1640,8 @@
861 "Offcore": "1" 1640 "Offcore": "1"
862 }, 1641 },
863 { 1642 {
1643 "CollectPEBSRecord": "1",
1644 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
864 "EventCode": "0xB7", 1645 "EventCode": "0xB7",
865 "MSRValue": "0x0200000010 ", 1646 "MSRValue": "0x0200000010 ",
866 "Counter": "0,1,2,3", 1647 "Counter": "0,1,2,3",
@@ -872,6 +1653,8 @@
872 "Offcore": "1" 1653 "Offcore": "1"
873 }, 1654 },
874 { 1655 {
1656 "CollectPEBSRecord": "1",
1657 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
875 "EventCode": "0xB7", 1658 "EventCode": "0xB7",
876 "MSRValue": "0x0000040010 ", 1659 "MSRValue": "0x0000040010 ",
877 "Counter": "0,1,2,3", 1660 "Counter": "0,1,2,3",
@@ -883,6 +1666,34 @@
883 "Offcore": "1" 1666 "Offcore": "1"
884 }, 1667 },
885 { 1668 {
1669 "CollectPEBSRecord": "1",
1670 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1671 "EventCode": "0xB7",
1672 "MSRValue": "0x0000010010 ",
1673 "Counter": "0,1,2,3",
1674 "UMask": "0x1",
1675 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.ANY_RESPONSE",
1676 "MSRIndex": "0x1a6,0x1a7",
1677 "SampleAfterValue": "100007",
1678 "BriefDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that have any transaction responses from the uncore subsystem.",
1679 "Offcore": "1"
1680 },
1681 {
1682 "CollectPEBSRecord": "1",
1683 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1684 "EventCode": "0xB7",
1685 "MSRValue": "0x4000000008 ",
1686 "Counter": "0,1,2,3",
1687 "UMask": "0x1",
1688 "EventName": "OFFCORE_RESPONSE.COREWB.OUTSTANDING",
1689 "MSRIndex": "0x1a6",
1690 "SampleAfterValue": "100007",
1691 "BriefDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that are outstanding, per cycle, from the time of the L2 miss to when any response is received.",
1692 "Offcore": "1"
1693 },
1694 {
1695 "CollectPEBSRecord": "1",
1696 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
886 "EventCode": "0xB7", 1697 "EventCode": "0xB7",
887 "MSRValue": "0x3600000008 ", 1698 "MSRValue": "0x3600000008 ",
888 "Counter": "0,1,2,3", 1699 "Counter": "0,1,2,3",
@@ -894,6 +1705,8 @@
894 "Offcore": "1" 1705 "Offcore": "1"
895 }, 1706 },
896 { 1707 {
1708 "CollectPEBSRecord": "1",
1709 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
897 "EventCode": "0xB7", 1710 "EventCode": "0xB7",
898 "MSRValue": "0x1000000008 ", 1711 "MSRValue": "0x1000000008 ",
899 "Counter": "0,1,2,3", 1712 "Counter": "0,1,2,3",
@@ -905,6 +1718,8 @@
905 "Offcore": "1" 1718 "Offcore": "1"
906 }, 1719 },
907 { 1720 {
1721 "CollectPEBSRecord": "1",
1722 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
908 "EventCode": "0xB7", 1723 "EventCode": "0xB7",
909 "MSRValue": "0x0400000008 ", 1724 "MSRValue": "0x0400000008 ",
910 "Counter": "0,1,2,3", 1725 "Counter": "0,1,2,3",
@@ -916,6 +1731,8 @@
916 "Offcore": "1" 1731 "Offcore": "1"
917 }, 1732 },
918 { 1733 {
1734 "CollectPEBSRecord": "1",
1735 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
919 "EventCode": "0xB7", 1736 "EventCode": "0xB7",
920 "MSRValue": "0x0200000008 ", 1737 "MSRValue": "0x0200000008 ",
921 "Counter": "0,1,2,3", 1738 "Counter": "0,1,2,3",
@@ -927,6 +1744,8 @@
927 "Offcore": "1" 1744 "Offcore": "1"
928 }, 1745 },
929 { 1746 {
1747 "CollectPEBSRecord": "1",
1748 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
930 "EventCode": "0xB7", 1749 "EventCode": "0xB7",
931 "MSRValue": "0x0000040008 ", 1750 "MSRValue": "0x0000040008 ",
932 "Counter": "0,1,2,3", 1751 "Counter": "0,1,2,3",
@@ -938,6 +1757,21 @@
938 "Offcore": "1" 1757 "Offcore": "1"
939 }, 1758 },
940 { 1759 {
1760 "CollectPEBSRecord": "1",
1761 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1762 "EventCode": "0xB7",
1763 "MSRValue": "0x0000010008 ",
1764 "Counter": "0,1,2,3",
1765 "UMask": "0x1",
1766 "EventName": "OFFCORE_RESPONSE.COREWB.ANY_RESPONSE",
1767 "MSRIndex": "0x1a6",
1768 "SampleAfterValue": "100007",
1769 "BriefDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that have any transaction responses from the uncore subsystem.",
1770 "Offcore": "1"
1771 },
1772 {
1773 "CollectPEBSRecord": "1",
1774 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
941 "EventCode": "0xB7", 1775 "EventCode": "0xB7",
942 "MSRValue": "0x4000000004 ", 1776 "MSRValue": "0x4000000004 ",
943 "Counter": "0,1,2,3", 1777 "Counter": "0,1,2,3",
@@ -949,6 +1783,8 @@
949 "Offcore": "1" 1783 "Offcore": "1"
950 }, 1784 },
951 { 1785 {
1786 "CollectPEBSRecord": "1",
1787 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
952 "EventCode": "0xB7", 1788 "EventCode": "0xB7",
953 "MSRValue": "0x3600000004 ", 1789 "MSRValue": "0x3600000004 ",
954 "Counter": "0,1,2,3", 1790 "Counter": "0,1,2,3",
@@ -960,6 +1796,21 @@
960 "Offcore": "1" 1796 "Offcore": "1"
961 }, 1797 },
962 { 1798 {
1799 "CollectPEBSRecord": "1",
1800 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1801 "EventCode": "0xB7",
1802 "MSRValue": "0x1000000004 ",
1803 "Counter": "0,1,2,3",
1804 "UMask": "0x1",
1805 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L2_MISS.HITM_OTHER_CORE",
1806 "MSRIndex": "0x1a6,0x1a7",
1807 "SampleAfterValue": "100007",
1808 "BriefDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required.",
1809 "Offcore": "1"
1810 },
1811 {
1812 "CollectPEBSRecord": "1",
1813 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
963 "EventCode": "0xB7", 1814 "EventCode": "0xB7",
964 "MSRValue": "0x0400000004 ", 1815 "MSRValue": "0x0400000004 ",
965 "Counter": "0,1,2,3", 1816 "Counter": "0,1,2,3",
@@ -971,6 +1822,8 @@
971 "Offcore": "1" 1822 "Offcore": "1"
972 }, 1823 },
973 { 1824 {
1825 "CollectPEBSRecord": "1",
1826 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
974 "EventCode": "0xB7", 1827 "EventCode": "0xB7",
975 "MSRValue": "0x0200000004 ", 1828 "MSRValue": "0x0200000004 ",
976 "Counter": "0,1,2,3", 1829 "Counter": "0,1,2,3",
@@ -982,6 +1835,8 @@
982 "Offcore": "1" 1835 "Offcore": "1"
983 }, 1836 },
984 { 1837 {
1838 "CollectPEBSRecord": "1",
1839 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
985 "EventCode": "0xB7", 1840 "EventCode": "0xB7",
986 "MSRValue": "0x0000040004 ", 1841 "MSRValue": "0x0000040004 ",
987 "Counter": "0,1,2,3", 1842 "Counter": "0,1,2,3",
@@ -993,6 +1848,21 @@
993 "Offcore": "1" 1848 "Offcore": "1"
994 }, 1849 },
995 { 1850 {
1851 "CollectPEBSRecord": "1",
1852 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1853 "EventCode": "0xB7",
1854 "MSRValue": "0x0000010004 ",
1855 "Counter": "0,1,2,3",
1856 "UMask": "0x1",
1857 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.ANY_RESPONSE",
1858 "MSRIndex": "0x1a6,0x1a7",
1859 "SampleAfterValue": "100007",
1860 "BriefDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that have any transaction responses from the uncore subsystem.",
1861 "Offcore": "1"
1862 },
1863 {
1864 "CollectPEBSRecord": "1",
1865 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
996 "EventCode": "0xB7", 1866 "EventCode": "0xB7",
997 "MSRValue": "0x4000000002 ", 1867 "MSRValue": "0x4000000002 ",
998 "Counter": "0,1,2,3", 1868 "Counter": "0,1,2,3",
@@ -1004,6 +1874,8 @@
1004 "Offcore": "1" 1874 "Offcore": "1"
1005 }, 1875 },
1006 { 1876 {
1877 "CollectPEBSRecord": "1",
1878 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1007 "EventCode": "0xB7", 1879 "EventCode": "0xB7",
1008 "MSRValue": "0x3600000002 ", 1880 "MSRValue": "0x3600000002 ",
1009 "Counter": "0,1,2,3", 1881 "Counter": "0,1,2,3",
@@ -1015,6 +1887,8 @@
1015 "Offcore": "1" 1887 "Offcore": "1"
1016 }, 1888 },
1017 { 1889 {
1890 "CollectPEBSRecord": "1",
1891 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1018 "EventCode": "0xB7", 1892 "EventCode": "0xB7",
1019 "MSRValue": "0x1000000002 ", 1893 "MSRValue": "0x1000000002 ",
1020 "Counter": "0,1,2,3", 1894 "Counter": "0,1,2,3",
@@ -1026,6 +1900,8 @@
1026 "Offcore": "1" 1900 "Offcore": "1"
1027 }, 1901 },
1028 { 1902 {
1903 "CollectPEBSRecord": "1",
1904 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1029 "EventCode": "0xB7", 1905 "EventCode": "0xB7",
1030 "MSRValue": "0x0400000002 ", 1906 "MSRValue": "0x0400000002 ",
1031 "Counter": "0,1,2,3", 1907 "Counter": "0,1,2,3",
@@ -1037,6 +1913,8 @@
1037 "Offcore": "1" 1913 "Offcore": "1"
1038 }, 1914 },
1039 { 1915 {
1916 "CollectPEBSRecord": "1",
1917 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1040 "EventCode": "0xB7", 1918 "EventCode": "0xB7",
1041 "MSRValue": "0x0200000002 ", 1919 "MSRValue": "0x0200000002 ",
1042 "Counter": "0,1,2,3", 1920 "Counter": "0,1,2,3",
@@ -1048,6 +1926,8 @@
1048 "Offcore": "1" 1926 "Offcore": "1"
1049 }, 1927 },
1050 { 1928 {
1929 "CollectPEBSRecord": "1",
1930 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1051 "EventCode": "0xB7", 1931 "EventCode": "0xB7",
1052 "MSRValue": "0x0000040002 ", 1932 "MSRValue": "0x0000040002 ",
1053 "Counter": "0,1,2,3", 1933 "Counter": "0,1,2,3",
@@ -1059,6 +1939,21 @@
1059 "Offcore": "1" 1939 "Offcore": "1"
1060 }, 1940 },
1061 { 1941 {
1942 "CollectPEBSRecord": "1",
1943 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1944 "EventCode": "0xB7",
1945 "MSRValue": "0x0000010002 ",
1946 "Counter": "0,1,2,3",
1947 "UMask": "0x1",
1948 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.ANY_RESPONSE",
1949 "MSRIndex": "0x1a6,0x1a7",
1950 "SampleAfterValue": "100007",
1951 "BriefDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that have any transaction responses from the uncore subsystem.",
1952 "Offcore": "1"
1953 },
1954 {
1955 "CollectPEBSRecord": "1",
1956 "PublicDescription": "Counts demand cacheable data reads of full cache lines that are outstanding, per cycle, from the time of the L2 miss to when any response is received. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1062 "EventCode": "0xB7", 1957 "EventCode": "0xB7",
1063 "MSRValue": "0x4000000001 ", 1958 "MSRValue": "0x4000000001 ",
1064 "Counter": "0,1,2,3", 1959 "Counter": "0,1,2,3",
@@ -1070,6 +1965,8 @@
1070 "Offcore": "1" 1965 "Offcore": "1"
1071 }, 1966 },
1072 { 1967 {
1968 "CollectPEBSRecord": "1",
1969 "PublicDescription": "Counts demand cacheable data reads of full cache lines that miss the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1073 "EventCode": "0xB7", 1970 "EventCode": "0xB7",
1074 "MSRValue": "0x3600000001 ", 1971 "MSRValue": "0x3600000001 ",
1075 "Counter": "0,1,2,3", 1972 "Counter": "0,1,2,3",
@@ -1081,6 +1978,8 @@
1081 "Offcore": "1" 1978 "Offcore": "1"
1082 }, 1979 },
1083 { 1980 {
1981 "CollectPEBSRecord": "1",
1982 "PublicDescription": "Counts demand cacheable data reads of full cache lines that miss the L2 cache with a snoop hit in the other processor module, data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1084 "EventCode": "0xB7", 1983 "EventCode": "0xB7",
1085 "MSRValue": "0x1000000001 ", 1984 "MSRValue": "0x1000000001 ",
1086 "Counter": "0,1,2,3", 1985 "Counter": "0,1,2,3",
@@ -1092,6 +1991,8 @@
1092 "Offcore": "1" 1991 "Offcore": "1"
1093 }, 1992 },
1094 { 1993 {
1994 "CollectPEBSRecord": "1",
1995 "PublicDescription": "Counts demand cacheable data reads of full cache lines that miss the L2 cache with a snoop hit in the other processor module, no data forwarding is required. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1095 "EventCode": "0xB7", 1996 "EventCode": "0xB7",
1096 "MSRValue": "0x0400000001 ", 1997 "MSRValue": "0x0400000001 ",
1097 "Counter": "0,1,2,3", 1998 "Counter": "0,1,2,3",
@@ -1103,6 +2004,8 @@
1103 "Offcore": "1" 2004 "Offcore": "1"
1104 }, 2005 },
1105 { 2006 {
2007 "CollectPEBSRecord": "1",
2008 "PublicDescription": "Counts demand cacheable data reads of full cache lines that true miss for the L2 cache with a snoop miss in the other processor module. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1106 "EventCode": "0xB7", 2009 "EventCode": "0xB7",
1107 "MSRValue": "0x0200000001 ", 2010 "MSRValue": "0x0200000001 ",
1108 "Counter": "0,1,2,3", 2011 "Counter": "0,1,2,3",
@@ -1114,6 +2017,8 @@
1114 "Offcore": "1" 2017 "Offcore": "1"
1115 }, 2018 },
1116 { 2019 {
2020 "CollectPEBSRecord": "1",
2021 "PublicDescription": "Counts demand cacheable data reads of full cache lines that hit the L2 cache. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
1117 "EventCode": "0xB7", 2022 "EventCode": "0xB7",
1118 "MSRValue": "0x0000040001 ", 2023 "MSRValue": "0x0000040001 ",
1119 "Counter": "0,1,2,3", 2024 "Counter": "0,1,2,3",
@@ -1123,5 +2028,18 @@
1123 "SampleAfterValue": "100007", 2028 "SampleAfterValue": "100007",
1124 "BriefDescription": "Counts demand cacheable data reads of full cache lines that hit the L2 cache.", 2029 "BriefDescription": "Counts demand cacheable data reads of full cache lines that hit the L2 cache.",
1125 "Offcore": "1" 2030 "Offcore": "1"
2031 },
2032 {
2033 "CollectPEBSRecord": "1",
2034 "PublicDescription": "Counts demand cacheable data reads of full cache lines that have any transaction responses from the uncore subsystem. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
2035 "EventCode": "0xB7",
2036 "MSRValue": "0x0000010001 ",
2037 "Counter": "0,1,2,3",
2038 "UMask": "0x1",
2039 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.ANY_RESPONSE",
2040 "MSRIndex": "0x1a6,0x1a7",
2041 "SampleAfterValue": "100007",
2042 "BriefDescription": "Counts demand cacheable data reads of full cache lines that have any transaction responses from the uncore subsystem.",
2043 "Offcore": "1"
1126 } 2044 }
1127] \ No newline at end of file 2045] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/goldmont/memory.json b/tools/perf/pmu-events/arch/x86/goldmont/memory.json
index ac8b0d365a19..690cebd12a94 100644
--- a/tools/perf/pmu-events/arch/x86/goldmont/memory.json
+++ b/tools/perf/pmu-events/arch/x86/goldmont/memory.json
@@ -1,15 +1,5 @@
1[ 1[
2 { 2 {
3 "CollectPEBSRecord": "1",
4 "PublicDescription": "Counts machine clears due to memory ordering issues. This occurs when a snoop request happens and the machine is uncertain if memory ordering will be preserved - as another core is in the process of modifying the data.",
5 "EventCode": "0xC3",
6 "Counter": "0,1,2,3",
7 "UMask": "0x2",
8 "EventName": "MACHINE_CLEARS.MEMORY_ORDERING",
9 "SampleAfterValue": "200003",
10 "BriefDescription": "Machine clears due to memory ordering issue"
11 },
12 {
13 "PEBS": "2", 3 "PEBS": "2",
14 "CollectPEBSRecord": "2", 4 "CollectPEBSRecord": "2",
15 "PublicDescription": "Counts when a memory load of a uop spans a page boundary (a split) is retired.", 5 "PublicDescription": "Counts when a memory load of a uop spans a page boundary (a split) is retired.",
@@ -30,5 +20,275 @@
30 "EventName": "MISALIGN_MEM_REF.STORE_PAGE_SPLIT", 20 "EventName": "MISALIGN_MEM_REF.STORE_PAGE_SPLIT",
31 "SampleAfterValue": "200003", 21 "SampleAfterValue": "200003",
32 "BriefDescription": "Store uops that split a page (Precise event capable)" 22 "BriefDescription": "Store uops that split a page (Precise event capable)"
23 },
24 {
25 "CollectPEBSRecord": "1",
26 "PublicDescription": "Counts machine clears due to memory ordering issues. This occurs when a snoop request happens and the machine is uncertain if memory ordering will be preserved as another core is in the process of modifying the data.",
27 "EventCode": "0xC3",
28 "Counter": "0,1,2,3",
29 "UMask": "0x2",
30 "EventName": "MACHINE_CLEARS.MEMORY_ORDERING",
31 "SampleAfterValue": "200003",
32 "BriefDescription": "Machine clears due to memory ordering issue"
33 },
34 {
35 "CollectPEBSRecord": "1",
36 "PublicDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
37 "EventCode": "0xB7",
38 "MSRValue": "0x20000032b7 ",
39 "Counter": "0,1,2,3",
40 "UMask": "0x1",
41 "EventName": "OFFCORE_RESPONSE.ANY_READ.L2_MISS.NON_DRAM",
42 "MSRIndex": "0x1a6,0x1a7",
43 "SampleAfterValue": "100007",
44 "BriefDescription": "Counts data read, code read, and read for ownership (RFO) requests (demand & prefetch) that miss the L2 cache and targets non-DRAM system address.",
45 "Offcore": "1"
46 },
47 {
48 "CollectPEBSRecord": "1",
49 "PublicDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
50 "EventCode": "0xB7",
51 "MSRValue": "0x2000000022 ",
52 "Counter": "0,1,2,3",
53 "UMask": "0x1",
54 "EventName": "OFFCORE_RESPONSE.ANY_RFO.L2_MISS.NON_DRAM",
55 "MSRIndex": "0x1a6,0x1a7",
56 "SampleAfterValue": "100007",
57 "BriefDescription": "Counts reads for ownership (RFO) requests (demand & prefetch) that miss the L2 cache and targets non-DRAM system address.",
58 "Offcore": "1"
59 },
60 {
61 "CollectPEBSRecord": "1",
62 "PublicDescription": "Counts data reads (demand & prefetch) that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
63 "EventCode": "0xB7",
64 "MSRValue": "0x2000003091",
65 "Counter": "0,1,2,3",
66 "UMask": "0x1",
67 "EventName": "OFFCORE_RESPONSE.ANY_DATA_RD.L2_MISS.NON_DRAM",
68 "MSRIndex": "0x1a6,0x1a7",
69 "SampleAfterValue": "100007",
70 "BriefDescription": "Counts data reads (demand & prefetch) that miss the L2 cache and targets non-DRAM system address.",
71 "Offcore": "1"
72 },
73 {
74 "CollectPEBSRecord": "1",
75 "PublicDescription": "Counts data reads generated by L1 or L2 prefetchers that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
76 "EventCode": "0xB7",
77 "MSRValue": "0x2000003010 ",
78 "Counter": "0,1,2,3",
79 "UMask": "0x1",
80 "EventName": "OFFCORE_RESPONSE.ANY_PF_DATA_RD.L2_MISS.NON_DRAM",
81 "MSRIndex": "0x1a6,0x1a7",
82 "SampleAfterValue": "100007",
83 "BriefDescription": "Counts data reads generated by L1 or L2 prefetchers that miss the L2 cache and targets non-DRAM system address.",
84 "Offcore": "1"
85 },
86 {
87 "CollectPEBSRecord": "1",
88 "PublicDescription": "Counts requests to the uncore subsystem that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
89 "EventCode": "0xB7",
90 "MSRValue": "0x2000008000 ",
91 "Counter": "0,1,2,3",
92 "UMask": "0x1",
93 "EventName": "OFFCORE_RESPONSE.ANY_REQUEST.L2_MISS.NON_DRAM",
94 "MSRIndex": "0x1a6,0x1a7",
95 "SampleAfterValue": "100007",
96 "BriefDescription": "Counts requests to the uncore subsystem that miss the L2 cache and targets non-DRAM system address.",
97 "Offcore": "1"
98 },
99 {
100 "CollectPEBSRecord": "1",
101 "PublicDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
102 "EventCode": "0xB7",
103 "MSRValue": "0x2000004800 ",
104 "Counter": "0,1,2,3",
105 "UMask": "0x1",
106 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L2_MISS.NON_DRAM",
107 "MSRIndex": "0x1a6,0x1a7",
108 "SampleAfterValue": "100007",
109 "BriefDescription": "Counts any data writes to uncacheable write combining (USWC) memory region that miss the L2 cache and targets non-DRAM system address.",
110 "Offcore": "1"
111 },
112 {
113 "CollectPEBSRecord": "1",
114 "PublicDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
115 "EventCode": "0xB7",
116 "MSRValue": "0x2000004000 ",
117 "Counter": "0,1,2,3",
118 "UMask": "0x1",
119 "EventName": "OFFCORE_RESPONSE.PARTIAL_STREAMING_STORES.L2_MISS.NON_DRAM",
120 "MSRIndex": "0x1a6,0x1a7",
121 "SampleAfterValue": "100007",
122 "BriefDescription": "Counts partial cache line data writes to uncacheable write combining (USWC) memory region that miss the L2 cache and targets non-DRAM system address.",
123 "Offcore": "1"
124 },
125 {
126 "CollectPEBSRecord": "1",
127 "PublicDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
128 "EventCode": "0xB7",
129 "MSRValue": "0x2000002000 ",
130 "Counter": "0,1,2,3",
131 "UMask": "0x1",
132 "EventName": "OFFCORE_RESPONSE.PF_L1_DATA_RD.L2_MISS.NON_DRAM",
133 "MSRIndex": "0x1a6,0x1a7",
134 "SampleAfterValue": "100007",
135 "BriefDescription": "Counts data cache line reads generated by hardware L1 data cache prefetcher that miss the L2 cache and targets non-DRAM system address.",
136 "Offcore": "1"
137 },
138 {
139 "CollectPEBSRecord": "1",
140 "PublicDescription": "Counts data cache lines requests by software prefetch instructions that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
141 "EventCode": "0xB7",
142 "MSRValue": "0x2000001000 ",
143 "Counter": "0,1,2,3",
144 "UMask": "0x1",
145 "EventName": "OFFCORE_RESPONSE.SW_PREFETCH.L2_MISS.NON_DRAM",
146 "MSRIndex": "0x1a6,0x1a7",
147 "SampleAfterValue": "100007",
148 "BriefDescription": "Counts data cache lines requests by software prefetch instructions that miss the L2 cache and targets non-DRAM system address.",
149 "Offcore": "1"
150 },
151 {
152 "CollectPEBSRecord": "1",
153 "PublicDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
154 "EventCode": "0xB7",
155 "MSRValue": "0x2000000800 ",
156 "Counter": "0,1,2,3",
157 "UMask": "0x1",
158 "EventName": "OFFCORE_RESPONSE.FULL_STREAMING_STORES.L2_MISS.NON_DRAM",
159 "MSRIndex": "0x1a6,0x1a7",
160 "SampleAfterValue": "100007",
161 "BriefDescription": "Counts full cache line data writes to uncacheable write combining (USWC) memory region and full cache-line non-temporal writes that miss the L2 cache and targets non-DRAM system address.",
162 "Offcore": "1"
163 },
164 {
165 "CollectPEBSRecord": "1",
166 "PublicDescription": "Counts bus lock and split lock requests that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
167 "EventCode": "0xB7",
168 "MSRValue": "0x2000000400 ",
169 "Counter": "0,1,2,3",
170 "UMask": "0x1",
171 "EventName": "OFFCORE_RESPONSE.BUS_LOCKS.L2_MISS.NON_DRAM",
172 "MSRIndex": "0x1a6,0x1a7",
173 "SampleAfterValue": "100007",
174 "BriefDescription": "Counts bus lock and split lock requests that miss the L2 cache and targets non-DRAM system address.",
175 "Offcore": "1"
176 },
177 {
178 "CollectPEBSRecord": "1",
179 "PublicDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
180 "EventCode": "0xB7",
181 "MSRValue": "0x2000000200 ",
182 "Counter": "0,1,2,3",
183 "UMask": "0x1",
184 "EventName": "OFFCORE_RESPONSE.UC_CODE_RD.L2_MISS.NON_DRAM",
185 "MSRIndex": "0x1a6,0x1a7",
186 "SampleAfterValue": "100007",
187 "BriefDescription": "Counts code reads in uncacheable (UC) memory region that miss the L2 cache and targets non-DRAM system address.",
188 "Offcore": "1"
189 },
190 {
191 "CollectPEBSRecord": "1",
192 "PublicDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
193 "EventCode": "0xB7",
194 "MSRValue": "0x2000000100 ",
195 "Counter": "0,1,2,3",
196 "UMask": "0x1",
197 "EventName": "OFFCORE_RESPONSE.PARTIAL_WRITES.L2_MISS.NON_DRAM",
198 "MSRIndex": "0x1a6,0x1a7",
199 "SampleAfterValue": "100007",
200 "BriefDescription": "Counts the number of demand write requests (RFO) generated by a write to partial data cache line, including the writes to uncacheable (UC) and write through (WT), and write protected (WP) types of memory that miss the L2 cache and targets non-DRAM system address.",
201 "Offcore": "1"
202 },
203 {
204 "CollectPEBSRecord": "1",
205 "PublicDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
206 "EventCode": "0xB7",
207 "MSRValue": "0x2000000080 ",
208 "Counter": "0,1,2,3",
209 "UMask": "0x1",
210 "EventName": "OFFCORE_RESPONSE.PARTIAL_READS.L2_MISS.NON_DRAM",
211 "MSRIndex": "0x1a6,0x1a7",
212 "SampleAfterValue": "100007",
213 "BriefDescription": "Counts demand data partial reads, including data in uncacheable (UC) or uncacheable write combining (USWC) memory types that miss the L2 cache and targets non-DRAM system address.",
214 "Offcore": "1"
215 },
216 {
217 "CollectPEBSRecord": "1",
218 "PublicDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
219 "EventCode": "0xB7",
220 "MSRValue": "0x2000000020 ",
221 "Counter": "0,1,2,3",
222 "UMask": "0x1",
223 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L2_MISS.NON_DRAM",
224 "MSRIndex": "0x1a6,0x1a7",
225 "SampleAfterValue": "100007",
226 "BriefDescription": "Counts reads for ownership (RFO) requests generated by L2 prefetcher that miss the L2 cache and targets non-DRAM system address.",
227 "Offcore": "1"
228 },
229 {
230 "CollectPEBSRecord": "1",
231 "PublicDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
232 "EventCode": "0xB7",
233 "MSRValue": "0x2000000010 ",
234 "Counter": "0,1,2,3",
235 "UMask": "0x1",
236 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L2_MISS.NON_DRAM",
237 "MSRIndex": "0x1a6,0x1a7",
238 "SampleAfterValue": "100007",
239 "BriefDescription": "Counts data cacheline reads generated by hardware L2 cache prefetcher that miss the L2 cache and targets non-DRAM system address.",
240 "Offcore": "1"
241 },
242 {
243 "CollectPEBSRecord": "1",
244 "PublicDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
245 "EventCode": "0xB7",
246 "MSRValue": "0x2000000008 ",
247 "Counter": "0,1,2,3",
248 "UMask": "0x1",
249 "EventName": "OFFCORE_RESPONSE.COREWB.L2_MISS.NON_DRAM",
250 "MSRIndex": "0x1a6",
251 "SampleAfterValue": "100007",
252 "BriefDescription": "Counts the number of writeback transactions caused by L1 or L2 cache evictions that miss the L2 cache and targets non-DRAM system address.",
253 "Offcore": "1"
254 },
255 {
256 "CollectPEBSRecord": "1",
257 "PublicDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
258 "EventCode": "0xB7",
259 "MSRValue": "0x2000000004 ",
260 "Counter": "0,1,2,3",
261 "UMask": "0x1",
262 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L2_MISS.NON_DRAM",
263 "MSRIndex": "0x1a6,0x1a7",
264 "SampleAfterValue": "100007",
265 "BriefDescription": "Counts demand instruction cacheline and I-side prefetch requests that miss the instruction cache that miss the L2 cache and targets non-DRAM system address.",
266 "Offcore": "1"
267 },
268 {
269 "CollectPEBSRecord": "1",
270 "PublicDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
271 "EventCode": "0xB7",
272 "MSRValue": "0x2000000002 ",
273 "Counter": "0,1,2,3",
274 "UMask": "0x1",
275 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L2_MISS.NON_DRAM",
276 "MSRIndex": "0x1a6,0x1a7",
277 "SampleAfterValue": "100007",
278 "BriefDescription": "Counts demand reads for ownership (RFO) requests generated by a write to full data cache line that miss the L2 cache and targets non-DRAM system address.",
279 "Offcore": "1"
280 },
281 {
282 "CollectPEBSRecord": "1",
283 "PublicDescription": "Counts demand cacheable data reads of full cache lines that miss the L2 cache and targets non-DRAM system address. Requires MSR_OFFCORE_RESP[0,1] to specify request type and response. (duplicated for both MSRs)",
284 "EventCode": "0xB7",
285 "MSRValue": "0x2000000001 ",
286 "Counter": "0,1,2,3",
287 "UMask": "0x1",
288 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L2_MISS.NON_DRAM",
289 "MSRIndex": "0x1a6,0x1a7",
290 "SampleAfterValue": "100007",
291 "BriefDescription": "Counts demand cacheable data reads of full cache lines that miss the L2 cache and targets non-DRAM system address.",
292 "Offcore": "1"
33 } 293 }
34] \ No newline at end of file 294] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/goldmont/other.json b/tools/perf/pmu-events/arch/x86/goldmont/other.json
index df25ca9542f1..959cadd7cb0e 100644
--- a/tools/perf/pmu-events/arch/x86/goldmont/other.json
+++ b/tools/perf/pmu-events/arch/x86/goldmont/other.json
@@ -1,23 +1,23 @@
1[ 1[
2 { 2 {
3 "CollectPEBSRecord": "1", 3 "CollectPEBSRecord": "1",
4 "PublicDescription": "Counts the number of issue slots per core cycle that were not consumed because of a full resource in the backend. Including but not limited to resources such as the Re-order Buffer (ROB), reservation stations (RS), load/store buffers, physical registers, or any other needed machine resource that is currently unavailable. Note that uops must be available for consumption in order for this event to fire. If a uop is not available (Instruction Queue is empty), this event will not count.", 4 "PublicDescription": "Counts cycles that fetch is stalled due to any reason. That is, the decoder queue is able to accept bytes, but the fetch unit is unable to provide bytes. This will include cycles due to an ITLB miss, ICache miss and other events.",
5 "EventCode": "0xCA", 5 "EventCode": "0x86",
6 "Counter": "0,1,2,3", 6 "Counter": "0,1,2,3",
7 "UMask": "0x1", 7 "UMask": "0x0",
8 "EventName": "ISSUE_SLOTS_NOT_CONSUMED.RESOURCE_FULL", 8 "EventName": "FETCH_STALL.ALL",
9 "SampleAfterValue": "200003", 9 "SampleAfterValue": "200003",
10 "BriefDescription": "Unfilled issue slots per cycle because of a full resource in the backend" 10 "BriefDescription": "Cycles code-fetch stalled due to any reason."
11 }, 11 },
12 { 12 {
13 "CollectPEBSRecord": "1", 13 "CollectPEBSRecord": "1",
14 "PublicDescription": "Counts the number of issue slots per core cycle that were not consumed by the backend because allocation is stalled waiting for a mispredicted jump to retire or other branch-like conditions (e.g. the event is relevant during certain microcode flows). Counts all issue slots blocked while within this window including slots where uops were not available in the Instruction Queue.", 14 "PublicDescription": "Counts cycles that fetch is stalled due to an outstanding ITLB miss. That is, the decoder queue is able to accept bytes, but the fetch unit is unable to provide bytes due to an ITLB miss. Note: this event is not the same as page walk cycles to retrieve an instruction translation.",
15 "EventCode": "0xCA", 15 "EventCode": "0x86",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "UMask": "0x2", 17 "UMask": "0x1",
18 "EventName": "ISSUE_SLOTS_NOT_CONSUMED.RECOVERY", 18 "EventName": "FETCH_STALL.ITLB_FILL_PENDING_CYCLES",
19 "SampleAfterValue": "200003", 19 "SampleAfterValue": "200003",
20 "BriefDescription": "Unfilled issue slots per cycle to recover" 20 "BriefDescription": "Cycles code-fetch stalled due to an outstanding ITLB miss."
21 }, 21 },
22 { 22 {
23 "CollectPEBSRecord": "1", 23 "CollectPEBSRecord": "1",
@@ -30,14 +30,44 @@
30 "BriefDescription": "Unfilled issue slots per cycle" 30 "BriefDescription": "Unfilled issue slots per cycle"
31 }, 31 },
32 { 32 {
33 "CollectPEBSRecord": "1",
34 "PublicDescription": "Counts the number of issue slots per core cycle that were not consumed because of a full resource in the backend. Including but not limited to resources such as the Re-order Buffer (ROB), reservation stations (RS), load/store buffers, physical registers, or any other needed machine resource that is currently unavailable. Note that uops must be available for consumption in order for this event to fire. If a uop is not available (Instruction Queue is empty), this event will not count.",
35 "EventCode": "0xCA",
36 "Counter": "0,1,2,3",
37 "UMask": "0x1",
38 "EventName": "ISSUE_SLOTS_NOT_CONSUMED.RESOURCE_FULL",
39 "SampleAfterValue": "200003",
40 "BriefDescription": "Unfilled issue slots per cycle because of a full resource in the backend"
41 },
42 {
43 "CollectPEBSRecord": "1",
44 "PublicDescription": "Counts the number of issue slots per core cycle that were not consumed by the backend because allocation is stalled waiting for a mispredicted jump to retire or other branch-like conditions (e.g. the event is relevant during certain microcode flows). Counts all issue slots blocked while within this window including slots where uops were not available in the Instruction Queue.",
45 "EventCode": "0xCA",
46 "Counter": "0,1,2,3",
47 "UMask": "0x2",
48 "EventName": "ISSUE_SLOTS_NOT_CONSUMED.RECOVERY",
49 "SampleAfterValue": "200003",
50 "BriefDescription": "Unfilled issue slots per cycle to recover"
51 },
52 {
33 "CollectPEBSRecord": "2", 53 "CollectPEBSRecord": "2",
34 "PublicDescription": "Counts hardware interrupts received by the processor.", 54 "PublicDescription": "Counts hardware interrupts received by the processor.",
35 "EventCode": "0xCB", 55 "EventCode": "0xCB",
36 "Counter": "0,1,2,3", 56 "Counter": "0,1,2,3",
37 "UMask": "0x1", 57 "UMask": "0x1",
38 "EventName": "HW_INTERRUPTS.RECEIVED", 58 "EventName": "HW_INTERRUPTS.RECEIVED",
59 "SampleAfterValue": "203",
60 "BriefDescription": "Hardware interrupts received"
61 },
62 {
63 "CollectPEBSRecord": "2",
64 "PublicDescription": "Counts the number of core cycles during which interrupts are masked (disabled). Increments by 1 each core cycle that EFLAGS.IF is 0, regardless of whether interrupts are pending or not.",
65 "EventCode": "0xCB",
66 "Counter": "0,1,2,3",
67 "UMask": "0x2",
68 "EventName": "HW_INTERRUPTS.MASKED",
39 "SampleAfterValue": "200003", 69 "SampleAfterValue": "200003",
40 "BriefDescription": "Hardware interrupts received (Precise event capable)" 70 "BriefDescription": "Cycles hardware interrupts are masked"
41 }, 71 },
42 { 72 {
43 "CollectPEBSRecord": "2", 73 "CollectPEBSRecord": "2",
@@ -47,6 +77,6 @@
47 "UMask": "0x4", 77 "UMask": "0x4",
48 "EventName": "HW_INTERRUPTS.PENDING_AND_MASKED", 78 "EventName": "HW_INTERRUPTS.PENDING_AND_MASKED",
49 "SampleAfterValue": "200003", 79 "SampleAfterValue": "200003",
50 "BriefDescription": "Cycles pending interrupts are masked (Precise event capable)" 80 "BriefDescription": "Cycles pending interrupts are masked"
51 } 81 }
52] \ No newline at end of file 82] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/goldmont/pipeline.json b/tools/perf/pmu-events/arch/x86/goldmont/pipeline.json
index 07f00041f56f..254788af8ab6 100644
--- a/tools/perf/pmu-events/arch/x86/goldmont/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/goldmont/pipeline.json
@@ -1,168 +1,136 @@
1[ 1[
2 { 2 {
3 "PEBS": "2", 3 "PublicDescription": "Counts the number of instructions that retire execution. For instructions that consist of multiple uops, this event counts the retirement of the last uop of the instruction. The counter continues counting during hardware interrupts, traps, and inside interrupt handlers. This event uses fixed counter 0. You cannot collect a PEBs record for this event.",
4 "CollectPEBSRecord": "2", 4 "EventCode": "0x00",
5 "PublicDescription": "Counts branch instructions retired for all branch types. This is an architectural performance event.", 5 "Counter": "Fixed counter 0",
6 "EventCode": "0xC4", 6 "UMask": "0x1",
7 "Counter": "0,1,2,3", 7 "EventName": "INST_RETIRED.ANY",
8 "UMask": "0x0", 8 "SampleAfterValue": "2000003",
9 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 9 "BriefDescription": "Instructions retired (Fixed event)"
10 "SampleAfterValue": "200003",
11 "BriefDescription": "Retired branch instructions (Precise event capable)"
12 },
13 {
14 "PEBS": "2",
15 "CollectPEBSRecord": "2",
16 "PublicDescription": "Counts retired Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired, including both when the branch was taken and when it was not taken.",
17 "EventCode": "0xC4",
18 "Counter": "0,1,2,3",
19 "UMask": "0x7e",
20 "EventName": "BR_INST_RETIRED.JCC",
21 "SampleAfterValue": "200003",
22 "BriefDescription": "Retired conditional branch instructions (Precise event capable)"
23 }, 10 },
24 { 11 {
25 "PEBS": "2", 12 "PublicDescription": "Counts the number of core cycles while the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time to time. For this reason this event may have a changing ratio with regards to time. This event uses fixed counter 1. You cannot collect a PEBs record for this event.",
26 "CollectPEBSRecord": "2", 13 "EventCode": "0x00",
27 "PublicDescription": "Counts Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired that were taken and does not count when the Jcc branch instruction were not taken.", 14 "Counter": "Fixed counter 1",
28 "EventCode": "0xC4", 15 "UMask": "0x2",
29 "Counter": "0,1,2,3", 16 "EventName": "CPU_CLK_UNHALTED.CORE",
30 "UMask": "0xfe", 17 "SampleAfterValue": "2000003",
31 "EventName": "BR_INST_RETIRED.TAKEN_JCC", 18 "BriefDescription": "Core cycles when core is not halted (Fixed event)"
32 "SampleAfterValue": "200003",
33 "BriefDescription": "Retired conditional branch instructions that were taken (Precise event capable)"
34 }, 19 },
35 { 20 {
36 "PEBS": "2", 21 "PublicDescription": "Counts the number of reference cycles that the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time. This event is not affected by core frequency changes but counts as if the core is running at the maximum frequency all the time. This event uses fixed counter 2. You cannot collect a PEBs record for this event.",
37 "CollectPEBSRecord": "2", 22 "EventCode": "0x00",
38 "PublicDescription": "Counts near CALL branch instructions retired.", 23 "Counter": "Fixed counter 2",
39 "EventCode": "0xC4", 24 "UMask": "0x3",
40 "Counter": "0,1,2,3", 25 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
41 "UMask": "0xf9", 26 "SampleAfterValue": "2000003",
42 "EventName": "BR_INST_RETIRED.CALL", 27 "BriefDescription": "Reference cycles when core is not halted (Fixed event)"
43 "SampleAfterValue": "200003",
44 "BriefDescription": "Retired near call instructions (Precise event capable)"
45 }, 28 },
46 { 29 {
47 "PEBS": "2", 30 "PEBS": "2",
48 "CollectPEBSRecord": "2", 31 "CollectPEBSRecord": "2",
49 "PublicDescription": "Counts near relative CALL branch instructions retired.", 32 "PublicDescription": "Counts a load blocked from using a store forward, but did not occur because the store data was not available at the right time. The forward might occur subsequently when the data is available.",
50 "EventCode": "0xC4", 33 "EventCode": "0x03",
51 "Counter": "0,1,2,3", 34 "Counter": "0,1,2,3",
52 "UMask": "0xfd", 35 "UMask": "0x1",
53 "EventName": "BR_INST_RETIRED.REL_CALL", 36 "EventName": "LD_BLOCKS.DATA_UNKNOWN",
54 "SampleAfterValue": "200003", 37 "SampleAfterValue": "200003",
55 "BriefDescription": "Retired near relative call instructions (Precise event capable)" 38 "BriefDescription": "Loads blocked due to store data not ready (Precise event capable)"
56 }, 39 },
57 { 40 {
58 "PEBS": "2", 41 "PEBS": "2",
59 "CollectPEBSRecord": "2", 42 "CollectPEBSRecord": "2",
60 "PublicDescription": "Counts near indirect CALL branch instructions retired.", 43 "PublicDescription": "Counts a load blocked from using a store forward because of an address/size mismatch, only one of the loads blocked from each store will be counted.",
61 "EventCode": "0xC4", 44 "EventCode": "0x03",
62 "Counter": "0,1,2,3", 45 "Counter": "0,1,2,3",
63 "UMask": "0xfb", 46 "UMask": "0x2",
64 "EventName": "BR_INST_RETIRED.IND_CALL", 47 "EventName": "LD_BLOCKS.STORE_FORWARD",
65 "SampleAfterValue": "200003", 48 "SampleAfterValue": "200003",
66 "BriefDescription": "Retired near indirect call instructions (Precise event capable)" 49 "BriefDescription": "Loads blocked due to store forward restriction (Precise event capable)"
67 }, 50 },
68 { 51 {
69 "PEBS": "2", 52 "PEBS": "2",
70 "CollectPEBSRecord": "2", 53 "CollectPEBSRecord": "2",
71 "PublicDescription": "Counts near return branch instructions retired.", 54 "PublicDescription": "Counts loads that block because their address modulo 4K matches a pending store.",
72 "EventCode": "0xC4", 55 "EventCode": "0x03",
73 "Counter": "0,1,2,3", 56 "Counter": "0,1,2,3",
74 "UMask": "0xf7", 57 "UMask": "0x4",
75 "EventName": "BR_INST_RETIRED.RETURN", 58 "EventName": "LD_BLOCKS.4K_ALIAS",
76 "SampleAfterValue": "200003", 59 "SampleAfterValue": "200003",
77 "BriefDescription": "Retired near return instructions (Precise event capable)" 60 "BriefDescription": "Loads blocked because address has 4k partial address false dependence (Precise event capable)"
78 }, 61 },
79 { 62 {
80 "PEBS": "2", 63 "PEBS": "2",
81 "CollectPEBSRecord": "2", 64 "CollectPEBSRecord": "2",
82 "PublicDescription": "Counts near indirect call or near indirect jmp branch instructions retired.", 65 "PublicDescription": "Counts loads blocked because they are unable to find their physical address in the micro TLB (UTLB).",
83 "EventCode": "0xC4", 66 "EventCode": "0x03",
84 "Counter": "0,1,2,3", 67 "Counter": "0,1,2,3",
85 "UMask": "0xeb", 68 "UMask": "0x8",
86 "EventName": "BR_INST_RETIRED.NON_RETURN_IND", 69 "EventName": "LD_BLOCKS.UTLB_MISS",
87 "SampleAfterValue": "200003", 70 "SampleAfterValue": "200003",
88 "BriefDescription": "Retired instructions of near indirect Jmp or call (Precise event capable)" 71 "BriefDescription": "Loads blocked because address in not in the UTLB (Precise event capable)"
89 }, 72 },
90 { 73 {
91 "PEBS": "2", 74 "PEBS": "2",
92 "CollectPEBSRecord": "2", 75 "CollectPEBSRecord": "2",
93 "PublicDescription": "Counts far branch instructions retired. This includes far jump, far call and return, and Interrupt call and return.", 76 "PublicDescription": "Counts anytime a load that retires is blocked for any reason.",
94 "EventCode": "0xC4", 77 "EventCode": "0x03",
95 "Counter": "0,1,2,3", 78 "Counter": "0,1,2,3",
96 "UMask": "0xbf", 79 "UMask": "0x10",
97 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 80 "EventName": "LD_BLOCKS.ALL_BLOCK",
98 "SampleAfterValue": "200003", 81 "SampleAfterValue": "200003",
99 "BriefDescription": "Retired far branch instructions (Precise event capable)" 82 "BriefDescription": "Loads blocked (Precise event capable)"
100 }, 83 },
101 { 84 {
102 "PEBS": "2", 85 "CollectPEBSRecord": "1",
103 "CollectPEBSRecord": "2", 86 "PublicDescription": "Counts uops issued by the front end and allocated into the back end of the machine. This event counts uops that retire as well as uops that were speculatively executed but didn't retire. The sort of speculative uops that might be counted includes, but is not limited to those uops issued in the shadow of a miss-predicted branch, those uops that are inserted during an assist (such as for a denormal floating point result), and (previously allocated) uops that might be canceled during a machine clear.",
104 "PublicDescription": "Counts mispredicted branch instructions retired including all branch types.", 87 "EventCode": "0x0E",
105 "EventCode": "0xC5",
106 "Counter": "0,1,2,3", 88 "Counter": "0,1,2,3",
107 "UMask": "0x0", 89 "UMask": "0x0",
108 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES", 90 "EventName": "UOPS_ISSUED.ANY",
109 "SampleAfterValue": "200003",
110 "BriefDescription": "Retired mispredicted branch instructions (Precise event capable)"
111 },
112 {
113 "PEBS": "2",
114 "CollectPEBSRecord": "2",
115 "PublicDescription": "Counts mispredicted retired Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired, including both when the branch was supposed to be taken and when it was not supposed to be taken (but the processor predicted the opposite condition).",
116 "EventCode": "0xC5",
117 "Counter": "0,1,2,3",
118 "UMask": "0x7e",
119 "EventName": "BR_MISP_RETIRED.JCC",
120 "SampleAfterValue": "200003", 91 "SampleAfterValue": "200003",
121 "BriefDescription": "Retired mispredicted conditional branch instructions (Precise event capable)" 92 "BriefDescription": "Uops issued to the back end per cycle"
122 }, 93 },
123 { 94 {
124 "PEBS": "2", 95 "CollectPEBSRecord": "1",
125 "CollectPEBSRecord": "2", 96 "PublicDescription": "Core cycles when core is not halted. This event uses a (_P)rogrammable general purpose performance counter.",
126 "PublicDescription": "Counts mispredicted retired Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired that were supposed to be taken but the processor predicted that it would not be taken.", 97 "EventCode": "0x3C",
127 "EventCode": "0xC5",
128 "Counter": "0,1,2,3", 98 "Counter": "0,1,2,3",
129 "UMask": "0xfe", 99 "UMask": "0x0",
130 "EventName": "BR_MISP_RETIRED.TAKEN_JCC", 100 "EventName": "CPU_CLK_UNHALTED.CORE_P",
131 "SampleAfterValue": "200003", 101 "SampleAfterValue": "2000003",
132 "BriefDescription": "Retired mispredicted conditional branch instructions that were taken (Precise event capable)" 102 "BriefDescription": "Core cycles when core is not halted"
133 }, 103 },
134 { 104 {
135 "PEBS": "2", 105 "CollectPEBSRecord": "1",
136 "CollectPEBSRecord": "2", 106 "PublicDescription": "Reference cycles when core is not halted. This event uses a programmable general purpose performance counter.",
137 "PublicDescription": "Counts mispredicted near indirect CALL branch instructions retired, where the target address taken was not what the processor predicted.", 107 "EventCode": "0x3C",
138 "EventCode": "0xC5",
139 "Counter": "0,1,2,3", 108 "Counter": "0,1,2,3",
140 "UMask": "0xfb", 109 "UMask": "0x1",
141 "EventName": "BR_MISP_RETIRED.IND_CALL", 110 "EventName": "CPU_CLK_UNHALTED.REF",
142 "SampleAfterValue": "200003", 111 "SampleAfterValue": "2000003",
143 "BriefDescription": "Retired mispredicted near indirect call instructions (Precise event capable)" 112 "BriefDescription": "Reference cycles when core is not halted"
144 }, 113 },
145 { 114 {
146 "PEBS": "2", 115 "CollectPEBSRecord": "1",
147 "CollectPEBSRecord": "2", 116 "PublicDescription": "This event used to measure front-end inefficiencies. I.e. when front-end of the machine is not delivering uops to the back-end and the back-end has is not stalled. This event can be used to identify if the machine is truly front-end bound. When this event occurs, it is an indication that the front-end of the machine is operating at less than its theoretical peak performance. Background: We can think of the processor pipeline as being divided into 2 broader parts: Front-end and Back-end. Front-end is responsible for fetching the instruction, decoding into uops in machine understandable format and putting them into a uop queue to be consumed by back end. The back-end then takes these uops, allocates the required resources. When all resources are ready, uops are executed. If the back-end is not ready to accept uops from the front-end, then we do not want to count these as front-end bottlenecks. However, whenever we have bottlenecks in the back-end, we will have allocation unit stalls and eventually forcing the front-end to wait until the back-end is ready to receive more uops. This event counts only when back-end is requesting more uops and front-end is not able to provide them. When 3 uops are requested and no uops are delivered, the event counts 3. When 3 are requested, and only 1 is delivered, the event counts 2. When only 2 are delivered, the event counts 1. Alternatively stated, the event will not count if 3 uops are delivered, or if the back end is stalled and not requesting any uops at all. Counts indicate missed opportunities for the front-end to deliver a uop to the back end. Some examples of conditions that cause front-end efficiencies are: ICache misses, ITLB misses, and decoder restrictions that limit the front-end bandwidth. Known Issues: Some uops require multiple allocation slots. These uops will not be charged as a front end 'not delivered' opportunity, and will be regarded as a back end problem. For example, the INC instruction has one uop that requires 2 issue slots. A stream of INC instructions will not count as UOPS_NOT_DELIVERED, even though only one instruction can be issued per clock. The low uop issue rate for a stream of INC instructions is considered to be a back end issue.",
148 "PublicDescription": "Counts mispredicted near RET branch instructions retired, where the return address taken was not what the processor predicted.", 117 "EventCode": "0x9C",
149 "EventCode": "0xC5",
150 "Counter": "0,1,2,3", 118 "Counter": "0,1,2,3",
151 "UMask": "0xf7", 119 "UMask": "0x0",
152 "EventName": "BR_MISP_RETIRED.RETURN", 120 "EventName": "UOPS_NOT_DELIVERED.ANY",
153 "SampleAfterValue": "200003", 121 "SampleAfterValue": "200003",
154 "BriefDescription": "Retired mispredicted near return instructions (Precise event capable)" 122 "BriefDescription": "Uops requested but not-delivered to the back-end per cycle"
155 }, 123 },
156 { 124 {
157 "PEBS": "2", 125 "PEBS": "2",
158 "CollectPEBSRecord": "2", 126 "CollectPEBSRecord": "1",
159 "PublicDescription": "Counts mispredicted branch instructions retired that were near indirect call or near indirect jmp, where the target address taken was not what the processor predicted.", 127 "PublicDescription": "Counts the number of instructions that retire execution. For instructions that consist of multiple uops, this event counts the retirement of the last uop of the instruction. The event continues counting during hardware interrupts, traps, and inside interrupt handlers. This is an architectural performance event. This event uses a (_P)rogrammable general purpose performance counter. *This event is Precise Event capable: The EventingRIP field in the PEBS record is precise to the address of the instruction which caused the event. Note: Because PEBS records can be collected only on IA32_PMC0, only one event can use the PEBS facility at a time.",
160 "EventCode": "0xC5", 128 "EventCode": "0xC0",
161 "Counter": "0,1,2,3", 129 "Counter": "0,1,2,3",
162 "UMask": "0xeb", 130 "UMask": "0x0",
163 "EventName": "BR_MISP_RETIRED.NON_RETURN_IND", 131 "EventName": "INST_RETIRED.ANY_P",
164 "SampleAfterValue": "200003", 132 "SampleAfterValue": "2000003",
165 "BriefDescription": "Retired mispredicted instructions of near indirect Jmp or near indirect call. (Precise event capable)" 133 "BriefDescription": "Instructions retired (Precise event capable)"
166 }, 134 },
167 { 135 {
168 "PEBS": "2", 136 "PEBS": "2",
@@ -187,8 +155,40 @@
187 "BriefDescription": "MS uops retired (Precise event capable)" 155 "BriefDescription": "MS uops retired (Precise event capable)"
188 }, 156 },
189 { 157 {
158 "PEBS": "2",
159 "CollectPEBSRecord": "1",
160 "PublicDescription": "Counts the number of floating point divide uops retired.",
161 "EventCode": "0xC2",
162 "Counter": "0,1,2,3",
163 "UMask": "0x8",
164 "EventName": "UOPS_RETIRED.FPDIV",
165 "SampleAfterValue": "2000003",
166 "BriefDescription": "Floating point divide uops retired. (Precise Event Capable)"
167 },
168 {
169 "PEBS": "2",
170 "CollectPEBSRecord": "1",
171 "PublicDescription": "Counts the number of integer divide uops retired.",
172 "EventCode": "0xC2",
173 "Counter": "0,1,2,3",
174 "UMask": "0x10",
175 "EventName": "UOPS_RETIRED.IDIV",
176 "SampleAfterValue": "2000003",
177 "BriefDescription": "Integer divide uops retired. (Precise Event Capable)"
178 },
179 {
190 "CollectPEBSRecord": "1", 180 "CollectPEBSRecord": "1",
191 "PublicDescription": "Counts the number of times that the processor detects that a program is writing to a code section and has to perform a machine clear because of that modification. Self-modifying code (SMC) causes a severe penalty in all Intel? architecture processors.", 181 "PublicDescription": "Counts machine clears for any reason.",
182 "EventCode": "0xC3",
183 "Counter": "0,1,2,3",
184 "UMask": "0x0",
185 "EventName": "MACHINE_CLEARS.ALL",
186 "SampleAfterValue": "200003",
187 "BriefDescription": "All machine clears"
188 },
189 {
190 "CollectPEBSRecord": "1",
191 "PublicDescription": "Counts the number of times that the processor detects that a program is writing to a code section and has to perform a machine clear because of that modification. Self-modifying code (SMC) causes a severe penalty in all Intel architecture processors.",
192 "EventCode": "0xC3", 192 "EventCode": "0xC3",
193 "Counter": "0,1,2,3", 193 "Counter": "0,1,2,3",
194 "UMask": "0x1", 194 "UMask": "0x1",
@@ -217,217 +217,239 @@
217 "BriefDescription": "Machine clears due to memory disambiguation" 217 "BriefDescription": "Machine clears due to memory disambiguation"
218 }, 218 },
219 { 219 {
220 "CollectPEBSRecord": "1", 220 "PEBS": "2",
221 "PublicDescription": "Counts machine clears for any reason.", 221 "CollectPEBSRecord": "2",
222 "EventCode": "0xC3", 222 "PublicDescription": "Counts branch instructions retired for all branch types. This is an architectural performance event.",
223 "EventCode": "0xC4",
223 "Counter": "0,1,2,3", 224 "Counter": "0,1,2,3",
224 "UMask": "0x0", 225 "UMask": "0x0",
225 "EventName": "MACHINE_CLEARS.ALL", 226 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
226 "SampleAfterValue": "200003", 227 "SampleAfterValue": "200003",
227 "BriefDescription": "All machine clears" 228 "BriefDescription": "Retired branch instructions (Precise event capable)"
228 }, 229 },
229 { 230 {
230 "PEBS": "2", 231 "PEBS": "2",
231 "CollectPEBSRecord": "1", 232 "CollectPEBSRecord": "2",
232 "PublicDescription": "Counts the number of instructions that retire execution. For instructions that consist of multiple uops, this event counts the retirement of the last uop of the instruction. The event continues counting during hardware interrupts, traps, and inside interrupt handlers. This is an architectural performance event. This event uses a (_P)rogrammable general purpose performance counter. *This event is Precise Event capable: The EventingRIP field in the PEBS record is precise to the address of the instruction which caused the event. Note: Because PEBS records can be collected only on IA32_PMC0, only one event can use the PEBS facility at a time.", 233 "PublicDescription": "Counts retired Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired, including both when the branch was taken and when it was not taken.",
233 "EventCode": "0xC0", 234 "EventCode": "0xC4",
234 "Counter": "0,1,2,3", 235 "Counter": "0,1,2,3",
235 "UMask": "0x0", 236 "UMask": "0x7e",
236 "EventName": "INST_RETIRED.ANY_P", 237 "EventName": "BR_INST_RETIRED.JCC",
237 "SampleAfterValue": "2000003", 238 "SampleAfterValue": "200003",
238 "BriefDescription": "Instructions retired (Precise event capable)" 239 "BriefDescription": "Retired conditional branch instructions (Precise event capable)"
239 }, 240 },
240 { 241 {
242 "PEBS": "2",
241 "CollectPEBSRecord": "1", 243 "CollectPEBSRecord": "1",
242 "PublicDescription": "This event used to measure front-end inefficiencies. I.e. when front-end of the machine is not delivering uops to the back-end and the back-end has is not stalled. This event can be used to identify if the machine is truly front-end bound. When this event occurs, it is an indication that the front-end of the machine is operating at less than its theoretical peak performance. Background: We can think of the processor pipeline as being divided into 2 broader parts: Front-end and Back-end. Front-end is responsible for fetching the instruction, decoding into uops in machine understandable format and putting them into a uop queue to be consumed by back end. The back-end then takes these uops, allocates the required resources. When all resources are ready, uops are executed. If the back-end is not ready to accept uops from the front-end, then we do not want to count these as front-end bottlenecks. However, whenever we have bottlenecks in the back-end, we will have allocation unit stalls and eventually forcing the front-end to wait until the back-end is ready to receive more uops. This event counts only when back-end is requesting more uops and front-end is not able to provide them. When 3 uops are requested and no uops are delivered, the event counts 3. When 3 are requested, and only 1 is delivered, the event counts 2. When only 2 are delivered, the event counts 1. Alternatively stated, the event will not count if 3 uops are delivered, or if the back end is stalled and not requesting any uops at all. Counts indicate missed opportunities for the front-end to deliver a uop to the back end. Some examples of conditions that cause front-end efficiencies are: ICache misses, ITLB misses, and decoder restrictions that limit the front-end bandwidth. Known Issues: Some uops require multiple allocation slots. These uops will not be charged as a front end 'not delivered' opportunity, and will be regarded as a back end problem. For example, the INC instruction has one uop that requires 2 issue slots. A stream of INC instructions will not count as UOPS_NOT_DELIVERED, even though only one instruction can be issued per clock. The low uop issue rate for a stream of INC instructions is considered to be a back end issue.", 244 "PublicDescription": "Counts the number of taken branch instructions retired.",
243 "EventCode": "0x9C", 245 "EventCode": "0xC4",
244 "Counter": "0,1,2,3", 246 "Counter": "0,1,2,3",
245 "UMask": "0x0", 247 "UMask": "0x80",
246 "EventName": "UOPS_NOT_DELIVERED.ANY", 248 "EventName": "BR_INST_RETIRED.ALL_TAKEN_BRANCHES",
247 "SampleAfterValue": "200003", 249 "SampleAfterValue": "200003",
248 "BriefDescription": "Uops requested but not-delivered to the back-end per cycle" 250 "BriefDescription": "Retired taken branch instructions (Precise event capable)"
249 }, 251 },
250 { 252 {
251 "CollectPEBSRecord": "1", 253 "PEBS": "2",
252 "PublicDescription": "Counts uops issued by the front end and allocated into the back end of the machine. This event counts uops that retire as well as uops that were speculatively executed but didn't retire. The sort of speculative uops that might be counted includes, but is not limited to those uops issued in the shadow of a miss-predicted branch, those uops that are inserted during an assist (such as for a denormal floating point result), and (previously allocated) uops that might be canceled during a machine clear.", 254 "CollectPEBSRecord": "2",
253 "EventCode": "0x0E", 255 "PublicDescription": "Counts far branch instructions retired. This includes far jump, far call and return, and Interrupt call and return.",
256 "EventCode": "0xC4",
254 "Counter": "0,1,2,3", 257 "Counter": "0,1,2,3",
255 "UMask": "0x0", 258 "UMask": "0xbf",
256 "EventName": "UOPS_ISSUED.ANY", 259 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
257 "SampleAfterValue": "200003", 260 "SampleAfterValue": "200003",
258 "BriefDescription": "Uops issued to the back end per cycle" 261 "BriefDescription": "Retired far branch instructions (Precise event capable)"
259 }, 262 },
260 { 263 {
261 "CollectPEBSRecord": "1", 264 "PEBS": "2",
262 "PublicDescription": "Counts core cycles if either divide unit is busy.", 265 "CollectPEBSRecord": "2",
263 "EventCode": "0xCD", 266 "PublicDescription": "Counts near indirect call or near indirect jmp branch instructions retired.",
267 "EventCode": "0xC4",
264 "Counter": "0,1,2,3", 268 "Counter": "0,1,2,3",
265 "UMask": "0x0", 269 "UMask": "0xeb",
266 "EventName": "CYCLES_DIV_BUSY.ALL", 270 "EventName": "BR_INST_RETIRED.NON_RETURN_IND",
267 "SampleAfterValue": "2000003", 271 "SampleAfterValue": "200003",
268 "BriefDescription": "Cycles a divider is busy" 272 "BriefDescription": "Retired instructions of near indirect Jmp or call (Precise event capable)"
269 }, 273 },
270 { 274 {
271 "CollectPEBSRecord": "1", 275 "PEBS": "2",
272 "PublicDescription": "Counts core cycles the integer divide unit is busy.", 276 "CollectPEBSRecord": "2",
273 "EventCode": "0xCD", 277 "PublicDescription": "Counts near return branch instructions retired.",
278 "EventCode": "0xC4",
274 "Counter": "0,1,2,3", 279 "Counter": "0,1,2,3",
275 "UMask": "0x1", 280 "UMask": "0xf7",
276 "EventName": "CYCLES_DIV_BUSY.IDIV", 281 "EventName": "BR_INST_RETIRED.RETURN",
277 "SampleAfterValue": "200003", 282 "SampleAfterValue": "200003",
278 "BriefDescription": "Cycles the integer divide unit is busy" 283 "BriefDescription": "Retired near return instructions (Precise event capable)"
279 }, 284 },
280 { 285 {
281 "CollectPEBSRecord": "1", 286 "PEBS": "2",
282 "PublicDescription": "Counts core cycles the floating point divide unit is busy.", 287 "CollectPEBSRecord": "2",
283 "EventCode": "0xCD", 288 "PublicDescription": "Counts near CALL branch instructions retired.",
289 "EventCode": "0xC4",
284 "Counter": "0,1,2,3", 290 "Counter": "0,1,2,3",
285 "UMask": "0x2", 291 "UMask": "0xf9",
286 "EventName": "CYCLES_DIV_BUSY.FPDIV", 292 "EventName": "BR_INST_RETIRED.CALL",
287 "SampleAfterValue": "200003", 293 "SampleAfterValue": "200003",
288 "BriefDescription": "Cycles the FP divide unit is busy" 294 "BriefDescription": "Retired near call instructions (Precise event capable)"
289 }, 295 },
290 { 296 {
291 "PublicDescription": "Counts the number of instructions that retire execution. For instructions that consist of multiple uops, this event counts the retirement of the last uop of the instruction. The counter continues counting during hardware interrupts, traps, and inside interrupt handlers. This event uses fixed counter 0. You cannot collect a PEBs record for this event.", 297 "PEBS": "2",
292 "EventCode": "0x00", 298 "CollectPEBSRecord": "2",
293 "Counter": "Fixed counter 1", 299 "PublicDescription": "Counts near indirect CALL branch instructions retired.",
294 "UMask": "0x1", 300 "EventCode": "0xC4",
295 "EventName": "INST_RETIRED.ANY", 301 "Counter": "0,1,2,3",
296 "SampleAfterValue": "2000003", 302 "UMask": "0xfb",
297 "BriefDescription": "Instructions retired (Fixed event)" 303 "EventName": "BR_INST_RETIRED.IND_CALL",
304 "SampleAfterValue": "200003",
305 "BriefDescription": "Retired near indirect call instructions (Precise event capable)"
298 }, 306 },
299 { 307 {
300 "PublicDescription": "Counts the number of core cycles while the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time to time. For this reason this event may have a changing ratio with regards to time. This event uses fixed counter 1. You cannot collect a PEBs record for this event.", 308 "PEBS": "2",
301 "EventCode": "0x00", 309 "CollectPEBSRecord": "2",
302 "Counter": "Fixed counter 2", 310 "PublicDescription": "Counts near relative CALL branch instructions retired.",
303 "UMask": "0x2", 311 "EventCode": "0xC4",
304 "EventName": "CPU_CLK_UNHALTED.CORE", 312 "Counter": "0,1,2,3",
305 "SampleAfterValue": "2000003", 313 "UMask": "0xfd",
306 "BriefDescription": "Core cycles when core is not halted (Fixed event)" 314 "EventName": "BR_INST_RETIRED.REL_CALL",
315 "SampleAfterValue": "200003",
316 "BriefDescription": "Retired near relative call instructions (Precise event capable)"
307 }, 317 },
308 { 318 {
309 "PublicDescription": "Counts the number of reference cycles that the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time. This event is not affected by core frequency changes but counts as if the core is running at the maximum frequency all the time. This event uses fixed counter 2. You cannot collect a PEBs record for this event.", 319 "PEBS": "2",
310 "EventCode": "0x00", 320 "CollectPEBSRecord": "2",
311 "Counter": "Fixed counter 3", 321 "PublicDescription": "Counts Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired that were taken and does not count when the Jcc branch instruction were not taken.",
312 "UMask": "0x3", 322 "EventCode": "0xC4",
313 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 323 "Counter": "0,1,2,3",
314 "SampleAfterValue": "2000003", 324 "UMask": "0xfe",
315 "BriefDescription": "Reference cycles when core is not halted (Fixed event)" 325 "EventName": "BR_INST_RETIRED.TAKEN_JCC",
326 "SampleAfterValue": "200003",
327 "BriefDescription": "Retired conditional branch instructions that were taken (Precise event capable)"
316 }, 328 },
317 { 329 {
318 "CollectPEBSRecord": "1", 330 "PEBS": "2",
319 "PublicDescription": "Core cycles when core is not halted. This event uses a (_P)rogrammable general purpose performance counter.", 331 "CollectPEBSRecord": "2",
320 "EventCode": "0x3C", 332 "PublicDescription": "Counts mispredicted branch instructions retired including all branch types.",
333 "EventCode": "0xC5",
321 "Counter": "0,1,2,3", 334 "Counter": "0,1,2,3",
322 "UMask": "0x0", 335 "UMask": "0x0",
323 "EventName": "CPU_CLK_UNHALTED.CORE_P", 336 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES",
324 "SampleAfterValue": "2000003", 337 "SampleAfterValue": "200003",
325 "BriefDescription": "Core cycles when core is not halted" 338 "BriefDescription": "Retired mispredicted branch instructions (Precise event capable)"
326 }, 339 },
327 { 340 {
328 "CollectPEBSRecord": "1", 341 "PEBS": "2",
329 "PublicDescription": "Reference cycles when core is not halted. This event uses a (_P)rogrammable general purpose performance counter.", 342 "CollectPEBSRecord": "2",
330 "EventCode": "0x3C", 343 "PublicDescription": "Counts mispredicted retired Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired, including both when the branch was supposed to be taken and when it was not supposed to be taken (but the processor predicted the opposite condition).",
344 "EventCode": "0xC5",
331 "Counter": "0,1,2,3", 345 "Counter": "0,1,2,3",
332 "UMask": "0x1", 346 "UMask": "0x7e",
333 "EventName": "CPU_CLK_UNHALTED.REF", 347 "EventName": "BR_MISP_RETIRED.JCC",
334 "SampleAfterValue": "2000003", 348 "SampleAfterValue": "200003",
335 "BriefDescription": "Reference cycles when core is not halted" 349 "BriefDescription": "Retired mispredicted conditional branch instructions (Precise event capable)"
336 }, 350 },
337 { 351 {
338 "CollectPEBSRecord": "1", 352 "PEBS": "2",
339 "PublicDescription": "Counts the number of times a BACLEAR is signaled for any reason, including, but not limited to indirect branch/call, Jcc (Jump on Conditional Code/Jump if Condition is Met) branch, unconditional branch/call, and returns.", 353 "CollectPEBSRecord": "2",
340 "EventCode": "0xE6", 354 "PublicDescription": "Counts mispredicted branch instructions retired that were near indirect call or near indirect jmp, where the target address taken was not what the processor predicted.",
355 "EventCode": "0xC5",
341 "Counter": "0,1,2,3", 356 "Counter": "0,1,2,3",
342 "UMask": "0x1", 357 "UMask": "0xeb",
343 "EventName": "BACLEARS.ALL", 358 "EventName": "BR_MISP_RETIRED.NON_RETURN_IND",
344 "SampleAfterValue": "200003", 359 "SampleAfterValue": "200003",
345 "BriefDescription": "BACLEARs asserted for any branch type" 360 "BriefDescription": "Retired mispredicted instructions of near indirect Jmp or near indirect call. (Precise event capable)"
346 }, 361 },
347 { 362 {
348 "CollectPEBSRecord": "1", 363 "PEBS": "2",
349 "PublicDescription": "Counts BACLEARS on return instructions.", 364 "CollectPEBSRecord": "2",
350 "EventCode": "0xE6", 365 "PublicDescription": "Counts mispredicted near RET branch instructions retired, where the return address taken was not what the processor predicted.",
366 "EventCode": "0xC5",
351 "Counter": "0,1,2,3", 367 "Counter": "0,1,2,3",
352 "UMask": "0x8", 368 "UMask": "0xf7",
353 "EventName": "BACLEARS.RETURN", 369 "EventName": "BR_MISP_RETIRED.RETURN",
354 "SampleAfterValue": "200003", 370 "SampleAfterValue": "200003",
355 "BriefDescription": "BACLEARs asserted for return branch" 371 "BriefDescription": "Retired mispredicted near return instructions (Precise event capable)"
356 }, 372 },
357 { 373 {
358 "CollectPEBSRecord": "1", 374 "PEBS": "2",
359 "PublicDescription": "Counts BACLEARS on Jcc (Jump on Conditional Code/Jump if Condition is Met) branches.", 375 "CollectPEBSRecord": "2",
360 "EventCode": "0xE6", 376 "PublicDescription": "Counts mispredicted near indirect CALL branch instructions retired, where the target address taken was not what the processor predicted.",
377 "EventCode": "0xC5",
361 "Counter": "0,1,2,3", 378 "Counter": "0,1,2,3",
362 "UMask": "0x10", 379 "UMask": "0xfb",
363 "EventName": "BACLEARS.COND", 380 "EventName": "BR_MISP_RETIRED.IND_CALL",
364 "SampleAfterValue": "200003", 381 "SampleAfterValue": "200003",
365 "BriefDescription": "BACLEARs asserted for conditional branch" 382 "BriefDescription": "Retired mispredicted near indirect call instructions (Precise event capable)"
366 }, 383 },
367 { 384 {
368 "PEBS": "2", 385 "PEBS": "2",
369 "CollectPEBSRecord": "2", 386 "CollectPEBSRecord": "2",
370 "PublicDescription": "Counts anytime a load that retires is blocked for any reason.", 387 "PublicDescription": "Counts mispredicted retired Jcc (Jump on Conditional Code/Jump if Condition is Met) branch instructions retired that were supposed to be taken but the processor predicted that it would not be taken.",
371 "EventCode": "0x03", 388 "EventCode": "0xC5",
372 "Counter": "0,1,2,3", 389 "Counter": "0,1,2,3",
373 "UMask": "0x10", 390 "UMask": "0xfe",
374 "EventName": "LD_BLOCKS.ALL_BLOCK", 391 "EventName": "BR_MISP_RETIRED.TAKEN_JCC",
375 "SampleAfterValue": "200003", 392 "SampleAfterValue": "200003",
376 "BriefDescription": "Loads blocked (Precise event capable)" 393 "BriefDescription": "Retired mispredicted conditional branch instructions that were taken (Precise event capable)"
377 }, 394 },
378 { 395 {
379 "PEBS": "2", 396 "CollectPEBSRecord": "1",
380 "CollectPEBSRecord": "2", 397 "PublicDescription": "Counts core cycles if either divide unit is busy.",
381 "PublicDescription": "Counts loads blocked because they are unable to find their physical address in the micro TLB (UTLB).", 398 "EventCode": "0xCD",
382 "EventCode": "0x03",
383 "Counter": "0,1,2,3", 399 "Counter": "0,1,2,3",
384 "UMask": "0x8", 400 "UMask": "0x0",
385 "EventName": "LD_BLOCKS.UTLB_MISS", 401 "EventName": "CYCLES_DIV_BUSY.ALL",
402 "SampleAfterValue": "2000003",
403 "BriefDescription": "Cycles a divider is busy"
404 },
405 {
406 "CollectPEBSRecord": "1",
407 "PublicDescription": "Counts core cycles the integer divide unit is busy.",
408 "EventCode": "0xCD",
409 "Counter": "0,1,2,3",
410 "UMask": "0x1",
411 "EventName": "CYCLES_DIV_BUSY.IDIV",
386 "SampleAfterValue": "200003", 412 "SampleAfterValue": "200003",
387 "BriefDescription": "Loads blocked because address in not in the UTLB (Precise event capable)" 413 "BriefDescription": "Cycles the integer divide unit is busy"
388 }, 414 },
389 { 415 {
390 "PEBS": "2", 416 "CollectPEBSRecord": "1",
391 "CollectPEBSRecord": "2", 417 "PublicDescription": "Counts core cycles the floating point divide unit is busy.",
392 "PublicDescription": "Counts a load blocked from using a store forward because of an address/size mismatch, only one of the loads blocked from each store will be counted.", 418 "EventCode": "0xCD",
393 "EventCode": "0x03",
394 "Counter": "0,1,2,3", 419 "Counter": "0,1,2,3",
395 "UMask": "0x2", 420 "UMask": "0x2",
396 "EventName": "LD_BLOCKS.STORE_FORWARD", 421 "EventName": "CYCLES_DIV_BUSY.FPDIV",
397 "SampleAfterValue": "200003", 422 "SampleAfterValue": "200003",
398 "BriefDescription": "Loads blocked due to store forward restriction (Precise event capable)" 423 "BriefDescription": "Cycles the FP divide unit is busy"
399 }, 424 },
400 { 425 {
401 "PEBS": "2", 426 "CollectPEBSRecord": "1",
402 "CollectPEBSRecord": "2", 427 "PublicDescription": "Counts the number of times a BACLEAR is signaled for any reason, including, but not limited to indirect branch/call, Jcc (Jump on Conditional Code/Jump if Condition is Met) branch, unconditional branch/call, and returns.",
403 "PublicDescription": "Counts a load blocked from using a store forward, but did not occur because the store data was not available at the right time. The forward might occur subsequently when the data is available.", 428 "EventCode": "0xE6",
404 "EventCode": "0x03",
405 "Counter": "0,1,2,3", 429 "Counter": "0,1,2,3",
406 "UMask": "0x1", 430 "UMask": "0x1",
407 "EventName": "LD_BLOCKS.DATA_UNKNOWN", 431 "EventName": "BACLEARS.ALL",
408 "SampleAfterValue": "200003", 432 "SampleAfterValue": "200003",
409 "BriefDescription": "Loads blocked due to store data not ready (Precise event capable)" 433 "BriefDescription": "BACLEARs asserted for any branch type"
410 }, 434 },
411 { 435 {
412 "PEBS": "2", 436 "CollectPEBSRecord": "1",
413 "CollectPEBSRecord": "2", 437 "PublicDescription": "Counts BACLEARS on return instructions.",
414 "PublicDescription": "Counts loads that block because their address modulo 4K matches a pending store.", 438 "EventCode": "0xE6",
415 "EventCode": "0x03",
416 "Counter": "0,1,2,3", 439 "Counter": "0,1,2,3",
417 "UMask": "0x4", 440 "UMask": "0x8",
418 "EventName": "LD_BLOCKS.4K_ALIAS", 441 "EventName": "BACLEARS.RETURN",
419 "SampleAfterValue": "200003", 442 "SampleAfterValue": "200003",
420 "BriefDescription": "Loads blocked because address has 4k partial address false dependence (Precise event capable)" 443 "BriefDescription": "BACLEARs asserted for return branch"
421 }, 444 },
422 { 445 {
423 "PEBS": "2",
424 "CollectPEBSRecord": "1", 446 "CollectPEBSRecord": "1",
425 "PublicDescription": "Counts the number of taken branch instructions retired.", 447 "PublicDescription": "Counts BACLEARS on Jcc (Jump on Conditional Code/Jump if Condition is Met) branches.",
426 "EventCode": "0xC4", 448 "EventCode": "0xE6",
427 "Counter": "0,1,2,3", 449 "Counter": "0,1,2,3",
428 "UMask": "0x80", 450 "UMask": "0x10",
429 "EventName": "BR_INST_RETIRED.ALL_TAKEN_BRANCHES", 451 "EventName": "BACLEARS.COND",
430 "SampleAfterValue": "200003", 452 "SampleAfterValue": "200003",
431 "BriefDescription": "Retired taken branch instructions (Precise event capable)" 453 "BriefDescription": "BACLEARs asserted for conditional branch"
432 } 454 }
433] \ No newline at end of file 455] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/goldmont/virtual-memory.json b/tools/perf/pmu-events/arch/x86/goldmont/virtual-memory.json
index 3202c4478836..9805198d3f5f 100644
--- a/tools/perf/pmu-events/arch/x86/goldmont/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/goldmont/virtual-memory.json
@@ -1,6 +1,36 @@
1[ 1[
2 { 2 {
3 "CollectPEBSRecord": "1", 3 "CollectPEBSRecord": "1",
4 "PublicDescription": "Counts every core cycle when a Data-side (walks due to a data operation) page walk is in progress.",
5 "EventCode": "0x05",
6 "Counter": "0,1,2,3",
7 "UMask": "0x1",
8 "EventName": "PAGE_WALKS.D_SIDE_CYCLES",
9 "SampleAfterValue": "200003",
10 "BriefDescription": "Duration of D-side page-walks in cycles"
11 },
12 {
13 "CollectPEBSRecord": "1",
14 "PublicDescription": "Counts every core cycle when a Instruction-side (walks due to an instruction fetch) page walk is in progress.",
15 "EventCode": "0x05",
16 "Counter": "0,1,2,3",
17 "UMask": "0x2",
18 "EventName": "PAGE_WALKS.I_SIDE_CYCLES",
19 "SampleAfterValue": "200003",
20 "BriefDescription": "Duration of I-side pagewalks in cycles"
21 },
22 {
23 "CollectPEBSRecord": "1",
24 "PublicDescription": "Counts every core cycle a page-walk is in progress due to either a data memory operation or an instruction fetch.",
25 "EventCode": "0x05",
26 "Counter": "0,1,2,3",
27 "UMask": "0x3",
28 "EventName": "PAGE_WALKS.CYCLES",
29 "SampleAfterValue": "200003",
30 "BriefDescription": "Duration of page-walks in cycles"
31 },
32 {
33 "CollectPEBSRecord": "1",
4 "PublicDescription": "Counts the number of times the machine was unable to find a translation in the Instruction Translation Lookaside Buffer (ITLB) for a linear address of an instruction fetch. It counts when new translation are filled into the ITLB. The event is speculative in nature, but will not count translations (page walks) that are begun and not finished, or translations that are finished but not filled into the ITLB.", 34 "PublicDescription": "Counts the number of times the machine was unable to find a translation in the Instruction Translation Lookaside Buffer (ITLB) for a linear address of an instruction fetch. It counts when new translation are filled into the ITLB. The event is speculative in nature, but will not count translations (page walks) that are begun and not finished, or translations that are finished but not filled into the ITLB.",
5 "EventCode": "0x81", 35 "EventCode": "0x81",
6 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
@@ -41,35 +71,5 @@
41 "EventName": "MEM_UOPS_RETIRED.DTLB_MISS", 71 "EventName": "MEM_UOPS_RETIRED.DTLB_MISS",
42 "SampleAfterValue": "200003", 72 "SampleAfterValue": "200003",
43 "BriefDescription": "Memory uops retired that missed the DTLB (Precise event capable)" 73 "BriefDescription": "Memory uops retired that missed the DTLB (Precise event capable)"
44 },
45 {
46 "CollectPEBSRecord": "1",
47 "PublicDescription": "Counts every core cycle when a Data-side (walks due to a data operation) page walk is in progress.",
48 "EventCode": "0x05",
49 "Counter": "0,1,2,3",
50 "UMask": "0x1",
51 "EventName": "PAGE_WALKS.D_SIDE_CYCLES",
52 "SampleAfterValue": "200003",
53 "BriefDescription": "Duration of D-side page-walks in cycles"
54 },
55 {
56 "CollectPEBSRecord": "1",
57 "PublicDescription": "Counts every core cycle when a Instruction-side (walks due to an instruction fetch) page walk is in progress.",
58 "EventCode": "0x05",
59 "Counter": "0,1,2,3",
60 "UMask": "0x2",
61 "EventName": "PAGE_WALKS.I_SIDE_CYCLES",
62 "SampleAfterValue": "200003",
63 "BriefDescription": "Duration of I-side pagewalks in cycles"
64 },
65 {
66 "CollectPEBSRecord": "1",
67 "PublicDescription": "Counts every core cycle a page-walk is in progress due to either a data memory operation or an instruction fetch.",
68 "EventCode": "0x05",
69 "Counter": "0,1,2,3",
70 "UMask": "0x3",
71 "EventName": "PAGE_WALKS.CYCLES",
72 "SampleAfterValue": "200003",
73 "BriefDescription": "Duration of page-walks in cycles"
74 } 74 }
75] \ No newline at end of file 75] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswell/cache.json b/tools/perf/pmu-events/arch/x86/haswell/cache.json
index bfb5ebf48c54..da4d6ddd4f92 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/cache.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/cache.json
@@ -11,14 +11,34 @@
11 "CounterHTOff": "0,1,2,3,4,5,6,7" 11 "CounterHTOff": "0,1,2,3,4,5,6,7"
12 }, 12 },
13 { 13 {
14 "PublicDescription": "Demand data read requests that hit L2 cache.", 14 "PublicDescription": "Counts the number of store RFO requests that miss the L2 cache.",
15 "EventCode": "0x24", 15 "EventCode": "0x24",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "UMask": "0x41", 17 "UMask": "0x22",
18 "EventName": "L2_RQSTS.RFO_MISS",
19 "SampleAfterValue": "200003",
20 "BriefDescription": "RFO requests that miss L2 cache",
21 "CounterHTOff": "0,1,2,3,4,5,6,7"
22 },
23 {
24 "PublicDescription": "Number of instruction fetches that missed the L2 cache.",
25 "EventCode": "0x24",
26 "Counter": "0,1,2,3",
27 "UMask": "0x24",
28 "EventName": "L2_RQSTS.CODE_RD_MISS",
29 "SampleAfterValue": "200003",
30 "BriefDescription": "L2 cache misses when fetching instructions",
31 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 },
33 {
34 "PublicDescription": "Demand requests that miss L2 cache.",
35 "EventCode": "0x24",
36 "Counter": "0,1,2,3",
37 "UMask": "0x27",
18 "Errata": "HSD78", 38 "Errata": "HSD78",
19 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT", 39 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
20 "SampleAfterValue": "200003", 40 "SampleAfterValue": "200003",
21 "BriefDescription": "Demand Data Read requests that hit L2 cache", 41 "BriefDescription": "Demand requests that miss L2 cache",
22 "CounterHTOff": "0,1,2,3,4,5,6,7" 42 "CounterHTOff": "0,1,2,3,4,5,6,7"
23 }, 43 },
24 { 44 {
@@ -32,6 +52,48 @@
32 "CounterHTOff": "0,1,2,3,4,5,6,7" 52 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 }, 53 },
34 { 54 {
55 "PublicDescription": "All requests that missed L2.",
56 "EventCode": "0x24",
57 "Counter": "0,1,2,3",
58 "UMask": "0x3f",
59 "Errata": "HSD78",
60 "EventName": "L2_RQSTS.MISS",
61 "SampleAfterValue": "200003",
62 "BriefDescription": "All requests that miss L2 cache",
63 "CounterHTOff": "0,1,2,3,4,5,6,7"
64 },
65 {
66 "PublicDescription": "Demand data read requests that hit L2 cache.",
67 "EventCode": "0x24",
68 "Counter": "0,1,2,3",
69 "UMask": "0x41",
70 "Errata": "HSD78",
71 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT",
72 "SampleAfterValue": "200003",
73 "BriefDescription": "Demand Data Read requests that hit L2 cache",
74 "CounterHTOff": "0,1,2,3,4,5,6,7"
75 },
76 {
77 "PublicDescription": "Counts the number of store RFO requests that hit the L2 cache.",
78 "EventCode": "0x24",
79 "Counter": "0,1,2,3",
80 "UMask": "0x42",
81 "EventName": "L2_RQSTS.RFO_HIT",
82 "SampleAfterValue": "200003",
83 "BriefDescription": "RFO requests that hit L2 cache",
84 "CounterHTOff": "0,1,2,3,4,5,6,7"
85 },
86 {
87 "PublicDescription": "Number of instruction fetches that hit the L2 cache.",
88 "EventCode": "0x24",
89 "Counter": "0,1,2,3",
90 "UMask": "0x44",
91 "EventName": "L2_RQSTS.CODE_RD_HIT",
92 "SampleAfterValue": "200003",
93 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
94 "CounterHTOff": "0,1,2,3,4,5,6,7"
95 },
96 {
35 "PublicDescription": "Counts all L2 HW prefetcher requests that hit L2.", 97 "PublicDescription": "Counts all L2 HW prefetcher requests that hit L2.",
36 "EventCode": "0x24", 98 "EventCode": "0x24",
37 "Counter": "0,1,2,3", 99 "Counter": "0,1,2,3",
@@ -73,6 +135,17 @@
73 "CounterHTOff": "0,1,2,3,4,5,6,7" 135 "CounterHTOff": "0,1,2,3,4,5,6,7"
74 }, 136 },
75 { 137 {
138 "PublicDescription": "Demand requests to L2 cache.",
139 "EventCode": "0x24",
140 "Counter": "0,1,2,3",
141 "UMask": "0xe7",
142 "Errata": "HSD78",
143 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
144 "SampleAfterValue": "200003",
145 "BriefDescription": "Demand requests to L2 cache",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
76 "PublicDescription": "Counts all L2 HW prefetcher requests.", 149 "PublicDescription": "Counts all L2 HW prefetcher requests.",
77 "EventCode": "0x24", 150 "EventCode": "0x24",
78 "Counter": "0,1,2,3", 151 "Counter": "0,1,2,3",
@@ -83,6 +156,17 @@
83 "CounterHTOff": "0,1,2,3,4,5,6,7" 156 "CounterHTOff": "0,1,2,3,4,5,6,7"
84 }, 157 },
85 { 158 {
159 "PublicDescription": "All requests to L2 cache.",
160 "EventCode": "0x24",
161 "Counter": "0,1,2,3",
162 "UMask": "0xff",
163 "Errata": "HSD78",
164 "EventName": "L2_RQSTS.REFERENCES",
165 "SampleAfterValue": "200003",
166 "BriefDescription": "All L2 requests",
167 "CounterHTOff": "0,1,2,3,4,5,6,7"
168 },
169 {
86 "PublicDescription": "Not rejected writebacks that hit L2 cache.", 170 "PublicDescription": "Not rejected writebacks that hit L2 cache.",
87 "EventCode": "0x27", 171 "EventCode": "0x27",
88 "Counter": "0,1,2,3", 172 "Counter": "0,1,2,3",
@@ -124,6 +208,27 @@
124 }, 208 },
125 { 209 {
126 "EventCode": "0x48", 210 "EventCode": "0x48",
211 "Counter": "2",
212 "UMask": "0x1",
213 "EventName": "L1D_PEND_MISS.PENDING_CYCLES",
214 "SampleAfterValue": "2000003",
215 "BriefDescription": "Cycles with L1D load Misses outstanding.",
216 "CounterMask": "1",
217 "CounterHTOff": "2"
218 },
219 {
220 "EventCode": "0x48",
221 "Counter": "2",
222 "UMask": "0x1",
223 "AnyThread": "1",
224 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
225 "SampleAfterValue": "2000003",
226 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
227 "CounterMask": "1",
228 "CounterHTOff": "2"
229 },
230 {
231 "EventCode": "0x48",
127 "Counter": "0,1,2,3", 232 "Counter": "0,1,2,3",
128 "UMask": "0x2", 233 "UMask": "0x2",
129 "EventName": "L1D_PEND_MISS.REQUEST_FB_FULL", 234 "EventName": "L1D_PEND_MISS.REQUEST_FB_FULL",
@@ -133,13 +238,13 @@
133 }, 238 },
134 { 239 {
135 "EventCode": "0x48", 240 "EventCode": "0x48",
136 "Counter": "2", 241 "Counter": "0,1,2,3",
137 "UMask": "0x1", 242 "UMask": "0x2",
138 "EventName": "L1D_PEND_MISS.PENDING_CYCLES", 243 "EventName": "L1D_PEND_MISS.FB_FULL",
139 "SampleAfterValue": "2000003", 244 "SampleAfterValue": "2000003",
140 "BriefDescription": "Cycles with L1D load Misses outstanding.", 245 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
141 "CounterMask": "1", 246 "CounterMask": "1",
142 "CounterHTOff": "2" 247 "CounterHTOff": "0,1,2,3,4,5,6,7"
143 }, 248 },
144 { 249 {
145 "PublicDescription": "This event counts when new data lines are brought into the L1 Data cache, which cause other lines to be evicted from the cache.", 250 "PublicDescription": "This event counts when new data lines are brought into the L1 Data cache, which cause other lines to be evicted from the cache.",
@@ -163,6 +268,28 @@
163 "CounterHTOff": "0,1,2,3,4,5,6,7" 268 "CounterHTOff": "0,1,2,3,4,5,6,7"
164 }, 269 },
165 { 270 {
271 "EventCode": "0x60",
272 "Counter": "0,1,2,3",
273 "UMask": "0x1",
274 "Errata": "HSD78, HSD62, HSD61",
275 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
276 "SampleAfterValue": "2000003",
277 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
278 "CounterMask": "1",
279 "CounterHTOff": "0,1,2,3,4,5,6,7"
280 },
281 {
282 "EventCode": "0x60",
283 "Counter": "0,1,2,3",
284 "UMask": "0x1",
285 "Errata": "HSD78, HSD62, HSD61",
286 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
287 "SampleAfterValue": "2000003",
288 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
289 "CounterMask": "6",
290 "CounterHTOff": "0,1,2,3,4,5,6,7"
291 },
292 {
166 "PublicDescription": "Offcore outstanding Demand code Read transactions in SQ to uncore. Set Cmask=1 to count cycles.", 293 "PublicDescription": "Offcore outstanding Demand code Read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
167 "EventCode": "0x60", 294 "EventCode": "0x60",
168 "Counter": "0,1,2,3", 295 "Counter": "0,1,2,3",
@@ -185,46 +312,35 @@
185 "CounterHTOff": "0,1,2,3,4,5,6,7" 312 "CounterHTOff": "0,1,2,3,4,5,6,7"
186 }, 313 },
187 { 314 {
188 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
189 "EventCode": "0x60", 315 "EventCode": "0x60",
190 "Counter": "0,1,2,3", 316 "Counter": "0,1,2,3",
191 "UMask": "0x8", 317 "UMask": "0x4",
192 "Errata": "HSD62, HSD61", 318 "Errata": "HSD62, HSD61",
193 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 319 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
194 "SampleAfterValue": "2000003",
195 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
196 "CounterHTOff": "0,1,2,3,4,5,6,7"
197 },
198 {
199 "EventCode": "0x60",
200 "Counter": "0,1,2,3",
201 "UMask": "0x1",
202 "Errata": "HSD78, HSD62, HSD61",
203 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
204 "SampleAfterValue": "2000003", 320 "SampleAfterValue": "2000003",
205 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 321 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
206 "CounterMask": "1", 322 "CounterMask": "1",
207 "CounterHTOff": "0,1,2,3,4,5,6,7" 323 "CounterHTOff": "0,1,2,3,4,5,6,7"
208 }, 324 },
209 { 325 {
326 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
210 "EventCode": "0x60", 327 "EventCode": "0x60",
211 "Counter": "0,1,2,3", 328 "Counter": "0,1,2,3",
212 "UMask": "0x8", 329 "UMask": "0x8",
213 "Errata": "HSD62, HSD61", 330 "Errata": "HSD62, HSD61",
214 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD", 331 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
215 "SampleAfterValue": "2000003", 332 "SampleAfterValue": "2000003",
216 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 333 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
217 "CounterMask": "1",
218 "CounterHTOff": "0,1,2,3,4,5,6,7" 334 "CounterHTOff": "0,1,2,3,4,5,6,7"
219 }, 335 },
220 { 336 {
221 "EventCode": "0x60", 337 "EventCode": "0x60",
222 "Counter": "0,1,2,3", 338 "Counter": "0,1,2,3",
223 "UMask": "0x4", 339 "UMask": "0x8",
224 "Errata": "HSD62, HSD61", 340 "Errata": "HSD62, HSD61",
225 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO", 341 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD",
226 "SampleAfterValue": "2000003", 342 "SampleAfterValue": "2000003",
227 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.", 343 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
228 "CounterMask": "1", 344 "CounterMask": "1",
229 "CounterHTOff": "0,1,2,3,4,5,6,7" 345 "CounterHTOff": "0,1,2,3,4,5,6,7"
230 }, 346 },
@@ -289,6 +405,15 @@
289 "CounterHTOff": "0,1,2,3,4,5,6,7" 405 "CounterHTOff": "0,1,2,3,4,5,6,7"
290 }, 406 },
291 { 407 {
408 "EventCode": "0xB7, 0xBB",
409 "Counter": "0,1,2,3",
410 "UMask": "0x1",
411 "EventName": "OFFCORE_RESPONSE",
412 "SampleAfterValue": "100003",
413 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
414 "CounterHTOff": "0,1,2,3"
415 },
416 {
292 "PEBS": "1", 417 "PEBS": "1",
293 "EventCode": "0xD0", 418 "EventCode": "0xD0",
294 "Counter": "0,1,2,3", 419 "Counter": "0,1,2,3",
@@ -296,7 +421,7 @@
296 "Errata": "HSD29, HSM30", 421 "Errata": "HSD29, HSM30",
297 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS", 422 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS",
298 "SampleAfterValue": "100003", 423 "SampleAfterValue": "100003",
299 "BriefDescription": "Retired load uops that miss the STLB.", 424 "BriefDescription": "Retired load uops that miss the STLB. (precise Event)",
300 "CounterHTOff": "0,1,2,3", 425 "CounterHTOff": "0,1,2,3",
301 "Data_LA": "1" 426 "Data_LA": "1"
302 }, 427 },
@@ -308,7 +433,7 @@
308 "Errata": "HSD29, HSM30", 433 "Errata": "HSD29, HSM30",
309 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 434 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
310 "SampleAfterValue": "100003", 435 "SampleAfterValue": "100003",
311 "BriefDescription": "Retired store uops that miss the STLB.", 436 "BriefDescription": "Retired store uops that miss the STLB. (precise Event)",
312 "CounterHTOff": "0,1,2,3", 437 "CounterHTOff": "0,1,2,3",
313 "Data_LA": "1", 438 "Data_LA": "1",
314 "L1_Hit_Indication": "1" 439 "L1_Hit_Indication": "1"
@@ -321,31 +446,33 @@
321 "Errata": "HSD76, HSD29, HSM30", 446 "Errata": "HSD76, HSD29, HSM30",
322 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 447 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
323 "SampleAfterValue": "100003", 448 "SampleAfterValue": "100003",
324 "BriefDescription": "Retired load uops with locked access.", 449 "BriefDescription": "Retired load uops with locked access. (precise Event)",
325 "CounterHTOff": "0,1,2,3", 450 "CounterHTOff": "0,1,2,3",
326 "Data_LA": "1" 451 "Data_LA": "1"
327 }, 452 },
328 { 453 {
329 "PEBS": "1", 454 "PEBS": "1",
455 "PublicDescription": "This event counts load uops retired which had memory addresses spilt across 2 cache lines. A line split is across 64B cache-lines which may include a page split (4K). This is a precise event.",
330 "EventCode": "0xD0", 456 "EventCode": "0xD0",
331 "Counter": "0,1,2,3", 457 "Counter": "0,1,2,3",
332 "UMask": "0x41", 458 "UMask": "0x41",
333 "Errata": "HSD29, HSM30", 459 "Errata": "HSD29, HSM30",
334 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 460 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
335 "SampleAfterValue": "100003", 461 "SampleAfterValue": "100003",
336 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 462 "BriefDescription": "Retired load uops that split across a cacheline boundary. (precise Event)",
337 "CounterHTOff": "0,1,2,3", 463 "CounterHTOff": "0,1,2,3",
338 "Data_LA": "1" 464 "Data_LA": "1"
339 }, 465 },
340 { 466 {
341 "PEBS": "1", 467 "PEBS": "1",
468 "PublicDescription": "This event counts store uops retired which had memory addresses spilt across 2 cache lines. A line split is across 64B cache-lines which may include a page split (4K). This is a precise event.",
342 "EventCode": "0xD0", 469 "EventCode": "0xD0",
343 "Counter": "0,1,2,3", 470 "Counter": "0,1,2,3",
344 "UMask": "0x42", 471 "UMask": "0x42",
345 "Errata": "HSD29, HSM30", 472 "Errata": "HSD29, HSM30",
346 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 473 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
347 "SampleAfterValue": "100003", 474 "SampleAfterValue": "100003",
348 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 475 "BriefDescription": "Retired store uops that split across a cacheline boundary. (precise Event)",
349 "CounterHTOff": "0,1,2,3", 476 "CounterHTOff": "0,1,2,3",
350 "Data_LA": "1", 477 "Data_LA": "1",
351 "L1_Hit_Indication": "1" 478 "L1_Hit_Indication": "1"
@@ -358,19 +485,20 @@
358 "Errata": "HSD29, HSM30", 485 "Errata": "HSD29, HSM30",
359 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 486 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
360 "SampleAfterValue": "2000003", 487 "SampleAfterValue": "2000003",
361 "BriefDescription": "All retired load uops.", 488 "BriefDescription": "All retired load uops. (precise Event)",
362 "CounterHTOff": "0,1,2,3", 489 "CounterHTOff": "0,1,2,3",
363 "Data_LA": "1" 490 "Data_LA": "1"
364 }, 491 },
365 { 492 {
366 "PEBS": "1", 493 "PEBS": "1",
494 "PublicDescription": "This event counts all store uops retired. This is a precise event.",
367 "EventCode": "0xD0", 495 "EventCode": "0xD0",
368 "Counter": "0,1,2,3", 496 "Counter": "0,1,2,3",
369 "UMask": "0x82", 497 "UMask": "0x82",
370 "Errata": "HSD29, HSM30", 498 "Errata": "HSD29, HSM30",
371 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 499 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
372 "SampleAfterValue": "2000003", 500 "SampleAfterValue": "2000003",
373 "BriefDescription": "All retired store uops.", 501 "BriefDescription": "All retired store uops. (precise Event)",
374 "CounterHTOff": "0,1,2,3", 502 "CounterHTOff": "0,1,2,3",
375 "Data_LA": "1", 503 "Data_LA": "1",
376 "L1_Hit_Indication": "1" 504 "L1_Hit_Indication": "1"
@@ -401,20 +529,20 @@
401 }, 529 },
402 { 530 {
403 "PEBS": "1", 531 "PEBS": "1",
404 "PublicDescription": "Retired load uops with L3 cache hits as data sources.", 532 "PublicDescription": "This event counts retired load uops in which data sources were data hits in the L3 cache without snoops required. This does not include hardware prefetches. This is a precise event.",
405 "EventCode": "0xD1", 533 "EventCode": "0xD1",
406 "Counter": "0,1,2,3", 534 "Counter": "0,1,2,3",
407 "UMask": "0x4", 535 "UMask": "0x4",
408 "Errata": "HSD74, HSD29, HSD25, HSM26, HSM30", 536 "Errata": "HSD74, HSD29, HSD25, HSM26, HSM30",
409 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT", 537 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT",
410 "SampleAfterValue": "50021", 538 "SampleAfterValue": "50021",
411 "BriefDescription": "Retired load uops which data sources were data hits in L3 without snoops required.", 539 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source.",
412 "CounterHTOff": "0,1,2,3", 540 "CounterHTOff": "0,1,2,3",
413 "Data_LA": "1" 541 "Data_LA": "1"
414 }, 542 },
415 { 543 {
416 "PEBS": "1", 544 "PEBS": "1",
417 "PublicDescription": "Retired load uops missed L1 cache as data sources.", 545 "PublicDescription": "This event counts retired load uops in which data sources missed in the L1 cache. This does not include hardware prefetches. This is a precise event.",
418 "EventCode": "0xD1", 546 "EventCode": "0xD1",
419 "Counter": "0,1,2,3", 547 "Counter": "0,1,2,3",
420 "UMask": "0x8", 548 "UMask": "0x8",
@@ -427,20 +555,18 @@
427 }, 555 },
428 { 556 {
429 "PEBS": "1", 557 "PEBS": "1",
430 "PublicDescription": "Retired load uops missed L2. Unknown data source excluded.",
431 "EventCode": "0xD1", 558 "EventCode": "0xD1",
432 "Counter": "0,1,2,3", 559 "Counter": "0,1,2,3",
433 "UMask": "0x10", 560 "UMask": "0x10",
434 "Errata": "HSD29, HSM30", 561 "Errata": "HSD29, HSM30",
435 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 562 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
436 "SampleAfterValue": "50021", 563 "SampleAfterValue": "50021",
437 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 564 "BriefDescription": "Retired load uops with L2 cache misses as data sources.",
438 "CounterHTOff": "0,1,2,3", 565 "CounterHTOff": "0,1,2,3",
439 "Data_LA": "1" 566 "Data_LA": "1"
440 }, 567 },
441 { 568 {
442 "PEBS": "1", 569 "PEBS": "1",
443 "PublicDescription": "Retired load uops missed L3. Excludes unknown data source .",
444 "EventCode": "0xD1", 570 "EventCode": "0xD1",
445 "Counter": "0,1,2,3", 571 "Counter": "0,1,2,3",
446 "UMask": "0x20", 572 "UMask": "0x20",
@@ -477,25 +603,27 @@
477 }, 603 },
478 { 604 {
479 "PEBS": "1", 605 "PEBS": "1",
606 "PublicDescription": "This event counts retired load uops that hit in the L3 cache, but required a cross-core snoop which resulted in a HIT in an on-pkg core cache. This does not include hardware prefetches. This is a precise event.",
480 "EventCode": "0xD2", 607 "EventCode": "0xD2",
481 "Counter": "0,1,2,3", 608 "Counter": "0,1,2,3",
482 "UMask": "0x2", 609 "UMask": "0x2",
483 "Errata": "HSD29, HSD25, HSM26, HSM30", 610 "Errata": "HSD29, HSD25, HSM26, HSM30",
484 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT", 611 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT",
485 "SampleAfterValue": "20011", 612 "SampleAfterValue": "20011",
486 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache.", 613 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache. ",
487 "CounterHTOff": "0,1,2,3", 614 "CounterHTOff": "0,1,2,3",
488 "Data_LA": "1" 615 "Data_LA": "1"
489 }, 616 },
490 { 617 {
491 "PEBS": "1", 618 "PEBS": "1",
619 "PublicDescription": "This event counts retired load uops that hit in the L3 cache, but required a cross-core snoop which resulted in a HITM (hit modified) in an on-pkg core cache. This does not include hardware prefetches. This is a precise event.",
492 "EventCode": "0xD2", 620 "EventCode": "0xD2",
493 "Counter": "0,1,2,3", 621 "Counter": "0,1,2,3",
494 "UMask": "0x4", 622 "UMask": "0x4",
495 "Errata": "HSD29, HSD25, HSM26, HSM30", 623 "Errata": "HSD29, HSD25, HSM26, HSM30",
496 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM", 624 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM",
497 "SampleAfterValue": "20011", 625 "SampleAfterValue": "20011",
498 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3.", 626 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3. ",
499 "CounterHTOff": "0,1,2,3", 627 "CounterHTOff": "0,1,2,3",
500 "Data_LA": "1" 628 "Data_LA": "1"
501 }, 629 },
@@ -513,14 +641,13 @@
513 }, 641 },
514 { 642 {
515 "PEBS": "1", 643 "PEBS": "1",
516 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches.", 644 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches. This is a precise event.",
517 "EventCode": "0xD3", 645 "EventCode": "0xD3",
518 "Counter": "0,1,2,3", 646 "Counter": "0,1,2,3",
519 "UMask": "0x1", 647 "UMask": "0x1",
520 "Errata": "HSD74, HSD29, HSD25, HSM30", 648 "Errata": "HSD74, HSD29, HSD25, HSM30",
521 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM", 649 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM",
522 "SampleAfterValue": "100003", 650 "SampleAfterValue": "100003",
523 "BriefDescription": "Data from local DRAM either Snoop not needed or Snoop Miss (RspI)",
524 "CounterHTOff": "0,1,2,3", 651 "CounterHTOff": "0,1,2,3",
525 "Data_LA": "1" 652 "Data_LA": "1"
526 }, 653 },
@@ -665,6 +792,7 @@
665 "CounterHTOff": "0,1,2,3,4,5,6,7" 792 "CounterHTOff": "0,1,2,3,4,5,6,7"
666 }, 793 },
667 { 794 {
795 "PublicDescription": "",
668 "EventCode": "0xf4", 796 "EventCode": "0xf4",
669 "Counter": "0,1,2,3", 797 "Counter": "0,1,2,3",
670 "UMask": "0x10", 798 "UMask": "0x10",
@@ -674,131 +802,7 @@
674 "CounterHTOff": "0,1,2,3,4,5,6,7" 802 "CounterHTOff": "0,1,2,3,4,5,6,7"
675 }, 803 },
676 { 804 {
677 "PublicDescription": "Counts the number of store RFO requests that hit the L2 cache.", 805 "PublicDescription": "Counts all requests that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
678 "EventCode": "0x24",
679 "Counter": "0,1,2,3",
680 "UMask": "0x42",
681 "EventName": "L2_RQSTS.RFO_HIT",
682 "SampleAfterValue": "200003",
683 "BriefDescription": "RFO requests that hit L2 cache",
684 "CounterHTOff": "0,1,2,3,4,5,6,7"
685 },
686 {
687 "PublicDescription": "Counts the number of store RFO requests that miss the L2 cache.",
688 "EventCode": "0x24",
689 "Counter": "0,1,2,3",
690 "UMask": "0x22",
691 "EventName": "L2_RQSTS.RFO_MISS",
692 "SampleAfterValue": "200003",
693 "BriefDescription": "RFO requests that miss L2 cache",
694 "CounterHTOff": "0,1,2,3,4,5,6,7"
695 },
696 {
697 "PublicDescription": "Number of instruction fetches that hit the L2 cache.",
698 "EventCode": "0x24",
699 "Counter": "0,1,2,3",
700 "UMask": "0x44",
701 "EventName": "L2_RQSTS.CODE_RD_HIT",
702 "SampleAfterValue": "200003",
703 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
704 "CounterHTOff": "0,1,2,3,4,5,6,7"
705 },
706 {
707 "PublicDescription": "Number of instruction fetches that missed the L2 cache.",
708 "EventCode": "0x24",
709 "Counter": "0,1,2,3",
710 "UMask": "0x24",
711 "EventName": "L2_RQSTS.CODE_RD_MISS",
712 "SampleAfterValue": "200003",
713 "BriefDescription": "L2 cache misses when fetching instructions",
714 "CounterHTOff": "0,1,2,3,4,5,6,7"
715 },
716 {
717 "PublicDescription": "Demand requests that miss L2 cache.",
718 "EventCode": "0x24",
719 "Counter": "0,1,2,3",
720 "UMask": "0x27",
721 "Errata": "HSD78",
722 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
723 "SampleAfterValue": "200003",
724 "BriefDescription": "Demand requests that miss L2 cache",
725 "CounterHTOff": "0,1,2,3,4,5,6,7"
726 },
727 {
728 "PublicDescription": "Demand requests to L2 cache.",
729 "EventCode": "0x24",
730 "Counter": "0,1,2,3",
731 "UMask": "0xe7",
732 "Errata": "HSD78",
733 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
734 "SampleAfterValue": "200003",
735 "BriefDescription": "Demand requests to L2 cache",
736 "CounterHTOff": "0,1,2,3,4,5,6,7"
737 },
738 {
739 "PublicDescription": "All requests that missed L2.",
740 "EventCode": "0x24",
741 "Counter": "0,1,2,3",
742 "UMask": "0x3f",
743 "Errata": "HSD78",
744 "EventName": "L2_RQSTS.MISS",
745 "SampleAfterValue": "200003",
746 "BriefDescription": "All requests that miss L2 cache",
747 "CounterHTOff": "0,1,2,3,4,5,6,7"
748 },
749 {
750 "PublicDescription": "All requests to L2 cache.",
751 "EventCode": "0x24",
752 "Counter": "0,1,2,3",
753 "UMask": "0xff",
754 "Errata": "HSD78",
755 "EventName": "L2_RQSTS.REFERENCES",
756 "SampleAfterValue": "200003",
757 "BriefDescription": "All L2 requests",
758 "CounterHTOff": "0,1,2,3,4,5,6,7"
759 },
760 {
761 "EventCode": "0xB7, 0xBB",
762 "Counter": "0,1,2,3",
763 "UMask": "0x1",
764 "EventName": "OFFCORE_RESPONSE",
765 "SampleAfterValue": "100003",
766 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
767 "CounterHTOff": "0,1,2,3"
768 },
769 {
770 "EventCode": "0x60",
771 "Counter": "0,1,2,3",
772 "UMask": "0x1",
773 "Errata": "HSD78, HSD62, HSD61",
774 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
775 "SampleAfterValue": "2000003",
776 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
777 "CounterMask": "6",
778 "CounterHTOff": "0,1,2,3,4,5,6,7"
779 },
780 {
781 "EventCode": "0x48",
782 "Counter": "2",
783 "UMask": "0x1",
784 "AnyThread": "1",
785 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
786 "SampleAfterValue": "2000003",
787 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
788 "CounterMask": "1",
789 "CounterHTOff": "2"
790 },
791 {
792 "EventCode": "0x48",
793 "Counter": "0,1,2,3",
794 "UMask": "0x2",
795 "EventName": "L1D_PEND_MISS.FB_FULL",
796 "SampleAfterValue": "2000003",
797 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
798 "CounterMask": "1",
799 "CounterHTOff": "0,1,2,3,4,5,6,7"
800 },
801 {
802 "EventCode": "0xB7, 0xBB", 806 "EventCode": "0xB7, 0xBB",
803 "MSRValue": "0x3f803c8fff", 807 "MSRValue": "0x3f803c8fff",
804 "Counter": "0,1,2,3", 808 "Counter": "0,1,2,3",
@@ -811,6 +815,7 @@
811 "CounterHTOff": "0,1,2,3" 815 "CounterHTOff": "0,1,2,3"
812 }, 816 },
813 { 817 {
818 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
814 "EventCode": "0xB7, 0xBB", 819 "EventCode": "0xB7, 0xBB",
815 "MSRValue": "0x10003c07f7", 820 "MSRValue": "0x10003c07f7",
816 "Counter": "0,1,2,3", 821 "Counter": "0,1,2,3",
@@ -823,6 +828,7 @@
823 "CounterHTOff": "0,1,2,3" 828 "CounterHTOff": "0,1,2,3"
824 }, 829 },
825 { 830 {
831 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
826 "EventCode": "0xB7, 0xBB", 832 "EventCode": "0xB7, 0xBB",
827 "MSRValue": "0x04003c07f7", 833 "MSRValue": "0x04003c07f7",
828 "Counter": "0,1,2,3", 834 "Counter": "0,1,2,3",
@@ -835,6 +841,7 @@
835 "CounterHTOff": "0,1,2,3" 841 "CounterHTOff": "0,1,2,3"
836 }, 842 },
837 { 843 {
844 "PublicDescription": "Counts all demand & prefetch code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
838 "EventCode": "0xB7, 0xBB", 845 "EventCode": "0xB7, 0xBB",
839 "MSRValue": "0x04003c0244", 846 "MSRValue": "0x04003c0244",
840 "Counter": "0,1,2,3", 847 "Counter": "0,1,2,3",
@@ -847,6 +854,7 @@
847 "CounterHTOff": "0,1,2,3" 854 "CounterHTOff": "0,1,2,3"
848 }, 855 },
849 { 856 {
857 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
850 "EventCode": "0xB7, 0xBB", 858 "EventCode": "0xB7, 0xBB",
851 "MSRValue": "0x10003c0122", 859 "MSRValue": "0x10003c0122",
852 "Counter": "0,1,2,3", 860 "Counter": "0,1,2,3",
@@ -859,6 +867,7 @@
859 "CounterHTOff": "0,1,2,3" 867 "CounterHTOff": "0,1,2,3"
860 }, 868 },
861 { 869 {
870 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
862 "EventCode": "0xB7, 0xBB", 871 "EventCode": "0xB7, 0xBB",
863 "MSRValue": "0x04003c0122", 872 "MSRValue": "0x04003c0122",
864 "Counter": "0,1,2,3", 873 "Counter": "0,1,2,3",
@@ -871,6 +880,7 @@
871 "CounterHTOff": "0,1,2,3" 880 "CounterHTOff": "0,1,2,3"
872 }, 881 },
873 { 882 {
883 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
874 "EventCode": "0xB7, 0xBB", 884 "EventCode": "0xB7, 0xBB",
875 "MSRValue": "0x10003c0091", 885 "MSRValue": "0x10003c0091",
876 "Counter": "0,1,2,3", 886 "Counter": "0,1,2,3",
@@ -883,6 +893,7 @@
883 "CounterHTOff": "0,1,2,3" 893 "CounterHTOff": "0,1,2,3"
884 }, 894 },
885 { 895 {
896 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
886 "EventCode": "0xB7, 0xBB", 897 "EventCode": "0xB7, 0xBB",
887 "MSRValue": "0x04003c0091", 898 "MSRValue": "0x04003c0091",
888 "Counter": "0,1,2,3", 899 "Counter": "0,1,2,3",
@@ -895,6 +906,7 @@
895 "CounterHTOff": "0,1,2,3" 906 "CounterHTOff": "0,1,2,3"
896 }, 907 },
897 { 908 {
909 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
898 "EventCode": "0xB7, 0xBB", 910 "EventCode": "0xB7, 0xBB",
899 "MSRValue": "0x3f803c0200", 911 "MSRValue": "0x3f803c0200",
900 "Counter": "0,1,2,3", 912 "Counter": "0,1,2,3",
@@ -907,6 +919,7 @@
907 "CounterHTOff": "0,1,2,3" 919 "CounterHTOff": "0,1,2,3"
908 }, 920 },
909 { 921 {
922 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
910 "EventCode": "0xB7, 0xBB", 923 "EventCode": "0xB7, 0xBB",
911 "MSRValue": "0x3f803c0100", 924 "MSRValue": "0x3f803c0100",
912 "Counter": "0,1,2,3", 925 "Counter": "0,1,2,3",
@@ -919,6 +932,7 @@
919 "CounterHTOff": "0,1,2,3" 932 "CounterHTOff": "0,1,2,3"
920 }, 933 },
921 { 934 {
935 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
922 "EventCode": "0xB7, 0xBB", 936 "EventCode": "0xB7, 0xBB",
923 "MSRValue": "0x3f803c0080", 937 "MSRValue": "0x3f803c0080",
924 "Counter": "0,1,2,3", 938 "Counter": "0,1,2,3",
@@ -931,6 +945,7 @@
931 "CounterHTOff": "0,1,2,3" 945 "CounterHTOff": "0,1,2,3"
932 }, 946 },
933 { 947 {
948 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
934 "EventCode": "0xB7, 0xBB", 949 "EventCode": "0xB7, 0xBB",
935 "MSRValue": "0x3f803c0040", 950 "MSRValue": "0x3f803c0040",
936 "Counter": "0,1,2,3", 951 "Counter": "0,1,2,3",
@@ -943,6 +958,7 @@
943 "CounterHTOff": "0,1,2,3" 958 "CounterHTOff": "0,1,2,3"
944 }, 959 },
945 { 960 {
961 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
946 "EventCode": "0xB7, 0xBB", 962 "EventCode": "0xB7, 0xBB",
947 "MSRValue": "0x3f803c0020", 963 "MSRValue": "0x3f803c0020",
948 "Counter": "0,1,2,3", 964 "Counter": "0,1,2,3",
@@ -955,6 +971,7 @@
955 "CounterHTOff": "0,1,2,3" 971 "CounterHTOff": "0,1,2,3"
956 }, 972 },
957 { 973 {
974 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
958 "EventCode": "0xB7, 0xBB", 975 "EventCode": "0xB7, 0xBB",
959 "MSRValue": "0x3f803c0010", 976 "MSRValue": "0x3f803c0010",
960 "Counter": "0,1,2,3", 977 "Counter": "0,1,2,3",
@@ -967,6 +984,7 @@
967 "CounterHTOff": "0,1,2,3" 984 "CounterHTOff": "0,1,2,3"
968 }, 985 },
969 { 986 {
987 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
970 "EventCode": "0xB7, 0xBB", 988 "EventCode": "0xB7, 0xBB",
971 "MSRValue": "0x10003c0004", 989 "MSRValue": "0x10003c0004",
972 "Counter": "0,1,2,3", 990 "Counter": "0,1,2,3",
@@ -979,6 +997,7 @@
979 "CounterHTOff": "0,1,2,3" 997 "CounterHTOff": "0,1,2,3"
980 }, 998 },
981 { 999 {
1000 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
982 "EventCode": "0xB7, 0xBB", 1001 "EventCode": "0xB7, 0xBB",
983 "MSRValue": "0x04003c0004", 1002 "MSRValue": "0x04003c0004",
984 "Counter": "0,1,2,3", 1003 "Counter": "0,1,2,3",
@@ -991,6 +1010,7 @@
991 "CounterHTOff": "0,1,2,3" 1010 "CounterHTOff": "0,1,2,3"
992 }, 1011 },
993 { 1012 {
1013 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
994 "EventCode": "0xB7, 0xBB", 1014 "EventCode": "0xB7, 0xBB",
995 "MSRValue": "0x10003c0002", 1015 "MSRValue": "0x10003c0002",
996 "Counter": "0,1,2,3", 1016 "Counter": "0,1,2,3",
@@ -1003,6 +1023,7 @@
1003 "CounterHTOff": "0,1,2,3" 1023 "CounterHTOff": "0,1,2,3"
1004 }, 1024 },
1005 { 1025 {
1026 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1006 "EventCode": "0xB7, 0xBB", 1027 "EventCode": "0xB7, 0xBB",
1007 "MSRValue": "0x04003c0002", 1028 "MSRValue": "0x04003c0002",
1008 "Counter": "0,1,2,3", 1029 "Counter": "0,1,2,3",
@@ -1015,6 +1036,7 @@
1015 "CounterHTOff": "0,1,2,3" 1036 "CounterHTOff": "0,1,2,3"
1016 }, 1037 },
1017 { 1038 {
1039 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1018 "EventCode": "0xB7, 0xBB", 1040 "EventCode": "0xB7, 0xBB",
1019 "MSRValue": "0x10003c0001", 1041 "MSRValue": "0x10003c0001",
1020 "Counter": "0,1,2,3", 1042 "Counter": "0,1,2,3",
@@ -1027,6 +1049,7 @@
1027 "CounterHTOff": "0,1,2,3" 1049 "CounterHTOff": "0,1,2,3"
1028 }, 1050 },
1029 { 1051 {
1052 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1030 "EventCode": "0xB7, 0xBB", 1053 "EventCode": "0xB7, 0xBB",
1031 "MSRValue": "0x04003c0001", 1054 "MSRValue": "0x04003c0001",
1032 "Counter": "0,1,2,3", 1055 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/haswell/floating-point.json b/tools/perf/pmu-events/arch/x86/haswell/floating-point.json
index 1732fa49c6d2..f9843e5a9b42 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/floating-point.json
@@ -20,6 +20,16 @@
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "PublicDescription": "Note that a whole rep string only counts AVX_INST.ALL once.",
24 "EventCode": "0xC6",
25 "Counter": "0,1,2,3",
26 "UMask": "0x7",
27 "EventName": "AVX_INSTS.ALL",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Approximate counts of AVX & AVX2 256-bit instructions, including non-arithmetic instructions, loads, and stores. May count non-AVX instructions that employ 256-bit operations, including (but not necessarily limited to) rep string instructions that use 256-bit loads and stores for optimized performance, XSAVE* and XRSTOR*, and operations that transition the x87 FPU data registers between x87 and MMX.",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
23 "PublicDescription": "Number of X87 FP assists due to output values.", 33 "PublicDescription": "Number of X87 FP assists due to output values.",
24 "EventCode": "0xCA", 34 "EventCode": "0xCA",
25 "Counter": "0,1,2,3", 35 "Counter": "0,1,2,3",
@@ -69,15 +79,5 @@
69 "BriefDescription": "Cycles with any input/output SSE or FP assist", 79 "BriefDescription": "Cycles with any input/output SSE or FP assist",
70 "CounterMask": "1", 80 "CounterMask": "1",
71 "CounterHTOff": "0,1,2,3" 81 "CounterHTOff": "0,1,2,3"
72 },
73 {
74 "PublicDescription": "Note that a whole rep string only counts AVX_INST.ALL once.",
75 "EventCode": "0xC6",
76 "Counter": "0,1,2,3",
77 "UMask": "0x7",
78 "EventName": "AVX_INSTS.ALL",
79 "SampleAfterValue": "2000003",
80 "BriefDescription": "Approximate counts of AVX & AVX2 256-bit instructions, including non-arithmetic instructions, loads, and stores. May count non-AVX instructions that employ 256-bit operations, including (but not necessarily limited to) rep string instructions that use 256-bit loads and stores for optimized performance, XSAVE* and XRSTOR*, and operations that transition the x87 FPU data registers between x87 and MMX.",
81 "CounterHTOff": "0,1,2,3,4,5,6,7"
82 } 82 }
83] \ No newline at end of file 83] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswell/frontend.json b/tools/perf/pmu-events/arch/x86/haswell/frontend.json
index 57a1ce46971f..c0a5bedcc15c 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/frontend.json
@@ -21,74 +21,43 @@
21 "CounterHTOff": "0,1,2,3,4,5,6,7" 21 "CounterHTOff": "0,1,2,3,4,5,6,7"
22 }, 22 },
23 { 23 {
24 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.",
25 "EventCode": "0x79", 24 "EventCode": "0x79",
26 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
27 "UMask": "0x8", 26 "UMask": "0x4",
28 "EventName": "IDQ.DSB_UOPS", 27 "EventName": "IDQ.MITE_CYCLES",
29 "SampleAfterValue": "2000003",
30 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
31 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 },
33 {
34 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
35 "EventCode": "0x79",
36 "Counter": "0,1,2,3",
37 "UMask": "0x10",
38 "EventName": "IDQ.MS_DSB_UOPS",
39 "SampleAfterValue": "2000003",
40 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
41 "CounterHTOff": "0,1,2,3,4,5,6,7"
42 },
43 {
44 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
45 "EventCode": "0x79",
46 "Counter": "0,1,2,3",
47 "UMask": "0x20",
48 "EventName": "IDQ.MS_MITE_UOPS",
49 "SampleAfterValue": "2000003",
50 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
51 "CounterHTOff": "0,1,2,3,4,5,6,7"
52 },
53 {
54 "PublicDescription": "This event counts uops delivered by the Front-end with the assistance of the microcode sequencer. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.",
55 "EventCode": "0x79",
56 "Counter": "0,1,2,3",
57 "UMask": "0x30",
58 "EventName": "IDQ.MS_UOPS",
59 "SampleAfterValue": "2000003", 28 "SampleAfterValue": "2000003",
60 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 29 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.",
30 "CounterMask": "1",
61 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
62 }, 32 },
63 { 33 {
64 "PublicDescription": "This event counts cycles during which the microcode sequencer assisted the Front-end in delivering uops. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.", 34 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.",
65 "EventCode": "0x79", 35 "EventCode": "0x79",
66 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
67 "UMask": "0x30", 37 "UMask": "0x8",
68 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
69 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
70 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 40 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
71 "CounterMask": "1",
72 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
73 }, 42 },
74 { 43 {
75 "EventCode": "0x79", 44 "EventCode": "0x79",
76 "Counter": "0,1,2,3", 45 "Counter": "0,1,2,3",
77 "UMask": "0x4", 46 "UMask": "0x8",
78 "EventName": "IDQ.MITE_CYCLES", 47 "EventName": "IDQ.DSB_CYCLES",
79 "SampleAfterValue": "2000003", 48 "SampleAfterValue": "2000003",
80 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.", 49 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.",
81 "CounterMask": "1", 50 "CounterMask": "1",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 51 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 52 },
84 { 53 {
54 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
85 "EventCode": "0x79", 55 "EventCode": "0x79",
86 "Counter": "0,1,2,3", 56 "Counter": "0,1,2,3",
87 "UMask": "0x8", 57 "UMask": "0x10",
88 "EventName": "IDQ.DSB_CYCLES", 58 "EventName": "IDQ.MS_DSB_UOPS",
89 "SampleAfterValue": "2000003", 59 "SampleAfterValue": "2000003",
90 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.", 60 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
91 "CounterMask": "1",
92 "CounterHTOff": "0,1,2,3,4,5,6,7" 61 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 }, 62 },
94 { 63 {
@@ -135,6 +104,16 @@
135 "CounterHTOff": "0,1,2,3,4,5,6,7" 104 "CounterHTOff": "0,1,2,3,4,5,6,7"
136 }, 105 },
137 { 106 {
107 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
108 "EventCode": "0x79",
109 "Counter": "0,1,2,3",
110 "UMask": "0x20",
111 "EventName": "IDQ.MS_MITE_UOPS",
112 "SampleAfterValue": "2000003",
113 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
114 "CounterHTOff": "0,1,2,3,4,5,6,7"
115 },
116 {
138 "PublicDescription": "Counts cycles MITE is delivered four uops. Set Cmask = 4.", 117 "PublicDescription": "Counts cycles MITE is delivered four uops. Set Cmask = 4.",
139 "EventCode": "0x79", 118 "EventCode": "0x79",
140 "Counter": "0,1,2,3", 119 "Counter": "0,1,2,3",
@@ -157,6 +136,38 @@
157 "CounterHTOff": "0,1,2,3,4,5,6,7" 136 "CounterHTOff": "0,1,2,3,4,5,6,7"
158 }, 137 },
159 { 138 {
139 "PublicDescription": "This event counts uops delivered by the Front-end with the assistance of the microcode sequencer. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.",
140 "EventCode": "0x79",
141 "Counter": "0,1,2,3",
142 "UMask": "0x30",
143 "EventName": "IDQ.MS_UOPS",
144 "SampleAfterValue": "2000003",
145 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
149 "PublicDescription": "This event counts cycles during which the microcode sequencer assisted the Front-end in delivering uops. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.",
150 "EventCode": "0x79",
151 "Counter": "0,1,2,3",
152 "UMask": "0x30",
153 "EventName": "IDQ.MS_CYCLES",
154 "SampleAfterValue": "2000003",
155 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
156 "CounterMask": "1",
157 "CounterHTOff": "0,1,2,3,4,5,6,7"
158 },
159 {
160 "EventCode": "0x79",
161 "Counter": "0,1,2,3",
162 "UMask": "0x30",
163 "EdgeDetect": "1",
164 "EventName": "IDQ.MS_SWITCHES",
165 "SampleAfterValue": "2000003",
166 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
167 "CounterMask": "1",
168 "CounterHTOff": "0,1,2,3,4,5,6,7"
169 },
170 {
160 "PublicDescription": "Number of uops delivered to IDQ from any path.", 171 "PublicDescription": "Number of uops delivered to IDQ from any path.",
161 "EventCode": "0x79", 172 "EventCode": "0x79",
162 "Counter": "0,1,2,3", 173 "Counter": "0,1,2,3",
@@ -195,6 +206,15 @@
195 "CounterHTOff": "0,1,2,3,4,5,6,7" 206 "CounterHTOff": "0,1,2,3,4,5,6,7"
196 }, 207 },
197 { 208 {
209 "EventCode": "0x80",
210 "Counter": "0,1,2,3",
211 "UMask": "0x4",
212 "EventName": "ICACHE.IFDATA_STALL",
213 "SampleAfterValue": "2000003",
214 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction-cache miss.",
215 "CounterHTOff": "0,1,2,3,4,5,6,7"
216 },
217 {
198 "PublicDescription": "This event count the number of undelivered (unallocated) uops from the Front-end to the Resource Allocation Table (RAT) while the Back-end of the processor is not stalled. The Front-end can allocate up to 4 uops per cycle so this event can increment 0-4 times per cycle depending on the number of unallocated uops. This event is counted on a per-core basis.", 218 "PublicDescription": "This event count the number of undelivered (unallocated) uops from the Front-end to the Resource Allocation Table (RAT) while the Back-end of the processor is not stalled. The Front-end can allocate up to 4 uops per cycle so this event can increment 0-4 times per cycle depending on the number of unallocated uops. This event is counted on a per-core basis.",
199 "EventCode": "0x9C", 219 "EventCode": "0x9C",
200 "Counter": "0,1,2,3", 220 "Counter": "0,1,2,3",
@@ -270,25 +290,5 @@
270 "SampleAfterValue": "2000003", 290 "SampleAfterValue": "2000003",
271 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.", 291 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.",
272 "CounterHTOff": "0,1,2,3,4,5,6,7" 292 "CounterHTOff": "0,1,2,3,4,5,6,7"
273 },
274 {
275 "EventCode": "0x79",
276 "Counter": "0,1,2,3",
277 "UMask": "0x30",
278 "EdgeDetect": "1",
279 "EventName": "IDQ.MS_SWITCHES",
280 "SampleAfterValue": "2000003",
281 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
282 "CounterMask": "1",
283 "CounterHTOff": "0,1,2,3,4,5,6,7"
284 },
285 {
286 "EventCode": "0x80",
287 "Counter": "0,1,2,3",
288 "UMask": "0x4",
289 "EventName": "ICACHE.IFDATA_STALL",
290 "SampleAfterValue": "2000003",
291 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction-cache miss.",
292 "CounterHTOff": "0,1,2,3,4,5,6,7"
293 } 293 }
294] \ No newline at end of file 294] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswell/memory.json b/tools/perf/pmu-events/arch/x86/haswell/memory.json
index aab981b42339..e5f9fa6655b3 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/memory.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/memory.json
@@ -401,6 +401,7 @@
401 "CounterHTOff": "3" 401 "CounterHTOff": "3"
402 }, 402 },
403 { 403 {
404 "PublicDescription": "Counts all requests that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
404 "EventCode": "0xB7, 0xBB", 405 "EventCode": "0xB7, 0xBB",
405 "MSRValue": "0x3fffc08fff", 406 "MSRValue": "0x3fffc08fff",
406 "Counter": "0,1,2,3", 407 "Counter": "0,1,2,3",
@@ -413,6 +414,7 @@
413 "CounterHTOff": "0,1,2,3" 414 "CounterHTOff": "0,1,2,3"
414 }, 415 },
415 { 416 {
417 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
416 "EventCode": "0xB7, 0xBB", 418 "EventCode": "0xB7, 0xBB",
417 "MSRValue": "0x01004007f7", 419 "MSRValue": "0x01004007f7",
418 "Counter": "0,1,2,3", 420 "Counter": "0,1,2,3",
@@ -425,6 +427,7 @@
425 "CounterHTOff": "0,1,2,3" 427 "CounterHTOff": "0,1,2,3"
426 }, 428 },
427 { 429 {
430 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
428 "EventCode": "0xB7, 0xBB", 431 "EventCode": "0xB7, 0xBB",
429 "MSRValue": "0x3fffc007f7", 432 "MSRValue": "0x3fffc007f7",
430 "Counter": "0,1,2,3", 433 "Counter": "0,1,2,3",
@@ -437,6 +440,7 @@
437 "CounterHTOff": "0,1,2,3" 440 "CounterHTOff": "0,1,2,3"
438 }, 441 },
439 { 442 {
443 "PublicDescription": "Counts all demand & prefetch code reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
440 "EventCode": "0xB7, 0xBB", 444 "EventCode": "0xB7, 0xBB",
441 "MSRValue": "0x0100400244", 445 "MSRValue": "0x0100400244",
442 "Counter": "0,1,2,3", 446 "Counter": "0,1,2,3",
@@ -449,6 +453,7 @@
449 "CounterHTOff": "0,1,2,3" 453 "CounterHTOff": "0,1,2,3"
450 }, 454 },
451 { 455 {
456 "PublicDescription": "Counts all demand & prefetch code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
452 "EventCode": "0xB7, 0xBB", 457 "EventCode": "0xB7, 0xBB",
453 "MSRValue": "0x3fffc00244", 458 "MSRValue": "0x3fffc00244",
454 "Counter": "0,1,2,3", 459 "Counter": "0,1,2,3",
@@ -461,6 +466,7 @@
461 "CounterHTOff": "0,1,2,3" 466 "CounterHTOff": "0,1,2,3"
462 }, 467 },
463 { 468 {
469 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
464 "EventCode": "0xB7, 0xBB", 470 "EventCode": "0xB7, 0xBB",
465 "MSRValue": "0x0100400122", 471 "MSRValue": "0x0100400122",
466 "Counter": "0,1,2,3", 472 "Counter": "0,1,2,3",
@@ -473,6 +479,7 @@
473 "CounterHTOff": "0,1,2,3" 479 "CounterHTOff": "0,1,2,3"
474 }, 480 },
475 { 481 {
482 "PublicDescription": "Counts all demand & prefetch RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
476 "EventCode": "0xB7, 0xBB", 483 "EventCode": "0xB7, 0xBB",
477 "MSRValue": "0x3fffc00122", 484 "MSRValue": "0x3fffc00122",
478 "Counter": "0,1,2,3", 485 "Counter": "0,1,2,3",
@@ -485,6 +492,7 @@
485 "CounterHTOff": "0,1,2,3" 492 "CounterHTOff": "0,1,2,3"
486 }, 493 },
487 { 494 {
495 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
488 "EventCode": "0xB7, 0xBB", 496 "EventCode": "0xB7, 0xBB",
489 "MSRValue": "0x0100400091", 497 "MSRValue": "0x0100400091",
490 "Counter": "0,1,2,3", 498 "Counter": "0,1,2,3",
@@ -497,6 +505,7 @@
497 "CounterHTOff": "0,1,2,3" 505 "CounterHTOff": "0,1,2,3"
498 }, 506 },
499 { 507 {
508 "PublicDescription": "Counts all demand & prefetch data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
500 "EventCode": "0xB7, 0xBB", 509 "EventCode": "0xB7, 0xBB",
501 "MSRValue": "0x3fffc00091", 510 "MSRValue": "0x3fffc00091",
502 "Counter": "0,1,2,3", 511 "Counter": "0,1,2,3",
@@ -509,6 +518,7 @@
509 "CounterHTOff": "0,1,2,3" 518 "CounterHTOff": "0,1,2,3"
510 }, 519 },
511 { 520 {
521 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
512 "EventCode": "0xB7, 0xBB", 522 "EventCode": "0xB7, 0xBB",
513 "MSRValue": "0x3fffc00200", 523 "MSRValue": "0x3fffc00200",
514 "Counter": "0,1,2,3", 524 "Counter": "0,1,2,3",
@@ -521,6 +531,7 @@
521 "CounterHTOff": "0,1,2,3" 531 "CounterHTOff": "0,1,2,3"
522 }, 532 },
523 { 533 {
534 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
524 "EventCode": "0xB7, 0xBB", 535 "EventCode": "0xB7, 0xBB",
525 "MSRValue": "0x3fffc00100", 536 "MSRValue": "0x3fffc00100",
526 "Counter": "0,1,2,3", 537 "Counter": "0,1,2,3",
@@ -533,6 +544,7 @@
533 "CounterHTOff": "0,1,2,3" 544 "CounterHTOff": "0,1,2,3"
534 }, 545 },
535 { 546 {
547 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
536 "EventCode": "0xB7, 0xBB", 548 "EventCode": "0xB7, 0xBB",
537 "MSRValue": "0x3fffc00080", 549 "MSRValue": "0x3fffc00080",
538 "Counter": "0,1,2,3", 550 "Counter": "0,1,2,3",
@@ -545,6 +557,7 @@
545 "CounterHTOff": "0,1,2,3" 557 "CounterHTOff": "0,1,2,3"
546 }, 558 },
547 { 559 {
560 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
548 "EventCode": "0xB7, 0xBB", 561 "EventCode": "0xB7, 0xBB",
549 "MSRValue": "0x3fffc00040", 562 "MSRValue": "0x3fffc00040",
550 "Counter": "0,1,2,3", 563 "Counter": "0,1,2,3",
@@ -557,6 +570,7 @@
557 "CounterHTOff": "0,1,2,3" 570 "CounterHTOff": "0,1,2,3"
558 }, 571 },
559 { 572 {
573 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
560 "EventCode": "0xB7, 0xBB", 574 "EventCode": "0xB7, 0xBB",
561 "MSRValue": "0x3fffc00020", 575 "MSRValue": "0x3fffc00020",
562 "Counter": "0,1,2,3", 576 "Counter": "0,1,2,3",
@@ -569,6 +583,7 @@
569 "CounterHTOff": "0,1,2,3" 583 "CounterHTOff": "0,1,2,3"
570 }, 584 },
571 { 585 {
586 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
572 "EventCode": "0xB7, 0xBB", 587 "EventCode": "0xB7, 0xBB",
573 "MSRValue": "0x3fffc00010", 588 "MSRValue": "0x3fffc00010",
574 "Counter": "0,1,2,3", 589 "Counter": "0,1,2,3",
@@ -581,6 +596,7 @@
581 "CounterHTOff": "0,1,2,3" 596 "CounterHTOff": "0,1,2,3"
582 }, 597 },
583 { 598 {
599 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
584 "EventCode": "0xB7, 0xBB", 600 "EventCode": "0xB7, 0xBB",
585 "MSRValue": "0x0100400004", 601 "MSRValue": "0x0100400004",
586 "Counter": "0,1,2,3", 602 "Counter": "0,1,2,3",
@@ -593,6 +609,7 @@
593 "CounterHTOff": "0,1,2,3" 609 "CounterHTOff": "0,1,2,3"
594 }, 610 },
595 { 611 {
612 "PublicDescription": "Counts all demand code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
596 "EventCode": "0xB7, 0xBB", 613 "EventCode": "0xB7, 0xBB",
597 "MSRValue": "0x3fffc00004", 614 "MSRValue": "0x3fffc00004",
598 "Counter": "0,1,2,3", 615 "Counter": "0,1,2,3",
@@ -605,6 +622,7 @@
605 "CounterHTOff": "0,1,2,3" 622 "CounterHTOff": "0,1,2,3"
606 }, 623 },
607 { 624 {
625 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
608 "EventCode": "0xB7, 0xBB", 626 "EventCode": "0xB7, 0xBB",
609 "MSRValue": "0x0100400002", 627 "MSRValue": "0x0100400002",
610 "Counter": "0,1,2,3", 628 "Counter": "0,1,2,3",
@@ -617,6 +635,7 @@
617 "CounterHTOff": "0,1,2,3" 635 "CounterHTOff": "0,1,2,3"
618 }, 636 },
619 { 637 {
638 "PublicDescription": "Counts all demand data writes (RFOs) that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
620 "EventCode": "0xB7, 0xBB", 639 "EventCode": "0xB7, 0xBB",
621 "MSRValue": "0x3fffc00002", 640 "MSRValue": "0x3fffc00002",
622 "Counter": "0,1,2,3", 641 "Counter": "0,1,2,3",
@@ -629,6 +648,7 @@
629 "CounterHTOff": "0,1,2,3" 648 "CounterHTOff": "0,1,2,3"
630 }, 649 },
631 { 650 {
651 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
632 "EventCode": "0xB7, 0xBB", 652 "EventCode": "0xB7, 0xBB",
633 "MSRValue": "0x0100400001", 653 "MSRValue": "0x0100400001",
634 "Counter": "0,1,2,3", 654 "Counter": "0,1,2,3",
@@ -641,6 +661,7 @@
641 "CounterHTOff": "0,1,2,3" 661 "CounterHTOff": "0,1,2,3"
642 }, 662 },
643 { 663 {
664 "PublicDescription": "Counts demand data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
644 "EventCode": "0xB7, 0xBB", 665 "EventCode": "0xB7, 0xBB",
645 "MSRValue": "0x3fffc00001", 666 "MSRValue": "0x3fffc00001",
646 "Counter": "0,1,2,3", 667 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/haswell/other.json b/tools/perf/pmu-events/arch/x86/haswell/other.json
index 85d6a14baf9d..8a4d898d76c1 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/other.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
14 "EventCode": "0x5C",
15 "Counter": "0,1,2,3",
16 "UMask": "0x2",
17 "EventName": "CPL_CYCLES.RING123",
18 "SampleAfterValue": "2000003",
19 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "EventCode": "0x5C", 13 "EventCode": "0x5C",
24 "Counter": "0,1,2,3", 14 "Counter": "0,1,2,3",
25 "UMask": "0x1", 15 "UMask": "0x1",
@@ -31,6 +21,16 @@
31 "CounterHTOff": "0,1,2,3,4,5,6,7" 21 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 }, 22 },
33 { 23 {
24 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
25 "EventCode": "0x5C",
26 "Counter": "0,1,2,3",
27 "UMask": "0x2",
28 "EventName": "CPL_CYCLES.RING123",
29 "SampleAfterValue": "2000003",
30 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
31 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 },
33 {
34 "PublicDescription": "Cycles in which the L1D and L2 are locked, due to a UC lock or split lock.", 34 "PublicDescription": "Cycles in which the L1D and L2 are locked, due to a UC lock or split lock.",
35 "EventCode": "0x63", 35 "EventCode": "0x63",
36 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/haswell/pipeline.json b/tools/perf/pmu-events/arch/x86/haswell/pipeline.json
index 0099848607ad..a4dcfce4a512 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/pipeline.json
@@ -2,33 +2,43 @@
2 { 2 {
3 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. INST_RETIRED.ANY is counted by a designated fixed counter, leaving the programmable counters available for other events. Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 3 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. INST_RETIRED.ANY is counted by a designated fixed counter, leaving the programmable counters available for other events. Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
4 "EventCode": "0x00", 4 "EventCode": "0x00",
5 "Counter": "Fixed counter 1", 5 "Counter": "Fixed counter 0",
6 "UMask": "0x1", 6 "UMask": "0x1",
7 "Errata": "HSD140, HSD143", 7 "Errata": "HSD140, HSD143",
8 "EventName": "INST_RETIRED.ANY", 8 "EventName": "INST_RETIRED.ANY",
9 "SampleAfterValue": "2000003", 9 "SampleAfterValue": "2000003",
10 "BriefDescription": "Instructions retired from execution.", 10 "BriefDescription": "Instructions retired from execution.",
11 "CounterHTOff": "Fixed counter 1" 11 "CounterHTOff": "Fixed counter 0"
12 }, 12 },
13 { 13 {
14 "PublicDescription": "This event counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.", 14 "PublicDescription": "This event counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.",
15 "EventCode": "0x00", 15 "EventCode": "0x00",
16 "Counter": "Fixed counter 2", 16 "Counter": "Fixed counter 1",
17 "UMask": "0x2", 17 "UMask": "0x2",
18 "EventName": "CPU_CLK_UNHALTED.THREAD", 18 "EventName": "CPU_CLK_UNHALTED.THREAD",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "BriefDescription": "Core cycles when the thread is not in halt state.", 20 "BriefDescription": "Core cycles when the thread is not in halt state.",
21 "CounterHTOff": "Fixed counter 2" 21 "CounterHTOff": "Fixed counter 1"
22 },
23 {
24 "EventCode": "0x00",
25 "Counter": "Fixed counter 1",
26 "UMask": "0x2",
27 "AnyThread": "1",
28 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
29 "SampleAfterValue": "2000003",
30 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
31 "CounterHTOff": "Fixed counter 1"
22 }, 32 },
23 { 33 {
24 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state.", 34 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state.",
25 "EventCode": "0x00", 35 "EventCode": "0x00",
26 "Counter": "Fixed counter 3", 36 "Counter": "Fixed counter 2",
27 "UMask": "0x3", 37 "UMask": "0x3",
28 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 38 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
29 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
30 "BriefDescription": "Reference cycles when the core is not in halt state.", 40 "BriefDescription": "Reference cycles when the core is not in halt state.",
31 "CounterHTOff": "Fixed counter 3" 41 "CounterHTOff": "Fixed counter 2"
32 }, 42 },
33 { 43 {
34 "PublicDescription": "This event counts loads that followed a store to the same address, where the data could not be forwarded inside the pipeline from the store to the load. The most common reason why store forwarding would be blocked is when a load's address range overlaps with a preceding smaller uncompleted store. The penalty for blocked store forwarding is that the load must wait for the store to write its value to the cache before it can be issued.", 44 "PublicDescription": "This event counts loads that followed a store to the same address, where the data could not be forwarded inside the pipeline from the store to the load. The most common reason why store forwarding would be blocked is when a load's address range overlaps with a preceding smaller uncompleted store. The penalty for blocked store forwarding is that the load must wait for the store to write its value to the cache before it can be issued.",
@@ -67,7 +77,19 @@
67 "UMask": "0x3", 77 "UMask": "0x3",
68 "EventName": "INT_MISC.RECOVERY_CYCLES", 78 "EventName": "INT_MISC.RECOVERY_CYCLES",
69 "SampleAfterValue": "2000003", 79 "SampleAfterValue": "2000003",
70 "BriefDescription": "Number of cycles waiting for the checkpoints in Resource Allocation Table (RAT) to be recovered after Nuke due to all other cases except JEClear (e.g. whenever a ucode assist is needed like SSE exception, memory disambiguation, etc...)", 80 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)",
81 "CounterMask": "1",
82 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 },
84 {
85 "PublicDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
86 "EventCode": "0x0D",
87 "Counter": "0,1,2,3",
88 "UMask": "0x3",
89 "AnyThread": "1",
90 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
91 "SampleAfterValue": "2000003",
92 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke)",
71 "CounterMask": "1", 93 "CounterMask": "1",
72 "CounterHTOff": "0,1,2,3,4,5,6,7" 94 "CounterHTOff": "0,1,2,3,4,5,6,7"
73 }, 95 },
@@ -82,6 +104,29 @@
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 104 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 105 },
84 { 106 {
107 "EventCode": "0x0E",
108 "Invert": "1",
109 "Counter": "0,1,2,3",
110 "UMask": "0x1",
111 "EventName": "UOPS_ISSUED.STALL_CYCLES",
112 "SampleAfterValue": "2000003",
113 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread.",
114 "CounterMask": "1",
115 "CounterHTOff": "0,1,2,3"
116 },
117 {
118 "EventCode": "0x0E",
119 "Invert": "1",
120 "Counter": "0,1,2,3",
121 "UMask": "0x1",
122 "AnyThread": "1",
123 "EventName": "UOPS_ISSUED.CORE_STALL_CYCLES",
124 "SampleAfterValue": "2000003",
125 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for all threads.",
126 "CounterMask": "1",
127 "CounterHTOff": "0,1,2,3"
128 },
129 {
85 "PublicDescription": "Number of flags-merge uops allocated. Such uops add delay.", 130 "PublicDescription": "Number of flags-merge uops allocated. Such uops add delay.",
86 "EventCode": "0x0E", 131 "EventCode": "0x0E",
87 "Counter": "0,1,2,3", 132 "Counter": "0,1,2,3",
@@ -112,35 +157,32 @@
112 "CounterHTOff": "0,1,2,3,4,5,6,7" 157 "CounterHTOff": "0,1,2,3,4,5,6,7"
113 }, 158 },
114 { 159 {
115 "EventCode": "0x0E", 160 "EventCode": "0x14",
116 "Invert": "1",
117 "Counter": "0,1,2,3", 161 "Counter": "0,1,2,3",
118 "UMask": "0x1", 162 "UMask": "0x2",
119 "EventName": "UOPS_ISSUED.STALL_CYCLES", 163 "EventName": "ARITH.DIVIDER_UOPS",
120 "SampleAfterValue": "2000003", 164 "SampleAfterValue": "2000003",
121 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread.", 165 "BriefDescription": "Any uop executed by the Divider. (This includes all divide uops, sqrt, ...)",
122 "CounterMask": "1", 166 "CounterHTOff": "0,1,2,3,4,5,6,7"
123 "CounterHTOff": "0,1,2,3"
124 }, 167 },
125 { 168 {
126 "EventCode": "0x0E", 169 "PublicDescription": "Counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.",
127 "Invert": "1", 170 "EventCode": "0x3C",
128 "Counter": "0,1,2,3", 171 "Counter": "0,1,2,3",
129 "UMask": "0x1", 172 "UMask": "0x0",
130 "AnyThread": "1", 173 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
131 "EventName": "UOPS_ISSUED.CORE_STALL_CYCLES",
132 "SampleAfterValue": "2000003", 174 "SampleAfterValue": "2000003",
133 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for all threads.", 175 "BriefDescription": "Thread cycles when thread is not in halt state",
134 "CounterMask": "1", 176 "CounterHTOff": "0,1,2,3,4,5,6,7"
135 "CounterHTOff": "0,1,2,3"
136 }, 177 },
137 { 178 {
138 "EventCode": "0x14", 179 "EventCode": "0x3C",
139 "Counter": "0,1,2,3", 180 "Counter": "0,1,2,3",
140 "UMask": "0x2", 181 "UMask": "0x0",
141 "EventName": "ARITH.DIVIDER_UOPS", 182 "AnyThread": "1",
183 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
142 "SampleAfterValue": "2000003", 184 "SampleAfterValue": "2000003",
143 "BriefDescription": "Any uop executed by the Divider. (This includes all divide uops, sqrt, ...)", 185 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
144 "CounterHTOff": "0,1,2,3,4,5,6,7" 186 "CounterHTOff": "0,1,2,3,4,5,6,7"
145 }, 187 },
146 { 188 {
@@ -154,6 +196,38 @@
154 "CounterHTOff": "0,1,2,3,4,5,6,7" 196 "CounterHTOff": "0,1,2,3,4,5,6,7"
155 }, 197 },
156 { 198 {
199 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
200 "EventCode": "0x3C",
201 "Counter": "0,1,2,3",
202 "UMask": "0x1",
203 "AnyThread": "1",
204 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
205 "SampleAfterValue": "2000003",
206 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
207 "CounterHTOff": "0,1,2,3,4,5,6,7"
208 },
209 {
210 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
211 "EventCode": "0x3C",
212 "Counter": "0,1,2,3",
213 "UMask": "0x1",
214 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
215 "SampleAfterValue": "2000003",
216 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
217 "CounterHTOff": "0,1,2,3,4,5,6,7"
218 },
219 {
220 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
221 "EventCode": "0x3C",
222 "Counter": "0,1,2,3",
223 "UMask": "0x1",
224 "AnyThread": "1",
225 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
226 "SampleAfterValue": "2000003",
227 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
228 "CounterHTOff": "0,1,2,3,4,5,6,7"
229 },
230 {
157 "EventCode": "0x3c", 231 "EventCode": "0x3c",
158 "Counter": "0,1,2,3", 232 "Counter": "0,1,2,3",
159 "UMask": "0x2", 233 "UMask": "0x2",
@@ -163,6 +237,15 @@
163 "CounterHTOff": "0,1,2,3" 237 "CounterHTOff": "0,1,2,3"
164 }, 238 },
165 { 239 {
240 "EventCode": "0x3C",
241 "Counter": "0,1,2,3",
242 "UMask": "0x2",
243 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
244 "SampleAfterValue": "2000003",
245 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
246 "CounterHTOff": "0,1,2,3,4,5,6,7"
247 },
248 {
166 "PublicDescription": "Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.", 249 "PublicDescription": "Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.",
167 "EventCode": "0x4c", 250 "EventCode": "0x4c",
168 "Counter": "0,1,2,3", 251 "Counter": "0,1,2,3",
@@ -233,6 +316,18 @@
233 "CounterHTOff": "0,1,2,3,4,5,6,7" 316 "CounterHTOff": "0,1,2,3,4,5,6,7"
234 }, 317 },
235 { 318 {
319 "EventCode": "0x5E",
320 "Invert": "1",
321 "Counter": "0,1,2,3",
322 "UMask": "0x1",
323 "EdgeDetect": "1",
324 "EventName": "RS_EVENTS.EMPTY_END",
325 "SampleAfterValue": "200003",
326 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
327 "CounterMask": "1",
328 "CounterHTOff": "0,1,2,3,4,5,6,7"
329 },
330 {
236 "PublicDescription": "This event counts cycles where the decoder is stalled on an instruction with a length changing prefix (LCP).", 331 "PublicDescription": "This event counts cycles where the decoder is stalled on an instruction with a length changing prefix (LCP).",
237 "EventCode": "0x87", 332 "EventCode": "0x87",
238 "Counter": "0,1,2,3", 333 "Counter": "0,1,2,3",
@@ -409,6 +504,15 @@
409 { 504 {
410 "EventCode": "0x89", 505 "EventCode": "0x89",
411 "Counter": "0,1,2,3", 506 "Counter": "0,1,2,3",
507 "UMask": "0xa0",
508 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
509 "SampleAfterValue": "200003",
510 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
511 "CounterHTOff": "0,1,2,3,4,5,6,7"
512 },
513 {
514 "EventCode": "0x89",
515 "Counter": "0,1,2,3",
412 "UMask": "0xc1", 516 "UMask": "0xc1",
413 "EventName": "BR_MISP_EXEC.ALL_CONDITIONAL", 517 "EventName": "BR_MISP_EXEC.ALL_CONDITIONAL",
414 "SampleAfterValue": "200003", 518 "SampleAfterValue": "200003",
@@ -445,6 +549,26 @@
445 "CounterHTOff": "0,1,2,3,4,5,6,7" 549 "CounterHTOff": "0,1,2,3,4,5,6,7"
446 }, 550 },
447 { 551 {
552 "PublicDescription": "Cycles per core when uops are exectuted in port 0.",
553 "EventCode": "0xA1",
554 "Counter": "0,1,2,3",
555 "UMask": "0x1",
556 "AnyThread": "1",
557 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
558 "SampleAfterValue": "2000003",
559 "BriefDescription": "Cycles per core when uops are executed in port 0.",
560 "CounterHTOff": "0,1,2,3,4,5,6,7"
561 },
562 {
563 "EventCode": "0xA1",
564 "Counter": "0,1,2,3",
565 "UMask": "0x1",
566 "EventName": "UOPS_DISPATCHED_PORT.PORT_0",
567 "SampleAfterValue": "2000003",
568 "BriefDescription": "Cycles per thread when uops are executed in port 0.",
569 "CounterHTOff": "0,1,2,3,4,5,6,7"
570 },
571 {
448 "PublicDescription": "Cycles which a uop is dispatched on port 1 in this thread.", 572 "PublicDescription": "Cycles which a uop is dispatched on port 1 in this thread.",
449 "EventCode": "0xA1", 573 "EventCode": "0xA1",
450 "Counter": "0,1,2,3", 574 "Counter": "0,1,2,3",
@@ -455,6 +579,26 @@
455 "CounterHTOff": "0,1,2,3,4,5,6,7" 579 "CounterHTOff": "0,1,2,3,4,5,6,7"
456 }, 580 },
457 { 581 {
582 "PublicDescription": "Cycles per core when uops are exectuted in port 1.",
583 "EventCode": "0xA1",
584 "Counter": "0,1,2,3",
585 "UMask": "0x2",
586 "AnyThread": "1",
587 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
588 "SampleAfterValue": "2000003",
589 "BriefDescription": "Cycles per core when uops are executed in port 1.",
590 "CounterHTOff": "0,1,2,3,4,5,6,7"
591 },
592 {
593 "EventCode": "0xA1",
594 "Counter": "0,1,2,3",
595 "UMask": "0x2",
596 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
597 "SampleAfterValue": "2000003",
598 "BriefDescription": "Cycles per thread when uops are executed in port 1.",
599 "CounterHTOff": "0,1,2,3,4,5,6,7"
600 },
601 {
458 "PublicDescription": "Cycles which a uop is dispatched on port 2 in this thread.", 602 "PublicDescription": "Cycles which a uop is dispatched on port 2 in this thread.",
459 "EventCode": "0xA1", 603 "EventCode": "0xA1",
460 "Counter": "0,1,2,3", 604 "Counter": "0,1,2,3",
@@ -465,6 +609,25 @@
465 "CounterHTOff": "0,1,2,3,4,5,6,7" 609 "CounterHTOff": "0,1,2,3,4,5,6,7"
466 }, 610 },
467 { 611 {
612 "EventCode": "0xA1",
613 "Counter": "0,1,2,3",
614 "UMask": "0x4",
615 "AnyThread": "1",
616 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
617 "SampleAfterValue": "2000003",
618 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
619 "CounterHTOff": "0,1,2,3,4,5,6,7"
620 },
621 {
622 "EventCode": "0xA1",
623 "Counter": "0,1,2,3",
624 "UMask": "0x4",
625 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
626 "SampleAfterValue": "2000003",
627 "BriefDescription": "Cycles per thread when uops are executed in port 2.",
628 "CounterHTOff": "0,1,2,3,4,5,6,7"
629 },
630 {
468 "PublicDescription": "Cycles which a uop is dispatched on port 3 in this thread.", 631 "PublicDescription": "Cycles which a uop is dispatched on port 3 in this thread.",
469 "EventCode": "0xA1", 632 "EventCode": "0xA1",
470 "Counter": "0,1,2,3", 633 "Counter": "0,1,2,3",
@@ -475,6 +638,25 @@
475 "CounterHTOff": "0,1,2,3,4,5,6,7" 638 "CounterHTOff": "0,1,2,3,4,5,6,7"
476 }, 639 },
477 { 640 {
641 "EventCode": "0xA1",
642 "Counter": "0,1,2,3",
643 "UMask": "0x8",
644 "AnyThread": "1",
645 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
646 "SampleAfterValue": "2000003",
647 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
648 "CounterHTOff": "0,1,2,3,4,5,6,7"
649 },
650 {
651 "EventCode": "0xA1",
652 "Counter": "0,1,2,3",
653 "UMask": "0x8",
654 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
655 "SampleAfterValue": "2000003",
656 "BriefDescription": "Cycles per thread when uops are executed in port 3.",
657 "CounterHTOff": "0,1,2,3,4,5,6,7"
658 },
659 {
478 "PublicDescription": "Cycles which a uop is dispatched on port 4 in this thread.", 660 "PublicDescription": "Cycles which a uop is dispatched on port 4 in this thread.",
479 "EventCode": "0xA1", 661 "EventCode": "0xA1",
480 "Counter": "0,1,2,3", 662 "Counter": "0,1,2,3",
@@ -485,6 +667,26 @@
485 "CounterHTOff": "0,1,2,3,4,5,6,7" 667 "CounterHTOff": "0,1,2,3,4,5,6,7"
486 }, 668 },
487 { 669 {
670 "PublicDescription": "Cycles per core when uops are exectuted in port 4.",
671 "EventCode": "0xA1",
672 "Counter": "0,1,2,3",
673 "UMask": "0x10",
674 "AnyThread": "1",
675 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
676 "SampleAfterValue": "2000003",
677 "BriefDescription": "Cycles per core when uops are executed in port 4.",
678 "CounterHTOff": "0,1,2,3,4,5,6,7"
679 },
680 {
681 "EventCode": "0xA1",
682 "Counter": "0,1,2,3",
683 "UMask": "0x10",
684 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
685 "SampleAfterValue": "2000003",
686 "BriefDescription": "Cycles per thread when uops are executed in port 4.",
687 "CounterHTOff": "0,1,2,3,4,5,6,7"
688 },
689 {
488 "PublicDescription": "Cycles which a uop is dispatched on port 5 in this thread.", 690 "PublicDescription": "Cycles which a uop is dispatched on port 5 in this thread.",
489 "EventCode": "0xA1", 691 "EventCode": "0xA1",
490 "Counter": "0,1,2,3", 692 "Counter": "0,1,2,3",
@@ -495,6 +697,26 @@
495 "CounterHTOff": "0,1,2,3,4,5,6,7" 697 "CounterHTOff": "0,1,2,3,4,5,6,7"
496 }, 698 },
497 { 699 {
700 "PublicDescription": "Cycles per core when uops are exectuted in port 5.",
701 "EventCode": "0xA1",
702 "Counter": "0,1,2,3",
703 "UMask": "0x20",
704 "AnyThread": "1",
705 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
706 "SampleAfterValue": "2000003",
707 "BriefDescription": "Cycles per core when uops are executed in port 5.",
708 "CounterHTOff": "0,1,2,3,4,5,6,7"
709 },
710 {
711 "EventCode": "0xA1",
712 "Counter": "0,1,2,3",
713 "UMask": "0x20",
714 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
715 "SampleAfterValue": "2000003",
716 "BriefDescription": "Cycles per thread when uops are executed in port 5.",
717 "CounterHTOff": "0,1,2,3,4,5,6,7"
718 },
719 {
498 "PublicDescription": "Cycles which a uop is dispatched on port 6 in this thread.", 720 "PublicDescription": "Cycles which a uop is dispatched on port 6 in this thread.",
499 "EventCode": "0xA1", 721 "EventCode": "0xA1",
500 "Counter": "0,1,2,3", 722 "Counter": "0,1,2,3",
@@ -505,6 +727,26 @@
505 "CounterHTOff": "0,1,2,3,4,5,6,7" 727 "CounterHTOff": "0,1,2,3,4,5,6,7"
506 }, 728 },
507 { 729 {
730 "PublicDescription": "Cycles per core when uops are exectuted in port 6.",
731 "EventCode": "0xA1",
732 "Counter": "0,1,2,3",
733 "UMask": "0x40",
734 "AnyThread": "1",
735 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
736 "SampleAfterValue": "2000003",
737 "BriefDescription": "Cycles per core when uops are executed in port 6.",
738 "CounterHTOff": "0,1,2,3,4,5,6,7"
739 },
740 {
741 "EventCode": "0xA1",
742 "Counter": "0,1,2,3",
743 "UMask": "0x40",
744 "EventName": "UOPS_DISPATCHED_PORT.PORT_6",
745 "SampleAfterValue": "2000003",
746 "BriefDescription": "Cycles per thread when uops are executed in port 6.",
747 "CounterHTOff": "0,1,2,3,4,5,6,7"
748 },
749 {
508 "PublicDescription": "Cycles which a uop is dispatched on port 7 in this thread.", 750 "PublicDescription": "Cycles which a uop is dispatched on port 7 in this thread.",
509 "EventCode": "0xA1", 751 "EventCode": "0xA1",
510 "Counter": "0,1,2,3", 752 "Counter": "0,1,2,3",
@@ -515,6 +757,25 @@
515 "CounterHTOff": "0,1,2,3,4,5,6,7" 757 "CounterHTOff": "0,1,2,3,4,5,6,7"
516 }, 758 },
517 { 759 {
760 "EventCode": "0xA1",
761 "Counter": "0,1,2,3",
762 "UMask": "0x80",
763 "AnyThread": "1",
764 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
765 "SampleAfterValue": "2000003",
766 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
767 "CounterHTOff": "0,1,2,3,4,5,6,7"
768 },
769 {
770 "EventCode": "0xA1",
771 "Counter": "0,1,2,3",
772 "UMask": "0x80",
773 "EventName": "UOPS_DISPATCHED_PORT.PORT_7",
774 "SampleAfterValue": "2000003",
775 "BriefDescription": "Cycles per thread when uops are executed in port 7.",
776 "CounterHTOff": "0,1,2,3,4,5,6,7"
777 },
778 {
518 "PublicDescription": "Cycles allocation is stalled due to resource related reason.", 779 "PublicDescription": "Cycles allocation is stalled due to resource related reason.",
519 "EventCode": "0xA2", 780 "EventCode": "0xA2",
520 "Counter": "0,1,2,3", 781 "Counter": "0,1,2,3",
@@ -566,17 +827,6 @@
566 "CounterHTOff": "0,1,2,3,4,5,6,7" 827 "CounterHTOff": "0,1,2,3,4,5,6,7"
567 }, 828 },
568 { 829 {
569 "PublicDescription": "Cycles with pending L1 data cache miss loads. Set Cmask=8 to count cycle.",
570 "EventCode": "0xA3",
571 "Counter": "2",
572 "UMask": "0x8",
573 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
574 "SampleAfterValue": "2000003",
575 "BriefDescription": "Cycles with pending L1 cache miss loads.",
576 "CounterMask": "8",
577 "CounterHTOff": "2"
578 },
579 {
580 "PublicDescription": "Cycles with pending memory loads. Set Cmask=2 to count cycle.", 830 "PublicDescription": "Cycles with pending memory loads. Set Cmask=2 to count cycle.",
581 "EventCode": "0xA3", 831 "EventCode": "0xA3",
582 "Counter": "0,1,2,3", 832 "Counter": "0,1,2,3",
@@ -594,7 +844,7 @@
594 "UMask": "0x4", 844 "UMask": "0x4",
595 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 845 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
596 "SampleAfterValue": "2000003", 846 "SampleAfterValue": "2000003",
597 "BriefDescription": "Total execution stalls", 847 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
598 "CounterMask": "4", 848 "CounterMask": "4",
599 "CounterHTOff": "0,1,2,3" 849 "CounterHTOff": "0,1,2,3"
600 }, 850 },
@@ -621,6 +871,17 @@
621 "CounterHTOff": "0,1,2,3" 871 "CounterHTOff": "0,1,2,3"
622 }, 872 },
623 { 873 {
874 "PublicDescription": "Cycles with pending L1 data cache miss loads. Set Cmask=8 to count cycle.",
875 "EventCode": "0xA3",
876 "Counter": "2",
877 "UMask": "0x8",
878 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
879 "SampleAfterValue": "2000003",
880 "BriefDescription": "Cycles with pending L1 cache miss loads.",
881 "CounterMask": "8",
882 "CounterHTOff": "2"
883 },
884 {
624 "PublicDescription": "Execution stalls due to L1 data cache miss loads. Set Cmask=0CH.", 885 "PublicDescription": "Execution stalls due to L1 data cache miss loads. Set Cmask=0CH.",
625 "EventCode": "0xA3", 886 "EventCode": "0xA3",
626 "Counter": "2", 887 "Counter": "2",
@@ -642,14 +903,23 @@
642 "CounterHTOff": "0,1,2,3,4,5,6,7" 903 "CounterHTOff": "0,1,2,3,4,5,6,7"
643 }, 904 },
644 { 905 {
645 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.", 906 "EventCode": "0xA8",
646 "EventCode": "0xB1",
647 "Counter": "0,1,2,3", 907 "Counter": "0,1,2,3",
648 "UMask": "0x2", 908 "UMask": "0x1",
649 "Errata": "HSD30, HSM31", 909 "EventName": "LSD.CYCLES_ACTIVE",
650 "EventName": "UOPS_EXECUTED.CORE",
651 "SampleAfterValue": "2000003", 910 "SampleAfterValue": "2000003",
652 "BriefDescription": "Number of uops executed on the core.", 911 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
912 "CounterMask": "1",
913 "CounterHTOff": "0,1,2,3,4,5,6,7"
914 },
915 {
916 "EventCode": "0xA8",
917 "Counter": "0,1,2,3",
918 "UMask": "0x1",
919 "EventName": "LSD.CYCLES_4_UOPS",
920 "SampleAfterValue": "2000003",
921 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
922 "CounterMask": "4",
653 "CounterHTOff": "0,1,2,3,4,5,6,7" 923 "CounterHTOff": "0,1,2,3,4,5,6,7"
654 }, 924 },
655 { 925 {
@@ -665,24 +935,127 @@
665 "CounterHTOff": "0,1,2,3" 935 "CounterHTOff": "0,1,2,3"
666 }, 936 },
667 { 937 {
668 "PublicDescription": "Number of instructions at retirement.", 938 "PublicDescription": "This events counts the cycles where at least one uop was executed. It is counted per thread.",
669 "EventCode": "0xC0", 939 "EventCode": "0xB1",
670 "Counter": "0,1,2,3", 940 "Counter": "0,1,2,3",
671 "UMask": "0x0", 941 "UMask": "0x1",
672 "Errata": "HSD11, HSD140", 942 "Errata": "HSD144, HSD30, HSM31",
673 "EventName": "INST_RETIRED.ANY_P", 943 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
674 "SampleAfterValue": "2000003", 944 "SampleAfterValue": "2000003",
675 "BriefDescription": "Number of instructions retired. General Counter - architectural event", 945 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
946 "CounterMask": "1",
947 "CounterHTOff": "0,1,2,3"
948 },
949 {
950 "PublicDescription": "This events counts the cycles where at least two uop were executed. It is counted per thread.",
951 "EventCode": "0xB1",
952 "Counter": "0,1,2,3",
953 "UMask": "0x1",
954 "Errata": "HSD144, HSD30, HSM31",
955 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
956 "SampleAfterValue": "2000003",
957 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
958 "CounterMask": "2",
959 "CounterHTOff": "0,1,2,3"
960 },
961 {
962 "PublicDescription": "This events counts the cycles where at least three uop were executed. It is counted per thread.",
963 "EventCode": "0xB1",
964 "Counter": "0,1,2,3",
965 "UMask": "0x1",
966 "Errata": "HSD144, HSD30, HSM31",
967 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
968 "SampleAfterValue": "2000003",
969 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
970 "CounterMask": "3",
971 "CounterHTOff": "0,1,2,3"
972 },
973 {
974 "EventCode": "0xB1",
975 "Counter": "0,1,2,3",
976 "UMask": "0x1",
977 "Errata": "HSD144, HSD30, HSM31",
978 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
979 "SampleAfterValue": "2000003",
980 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
981 "CounterMask": "4",
982 "CounterHTOff": "0,1,2,3"
983 },
984 {
985 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.",
986 "EventCode": "0xB1",
987 "Counter": "0,1,2,3",
988 "UMask": "0x2",
989 "Errata": "HSD30, HSM31",
990 "EventName": "UOPS_EXECUTED.CORE",
991 "SampleAfterValue": "2000003",
992 "BriefDescription": "Number of uops executed on the core.",
676 "CounterHTOff": "0,1,2,3,4,5,6,7" 993 "CounterHTOff": "0,1,2,3,4,5,6,7"
677 }, 994 },
678 { 995 {
679 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.", 996 "EventCode": "0xb1",
680 "EventCode": "0xC0",
681 "Counter": "0,1,2,3", 997 "Counter": "0,1,2,3",
682 "UMask": "0x2", 998 "UMask": "0x2",
683 "EventName": "INST_RETIRED.X87", 999 "Errata": "HSD30, HSM31",
1000 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
684 "SampleAfterValue": "2000003", 1001 "SampleAfterValue": "2000003",
685 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions: Counts also flows that have several X87 or flows that use X87 uops in the exception handling.", 1002 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1003 "CounterMask": "1",
1004 "CounterHTOff": "0,1,2,3,4,5,6,7"
1005 },
1006 {
1007 "EventCode": "0xb1",
1008 "Counter": "0,1,2,3",
1009 "UMask": "0x2",
1010 "Errata": "HSD30, HSM31",
1011 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1012 "SampleAfterValue": "2000003",
1013 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1014 "CounterMask": "2",
1015 "CounterHTOff": "0,1,2,3,4,5,6,7"
1016 },
1017 {
1018 "EventCode": "0xb1",
1019 "Counter": "0,1,2,3",
1020 "UMask": "0x2",
1021 "Errata": "HSD30, HSM31",
1022 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1023 "SampleAfterValue": "2000003",
1024 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1025 "CounterMask": "3",
1026 "CounterHTOff": "0,1,2,3,4,5,6,7"
1027 },
1028 {
1029 "EventCode": "0xb1",
1030 "Counter": "0,1,2,3",
1031 "UMask": "0x2",
1032 "Errata": "HSD30, HSM31",
1033 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1034 "SampleAfterValue": "2000003",
1035 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1036 "CounterMask": "4",
1037 "CounterHTOff": "0,1,2,3,4,5,6,7"
1038 },
1039 {
1040 "EventCode": "0xb1",
1041 "Invert": "1",
1042 "Counter": "0,1,2,3",
1043 "UMask": "0x2",
1044 "Errata": "HSD30, HSM31",
1045 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1046 "SampleAfterValue": "2000003",
1047 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1048 "CounterHTOff": "0,1,2,3,4,5,6,7"
1049 },
1050 {
1051 "PublicDescription": "Number of instructions at retirement.",
1052 "EventCode": "0xC0",
1053 "Counter": "0,1,2,3",
1054 "UMask": "0x0",
1055 "Errata": "HSD11, HSD140",
1056 "EventName": "INST_RETIRED.ANY_P",
1057 "SampleAfterValue": "2000003",
1058 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
686 "CounterHTOff": "0,1,2,3,4,5,6,7" 1059 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 }, 1060 },
688 { 1061 {
@@ -698,6 +1071,16 @@
698 "CounterHTOff": "1" 1071 "CounterHTOff": "1"
699 }, 1072 },
700 { 1073 {
1074 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.",
1075 "EventCode": "0xC0",
1076 "Counter": "0,1,2,3",
1077 "UMask": "0x2",
1078 "EventName": "INST_RETIRED.X87",
1079 "SampleAfterValue": "2000003",
1080 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions: Counts also flows that have several X87 or flows that use X87 uops in the exception handling.",
1081 "CounterHTOff": "0,1,2,3,4,5,6,7"
1082 },
1083 {
701 "PublicDescription": "Number of microcode assists invoked by HW upon uop writeback.", 1084 "PublicDescription": "Number of microcode assists invoked by HW upon uop writeback.",
702 "EventCode": "0xC1", 1085 "EventCode": "0xC1",
703 "Counter": "0,1,2,3", 1086 "Counter": "0,1,2,3",
@@ -709,7 +1092,6 @@
709 }, 1092 },
710 { 1093 {
711 "PEBS": "1", 1094 "PEBS": "1",
712 "PublicDescription": "Counts the number of micro-ops retired. Use Cmask=1 and invert to count active cycles or stalled cycles.",
713 "EventCode": "0xC2", 1095 "EventCode": "0xC2",
714 "Counter": "0,1,2,3", 1096 "Counter": "0,1,2,3",
715 "UMask": "0x1", 1097 "UMask": "0x1",
@@ -720,17 +1102,6 @@
720 "Data_LA": "1" 1102 "Data_LA": "1"
721 }, 1103 },
722 { 1104 {
723 "PEBS": "1",
724 "PublicDescription": "This event counts the number of retirement slots used each cycle. There are potentially 4 slots that can be used each cycle - meaning, 4 uops or 4 instructions could retire each cycle.",
725 "EventCode": "0xC2",
726 "Counter": "0,1,2,3",
727 "UMask": "0x2",
728 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
729 "SampleAfterValue": "2000003",
730 "BriefDescription": "Retirement slots used.",
731 "CounterHTOff": "0,1,2,3,4,5,6,7"
732 },
733 {
734 "EventCode": "0xC2", 1105 "EventCode": "0xC2",
735 "Invert": "1", 1106 "Invert": "1",
736 "Counter": "0,1,2,3", 1107 "Counter": "0,1,2,3",
@@ -765,6 +1136,16 @@
765 "CounterHTOff": "0,1,2,3" 1136 "CounterHTOff": "0,1,2,3"
766 }, 1137 },
767 { 1138 {
1139 "PEBS": "1",
1140 "EventCode": "0xC2",
1141 "Counter": "0,1,2,3",
1142 "UMask": "0x2",
1143 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1144 "SampleAfterValue": "2000003",
1145 "BriefDescription": "Retirement slots used.",
1146 "CounterHTOff": "0,1,2,3,4,5,6,7"
1147 },
1148 {
768 "EventCode": "0xC3", 1149 "EventCode": "0xC3",
769 "Counter": "0,1,2,3", 1150 "Counter": "0,1,2,3",
770 "UMask": "0x1", 1151 "UMask": "0x1",
@@ -774,6 +1155,17 @@
774 "CounterHTOff": "0,1,2,3,4,5,6,7" 1155 "CounterHTOff": "0,1,2,3,4,5,6,7"
775 }, 1156 },
776 { 1157 {
1158 "EventCode": "0xC3",
1159 "Counter": "0,1,2,3",
1160 "UMask": "0x1",
1161 "EdgeDetect": "1",
1162 "EventName": "MACHINE_CLEARS.COUNT",
1163 "SampleAfterValue": "100003",
1164 "BriefDescription": "Number of machine clears (nukes) of any type.",
1165 "CounterMask": "1",
1166 "CounterHTOff": "0,1,2,3,4,5,6,7"
1167 },
1168 {
777 "PublicDescription": "This event is incremented when self-modifying code (SMC) is detected, which causes a machine clear. Machine clears can have a significant performance impact if they are happening frequently.", 1169 "PublicDescription": "This event is incremented when self-modifying code (SMC) is detected, which causes a machine clear. Machine clears can have a significant performance impact if they are happening frequently.",
778 "EventCode": "0xC3", 1170 "EventCode": "0xC3",
779 "Counter": "0,1,2,3", 1171 "Counter": "0,1,2,3",
@@ -793,8 +1185,17 @@
793 "CounterHTOff": "0,1,2,3,4,5,6,7" 1185 "CounterHTOff": "0,1,2,3,4,5,6,7"
794 }, 1186 },
795 { 1187 {
1188 "PublicDescription": "Branch instructions at retirement.",
1189 "EventCode": "0xC4",
1190 "Counter": "0,1,2,3",
1191 "UMask": "0x0",
1192 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1193 "SampleAfterValue": "400009",
1194 "BriefDescription": "All (macro) branch instructions retired.",
1195 "CounterHTOff": "0,1,2,3,4,5,6,7"
1196 },
1197 {
796 "PEBS": "1", 1198 "PEBS": "1",
797 "PublicDescription": "Counts the number of conditional branch instructions retired.",
798 "EventCode": "0xC4", 1199 "EventCode": "0xC4",
799 "Counter": "0,1,2,3", 1200 "Counter": "0,1,2,3",
800 "UMask": "0x1", 1201 "UMask": "0x1",
@@ -814,18 +1215,27 @@
814 "CounterHTOff": "0,1,2,3,4,5,6,7" 1215 "CounterHTOff": "0,1,2,3,4,5,6,7"
815 }, 1216 },
816 { 1217 {
817 "PublicDescription": "Branch instructions at retirement.", 1218 "PEBS": "1",
818 "EventCode": "0xC4", 1219 "EventCode": "0xC4",
819 "Counter": "0,1,2,3", 1220 "Counter": "0,1,2,3",
820 "UMask": "0x0", 1221 "UMask": "0x2",
821 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1222 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
1223 "SampleAfterValue": "100003",
1224 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3).",
1225 "CounterHTOff": "0,1,2,3,4,5,6,7"
1226 },
1227 {
1228 "PEBS": "2",
1229 "EventCode": "0xC4",
1230 "Counter": "0,1,2,3",
1231 "UMask": "0x4",
1232 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
822 "SampleAfterValue": "400009", 1233 "SampleAfterValue": "400009",
823 "BriefDescription": "All (macro) branch instructions retired.", 1234 "BriefDescription": "All (macro) branch instructions retired.",
824 "CounterHTOff": "0,1,2,3,4,5,6,7" 1235 "CounterHTOff": "0,1,2,3"
825 }, 1236 },
826 { 1237 {
827 "PEBS": "1", 1238 "PEBS": "1",
828 "PublicDescription": "Counts the number of near return instructions retired.",
829 "EventCode": "0xC4", 1239 "EventCode": "0xC4",
830 "Counter": "0,1,2,3", 1240 "Counter": "0,1,2,3",
831 "UMask": "0x8", 1241 "UMask": "0x8",
@@ -846,7 +1256,6 @@
846 }, 1256 },
847 { 1257 {
848 "PEBS": "1", 1258 "PEBS": "1",
849 "PublicDescription": "Number of near taken branches retired.",
850 "EventCode": "0xC4", 1259 "EventCode": "0xC4",
851 "Counter": "0,1,2,3", 1260 "Counter": "0,1,2,3",
852 "UMask": "0x20", 1261 "UMask": "0x20",
@@ -866,14 +1275,14 @@
866 "CounterHTOff": "0,1,2,3,4,5,6,7" 1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
867 }, 1276 },
868 { 1277 {
869 "PEBS": "2", 1278 "PublicDescription": "Mispredicted branch instructions at retirement.",
870 "EventCode": "0xC4", 1279 "EventCode": "0xC5",
871 "Counter": "0,1,2,3", 1280 "Counter": "0,1,2,3",
872 "UMask": "0x4", 1281 "UMask": "0x0",
873 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS", 1282 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES",
874 "SampleAfterValue": "400009", 1283 "SampleAfterValue": "400009",
875 "BriefDescription": "All (macro) branch instructions retired.", 1284 "BriefDescription": "All mispredicted macro branch instructions retired.",
876 "CounterHTOff": "0,1,2,3" 1285 "CounterHTOff": "0,1,2,3,4,5,6,7"
877 }, 1286 },
878 { 1287 {
879 "PEBS": "1", 1288 "PEBS": "1",
@@ -886,16 +1295,6 @@
886 "CounterHTOff": "0,1,2,3,4,5,6,7" 1295 "CounterHTOff": "0,1,2,3,4,5,6,7"
887 }, 1296 },
888 { 1297 {
889 "PublicDescription": "Mispredicted branch instructions at retirement.",
890 "EventCode": "0xC5",
891 "Counter": "0,1,2,3",
892 "UMask": "0x0",
893 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES",
894 "SampleAfterValue": "400009",
895 "BriefDescription": "All mispredicted macro branch instructions retired.",
896 "CounterHTOff": "0,1,2,3,4,5,6,7"
897 },
898 {
899 "PEBS": "2", 1298 "PEBS": "2",
900 "PublicDescription": "This event counts all mispredicted branch instructions retired. This is a precise event.", 1299 "PublicDescription": "This event counts all mispredicted branch instructions retired. This is a precise event.",
901 "EventCode": "0xC5", 1300 "EventCode": "0xC5",
@@ -903,121 +1302,11 @@
903 "UMask": "0x4", 1302 "UMask": "0x4",
904 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS", 1303 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS",
905 "SampleAfterValue": "400009", 1304 "SampleAfterValue": "400009",
906 "BriefDescription": "Mispredicted macro branch instructions retired. ", 1305 "BriefDescription": "Mispredicted macro branch instructions retired.",
907 "CounterHTOff": "0,1,2,3" 1306 "CounterHTOff": "0,1,2,3"
908 }, 1307 },
909 { 1308 {
910 "PublicDescription": "Count cases of saving new LBR records by hardware.",
911 "EventCode": "0xCC",
912 "Counter": "0,1,2,3",
913 "UMask": "0x20",
914 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
915 "SampleAfterValue": "2000003",
916 "BriefDescription": "Count cases of saving new LBR",
917 "CounterHTOff": "0,1,2,3,4,5,6,7"
918 },
919 {
920 "PublicDescription": "Counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.",
921 "EventCode": "0x3C",
922 "Counter": "0,1,2,3",
923 "UMask": "0x0",
924 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
925 "SampleAfterValue": "2000003",
926 "BriefDescription": "Thread cycles when thread is not in halt state",
927 "CounterHTOff": "0,1,2,3,4,5,6,7"
928 },
929 {
930 "EventCode": "0x89",
931 "Counter": "0,1,2,3",
932 "UMask": "0xa0",
933 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
934 "SampleAfterValue": "200003",
935 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
936 "CounterHTOff": "0,1,2,3,4,5,6,7"
937 },
938 {
939 "EventCode": "0xA1",
940 "Counter": "0,1,2,3",
941 "UMask": "0x1",
942 "AnyThread": "1",
943 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
944 "SampleAfterValue": "2000003",
945 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
946 "CounterHTOff": "0,1,2,3,4,5,6,7"
947 },
948 {
949 "EventCode": "0xA1",
950 "Counter": "0,1,2,3",
951 "UMask": "0x2",
952 "AnyThread": "1",
953 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
954 "SampleAfterValue": "2000003",
955 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
956 "CounterHTOff": "0,1,2,3,4,5,6,7"
957 },
958 {
959 "EventCode": "0xA1",
960 "Counter": "0,1,2,3",
961 "UMask": "0x4",
962 "AnyThread": "1",
963 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
964 "SampleAfterValue": "2000003",
965 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
966 "CounterHTOff": "0,1,2,3,4,5,6,7"
967 },
968 {
969 "EventCode": "0xA1",
970 "Counter": "0,1,2,3",
971 "UMask": "0x8",
972 "AnyThread": "1",
973 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
974 "SampleAfterValue": "2000003",
975 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
976 "CounterHTOff": "0,1,2,3,4,5,6,7"
977 },
978 {
979 "EventCode": "0xA1",
980 "Counter": "0,1,2,3",
981 "UMask": "0x10",
982 "AnyThread": "1",
983 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
984 "SampleAfterValue": "2000003",
985 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
986 "CounterHTOff": "0,1,2,3,4,5,6,7"
987 },
988 {
989 "EventCode": "0xA1",
990 "Counter": "0,1,2,3",
991 "UMask": "0x20",
992 "AnyThread": "1",
993 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
994 "SampleAfterValue": "2000003",
995 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
996 "CounterHTOff": "0,1,2,3,4,5,6,7"
997 },
998 {
999 "EventCode": "0xA1",
1000 "Counter": "0,1,2,3",
1001 "UMask": "0x40",
1002 "AnyThread": "1",
1003 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
1004 "SampleAfterValue": "2000003",
1005 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
1006 "CounterHTOff": "0,1,2,3,4,5,6,7"
1007 },
1008 {
1009 "EventCode": "0xA1",
1010 "Counter": "0,1,2,3",
1011 "UMask": "0x80",
1012 "AnyThread": "1",
1013 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
1014 "SampleAfterValue": "2000003",
1015 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
1016 "CounterHTOff": "0,1,2,3,4,5,6,7"
1017 },
1018 {
1019 "PEBS": "1", 1309 "PEBS": "1",
1020 "PublicDescription": "Number of near branch instructions retired that were taken but mispredicted.",
1021 "EventCode": "0xC5", 1310 "EventCode": "0xC5",
1022 "Counter": "0,1,2,3", 1311 "Counter": "0,1,2,3",
1023 "UMask": "0x20", 1312 "UMask": "0x20",
@@ -1027,51 +1316,14 @@
1027 "CounterHTOff": "0,1,2,3,4,5,6,7" 1316 "CounterHTOff": "0,1,2,3,4,5,6,7"
1028 }, 1317 },
1029 { 1318 {
1030 "PublicDescription": "This events counts the cycles where at least one uop was executed. It is counted per thread.", 1319 "PublicDescription": "Count cases of saving new LBR records by hardware.",
1031 "EventCode": "0xB1", 1320 "EventCode": "0xCC",
1032 "Counter": "0,1,2,3",
1033 "UMask": "0x1",
1034 "Errata": "HSD144, HSD30, HSM31",
1035 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1036 "SampleAfterValue": "2000003",
1037 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
1038 "CounterMask": "1",
1039 "CounterHTOff": "0,1,2,3"
1040 },
1041 {
1042 "PublicDescription": "This events counts the cycles where at least two uop were executed. It is counted per thread.",
1043 "EventCode": "0xB1",
1044 "Counter": "0,1,2,3",
1045 "UMask": "0x1",
1046 "Errata": "HSD144, HSD30, HSM31",
1047 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1048 "SampleAfterValue": "2000003",
1049 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
1050 "CounterMask": "2",
1051 "CounterHTOff": "0,1,2,3"
1052 },
1053 {
1054 "PublicDescription": "This events counts the cycles where at least three uop were executed. It is counted per thread.",
1055 "EventCode": "0xB1",
1056 "Counter": "0,1,2,3",
1057 "UMask": "0x1",
1058 "Errata": "HSD144, HSD30, HSM31",
1059 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1060 "SampleAfterValue": "2000003",
1061 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
1062 "CounterMask": "3",
1063 "CounterHTOff": "0,1,2,3"
1064 },
1065 {
1066 "EventCode": "0xB1",
1067 "Counter": "0,1,2,3", 1321 "Counter": "0,1,2,3",
1068 "UMask": "0x1", 1322 "UMask": "0x20",
1069 "Errata": "HSD144, HSD30, HSM31", 1323 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
1070 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
1071 "SampleAfterValue": "2000003", 1324 "SampleAfterValue": "2000003",
1072 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.", 1325 "BriefDescription": "Count cases of saving new LBR",
1073 "CounterMask": "4", 1326 "CounterHTOff": "0,1,2,3,4,5,6,7"
1074 "CounterHTOff": "0,1,2,3"
1075 }, 1327 },
1076 { 1328 {
1077 "PublicDescription": "Number of front end re-steers due to BPU misprediction.", 1329 "PublicDescription": "Number of front end re-steers due to BPU misprediction.",
@@ -1082,248 +1334,5 @@
1082 "SampleAfterValue": "100003", 1334 "SampleAfterValue": "100003",
1083 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.", 1335 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.",
1084 "CounterHTOff": "0,1,2,3,4,5,6,7" 1336 "CounterHTOff": "0,1,2,3,4,5,6,7"
1085 },
1086 {
1087 "EventCode": "0xC3",
1088 "Counter": "0,1,2,3",
1089 "UMask": "0x1",
1090 "EdgeDetect": "1",
1091 "EventName": "MACHINE_CLEARS.COUNT",
1092 "SampleAfterValue": "100003",
1093 "BriefDescription": "Number of machine clears (nukes) of any type.",
1094 "CounterMask": "1",
1095 "CounterHTOff": "0,1,2,3,4,5,6,7"
1096 },
1097 {
1098 "EventCode": "0xA8",
1099 "Counter": "0,1,2,3",
1100 "UMask": "0x1",
1101 "EventName": "LSD.CYCLES_ACTIVE",
1102 "SampleAfterValue": "2000003",
1103 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
1104 "CounterMask": "1",
1105 "CounterHTOff": "0,1,2,3,4,5,6,7"
1106 },
1107 {
1108 "EventCode": "0xA8",
1109 "Counter": "0,1,2,3",
1110 "UMask": "0x1",
1111 "EventName": "LSD.CYCLES_4_UOPS",
1112 "SampleAfterValue": "2000003",
1113 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1114 "CounterMask": "4",
1115 "CounterHTOff": "0,1,2,3,4,5,6,7"
1116 },
1117 {
1118 "EventCode": "0x5E",
1119 "Invert": "1",
1120 "Counter": "0,1,2,3",
1121 "UMask": "0x1",
1122 "EdgeDetect": "1",
1123 "EventName": "RS_EVENTS.EMPTY_END",
1124 "SampleAfterValue": "200003",
1125 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1126 "CounterMask": "1",
1127 "CounterHTOff": "0,1,2,3,4,5,6,7"
1128 },
1129 {
1130 "EventCode": "0xA1",
1131 "Counter": "0,1,2,3",
1132 "UMask": "0x1",
1133 "EventName": "UOPS_DISPATCHED_PORT.PORT_0",
1134 "SampleAfterValue": "2000003",
1135 "BriefDescription": "Cycles per thread when uops are executed in port 0.",
1136 "CounterHTOff": "0,1,2,3,4,5,6,7"
1137 },
1138 {
1139 "EventCode": "0xA1",
1140 "Counter": "0,1,2,3",
1141 "UMask": "0x2",
1142 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
1143 "SampleAfterValue": "2000003",
1144 "BriefDescription": "Cycles per thread when uops are executed in port 1.",
1145 "CounterHTOff": "0,1,2,3,4,5,6,7"
1146 },
1147 {
1148 "EventCode": "0xA1",
1149 "Counter": "0,1,2,3",
1150 "UMask": "0x4",
1151 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
1152 "SampleAfterValue": "2000003",
1153 "BriefDescription": "Cycles per thread when uops are executed in port 2.",
1154 "CounterHTOff": "0,1,2,3,4,5,6,7"
1155 },
1156 {
1157 "EventCode": "0xA1",
1158 "Counter": "0,1,2,3",
1159 "UMask": "0x8",
1160 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
1161 "SampleAfterValue": "2000003",
1162 "BriefDescription": "Cycles per thread when uops are executed in port 3.",
1163 "CounterHTOff": "0,1,2,3,4,5,6,7"
1164 },
1165 {
1166 "EventCode": "0xA1",
1167 "Counter": "0,1,2,3",
1168 "UMask": "0x10",
1169 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
1170 "SampleAfterValue": "2000003",
1171 "BriefDescription": "Cycles per thread when uops are executed in port 4.",
1172 "CounterHTOff": "0,1,2,3,4,5,6,7"
1173 },
1174 {
1175 "EventCode": "0xA1",
1176 "Counter": "0,1,2,3",
1177 "UMask": "0x20",
1178 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
1179 "SampleAfterValue": "2000003",
1180 "BriefDescription": "Cycles per thread when uops are executed in port 5.",
1181 "CounterHTOff": "0,1,2,3,4,5,6,7"
1182 },
1183 {
1184 "EventCode": "0xA1",
1185 "Counter": "0,1,2,3",
1186 "UMask": "0x40",
1187 "EventName": "UOPS_DISPATCHED_PORT.PORT_6",
1188 "SampleAfterValue": "2000003",
1189 "BriefDescription": "Cycles per thread when uops are executed in port 6.",
1190 "CounterHTOff": "0,1,2,3,4,5,6,7"
1191 },
1192 {
1193 "EventCode": "0xA1",
1194 "Counter": "0,1,2,3",
1195 "UMask": "0x80",
1196 "EventName": "UOPS_DISPATCHED_PORT.PORT_7",
1197 "SampleAfterValue": "2000003",
1198 "BriefDescription": "Cycles per thread when uops are executed in port 7.",
1199 "CounterHTOff": "0,1,2,3,4,5,6,7"
1200 },
1201 {
1202 "EventCode": "0x00",
1203 "Counter": "Fixed counter 2",
1204 "UMask": "0x2",
1205 "AnyThread": "1",
1206 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1207 "SampleAfterValue": "2000003",
1208 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1209 "CounterHTOff": "Fixed counter 2"
1210 },
1211 {
1212 "EventCode": "0x3C",
1213 "Counter": "0,1,2,3",
1214 "UMask": "0x0",
1215 "AnyThread": "1",
1216 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1217 "SampleAfterValue": "2000003",
1218 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1219 "CounterHTOff": "0,1,2,3,4,5,6,7"
1220 },
1221 {
1222 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1223 "EventCode": "0x3C",
1224 "Counter": "0,1,2,3",
1225 "UMask": "0x1",
1226 "AnyThread": "1",
1227 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1228 "SampleAfterValue": "2000003",
1229 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
1230 "CounterHTOff": "0,1,2,3,4,5,6,7"
1231 },
1232 {
1233 "PublicDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1234 "EventCode": "0x0D",
1235 "Counter": "0,1,2,3",
1236 "UMask": "0x3",
1237 "AnyThread": "1",
1238 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1239 "SampleAfterValue": "2000003",
1240 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke)",
1241 "CounterMask": "1",
1242 "CounterHTOff": "0,1,2,3,4,5,6,7"
1243 },
1244 {
1245 "EventCode": "0xb1",
1246 "Counter": "0,1,2,3",
1247 "UMask": "0x2",
1248 "Errata": "HSD30, HSM31",
1249 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1250 "SampleAfterValue": "2000003",
1251 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1252 "CounterMask": "1",
1253 "CounterHTOff": "0,1,2,3,4,5,6,7"
1254 },
1255 {
1256 "EventCode": "0xb1",
1257 "Counter": "0,1,2,3",
1258 "UMask": "0x2",
1259 "Errata": "HSD30, HSM31",
1260 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1261 "SampleAfterValue": "2000003",
1262 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1263 "CounterMask": "2",
1264 "CounterHTOff": "0,1,2,3,4,5,6,7"
1265 },
1266 {
1267 "EventCode": "0xb1",
1268 "Counter": "0,1,2,3",
1269 "UMask": "0x2",
1270 "Errata": "HSD30, HSM31",
1271 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1272 "SampleAfterValue": "2000003",
1273 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1274 "CounterMask": "3",
1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
1276 },
1277 {
1278 "EventCode": "0xb1",
1279 "Counter": "0,1,2,3",
1280 "UMask": "0x2",
1281 "Errata": "HSD30, HSM31",
1282 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1283 "SampleAfterValue": "2000003",
1284 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1285 "CounterMask": "4",
1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
1287 },
1288 {
1289 "EventCode": "0xb1",
1290 "Invert": "1",
1291 "Counter": "0,1,2,3",
1292 "UMask": "0x2",
1293 "Errata": "HSD30, HSM31",
1294 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1295 "SampleAfterValue": "2000003",
1296 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1297 "CounterHTOff": "0,1,2,3,4,5,6,7"
1298 },
1299 {
1300 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
1301 "EventCode": "0x3C",
1302 "Counter": "0,1,2,3",
1303 "UMask": "0x1",
1304 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1305 "SampleAfterValue": "2000003",
1306 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1307 "CounterHTOff": "0,1,2,3,4,5,6,7"
1308 },
1309 {
1310 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1311 "EventCode": "0x3C",
1312 "Counter": "0,1,2,3",
1313 "UMask": "0x1",
1314 "AnyThread": "1",
1315 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1316 "SampleAfterValue": "2000003",
1317 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
1318 "CounterHTOff": "0,1,2,3,4,5,6,7"
1319 },
1320 {
1321 "EventCode": "0x3C",
1322 "Counter": "0,1,2,3",
1323 "UMask": "0x2",
1324 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1325 "SampleAfterValue": "2000003",
1326 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1327 "CounterHTOff": "0,1,2,3,4,5,6,7"
1328 } 1337 }
1329] \ No newline at end of file 1338] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswell/virtual-memory.json b/tools/perf/pmu-events/arch/x86/haswell/virtual-memory.json
index ce80a08d0f08..777b500a5c9f 100644
--- a/tools/perf/pmu-events/arch/x86/haswell/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/haswell/virtual-memory.json
@@ -39,6 +39,16 @@
39 "CounterHTOff": "0,1,2,3,4,5,6,7" 39 "CounterHTOff": "0,1,2,3,4,5,6,7"
40 }, 40 },
41 { 41 {
42 "PublicDescription": "Completed page walks in any TLB of any page size due to demand load misses.",
43 "EventCode": "0x08",
44 "Counter": "0,1,2,3",
45 "UMask": "0xe",
46 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
47 "SampleAfterValue": "100003",
48 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
49 "CounterHTOff": "0,1,2,3,4,5,6,7"
50 },
51 {
42 "PublicDescription": "This event counts cycles when the page miss handler (PMH) is servicing page walks caused by DTLB load misses.", 52 "PublicDescription": "This event counts cycles when the page miss handler (PMH) is servicing page walks caused by DTLB load misses.",
43 "EventCode": "0x08", 53 "EventCode": "0x08",
44 "Counter": "0,1,2,3", 54 "Counter": "0,1,2,3",
@@ -69,6 +79,16 @@
69 "CounterHTOff": "0,1,2,3,4,5,6,7" 79 "CounterHTOff": "0,1,2,3,4,5,6,7"
70 }, 80 },
71 { 81 {
82 "PublicDescription": "Number of cache load STLB hits. No page walk.",
83 "EventCode": "0x08",
84 "Counter": "0,1,2,3",
85 "UMask": "0x60",
86 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
87 "SampleAfterValue": "2000003",
88 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks",
89 "CounterHTOff": "0,1,2,3,4,5,6,7"
90 },
91 {
72 "PublicDescription": "DTLB demand load misses with low part of linear-to-physical address translation missed.", 92 "PublicDescription": "DTLB demand load misses with low part of linear-to-physical address translation missed.",
73 "EventCode": "0x08", 93 "EventCode": "0x08",
74 "Counter": "0,1,2,3", 94 "Counter": "0,1,2,3",
@@ -118,6 +138,16 @@
118 "CounterHTOff": "0,1,2,3,4,5,6,7" 138 "CounterHTOff": "0,1,2,3,4,5,6,7"
119 }, 139 },
120 { 140 {
141 "PublicDescription": "Completed page walks due to store miss in any TLB levels of any page size (4K/2M/4M/1G).",
142 "EventCode": "0x49",
143 "Counter": "0,1,2,3",
144 "UMask": "0xe",
145 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
146 "SampleAfterValue": "100003",
147 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks",
148 "CounterHTOff": "0,1,2,3,4,5,6,7"
149 },
150 {
121 "PublicDescription": "This event counts cycles when the page miss handler (PMH) is servicing page walks caused by DTLB store misses.", 151 "PublicDescription": "This event counts cycles when the page miss handler (PMH) is servicing page walks caused by DTLB store misses.",
122 "EventCode": "0x49", 152 "EventCode": "0x49",
123 "Counter": "0,1,2,3", 153 "Counter": "0,1,2,3",
@@ -148,6 +178,16 @@
148 "CounterHTOff": "0,1,2,3,4,5,6,7" 178 "CounterHTOff": "0,1,2,3,4,5,6,7"
149 }, 179 },
150 { 180 {
181 "PublicDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
182 "EventCode": "0x49",
183 "Counter": "0,1,2,3",
184 "UMask": "0x60",
185 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
186 "SampleAfterValue": "100003",
187 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks",
188 "CounterHTOff": "0,1,2,3,4,5,6,7"
189 },
190 {
151 "PublicDescription": "DTLB store misses with low part of linear-to-physical address translation missed.", 191 "PublicDescription": "DTLB store misses with low part of linear-to-physical address translation missed.",
152 "EventCode": "0x49", 192 "EventCode": "0x49",
153 "Counter": "0,1,2,3", 193 "Counter": "0,1,2,3",
@@ -206,6 +246,16 @@
206 "CounterHTOff": "0,1,2,3,4,5,6,7" 246 "CounterHTOff": "0,1,2,3,4,5,6,7"
207 }, 247 },
208 { 248 {
249 "PublicDescription": "Completed page walks in ITLB of any page size.",
250 "EventCode": "0x85",
251 "Counter": "0,1,2,3",
252 "UMask": "0xe",
253 "EventName": "ITLB_MISSES.WALK_COMPLETED",
254 "SampleAfterValue": "100003",
255 "BriefDescription": "Misses in all ITLB levels that cause completed page walks",
256 "CounterHTOff": "0,1,2,3,4,5,6,7"
257 },
258 {
209 "PublicDescription": "This event counts cycles when the page miss handler (PMH) is servicing page walks caused by ITLB misses.", 259 "PublicDescription": "This event counts cycles when the page miss handler (PMH) is servicing page walks caused by ITLB misses.",
210 "EventCode": "0x85", 260 "EventCode": "0x85",
211 "Counter": "0,1,2,3", 261 "Counter": "0,1,2,3",
@@ -236,6 +286,16 @@
236 "CounterHTOff": "0,1,2,3,4,5,6,7" 286 "CounterHTOff": "0,1,2,3,4,5,6,7"
237 }, 287 },
238 { 288 {
289 "PublicDescription": "ITLB misses that hit STLB. No page walk.",
290 "EventCode": "0x85",
291 "Counter": "0,1,2,3",
292 "UMask": "0x60",
293 "EventName": "ITLB_MISSES.STLB_HIT",
294 "SampleAfterValue": "100003",
295 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks",
296 "CounterHTOff": "0,1,2,3,4,5,6,7"
297 },
298 {
239 "PublicDescription": "Counts the number of ITLB flushes, includes 4k/2M/4M pages.", 299 "PublicDescription": "Counts the number of ITLB flushes, includes 4k/2M/4M pages.",
240 "EventCode": "0xae", 300 "EventCode": "0xae",
241 "Counter": "0,1,2,3", 301 "Counter": "0,1,2,3",
@@ -256,41 +316,45 @@
256 "CounterHTOff": "0,1,2,3" 316 "CounterHTOff": "0,1,2,3"
257 }, 317 },
258 { 318 {
259 "PublicDescription": "Number of ITLB page walker loads that hit in the L1+FB.", 319 "PublicDescription": "Number of DTLB page walker loads that hit in the L2.",
260 "EventCode": "0xBC", 320 "EventCode": "0xBC",
261 "Counter": "0,1,2,3", 321 "Counter": "0,1,2,3",
262 "UMask": "0x21", 322 "UMask": "0x12",
263 "EventName": "PAGE_WALKER_LOADS.ITLB_L1", 323 "EventName": "PAGE_WALKER_LOADS.DTLB_L2",
264 "SampleAfterValue": "2000003", 324 "SampleAfterValue": "2000003",
265 "BriefDescription": "Number of ITLB page walker hits in the L1+FB", 325 "BriefDescription": "Number of DTLB page walker hits in the L2",
266 "CounterHTOff": "0,1,2,3" 326 "CounterHTOff": "0,1,2,3"
267 }, 327 },
268 { 328 {
329 "PublicDescription": "Number of DTLB page walker loads that hit in the L3.",
269 "EventCode": "0xBC", 330 "EventCode": "0xBC",
270 "Counter": "0,1,2,3", 331 "Counter": "0,1,2,3",
271 "UMask": "0x41", 332 "UMask": "0x14",
272 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L1", 333 "Errata": "HSD25",
334 "EventName": "PAGE_WALKER_LOADS.DTLB_L3",
273 "SampleAfterValue": "2000003", 335 "SampleAfterValue": "2000003",
274 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L1 and FB.", 336 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP",
275 "CounterHTOff": "0,1,2,3" 337 "CounterHTOff": "0,1,2,3"
276 }, 338 },
277 { 339 {
340 "PublicDescription": "Number of DTLB page walker loads from memory.",
278 "EventCode": "0xBC", 341 "EventCode": "0xBC",
279 "Counter": "0,1,2,3", 342 "Counter": "0,1,2,3",
280 "UMask": "0x81", 343 "UMask": "0x18",
281 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L1", 344 "Errata": "HSD25",
345 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY",
282 "SampleAfterValue": "2000003", 346 "SampleAfterValue": "2000003",
283 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L1 and FB.", 347 "BriefDescription": "Number of DTLB page walker hits in Memory",
284 "CounterHTOff": "0,1,2,3" 348 "CounterHTOff": "0,1,2,3"
285 }, 349 },
286 { 350 {
287 "PublicDescription": "Number of DTLB page walker loads that hit in the L2.", 351 "PublicDescription": "Number of ITLB page walker loads that hit in the L1+FB.",
288 "EventCode": "0xBC", 352 "EventCode": "0xBC",
289 "Counter": "0,1,2,3", 353 "Counter": "0,1,2,3",
290 "UMask": "0x12", 354 "UMask": "0x21",
291 "EventName": "PAGE_WALKER_LOADS.DTLB_L2", 355 "EventName": "PAGE_WALKER_LOADS.ITLB_L1",
292 "SampleAfterValue": "2000003", 356 "SampleAfterValue": "2000003",
293 "BriefDescription": "Number of DTLB page walker hits in the L2", 357 "BriefDescription": "Number of ITLB page walker hits in the L1+FB",
294 "CounterHTOff": "0,1,2,3" 358 "CounterHTOff": "0,1,2,3"
295 }, 359 },
296 { 360 {
@@ -304,43 +368,43 @@
304 "CounterHTOff": "0,1,2,3" 368 "CounterHTOff": "0,1,2,3"
305 }, 369 },
306 { 370 {
371 "PublicDescription": "Number of ITLB page walker loads that hit in the L3.",
307 "EventCode": "0xBC", 372 "EventCode": "0xBC",
308 "Counter": "0,1,2,3", 373 "Counter": "0,1,2,3",
309 "UMask": "0x42", 374 "UMask": "0x24",
310 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L2", 375 "Errata": "HSD25",
376 "EventName": "PAGE_WALKER_LOADS.ITLB_L3",
311 "SampleAfterValue": "2000003", 377 "SampleAfterValue": "2000003",
312 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L2.", 378 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP",
313 "CounterHTOff": "0,1,2,3" 379 "CounterHTOff": "0,1,2,3"
314 }, 380 },
315 { 381 {
382 "PublicDescription": "Number of ITLB page walker loads from memory.",
316 "EventCode": "0xBC", 383 "EventCode": "0xBC",
317 "Counter": "0,1,2,3", 384 "Counter": "0,1,2,3",
318 "UMask": "0x82", 385 "UMask": "0x28",
319 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L2", 386 "Errata": "HSD25",
387 "EventName": "PAGE_WALKER_LOADS.ITLB_MEMORY",
320 "SampleAfterValue": "2000003", 388 "SampleAfterValue": "2000003",
321 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.", 389 "BriefDescription": "Number of ITLB page walker hits in Memory",
322 "CounterHTOff": "0,1,2,3" 390 "CounterHTOff": "0,1,2,3"
323 }, 391 },
324 { 392 {
325 "PublicDescription": "Number of DTLB page walker loads that hit in the L3.",
326 "EventCode": "0xBC", 393 "EventCode": "0xBC",
327 "Counter": "0,1,2,3", 394 "Counter": "0,1,2,3",
328 "UMask": "0x14", 395 "UMask": "0x41",
329 "Errata": "HSD25", 396 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L1",
330 "EventName": "PAGE_WALKER_LOADS.DTLB_L3",
331 "SampleAfterValue": "2000003", 397 "SampleAfterValue": "2000003",
332 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP", 398 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L1 and FB.",
333 "CounterHTOff": "0,1,2,3" 399 "CounterHTOff": "0,1,2,3"
334 }, 400 },
335 { 401 {
336 "PublicDescription": "Number of ITLB page walker loads that hit in the L3.",
337 "EventCode": "0xBC", 402 "EventCode": "0xBC",
338 "Counter": "0,1,2,3", 403 "Counter": "0,1,2,3",
339 "UMask": "0x24", 404 "UMask": "0x42",
340 "Errata": "HSD25", 405 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L2",
341 "EventName": "PAGE_WALKER_LOADS.ITLB_L3",
342 "SampleAfterValue": "2000003", 406 "SampleAfterValue": "2000003",
343 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP", 407 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L2.",
344 "CounterHTOff": "0,1,2,3" 408 "CounterHTOff": "0,1,2,3"
345 }, 409 },
346 { 410 {
@@ -355,41 +419,37 @@
355 { 419 {
356 "EventCode": "0xBC", 420 "EventCode": "0xBC",
357 "Counter": "0,1,2,3", 421 "Counter": "0,1,2,3",
358 "UMask": "0x84", 422 "UMask": "0x48",
359 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L3", 423 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_MEMORY",
360 "SampleAfterValue": "2000003", 424 "SampleAfterValue": "2000003",
361 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.", 425 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in memory.",
362 "CounterHTOff": "0,1,2,3" 426 "CounterHTOff": "0,1,2,3"
363 }, 427 },
364 { 428 {
365 "PublicDescription": "Number of DTLB page walker loads from memory.",
366 "EventCode": "0xBC", 429 "EventCode": "0xBC",
367 "Counter": "0,1,2,3", 430 "Counter": "0,1,2,3",
368 "UMask": "0x18", 431 "UMask": "0x81",
369 "Errata": "HSD25", 432 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L1",
370 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY",
371 "SampleAfterValue": "2000003", 433 "SampleAfterValue": "2000003",
372 "BriefDescription": "Number of DTLB page walker hits in Memory", 434 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L1 and FB.",
373 "CounterHTOff": "0,1,2,3" 435 "CounterHTOff": "0,1,2,3"
374 }, 436 },
375 { 437 {
376 "PublicDescription": "Number of ITLB page walker loads from memory.",
377 "EventCode": "0xBC", 438 "EventCode": "0xBC",
378 "Counter": "0,1,2,3", 439 "Counter": "0,1,2,3",
379 "UMask": "0x28", 440 "UMask": "0x82",
380 "Errata": "HSD25", 441 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L2",
381 "EventName": "PAGE_WALKER_LOADS.ITLB_MEMORY",
382 "SampleAfterValue": "2000003", 442 "SampleAfterValue": "2000003",
383 "BriefDescription": "Number of ITLB page walker hits in Memory", 443 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.",
384 "CounterHTOff": "0,1,2,3" 444 "CounterHTOff": "0,1,2,3"
385 }, 445 },
386 { 446 {
387 "EventCode": "0xBC", 447 "EventCode": "0xBC",
388 "Counter": "0,1,2,3", 448 "Counter": "0,1,2,3",
389 "UMask": "0x48", 449 "UMask": "0x84",
390 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_MEMORY", 450 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L3",
391 "SampleAfterValue": "2000003", 451 "SampleAfterValue": "2000003",
392 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in memory.", 452 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.",
393 "CounterHTOff": "0,1,2,3" 453 "CounterHTOff": "0,1,2,3"
394 }, 454 },
395 { 455 {
@@ -420,65 +480,5 @@
420 "SampleAfterValue": "100003", 480 "SampleAfterValue": "100003",
421 "BriefDescription": "STLB flush attempts", 481 "BriefDescription": "STLB flush attempts",
422 "CounterHTOff": "0,1,2,3,4,5,6,7" 482 "CounterHTOff": "0,1,2,3,4,5,6,7"
423 },
424 {
425 "PublicDescription": "Completed page walks in any TLB of any page size due to demand load misses.",
426 "EventCode": "0x08",
427 "Counter": "0,1,2,3",
428 "UMask": "0xe",
429 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
430 "SampleAfterValue": "100003",
431 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
432 "CounterHTOff": "0,1,2,3,4,5,6,7"
433 },
434 {
435 "PublicDescription": "Number of cache load STLB hits. No page walk.",
436 "EventCode": "0x08",
437 "Counter": "0,1,2,3",
438 "UMask": "0x60",
439 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
440 "SampleAfterValue": "2000003",
441 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks",
442 "CounterHTOff": "0,1,2,3,4,5,6,7"
443 },
444 {
445 "PublicDescription": "Completed page walks due to store miss in any TLB levels of any page size (4K/2M/4M/1G).",
446 "EventCode": "0x49",
447 "Counter": "0,1,2,3",
448 "UMask": "0xe",
449 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
450 "SampleAfterValue": "100003",
451 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks",
452 "CounterHTOff": "0,1,2,3,4,5,6,7"
453 },
454 {
455 "PublicDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
456 "EventCode": "0x49",
457 "Counter": "0,1,2,3",
458 "UMask": "0x60",
459 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
460 "SampleAfterValue": "100003",
461 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks",
462 "CounterHTOff": "0,1,2,3,4,5,6,7"
463 },
464 {
465 "PublicDescription": "Completed page walks in ITLB of any page size.",
466 "EventCode": "0x85",
467 "Counter": "0,1,2,3",
468 "UMask": "0xe",
469 "EventName": "ITLB_MISSES.WALK_COMPLETED",
470 "SampleAfterValue": "100003",
471 "BriefDescription": "Misses in all ITLB levels that cause completed page walks",
472 "CounterHTOff": "0,1,2,3,4,5,6,7"
473 },
474 {
475 "PublicDescription": "ITLB misses that hit STLB. No page walk.",
476 "EventCode": "0x85",
477 "Counter": "0,1,2,3",
478 "UMask": "0x60",
479 "EventName": "ITLB_MISSES.STLB_HIT",
480 "SampleAfterValue": "100003",
481 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks",
482 "CounterHTOff": "0,1,2,3,4,5,6,7"
483 } 483 }
484] \ No newline at end of file 484] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/cache.json b/tools/perf/pmu-events/arch/x86/haswellx/cache.json
index f1bae0817a6f..b2fbd617306a 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/cache.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/cache.json
@@ -12,12 +12,32 @@
12 }, 12 },
13 { 13 {
14 "EventCode": "0x24", 14 "EventCode": "0x24",
15 "UMask": "0x41", 15 "UMask": "0x22",
16 "BriefDescription": "Demand Data Read requests that hit L2 cache", 16 "BriefDescription": "RFO requests that miss L2 cache",
17 "Counter": "0,1,2,3", 17 "Counter": "0,1,2,3",
18 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT", 18 "EventName": "L2_RQSTS.RFO_MISS",
19 "PublicDescription": "Counts the number of store RFO requests that miss the L2 cache.",
20 "SampleAfterValue": "200003",
21 "CounterHTOff": "0,1,2,3,4,5,6,7"
22 },
23 {
24 "EventCode": "0x24",
25 "UMask": "0x24",
26 "BriefDescription": "L2 cache misses when fetching instructions",
27 "Counter": "0,1,2,3",
28 "EventName": "L2_RQSTS.CODE_RD_MISS",
29 "PublicDescription": "Number of instruction fetches that missed the L2 cache.",
30 "SampleAfterValue": "200003",
31 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 },
33 {
34 "EventCode": "0x24",
35 "UMask": "0x27",
36 "BriefDescription": "Demand requests that miss L2 cache",
37 "Counter": "0,1,2,3",
38 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
19 "Errata": "HSD78", 39 "Errata": "HSD78",
20 "PublicDescription": "Demand data read requests that hit L2 cache.", 40 "PublicDescription": "Demand requests that miss L2 cache.",
21 "SampleAfterValue": "200003", 41 "SampleAfterValue": "200003",
22 "CounterHTOff": "0,1,2,3,4,5,6,7" 42 "CounterHTOff": "0,1,2,3,4,5,6,7"
23 }, 43 },
@@ -33,6 +53,48 @@
33 }, 53 },
34 { 54 {
35 "EventCode": "0x24", 55 "EventCode": "0x24",
56 "UMask": "0x3f",
57 "BriefDescription": "All requests that miss L2 cache",
58 "Counter": "0,1,2,3",
59 "EventName": "L2_RQSTS.MISS",
60 "Errata": "HSD78",
61 "PublicDescription": "All requests that missed L2.",
62 "SampleAfterValue": "200003",
63 "CounterHTOff": "0,1,2,3,4,5,6,7"
64 },
65 {
66 "EventCode": "0x24",
67 "UMask": "0x41",
68 "BriefDescription": "Demand Data Read requests that hit L2 cache",
69 "Counter": "0,1,2,3",
70 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT",
71 "Errata": "HSD78",
72 "PublicDescription": "Demand data read requests that hit L2 cache.",
73 "SampleAfterValue": "200003",
74 "CounterHTOff": "0,1,2,3,4,5,6,7"
75 },
76 {
77 "EventCode": "0x24",
78 "UMask": "0x42",
79 "BriefDescription": "RFO requests that hit L2 cache",
80 "Counter": "0,1,2,3",
81 "EventName": "L2_RQSTS.RFO_HIT",
82 "PublicDescription": "Counts the number of store RFO requests that hit the L2 cache.",
83 "SampleAfterValue": "200003",
84 "CounterHTOff": "0,1,2,3,4,5,6,7"
85 },
86 {
87 "EventCode": "0x24",
88 "UMask": "0x44",
89 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
90 "Counter": "0,1,2,3",
91 "EventName": "L2_RQSTS.CODE_RD_HIT",
92 "PublicDescription": "Number of instruction fetches that hit the L2 cache.",
93 "SampleAfterValue": "200003",
94 "CounterHTOff": "0,1,2,3,4,5,6,7"
95 },
96 {
97 "EventCode": "0x24",
36 "UMask": "0x50", 98 "UMask": "0x50",
37 "BriefDescription": "L2 prefetch requests that hit L2 cache", 99 "BriefDescription": "L2 prefetch requests that hit L2 cache",
38 "Counter": "0,1,2,3", 100 "Counter": "0,1,2,3",
@@ -74,6 +136,17 @@
74 }, 136 },
75 { 137 {
76 "EventCode": "0x24", 138 "EventCode": "0x24",
139 "UMask": "0xe7",
140 "BriefDescription": "Demand requests to L2 cache",
141 "Counter": "0,1,2,3",
142 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
143 "Errata": "HSD78",
144 "PublicDescription": "Demand requests to L2 cache.",
145 "SampleAfterValue": "200003",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
149 "EventCode": "0x24",
77 "UMask": "0xf8", 150 "UMask": "0xf8",
78 "BriefDescription": "Requests from L2 hardware prefetchers", 151 "BriefDescription": "Requests from L2 hardware prefetchers",
79 "Counter": "0,1,2,3", 152 "Counter": "0,1,2,3",
@@ -83,6 +156,17 @@
83 "CounterHTOff": "0,1,2,3,4,5,6,7" 156 "CounterHTOff": "0,1,2,3,4,5,6,7"
84 }, 157 },
85 { 158 {
159 "EventCode": "0x24",
160 "UMask": "0xff",
161 "BriefDescription": "All L2 requests",
162 "Counter": "0,1,2,3",
163 "EventName": "L2_RQSTS.REFERENCES",
164 "Errata": "HSD78",
165 "PublicDescription": "All requests to L2 cache.",
166 "SampleAfterValue": "200003",
167 "CounterHTOff": "0,1,2,3,4,5,6,7"
168 },
169 {
86 "EventCode": "0x27", 170 "EventCode": "0x27",
87 "UMask": "0x50", 171 "UMask": "0x50",
88 "BriefDescription": "Not rejected writebacks that hit L2 cache", 172 "BriefDescription": "Not rejected writebacks that hit L2 cache",
@@ -124,6 +208,27 @@
124 }, 208 },
125 { 209 {
126 "EventCode": "0x48", 210 "EventCode": "0x48",
211 "UMask": "0x1",
212 "BriefDescription": "Cycles with L1D load Misses outstanding.",
213 "Counter": "2",
214 "EventName": "L1D_PEND_MISS.PENDING_CYCLES",
215 "CounterMask": "1",
216 "SampleAfterValue": "2000003",
217 "CounterHTOff": "2"
218 },
219 {
220 "EventCode": "0x48",
221 "UMask": "0x1",
222 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
223 "Counter": "2",
224 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
225 "AnyThread": "1",
226 "CounterMask": "1",
227 "SampleAfterValue": "2000003",
228 "CounterHTOff": "2"
229 },
230 {
231 "EventCode": "0x48",
127 "UMask": "0x2", 232 "UMask": "0x2",
128 "BriefDescription": "Number of times a request needed a FB entry but there was no entry available for it. That is the FB unavailability was dominant reason for blocking the request. A request includes cacheable/uncacheable demands that is load, store or SW prefetch. HWP are e.", 233 "BriefDescription": "Number of times a request needed a FB entry but there was no entry available for it. That is the FB unavailability was dominant reason for blocking the request. A request includes cacheable/uncacheable demands that is load, store or SW prefetch. HWP are e.",
129 "Counter": "0,1,2,3", 234 "Counter": "0,1,2,3",
@@ -133,13 +238,13 @@
133 }, 238 },
134 { 239 {
135 "EventCode": "0x48", 240 "EventCode": "0x48",
136 "UMask": "0x1", 241 "UMask": "0x2",
137 "BriefDescription": "Cycles with L1D load Misses outstanding.", 242 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
138 "Counter": "2", 243 "Counter": "0,1,2,3",
139 "EventName": "L1D_PEND_MISS.PENDING_CYCLES", 244 "EventName": "L1D_PEND_MISS.FB_FULL",
140 "CounterMask": "1", 245 "CounterMask": "1",
141 "SampleAfterValue": "2000003", 246 "SampleAfterValue": "2000003",
142 "CounterHTOff": "2" 247 "CounterHTOff": "0,1,2,3,4,5,6,7"
143 }, 248 },
144 { 249 {
145 "EventCode": "0x51", 250 "EventCode": "0x51",
@@ -164,6 +269,28 @@
164 }, 269 },
165 { 270 {
166 "EventCode": "0x60", 271 "EventCode": "0x60",
272 "UMask": "0x1",
273 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
274 "Counter": "0,1,2,3",
275 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
276 "CounterMask": "1",
277 "Errata": "HSD78, HSD62, HSD61",
278 "SampleAfterValue": "2000003",
279 "CounterHTOff": "0,1,2,3,4,5,6,7"
280 },
281 {
282 "EventCode": "0x60",
283 "UMask": "0x1",
284 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
285 "Counter": "0,1,2,3",
286 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
287 "CounterMask": "6",
288 "Errata": "HSD78, HSD62, HSD61",
289 "SampleAfterValue": "2000003",
290 "CounterHTOff": "0,1,2,3,4,5,6,7"
291 },
292 {
293 "EventCode": "0x60",
167 "UMask": "0x2", 294 "UMask": "0x2",
168 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 295 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
169 "Counter": "0,1,2,3", 296 "Counter": "0,1,2,3",
@@ -186,23 +313,23 @@
186 }, 313 },
187 { 314 {
188 "EventCode": "0x60", 315 "EventCode": "0x60",
189 "UMask": "0x8", 316 "UMask": "0x4",
190 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore", 317 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
191 "Counter": "0,1,2,3", 318 "Counter": "0,1,2,3",
192 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 319 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
320 "CounterMask": "1",
193 "Errata": "HSD62, HSD61", 321 "Errata": "HSD62, HSD61",
194 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
195 "SampleAfterValue": "2000003", 322 "SampleAfterValue": "2000003",
196 "CounterHTOff": "0,1,2,3,4,5,6,7" 323 "CounterHTOff": "0,1,2,3,4,5,6,7"
197 }, 324 },
198 { 325 {
199 "EventCode": "0x60", 326 "EventCode": "0x60",
200 "UMask": "0x1", 327 "UMask": "0x8",
201 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 328 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
202 "Counter": "0,1,2,3", 329 "Counter": "0,1,2,3",
203 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD", 330 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
204 "CounterMask": "1", 331 "Errata": "HSD62, HSD61",
205 "Errata": "HSD78, HSD62, HSD61", 332 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
206 "SampleAfterValue": "2000003", 333 "SampleAfterValue": "2000003",
207 "CounterHTOff": "0,1,2,3,4,5,6,7" 334 "CounterHTOff": "0,1,2,3,4,5,6,7"
208 }, 335 },
@@ -218,17 +345,6 @@
218 "CounterHTOff": "0,1,2,3,4,5,6,7" 345 "CounterHTOff": "0,1,2,3,4,5,6,7"
219 }, 346 },
220 { 347 {
221 "EventCode": "0x60",
222 "UMask": "0x4",
223 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
224 "Counter": "0,1,2,3",
225 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
226 "CounterMask": "1",
227 "Errata": "HSD62, HSD61",
228 "SampleAfterValue": "2000003",
229 "CounterHTOff": "0,1,2,3,4,5,6,7"
230 },
231 {
232 "EventCode": "0x63", 348 "EventCode": "0x63",
233 "UMask": "0x2", 349 "UMask": "0x2",
234 "BriefDescription": "Cycles when L1D is locked", 350 "BriefDescription": "Cycles when L1D is locked",
@@ -289,9 +405,18 @@
289 "CounterHTOff": "0,1,2,3,4,5,6,7" 405 "CounterHTOff": "0,1,2,3,4,5,6,7"
290 }, 406 },
291 { 407 {
408 "EventCode": "0xB7, 0xBB",
409 "UMask": "0x1",
410 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
411 "Counter": "0,1,2,3",
412 "EventName": "OFFCORE_RESPONSE",
413 "SampleAfterValue": "100003",
414 "CounterHTOff": "0,1,2,3"
415 },
416 {
292 "EventCode": "0xD0", 417 "EventCode": "0xD0",
293 "UMask": "0x11", 418 "UMask": "0x11",
294 "BriefDescription": "Retired load uops that miss the STLB.", 419 "BriefDescription": "Retired load uops that miss the STLB. (precise Event)",
295 "Data_LA": "1", 420 "Data_LA": "1",
296 "PEBS": "1", 421 "PEBS": "1",
297 "Counter": "0,1,2,3", 422 "Counter": "0,1,2,3",
@@ -303,20 +428,20 @@
303 { 428 {
304 "EventCode": "0xD0", 429 "EventCode": "0xD0",
305 "UMask": "0x12", 430 "UMask": "0x12",
306 "BriefDescription": "Retired store uops that miss the STLB.", 431 "BriefDescription": "Retired store uops that miss the STLB. (precise Event)",
307 "Data_LA": "1", 432 "Data_LA": "1",
308 "PEBS": "1", 433 "PEBS": "1",
309 "Counter": "0,1,2,3", 434 "Counter": "0,1,2,3",
310 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 435 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
311 "Errata": "HSD29, HSM30", 436 "Errata": "HSD29, HSM30",
312 "SampleAfterValue": "100003",
313 "L1_Hit_Indication": "1", 437 "L1_Hit_Indication": "1",
438 "SampleAfterValue": "100003",
314 "CounterHTOff": "0,1,2,3" 439 "CounterHTOff": "0,1,2,3"
315 }, 440 },
316 { 441 {
317 "EventCode": "0xD0", 442 "EventCode": "0xD0",
318 "UMask": "0x21", 443 "UMask": "0x21",
319 "BriefDescription": "Retired load uops with locked access.", 444 "BriefDescription": "Retired load uops with locked access. (precise Event)",
320 "Data_LA": "1", 445 "Data_LA": "1",
321 "PEBS": "1", 446 "PEBS": "1",
322 "Counter": "0,1,2,3", 447 "Counter": "0,1,2,3",
@@ -328,32 +453,34 @@
328 { 453 {
329 "EventCode": "0xD0", 454 "EventCode": "0xD0",
330 "UMask": "0x41", 455 "UMask": "0x41",
331 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 456 "BriefDescription": "Retired load uops that split across a cacheline boundary. (precise Event)",
332 "Data_LA": "1", 457 "Data_LA": "1",
333 "PEBS": "1", 458 "PEBS": "1",
334 "Counter": "0,1,2,3", 459 "Counter": "0,1,2,3",
335 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 460 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
336 "Errata": "HSD29, HSM30", 461 "Errata": "HSD29, HSM30",
462 "PublicDescription": "This event counts load uops retired which had memory addresses spilt across 2 cache lines. A line split is across 64B cache-lines which may include a page split (4K). This is a precise event.",
337 "SampleAfterValue": "100003", 463 "SampleAfterValue": "100003",
338 "CounterHTOff": "0,1,2,3" 464 "CounterHTOff": "0,1,2,3"
339 }, 465 },
340 { 466 {
341 "EventCode": "0xD0", 467 "EventCode": "0xD0",
342 "UMask": "0x42", 468 "UMask": "0x42",
343 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 469 "BriefDescription": "Retired store uops that split across a cacheline boundary. (precise Event)",
344 "Data_LA": "1", 470 "Data_LA": "1",
345 "PEBS": "1", 471 "PEBS": "1",
346 "Counter": "0,1,2,3", 472 "Counter": "0,1,2,3",
347 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 473 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
348 "Errata": "HSD29, HSM30", 474 "Errata": "HSD29, HSM30",
349 "SampleAfterValue": "100003",
350 "L1_Hit_Indication": "1", 475 "L1_Hit_Indication": "1",
476 "PublicDescription": "This event counts store uops retired which had memory addresses spilt across 2 cache lines. A line split is across 64B cache-lines which may include a page split (4K). This is a precise event.",
477 "SampleAfterValue": "100003",
351 "CounterHTOff": "0,1,2,3" 478 "CounterHTOff": "0,1,2,3"
352 }, 479 },
353 { 480 {
354 "EventCode": "0xD0", 481 "EventCode": "0xD0",
355 "UMask": "0x81", 482 "UMask": "0x81",
356 "BriefDescription": "All retired load uops.", 483 "BriefDescription": "All retired load uops. (precise Event)",
357 "Data_LA": "1", 484 "Data_LA": "1",
358 "PEBS": "1", 485 "PEBS": "1",
359 "Counter": "0,1,2,3", 486 "Counter": "0,1,2,3",
@@ -365,14 +492,15 @@
365 { 492 {
366 "EventCode": "0xD0", 493 "EventCode": "0xD0",
367 "UMask": "0x82", 494 "UMask": "0x82",
368 "BriefDescription": "All retired store uops.", 495 "BriefDescription": "All retired store uops. (precise Event)",
369 "Data_LA": "1", 496 "Data_LA": "1",
370 "PEBS": "1", 497 "PEBS": "1",
371 "Counter": "0,1,2,3", 498 "Counter": "0,1,2,3",
372 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 499 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
373 "Errata": "HSD29, HSM30", 500 "Errata": "HSD29, HSM30",
374 "SampleAfterValue": "2000003",
375 "L1_Hit_Indication": "1", 501 "L1_Hit_Indication": "1",
502 "PublicDescription": "This event counts all store uops retired. This is a precise event.",
503 "SampleAfterValue": "2000003",
376 "CounterHTOff": "0,1,2,3" 504 "CounterHTOff": "0,1,2,3"
377 }, 505 },
378 { 506 {
@@ -402,13 +530,13 @@
402 { 530 {
403 "EventCode": "0xD1", 531 "EventCode": "0xD1",
404 "UMask": "0x4", 532 "UMask": "0x4",
405 "BriefDescription": "Retired load uops which data sources were data hits in L3 without snoops required.", 533 "BriefDescription": "Miss in last-level (L3) cache. Excludes Unknown data-source.",
406 "Data_LA": "1", 534 "Data_LA": "1",
407 "PEBS": "1", 535 "PEBS": "1",
408 "Counter": "0,1,2,3", 536 "Counter": "0,1,2,3",
409 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT", 537 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT",
410 "Errata": "HSD74, HSD29, HSD25, HSM26, HSM30", 538 "Errata": "HSD74, HSD29, HSD25, HSM26, HSM30",
411 "PublicDescription": "Retired load uops with L3 cache hits as data sources.", 539 "PublicDescription": "This event counts retired load uops in which data sources were data hits in the L3 cache without snoops required. This does not include hardware prefetches. This is a precise event.",
412 "SampleAfterValue": "50021", 540 "SampleAfterValue": "50021",
413 "CounterHTOff": "0,1,2,3" 541 "CounterHTOff": "0,1,2,3"
414 }, 542 },
@@ -421,20 +549,19 @@
421 "Counter": "0,1,2,3", 549 "Counter": "0,1,2,3",
422 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 550 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
423 "Errata": "HSM30", 551 "Errata": "HSM30",
424 "PublicDescription": "Retired load uops missed L1 cache as data sources.", 552 "PublicDescription": "This event counts retired load uops in which data sources missed in the L1 cache. This does not include hardware prefetches. This is a precise event.",
425 "SampleAfterValue": "100003", 553 "SampleAfterValue": "100003",
426 "CounterHTOff": "0,1,2,3" 554 "CounterHTOff": "0,1,2,3"
427 }, 555 },
428 { 556 {
429 "EventCode": "0xD1", 557 "EventCode": "0xD1",
430 "UMask": "0x10", 558 "UMask": "0x10",
431 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 559 "BriefDescription": "Retired load uops with L2 cache misses as data sources.",
432 "Data_LA": "1", 560 "Data_LA": "1",
433 "PEBS": "1", 561 "PEBS": "1",
434 "Counter": "0,1,2,3", 562 "Counter": "0,1,2,3",
435 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 563 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
436 "Errata": "HSD29, HSM30", 564 "Errata": "HSD29, HSM30",
437 "PublicDescription": "Retired load uops missed L2. Unknown data source excluded.",
438 "SampleAfterValue": "50021", 565 "SampleAfterValue": "50021",
439 "CounterHTOff": "0,1,2,3" 566 "CounterHTOff": "0,1,2,3"
440 }, 567 },
@@ -447,7 +574,6 @@
447 "Counter": "0,1,2,3", 574 "Counter": "0,1,2,3",
448 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_MISS", 575 "EventName": "MEM_LOAD_UOPS_RETIRED.L3_MISS",
449 "Errata": "HSD74, HSD29, HSD25, HSM26, HSM30", 576 "Errata": "HSD74, HSD29, HSD25, HSM26, HSM30",
450 "PublicDescription": "Retired load uops missed L3. Excludes unknown data source .",
451 "SampleAfterValue": "100003", 577 "SampleAfterValue": "100003",
452 "CounterHTOff": "0,1,2,3" 578 "CounterHTOff": "0,1,2,3"
453 }, 579 },
@@ -478,24 +604,26 @@
478 { 604 {
479 "EventCode": "0xD2", 605 "EventCode": "0xD2",
480 "UMask": "0x2", 606 "UMask": "0x2",
481 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache.", 607 "BriefDescription": "Retired load uops which data sources were L3 and cross-core snoop hits in on-pkg core cache. ",
482 "Data_LA": "1", 608 "Data_LA": "1",
483 "PEBS": "1", 609 "PEBS": "1",
484 "Counter": "0,1,2,3", 610 "Counter": "0,1,2,3",
485 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT", 611 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT",
486 "Errata": "HSD29, HSD25, HSM26, HSM30", 612 "Errata": "HSD29, HSD25, HSM26, HSM30",
613 "PublicDescription": "This event counts retired load uops that hit in the L3 cache, but required a cross-core snoop which resulted in a HIT in an on-pkg core cache. This does not include hardware prefetches. This is a precise event.",
487 "SampleAfterValue": "20011", 614 "SampleAfterValue": "20011",
488 "CounterHTOff": "0,1,2,3" 615 "CounterHTOff": "0,1,2,3"
489 }, 616 },
490 { 617 {
491 "EventCode": "0xD2", 618 "EventCode": "0xD2",
492 "UMask": "0x4", 619 "UMask": "0x4",
493 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3.", 620 "BriefDescription": "Retired load uops which data sources were HitM responses from shared L3. ",
494 "Data_LA": "1", 621 "Data_LA": "1",
495 "PEBS": "1", 622 "PEBS": "1",
496 "Counter": "0,1,2,3", 623 "Counter": "0,1,2,3",
497 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM", 624 "EventName": "MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM",
498 "Errata": "HSD29, HSD25, HSM26, HSM30", 625 "Errata": "HSD29, HSD25, HSM26, HSM30",
626 "PublicDescription": "This event counts retired load uops that hit in the L3 cache, but required a cross-core snoop which resulted in a HITM (hit modified) in an on-pkg core cache. This does not include hardware prefetches. This is a precise event.",
499 "SampleAfterValue": "20011", 627 "SampleAfterValue": "20011",
500 "CounterHTOff": "0,1,2,3" 628 "CounterHTOff": "0,1,2,3"
501 }, 629 },
@@ -514,20 +642,19 @@
514 { 642 {
515 "EventCode": "0xD3", 643 "EventCode": "0xD3",
516 "UMask": "0x1", 644 "UMask": "0x1",
517 "BriefDescription": "Data from local DRAM either Snoop not needed or Snoop Miss (RspI)",
518 "Data_LA": "1", 645 "Data_LA": "1",
519 "PEBS": "1", 646 "PEBS": "1",
520 "Counter": "0,1,2,3", 647 "Counter": "0,1,2,3",
521 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM", 648 "EventName": "MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM",
522 "Errata": "HSD74, HSD29, HSD25, HSM30", 649 "Errata": "HSD74, HSD29, HSD25, HSM30",
523 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches.", 650 "PublicDescription": "This event counts retired load uops where the data came from local DRAM. This does not include hardware prefetches. This is a precise event.",
524 "SampleAfterValue": "100003", 651 "SampleAfterValue": "100003",
525 "CounterHTOff": "0,1,2,3" 652 "CounterHTOff": "0,1,2,3"
526 }, 653 },
527 { 654 {
528 "EventCode": "0xD3", 655 "EventCode": "0xD3",
529 "UMask": "0x4", 656 "UMask": "0x4",
530 "BriefDescription": "Retired load uop whose Data Source was: remote DRAM either Snoop not needed or Snoop Miss (RspI)", 657 "BriefDescription": "Retired load uop whose Data Source was: remote DRAM either Snoop not needed or Snoop Miss (RspI) (Precise Event)",
531 "Data_LA": "1", 658 "Data_LA": "1",
532 "PEBS": "1", 659 "PEBS": "1",
533 "Counter": "0,1,2,3", 660 "Counter": "0,1,2,3",
@@ -539,7 +666,7 @@
539 { 666 {
540 "EventCode": "0xD3", 667 "EventCode": "0xD3",
541 "UMask": "0x10", 668 "UMask": "0x10",
542 "BriefDescription": "Retired load uop whose Data Source was: Remote cache HITM", 669 "BriefDescription": "Retired load uop whose Data Source was: Remote cache HITM (Precise Event)",
543 "Data_LA": "1", 670 "Data_LA": "1",
544 "PEBS": "1", 671 "PEBS": "1",
545 "Counter": "0,1,2,3", 672 "Counter": "0,1,2,3",
@@ -551,7 +678,7 @@
551 { 678 {
552 "EventCode": "0xD3", 679 "EventCode": "0xD3",
553 "UMask": "0x20", 680 "UMask": "0x20",
554 "BriefDescription": "Retired load uop whose Data Source was: forwarded from remote cache", 681 "BriefDescription": "Retired load uop whose Data Source was: forwarded from remote cache (Precise Event)",
555 "Data_LA": "1", 682 "Data_LA": "1",
556 "PEBS": "1", 683 "PEBS": "1",
557 "Counter": "0,1,2,3", 684 "Counter": "0,1,2,3",
@@ -706,135 +833,11 @@
706 "BriefDescription": "Split locks in SQ", 833 "BriefDescription": "Split locks in SQ",
707 "Counter": "0,1,2,3", 834 "Counter": "0,1,2,3",
708 "EventName": "SQ_MISC.SPLIT_LOCK", 835 "EventName": "SQ_MISC.SPLIT_LOCK",
836 "PublicDescription": "",
709 "SampleAfterValue": "100003", 837 "SampleAfterValue": "100003",
710 "CounterHTOff": "0,1,2,3,4,5,6,7" 838 "CounterHTOff": "0,1,2,3,4,5,6,7"
711 }, 839 },
712 { 840 {
713 "EventCode": "0x24",
714 "UMask": "0x42",
715 "BriefDescription": "RFO requests that hit L2 cache",
716 "Counter": "0,1,2,3",
717 "EventName": "L2_RQSTS.RFO_HIT",
718 "PublicDescription": "Counts the number of store RFO requests that hit the L2 cache.",
719 "SampleAfterValue": "200003",
720 "CounterHTOff": "0,1,2,3,4,5,6,7"
721 },
722 {
723 "EventCode": "0x24",
724 "UMask": "0x22",
725 "BriefDescription": "RFO requests that miss L2 cache",
726 "Counter": "0,1,2,3",
727 "EventName": "L2_RQSTS.RFO_MISS",
728 "PublicDescription": "Counts the number of store RFO requests that miss the L2 cache.",
729 "SampleAfterValue": "200003",
730 "CounterHTOff": "0,1,2,3,4,5,6,7"
731 },
732 {
733 "EventCode": "0x24",
734 "UMask": "0x44",
735 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
736 "Counter": "0,1,2,3",
737 "EventName": "L2_RQSTS.CODE_RD_HIT",
738 "PublicDescription": "Number of instruction fetches that hit the L2 cache.",
739 "SampleAfterValue": "200003",
740 "CounterHTOff": "0,1,2,3,4,5,6,7"
741 },
742 {
743 "EventCode": "0x24",
744 "UMask": "0x24",
745 "BriefDescription": "L2 cache misses when fetching instructions",
746 "Counter": "0,1,2,3",
747 "EventName": "L2_RQSTS.CODE_RD_MISS",
748 "PublicDescription": "Number of instruction fetches that missed the L2 cache.",
749 "SampleAfterValue": "200003",
750 "CounterHTOff": "0,1,2,3,4,5,6,7"
751 },
752 {
753 "EventCode": "0x24",
754 "UMask": "0x27",
755 "BriefDescription": "Demand requests that miss L2 cache",
756 "Counter": "0,1,2,3",
757 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
758 "Errata": "HSD78",
759 "PublicDescription": "Demand requests that miss L2 cache.",
760 "SampleAfterValue": "200003",
761 "CounterHTOff": "0,1,2,3,4,5,6,7"
762 },
763 {
764 "EventCode": "0x24",
765 "UMask": "0xe7",
766 "BriefDescription": "Demand requests to L2 cache",
767 "Counter": "0,1,2,3",
768 "EventName": "L2_RQSTS.ALL_DEMAND_REFERENCES",
769 "Errata": "HSD78",
770 "PublicDescription": "Demand requests to L2 cache.",
771 "SampleAfterValue": "200003",
772 "CounterHTOff": "0,1,2,3,4,5,6,7"
773 },
774 {
775 "EventCode": "0x24",
776 "UMask": "0x3f",
777 "BriefDescription": "All requests that miss L2 cache",
778 "Counter": "0,1,2,3",
779 "EventName": "L2_RQSTS.MISS",
780 "Errata": "HSD78",
781 "PublicDescription": "All requests that missed L2.",
782 "SampleAfterValue": "200003",
783 "CounterHTOff": "0,1,2,3,4,5,6,7"
784 },
785 {
786 "EventCode": "0x24",
787 "UMask": "0xff",
788 "BriefDescription": "All L2 requests",
789 "Counter": "0,1,2,3",
790 "EventName": "L2_RQSTS.REFERENCES",
791 "Errata": "HSD78",
792 "PublicDescription": "All requests to L2 cache.",
793 "SampleAfterValue": "200003",
794 "CounterHTOff": "0,1,2,3,4,5,6,7"
795 },
796 {
797 "EventCode": "0xB7, 0xBB",
798 "UMask": "0x1",
799 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
800 "Counter": "0,1,2,3",
801 "EventName": "OFFCORE_RESPONSE",
802 "SampleAfterValue": "100003",
803 "CounterHTOff": "0,1,2,3"
804 },
805 {
806 "EventCode": "0x60",
807 "UMask": "0x1",
808 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
809 "Counter": "0,1,2,3",
810 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
811 "CounterMask": "6",
812 "Errata": "HSD78, HSD62, HSD61",
813 "SampleAfterValue": "2000003",
814 "CounterHTOff": "0,1,2,3,4,5,6,7"
815 },
816 {
817 "EventCode": "0x48",
818 "UMask": "0x1",
819 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
820 "Counter": "2",
821 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
822 "AnyThread": "1",
823 "CounterMask": "1",
824 "SampleAfterValue": "2000003",
825 "CounterHTOff": "2"
826 },
827 {
828 "EventCode": "0x48",
829 "UMask": "0x2",
830 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
831 "Counter": "0,1,2,3",
832 "EventName": "L1D_PEND_MISS.FB_FULL",
833 "CounterMask": "1",
834 "SampleAfterValue": "2000003",
835 "CounterHTOff": "0,1,2,3,4,5,6,7"
836 },
837 {
838 "Offcore": "1", 841 "Offcore": "1",
839 "EventCode": "0xB7, 0xBB", 842 "EventCode": "0xB7, 0xBB",
840 "UMask": "0x1", 843 "UMask": "0x1",
@@ -843,6 +846,7 @@
843 "Counter": "0,1,2,3", 846 "Counter": "0,1,2,3",
844 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 847 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
845 "MSRIndex": "0x1a6,0x1a7", 848 "MSRIndex": "0x1a6,0x1a7",
849 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
846 "SampleAfterValue": "100003", 850 "SampleAfterValue": "100003",
847 "CounterHTOff": "0,1,2,3" 851 "CounterHTOff": "0,1,2,3"
848 }, 852 },
@@ -855,6 +859,7 @@
855 "Counter": "0,1,2,3", 859 "Counter": "0,1,2,3",
856 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_HIT.HITM_OTHER_CORE", 860 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_HIT.HITM_OTHER_CORE",
857 "MSRIndex": "0x1a6,0x1a7", 861 "MSRIndex": "0x1a6,0x1a7",
862 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
858 "SampleAfterValue": "100003", 863 "SampleAfterValue": "100003",
859 "CounterHTOff": "0,1,2,3" 864 "CounterHTOff": "0,1,2,3"
860 }, 865 },
@@ -867,6 +872,7 @@
867 "Counter": "0,1,2,3", 872 "Counter": "0,1,2,3",
868 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 873 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
869 "MSRIndex": "0x1a6,0x1a7", 874 "MSRIndex": "0x1a6,0x1a7",
875 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
870 "SampleAfterValue": "100003", 876 "SampleAfterValue": "100003",
871 "CounterHTOff": "0,1,2,3" 877 "CounterHTOff": "0,1,2,3"
872 }, 878 },
@@ -879,6 +885,7 @@
879 "Counter": "0,1,2,3", 885 "Counter": "0,1,2,3",
880 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.HITM_OTHER_CORE", 886 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_HIT.HITM_OTHER_CORE",
881 "MSRIndex": "0x1a6,0x1a7", 887 "MSRIndex": "0x1a6,0x1a7",
888 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
882 "SampleAfterValue": "100003", 889 "SampleAfterValue": "100003",
883 "CounterHTOff": "0,1,2,3" 890 "CounterHTOff": "0,1,2,3"
884 }, 891 },
@@ -891,6 +898,7 @@
891 "Counter": "0,1,2,3", 898 "Counter": "0,1,2,3",
892 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 899 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
893 "MSRIndex": "0x1a6,0x1a7", 900 "MSRIndex": "0x1a6,0x1a7",
901 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
894 "SampleAfterValue": "100003", 902 "SampleAfterValue": "100003",
895 "CounterHTOff": "0,1,2,3" 903 "CounterHTOff": "0,1,2,3"
896 }, 904 },
@@ -903,6 +911,7 @@
903 "Counter": "0,1,2,3", 911 "Counter": "0,1,2,3",
904 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_HIT.HITM_OTHER_CORE", 912 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_HIT.HITM_OTHER_CORE",
905 "MSRIndex": "0x1a6,0x1a7", 913 "MSRIndex": "0x1a6,0x1a7",
914 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
906 "SampleAfterValue": "100003", 915 "SampleAfterValue": "100003",
907 "CounterHTOff": "0,1,2,3" 916 "CounterHTOff": "0,1,2,3"
908 }, 917 },
@@ -915,6 +924,7 @@
915 "Counter": "0,1,2,3", 924 "Counter": "0,1,2,3",
916 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.LLC_HIT.ANY_RESPONSE", 925 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.LLC_HIT.ANY_RESPONSE",
917 "MSRIndex": "0x1a6,0x1a7", 926 "MSRIndex": "0x1a6,0x1a7",
927 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
918 "SampleAfterValue": "100003", 928 "SampleAfterValue": "100003",
919 "CounterHTOff": "0,1,2,3" 929 "CounterHTOff": "0,1,2,3"
920 }, 930 },
@@ -927,6 +937,7 @@
927 "Counter": "0,1,2,3", 937 "Counter": "0,1,2,3",
928 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.LLC_HIT.ANY_RESPONSE", 938 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.LLC_HIT.ANY_RESPONSE",
929 "MSRIndex": "0x1a6,0x1a7", 939 "MSRIndex": "0x1a6,0x1a7",
940 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
930 "SampleAfterValue": "100003", 941 "SampleAfterValue": "100003",
931 "CounterHTOff": "0,1,2,3" 942 "CounterHTOff": "0,1,2,3"
932 }, 943 },
@@ -939,6 +950,7 @@
939 "Counter": "0,1,2,3", 950 "Counter": "0,1,2,3",
940 "EventName": "OFFCORE_RESPONSE.PF_L2_CODE_RD.LLC_HIT.ANY_RESPONSE", 951 "EventName": "OFFCORE_RESPONSE.PF_L2_CODE_RD.LLC_HIT.ANY_RESPONSE",
941 "MSRIndex": "0x1a6,0x1a7", 952 "MSRIndex": "0x1a6,0x1a7",
953 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
942 "SampleAfterValue": "100003", 954 "SampleAfterValue": "100003",
943 "CounterHTOff": "0,1,2,3" 955 "CounterHTOff": "0,1,2,3"
944 }, 956 },
@@ -951,6 +963,7 @@
951 "Counter": "0,1,2,3", 963 "Counter": "0,1,2,3",
952 "EventName": "OFFCORE_RESPONSE.PF_LLC_DATA_RD.LLC_HIT.ANY_RESPONSE", 964 "EventName": "OFFCORE_RESPONSE.PF_LLC_DATA_RD.LLC_HIT.ANY_RESPONSE",
953 "MSRIndex": "0x1a6,0x1a7", 965 "MSRIndex": "0x1a6,0x1a7",
966 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
954 "SampleAfterValue": "100003", 967 "SampleAfterValue": "100003",
955 "CounterHTOff": "0,1,2,3" 968 "CounterHTOff": "0,1,2,3"
956 }, 969 },
@@ -963,6 +976,7 @@
963 "Counter": "0,1,2,3", 976 "Counter": "0,1,2,3",
964 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_HIT.ANY_RESPONSE", 977 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_HIT.ANY_RESPONSE",
965 "MSRIndex": "0x1a6,0x1a7", 978 "MSRIndex": "0x1a6,0x1a7",
979 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
966 "SampleAfterValue": "100003", 980 "SampleAfterValue": "100003",
967 "CounterHTOff": "0,1,2,3" 981 "CounterHTOff": "0,1,2,3"
968 }, 982 },
@@ -975,6 +989,7 @@
975 "Counter": "0,1,2,3", 989 "Counter": "0,1,2,3",
976 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_HIT.ANY_RESPONSE", 990 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_HIT.ANY_RESPONSE",
977 "MSRIndex": "0x1a6,0x1a7", 991 "MSRIndex": "0x1a6,0x1a7",
992 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
978 "SampleAfterValue": "100003", 993 "SampleAfterValue": "100003",
979 "CounterHTOff": "0,1,2,3" 994 "CounterHTOff": "0,1,2,3"
980 }, 995 },
@@ -987,6 +1002,7 @@
987 "Counter": "0,1,2,3", 1002 "Counter": "0,1,2,3",
988 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 1003 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
989 "MSRIndex": "0x1a6,0x1a7", 1004 "MSRIndex": "0x1a6,0x1a7",
1005 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
990 "SampleAfterValue": "100003", 1006 "SampleAfterValue": "100003",
991 "CounterHTOff": "0,1,2,3" 1007 "CounterHTOff": "0,1,2,3"
992 }, 1008 },
@@ -999,6 +1015,7 @@
999 "Counter": "0,1,2,3", 1015 "Counter": "0,1,2,3",
1000 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HITM_OTHER_CORE", 1016 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_HIT.HITM_OTHER_CORE",
1001 "MSRIndex": "0x1a6,0x1a7", 1017 "MSRIndex": "0x1a6,0x1a7",
1018 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1002 "SampleAfterValue": "100003", 1019 "SampleAfterValue": "100003",
1003 "CounterHTOff": "0,1,2,3" 1020 "CounterHTOff": "0,1,2,3"
1004 }, 1021 },
@@ -1011,6 +1028,7 @@
1011 "Counter": "0,1,2,3", 1028 "Counter": "0,1,2,3",
1012 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 1029 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
1013 "MSRIndex": "0x1a6,0x1a7", 1030 "MSRIndex": "0x1a6,0x1a7",
1031 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1014 "SampleAfterValue": "100003", 1032 "SampleAfterValue": "100003",
1015 "CounterHTOff": "0,1,2,3" 1033 "CounterHTOff": "0,1,2,3"
1016 }, 1034 },
@@ -1023,6 +1041,7 @@
1023 "Counter": "0,1,2,3", 1041 "Counter": "0,1,2,3",
1024 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HITM_OTHER_CORE", 1042 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_HIT.HITM_OTHER_CORE",
1025 "MSRIndex": "0x1a6,0x1a7", 1043 "MSRIndex": "0x1a6,0x1a7",
1044 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1026 "SampleAfterValue": "100003", 1045 "SampleAfterValue": "100003",
1027 "CounterHTOff": "0,1,2,3" 1046 "CounterHTOff": "0,1,2,3"
1028 }, 1047 },
@@ -1035,6 +1054,7 @@
1035 "Counter": "0,1,2,3", 1054 "Counter": "0,1,2,3",
1036 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 1055 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
1037 "MSRIndex": "0x1a6,0x1a7", 1056 "MSRIndex": "0x1a6,0x1a7",
1057 "PublicDescription": "Counts all demand & prefetch code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1038 "SampleAfterValue": "100003", 1058 "SampleAfterValue": "100003",
1039 "CounterHTOff": "0,1,2,3" 1059 "CounterHTOff": "0,1,2,3"
1040 }, 1060 },
@@ -1047,6 +1067,7 @@
1047 "Counter": "0,1,2,3", 1067 "Counter": "0,1,2,3",
1048 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HIT_OTHER_CORE_NO_FWD", 1068 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HIT_OTHER_CORE_NO_FWD",
1049 "MSRIndex": "0x1a6,0x1a7", 1069 "MSRIndex": "0x1a6,0x1a7",
1070 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1050 "SampleAfterValue": "100003", 1071 "SampleAfterValue": "100003",
1051 "CounterHTOff": "0,1,2,3" 1072 "CounterHTOff": "0,1,2,3"
1052 }, 1073 },
@@ -1059,6 +1080,7 @@
1059 "Counter": "0,1,2,3", 1080 "Counter": "0,1,2,3",
1060 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HITM_OTHER_CORE", 1081 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_HIT.HITM_OTHER_CORE",
1061 "MSRIndex": "0x1a6,0x1a7", 1082 "MSRIndex": "0x1a6,0x1a7",
1083 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1062 "SampleAfterValue": "100003", 1084 "SampleAfterValue": "100003",
1063 "CounterHTOff": "0,1,2,3" 1085 "CounterHTOff": "0,1,2,3"
1064 }, 1086 },
@@ -1071,6 +1093,7 @@
1071 "Counter": "0,1,2,3", 1093 "Counter": "0,1,2,3",
1072 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_HIT.ANY_RESPONSE", 1094 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_HIT.ANY_RESPONSE",
1073 "MSRIndex": "0x1a6,0x1a7", 1095 "MSRIndex": "0x1a6,0x1a7",
1096 "PublicDescription": "Counts all requests that hit in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1074 "SampleAfterValue": "100003", 1097 "SampleAfterValue": "100003",
1075 "CounterHTOff": "0,1,2,3" 1098 "CounterHTOff": "0,1,2,3"
1076 } 1099 }
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/floating-point.json b/tools/perf/pmu-events/arch/x86/haswellx/floating-point.json
index 6282aed6e090..bc08cc1f2f7e 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/floating-point.json
@@ -20,6 +20,16 @@
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "EventCode": "0xC6",
24 "UMask": "0x7",
25 "BriefDescription": "Approximate counts of AVX & AVX2 256-bit instructions, including non-arithmetic instructions, loads, and stores. May count non-AVX instructions that employ 256-bit operations, including (but not necessarily limited to) rep string instructions that use 256-bit loads and stores for optimized performance, XSAVE* and XRSTOR*, and operations that transition the x87 FPU data registers between x87 and MMX.",
26 "Counter": "0,1,2,3",
27 "EventName": "AVX_INSTS.ALL",
28 "PublicDescription": "Note that a whole rep string only counts AVX_INST.ALL once.",
29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
23 "EventCode": "0xCA", 33 "EventCode": "0xCA",
24 "UMask": "0x2", 34 "UMask": "0x2",
25 "BriefDescription": "Number of X87 assists due to output value.", 35 "BriefDescription": "Number of X87 assists due to output value.",
@@ -69,15 +79,5 @@
69 "PublicDescription": "Cycles with any input/output SSE* or FP assists.", 79 "PublicDescription": "Cycles with any input/output SSE* or FP assists.",
70 "SampleAfterValue": "100003", 80 "SampleAfterValue": "100003",
71 "CounterHTOff": "0,1,2,3" 81 "CounterHTOff": "0,1,2,3"
72 },
73 {
74 "EventCode": "0xC6",
75 "UMask": "0x7",
76 "BriefDescription": "Approximate counts of AVX & AVX2 256-bit instructions, including non-arithmetic instructions, loads, and stores. May count non-AVX instructions that employ 256-bit operations, including (but not necessarily limited to) rep string instructions that use 256-bit loads and stores for optimized performance, XSAVE* and XRSTOR*, and operations that transition the x87 FPU data registers between x87 and MMX.",
77 "Counter": "0,1,2,3",
78 "EventName": "AVX_INSTS.ALL",
79 "PublicDescription": "Note that a whole rep string only counts AVX_INST.ALL once.",
80 "SampleAfterValue": "2000003",
81 "CounterHTOff": "0,1,2,3,4,5,6,7"
82 } 82 }
83] \ No newline at end of file 83] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/frontend.json b/tools/perf/pmu-events/arch/x86/haswellx/frontend.json
index 2d0c7aac1e61..a4d9f1fcf940 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/frontend.json
@@ -22,72 +22,41 @@
22 }, 22 },
23 { 23 {
24 "EventCode": "0x79", 24 "EventCode": "0x79",
25 "UMask": "0x8", 25 "UMask": "0x4",
26 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path", 26 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.",
27 "Counter": "0,1,2,3",
28 "EventName": "IDQ.DSB_UOPS",
29 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.",
30 "SampleAfterValue": "2000003",
31 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 },
33 {
34 "EventCode": "0x79",
35 "UMask": "0x10",
36 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
37 "Counter": "0,1,2,3",
38 "EventName": "IDQ.MS_DSB_UOPS",
39 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
40 "SampleAfterValue": "2000003",
41 "CounterHTOff": "0,1,2,3,4,5,6,7"
42 },
43 {
44 "EventCode": "0x79",
45 "UMask": "0x20",
46 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
47 "Counter": "0,1,2,3",
48 "EventName": "IDQ.MS_MITE_UOPS",
49 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
50 "SampleAfterValue": "2000003",
51 "CounterHTOff": "0,1,2,3,4,5,6,7"
52 },
53 {
54 "EventCode": "0x79",
55 "UMask": "0x30",
56 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
57 "Counter": "0,1,2,3", 27 "Counter": "0,1,2,3",
58 "EventName": "IDQ.MS_UOPS", 28 "EventName": "IDQ.MITE_CYCLES",
59 "PublicDescription": "This event counts uops delivered by the Front-end with the assistance of the microcode sequencer. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.", 29 "CounterMask": "1",
60 "SampleAfterValue": "2000003", 30 "SampleAfterValue": "2000003",
61 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
62 }, 32 },
63 { 33 {
64 "EventCode": "0x79", 34 "EventCode": "0x79",
65 "UMask": "0x30", 35 "UMask": "0x8",
66 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 36 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
67 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
68 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
69 "CounterMask": "1", 39 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.",
70 "PublicDescription": "This event counts cycles during which the microcode sequencer assisted the Front-end in delivering uops. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.",
71 "SampleAfterValue": "2000003", 40 "SampleAfterValue": "2000003",
72 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
73 }, 42 },
74 { 43 {
75 "EventCode": "0x79", 44 "EventCode": "0x79",
76 "UMask": "0x4", 45 "UMask": "0x8",
77 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.", 46 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.",
78 "Counter": "0,1,2,3", 47 "Counter": "0,1,2,3",
79 "EventName": "IDQ.MITE_CYCLES", 48 "EventName": "IDQ.DSB_CYCLES",
80 "CounterMask": "1", 49 "CounterMask": "1",
81 "SampleAfterValue": "2000003", 50 "SampleAfterValue": "2000003",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 51 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 52 },
84 { 53 {
85 "EventCode": "0x79", 54 "EventCode": "0x79",
86 "UMask": "0x8", 55 "UMask": "0x10",
87 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.", 56 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
88 "Counter": "0,1,2,3", 57 "Counter": "0,1,2,3",
89 "EventName": "IDQ.DSB_CYCLES", 58 "EventName": "IDQ.MS_DSB_UOPS",
90 "CounterMask": "1", 59 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
91 "SampleAfterValue": "2000003", 60 "SampleAfterValue": "2000003",
92 "CounterHTOff": "0,1,2,3,4,5,6,7" 61 "CounterHTOff": "0,1,2,3,4,5,6,7"
93 }, 62 },
@@ -136,6 +105,16 @@
136 }, 105 },
137 { 106 {
138 "EventCode": "0x79", 107 "EventCode": "0x79",
108 "UMask": "0x20",
109 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
110 "Counter": "0,1,2,3",
111 "EventName": "IDQ.MS_MITE_UOPS",
112 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
113 "SampleAfterValue": "2000003",
114 "CounterHTOff": "0,1,2,3,4,5,6,7"
115 },
116 {
117 "EventCode": "0x79",
139 "UMask": "0x24", 118 "UMask": "0x24",
140 "BriefDescription": "Cycles MITE is delivering 4 Uops", 119 "BriefDescription": "Cycles MITE is delivering 4 Uops",
141 "Counter": "0,1,2,3", 120 "Counter": "0,1,2,3",
@@ -158,6 +137,38 @@
158 }, 137 },
159 { 138 {
160 "EventCode": "0x79", 139 "EventCode": "0x79",
140 "UMask": "0x30",
141 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
142 "Counter": "0,1,2,3",
143 "EventName": "IDQ.MS_UOPS",
144 "PublicDescription": "This event counts uops delivered by the Front-end with the assistance of the microcode sequencer. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.",
145 "SampleAfterValue": "2000003",
146 "CounterHTOff": "0,1,2,3,4,5,6,7"
147 },
148 {
149 "EventCode": "0x79",
150 "UMask": "0x30",
151 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
152 "Counter": "0,1,2,3",
153 "EventName": "IDQ.MS_CYCLES",
154 "CounterMask": "1",
155 "PublicDescription": "This event counts cycles during which the microcode sequencer assisted the Front-end in delivering uops. Microcode assists are used for complex instructions or scenarios that can't be handled by the standard decoder. Using other instructions, if possible, will usually improve performance.",
156 "SampleAfterValue": "2000003",
157 "CounterHTOff": "0,1,2,3,4,5,6,7"
158 },
159 {
160 "EdgeDetect": "1",
161 "EventCode": "0x79",
162 "UMask": "0x30",
163 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
164 "Counter": "0,1,2,3",
165 "EventName": "IDQ.MS_SWITCHES",
166 "CounterMask": "1",
167 "SampleAfterValue": "2000003",
168 "CounterHTOff": "0,1,2,3,4,5,6,7"
169 },
170 {
171 "EventCode": "0x79",
161 "UMask": "0x3c", 172 "UMask": "0x3c",
162 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path", 173 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path",
163 "Counter": "0,1,2,3", 174 "Counter": "0,1,2,3",
@@ -195,6 +206,15 @@
195 "CounterHTOff": "0,1,2,3,4,5,6,7" 206 "CounterHTOff": "0,1,2,3,4,5,6,7"
196 }, 207 },
197 { 208 {
209 "EventCode": "0x80",
210 "UMask": "0x4",
211 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction-cache miss.",
212 "Counter": "0,1,2,3",
213 "EventName": "ICACHE.IFDATA_STALL",
214 "SampleAfterValue": "2000003",
215 "CounterHTOff": "0,1,2,3,4,5,6,7"
216 },
217 {
198 "EventCode": "0x9C", 218 "EventCode": "0x9C",
199 "UMask": "0x1", 219 "UMask": "0x1",
200 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled", 220 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled",
@@ -270,25 +290,5 @@
270 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES", 290 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES",
271 "SampleAfterValue": "2000003", 291 "SampleAfterValue": "2000003",
272 "CounterHTOff": "0,1,2,3,4,5,6,7" 292 "CounterHTOff": "0,1,2,3,4,5,6,7"
273 },
274 {
275 "EdgeDetect": "1",
276 "EventCode": "0x79",
277 "UMask": "0x30",
278 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
279 "Counter": "0,1,2,3",
280 "EventName": "IDQ.MS_SWITCHES",
281 "CounterMask": "1",
282 "SampleAfterValue": "2000003",
283 "CounterHTOff": "0,1,2,3,4,5,6,7"
284 },
285 {
286 "EventCode": "0x80",
287 "UMask": "0x4",
288 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction-cache miss.",
289 "Counter": "0,1,2,3",
290 "EventName": "ICACHE.IFDATA_STALL",
291 "SampleAfterValue": "2000003",
292 "CounterHTOff": "0,1,2,3,4,5,6,7"
293 } 293 }
294] \ No newline at end of file 294] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/memory.json b/tools/perf/pmu-events/arch/x86/haswellx/memory.json
index 0886cc000d22..56b0f24b8029 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/memory.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/memory.json
@@ -409,6 +409,7 @@
409 "Counter": "0,1,2,3", 409 "Counter": "0,1,2,3",
410 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_MISS.ANY_RESPONSE", 410 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_MISS.ANY_RESPONSE",
411 "MSRIndex": "0x1a6,0x1a7", 411 "MSRIndex": "0x1a6,0x1a7",
412 "PublicDescription": "Counts demand data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
412 "SampleAfterValue": "100003", 413 "SampleAfterValue": "100003",
413 "CounterHTOff": "0,1,2,3" 414 "CounterHTOff": "0,1,2,3"
414 }, 415 },
@@ -421,6 +422,7 @@
421 "Counter": "0,1,2,3", 422 "Counter": "0,1,2,3",
422 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_MISS.LOCAL_DRAM", 423 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.LLC_MISS.LOCAL_DRAM",
423 "MSRIndex": "0x1a6,0x1a7", 424 "MSRIndex": "0x1a6,0x1a7",
425 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
424 "SampleAfterValue": "100003", 426 "SampleAfterValue": "100003",
425 "CounterHTOff": "0,1,2,3" 427 "CounterHTOff": "0,1,2,3"
426 }, 428 },
@@ -433,6 +435,7 @@
433 "Counter": "0,1,2,3", 435 "Counter": "0,1,2,3",
434 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.ANY_RESPONSE", 436 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.ANY_RESPONSE",
435 "MSRIndex": "0x1a6,0x1a7", 437 "MSRIndex": "0x1a6,0x1a7",
438 "PublicDescription": "Counts all demand data writes (RFOs) that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
436 "SampleAfterValue": "100003", 439 "SampleAfterValue": "100003",
437 "CounterHTOff": "0,1,2,3" 440 "CounterHTOff": "0,1,2,3"
438 }, 441 },
@@ -445,6 +448,7 @@
445 "Counter": "0,1,2,3", 448 "Counter": "0,1,2,3",
446 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.LOCAL_DRAM", 449 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.LOCAL_DRAM",
447 "MSRIndex": "0x1a6,0x1a7", 450 "MSRIndex": "0x1a6,0x1a7",
451 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
448 "SampleAfterValue": "100003", 452 "SampleAfterValue": "100003",
449 "CounterHTOff": "0,1,2,3" 453 "CounterHTOff": "0,1,2,3"
450 }, 454 },
@@ -457,6 +461,7 @@
457 "Counter": "0,1,2,3", 461 "Counter": "0,1,2,3",
458 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.REMOTE_HITM", 462 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.LLC_MISS.REMOTE_HITM",
459 "MSRIndex": "0x1a6,0x1a7", 463 "MSRIndex": "0x1a6,0x1a7",
464 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the modified data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
460 "SampleAfterValue": "100003", 465 "SampleAfterValue": "100003",
461 "CounterHTOff": "0,1,2,3" 466 "CounterHTOff": "0,1,2,3"
462 }, 467 },
@@ -469,6 +474,7 @@
469 "Counter": "0,1,2,3", 474 "Counter": "0,1,2,3",
470 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_MISS.ANY_RESPONSE", 475 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_MISS.ANY_RESPONSE",
471 "MSRIndex": "0x1a6,0x1a7", 476 "MSRIndex": "0x1a6,0x1a7",
477 "PublicDescription": "Counts all demand code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
472 "SampleAfterValue": "100003", 478 "SampleAfterValue": "100003",
473 "CounterHTOff": "0,1,2,3" 479 "CounterHTOff": "0,1,2,3"
474 }, 480 },
@@ -481,6 +487,7 @@
481 "Counter": "0,1,2,3", 487 "Counter": "0,1,2,3",
482 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_MISS.LOCAL_DRAM", 488 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.LLC_MISS.LOCAL_DRAM",
483 "MSRIndex": "0x1a6,0x1a7", 489 "MSRIndex": "0x1a6,0x1a7",
490 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
484 "SampleAfterValue": "100003", 491 "SampleAfterValue": "100003",
485 "CounterHTOff": "0,1,2,3" 492 "CounterHTOff": "0,1,2,3"
486 }, 493 },
@@ -493,6 +500,7 @@
493 "Counter": "0,1,2,3", 500 "Counter": "0,1,2,3",
494 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.LLC_MISS.ANY_RESPONSE", 501 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.LLC_MISS.ANY_RESPONSE",
495 "MSRIndex": "0x1a6,0x1a7", 502 "MSRIndex": "0x1a6,0x1a7",
503 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
496 "SampleAfterValue": "100003", 504 "SampleAfterValue": "100003",
497 "CounterHTOff": "0,1,2,3" 505 "CounterHTOff": "0,1,2,3"
498 }, 506 },
@@ -505,6 +513,7 @@
505 "Counter": "0,1,2,3", 513 "Counter": "0,1,2,3",
506 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.LLC_MISS.ANY_RESPONSE", 514 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.LLC_MISS.ANY_RESPONSE",
507 "MSRIndex": "0x1a6,0x1a7", 515 "MSRIndex": "0x1a6,0x1a7",
516 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
508 "SampleAfterValue": "100003", 517 "SampleAfterValue": "100003",
509 "CounterHTOff": "0,1,2,3" 518 "CounterHTOff": "0,1,2,3"
510 }, 519 },
@@ -517,6 +526,7 @@
517 "Counter": "0,1,2,3", 526 "Counter": "0,1,2,3",
518 "EventName": "OFFCORE_RESPONSE.PF_L2_CODE_RD.LLC_MISS.ANY_RESPONSE", 527 "EventName": "OFFCORE_RESPONSE.PF_L2_CODE_RD.LLC_MISS.ANY_RESPONSE",
519 "MSRIndex": "0x1a6,0x1a7", 528 "MSRIndex": "0x1a6,0x1a7",
529 "PublicDescription": "Counts all prefetch (that bring data to LLC only) code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
520 "SampleAfterValue": "100003", 530 "SampleAfterValue": "100003",
521 "CounterHTOff": "0,1,2,3" 531 "CounterHTOff": "0,1,2,3"
522 }, 532 },
@@ -529,6 +539,7 @@
529 "Counter": "0,1,2,3", 539 "Counter": "0,1,2,3",
530 "EventName": "OFFCORE_RESPONSE.PF_LLC_DATA_RD.LLC_MISS.ANY_RESPONSE", 540 "EventName": "OFFCORE_RESPONSE.PF_LLC_DATA_RD.LLC_MISS.ANY_RESPONSE",
531 "MSRIndex": "0x1a6,0x1a7", 541 "MSRIndex": "0x1a6,0x1a7",
542 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
532 "SampleAfterValue": "100003", 543 "SampleAfterValue": "100003",
533 "CounterHTOff": "0,1,2,3" 544 "CounterHTOff": "0,1,2,3"
534 }, 545 },
@@ -541,6 +552,7 @@
541 "Counter": "0,1,2,3", 552 "Counter": "0,1,2,3",
542 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_MISS.ANY_RESPONSE", 553 "EventName": "OFFCORE_RESPONSE.PF_LLC_RFO.LLC_MISS.ANY_RESPONSE",
543 "MSRIndex": "0x1a6,0x1a7", 554 "MSRIndex": "0x1a6,0x1a7",
555 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
544 "SampleAfterValue": "100003", 556 "SampleAfterValue": "100003",
545 "CounterHTOff": "0,1,2,3" 557 "CounterHTOff": "0,1,2,3"
546 }, 558 },
@@ -553,6 +565,7 @@
553 "Counter": "0,1,2,3", 565 "Counter": "0,1,2,3",
554 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_MISS.ANY_RESPONSE", 566 "EventName": "OFFCORE_RESPONSE.PF_LLC_CODE_RD.LLC_MISS.ANY_RESPONSE",
555 "MSRIndex": "0x1a6,0x1a7", 567 "MSRIndex": "0x1a6,0x1a7",
568 "PublicDescription": "Counts prefetch (that bring data to LLC only) code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
556 "SampleAfterValue": "100003", 569 "SampleAfterValue": "100003",
557 "CounterHTOff": "0,1,2,3" 570 "CounterHTOff": "0,1,2,3"
558 }, 571 },
@@ -565,6 +578,7 @@
565 "Counter": "0,1,2,3", 578 "Counter": "0,1,2,3",
566 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.ANY_RESPONSE", 579 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.ANY_RESPONSE",
567 "MSRIndex": "0x1a6,0x1a7", 580 "MSRIndex": "0x1a6,0x1a7",
581 "PublicDescription": "Counts all demand & prefetch data reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
568 "SampleAfterValue": "100003", 582 "SampleAfterValue": "100003",
569 "CounterHTOff": "0,1,2,3" 583 "CounterHTOff": "0,1,2,3"
570 }, 584 },
@@ -577,6 +591,7 @@
577 "Counter": "0,1,2,3", 591 "Counter": "0,1,2,3",
578 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.LOCAL_DRAM", 592 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.LOCAL_DRAM",
579 "MSRIndex": "0x1a6,0x1a7", 593 "MSRIndex": "0x1a6,0x1a7",
594 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
580 "SampleAfterValue": "100003", 595 "SampleAfterValue": "100003",
581 "CounterHTOff": "0,1,2,3" 596 "CounterHTOff": "0,1,2,3"
582 }, 597 },
@@ -589,6 +604,7 @@
589 "Counter": "0,1,2,3", 604 "Counter": "0,1,2,3",
590 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_DRAM", 605 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_DRAM",
591 "MSRIndex": "0x1a6,0x1a7", 606 "MSRIndex": "0x1a6,0x1a7",
607 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from remote dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
592 "SampleAfterValue": "100003", 608 "SampleAfterValue": "100003",
593 "CounterHTOff": "0,1,2,3" 609 "CounterHTOff": "0,1,2,3"
594 }, 610 },
@@ -601,6 +617,7 @@
601 "Counter": "0,1,2,3", 617 "Counter": "0,1,2,3",
602 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HITM", 618 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HITM",
603 "MSRIndex": "0x1a6,0x1a7", 619 "MSRIndex": "0x1a6,0x1a7",
620 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the modified data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
604 "SampleAfterValue": "100003", 621 "SampleAfterValue": "100003",
605 "CounterHTOff": "0,1,2,3" 622 "CounterHTOff": "0,1,2,3"
606 }, 623 },
@@ -613,6 +630,7 @@
613 "Counter": "0,1,2,3", 630 "Counter": "0,1,2,3",
614 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HIT_FORWARD", 631 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.LLC_MISS.REMOTE_HIT_FORWARD",
615 "MSRIndex": "0x1a6,0x1a7", 632 "MSRIndex": "0x1a6,0x1a7",
633 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and clean or shared data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
616 "SampleAfterValue": "100003", 634 "SampleAfterValue": "100003",
617 "CounterHTOff": "0,1,2,3" 635 "CounterHTOff": "0,1,2,3"
618 }, 636 },
@@ -625,6 +643,7 @@
625 "Counter": "0,1,2,3", 643 "Counter": "0,1,2,3",
626 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.ANY_RESPONSE", 644 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.ANY_RESPONSE",
627 "MSRIndex": "0x1a6,0x1a7", 645 "MSRIndex": "0x1a6,0x1a7",
646 "PublicDescription": "Counts all demand & prefetch RFOs that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
628 "SampleAfterValue": "100003", 647 "SampleAfterValue": "100003",
629 "CounterHTOff": "0,1,2,3" 648 "CounterHTOff": "0,1,2,3"
630 }, 649 },
@@ -637,6 +656,7 @@
637 "Counter": "0,1,2,3", 656 "Counter": "0,1,2,3",
638 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.LOCAL_DRAM", 657 "EventName": "OFFCORE_RESPONSE.ALL_RFO.LLC_MISS.LOCAL_DRAM",
639 "MSRIndex": "0x1a6,0x1a7", 658 "MSRIndex": "0x1a6,0x1a7",
659 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
640 "SampleAfterValue": "100003", 660 "SampleAfterValue": "100003",
641 "CounterHTOff": "0,1,2,3" 661 "CounterHTOff": "0,1,2,3"
642 }, 662 },
@@ -649,6 +669,7 @@
649 "Counter": "0,1,2,3", 669 "Counter": "0,1,2,3",
650 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.ANY_RESPONSE", 670 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.ANY_RESPONSE",
651 "MSRIndex": "0x1a6,0x1a7", 671 "MSRIndex": "0x1a6,0x1a7",
672 "PublicDescription": "Counts all demand & prefetch code reads that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
652 "SampleAfterValue": "100003", 673 "SampleAfterValue": "100003",
653 "CounterHTOff": "0,1,2,3" 674 "CounterHTOff": "0,1,2,3"
654 }, 675 },
@@ -661,6 +682,7 @@
661 "Counter": "0,1,2,3", 682 "Counter": "0,1,2,3",
662 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.LOCAL_DRAM", 683 "EventName": "OFFCORE_RESPONSE.ALL_CODE_RD.LLC_MISS.LOCAL_DRAM",
663 "MSRIndex": "0x1a6,0x1a7", 684 "MSRIndex": "0x1a6,0x1a7",
685 "PublicDescription": "Counts all demand & prefetch code reads that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
664 "SampleAfterValue": "100003", 686 "SampleAfterValue": "100003",
665 "CounterHTOff": "0,1,2,3" 687 "CounterHTOff": "0,1,2,3"
666 }, 688 },
@@ -673,6 +695,7 @@
673 "Counter": "0,1,2,3", 695 "Counter": "0,1,2,3",
674 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.ANY_RESPONSE", 696 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.ANY_RESPONSE",
675 "MSRIndex": "0x1a6,0x1a7", 697 "MSRIndex": "0x1a6,0x1a7",
698 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
676 "SampleAfterValue": "100003", 699 "SampleAfterValue": "100003",
677 "CounterHTOff": "0,1,2,3" 700 "CounterHTOff": "0,1,2,3"
678 }, 701 },
@@ -685,6 +708,7 @@
685 "Counter": "0,1,2,3", 708 "Counter": "0,1,2,3",
686 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.LOCAL_DRAM", 709 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.LOCAL_DRAM",
687 "MSRIndex": "0x1a6,0x1a7", 710 "MSRIndex": "0x1a6,0x1a7",
711 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the data is returned from local dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
688 "SampleAfterValue": "100003", 712 "SampleAfterValue": "100003",
689 "CounterHTOff": "0,1,2,3" 713 "CounterHTOff": "0,1,2,3"
690 }, 714 },
@@ -697,6 +721,7 @@
697 "Counter": "0,1,2,3", 721 "Counter": "0,1,2,3",
698 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_DRAM", 722 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_DRAM",
699 "MSRIndex": "0x1a6,0x1a7", 723 "MSRIndex": "0x1a6,0x1a7",
724 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the data is returned from remote dram Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
700 "SampleAfterValue": "100003", 725 "SampleAfterValue": "100003",
701 "CounterHTOff": "0,1,2,3" 726 "CounterHTOff": "0,1,2,3"
702 }, 727 },
@@ -709,6 +734,7 @@
709 "Counter": "0,1,2,3", 734 "Counter": "0,1,2,3",
710 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HITM", 735 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HITM",
711 "MSRIndex": "0x1a6,0x1a7", 736 "MSRIndex": "0x1a6,0x1a7",
737 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and the modified data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
712 "SampleAfterValue": "100003", 738 "SampleAfterValue": "100003",
713 "CounterHTOff": "0,1,2,3" 739 "CounterHTOff": "0,1,2,3"
714 }, 740 },
@@ -721,6 +747,7 @@
721 "Counter": "0,1,2,3", 747 "Counter": "0,1,2,3",
722 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HIT_FORWARD", 748 "EventName": "OFFCORE_RESPONSE.ALL_READS.LLC_MISS.REMOTE_HIT_FORWARD",
723 "MSRIndex": "0x1a6,0x1a7", 749 "MSRIndex": "0x1a6,0x1a7",
750 "PublicDescription": "Counts all data/code/rfo reads (demand & prefetch) that miss the L3 and clean or shared data is transferred from remote cache Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
724 "SampleAfterValue": "100003", 751 "SampleAfterValue": "100003",
725 "CounterHTOff": "0,1,2,3" 752 "CounterHTOff": "0,1,2,3"
726 }, 753 },
@@ -733,6 +760,7 @@
733 "Counter": "0,1,2,3", 760 "Counter": "0,1,2,3",
734 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_MISS.ANY_RESPONSE", 761 "EventName": "OFFCORE_RESPONSE.ALL_REQUESTS.LLC_MISS.ANY_RESPONSE",
735 "MSRIndex": "0x1a6,0x1a7", 762 "MSRIndex": "0x1a6,0x1a7",
763 "PublicDescription": "Counts all requests that miss in the L3 Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
736 "SampleAfterValue": "100003", 764 "SampleAfterValue": "100003",
737 "CounterHTOff": "0,1,2,3" 765 "CounterHTOff": "0,1,2,3"
738 } 766 }
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/other.json b/tools/perf/pmu-events/arch/x86/haswellx/other.json
index 4e1b6ce96ca3..800e65df31bc 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/other.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "EventCode": "0x5C",
14 "UMask": "0x2",
15 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
16 "Counter": "0,1,2,3",
17 "EventName": "CPL_CYCLES.RING123",
18 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "EdgeDetect": "1", 13 "EdgeDetect": "1",
24 "EventCode": "0x5C", 14 "EventCode": "0x5C",
25 "UMask": "0x1", 15 "UMask": "0x1",
@@ -31,6 +21,16 @@
31 "CounterHTOff": "0,1,2,3,4,5,6,7" 21 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 }, 22 },
33 { 23 {
24 "EventCode": "0x5C",
25 "UMask": "0x2",
26 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
27 "Counter": "0,1,2,3",
28 "EventName": "CPL_CYCLES.RING123",
29 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
30 "SampleAfterValue": "2000003",
31 "CounterHTOff": "0,1,2,3,4,5,6,7"
32 },
33 {
34 "EventCode": "0x63", 34 "EventCode": "0x63",
35 "UMask": "0x1", 35 "UMask": "0x1",
36 "BriefDescription": "Cycles when L1 and L2 are locked due to UC or split lock", 36 "BriefDescription": "Cycles when L1 and L2 are locked due to UC or split lock",
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/pipeline.json b/tools/perf/pmu-events/arch/x86/haswellx/pipeline.json
index c3a163d34bd7..8a18bfe9e3e4 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/pipeline.json
@@ -3,32 +3,42 @@
3 "EventCode": "0x00", 3 "EventCode": "0x00",
4 "UMask": "0x1", 4 "UMask": "0x1",
5 "BriefDescription": "Instructions retired from execution.", 5 "BriefDescription": "Instructions retired from execution.",
6 "Counter": "Fixed counter 1", 6 "Counter": "Fixed counter 0",
7 "EventName": "INST_RETIRED.ANY", 7 "EventName": "INST_RETIRED.ANY",
8 "Errata": "HSD140, HSD143", 8 "Errata": "HSD140, HSD143",
9 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. INST_RETIRED.ANY is counted by a designated fixed counter, leaving the programmable counters available for other events. Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 9 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. INST_RETIRED.ANY is counted by a designated fixed counter, leaving the programmable counters available for other events. Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
10 "SampleAfterValue": "2000003", 10 "SampleAfterValue": "2000003",
11 "CounterHTOff": "Fixed counter 1" 11 "CounterHTOff": "Fixed counter 0"
12 }, 12 },
13 { 13 {
14 "EventCode": "0x00", 14 "EventCode": "0x00",
15 "UMask": "0x2", 15 "UMask": "0x2",
16 "BriefDescription": "Core cycles when the thread is not in halt state.", 16 "BriefDescription": "Core cycles when the thread is not in halt state.",
17 "Counter": "Fixed counter 2", 17 "Counter": "Fixed counter 1",
18 "EventName": "CPU_CLK_UNHALTED.THREAD", 18 "EventName": "CPU_CLK_UNHALTED.THREAD",
19 "PublicDescription": "This event counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.", 19 "PublicDescription": "This event counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.",
20 "SampleAfterValue": "2000003", 20 "SampleAfterValue": "2000003",
21 "CounterHTOff": "Fixed counter 2" 21 "CounterHTOff": "Fixed counter 1"
22 },
23 {
24 "EventCode": "0x00",
25 "UMask": "0x2",
26 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
27 "Counter": "Fixed counter 1",
28 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
29 "AnyThread": "1",
30 "SampleAfterValue": "2000003",
31 "CounterHTOff": "Fixed counter 1"
22 }, 32 },
23 { 33 {
24 "EventCode": "0x00", 34 "EventCode": "0x00",
25 "UMask": "0x3", 35 "UMask": "0x3",
26 "BriefDescription": "Reference cycles when the core is not in halt state.", 36 "BriefDescription": "Reference cycles when the core is not in halt state.",
27 "Counter": "Fixed counter 3", 37 "Counter": "Fixed counter 2",
28 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 38 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
29 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state.", 39 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state.",
30 "SampleAfterValue": "2000003", 40 "SampleAfterValue": "2000003",
31 "CounterHTOff": "Fixed counter 3" 41 "CounterHTOff": "Fixed counter 2"
32 }, 42 },
33 { 43 {
34 "EventCode": "0x03", 44 "EventCode": "0x03",
@@ -63,7 +73,7 @@
63 { 73 {
64 "EventCode": "0x0D", 74 "EventCode": "0x0D",
65 "UMask": "0x3", 75 "UMask": "0x3",
66 "BriefDescription": "Number of cycles waiting for the checkpoints in Resource Allocation Table (RAT) to be recovered after Nuke due to all other cases except JEClear (e.g. whenever a ucode assist is needed like SSE exception, memory disambiguation, etc...)", 76 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)",
67 "Counter": "0,1,2,3", 77 "Counter": "0,1,2,3",
68 "EventName": "INT_MISC.RECOVERY_CYCLES", 78 "EventName": "INT_MISC.RECOVERY_CYCLES",
69 "CounterMask": "1", 79 "CounterMask": "1",
@@ -72,6 +82,18 @@
72 "CounterHTOff": "0,1,2,3,4,5,6,7" 82 "CounterHTOff": "0,1,2,3,4,5,6,7"
73 }, 83 },
74 { 84 {
85 "EventCode": "0x0D",
86 "UMask": "0x3",
87 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke)",
88 "Counter": "0,1,2,3",
89 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
90 "AnyThread": "1",
91 "CounterMask": "1",
92 "PublicDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
93 "SampleAfterValue": "2000003",
94 "CounterHTOff": "0,1,2,3,4,5,6,7"
95 },
96 {
75 "EventCode": "0x0E", 97 "EventCode": "0x0E",
76 "UMask": "0x1", 98 "UMask": "0x1",
77 "BriefDescription": "Uops that Resource Allocation Table (RAT) issues to Reservation Station (RS)", 99 "BriefDescription": "Uops that Resource Allocation Table (RAT) issues to Reservation Station (RS)",
@@ -82,6 +104,29 @@
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 104 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 105 },
84 { 106 {
107 "Invert": "1",
108 "EventCode": "0x0E",
109 "UMask": "0x1",
110 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread.",
111 "Counter": "0,1,2,3",
112 "EventName": "UOPS_ISSUED.STALL_CYCLES",
113 "CounterMask": "1",
114 "SampleAfterValue": "2000003",
115 "CounterHTOff": "0,1,2,3"
116 },
117 {
118 "Invert": "1",
119 "EventCode": "0x0E",
120 "UMask": "0x1",
121 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for all threads.",
122 "Counter": "0,1,2,3",
123 "EventName": "UOPS_ISSUED.CORE_STALL_CYCLES",
124 "AnyThread": "1",
125 "CounterMask": "1",
126 "SampleAfterValue": "2000003",
127 "CounterHTOff": "0,1,2,3"
128 },
129 {
85 "EventCode": "0x0E", 130 "EventCode": "0x0E",
86 "UMask": "0x10", 131 "UMask": "0x10",
87 "BriefDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive; added by GSR u-arch.", 132 "BriefDescription": "Number of flags-merge uops being allocated. Such uops considered perf sensitive; added by GSR u-arch.",
@@ -112,34 +157,31 @@
112 "CounterHTOff": "0,1,2,3,4,5,6,7" 157 "CounterHTOff": "0,1,2,3,4,5,6,7"
113 }, 158 },
114 { 159 {
115 "Invert": "1", 160 "EventCode": "0x14",
116 "EventCode": "0x0E", 161 "UMask": "0x2",
117 "UMask": "0x1", 162 "BriefDescription": "Any uop executed by the Divider. (This includes all divide uops, sqrt, ...)",
118 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread.",
119 "Counter": "0,1,2,3", 163 "Counter": "0,1,2,3",
120 "EventName": "UOPS_ISSUED.STALL_CYCLES", 164 "EventName": "ARITH.DIVIDER_UOPS",
121 "CounterMask": "1",
122 "SampleAfterValue": "2000003", 165 "SampleAfterValue": "2000003",
123 "CounterHTOff": "0,1,2,3" 166 "CounterHTOff": "0,1,2,3,4,5,6,7"
124 }, 167 },
125 { 168 {
126 "Invert": "1", 169 "EventCode": "0x3C",
127 "EventCode": "0x0E", 170 "UMask": "0x0",
128 "UMask": "0x1", 171 "BriefDescription": "Thread cycles when thread is not in halt state",
129 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for all threads.",
130 "Counter": "0,1,2,3", 172 "Counter": "0,1,2,3",
131 "EventName": "UOPS_ISSUED.CORE_STALL_CYCLES", 173 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
132 "AnyThread": "1", 174 "PublicDescription": "Counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.",
133 "CounterMask": "1",
134 "SampleAfterValue": "2000003", 175 "SampleAfterValue": "2000003",
135 "CounterHTOff": "0,1,2,3" 176 "CounterHTOff": "0,1,2,3,4,5,6,7"
136 }, 177 },
137 { 178 {
138 "EventCode": "0x14", 179 "EventCode": "0x3C",
139 "UMask": "0x2", 180 "UMask": "0x0",
140 "BriefDescription": "Any uop executed by the Divider. (This includes all divide uops, sqrt, ...)", 181 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
141 "Counter": "0,1,2,3", 182 "Counter": "0,1,2,3",
142 "EventName": "ARITH.DIVIDER_UOPS", 183 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
184 "AnyThread": "1",
143 "SampleAfterValue": "2000003", 185 "SampleAfterValue": "2000003",
144 "CounterHTOff": "0,1,2,3,4,5,6,7" 186 "CounterHTOff": "0,1,2,3,4,5,6,7"
145 }, 187 },
@@ -154,6 +196,38 @@
154 "CounterHTOff": "0,1,2,3,4,5,6,7" 196 "CounterHTOff": "0,1,2,3,4,5,6,7"
155 }, 197 },
156 { 198 {
199 "EventCode": "0x3C",
200 "UMask": "0x1",
201 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
202 "Counter": "0,1,2,3",
203 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
204 "AnyThread": "1",
205 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
206 "SampleAfterValue": "2000003",
207 "CounterHTOff": "0,1,2,3,4,5,6,7"
208 },
209 {
210 "EventCode": "0x3C",
211 "UMask": "0x1",
212 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
213 "Counter": "0,1,2,3",
214 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
215 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
216 "SampleAfterValue": "2000003",
217 "CounterHTOff": "0,1,2,3,4,5,6,7"
218 },
219 {
220 "EventCode": "0x3C",
221 "UMask": "0x1",
222 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
223 "Counter": "0,1,2,3",
224 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
225 "AnyThread": "1",
226 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
227 "SampleAfterValue": "2000003",
228 "CounterHTOff": "0,1,2,3,4,5,6,7"
229 },
230 {
157 "EventCode": "0x3c", 231 "EventCode": "0x3c",
158 "UMask": "0x2", 232 "UMask": "0x2",
159 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.", 233 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
@@ -163,6 +237,15 @@
163 "CounterHTOff": "0,1,2,3" 237 "CounterHTOff": "0,1,2,3"
164 }, 238 },
165 { 239 {
240 "EventCode": "0x3C",
241 "UMask": "0x2",
242 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
243 "Counter": "0,1,2,3",
244 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
245 "SampleAfterValue": "2000003",
246 "CounterHTOff": "0,1,2,3,4,5,6,7"
247 },
248 {
166 "EventCode": "0x4c", 249 "EventCode": "0x4c",
167 "UMask": "0x1", 250 "UMask": "0x1",
168 "BriefDescription": "Not software-prefetch load dispatches that hit FB allocated for software prefetch", 251 "BriefDescription": "Not software-prefetch load dispatches that hit FB allocated for software prefetch",
@@ -233,6 +316,18 @@
233 "CounterHTOff": "0,1,2,3,4,5,6,7" 316 "CounterHTOff": "0,1,2,3,4,5,6,7"
234 }, 317 },
235 { 318 {
319 "EdgeDetect": "1",
320 "Invert": "1",
321 "EventCode": "0x5E",
322 "UMask": "0x1",
323 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
324 "Counter": "0,1,2,3",
325 "EventName": "RS_EVENTS.EMPTY_END",
326 "CounterMask": "1",
327 "SampleAfterValue": "200003",
328 "CounterHTOff": "0,1,2,3,4,5,6,7"
329 },
330 {
236 "EventCode": "0x87", 331 "EventCode": "0x87",
237 "UMask": "0x1", 332 "UMask": "0x1",
238 "BriefDescription": "Stalls caused by changing prefix length of the instruction.", 333 "BriefDescription": "Stalls caused by changing prefix length of the instruction.",
@@ -408,6 +503,15 @@
408 }, 503 },
409 { 504 {
410 "EventCode": "0x89", 505 "EventCode": "0x89",
506 "UMask": "0xa0",
507 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
508 "Counter": "0,1,2,3",
509 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
510 "SampleAfterValue": "200003",
511 "CounterHTOff": "0,1,2,3,4,5,6,7"
512 },
513 {
514 "EventCode": "0x89",
411 "UMask": "0xc1", 515 "UMask": "0xc1",
412 "BriefDescription": "Speculative and retired mispredicted macro conditional branches.", 516 "BriefDescription": "Speculative and retired mispredicted macro conditional branches.",
413 "Counter": "0,1,2,3", 517 "Counter": "0,1,2,3",
@@ -446,6 +550,26 @@
446 }, 550 },
447 { 551 {
448 "EventCode": "0xA1", 552 "EventCode": "0xA1",
553 "UMask": "0x1",
554 "BriefDescription": "Cycles per core when uops are executed in port 0.",
555 "Counter": "0,1,2,3",
556 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
557 "AnyThread": "1",
558 "PublicDescription": "Cycles per core when uops are exectuted in port 0.",
559 "SampleAfterValue": "2000003",
560 "CounterHTOff": "0,1,2,3,4,5,6,7"
561 },
562 {
563 "EventCode": "0xA1",
564 "UMask": "0x1",
565 "BriefDescription": "Cycles per thread when uops are executed in port 0.",
566 "Counter": "0,1,2,3",
567 "EventName": "UOPS_DISPATCHED_PORT.PORT_0",
568 "SampleAfterValue": "2000003",
569 "CounterHTOff": "0,1,2,3,4,5,6,7"
570 },
571 {
572 "EventCode": "0xA1",
449 "UMask": "0x2", 573 "UMask": "0x2",
450 "BriefDescription": "Cycles per thread when uops are executed in port 1", 574 "BriefDescription": "Cycles per thread when uops are executed in port 1",
451 "Counter": "0,1,2,3", 575 "Counter": "0,1,2,3",
@@ -456,6 +580,26 @@
456 }, 580 },
457 { 581 {
458 "EventCode": "0xA1", 582 "EventCode": "0xA1",
583 "UMask": "0x2",
584 "BriefDescription": "Cycles per core when uops are executed in port 1.",
585 "Counter": "0,1,2,3",
586 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
587 "AnyThread": "1",
588 "PublicDescription": "Cycles per core when uops are exectuted in port 1.",
589 "SampleAfterValue": "2000003",
590 "CounterHTOff": "0,1,2,3,4,5,6,7"
591 },
592 {
593 "EventCode": "0xA1",
594 "UMask": "0x2",
595 "BriefDescription": "Cycles per thread when uops are executed in port 1.",
596 "Counter": "0,1,2,3",
597 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
598 "SampleAfterValue": "2000003",
599 "CounterHTOff": "0,1,2,3,4,5,6,7"
600 },
601 {
602 "EventCode": "0xA1",
459 "UMask": "0x4", 603 "UMask": "0x4",
460 "BriefDescription": "Cycles per thread when uops are executed in port 2", 604 "BriefDescription": "Cycles per thread when uops are executed in port 2",
461 "Counter": "0,1,2,3", 605 "Counter": "0,1,2,3",
@@ -466,6 +610,25 @@
466 }, 610 },
467 { 611 {
468 "EventCode": "0xA1", 612 "EventCode": "0xA1",
613 "UMask": "0x4",
614 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
615 "Counter": "0,1,2,3",
616 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
617 "AnyThread": "1",
618 "SampleAfterValue": "2000003",
619 "CounterHTOff": "0,1,2,3,4,5,6,7"
620 },
621 {
622 "EventCode": "0xA1",
623 "UMask": "0x4",
624 "BriefDescription": "Cycles per thread when uops are executed in port 2.",
625 "Counter": "0,1,2,3",
626 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
627 "SampleAfterValue": "2000003",
628 "CounterHTOff": "0,1,2,3,4,5,6,7"
629 },
630 {
631 "EventCode": "0xA1",
469 "UMask": "0x8", 632 "UMask": "0x8",
470 "BriefDescription": "Cycles per thread when uops are executed in port 3", 633 "BriefDescription": "Cycles per thread when uops are executed in port 3",
471 "Counter": "0,1,2,3", 634 "Counter": "0,1,2,3",
@@ -476,6 +639,25 @@
476 }, 639 },
477 { 640 {
478 "EventCode": "0xA1", 641 "EventCode": "0xA1",
642 "UMask": "0x8",
643 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
644 "Counter": "0,1,2,3",
645 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
646 "AnyThread": "1",
647 "SampleAfterValue": "2000003",
648 "CounterHTOff": "0,1,2,3,4,5,6,7"
649 },
650 {
651 "EventCode": "0xA1",
652 "UMask": "0x8",
653 "BriefDescription": "Cycles per thread when uops are executed in port 3.",
654 "Counter": "0,1,2,3",
655 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
656 "SampleAfterValue": "2000003",
657 "CounterHTOff": "0,1,2,3,4,5,6,7"
658 },
659 {
660 "EventCode": "0xA1",
479 "UMask": "0x10", 661 "UMask": "0x10",
480 "BriefDescription": "Cycles per thread when uops are executed in port 4", 662 "BriefDescription": "Cycles per thread when uops are executed in port 4",
481 "Counter": "0,1,2,3", 663 "Counter": "0,1,2,3",
@@ -486,6 +668,26 @@
486 }, 668 },
487 { 669 {
488 "EventCode": "0xA1", 670 "EventCode": "0xA1",
671 "UMask": "0x10",
672 "BriefDescription": "Cycles per core when uops are executed in port 4.",
673 "Counter": "0,1,2,3",
674 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
675 "AnyThread": "1",
676 "PublicDescription": "Cycles per core when uops are exectuted in port 4.",
677 "SampleAfterValue": "2000003",
678 "CounterHTOff": "0,1,2,3,4,5,6,7"
679 },
680 {
681 "EventCode": "0xA1",
682 "UMask": "0x10",
683 "BriefDescription": "Cycles per thread when uops are executed in port 4.",
684 "Counter": "0,1,2,3",
685 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
686 "SampleAfterValue": "2000003",
687 "CounterHTOff": "0,1,2,3,4,5,6,7"
688 },
689 {
690 "EventCode": "0xA1",
489 "UMask": "0x20", 691 "UMask": "0x20",
490 "BriefDescription": "Cycles per thread when uops are executed in port 5", 692 "BriefDescription": "Cycles per thread when uops are executed in port 5",
491 "Counter": "0,1,2,3", 693 "Counter": "0,1,2,3",
@@ -496,6 +698,26 @@
496 }, 698 },
497 { 699 {
498 "EventCode": "0xA1", 700 "EventCode": "0xA1",
701 "UMask": "0x20",
702 "BriefDescription": "Cycles per core when uops are executed in port 5.",
703 "Counter": "0,1,2,3",
704 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
705 "AnyThread": "1",
706 "PublicDescription": "Cycles per core when uops are exectuted in port 5.",
707 "SampleAfterValue": "2000003",
708 "CounterHTOff": "0,1,2,3,4,5,6,7"
709 },
710 {
711 "EventCode": "0xA1",
712 "UMask": "0x20",
713 "BriefDescription": "Cycles per thread when uops are executed in port 5.",
714 "Counter": "0,1,2,3",
715 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
716 "SampleAfterValue": "2000003",
717 "CounterHTOff": "0,1,2,3,4,5,6,7"
718 },
719 {
720 "EventCode": "0xA1",
499 "UMask": "0x40", 721 "UMask": "0x40",
500 "BriefDescription": "Cycles per thread when uops are executed in port 6", 722 "BriefDescription": "Cycles per thread when uops are executed in port 6",
501 "Counter": "0,1,2,3", 723 "Counter": "0,1,2,3",
@@ -506,6 +728,26 @@
506 }, 728 },
507 { 729 {
508 "EventCode": "0xA1", 730 "EventCode": "0xA1",
731 "UMask": "0x40",
732 "BriefDescription": "Cycles per core when uops are executed in port 6.",
733 "Counter": "0,1,2,3",
734 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
735 "AnyThread": "1",
736 "PublicDescription": "Cycles per core when uops are exectuted in port 6.",
737 "SampleAfterValue": "2000003",
738 "CounterHTOff": "0,1,2,3,4,5,6,7"
739 },
740 {
741 "EventCode": "0xA1",
742 "UMask": "0x40",
743 "BriefDescription": "Cycles per thread when uops are executed in port 6.",
744 "Counter": "0,1,2,3",
745 "EventName": "UOPS_DISPATCHED_PORT.PORT_6",
746 "SampleAfterValue": "2000003",
747 "CounterHTOff": "0,1,2,3,4,5,6,7"
748 },
749 {
750 "EventCode": "0xA1",
509 "UMask": "0x80", 751 "UMask": "0x80",
510 "BriefDescription": "Cycles per thread when uops are executed in port 7", 752 "BriefDescription": "Cycles per thread when uops are executed in port 7",
511 "Counter": "0,1,2,3", 753 "Counter": "0,1,2,3",
@@ -515,6 +757,25 @@
515 "CounterHTOff": "0,1,2,3,4,5,6,7" 757 "CounterHTOff": "0,1,2,3,4,5,6,7"
516 }, 758 },
517 { 759 {
760 "EventCode": "0xA1",
761 "UMask": "0x80",
762 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
763 "Counter": "0,1,2,3",
764 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
765 "AnyThread": "1",
766 "SampleAfterValue": "2000003",
767 "CounterHTOff": "0,1,2,3,4,5,6,7"
768 },
769 {
770 "EventCode": "0xA1",
771 "UMask": "0x80",
772 "BriefDescription": "Cycles per thread when uops are executed in port 7.",
773 "Counter": "0,1,2,3",
774 "EventName": "UOPS_DISPATCHED_PORT.PORT_7",
775 "SampleAfterValue": "2000003",
776 "CounterHTOff": "0,1,2,3,4,5,6,7"
777 },
778 {
518 "EventCode": "0xA2", 779 "EventCode": "0xA2",
519 "UMask": "0x1", 780 "UMask": "0x1",
520 "BriefDescription": "Resource-related stall cycles", 781 "BriefDescription": "Resource-related stall cycles",
@@ -567,17 +828,6 @@
567 }, 828 },
568 { 829 {
569 "EventCode": "0xA3", 830 "EventCode": "0xA3",
570 "UMask": "0x8",
571 "BriefDescription": "Cycles with pending L1 cache miss loads.",
572 "Counter": "2",
573 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
574 "CounterMask": "8",
575 "PublicDescription": "Cycles with pending L1 data cache miss loads. Set Cmask=8 to count cycle.",
576 "SampleAfterValue": "2000003",
577 "CounterHTOff": "2"
578 },
579 {
580 "EventCode": "0xA3",
581 "UMask": "0x2", 831 "UMask": "0x2",
582 "BriefDescription": "Cycles with pending memory loads.", 832 "BriefDescription": "Cycles with pending memory loads.",
583 "Counter": "0,1,2,3", 833 "Counter": "0,1,2,3",
@@ -590,7 +840,7 @@
590 { 840 {
591 "EventCode": "0xA3", 841 "EventCode": "0xA3",
592 "UMask": "0x4", 842 "UMask": "0x4",
593 "BriefDescription": "Total execution stalls", 843 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
594 "Counter": "0,1,2,3", 844 "Counter": "0,1,2,3",
595 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 845 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
596 "CounterMask": "4", 846 "CounterMask": "4",
@@ -622,6 +872,17 @@
622 }, 872 },
623 { 873 {
624 "EventCode": "0xA3", 874 "EventCode": "0xA3",
875 "UMask": "0x8",
876 "BriefDescription": "Cycles with pending L1 cache miss loads.",
877 "Counter": "2",
878 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
879 "CounterMask": "8",
880 "PublicDescription": "Cycles with pending L1 data cache miss loads. Set Cmask=8 to count cycle.",
881 "SampleAfterValue": "2000003",
882 "CounterHTOff": "2"
883 },
884 {
885 "EventCode": "0xA3",
625 "UMask": "0xc", 886 "UMask": "0xc",
626 "BriefDescription": "Execution stalls due to L1 data cache misses", 887 "BriefDescription": "Execution stalls due to L1 data cache misses",
627 "Counter": "2", 888 "Counter": "2",
@@ -642,13 +903,22 @@
642 "CounterHTOff": "0,1,2,3,4,5,6,7" 903 "CounterHTOff": "0,1,2,3,4,5,6,7"
643 }, 904 },
644 { 905 {
645 "EventCode": "0xB1", 906 "EventCode": "0xA8",
646 "UMask": "0x2", 907 "UMask": "0x1",
647 "BriefDescription": "Number of uops executed on the core.", 908 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
648 "Counter": "0,1,2,3", 909 "Counter": "0,1,2,3",
649 "EventName": "UOPS_EXECUTED.CORE", 910 "EventName": "LSD.CYCLES_ACTIVE",
650 "Errata": "HSD30, HSM31", 911 "CounterMask": "1",
651 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.", 912 "SampleAfterValue": "2000003",
913 "CounterHTOff": "0,1,2,3,4,5,6,7"
914 },
915 {
916 "EventCode": "0xA8",
917 "UMask": "0x1",
918 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
919 "Counter": "0,1,2,3",
920 "EventName": "LSD.CYCLES_4_UOPS",
921 "CounterMask": "4",
652 "SampleAfterValue": "2000003", 922 "SampleAfterValue": "2000003",
653 "CounterHTOff": "0,1,2,3,4,5,6,7" 923 "CounterHTOff": "0,1,2,3,4,5,6,7"
654 }, 924 },
@@ -665,23 +935,126 @@
665 "CounterHTOff": "0,1,2,3" 935 "CounterHTOff": "0,1,2,3"
666 }, 936 },
667 { 937 {
668 "EventCode": "0xC0", 938 "EventCode": "0xB1",
669 "UMask": "0x0", 939 "UMask": "0x1",
670 "BriefDescription": "Number of instructions retired. General Counter - architectural event", 940 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
671 "Counter": "0,1,2,3", 941 "Counter": "0,1,2,3",
672 "EventName": "INST_RETIRED.ANY_P", 942 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
673 "Errata": "HSD11, HSD140", 943 "CounterMask": "1",
674 "PublicDescription": "Number of instructions at retirement.", 944 "Errata": "HSD144, HSD30, HSM31",
945 "PublicDescription": "This events counts the cycles where at least one uop was executed. It is counted per thread.",
946 "SampleAfterValue": "2000003",
947 "CounterHTOff": "0,1,2,3"
948 },
949 {
950 "EventCode": "0xB1",
951 "UMask": "0x1",
952 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
953 "Counter": "0,1,2,3",
954 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
955 "CounterMask": "2",
956 "Errata": "HSD144, HSD30, HSM31",
957 "PublicDescription": "This events counts the cycles where at least two uop were executed. It is counted per thread.",
958 "SampleAfterValue": "2000003",
959 "CounterHTOff": "0,1,2,3"
960 },
961 {
962 "EventCode": "0xB1",
963 "UMask": "0x1",
964 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
965 "Counter": "0,1,2,3",
966 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
967 "CounterMask": "3",
968 "Errata": "HSD144, HSD30, HSM31",
969 "PublicDescription": "This events counts the cycles where at least three uop were executed. It is counted per thread.",
970 "SampleAfterValue": "2000003",
971 "CounterHTOff": "0,1,2,3"
972 },
973 {
974 "EventCode": "0xB1",
975 "UMask": "0x1",
976 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
977 "Counter": "0,1,2,3",
978 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
979 "CounterMask": "4",
980 "Errata": "HSD144, HSD30, HSM31",
981 "SampleAfterValue": "2000003",
982 "CounterHTOff": "0,1,2,3"
983 },
984 {
985 "EventCode": "0xB1",
986 "UMask": "0x2",
987 "BriefDescription": "Number of uops executed on the core.",
988 "Counter": "0,1,2,3",
989 "EventName": "UOPS_EXECUTED.CORE",
990 "Errata": "HSD30, HSM31",
991 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.",
675 "SampleAfterValue": "2000003", 992 "SampleAfterValue": "2000003",
676 "CounterHTOff": "0,1,2,3,4,5,6,7" 993 "CounterHTOff": "0,1,2,3,4,5,6,7"
677 }, 994 },
678 { 995 {
679 "EventCode": "0xC0", 996 "EventCode": "0xb1",
680 "UMask": "0x2", 997 "UMask": "0x2",
681 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions: Counts also flows that have several X87 or flows that use X87 uops in the exception handling.", 998 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
682 "Counter": "0,1,2,3", 999 "Counter": "0,1,2,3",
683 "EventName": "INST_RETIRED.X87", 1000 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
684 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.", 1001 "CounterMask": "1",
1002 "Errata": "HSD30, HSM31",
1003 "SampleAfterValue": "2000003",
1004 "CounterHTOff": "0,1,2,3,4,5,6,7"
1005 },
1006 {
1007 "EventCode": "0xb1",
1008 "UMask": "0x2",
1009 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1010 "Counter": "0,1,2,3",
1011 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1012 "CounterMask": "2",
1013 "Errata": "HSD30, HSM31",
1014 "SampleAfterValue": "2000003",
1015 "CounterHTOff": "0,1,2,3,4,5,6,7"
1016 },
1017 {
1018 "EventCode": "0xb1",
1019 "UMask": "0x2",
1020 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1021 "Counter": "0,1,2,3",
1022 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1023 "CounterMask": "3",
1024 "Errata": "HSD30, HSM31",
1025 "SampleAfterValue": "2000003",
1026 "CounterHTOff": "0,1,2,3,4,5,6,7"
1027 },
1028 {
1029 "EventCode": "0xb1",
1030 "UMask": "0x2",
1031 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1032 "Counter": "0,1,2,3",
1033 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1034 "CounterMask": "4",
1035 "Errata": "HSD30, HSM31",
1036 "SampleAfterValue": "2000003",
1037 "CounterHTOff": "0,1,2,3,4,5,6,7"
1038 },
1039 {
1040 "Invert": "1",
1041 "EventCode": "0xb1",
1042 "UMask": "0x2",
1043 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1044 "Counter": "0,1,2,3",
1045 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1046 "Errata": "HSD30, HSM31",
1047 "SampleAfterValue": "2000003",
1048 "CounterHTOff": "0,1,2,3,4,5,6,7"
1049 },
1050 {
1051 "EventCode": "0xC0",
1052 "UMask": "0x0",
1053 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
1054 "Counter": "0,1,2,3",
1055 "EventName": "INST_RETIRED.ANY_P",
1056 "Errata": "HSD11, HSD140",
1057 "PublicDescription": "Number of instructions at retirement.",
685 "SampleAfterValue": "2000003", 1058 "SampleAfterValue": "2000003",
686 "CounterHTOff": "0,1,2,3,4,5,6,7" 1059 "CounterHTOff": "0,1,2,3,4,5,6,7"
687 }, 1060 },
@@ -698,6 +1071,16 @@
698 "CounterHTOff": "1" 1071 "CounterHTOff": "1"
699 }, 1072 },
700 { 1073 {
1074 "EventCode": "0xC0",
1075 "UMask": "0x2",
1076 "BriefDescription": "FP operations retired. X87 FP operations that have no exceptions: Counts also flows that have several X87 or flows that use X87 uops in the exception handling.",
1077 "Counter": "0,1,2,3",
1078 "EventName": "INST_RETIRED.X87",
1079 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts FP operations retired. For X87 FP operations that have no exceptions counting also includes flows that have several X87, or flows that use X87 uops in the exception handling.",
1080 "SampleAfterValue": "2000003",
1081 "CounterHTOff": "0,1,2,3,4,5,6,7"
1082 },
1083 {
701 "EventCode": "0xC1", 1084 "EventCode": "0xC1",
702 "UMask": "0x40", 1085 "UMask": "0x40",
703 "BriefDescription": "Number of times any microcode assist is invoked by HW upon uop writeback.", 1086 "BriefDescription": "Number of times any microcode assist is invoked by HW upon uop writeback.",
@@ -715,18 +1098,6 @@
715 "PEBS": "1", 1098 "PEBS": "1",
716 "Counter": "0,1,2,3", 1099 "Counter": "0,1,2,3",
717 "EventName": "UOPS_RETIRED.ALL", 1100 "EventName": "UOPS_RETIRED.ALL",
718 "PublicDescription": "Counts the number of micro-ops retired. Use Cmask=1 and invert to count active cycles or stalled cycles.",
719 "SampleAfterValue": "2000003",
720 "CounterHTOff": "0,1,2,3,4,5,6,7"
721 },
722 {
723 "EventCode": "0xC2",
724 "UMask": "0x2",
725 "BriefDescription": "Retirement slots used.",
726 "PEBS": "1",
727 "Counter": "0,1,2,3",
728 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
729 "PublicDescription": "This event counts the number of retirement slots used each cycle. There are potentially 4 slots that can be used each cycle - meaning, 4 uops or 4 instructions could retire each cycle.",
730 "SampleAfterValue": "2000003", 1101 "SampleAfterValue": "2000003",
731 "CounterHTOff": "0,1,2,3,4,5,6,7" 1102 "CounterHTOff": "0,1,2,3,4,5,6,7"
732 }, 1103 },
@@ -765,6 +1136,16 @@
765 "CounterHTOff": "0,1,2,3" 1136 "CounterHTOff": "0,1,2,3"
766 }, 1137 },
767 { 1138 {
1139 "EventCode": "0xC2",
1140 "UMask": "0x2",
1141 "BriefDescription": "Retirement slots used.",
1142 "PEBS": "1",
1143 "Counter": "0,1,2,3",
1144 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1145 "SampleAfterValue": "2000003",
1146 "CounterHTOff": "0,1,2,3,4,5,6,7"
1147 },
1148 {
768 "EventCode": "0xC3", 1149 "EventCode": "0xC3",
769 "UMask": "0x1", 1150 "UMask": "0x1",
770 "BriefDescription": "Cycles there was a Nuke. Account for both thread-specific and All Thread Nukes.", 1151 "BriefDescription": "Cycles there was a Nuke. Account for both thread-specific and All Thread Nukes.",
@@ -774,6 +1155,17 @@
774 "CounterHTOff": "0,1,2,3,4,5,6,7" 1155 "CounterHTOff": "0,1,2,3,4,5,6,7"
775 }, 1156 },
776 { 1157 {
1158 "EdgeDetect": "1",
1159 "EventCode": "0xC3",
1160 "UMask": "0x1",
1161 "BriefDescription": "Number of machine clears (nukes) of any type.",
1162 "Counter": "0,1,2,3",
1163 "EventName": "MACHINE_CLEARS.COUNT",
1164 "CounterMask": "1",
1165 "SampleAfterValue": "100003",
1166 "CounterHTOff": "0,1,2,3,4,5,6,7"
1167 },
1168 {
777 "EventCode": "0xC3", 1169 "EventCode": "0xC3",
778 "UMask": "0x4", 1170 "UMask": "0x4",
779 "BriefDescription": "Self-modifying code (SMC) detected.", 1171 "BriefDescription": "Self-modifying code (SMC) detected.",
@@ -794,12 +1186,21 @@
794 }, 1186 },
795 { 1187 {
796 "EventCode": "0xC4", 1188 "EventCode": "0xC4",
1189 "UMask": "0x0",
1190 "BriefDescription": "All (macro) branch instructions retired.",
1191 "Counter": "0,1,2,3",
1192 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1193 "PublicDescription": "Branch instructions at retirement.",
1194 "SampleAfterValue": "400009",
1195 "CounterHTOff": "0,1,2,3,4,5,6,7"
1196 },
1197 {
1198 "EventCode": "0xC4",
797 "UMask": "0x1", 1199 "UMask": "0x1",
798 "BriefDescription": "Conditional branch instructions retired.", 1200 "BriefDescription": "Conditional branch instructions retired.",
799 "PEBS": "1", 1201 "PEBS": "1",
800 "Counter": "0,1,2,3", 1202 "Counter": "0,1,2,3",
801 "EventName": "BR_INST_RETIRED.CONDITIONAL", 1203 "EventName": "BR_INST_RETIRED.CONDITIONAL",
802 "PublicDescription": "Counts the number of conditional branch instructions retired.",
803 "SampleAfterValue": "400009", 1204 "SampleAfterValue": "400009",
804 "CounterHTOff": "0,1,2,3,4,5,6,7" 1205 "CounterHTOff": "0,1,2,3,4,5,6,7"
805 }, 1206 },
@@ -815,13 +1216,23 @@
815 }, 1216 },
816 { 1217 {
817 "EventCode": "0xC4", 1218 "EventCode": "0xC4",
818 "UMask": "0x0", 1219 "UMask": "0x2",
1220 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3).",
1221 "PEBS": "1",
1222 "Counter": "0,1,2,3",
1223 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
1224 "SampleAfterValue": "100003",
1225 "CounterHTOff": "0,1,2,3,4,5,6,7"
1226 },
1227 {
1228 "EventCode": "0xC4",
1229 "UMask": "0x4",
819 "BriefDescription": "All (macro) branch instructions retired.", 1230 "BriefDescription": "All (macro) branch instructions retired.",
1231 "PEBS": "2",
820 "Counter": "0,1,2,3", 1232 "Counter": "0,1,2,3",
821 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1233 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
822 "PublicDescription": "Branch instructions at retirement.",
823 "SampleAfterValue": "400009", 1234 "SampleAfterValue": "400009",
824 "CounterHTOff": "0,1,2,3,4,5,6,7" 1235 "CounterHTOff": "0,1,2,3"
825 }, 1236 },
826 { 1237 {
827 "EventCode": "0xC4", 1238 "EventCode": "0xC4",
@@ -830,7 +1241,6 @@
830 "PEBS": "1", 1241 "PEBS": "1",
831 "Counter": "0,1,2,3", 1242 "Counter": "0,1,2,3",
832 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 1243 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
833 "PublicDescription": "Counts the number of near return instructions retired.",
834 "SampleAfterValue": "100003", 1244 "SampleAfterValue": "100003",
835 "CounterHTOff": "0,1,2,3,4,5,6,7" 1245 "CounterHTOff": "0,1,2,3,4,5,6,7"
836 }, 1246 },
@@ -851,7 +1261,6 @@
851 "PEBS": "1", 1261 "PEBS": "1",
852 "Counter": "0,1,2,3", 1262 "Counter": "0,1,2,3",
853 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 1263 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
854 "PublicDescription": "Number of near taken branches retired.",
855 "SampleAfterValue": "400009", 1264 "SampleAfterValue": "400009",
856 "CounterHTOff": "0,1,2,3,4,5,6,7" 1265 "CounterHTOff": "0,1,2,3,4,5,6,7"
857 }, 1266 },
@@ -866,14 +1275,14 @@
866 "CounterHTOff": "0,1,2,3,4,5,6,7" 1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
867 }, 1276 },
868 { 1277 {
869 "EventCode": "0xC4", 1278 "EventCode": "0xC5",
870 "UMask": "0x4", 1279 "UMask": "0x0",
871 "BriefDescription": "All (macro) branch instructions retired.", 1280 "BriefDescription": "All mispredicted macro branch instructions retired.",
872 "PEBS": "2",
873 "Counter": "0,1,2,3", 1281 "Counter": "0,1,2,3",
874 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS", 1282 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES",
1283 "PublicDescription": "Mispredicted branch instructions at retirement.",
875 "SampleAfterValue": "400009", 1284 "SampleAfterValue": "400009",
876 "CounterHTOff": "0,1,2,3" 1285 "CounterHTOff": "0,1,2,3,4,5,6,7"
877 }, 1286 },
878 { 1287 {
879 "EventCode": "0xC5", 1288 "EventCode": "0xC5",
@@ -887,18 +1296,8 @@
887 }, 1296 },
888 { 1297 {
889 "EventCode": "0xC5", 1298 "EventCode": "0xC5",
890 "UMask": "0x0",
891 "BriefDescription": "All mispredicted macro branch instructions retired.",
892 "Counter": "0,1,2,3",
893 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES",
894 "PublicDescription": "Mispredicted branch instructions at retirement.",
895 "SampleAfterValue": "400009",
896 "CounterHTOff": "0,1,2,3,4,5,6,7"
897 },
898 {
899 "EventCode": "0xC5",
900 "UMask": "0x4", 1299 "UMask": "0x4",
901 "BriefDescription": "Mispredicted macro branch instructions retired. ", 1300 "BriefDescription": "Mispredicted macro branch instructions retired.",
902 "PEBS": "2", 1301 "PEBS": "2",
903 "Counter": "0,1,2,3", 1302 "Counter": "0,1,2,3",
904 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS", 1303 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS",
@@ -907,171 +1306,24 @@
907 "CounterHTOff": "0,1,2,3" 1306 "CounterHTOff": "0,1,2,3"
908 }, 1307 },
909 { 1308 {
910 "EventCode": "0xCC",
911 "UMask": "0x20",
912 "BriefDescription": "Count cases of saving new LBR",
913 "Counter": "0,1,2,3",
914 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
915 "PublicDescription": "Count cases of saving new LBR records by hardware.",
916 "SampleAfterValue": "2000003",
917 "CounterHTOff": "0,1,2,3,4,5,6,7"
918 },
919 {
920 "EventCode": "0x3C",
921 "UMask": "0x0",
922 "BriefDescription": "Thread cycles when thread is not in halt state",
923 "Counter": "0,1,2,3",
924 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
925 "PublicDescription": "Counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling.",
926 "SampleAfterValue": "2000003",
927 "CounterHTOff": "0,1,2,3,4,5,6,7"
928 },
929 {
930 "EventCode": "0x89",
931 "UMask": "0xa0",
932 "BriefDescription": "Taken speculative and retired mispredicted indirect calls.",
933 "Counter": "0,1,2,3",
934 "EventName": "BR_MISP_EXEC.TAKEN_INDIRECT_NEAR_CALL",
935 "SampleAfterValue": "200003",
936 "CounterHTOff": "0,1,2,3,4,5,6,7"
937 },
938 {
939 "EventCode": "0xA1",
940 "UMask": "0x1",
941 "BriefDescription": "Cycles per core when uops are exectuted in port 0.",
942 "Counter": "0,1,2,3",
943 "EventName": "UOPS_EXECUTED_PORT.PORT_0_CORE",
944 "AnyThread": "1",
945 "SampleAfterValue": "2000003",
946 "CounterHTOff": "0,1,2,3,4,5,6,7"
947 },
948 {
949 "EventCode": "0xA1",
950 "UMask": "0x2",
951 "BriefDescription": "Cycles per core when uops are exectuted in port 1.",
952 "Counter": "0,1,2,3",
953 "EventName": "UOPS_EXECUTED_PORT.PORT_1_CORE",
954 "AnyThread": "1",
955 "SampleAfterValue": "2000003",
956 "CounterHTOff": "0,1,2,3,4,5,6,7"
957 },
958 {
959 "EventCode": "0xA1",
960 "UMask": "0x4",
961 "BriefDescription": "Cycles per core when uops are dispatched to port 2.",
962 "Counter": "0,1,2,3",
963 "EventName": "UOPS_EXECUTED_PORT.PORT_2_CORE",
964 "AnyThread": "1",
965 "SampleAfterValue": "2000003",
966 "CounterHTOff": "0,1,2,3,4,5,6,7"
967 },
968 {
969 "EventCode": "0xA1",
970 "UMask": "0x8",
971 "BriefDescription": "Cycles per core when uops are dispatched to port 3.",
972 "Counter": "0,1,2,3",
973 "EventName": "UOPS_EXECUTED_PORT.PORT_3_CORE",
974 "AnyThread": "1",
975 "SampleAfterValue": "2000003",
976 "CounterHTOff": "0,1,2,3,4,5,6,7"
977 },
978 {
979 "EventCode": "0xA1",
980 "UMask": "0x10",
981 "BriefDescription": "Cycles per core when uops are exectuted in port 4.",
982 "Counter": "0,1,2,3",
983 "EventName": "UOPS_EXECUTED_PORT.PORT_4_CORE",
984 "AnyThread": "1",
985 "SampleAfterValue": "2000003",
986 "CounterHTOff": "0,1,2,3,4,5,6,7"
987 },
988 {
989 "EventCode": "0xA1",
990 "UMask": "0x20",
991 "BriefDescription": "Cycles per core when uops are exectuted in port 5.",
992 "Counter": "0,1,2,3",
993 "EventName": "UOPS_EXECUTED_PORT.PORT_5_CORE",
994 "AnyThread": "1",
995 "SampleAfterValue": "2000003",
996 "CounterHTOff": "0,1,2,3,4,5,6,7"
997 },
998 {
999 "EventCode": "0xA1",
1000 "UMask": "0x40",
1001 "BriefDescription": "Cycles per core when uops are exectuted in port 6.",
1002 "Counter": "0,1,2,3",
1003 "EventName": "UOPS_EXECUTED_PORT.PORT_6_CORE",
1004 "AnyThread": "1",
1005 "SampleAfterValue": "2000003",
1006 "CounterHTOff": "0,1,2,3,4,5,6,7"
1007 },
1008 {
1009 "EventCode": "0xA1",
1010 "UMask": "0x80",
1011 "BriefDescription": "Cycles per core when uops are dispatched to port 7.",
1012 "Counter": "0,1,2,3",
1013 "EventName": "UOPS_EXECUTED_PORT.PORT_7_CORE",
1014 "AnyThread": "1",
1015 "SampleAfterValue": "2000003",
1016 "CounterHTOff": "0,1,2,3,4,5,6,7"
1017 },
1018 {
1019 "EventCode": "0xC5", 1309 "EventCode": "0xC5",
1020 "UMask": "0x20", 1310 "UMask": "0x20",
1021 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.", 1311 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.",
1022 "PEBS": "1", 1312 "PEBS": "1",
1023 "Counter": "0,1,2,3", 1313 "Counter": "0,1,2,3",
1024 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 1314 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
1025 "PublicDescription": "Number of near branch instructions retired that were taken but mispredicted.",
1026 "SampleAfterValue": "400009", 1315 "SampleAfterValue": "400009",
1027 "CounterHTOff": "0,1,2,3,4,5,6,7" 1316 "CounterHTOff": "0,1,2,3,4,5,6,7"
1028 }, 1317 },
1029 { 1318 {
1030 "EventCode": "0xB1", 1319 "EventCode": "0xCC",
1031 "UMask": "0x1", 1320 "UMask": "0x20",
1032 "BriefDescription": "Cycles where at least 1 uop was executed per-thread", 1321 "BriefDescription": "Count cases of saving new LBR",
1033 "Counter": "0,1,2,3",
1034 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1035 "CounterMask": "1",
1036 "Errata": "HSD144, HSD30, HSM31",
1037 "PublicDescription": "This events counts the cycles where at least one uop was executed. It is counted per thread.",
1038 "SampleAfterValue": "2000003",
1039 "CounterHTOff": "0,1,2,3"
1040 },
1041 {
1042 "EventCode": "0xB1",
1043 "UMask": "0x1",
1044 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
1045 "Counter": "0,1,2,3",
1046 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1047 "CounterMask": "2",
1048 "Errata": "HSD144, HSD30, HSM31",
1049 "PublicDescription": "This events counts the cycles where at least two uop were executed. It is counted per thread.",
1050 "SampleAfterValue": "2000003",
1051 "CounterHTOff": "0,1,2,3"
1052 },
1053 {
1054 "EventCode": "0xB1",
1055 "UMask": "0x1",
1056 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
1057 "Counter": "0,1,2,3",
1058 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1059 "CounterMask": "3",
1060 "Errata": "HSD144, HSD30, HSM31",
1061 "PublicDescription": "This events counts the cycles where at least three uop were executed. It is counted per thread.",
1062 "SampleAfterValue": "2000003",
1063 "CounterHTOff": "0,1,2,3"
1064 },
1065 {
1066 "EventCode": "0xB1",
1067 "UMask": "0x1",
1068 "BriefDescription": "Cycles where at least 4 uops were executed per-thread.",
1069 "Counter": "0,1,2,3", 1322 "Counter": "0,1,2,3",
1070 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC", 1323 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
1071 "CounterMask": "4", 1324 "PublicDescription": "Count cases of saving new LBR records by hardware.",
1072 "Errata": "HSD144, HSD30, HSM31",
1073 "SampleAfterValue": "2000003", 1325 "SampleAfterValue": "2000003",
1074 "CounterHTOff": "0,1,2,3" 1326 "CounterHTOff": "0,1,2,3,4,5,6,7"
1075 }, 1327 },
1076 { 1328 {
1077 "EventCode": "0xe6", 1329 "EventCode": "0xe6",
@@ -1082,248 +1334,5 @@
1082 "PublicDescription": "Number of front end re-steers due to BPU misprediction.", 1334 "PublicDescription": "Number of front end re-steers due to BPU misprediction.",
1083 "SampleAfterValue": "100003", 1335 "SampleAfterValue": "100003",
1084 "CounterHTOff": "0,1,2,3,4,5,6,7" 1336 "CounterHTOff": "0,1,2,3,4,5,6,7"
1085 },
1086 {
1087 "EdgeDetect": "1",
1088 "EventCode": "0xC3",
1089 "UMask": "0x1",
1090 "BriefDescription": "Number of machine clears (nukes) of any type.",
1091 "Counter": "0,1,2,3",
1092 "EventName": "MACHINE_CLEARS.COUNT",
1093 "CounterMask": "1",
1094 "SampleAfterValue": "100003",
1095 "CounterHTOff": "0,1,2,3,4,5,6,7"
1096 },
1097 {
1098 "EventCode": "0xA8",
1099 "UMask": "0x1",
1100 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
1101 "Counter": "0,1,2,3",
1102 "EventName": "LSD.CYCLES_ACTIVE",
1103 "CounterMask": "1",
1104 "SampleAfterValue": "2000003",
1105 "CounterHTOff": "0,1,2,3,4,5,6,7"
1106 },
1107 {
1108 "EventCode": "0xA8",
1109 "UMask": "0x1",
1110 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1111 "Counter": "0,1,2,3",
1112 "EventName": "LSD.CYCLES_4_UOPS",
1113 "CounterMask": "4",
1114 "SampleAfterValue": "2000003",
1115 "CounterHTOff": "0,1,2,3,4,5,6,7"
1116 },
1117 {
1118 "EdgeDetect": "1",
1119 "Invert": "1",
1120 "EventCode": "0x5E",
1121 "UMask": "0x1",
1122 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1123 "Counter": "0,1,2,3",
1124 "EventName": "RS_EVENTS.EMPTY_END",
1125 "CounterMask": "1",
1126 "SampleAfterValue": "200003",
1127 "CounterHTOff": "0,1,2,3,4,5,6,7"
1128 },
1129 {
1130 "EventCode": "0xA1",
1131 "UMask": "0x1",
1132 "BriefDescription": "Cycles per thread when uops are executed in port 0.",
1133 "Counter": "0,1,2,3",
1134 "EventName": "UOPS_DISPATCHED_PORT.PORT_0",
1135 "SampleAfterValue": "2000003",
1136 "CounterHTOff": "0,1,2,3,4,5,6,7"
1137 },
1138 {
1139 "EventCode": "0xA1",
1140 "UMask": "0x2",
1141 "BriefDescription": "Cycles per thread when uops are executed in port 1.",
1142 "Counter": "0,1,2,3",
1143 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
1144 "SampleAfterValue": "2000003",
1145 "CounterHTOff": "0,1,2,3,4,5,6,7"
1146 },
1147 {
1148 "EventCode": "0xA1",
1149 "UMask": "0x4",
1150 "BriefDescription": "Cycles per thread when uops are executed in port 2.",
1151 "Counter": "0,1,2,3",
1152 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
1153 "SampleAfterValue": "2000003",
1154 "CounterHTOff": "0,1,2,3,4,5,6,7"
1155 },
1156 {
1157 "EventCode": "0xA1",
1158 "UMask": "0x8",
1159 "BriefDescription": "Cycles per thread when uops are executed in port 3.",
1160 "Counter": "0,1,2,3",
1161 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
1162 "SampleAfterValue": "2000003",
1163 "CounterHTOff": "0,1,2,3,4,5,6,7"
1164 },
1165 {
1166 "EventCode": "0xA1",
1167 "UMask": "0x10",
1168 "BriefDescription": "Cycles per thread when uops are executed in port 4.",
1169 "Counter": "0,1,2,3",
1170 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
1171 "SampleAfterValue": "2000003",
1172 "CounterHTOff": "0,1,2,3,4,5,6,7"
1173 },
1174 {
1175 "EventCode": "0xA1",
1176 "UMask": "0x20",
1177 "BriefDescription": "Cycles per thread when uops are executed in port 5.",
1178 "Counter": "0,1,2,3",
1179 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
1180 "SampleAfterValue": "2000003",
1181 "CounterHTOff": "0,1,2,3,4,5,6,7"
1182 },
1183 {
1184 "EventCode": "0xA1",
1185 "UMask": "0x40",
1186 "BriefDescription": "Cycles per thread when uops are executed in port 6.",
1187 "Counter": "0,1,2,3",
1188 "EventName": "UOPS_DISPATCHED_PORT.PORT_6",
1189 "SampleAfterValue": "2000003",
1190 "CounterHTOff": "0,1,2,3,4,5,6,7"
1191 },
1192 {
1193 "EventCode": "0xA1",
1194 "UMask": "0x80",
1195 "BriefDescription": "Cycles per thread when uops are executed in port 7.",
1196 "Counter": "0,1,2,3",
1197 "EventName": "UOPS_DISPATCHED_PORT.PORT_7",
1198 "SampleAfterValue": "2000003",
1199 "CounterHTOff": "0,1,2,3,4,5,6,7"
1200 },
1201 {
1202 "EventCode": "0x00",
1203 "UMask": "0x2",
1204 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1205 "Counter": "Fixed counter 2",
1206 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1207 "AnyThread": "1",
1208 "SampleAfterValue": "2000003",
1209 "CounterHTOff": "Fixed counter 2"
1210 },
1211 {
1212 "EventCode": "0x3C",
1213 "UMask": "0x0",
1214 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1215 "Counter": "0,1,2,3",
1216 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1217 "AnyThread": "1",
1218 "SampleAfterValue": "2000003",
1219 "CounterHTOff": "0,1,2,3,4,5,6,7"
1220 },
1221 {
1222 "EventCode": "0x3C",
1223 "UMask": "0x1",
1224 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
1225 "Counter": "0,1,2,3",
1226 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1227 "AnyThread": "1",
1228 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1229 "SampleAfterValue": "2000003",
1230 "CounterHTOff": "0,1,2,3,4,5,6,7"
1231 },
1232 {
1233 "EventCode": "0x0D",
1234 "UMask": "0x3",
1235 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke)",
1236 "Counter": "0,1,2,3",
1237 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1238 "AnyThread": "1",
1239 "CounterMask": "1",
1240 "PublicDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1241 "SampleAfterValue": "2000003",
1242 "CounterHTOff": "0,1,2,3,4,5,6,7"
1243 },
1244 {
1245 "EventCode": "0xb1",
1246 "UMask": "0x2",
1247 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1248 "Counter": "0,1,2,3",
1249 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1250 "CounterMask": "1",
1251 "Errata": "HSD30, HSM31",
1252 "SampleAfterValue": "2000003",
1253 "CounterHTOff": "0,1,2,3,4,5,6,7"
1254 },
1255 {
1256 "EventCode": "0xb1",
1257 "UMask": "0x2",
1258 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1259 "Counter": "0,1,2,3",
1260 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1261 "CounterMask": "2",
1262 "Errata": "HSD30, HSM31",
1263 "SampleAfterValue": "2000003",
1264 "CounterHTOff": "0,1,2,3,4,5,6,7"
1265 },
1266 {
1267 "EventCode": "0xb1",
1268 "UMask": "0x2",
1269 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1270 "Counter": "0,1,2,3",
1271 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1272 "CounterMask": "3",
1273 "Errata": "HSD30, HSM31",
1274 "SampleAfterValue": "2000003",
1275 "CounterHTOff": "0,1,2,3,4,5,6,7"
1276 },
1277 {
1278 "EventCode": "0xb1",
1279 "UMask": "0x2",
1280 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1281 "Counter": "0,1,2,3",
1282 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1283 "CounterMask": "4",
1284 "Errata": "HSD30, HSM31",
1285 "SampleAfterValue": "2000003",
1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
1287 },
1288 {
1289 "Invert": "1",
1290 "EventCode": "0xb1",
1291 "UMask": "0x2",
1292 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1293 "Counter": "0,1,2,3",
1294 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1295 "Errata": "HSD30, HSM31",
1296 "SampleAfterValue": "2000003",
1297 "CounterHTOff": "0,1,2,3,4,5,6,7"
1298 },
1299 {
1300 "EventCode": "0x3C",
1301 "UMask": "0x1",
1302 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1303 "Counter": "0,1,2,3",
1304 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1305 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
1306 "SampleAfterValue": "2000003",
1307 "CounterHTOff": "0,1,2,3,4,5,6,7"
1308 },
1309 {
1310 "EventCode": "0x3C",
1311 "UMask": "0x1",
1312 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate)",
1313 "Counter": "0,1,2,3",
1314 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1315 "AnyThread": "1",
1316 "PublicDescription": "Reference cycles when the at least one thread on the physical core is unhalted (counts at 100 MHz rate).",
1317 "SampleAfterValue": "2000003",
1318 "CounterHTOff": "0,1,2,3,4,5,6,7"
1319 },
1320 {
1321 "EventCode": "0x3C",
1322 "UMask": "0x2",
1323 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1324 "Counter": "0,1,2,3",
1325 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1326 "SampleAfterValue": "2000003",
1327 "CounterHTOff": "0,1,2,3,4,5,6,7"
1328 } 1337 }
1329] \ No newline at end of file 1338] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/virtual-memory.json b/tools/perf/pmu-events/arch/x86/haswellx/virtual-memory.json
index 9c00f8ef6a07..168df552b1a8 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/virtual-memory.json
@@ -40,6 +40,16 @@
40 }, 40 },
41 { 41 {
42 "EventCode": "0x08", 42 "EventCode": "0x08",
43 "UMask": "0xe",
44 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
45 "Counter": "0,1,2,3",
46 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
47 "PublicDescription": "Completed page walks in any TLB of any page size due to demand load misses.",
48 "SampleAfterValue": "100003",
49 "CounterHTOff": "0,1,2,3,4,5,6,7"
50 },
51 {
52 "EventCode": "0x08",
43 "UMask": "0x10", 53 "UMask": "0x10",
44 "BriefDescription": "Cycles when PMH is busy with page walks", 54 "BriefDescription": "Cycles when PMH is busy with page walks",
45 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
@@ -70,6 +80,16 @@
70 }, 80 },
71 { 81 {
72 "EventCode": "0x08", 82 "EventCode": "0x08",
83 "UMask": "0x60",
84 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks",
85 "Counter": "0,1,2,3",
86 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
87 "PublicDescription": "Number of cache load STLB hits. No page walk.",
88 "SampleAfterValue": "2000003",
89 "CounterHTOff": "0,1,2,3,4,5,6,7"
90 },
91 {
92 "EventCode": "0x08",
73 "UMask": "0x80", 93 "UMask": "0x80",
74 "BriefDescription": "DTLB demand load misses with low part of linear-to-physical address translation missed", 94 "BriefDescription": "DTLB demand load misses with low part of linear-to-physical address translation missed",
75 "Counter": "0,1,2,3", 95 "Counter": "0,1,2,3",
@@ -119,6 +139,16 @@
119 }, 139 },
120 { 140 {
121 "EventCode": "0x49", 141 "EventCode": "0x49",
142 "UMask": "0xe",
143 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks",
144 "Counter": "0,1,2,3",
145 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
146 "PublicDescription": "Completed page walks due to store miss in any TLB levels of any page size (4K/2M/4M/1G).",
147 "SampleAfterValue": "100003",
148 "CounterHTOff": "0,1,2,3,4,5,6,7"
149 },
150 {
151 "EventCode": "0x49",
122 "UMask": "0x10", 152 "UMask": "0x10",
123 "BriefDescription": "Cycles when PMH is busy with page walks", 153 "BriefDescription": "Cycles when PMH is busy with page walks",
124 "Counter": "0,1,2,3", 154 "Counter": "0,1,2,3",
@@ -149,6 +179,16 @@
149 }, 179 },
150 { 180 {
151 "EventCode": "0x49", 181 "EventCode": "0x49",
182 "UMask": "0x60",
183 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks",
184 "Counter": "0,1,2,3",
185 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
186 "PublicDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
187 "SampleAfterValue": "100003",
188 "CounterHTOff": "0,1,2,3,4,5,6,7"
189 },
190 {
191 "EventCode": "0x49",
152 "UMask": "0x80", 192 "UMask": "0x80",
153 "BriefDescription": "DTLB store misses with low part of linear-to-physical address translation missed", 193 "BriefDescription": "DTLB store misses with low part of linear-to-physical address translation missed",
154 "Counter": "0,1,2,3", 194 "Counter": "0,1,2,3",
@@ -207,6 +247,16 @@
207 }, 247 },
208 { 248 {
209 "EventCode": "0x85", 249 "EventCode": "0x85",
250 "UMask": "0xe",
251 "BriefDescription": "Misses in all ITLB levels that cause completed page walks",
252 "Counter": "0,1,2,3",
253 "EventName": "ITLB_MISSES.WALK_COMPLETED",
254 "PublicDescription": "Completed page walks in ITLB of any page size.",
255 "SampleAfterValue": "100003",
256 "CounterHTOff": "0,1,2,3,4,5,6,7"
257 },
258 {
259 "EventCode": "0x85",
210 "UMask": "0x10", 260 "UMask": "0x10",
211 "BriefDescription": "Cycles when PMH is busy with page walks", 261 "BriefDescription": "Cycles when PMH is busy with page walks",
212 "Counter": "0,1,2,3", 262 "Counter": "0,1,2,3",
@@ -236,6 +286,16 @@
236 "CounterHTOff": "0,1,2,3,4,5,6,7" 286 "CounterHTOff": "0,1,2,3,4,5,6,7"
237 }, 287 },
238 { 288 {
289 "EventCode": "0x85",
290 "UMask": "0x60",
291 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks",
292 "Counter": "0,1,2,3",
293 "EventName": "ITLB_MISSES.STLB_HIT",
294 "PublicDescription": "ITLB misses that hit STLB. No page walk.",
295 "SampleAfterValue": "100003",
296 "CounterHTOff": "0,1,2,3,4,5,6,7"
297 },
298 {
239 "EventCode": "0xae", 299 "EventCode": "0xae",
240 "UMask": "0x1", 300 "UMask": "0x1",
241 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.", 301 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.",
@@ -257,39 +317,43 @@
257 }, 317 },
258 { 318 {
259 "EventCode": "0xBC", 319 "EventCode": "0xBC",
260 "UMask": "0x21", 320 "UMask": "0x12",
261 "BriefDescription": "Number of ITLB page walker hits in the L1+FB", 321 "BriefDescription": "Number of DTLB page walker hits in the L2",
262 "Counter": "0,1,2,3", 322 "Counter": "0,1,2,3",
263 "EventName": "PAGE_WALKER_LOADS.ITLB_L1", 323 "EventName": "PAGE_WALKER_LOADS.DTLB_L2",
264 "PublicDescription": "Number of ITLB page walker loads that hit in the L1+FB.", 324 "PublicDescription": "Number of DTLB page walker loads that hit in the L2.",
265 "SampleAfterValue": "2000003", 325 "SampleAfterValue": "2000003",
266 "CounterHTOff": "0,1,2,3" 326 "CounterHTOff": "0,1,2,3"
267 }, 327 },
268 { 328 {
269 "EventCode": "0xBC", 329 "EventCode": "0xBC",
270 "UMask": "0x41", 330 "UMask": "0x14",
271 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L1 and FB.", 331 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP",
272 "Counter": "0,1,2,3", 332 "Counter": "0,1,2,3",
273 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L1", 333 "EventName": "PAGE_WALKER_LOADS.DTLB_L3",
334 "Errata": "HSD25",
335 "PublicDescription": "Number of DTLB page walker loads that hit in the L3.",
274 "SampleAfterValue": "2000003", 336 "SampleAfterValue": "2000003",
275 "CounterHTOff": "0,1,2,3" 337 "CounterHTOff": "0,1,2,3"
276 }, 338 },
277 { 339 {
278 "EventCode": "0xBC", 340 "EventCode": "0xBC",
279 "UMask": "0x81", 341 "UMask": "0x18",
280 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L1 and FB.", 342 "BriefDescription": "Number of DTLB page walker hits in Memory",
281 "Counter": "0,1,2,3", 343 "Counter": "0,1,2,3",
282 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L1", 344 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY",
345 "Errata": "HSD25",
346 "PublicDescription": "Number of DTLB page walker loads from memory.",
283 "SampleAfterValue": "2000003", 347 "SampleAfterValue": "2000003",
284 "CounterHTOff": "0,1,2,3" 348 "CounterHTOff": "0,1,2,3"
285 }, 349 },
286 { 350 {
287 "EventCode": "0xBC", 351 "EventCode": "0xBC",
288 "UMask": "0x12", 352 "UMask": "0x21",
289 "BriefDescription": "Number of DTLB page walker hits in the L2", 353 "BriefDescription": "Number of ITLB page walker hits in the L1+FB",
290 "Counter": "0,1,2,3", 354 "Counter": "0,1,2,3",
291 "EventName": "PAGE_WALKER_LOADS.DTLB_L2", 355 "EventName": "PAGE_WALKER_LOADS.ITLB_L1",
292 "PublicDescription": "Number of DTLB page walker loads that hit in the L2.", 356 "PublicDescription": "Number of ITLB page walker loads that hit in the L1+FB.",
293 "SampleAfterValue": "2000003", 357 "SampleAfterValue": "2000003",
294 "CounterHTOff": "0,1,2,3" 358 "CounterHTOff": "0,1,2,3"
295 }, 359 },
@@ -305,41 +369,41 @@
305 }, 369 },
306 { 370 {
307 "EventCode": "0xBC", 371 "EventCode": "0xBC",
308 "UMask": "0x42", 372 "UMask": "0x24",
309 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L2.", 373 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP",
310 "Counter": "0,1,2,3", 374 "Counter": "0,1,2,3",
311 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L2", 375 "EventName": "PAGE_WALKER_LOADS.ITLB_L3",
376 "Errata": "HSD25",
377 "PublicDescription": "Number of ITLB page walker loads that hit in the L3.",
312 "SampleAfterValue": "2000003", 378 "SampleAfterValue": "2000003",
313 "CounterHTOff": "0,1,2,3" 379 "CounterHTOff": "0,1,2,3"
314 }, 380 },
315 { 381 {
316 "EventCode": "0xBC", 382 "EventCode": "0xBC",
317 "UMask": "0x82", 383 "UMask": "0x28",
318 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.", 384 "BriefDescription": "Number of ITLB page walker hits in Memory",
319 "Counter": "0,1,2,3", 385 "Counter": "0,1,2,3",
320 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L2", 386 "EventName": "PAGE_WALKER_LOADS.ITLB_MEMORY",
387 "Errata": "HSD25",
388 "PublicDescription": "Number of ITLB page walker loads from memory.",
321 "SampleAfterValue": "2000003", 389 "SampleAfterValue": "2000003",
322 "CounterHTOff": "0,1,2,3" 390 "CounterHTOff": "0,1,2,3"
323 }, 391 },
324 { 392 {
325 "EventCode": "0xBC", 393 "EventCode": "0xBC",
326 "UMask": "0x14", 394 "UMask": "0x41",
327 "BriefDescription": "Number of DTLB page walker hits in the L3 + XSNP", 395 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L1 and FB.",
328 "Counter": "0,1,2,3", 396 "Counter": "0,1,2,3",
329 "EventName": "PAGE_WALKER_LOADS.DTLB_L3", 397 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L1",
330 "Errata": "HSD25",
331 "PublicDescription": "Number of DTLB page walker loads that hit in the L3.",
332 "SampleAfterValue": "2000003", 398 "SampleAfterValue": "2000003",
333 "CounterHTOff": "0,1,2,3" 399 "CounterHTOff": "0,1,2,3"
334 }, 400 },
335 { 401 {
336 "EventCode": "0xBC", 402 "EventCode": "0xBC",
337 "UMask": "0x24", 403 "UMask": "0x42",
338 "BriefDescription": "Number of ITLB page walker hits in the L3 + XSNP", 404 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in the L2.",
339 "Counter": "0,1,2,3", 405 "Counter": "0,1,2,3",
340 "EventName": "PAGE_WALKER_LOADS.ITLB_L3", 406 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_L2",
341 "Errata": "HSD25",
342 "PublicDescription": "Number of ITLB page walker loads that hit in the L3.",
343 "SampleAfterValue": "2000003", 407 "SampleAfterValue": "2000003",
344 "CounterHTOff": "0,1,2,3" 408 "CounterHTOff": "0,1,2,3"
345 }, 409 },
@@ -354,41 +418,37 @@
354 }, 418 },
355 { 419 {
356 "EventCode": "0xBC", 420 "EventCode": "0xBC",
357 "UMask": "0x84", 421 "UMask": "0x48",
358 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.", 422 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in memory.",
359 "Counter": "0,1,2,3", 423 "Counter": "0,1,2,3",
360 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L3", 424 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_MEMORY",
361 "SampleAfterValue": "2000003", 425 "SampleAfterValue": "2000003",
362 "CounterHTOff": "0,1,2,3" 426 "CounterHTOff": "0,1,2,3"
363 }, 427 },
364 { 428 {
365 "EventCode": "0xBC", 429 "EventCode": "0xBC",
366 "UMask": "0x18", 430 "UMask": "0x81",
367 "BriefDescription": "Number of DTLB page walker hits in Memory", 431 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L1 and FB.",
368 "Counter": "0,1,2,3", 432 "Counter": "0,1,2,3",
369 "EventName": "PAGE_WALKER_LOADS.DTLB_MEMORY", 433 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L1",
370 "Errata": "HSD25",
371 "PublicDescription": "Number of DTLB page walker loads from memory.",
372 "SampleAfterValue": "2000003", 434 "SampleAfterValue": "2000003",
373 "CounterHTOff": "0,1,2,3" 435 "CounterHTOff": "0,1,2,3"
374 }, 436 },
375 { 437 {
376 "EventCode": "0xBC", 438 "EventCode": "0xBC",
377 "UMask": "0x28", 439 "UMask": "0x82",
378 "BriefDescription": "Number of ITLB page walker hits in Memory", 440 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.",
379 "Counter": "0,1,2,3", 441 "Counter": "0,1,2,3",
380 "EventName": "PAGE_WALKER_LOADS.ITLB_MEMORY", 442 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L2",
381 "Errata": "HSD25",
382 "PublicDescription": "Number of ITLB page walker loads from memory.",
383 "SampleAfterValue": "2000003", 443 "SampleAfterValue": "2000003",
384 "CounterHTOff": "0,1,2,3" 444 "CounterHTOff": "0,1,2,3"
385 }, 445 },
386 { 446 {
387 "EventCode": "0xBC", 447 "EventCode": "0xBC",
388 "UMask": "0x48", 448 "UMask": "0x84",
389 "BriefDescription": "Counts the number of Extended Page Table walks from the DTLB that hit in memory.", 449 "BriefDescription": "Counts the number of Extended Page Table walks from the ITLB that hit in the L2.",
390 "Counter": "0,1,2,3", 450 "Counter": "0,1,2,3",
391 "EventName": "PAGE_WALKER_LOADS.EPT_DTLB_MEMORY", 451 "EventName": "PAGE_WALKER_LOADS.EPT_ITLB_L3",
392 "SampleAfterValue": "2000003", 452 "SampleAfterValue": "2000003",
393 "CounterHTOff": "0,1,2,3" 453 "CounterHTOff": "0,1,2,3"
394 }, 454 },
@@ -420,65 +480,5 @@
420 "PublicDescription": "Count number of STLB flush attempts.", 480 "PublicDescription": "Count number of STLB flush attempts.",
421 "SampleAfterValue": "100003", 481 "SampleAfterValue": "100003",
422 "CounterHTOff": "0,1,2,3,4,5,6,7" 482 "CounterHTOff": "0,1,2,3,4,5,6,7"
423 },
424 {
425 "EventCode": "0x08",
426 "UMask": "0xe",
427 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
428 "Counter": "0,1,2,3",
429 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
430 "PublicDescription": "Completed page walks in any TLB of any page size due to demand load misses.",
431 "SampleAfterValue": "100003",
432 "CounterHTOff": "0,1,2,3,4,5,6,7"
433 },
434 {
435 "EventCode": "0x08",
436 "UMask": "0x60",
437 "BriefDescription": "Load operations that miss the first DTLB level but hit the second and do not cause page walks",
438 "Counter": "0,1,2,3",
439 "EventName": "DTLB_LOAD_MISSES.STLB_HIT",
440 "PublicDescription": "Number of cache load STLB hits. No page walk.",
441 "SampleAfterValue": "2000003",
442 "CounterHTOff": "0,1,2,3,4,5,6,7"
443 },
444 {
445 "EventCode": "0x49",
446 "UMask": "0xe",
447 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks",
448 "Counter": "0,1,2,3",
449 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
450 "PublicDescription": "Completed page walks due to store miss in any TLB levels of any page size (4K/2M/4M/1G).",
451 "SampleAfterValue": "100003",
452 "CounterHTOff": "0,1,2,3,4,5,6,7"
453 },
454 {
455 "EventCode": "0x49",
456 "UMask": "0x60",
457 "BriefDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks",
458 "Counter": "0,1,2,3",
459 "EventName": "DTLB_STORE_MISSES.STLB_HIT",
460 "PublicDescription": "Store operations that miss the first TLB level but hit the second and do not cause page walks.",
461 "SampleAfterValue": "100003",
462 "CounterHTOff": "0,1,2,3,4,5,6,7"
463 },
464 {
465 "EventCode": "0x85",
466 "UMask": "0xe",
467 "BriefDescription": "Misses in all ITLB levels that cause completed page walks",
468 "Counter": "0,1,2,3",
469 "EventName": "ITLB_MISSES.WALK_COMPLETED",
470 "PublicDescription": "Completed page walks in ITLB of any page size.",
471 "SampleAfterValue": "100003",
472 "CounterHTOff": "0,1,2,3,4,5,6,7"
473 },
474 {
475 "EventCode": "0x85",
476 "UMask": "0x60",
477 "BriefDescription": "Operations that miss the first ITLB level but hit the second and do not cause any page walks",
478 "Counter": "0,1,2,3",
479 "EventName": "ITLB_MISSES.STLB_HIT",
480 "PublicDescription": "ITLB misses that hit STLB. No page walk.",
481 "SampleAfterValue": "100003",
482 "CounterHTOff": "0,1,2,3,4,5,6,7"
483 } 483 }
484] \ No newline at end of file 484] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/ivybridge/cache.json b/tools/perf/pmu-events/arch/x86/ivybridge/cache.json
index f1ee6d4853c5..999a01bc6467 100644
--- a/tools/perf/pmu-events/arch/x86/ivybridge/cache.json
+++ b/tools/perf/pmu-events/arch/x86/ivybridge/cache.json
@@ -10,6 +10,16 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "Counts any demand and L1 HW prefetch data load requests to L2.",
14 "EventCode": "0x24",
15 "Counter": "0,1,2,3",
16 "UMask": "0x3",
17 "EventName": "L2_RQSTS.ALL_DEMAND_DATA_RD",
18 "SampleAfterValue": "200003",
19 "BriefDescription": "Demand Data Read requests",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
13 "PublicDescription": "RFO requests that hit L2 cache.", 23 "PublicDescription": "RFO requests that hit L2 cache.",
14 "EventCode": "0x24", 24 "EventCode": "0x24",
15 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
@@ -30,6 +40,16 @@
30 "CounterHTOff": "0,1,2,3,4,5,6,7" 40 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 }, 41 },
32 { 42 {
43 "PublicDescription": "Counts all L2 store RFO requests.",
44 "EventCode": "0x24",
45 "Counter": "0,1,2,3",
46 "UMask": "0xc",
47 "EventName": "L2_RQSTS.ALL_RFO",
48 "SampleAfterValue": "200003",
49 "BriefDescription": "RFO requests to L2 cache",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
33 "PublicDescription": "Number of instruction fetches that hit the L2 cache.", 53 "PublicDescription": "Number of instruction fetches that hit the L2 cache.",
34 "EventCode": "0x24", 54 "EventCode": "0x24",
35 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
@@ -50,6 +70,16 @@
50 "CounterHTOff": "0,1,2,3,4,5,6,7" 70 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 }, 71 },
52 { 72 {
73 "PublicDescription": "Counts all L2 code requests.",
74 "EventCode": "0x24",
75 "Counter": "0,1,2,3",
76 "UMask": "0x30",
77 "EventName": "L2_RQSTS.ALL_CODE_RD",
78 "SampleAfterValue": "200003",
79 "BriefDescription": "L2 code requests",
80 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 },
82 {
53 "PublicDescription": "Counts all L2 HW prefetcher requests that hit L2.", 83 "PublicDescription": "Counts all L2 HW prefetcher requests that hit L2.",
54 "EventCode": "0x24", 84 "EventCode": "0x24",
55 "Counter": "0,1,2,3", 85 "Counter": "0,1,2,3",
@@ -70,36 +100,6 @@
70 "CounterHTOff": "0,1,2,3,4,5,6,7" 100 "CounterHTOff": "0,1,2,3,4,5,6,7"
71 }, 101 },
72 { 102 {
73 "PublicDescription": "Counts any demand and L1 HW prefetch data load requests to L2.",
74 "EventCode": "0x24",
75 "Counter": "0,1,2,3",
76 "UMask": "0x3",
77 "EventName": "L2_RQSTS.ALL_DEMAND_DATA_RD",
78 "SampleAfterValue": "200003",
79 "BriefDescription": "Demand Data Read requests",
80 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 },
82 {
83 "PublicDescription": "Counts all L2 store RFO requests.",
84 "EventCode": "0x24",
85 "Counter": "0,1,2,3",
86 "UMask": "0xc",
87 "EventName": "L2_RQSTS.ALL_RFO",
88 "SampleAfterValue": "200003",
89 "BriefDescription": "RFO requests to L2 cache",
90 "CounterHTOff": "0,1,2,3,4,5,6,7"
91 },
92 {
93 "PublicDescription": "Counts all L2 code requests.",
94 "EventCode": "0x24",
95 "Counter": "0,1,2,3",
96 "UMask": "0x30",
97 "EventName": "L2_RQSTS.ALL_CODE_RD",
98 "SampleAfterValue": "200003",
99 "BriefDescription": "L2 code requests",
100 "CounterHTOff": "0,1,2,3,4,5,6,7"
101 },
102 {
103 "PublicDescription": "Counts all L2 HW prefetcher requests.", 103 "PublicDescription": "Counts all L2 HW prefetcher requests.",
104 "EventCode": "0x24", 104 "EventCode": "0x24",
105 "Counter": "0,1,2,3", 105 "Counter": "0,1,2,3",
@@ -219,6 +219,29 @@
219 "CounterHTOff": "2" 219 "CounterHTOff": "2"
220 }, 220 },
221 { 221 {
222 "PublicDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
223 "EventCode": "0x48",
224 "Counter": "2",
225 "UMask": "0x1",
226 "AnyThread": "1",
227 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
228 "SampleAfterValue": "2000003",
229 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core",
230 "CounterMask": "1",
231 "CounterHTOff": "2"
232 },
233 {
234 "PublicDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
235 "EventCode": "0x48",
236 "Counter": "0,1,2,3",
237 "UMask": "0x2",
238 "EventName": "L1D_PEND_MISS.FB_FULL",
239 "SampleAfterValue": "2000003",
240 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability",
241 "CounterMask": "1",
242 "CounterHTOff": "0,1,2,3,4,5,6,7"
243 },
244 {
222 "PublicDescription": "Counts the number of lines brought into the L1 data cache.", 245 "PublicDescription": "Counts the number of lines brought into the L1 data cache.",
223 "EventCode": "0x51", 246 "EventCode": "0x51",
224 "Counter": "0,1,2,3", 247 "Counter": "0,1,2,3",
@@ -239,76 +262,87 @@
239 "CounterHTOff": "0,1,2,3,4,5,6,7" 262 "CounterHTOff": "0,1,2,3,4,5,6,7"
240 }, 263 },
241 { 264 {
242 "PublicDescription": "Offcore outstanding Demand Code Read transactions in SQ to uncore. Set Cmask=1 to count cycles.", 265 "PublicDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
243 "EventCode": "0x60", 266 "EventCode": "0x60",
244 "Counter": "0,1,2,3", 267 "Counter": "0,1,2,3",
245 "UMask": "0x2", 268 "UMask": "0x1",
246 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", 269 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
247 "SampleAfterValue": "2000003", 270 "SampleAfterValue": "2000003",
248 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 271 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
272 "CounterMask": "1",
249 "CounterHTOff": "0,1,2,3,4,5,6,7" 273 "CounterHTOff": "0,1,2,3,4,5,6,7"
250 }, 274 },
251 { 275 {
252 "PublicDescription": "Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles.", 276 "PublicDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
253 "EventCode": "0x60", 277 "EventCode": "0x60",
254 "Counter": "0,1,2,3", 278 "Counter": "0,1,2,3",
255 "UMask": "0x4", 279 "UMask": "0x1",
256 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", 280 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
257 "SampleAfterValue": "2000003", 281 "SampleAfterValue": "2000003",
258 "BriefDescription": "Offcore outstanding RFO store transactions in SuperQueue (SQ), queue to uncore", 282 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue",
283 "CounterMask": "6",
259 "CounterHTOff": "0,1,2,3,4,5,6,7" 284 "CounterHTOff": "0,1,2,3,4,5,6,7"
260 }, 285 },
261 { 286 {
262 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.", 287 "PublicDescription": "Offcore outstanding Demand Code Read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
263 "EventCode": "0x60", 288 "EventCode": "0x60",
264 "Counter": "0,1,2,3", 289 "Counter": "0,1,2,3",
265 "UMask": "0x8", 290 "UMask": "0x2",
266 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 291 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
267 "SampleAfterValue": "2000003", 292 "SampleAfterValue": "2000003",
268 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore", 293 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
269 "CounterHTOff": "0,1,2,3,4,5,6,7" 294 "CounterHTOff": "0,1,2,3,4,5,6,7"
270 }, 295 },
271 { 296 {
272 "PublicDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 297 "PublicDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
273 "EventCode": "0x60", 298 "EventCode": "0x60",
274 "Counter": "0,1,2,3", 299 "Counter": "0,1,2,3",
275 "UMask": "0x1", 300 "UMask": "0x2",
276 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD", 301 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD",
277 "SampleAfterValue": "2000003", 302 "SampleAfterValue": "2000003",
278 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore", 303 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
279 "CounterMask": "1", 304 "CounterMask": "1",
280 "CounterHTOff": "0,1,2,3,4,5,6,7" 305 "CounterHTOff": "0,1,2,3,4,5,6,7"
281 }, 306 },
282 { 307 {
283 "PublicDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 308 "PublicDescription": "Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles.",
284 "EventCode": "0x60", 309 "EventCode": "0x60",
285 "Counter": "0,1,2,3", 310 "Counter": "0,1,2,3",
286 "UMask": "0x8", 311 "UMask": "0x4",
287 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD", 312 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO",
288 "SampleAfterValue": "2000003", 313 "SampleAfterValue": "2000003",
289 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore", 314 "BriefDescription": "Offcore outstanding RFO store transactions in SuperQueue (SQ), queue to uncore",
290 "CounterMask": "1",
291 "CounterHTOff": "0,1,2,3,4,5,6,7" 315 "CounterHTOff": "0,1,2,3,4,5,6,7"
292 }, 316 },
293 { 317 {
294 "PublicDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle.", 318 "PublicDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
295 "EventCode": "0x60", 319 "EventCode": "0x60",
296 "Counter": "0,1,2,3", 320 "Counter": "0,1,2,3",
297 "UMask": "0x2", 321 "UMask": "0x4",
298 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD", 322 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
299 "SampleAfterValue": "2000003", 323 "SampleAfterValue": "2000003",
300 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 324 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
301 "CounterMask": "1", 325 "CounterMask": "1",
302 "CounterHTOff": "0,1,2,3,4,5,6,7" 326 "CounterHTOff": "0,1,2,3,4,5,6,7"
303 }, 327 },
304 { 328 {
305 "PublicDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.", 329 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
306 "EventCode": "0x60", 330 "EventCode": "0x60",
307 "Counter": "0,1,2,3", 331 "Counter": "0,1,2,3",
308 "UMask": "0x4", 332 "UMask": "0x8",
309 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO", 333 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
310 "SampleAfterValue": "2000003", 334 "SampleAfterValue": "2000003",
311 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 335 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
336 "CounterHTOff": "0,1,2,3,4,5,6,7"
337 },
338 {
339 "PublicDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
340 "EventCode": "0x60",
341 "Counter": "0,1,2,3",
342 "UMask": "0x8",
343 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD",
344 "SampleAfterValue": "2000003",
345 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore",
312 "CounterMask": "1", 346 "CounterMask": "1",
313 "CounterHTOff": "0,1,2,3,4,5,6,7" 347 "CounterHTOff": "0,1,2,3,4,5,6,7"
314 }, 348 },
@@ -379,7 +413,7 @@
379 "UMask": "0x11", 413 "UMask": "0x11",
380 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS", 414 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS",
381 "SampleAfterValue": "100003", 415 "SampleAfterValue": "100003",
382 "BriefDescription": "Retired load uops that miss the STLB.", 416 "BriefDescription": "Retired load uops that miss the STLB. (Precise Event)",
383 "CounterHTOff": "0,1,2,3" 417 "CounterHTOff": "0,1,2,3"
384 }, 418 },
385 { 419 {
@@ -389,7 +423,7 @@
389 "UMask": "0x12", 423 "UMask": "0x12",
390 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 424 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
391 "SampleAfterValue": "100003", 425 "SampleAfterValue": "100003",
392 "BriefDescription": "Retired store uops that miss the STLB.", 426 "BriefDescription": "Retired store uops that miss the STLB. (Precise Event)",
393 "CounterHTOff": "0,1,2,3" 427 "CounterHTOff": "0,1,2,3"
394 }, 428 },
395 { 429 {
@@ -399,7 +433,7 @@
399 "UMask": "0x21", 433 "UMask": "0x21",
400 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 434 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
401 "SampleAfterValue": "100007", 435 "SampleAfterValue": "100007",
402 "BriefDescription": "Retired load uops with locked access.", 436 "BriefDescription": "Retired load uops with locked access. (Precise Event)",
403 "CounterHTOff": "0,1,2,3" 437 "CounterHTOff": "0,1,2,3"
404 }, 438 },
405 { 439 {
@@ -409,7 +443,7 @@
409 "UMask": "0x41", 443 "UMask": "0x41",
410 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 444 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
411 "SampleAfterValue": "100003", 445 "SampleAfterValue": "100003",
412 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 446 "BriefDescription": "Retired load uops that split across a cacheline boundary. (Precise Event)",
413 "CounterHTOff": "0,1,2,3" 447 "CounterHTOff": "0,1,2,3"
414 }, 448 },
415 { 449 {
@@ -419,7 +453,7 @@
419 "UMask": "0x42", 453 "UMask": "0x42",
420 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 454 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
421 "SampleAfterValue": "100003", 455 "SampleAfterValue": "100003",
422 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 456 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event)",
423 "CounterHTOff": "0,1,2,3" 457 "CounterHTOff": "0,1,2,3"
424 }, 458 },
425 { 459 {
@@ -429,7 +463,7 @@
429 "UMask": "0x81", 463 "UMask": "0x81",
430 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 464 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
431 "SampleAfterValue": "2000003", 465 "SampleAfterValue": "2000003",
432 "BriefDescription": "All retired load uops.", 466 "BriefDescription": "All retired load uops. (Precise Event)",
433 "CounterHTOff": "0,1,2,3" 467 "CounterHTOff": "0,1,2,3"
434 }, 468 },
435 { 469 {
@@ -439,67 +473,61 @@
439 "UMask": "0x82", 473 "UMask": "0x82",
440 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 474 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
441 "SampleAfterValue": "2000003", 475 "SampleAfterValue": "2000003",
442 "BriefDescription": "All retired store uops.", 476 "BriefDescription": "All retired store uops. (Precise Event)",
443 "CounterHTOff": "0,1,2,3" 477 "CounterHTOff": "0,1,2,3"
444 }, 478 },
445 { 479 {
446 "PEBS": "1", 480 "PEBS": "1",
447 "PublicDescription": "Retired load uops with L1 cache hits as data sources.",
448 "EventCode": "0xD1", 481 "EventCode": "0xD1",
449 "Counter": "0,1,2,3", 482 "Counter": "0,1,2,3",
450 "UMask": "0x1", 483 "UMask": "0x1",
451 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT", 484 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT",
452 "SampleAfterValue": "2000003", 485 "SampleAfterValue": "2000003",
453 "BriefDescription": "Retired load uops with L1 cache hits as data sources. ", 486 "BriefDescription": "Retired load uops with L1 cache hits as data sources.",
454 "CounterHTOff": "0,1,2,3" 487 "CounterHTOff": "0,1,2,3"
455 }, 488 },
456 { 489 {
457 "PEBS": "1", 490 "PEBS": "1",
458 "PublicDescription": "Retired load uops with L2 cache hits as data sources.",
459 "EventCode": "0xD1", 491 "EventCode": "0xD1",
460 "Counter": "0,1,2,3", 492 "Counter": "0,1,2,3",
461 "UMask": "0x2", 493 "UMask": "0x2",
462 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 494 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT",
463 "SampleAfterValue": "100003", 495 "SampleAfterValue": "100003",
464 "BriefDescription": "Retired load uops with L2 cache hits as data sources. ", 496 "BriefDescription": "Retired load uops with L2 cache hits as data sources.",
465 "CounterHTOff": "0,1,2,3" 497 "CounterHTOff": "0,1,2,3"
466 }, 498 },
467 { 499 {
468 "PEBS": "1", 500 "PEBS": "1",
469 "PublicDescription": "Retired load uops whose data source was LLC hit with no snoop required.",
470 "EventCode": "0xD1", 501 "EventCode": "0xD1",
471 "Counter": "0,1,2,3", 502 "Counter": "0,1,2,3",
472 "UMask": "0x4", 503 "UMask": "0x4",
473 "EventName": "MEM_LOAD_UOPS_RETIRED.LLC_HIT", 504 "EventName": "MEM_LOAD_UOPS_RETIRED.LLC_HIT",
474 "SampleAfterValue": "50021", 505 "SampleAfterValue": "50021",
475 "BriefDescription": "Retired load uops which data sources were data hits in LLC without snoops required. ", 506 "BriefDescription": "Retired load uops which data sources were data hits in LLC without snoops required.",
476 "CounterHTOff": "0,1,2,3" 507 "CounterHTOff": "0,1,2,3"
477 }, 508 },
478 { 509 {
479 "PEBS": "1", 510 "PEBS": "1",
480 "PublicDescription": "Retired load uops whose data source followed an L1 miss.",
481 "EventCode": "0xD1", 511 "EventCode": "0xD1",
482 "Counter": "0,1,2,3", 512 "Counter": "0,1,2,3",
483 "UMask": "0x8", 513 "UMask": "0x8",
484 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 514 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
485 "SampleAfterValue": "100003", 515 "SampleAfterValue": "100003",
486 "BriefDescription": "Retired load uops which data sources following L1 data-cache miss", 516 "BriefDescription": "Retired load uops which data sources following L1 data-cache miss.",
487 "CounterHTOff": "0,1,2,3" 517 "CounterHTOff": "0,1,2,3"
488 }, 518 },
489 { 519 {
490 "PEBS": "1", 520 "PEBS": "1",
491 "PublicDescription": "Retired load uops that missed L2, excluding unknown sources.",
492 "EventCode": "0xD1", 521 "EventCode": "0xD1",
493 "Counter": "0,1,2,3", 522 "Counter": "0,1,2,3",
494 "UMask": "0x10", 523 "UMask": "0x10",
495 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 524 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
496 "SampleAfterValue": "50021", 525 "SampleAfterValue": "50021",
497 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 526 "BriefDescription": "Retired load uops with L2 cache misses as data sources.",
498 "CounterHTOff": "0,1,2,3" 527 "CounterHTOff": "0,1,2,3"
499 }, 528 },
500 { 529 {
501 "PEBS": "1", 530 "PEBS": "1",
502 "PublicDescription": "Retired load uops whose data source is LLC miss.",
503 "EventCode": "0xD1", 531 "EventCode": "0xD1",
504 "Counter": "0,1,2,3", 532 "Counter": "0,1,2,3",
505 "UMask": "0x20", 533 "UMask": "0x20",
@@ -510,61 +538,56 @@
510 }, 538 },
511 { 539 {
512 "PEBS": "1", 540 "PEBS": "1",
513 "PublicDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.",
514 "EventCode": "0xD1", 541 "EventCode": "0xD1",
515 "Counter": "0,1,2,3", 542 "Counter": "0,1,2,3",
516 "UMask": "0x40", 543 "UMask": "0x40",
517 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB", 544 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB",
518 "SampleAfterValue": "100003", 545 "SampleAfterValue": "100003",
519 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready. ", 546 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.",
520 "CounterHTOff": "0,1,2,3" 547 "CounterHTOff": "0,1,2,3"
521 }, 548 },
522 { 549 {
523 "PEBS": "1", 550 "PEBS": "1",
524 "PublicDescription": "Retired load uops whose data source was an on-package core cache LLC hit and cross-core snoop missed.",
525 "EventCode": "0xD2", 551 "EventCode": "0xD2",
526 "Counter": "0,1,2,3", 552 "Counter": "0,1,2,3",
527 "UMask": "0x1", 553 "UMask": "0x1",
528 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS", 554 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS",
529 "SampleAfterValue": "20011", 555 "SampleAfterValue": "20011",
530 "BriefDescription": "Retired load uops which data sources were LLC hit and cross-core snoop missed in on-pkg core cache. ", 556 "BriefDescription": "Retired load uops which data sources were LLC hit and cross-core snoop missed in on-pkg core cache.",
531 "CounterHTOff": "0,1,2,3" 557 "CounterHTOff": "0,1,2,3"
532 }, 558 },
533 { 559 {
534 "PEBS": "1", 560 "PEBS": "1",
535 "PublicDescription": "Retired load uops whose data source was an on-package LLC hit and cross-core snoop hits.",
536 "EventCode": "0xD2", 561 "EventCode": "0xD2",
537 "Counter": "0,1,2,3", 562 "Counter": "0,1,2,3",
538 "UMask": "0x2", 563 "UMask": "0x2",
539 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT", 564 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT",
540 "SampleAfterValue": "20011", 565 "SampleAfterValue": "20011",
541 "BriefDescription": "Retired load uops which data sources were LLC and cross-core snoop hits in on-pkg core cache. ", 566 "BriefDescription": "Retired load uops which data sources were LLC and cross-core snoop hits in on-pkg core cache.",
542 "CounterHTOff": "0,1,2,3" 567 "CounterHTOff": "0,1,2,3"
543 }, 568 },
544 { 569 {
545 "PEBS": "1", 570 "PEBS": "1",
546 "PublicDescription": "Retired load uops whose data source was an on-package core cache with HitM responses.",
547 "EventCode": "0xD2", 571 "EventCode": "0xD2",
548 "Counter": "0,1,2,3", 572 "Counter": "0,1,2,3",
549 "UMask": "0x4", 573 "UMask": "0x4",
550 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM", 574 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM",
551 "SampleAfterValue": "20011", 575 "SampleAfterValue": "20011",
552 "BriefDescription": "Retired load uops which data sources were HitM responses from shared LLC. ", 576 "BriefDescription": "Retired load uops which data sources were HitM responses from shared LLC.",
553 "CounterHTOff": "0,1,2,3" 577 "CounterHTOff": "0,1,2,3"
554 }, 578 },
555 { 579 {
556 "PEBS": "1", 580 "PEBS": "1",
557 "PublicDescription": "Retired load uops whose data source was LLC hit with no snoop required.",
558 "EventCode": "0xD2", 581 "EventCode": "0xD2",
559 "Counter": "0,1,2,3", 582 "Counter": "0,1,2,3",
560 "UMask": "0x8", 583 "UMask": "0x8",
561 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", 584 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE",
562 "SampleAfterValue": "100003", 585 "SampleAfterValue": "100003",
563 "BriefDescription": "Retired load uops which data sources were hits in LLC without snoops required. ", 586 "BriefDescription": "Retired load uops which data sources were hits in LLC without snoops required.",
564 "CounterHTOff": "0,1,2,3" 587 "CounterHTOff": "0,1,2,3"
565 }, 588 },
566 { 589 {
567 "PublicDescription": "Retired load uop whose Data Source was: local DRAM either Snoop not needed or Snoop Miss (RspI)", 590 "PublicDescription": "Retired load uops whose data source was local memory (cross-socket snoop not needed or missed).",
568 "EventCode": "0xD3", 591 "EventCode": "0xD3",
569 "Counter": "0,1,2,3", 592 "Counter": "0,1,2,3",
570 "UMask": "0x1", 593 "UMask": "0x1",
@@ -753,50 +776,6 @@
753 "CounterHTOff": "0,1,2,3,4,5,6,7" 776 "CounterHTOff": "0,1,2,3,4,5,6,7"
754 }, 777 },
755 { 778 {
756 "PublicDescription": "Retired load uops whose data source was local memory (cross-socket snoop not needed or missed).",
757 "EventCode": "0xD3",
758 "Counter": "0,1,2,3",
759 "UMask": "0x1",
760 "EventName": "MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM",
761 "SampleAfterValue": "100007",
762 "BriefDescription": "Retired load uops which data sources missed LLC but serviced from local dram.",
763 "CounterHTOff": "0,1,2,3"
764 },
765 {
766 "PublicDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
767 "EventCode": "0x60",
768 "Counter": "0,1,2,3",
769 "UMask": "0x1",
770 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
771 "SampleAfterValue": "2000003",
772 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue",
773 "CounterMask": "6",
774 "CounterHTOff": "0,1,2,3,4,5,6,7"
775 },
776 {
777 "PublicDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
778 "EventCode": "0x48",
779 "Counter": "2",
780 "UMask": "0x1",
781 "AnyThread": "1",
782 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
783 "SampleAfterValue": "2000003",
784 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core",
785 "CounterMask": "1",
786 "CounterHTOff": "2"
787 },
788 {
789 "PublicDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
790 "EventCode": "0x48",
791 "Counter": "0,1,2,3",
792 "UMask": "0x2",
793 "EventName": "L1D_PEND_MISS.FB_FULL",
794 "SampleAfterValue": "2000003",
795 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability",
796 "CounterMask": "1",
797 "CounterHTOff": "0,1,2,3,4,5,6,7"
798 },
799 {
800 "EventCode": "0xB7, 0xBB", 779 "EventCode": "0xB7, 0xBB",
801 "MSRValue": "0x3f803c0244", 780 "MSRValue": "0x3f803c0244",
802 "Counter": "0,1,2,3", 781 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/ivybridge/frontend.json b/tools/perf/pmu-events/arch/x86/ivybridge/frontend.json
index de72b84b3536..efaa949ead31 100644
--- a/tools/perf/pmu-events/arch/x86/ivybridge/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/ivybridge/frontend.json
@@ -20,76 +20,45 @@
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.", 23 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.",
24 "EventCode": "0x79",
25 "Counter": "0,1,2,3",
26 "UMask": "0x8",
27 "EventName": "IDQ.DSB_UOPS",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
33 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
34 "EventCode": "0x79",
35 "Counter": "0,1,2,3",
36 "UMask": "0x10",
37 "EventName": "IDQ.MS_DSB_UOPS",
38 "SampleAfterValue": "2000003",
39 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 },
42 {
43 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
44 "EventCode": "0x79",
45 "Counter": "0,1,2,3",
46 "UMask": "0x20",
47 "EventName": "IDQ.MS_MITE_UOPS",
48 "SampleAfterValue": "2000003",
49 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
53 "PublicDescription": "Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles.",
54 "EventCode": "0x79", 24 "EventCode": "0x79",
55 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
56 "UMask": "0x30", 26 "UMask": "0x4",
57 "EventName": "IDQ.MS_UOPS", 27 "EventName": "IDQ.MITE_CYCLES",
58 "SampleAfterValue": "2000003", 28 "SampleAfterValue": "2000003",
59 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 29 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path",
30 "CounterMask": "1",
60 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 }, 32 },
62 { 33 {
63 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy.", 34 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.",
64 "EventCode": "0x79", 35 "EventCode": "0x79",
65 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
66 "UMask": "0x30", 37 "UMask": "0x8",
67 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
68 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
69 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 40 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
70 "CounterMask": "1",
71 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
72 }, 42 },
73 { 43 {
74 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.", 44 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.",
75 "EventCode": "0x79", 45 "EventCode": "0x79",
76 "Counter": "0,1,2,3", 46 "Counter": "0,1,2,3",
77 "UMask": "0x4", 47 "UMask": "0x8",
78 "EventName": "IDQ.MITE_CYCLES", 48 "EventName": "IDQ.DSB_CYCLES",
79 "SampleAfterValue": "2000003", 49 "SampleAfterValue": "2000003",
80 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path", 50 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path",
81 "CounterMask": "1", 51 "CounterMask": "1",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 52 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 53 },
84 { 54 {
85 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.", 55 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
86 "EventCode": "0x79", 56 "EventCode": "0x79",
87 "Counter": "0,1,2,3", 57 "Counter": "0,1,2,3",
88 "UMask": "0x8", 58 "UMask": "0x10",
89 "EventName": "IDQ.DSB_CYCLES", 59 "EventName": "IDQ.MS_DSB_UOPS",
90 "SampleAfterValue": "2000003", 60 "SampleAfterValue": "2000003",
91 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path", 61 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
92 "CounterMask": "1",
93 "CounterHTOff": "0,1,2,3,4,5,6,7" 62 "CounterHTOff": "0,1,2,3,4,5,6,7"
94 }, 63 },
95 { 64 {
@@ -138,6 +107,16 @@
138 "CounterHTOff": "0,1,2,3,4,5,6,7" 107 "CounterHTOff": "0,1,2,3,4,5,6,7"
139 }, 108 },
140 { 109 {
110 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
111 "EventCode": "0x79",
112 "Counter": "0,1,2,3",
113 "UMask": "0x20",
114 "EventName": "IDQ.MS_MITE_UOPS",
115 "SampleAfterValue": "2000003",
116 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
117 "CounterHTOff": "0,1,2,3,4,5,6,7"
118 },
119 {
141 "PublicDescription": "Counts cycles MITE is delivered four uops. Set Cmask = 4.", 120 "PublicDescription": "Counts cycles MITE is delivered four uops. Set Cmask = 4.",
142 "EventCode": "0x79", 121 "EventCode": "0x79",
143 "Counter": "0,1,2,3", 122 "Counter": "0,1,2,3",
@@ -160,6 +139,39 @@
160 "CounterHTOff": "0,1,2,3,4,5,6,7" 139 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 }, 140 },
162 { 141 {
142 "PublicDescription": "Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles.",
143 "EventCode": "0x79",
144 "Counter": "0,1,2,3",
145 "UMask": "0x30",
146 "EventName": "IDQ.MS_UOPS",
147 "SampleAfterValue": "2000003",
148 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
149 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 },
151 {
152 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy.",
153 "EventCode": "0x79",
154 "Counter": "0,1,2,3",
155 "UMask": "0x30",
156 "EventName": "IDQ.MS_CYCLES",
157 "SampleAfterValue": "2000003",
158 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
159 "CounterMask": "1",
160 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 },
162 {
163 "PublicDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
164 "EventCode": "0x79",
165 "Counter": "0,1,2,3",
166 "UMask": "0x30",
167 "EdgeDetect": "1",
168 "EventName": "IDQ.MS_SWITCHES",
169 "SampleAfterValue": "2000003",
170 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer",
171 "CounterMask": "1",
172 "CounterHTOff": "0,1,2,3,4,5,6,7"
173 },
174 {
163 "PublicDescription": "Number of uops delivered to IDQ from any path.", 175 "PublicDescription": "Number of uops delivered to IDQ from any path.",
164 "EventCode": "0x79", 176 "EventCode": "0x79",
165 "Counter": "0,1,2,3", 177 "Counter": "0,1,2,3",
@@ -206,7 +218,7 @@
206 "UMask": "0x1", 218 "UMask": "0x1",
207 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE", 219 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE",
208 "SampleAfterValue": "2000003", 220 "SampleAfterValue": "2000003",
209 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled ", 221 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled",
210 "CounterHTOff": "0,1,2,3" 222 "CounterHTOff": "0,1,2,3"
211 }, 223 },
212 { 224 {
@@ -289,17 +301,5 @@
289 "SampleAfterValue": "2000003", 301 "SampleAfterValue": "2000003",
290 "BriefDescription": "Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB) lines", 302 "BriefDescription": "Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB) lines",
291 "CounterHTOff": "0,1,2,3,4,5,6,7" 303 "CounterHTOff": "0,1,2,3,4,5,6,7"
292 },
293 {
294 "PublicDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
295 "EventCode": "0x79",
296 "Counter": "0,1,2,3",
297 "UMask": "0x30",
298 "EdgeDetect": "1",
299 "EventName": "IDQ.MS_SWITCHES",
300 "SampleAfterValue": "2000003",
301 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer",
302 "CounterMask": "1",
303 "CounterHTOff": "0,1,2,3,4,5,6,7"
304 } 304 }
305] \ No newline at end of file 305] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/ivybridge/memory.json b/tools/perf/pmu-events/arch/x86/ivybridge/memory.json
index e1c6a1d4a4d5..a74d54f56192 100644
--- a/tools/perf/pmu-events/arch/x86/ivybridge/memory.json
+++ b/tools/perf/pmu-events/arch/x86/ivybridge/memory.json
@@ -39,18 +39,6 @@
39 }, 39 },
40 { 40 {
41 "PEBS": "2", 41 "PEBS": "2",
42 "EventCode": "0xCD",
43 "Counter": "3",
44 "UMask": "0x2",
45 "EventName": "MEM_TRANS_RETIRED.PRECISE_STORE",
46 "SampleAfterValue": "2000003",
47 "BriefDescription": "Sample stores and collect precise store operation via PEBS record. PMC3 only.",
48 "PRECISE_STORE": "1",
49 "TakenAlone": "1",
50 "CounterHTOff": "3"
51 },
52 {
53 "PEBS": "2",
54 "PublicDescription": "Loads with latency value being above 4.", 42 "PublicDescription": "Loads with latency value being above 4.",
55 "EventCode": "0xCD", 43 "EventCode": "0xCD",
56 "MSRValue": "0x4", 44 "MSRValue": "0x4",
@@ -162,6 +150,18 @@
162 "CounterHTOff": "3" 150 "CounterHTOff": "3"
163 }, 151 },
164 { 152 {
153 "PEBS": "2",
154 "EventCode": "0xCD",
155 "Counter": "3",
156 "UMask": "0x2",
157 "EventName": "MEM_TRANS_RETIRED.PRECISE_STORE",
158 "SampleAfterValue": "2000003",
159 "BriefDescription": "Sample stores and collect precise store operation via PEBS record. PMC3 only.",
160 "PRECISE_STORE": "1",
161 "TakenAlone": "1",
162 "CounterHTOff": "3"
163 },
164 {
165 "EventCode": "0xB7, 0xBB", 165 "EventCode": "0xB7, 0xBB",
166 "MSRValue": "0x300400244", 166 "MSRValue": "0x300400244",
167 "Counter": "0,1,2,3", 167 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/ivybridge/other.json b/tools/perf/pmu-events/arch/x86/ivybridge/other.json
index 9c2dd0511a32..4eb83ee40412 100644
--- a/tools/perf/pmu-events/arch/x86/ivybridge/other.json
+++ b/tools/perf/pmu-events/arch/x86/ivybridge/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
14 "EventCode": "0x5C",
15 "Counter": "0,1,2,3",
16 "UMask": "0x2",
17 "EventName": "CPL_CYCLES.RING123",
18 "SampleAfterValue": "2000003",
19 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "PublicDescription": "Number of intervals between processor halts while thread is in ring 0.", 13 "PublicDescription": "Number of intervals between processor halts while thread is in ring 0.",
24 "EventCode": "0x5C", 14 "EventCode": "0x5C",
25 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
@@ -32,6 +22,16 @@
32 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 }, 23 },
34 { 24 {
25 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
26 "EventCode": "0x5C",
27 "Counter": "0,1,2,3",
28 "UMask": "0x2",
29 "EventName": "CPL_CYCLES.RING123",
30 "SampleAfterValue": "2000003",
31 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
32 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 },
34 {
35 "PublicDescription": "Cycles in which the L1D and L2 are locked, due to a UC lock or split lock.", 35 "PublicDescription": "Cycles in which the L1D and L2 are locked, due to a UC lock or split lock.",
36 "EventCode": "0x63", 36 "EventCode": "0x63",
37 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/ivybridge/pipeline.json b/tools/perf/pmu-events/arch/x86/ivybridge/pipeline.json
index 2145c28193f7..0afbfd95ea30 100644
--- a/tools/perf/pmu-events/arch/x86/ivybridge/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/ivybridge/pipeline.json
@@ -1,30 +1,41 @@
1[ 1[
2 { 2 {
3 "EventCode": "0x00", 3 "EventCode": "0x00",
4 "Counter": "Fixed counter 1", 4 "Counter": "Fixed counter 0",
5 "UMask": "0x1", 5 "UMask": "0x1",
6 "EventName": "INST_RETIRED.ANY", 6 "EventName": "INST_RETIRED.ANY",
7 "SampleAfterValue": "2000003", 7 "SampleAfterValue": "2000003",
8 "BriefDescription": "Instructions retired from execution.", 8 "BriefDescription": "Instructions retired from execution.",
9 "CounterHTOff": "Fixed counter 1" 9 "CounterHTOff": "Fixed counter 0"
10 }, 10 },
11 { 11 {
12 "EventCode": "0x00", 12 "EventCode": "0x00",
13 "Counter": "Fixed counter 2", 13 "Counter": "Fixed counter 1",
14 "UMask": "0x2", 14 "UMask": "0x2",
15 "EventName": "CPU_CLK_UNHALTED.THREAD", 15 "EventName": "CPU_CLK_UNHALTED.THREAD",
16 "SampleAfterValue": "2000003", 16 "SampleAfterValue": "2000003",
17 "BriefDescription": "Core cycles when the thread is not in halt state.", 17 "BriefDescription": "Core cycles when the thread is not in halt state.",
18 "CounterHTOff": "Fixed counter 2" 18 "CounterHTOff": "Fixed counter 1"
19 }, 19 },
20 { 20 {
21 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
21 "EventCode": "0x00", 22 "EventCode": "0x00",
22 "Counter": "Fixed counter 3", 23 "Counter": "Fixed counter 1",
24 "UMask": "0x2",
25 "AnyThread": "1",
26 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
27 "SampleAfterValue": "2000003",
28 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
29 "CounterHTOff": "Fixed counter 1"
30 },
31 {
32 "EventCode": "0x00",
33 "Counter": "Fixed counter 2",
23 "UMask": "0x3", 34 "UMask": "0x3",
24 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 35 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
25 "SampleAfterValue": "2000003", 36 "SampleAfterValue": "2000003",
26 "BriefDescription": "Reference cycles when the core is not in halt state.", 37 "BriefDescription": "Reference cycles when the core is not in halt state.",
27 "CounterHTOff": "Fixed counter 3" 38 "CounterHTOff": "Fixed counter 2"
28 }, 39 },
29 { 40 {
30 "PublicDescription": "Loads blocked by overlapping with store buffer that cannot be forwarded.", 41 "PublicDescription": "Loads blocked by overlapping with store buffer that cannot be forwarded.",
@@ -78,6 +89,17 @@
78 "CounterHTOff": "0,1,2,3,4,5,6,7" 89 "CounterHTOff": "0,1,2,3,4,5,6,7"
79 }, 90 },
80 { 91 {
92 "EventCode": "0x0D",
93 "Counter": "0,1,2,3",
94 "UMask": "0x3",
95 "AnyThread": "1",
96 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
97 "SampleAfterValue": "2000003",
98 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
99 "CounterMask": "1",
100 "CounterHTOff": "0,1,2,3,4,5,6,7"
101 },
102 {
81 "PublicDescription": "Increments each cycle the # of Uops issued by the RAT to RS. Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core.", 103 "PublicDescription": "Increments each cycle the # of Uops issued by the RAT to RS. Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core.",
82 "EventCode": "0x0E", 104 "EventCode": "0x0E",
83 "Counter": "0,1,2,3", 105 "Counter": "0,1,2,3",
@@ -175,6 +197,17 @@
175 "CounterHTOff": "0,1,2,3,4,5,6,7" 197 "CounterHTOff": "0,1,2,3,4,5,6,7"
176 }, 198 },
177 { 199 {
200 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
201 "EventCode": "0x3C",
202 "Counter": "0,1,2,3",
203 "UMask": "0x0",
204 "AnyThread": "1",
205 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
206 "SampleAfterValue": "2000003",
207 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
208 "CounterHTOff": "0,1,2,3,4,5,6,7"
209 },
210 {
178 "PublicDescription": "Increments at the frequency of XCLK (100 MHz) when not halted.", 211 "PublicDescription": "Increments at the frequency of XCLK (100 MHz) when not halted.",
179 "EventCode": "0x3C", 212 "EventCode": "0x3C",
180 "Counter": "0,1,2,3", 213 "Counter": "0,1,2,3",
@@ -187,6 +220,36 @@
187 { 220 {
188 "EventCode": "0x3C", 221 "EventCode": "0x3C",
189 "Counter": "0,1,2,3", 222 "Counter": "0,1,2,3",
223 "UMask": "0x1",
224 "AnyThread": "1",
225 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
226 "SampleAfterValue": "2000003",
227 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
228 "CounterHTOff": "0,1,2,3,4,5,6,7"
229 },
230 {
231 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
232 "EventCode": "0x3C",
233 "Counter": "0,1,2,3",
234 "UMask": "0x1",
235 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
236 "SampleAfterValue": "2000003",
237 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
238 "CounterHTOff": "0,1,2,3,4,5,6,7"
239 },
240 {
241 "EventCode": "0x3C",
242 "Counter": "0,1,2,3",
243 "UMask": "0x1",
244 "AnyThread": "1",
245 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
246 "SampleAfterValue": "2000003",
247 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
248 "CounterHTOff": "0,1,2,3,4,5,6,7"
249 },
250 {
251 "EventCode": "0x3C",
252 "Counter": "0,1,2,3",
190 "UMask": "0x2", 253 "UMask": "0x2",
191 "EventName": "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE", 254 "EventName": "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE",
192 "SampleAfterValue": "2000003", 255 "SampleAfterValue": "2000003",
@@ -194,6 +257,15 @@
194 "CounterHTOff": "0,1,2,3" 257 "CounterHTOff": "0,1,2,3"
195 }, 258 },
196 { 259 {
260 "EventCode": "0x3C",
261 "Counter": "0,1,2,3",
262 "UMask": "0x2",
263 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
264 "SampleAfterValue": "2000003",
265 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
266 "CounterHTOff": "0,1,2,3,4,5,6,7"
267 },
268 {
197 "PublicDescription": "Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.", 269 "PublicDescription": "Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.",
198 "EventCode": "0x4C", 270 "EventCode": "0x4C",
199 "Counter": "0,1,2,3", 271 "Counter": "0,1,2,3",
@@ -216,37 +288,37 @@
216 { 288 {
217 "EventCode": "0x58", 289 "EventCode": "0x58",
218 "Counter": "0,1,2,3", 290 "Counter": "0,1,2,3",
219 "UMask": "0x4", 291 "UMask": "0x1",
220 "EventName": "MOVE_ELIMINATION.INT_NOT_ELIMINATED", 292 "EventName": "MOVE_ELIMINATION.INT_ELIMINATED",
221 "SampleAfterValue": "1000003", 293 "SampleAfterValue": "1000003",
222 "BriefDescription": "Number of integer Move Elimination candidate uops that were not eliminated.", 294 "BriefDescription": "Number of integer Move Elimination candidate uops that were eliminated.",
223 "CounterHTOff": "0,1,2,3,4,5,6,7" 295 "CounterHTOff": "0,1,2,3,4,5,6,7"
224 }, 296 },
225 { 297 {
226 "EventCode": "0x58", 298 "EventCode": "0x58",
227 "Counter": "0,1,2,3", 299 "Counter": "0,1,2,3",
228 "UMask": "0x8", 300 "UMask": "0x2",
229 "EventName": "MOVE_ELIMINATION.SIMD_NOT_ELIMINATED", 301 "EventName": "MOVE_ELIMINATION.SIMD_ELIMINATED",
230 "SampleAfterValue": "1000003", 302 "SampleAfterValue": "1000003",
231 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were not eliminated.", 303 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were eliminated.",
232 "CounterHTOff": "0,1,2,3,4,5,6,7" 304 "CounterHTOff": "0,1,2,3,4,5,6,7"
233 }, 305 },
234 { 306 {
235 "EventCode": "0x58", 307 "EventCode": "0x58",
236 "Counter": "0,1,2,3", 308 "Counter": "0,1,2,3",
237 "UMask": "0x1", 309 "UMask": "0x4",
238 "EventName": "MOVE_ELIMINATION.INT_ELIMINATED", 310 "EventName": "MOVE_ELIMINATION.INT_NOT_ELIMINATED",
239 "SampleAfterValue": "1000003", 311 "SampleAfterValue": "1000003",
240 "BriefDescription": "Number of integer Move Elimination candidate uops that were eliminated.", 312 "BriefDescription": "Number of integer Move Elimination candidate uops that were not eliminated.",
241 "CounterHTOff": "0,1,2,3,4,5,6,7" 313 "CounterHTOff": "0,1,2,3,4,5,6,7"
242 }, 314 },
243 { 315 {
244 "EventCode": "0x58", 316 "EventCode": "0x58",
245 "Counter": "0,1,2,3", 317 "Counter": "0,1,2,3",
246 "UMask": "0x2", 318 "UMask": "0x8",
247 "EventName": "MOVE_ELIMINATION.SIMD_ELIMINATED", 319 "EventName": "MOVE_ELIMINATION.SIMD_NOT_ELIMINATED",
248 "SampleAfterValue": "1000003", 320 "SampleAfterValue": "1000003",
249 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were eliminated.", 321 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were not eliminated.",
250 "CounterHTOff": "0,1,2,3,4,5,6,7" 322 "CounterHTOff": "0,1,2,3,4,5,6,7"
251 }, 323 },
252 { 324 {
@@ -260,6 +332,18 @@
260 "CounterHTOff": "0,1,2,3,4,5,6,7" 332 "CounterHTOff": "0,1,2,3,4,5,6,7"
261 }, 333 },
262 { 334 {
335 "EventCode": "0x5E",
336 "Invert": "1",
337 "Counter": "0,1,2,3",
338 "UMask": "0x1",
339 "EdgeDetect": "1",
340 "EventName": "RS_EVENTS.EMPTY_END",
341 "SampleAfterValue": "200003",
342 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
343 "CounterMask": "1",
344 "CounterHTOff": "0,1,2,3,4,5,6,7"
345 },
346 {
263 "EventCode": "0x87", 347 "EventCode": "0x87",
264 "Counter": "0,1,2,3", 348 "Counter": "0,1,2,3",
265 "UMask": "0x1", 349 "UMask": "0x1",
@@ -498,118 +582,118 @@
498 "CounterHTOff": "0,1,2,3,4,5,6,7" 582 "CounterHTOff": "0,1,2,3,4,5,6,7"
499 }, 583 },
500 { 584 {
501 "PublicDescription": "Cycles which a Uop is dispatched on port 1.", 585 "PublicDescription": "Cycles per core when uops are dispatched to port 0.",
502 "EventCode": "0xA1", 586 "EventCode": "0xA1",
503 "Counter": "0,1,2,3", 587 "Counter": "0,1,2,3",
504 "UMask": "0x2", 588 "UMask": "0x1",
505 "EventName": "UOPS_DISPATCHED_PORT.PORT_1", 589 "AnyThread": "1",
590 "EventName": "UOPS_DISPATCHED_PORT.PORT_0_CORE",
506 "SampleAfterValue": "2000003", 591 "SampleAfterValue": "2000003",
507 "BriefDescription": "Cycles per thread when uops are dispatched to port 1", 592 "BriefDescription": "Cycles per core when uops are dispatched to port 0",
508 "CounterHTOff": "0,1,2,3,4,5,6,7" 593 "CounterHTOff": "0,1,2,3,4,5,6,7"
509 }, 594 },
510 { 595 {
511 "PublicDescription": "Cycles which a Uop is dispatched on port 4.", 596 "PublicDescription": "Cycles which a Uop is dispatched on port 1.",
512 "EventCode": "0xA1", 597 "EventCode": "0xA1",
513 "Counter": "0,1,2,3", 598 "Counter": "0,1,2,3",
514 "UMask": "0x40", 599 "UMask": "0x2",
515 "EventName": "UOPS_DISPATCHED_PORT.PORT_4", 600 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
516 "SampleAfterValue": "2000003", 601 "SampleAfterValue": "2000003",
517 "BriefDescription": "Cycles per thread when uops are dispatched to port 4", 602 "BriefDescription": "Cycles per thread when uops are dispatched to port 1",
518 "CounterHTOff": "0,1,2,3,4,5,6,7" 603 "CounterHTOff": "0,1,2,3,4,5,6,7"
519 }, 604 },
520 { 605 {
521 "PublicDescription": "Cycles which a Uop is dispatched on port 5.", 606 "PublicDescription": "Cycles per core when uops are dispatched to port 1.",
522 "EventCode": "0xA1", 607 "EventCode": "0xA1",
523 "Counter": "0,1,2,3", 608 "Counter": "0,1,2,3",
524 "UMask": "0x80", 609 "UMask": "0x2",
525 "EventName": "UOPS_DISPATCHED_PORT.PORT_5", 610 "AnyThread": "1",
611 "EventName": "UOPS_DISPATCHED_PORT.PORT_1_CORE",
526 "SampleAfterValue": "2000003", 612 "SampleAfterValue": "2000003",
527 "BriefDescription": "Cycles per thread when uops are dispatched to port 5", 613 "BriefDescription": "Cycles per core when uops are dispatched to port 1",
528 "CounterHTOff": "0,1,2,3,4,5,6,7" 614 "CounterHTOff": "0,1,2,3,4,5,6,7"
529 }, 615 },
530 { 616 {
531 "PublicDescription": "Cycles per core when uops are dispatched to port 0.", 617 "PublicDescription": "Cycles which a Uop is dispatched on port 2.",
532 "EventCode": "0xA1", 618 "EventCode": "0xA1",
533 "Counter": "0,1,2,3", 619 "Counter": "0,1,2,3",
534 "UMask": "0x1", 620 "UMask": "0xc",
535 "AnyThread": "1", 621 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
536 "EventName": "UOPS_DISPATCHED_PORT.PORT_0_CORE",
537 "SampleAfterValue": "2000003", 622 "SampleAfterValue": "2000003",
538 "BriefDescription": "Cycles per core when uops are dispatched to port 0", 623 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 2",
539 "CounterHTOff": "0,1,2,3,4,5,6,7" 624 "CounterHTOff": "0,1,2,3,4,5,6,7"
540 }, 625 },
541 { 626 {
542 "PublicDescription": "Cycles per core when uops are dispatched to port 1.",
543 "EventCode": "0xA1", 627 "EventCode": "0xA1",
544 "Counter": "0,1,2,3", 628 "Counter": "0,1,2,3",
545 "UMask": "0x2", 629 "UMask": "0xc",
546 "AnyThread": "1", 630 "AnyThread": "1",
547 "EventName": "UOPS_DISPATCHED_PORT.PORT_1_CORE", 631 "EventName": "UOPS_DISPATCHED_PORT.PORT_2_CORE",
548 "SampleAfterValue": "2000003", 632 "SampleAfterValue": "2000003",
549 "BriefDescription": "Cycles per core when uops are dispatched to port 1", 633 "BriefDescription": "Uops dispatched to port 2, loads and stores per core (speculative and retired).",
550 "CounterHTOff": "0,1,2,3,4,5,6,7" 634 "CounterHTOff": "0,1,2,3,4,5,6,7"
551 }, 635 },
552 { 636 {
553 "PublicDescription": "Cycles per core when uops are dispatched to port 4.", 637 "PublicDescription": "Cycles which a Uop is dispatched on port 3.",
554 "EventCode": "0xA1", 638 "EventCode": "0xA1",
555 "Counter": "0,1,2,3", 639 "Counter": "0,1,2,3",
556 "UMask": "0x40", 640 "UMask": "0x30",
557 "AnyThread": "1", 641 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
558 "EventName": "UOPS_DISPATCHED_PORT.PORT_4_CORE",
559 "SampleAfterValue": "2000003", 642 "SampleAfterValue": "2000003",
560 "BriefDescription": "Cycles per core when uops are dispatched to port 4", 643 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 3",
561 "CounterHTOff": "0,1,2,3,4,5,6,7" 644 "CounterHTOff": "0,1,2,3,4,5,6,7"
562 }, 645 },
563 { 646 {
564 "PublicDescription": "Cycles per core when uops are dispatched to port 5.", 647 "PublicDescription": "Cycles per core when load or STA uops are dispatched to port 3.",
565 "EventCode": "0xA1", 648 "EventCode": "0xA1",
566 "Counter": "0,1,2,3", 649 "Counter": "0,1,2,3",
567 "UMask": "0x80", 650 "UMask": "0x30",
568 "AnyThread": "1", 651 "AnyThread": "1",
569 "EventName": "UOPS_DISPATCHED_PORT.PORT_5_CORE", 652 "EventName": "UOPS_DISPATCHED_PORT.PORT_3_CORE",
570 "SampleAfterValue": "2000003", 653 "SampleAfterValue": "2000003",
571 "BriefDescription": "Cycles per core when uops are dispatched to port 5", 654 "BriefDescription": "Cycles per core when load or STA uops are dispatched to port 3",
572 "CounterHTOff": "0,1,2,3,4,5,6,7" 655 "CounterHTOff": "0,1,2,3,4,5,6,7"
573 }, 656 },
574 { 657 {
575 "PublicDescription": "Cycles which a Uop is dispatched on port 2.", 658 "PublicDescription": "Cycles which a Uop is dispatched on port 4.",
576 "EventCode": "0xA1", 659 "EventCode": "0xA1",
577 "Counter": "0,1,2,3", 660 "Counter": "0,1,2,3",
578 "UMask": "0xc", 661 "UMask": "0x40",
579 "EventName": "UOPS_DISPATCHED_PORT.PORT_2", 662 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
580 "SampleAfterValue": "2000003", 663 "SampleAfterValue": "2000003",
581 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 2", 664 "BriefDescription": "Cycles per thread when uops are dispatched to port 4",
582 "CounterHTOff": "0,1,2,3,4,5,6,7" 665 "CounterHTOff": "0,1,2,3,4,5,6,7"
583 }, 666 },
584 { 667 {
585 "PublicDescription": "Cycles which a Uop is dispatched on port 3.", 668 "PublicDescription": "Cycles per core when uops are dispatched to port 4.",
586 "EventCode": "0xA1", 669 "EventCode": "0xA1",
587 "Counter": "0,1,2,3", 670 "Counter": "0,1,2,3",
588 "UMask": "0x30", 671 "UMask": "0x40",
589 "EventName": "UOPS_DISPATCHED_PORT.PORT_3", 672 "AnyThread": "1",
673 "EventName": "UOPS_DISPATCHED_PORT.PORT_4_CORE",
590 "SampleAfterValue": "2000003", 674 "SampleAfterValue": "2000003",
591 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 3", 675 "BriefDescription": "Cycles per core when uops are dispatched to port 4",
592 "CounterHTOff": "0,1,2,3,4,5,6,7" 676 "CounterHTOff": "0,1,2,3,4,5,6,7"
593 }, 677 },
594 { 678 {
679 "PublicDescription": "Cycles which a Uop is dispatched on port 5.",
595 "EventCode": "0xA1", 680 "EventCode": "0xA1",
596 "Counter": "0,1,2,3", 681 "Counter": "0,1,2,3",
597 "UMask": "0xc", 682 "UMask": "0x80",
598 "AnyThread": "1", 683 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
599 "EventName": "UOPS_DISPATCHED_PORT.PORT_2_CORE",
600 "SampleAfterValue": "2000003", 684 "SampleAfterValue": "2000003",
601 "BriefDescription": "Uops dispatched to port 2, loads and stores per core (speculative and retired).", 685 "BriefDescription": "Cycles per thread when uops are dispatched to port 5",
602 "CounterHTOff": "0,1,2,3,4,5,6,7" 686 "CounterHTOff": "0,1,2,3,4,5,6,7"
603 }, 687 },
604 { 688 {
605 "PublicDescription": "Cycles per core when load or STA uops are dispatched to port 3.", 689 "PublicDescription": "Cycles per core when uops are dispatched to port 5.",
606 "EventCode": "0xA1", 690 "EventCode": "0xA1",
607 "Counter": "0,1,2,3", 691 "Counter": "0,1,2,3",
608 "UMask": "0x30", 692 "UMask": "0x80",
609 "AnyThread": "1", 693 "AnyThread": "1",
610 "EventName": "UOPS_DISPATCHED_PORT.PORT_3_CORE", 694 "EventName": "UOPS_DISPATCHED_PORT.PORT_5_CORE",
611 "SampleAfterValue": "2000003", 695 "SampleAfterValue": "2000003",
612 "BriefDescription": "Cycles per core when load or STA uops are dispatched to port 3", 696 "BriefDescription": "Cycles per core when uops are dispatched to port 5",
613 "CounterHTOff": "0,1,2,3,4,5,6,7" 697 "CounterHTOff": "0,1,2,3,4,5,6,7"
614 }, 698 },
615 { 699 {
@@ -662,15 +746,14 @@
662 "CounterHTOff": "0,1,2,3,4,5,6,7" 746 "CounterHTOff": "0,1,2,3,4,5,6,7"
663 }, 747 },
664 { 748 {
665 "PublicDescription": "Cycles with pending L1 cache miss loads. Set AnyThread to count per core.",
666 "EventCode": "0xA3", 749 "EventCode": "0xA3",
667 "Counter": "2", 750 "Counter": "0,1,2,3",
668 "UMask": "0x8", 751 "UMask": "0x1",
669 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING", 752 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
670 "SampleAfterValue": "2000003", 753 "SampleAfterValue": "2000003",
671 "BriefDescription": "Cycles with pending L1 cache miss loads.", 754 "BriefDescription": "Cycles while L2 cache miss load* is outstanding.",
672 "CounterMask": "8", 755 "CounterMask": "1",
673 "CounterHTOff": "2" 756 "CounterHTOff": "0,1,2,3,4,5,6,7"
674 }, 757 },
675 { 758 {
676 "PublicDescription": "Cycles with pending memory loads. Set AnyThread to count per core.", 759 "PublicDescription": "Cycles with pending memory loads. Set AnyThread to count per core.",
@@ -684,13 +767,33 @@
684 "CounterHTOff": "0,1,2,3" 767 "CounterHTOff": "0,1,2,3"
685 }, 768 },
686 { 769 {
770 "EventCode": "0xA3",
771 "Counter": "0,1,2,3",
772 "UMask": "0x2",
773 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
774 "SampleAfterValue": "2000003",
775 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
776 "CounterMask": "2",
777 "CounterHTOff": "0,1,2,3"
778 },
779 {
687 "PublicDescription": "Total execution stalls.", 780 "PublicDescription": "Total execution stalls.",
688 "EventCode": "0xA3", 781 "EventCode": "0xA3",
689 "Counter": "0,1,2,3", 782 "Counter": "0,1,2,3",
690 "UMask": "0x4", 783 "UMask": "0x4",
691 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 784 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
692 "SampleAfterValue": "2000003", 785 "SampleAfterValue": "2000003",
693 "BriefDescription": "Total execution stalls", 786 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
787 "CounterMask": "4",
788 "CounterHTOff": "0,1,2,3"
789 },
790 {
791 "EventCode": "0xA3",
792 "Counter": "0,1,2,3",
793 "UMask": "0x4",
794 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
795 "SampleAfterValue": "2000003",
796 "BriefDescription": "Total execution stalls.",
694 "CounterMask": "4", 797 "CounterMask": "4",
695 "CounterHTOff": "0,1,2,3" 798 "CounterHTOff": "0,1,2,3"
696 }, 799 },
@@ -708,6 +811,16 @@
708 { 811 {
709 "EventCode": "0xA3", 812 "EventCode": "0xA3",
710 "Counter": "0,1,2,3", 813 "Counter": "0,1,2,3",
814 "UMask": "0x5",
815 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
816 "SampleAfterValue": "2000003",
817 "BriefDescription": "Execution stalls while L2 cache miss load* is outstanding.",
818 "CounterMask": "5",
819 "CounterHTOff": "0,1,2,3"
820 },
821 {
822 "EventCode": "0xA3",
823 "Counter": "0,1,2,3",
711 "UMask": "0x6", 824 "UMask": "0x6",
712 "EventName": "CYCLE_ACTIVITY.STALLS_LDM_PENDING", 825 "EventName": "CYCLE_ACTIVITY.STALLS_LDM_PENDING",
713 "SampleAfterValue": "2000003", 826 "SampleAfterValue": "2000003",
@@ -716,6 +829,37 @@
716 "CounterHTOff": "0,1,2,3" 829 "CounterHTOff": "0,1,2,3"
717 }, 830 },
718 { 831 {
832 "EventCode": "0xA3",
833 "Counter": "0,1,2,3",
834 "UMask": "0x6",
835 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
836 "SampleAfterValue": "2000003",
837 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
838 "CounterMask": "6",
839 "CounterHTOff": "0,1,2,3"
840 },
841 {
842 "PublicDescription": "Cycles with pending L1 cache miss loads. Set AnyThread to count per core.",
843 "EventCode": "0xA3",
844 "Counter": "2",
845 "UMask": "0x8",
846 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
847 "SampleAfterValue": "2000003",
848 "BriefDescription": "Cycles with pending L1 cache miss loads.",
849 "CounterMask": "8",
850 "CounterHTOff": "2"
851 },
852 {
853 "EventCode": "0xA3",
854 "Counter": "2",
855 "UMask": "0x8",
856 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
857 "SampleAfterValue": "2000003",
858 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
859 "CounterMask": "8",
860 "CounterHTOff": "2"
861 },
862 {
719 "PublicDescription": "Execution stalls due to L1 data cache miss loads. Set Cmask=0CH.", 863 "PublicDescription": "Execution stalls due to L1 data cache miss loads. Set Cmask=0CH.",
720 "EventCode": "0xA3", 864 "EventCode": "0xA3",
721 "Counter": "2", 865 "Counter": "2",
@@ -727,6 +871,16 @@
727 "CounterHTOff": "2" 871 "CounterHTOff": "2"
728 }, 872 },
729 { 873 {
874 "EventCode": "0xA3",
875 "Counter": "2",
876 "UMask": "0xc",
877 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
878 "SampleAfterValue": "2000003",
879 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
880 "CounterMask": "12",
881 "CounterHTOff": "2"
882 },
883 {
730 "EventCode": "0xA8", 884 "EventCode": "0xA8",
731 "Counter": "0,1,2,3", 885 "Counter": "0,1,2,3",
732 "UMask": "0x1", 886 "UMask": "0x1",
@@ -747,6 +901,17 @@
747 "CounterHTOff": "0,1,2,3,4,5,6,7" 901 "CounterHTOff": "0,1,2,3,4,5,6,7"
748 }, 902 },
749 { 903 {
904 "PublicDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
905 "EventCode": "0xA8",
906 "Counter": "0,1,2,3",
907 "UMask": "0x1",
908 "EventName": "LSD.CYCLES_4_UOPS",
909 "SampleAfterValue": "2000003",
910 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder",
911 "CounterMask": "4",
912 "CounterHTOff": "0,1,2,3,4,5,6,7"
913 },
914 {
750 "PublicDescription": "Counts total number of uops to be executed per-thread each cycle. Set Cmask = 1, INV =1 to count stall cycles.", 915 "PublicDescription": "Counts total number of uops to be executed per-thread each cycle. Set Cmask = 1, INV =1 to count stall cycles.",
751 "EventCode": "0xB1", 916 "EventCode": "0xB1",
752 "Counter": "0,1,2,3", 917 "Counter": "0,1,2,3",
@@ -757,6 +922,61 @@
757 "CounterHTOff": "0,1,2,3,4,5,6,7" 922 "CounterHTOff": "0,1,2,3,4,5,6,7"
758 }, 923 },
759 { 924 {
925 "EventCode": "0xB1",
926 "Invert": "1",
927 "Counter": "0,1,2,3",
928 "UMask": "0x1",
929 "EventName": "UOPS_EXECUTED.STALL_CYCLES",
930 "SampleAfterValue": "2000003",
931 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
932 "CounterMask": "1",
933 "CounterHTOff": "0,1,2,3"
934 },
935 {
936 "PublicDescription": "Cycles where at least 1 uop was executed per-thread.",
937 "EventCode": "0xB1",
938 "Counter": "0,1,2,3",
939 "UMask": "0x1",
940 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
941 "SampleAfterValue": "2000003",
942 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
943 "CounterMask": "1",
944 "CounterHTOff": "0,1,2,3,4,5,6,7"
945 },
946 {
947 "PublicDescription": "Cycles where at least 2 uops were executed per-thread.",
948 "EventCode": "0xB1",
949 "Counter": "0,1,2,3",
950 "UMask": "0x1",
951 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
952 "SampleAfterValue": "2000003",
953 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
954 "CounterMask": "2",
955 "CounterHTOff": "0,1,2,3,4,5,6,7"
956 },
957 {
958 "PublicDescription": "Cycles where at least 3 uops were executed per-thread.",
959 "EventCode": "0xB1",
960 "Counter": "0,1,2,3",
961 "UMask": "0x1",
962 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
963 "SampleAfterValue": "2000003",
964 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
965 "CounterMask": "3",
966 "CounterHTOff": "0,1,2,3,4,5,6,7"
967 },
968 {
969 "PublicDescription": "Cycles where at least 4 uops were executed per-thread.",
970 "EventCode": "0xB1",
971 "Counter": "0,1,2,3",
972 "UMask": "0x1",
973 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
974 "SampleAfterValue": "2000003",
975 "BriefDescription": "Cycles where at least 4 uops were executed per-thread",
976 "CounterMask": "4",
977 "CounterHTOff": "0,1,2,3,4,5,6,7"
978 },
979 {
760 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.", 980 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.",
761 "EventCode": "0xB1", 981 "EventCode": "0xB1",
762 "Counter": "0,1,2,3", 982 "Counter": "0,1,2,3",
@@ -767,15 +987,59 @@
767 "CounterHTOff": "0,1,2,3,4,5,6,7" 987 "CounterHTOff": "0,1,2,3,4,5,6,7"
768 }, 988 },
769 { 989 {
990 "PublicDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
770 "EventCode": "0xB1", 991 "EventCode": "0xB1",
771 "Invert": "1",
772 "Counter": "0,1,2,3", 992 "Counter": "0,1,2,3",
773 "UMask": "0x1", 993 "UMask": "0x2",
774 "EventName": "UOPS_EXECUTED.STALL_CYCLES", 994 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
775 "SampleAfterValue": "2000003", 995 "SampleAfterValue": "2000003",
776 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.", 996 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core",
777 "CounterMask": "1", 997 "CounterMask": "1",
778 "CounterHTOff": "0,1,2,3" 998 "CounterHTOff": "0,1,2,3,4,5,6,7"
999 },
1000 {
1001 "PublicDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1002 "EventCode": "0xB1",
1003 "Counter": "0,1,2,3",
1004 "UMask": "0x2",
1005 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1006 "SampleAfterValue": "2000003",
1007 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core",
1008 "CounterMask": "2",
1009 "CounterHTOff": "0,1,2,3,4,5,6,7"
1010 },
1011 {
1012 "PublicDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1013 "EventCode": "0xB1",
1014 "Counter": "0,1,2,3",
1015 "UMask": "0x2",
1016 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1017 "SampleAfterValue": "2000003",
1018 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core",
1019 "CounterMask": "3",
1020 "CounterHTOff": "0,1,2,3,4,5,6,7"
1021 },
1022 {
1023 "PublicDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1024 "EventCode": "0xB1",
1025 "Counter": "0,1,2,3",
1026 "UMask": "0x2",
1027 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1028 "SampleAfterValue": "2000003",
1029 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core",
1030 "CounterMask": "4",
1031 "CounterHTOff": "0,1,2,3,4,5,6,7"
1032 },
1033 {
1034 "PublicDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1035 "EventCode": "0xB1",
1036 "Invert": "1",
1037 "Counter": "0,1,2,3",
1038 "UMask": "0x2",
1039 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1040 "SampleAfterValue": "2000003",
1041 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core",
1042 "CounterHTOff": "0,1,2,3,4,5,6,7"
779 }, 1043 },
780 { 1044 {
781 "PublicDescription": "Number of instructions at retirement.", 1045 "PublicDescription": "Number of instructions at retirement.",
@@ -809,24 +1073,12 @@
809 }, 1073 },
810 { 1074 {
811 "PEBS": "1", 1075 "PEBS": "1",
812 "PublicDescription": "Counts the number of micro-ops retired, Use cmask=1 and invert to count active cycles or stalled cycles.",
813 "EventCode": "0xC2", 1076 "EventCode": "0xC2",
814 "Counter": "0,1,2,3", 1077 "Counter": "0,1,2,3",
815 "UMask": "0x1", 1078 "UMask": "0x1",
816 "EventName": "UOPS_RETIRED.ALL", 1079 "EventName": "UOPS_RETIRED.ALL",
817 "SampleAfterValue": "2000003", 1080 "SampleAfterValue": "2000003",
818 "BriefDescription": "Actually retired uops. ", 1081 "BriefDescription": "Retired uops.",
819 "CounterHTOff": "0,1,2,3,4,5,6,7"
820 },
821 {
822 "PEBS": "1",
823 "PublicDescription": "Counts the number of retirement slots used each cycle.",
824 "EventCode": "0xC2",
825 "Counter": "0,1,2,3",
826 "UMask": "0x2",
827 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
828 "SampleAfterValue": "2000003",
829 "BriefDescription": "Retirement slots used. ",
830 "CounterHTOff": "0,1,2,3,4,5,6,7" 1082 "CounterHTOff": "0,1,2,3,4,5,6,7"
831 }, 1083 },
832 { 1084 {
@@ -864,6 +1116,27 @@
864 "CounterHTOff": "0,1,2,3" 1116 "CounterHTOff": "0,1,2,3"
865 }, 1117 },
866 { 1118 {
1119 "PEBS": "1",
1120 "EventCode": "0xC2",
1121 "Counter": "0,1,2,3",
1122 "UMask": "0x2",
1123 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1124 "SampleAfterValue": "2000003",
1125 "BriefDescription": "Retirement slots used.",
1126 "CounterHTOff": "0,1,2,3,4,5,6,7"
1127 },
1128 {
1129 "EventCode": "0xC3",
1130 "Counter": "0,1,2,3",
1131 "UMask": "0x1",
1132 "EdgeDetect": "1",
1133 "EventName": "MACHINE_CLEARS.COUNT",
1134 "SampleAfterValue": "100003",
1135 "BriefDescription": "Number of machine clears (nukes) of any type.",
1136 "CounterMask": "1",
1137 "CounterHTOff": "0,1,2,3,4,5,6,7"
1138 },
1139 {
867 "PublicDescription": "Number of self-modifying-code machine clears detected.", 1140 "PublicDescription": "Number of self-modifying-code machine clears detected.",
868 "EventCode": "0xC3", 1141 "EventCode": "0xC3",
869 "Counter": "0,1,2,3", 1142 "Counter": "0,1,2,3",
@@ -880,50 +1153,67 @@
880 "UMask": "0x20", 1153 "UMask": "0x20",
881 "EventName": "MACHINE_CLEARS.MASKMOV", 1154 "EventName": "MACHINE_CLEARS.MASKMOV",
882 "SampleAfterValue": "100003", 1155 "SampleAfterValue": "100003",
883 "BriefDescription": "This event counts the number of executed Intel AVX masked load operations that refer to an illegal address range with the mask bits set to 0. ", 1156 "BriefDescription": "This event counts the number of executed Intel AVX masked load operations that refer to an illegal address range with the mask bits set to 0.",
1157 "CounterHTOff": "0,1,2,3,4,5,6,7"
1158 },
1159 {
1160 "PublicDescription": "Branch instructions at retirement.",
1161 "EventCode": "0xC4",
1162 "Counter": "0,1,2,3",
1163 "UMask": "0x0",
1164 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1165 "SampleAfterValue": "400009",
1166 "BriefDescription": "All (macro) branch instructions retired.",
884 "CounterHTOff": "0,1,2,3,4,5,6,7" 1167 "CounterHTOff": "0,1,2,3,4,5,6,7"
885 }, 1168 },
886 { 1169 {
887 "PEBS": "1", 1170 "PEBS": "1",
888 "PublicDescription": "Counts the number of conditional branch instructions retired.",
889 "EventCode": "0xC4", 1171 "EventCode": "0xC4",
890 "Counter": "0,1,2,3", 1172 "Counter": "0,1,2,3",
891 "UMask": "0x1", 1173 "UMask": "0x1",
892 "EventName": "BR_INST_RETIRED.CONDITIONAL", 1174 "EventName": "BR_INST_RETIRED.CONDITIONAL",
893 "SampleAfterValue": "400009", 1175 "SampleAfterValue": "400009",
894 "BriefDescription": "Conditional branch instructions retired. ", 1176 "BriefDescription": "Conditional branch instructions retired.",
895 "CounterHTOff": "0,1,2,3,4,5,6,7" 1177 "CounterHTOff": "0,1,2,3,4,5,6,7"
896 }, 1178 },
897 { 1179 {
898 "PEBS": "1", 1180 "PEBS": "1",
899 "PublicDescription": "Direct and indirect near call instructions retired.",
900 "EventCode": "0xC4", 1181 "EventCode": "0xC4",
901 "Counter": "0,1,2,3", 1182 "Counter": "0,1,2,3",
902 "UMask": "0x2", 1183 "UMask": "0x2",
903 "EventName": "BR_INST_RETIRED.NEAR_CALL", 1184 "EventName": "BR_INST_RETIRED.NEAR_CALL",
904 "SampleAfterValue": "100007", 1185 "SampleAfterValue": "100007",
905 "BriefDescription": "Direct and indirect near call instructions retired. ", 1186 "BriefDescription": "Direct and indirect near call instructions retired.",
906 "CounterHTOff": "0,1,2,3,4,5,6,7" 1187 "CounterHTOff": "0,1,2,3,4,5,6,7"
907 }, 1188 },
908 { 1189 {
909 "PublicDescription": "Branch instructions at retirement.", 1190 "PEBS": "1",
910 "EventCode": "0xC4", 1191 "EventCode": "0xC4",
911 "Counter": "0,1,2,3", 1192 "Counter": "0,1,2,3",
912 "UMask": "0x0", 1193 "UMask": "0x2",
913 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1194 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
1195 "SampleAfterValue": "100007",
1196 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3).",
1197 "CounterHTOff": "0,1,2,3,4,5,6,7"
1198 },
1199 {
1200 "PEBS": "2",
1201 "EventCode": "0xC4",
1202 "Counter": "0,1,2,3",
1203 "UMask": "0x4",
1204 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
914 "SampleAfterValue": "400009", 1205 "SampleAfterValue": "400009",
915 "BriefDescription": "All (macro) branch instructions retired.", 1206 "BriefDescription": "All (macro) branch instructions retired.",
916 "CounterHTOff": "0,1,2,3,4,5,6,7" 1207 "CounterHTOff": "0,1,2,3"
917 }, 1208 },
918 { 1209 {
919 "PEBS": "1", 1210 "PEBS": "1",
920 "PublicDescription": "Counts the number of near return instructions retired.",
921 "EventCode": "0xC4", 1211 "EventCode": "0xC4",
922 "Counter": "0,1,2,3", 1212 "Counter": "0,1,2,3",
923 "UMask": "0x8", 1213 "UMask": "0x8",
924 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 1214 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
925 "SampleAfterValue": "100007", 1215 "SampleAfterValue": "100007",
926 "BriefDescription": "Return instructions retired. ", 1216 "BriefDescription": "Return instructions retired.",
927 "CounterHTOff": "0,1,2,3,4,5,6,7" 1217 "CounterHTOff": "0,1,2,3,4,5,6,7"
928 }, 1218 },
929 { 1219 {
@@ -933,18 +1223,17 @@
933 "UMask": "0x10", 1223 "UMask": "0x10",
934 "EventName": "BR_INST_RETIRED.NOT_TAKEN", 1224 "EventName": "BR_INST_RETIRED.NOT_TAKEN",
935 "SampleAfterValue": "400009", 1225 "SampleAfterValue": "400009",
936 "BriefDescription": "Not taken branch instructions retired. ", 1226 "BriefDescription": "Not taken branch instructions retired.",
937 "CounterHTOff": "0,1,2,3,4,5,6,7" 1227 "CounterHTOff": "0,1,2,3,4,5,6,7"
938 }, 1228 },
939 { 1229 {
940 "PEBS": "1", 1230 "PEBS": "1",
941 "PublicDescription": "Number of near taken branches retired.",
942 "EventCode": "0xC4", 1231 "EventCode": "0xC4",
943 "Counter": "0,1,2,3", 1232 "Counter": "0,1,2,3",
944 "UMask": "0x20", 1233 "UMask": "0x20",
945 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 1234 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
946 "SampleAfterValue": "400009", 1235 "SampleAfterValue": "400009",
947 "BriefDescription": "Taken branch instructions retired. ", 1236 "BriefDescription": "Taken branch instructions retired.",
948 "CounterHTOff": "0,1,2,3,4,5,6,7" 1237 "CounterHTOff": "0,1,2,3,4,5,6,7"
949 }, 1238 },
950 { 1239 {
@@ -954,28 +1243,7 @@
954 "UMask": "0x40", 1243 "UMask": "0x40",
955 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 1244 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
956 "SampleAfterValue": "100007", 1245 "SampleAfterValue": "100007",
957 "BriefDescription": "Far branch instructions retired. ", 1246 "BriefDescription": "Far branch instructions retired.",
958 "CounterHTOff": "0,1,2,3,4,5,6,7"
959 },
960 {
961 "PEBS": "2",
962 "EventCode": "0xC4",
963 "Counter": "0,1,2,3",
964 "UMask": "0x4",
965 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
966 "SampleAfterValue": "400009",
967 "BriefDescription": "All (macro) branch instructions retired.",
968 "CounterHTOff": "0,1,2,3"
969 },
970 {
971 "PEBS": "1",
972 "PublicDescription": "Mispredicted conditional branch instructions retired.",
973 "EventCode": "0xC5",
974 "Counter": "0,1,2,3",
975 "UMask": "0x1",
976 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
977 "SampleAfterValue": "400009",
978 "BriefDescription": "Mispredicted conditional branch instructions retired. ",
979 "CounterHTOff": "0,1,2,3,4,5,6,7" 1247 "CounterHTOff": "0,1,2,3,4,5,6,7"
980 }, 1248 },
981 { 1249 {
@@ -990,13 +1258,12 @@
990 }, 1258 },
991 { 1259 {
992 "PEBS": "1", 1260 "PEBS": "1",
993 "PublicDescription": "Mispredicted taken branch instructions retired.",
994 "EventCode": "0xC5", 1261 "EventCode": "0xC5",
995 "Counter": "0,1,2,3", 1262 "Counter": "0,1,2,3",
996 "UMask": "0x20", 1263 "UMask": "0x1",
997 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 1264 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
998 "SampleAfterValue": "400009", 1265 "SampleAfterValue": "400009",
999 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken. ", 1266 "BriefDescription": "Mispredicted conditional branch instructions retired.",
1000 "CounterHTOff": "0,1,2,3,4,5,6,7" 1267 "CounterHTOff": "0,1,2,3,4,5,6,7"
1001 }, 1268 },
1002 { 1269 {
@@ -1010,6 +1277,16 @@
1010 "CounterHTOff": "0,1,2,3" 1277 "CounterHTOff": "0,1,2,3"
1011 }, 1278 },
1012 { 1279 {
1280 "PEBS": "1",
1281 "EventCode": "0xC5",
1282 "Counter": "0,1,2,3",
1283 "UMask": "0x20",
1284 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
1285 "SampleAfterValue": "400009",
1286 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.",
1287 "CounterHTOff": "0,1,2,3,4,5,6,7"
1288 },
1289 {
1013 "PublicDescription": "Count cases of saving new LBR records by hardware.", 1290 "PublicDescription": "Count cases of saving new LBR records by hardware.",
1014 "EventCode": "0xCC", 1291 "EventCode": "0xCC",
1015 "Counter": "0,1,2,3", 1292 "Counter": "0,1,2,3",
@@ -1028,280 +1305,5 @@
1028 "SampleAfterValue": "100003", 1305 "SampleAfterValue": "100003",
1029 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.", 1306 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.",
1030 "CounterHTOff": "0,1,2,3,4,5,6,7" 1307 "CounterHTOff": "0,1,2,3,4,5,6,7"
1031 },
1032 {
1033 "PublicDescription": "Cycles where at least 1 uop was executed per-thread.",
1034 "EventCode": "0xB1",
1035 "Counter": "0,1,2,3",
1036 "UMask": "0x1",
1037 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1038 "SampleAfterValue": "2000003",
1039 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
1040 "CounterMask": "1",
1041 "CounterHTOff": "0,1,2,3,4,5,6,7"
1042 },
1043 {
1044 "PublicDescription": "Cycles where at least 2 uops were executed per-thread.",
1045 "EventCode": "0xB1",
1046 "Counter": "0,1,2,3",
1047 "UMask": "0x1",
1048 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1049 "SampleAfterValue": "2000003",
1050 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
1051 "CounterMask": "2",
1052 "CounterHTOff": "0,1,2,3,4,5,6,7"
1053 },
1054 {
1055 "PublicDescription": "Cycles where at least 3 uops were executed per-thread.",
1056 "EventCode": "0xB1",
1057 "Counter": "0,1,2,3",
1058 "UMask": "0x1",
1059 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1060 "SampleAfterValue": "2000003",
1061 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
1062 "CounterMask": "3",
1063 "CounterHTOff": "0,1,2,3,4,5,6,7"
1064 },
1065 {
1066 "PublicDescription": "Cycles where at least 4 uops were executed per-thread.",
1067 "EventCode": "0xB1",
1068 "Counter": "0,1,2,3",
1069 "UMask": "0x1",
1070 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
1071 "SampleAfterValue": "2000003",
1072 "BriefDescription": "Cycles where at least 4 uops were executed per-thread",
1073 "CounterMask": "4",
1074 "CounterHTOff": "0,1,2,3,4,5,6,7"
1075 },
1076 {
1077 "EventCode": "0x5E",
1078 "Invert": "1",
1079 "Counter": "0,1,2,3",
1080 "UMask": "0x1",
1081 "EdgeDetect": "1",
1082 "EventName": "RS_EVENTS.EMPTY_END",
1083 "SampleAfterValue": "200003",
1084 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1085 "CounterMask": "1",
1086 "CounterHTOff": "0,1,2,3,4,5,6,7"
1087 },
1088 {
1089 "EventCode": "0xC3",
1090 "Counter": "0,1,2,3",
1091 "UMask": "0x1",
1092 "EdgeDetect": "1",
1093 "EventName": "MACHINE_CLEARS.COUNT",
1094 "SampleAfterValue": "100003",
1095 "BriefDescription": "Number of machine clears (nukes) of any type.",
1096 "CounterMask": "1",
1097 "CounterHTOff": "0,1,2,3,4,5,6,7"
1098 },
1099 {
1100 "PublicDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1101 "EventCode": "0xA8",
1102 "Counter": "0,1,2,3",
1103 "UMask": "0x1",
1104 "EventName": "LSD.CYCLES_4_UOPS",
1105 "SampleAfterValue": "2000003",
1106 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder",
1107 "CounterMask": "4",
1108 "CounterHTOff": "0,1,2,3,4,5,6,7"
1109 },
1110 {
1111 "EventCode": "0xA3",
1112 "Counter": "2",
1113 "UMask": "0x8",
1114 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
1115 "SampleAfterValue": "2000003",
1116 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
1117 "CounterMask": "8",
1118 "CounterHTOff": "2"
1119 },
1120 {
1121 "EventCode": "0xA3",
1122 "Counter": "0,1,2,3",
1123 "UMask": "0x1",
1124 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
1125 "SampleAfterValue": "2000003",
1126 "BriefDescription": "Cycles while L2 cache miss load* is outstanding.",
1127 "CounterMask": "1",
1128 "CounterHTOff": "0,1,2,3,4,5,6,7"
1129 },
1130 {
1131 "EventCode": "0xA3",
1132 "Counter": "0,1,2,3",
1133 "UMask": "0x2",
1134 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
1135 "SampleAfterValue": "2000003",
1136 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
1137 "CounterMask": "2",
1138 "CounterHTOff": "0,1,2,3"
1139 },
1140 {
1141 "EventCode": "0xA3",
1142 "Counter": "0,1,2,3",
1143 "UMask": "0x4",
1144 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
1145 "SampleAfterValue": "2000003",
1146 "BriefDescription": "Total execution stalls.",
1147 "CounterMask": "4",
1148 "CounterHTOff": "0,1,2,3"
1149 },
1150 {
1151 "EventCode": "0xA3",
1152 "Counter": "2",
1153 "UMask": "0xc",
1154 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
1155 "SampleAfterValue": "2000003",
1156 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
1157 "CounterMask": "12",
1158 "CounterHTOff": "2"
1159 },
1160 {
1161 "EventCode": "0xA3",
1162 "Counter": "0,1,2,3",
1163 "UMask": "0x5",
1164 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
1165 "SampleAfterValue": "2000003",
1166 "BriefDescription": "Execution stalls while L2 cache miss load* is outstanding.",
1167 "CounterMask": "5",
1168 "CounterHTOff": "0,1,2,3"
1169 },
1170 {
1171 "EventCode": "0xA3",
1172 "Counter": "0,1,2,3",
1173 "UMask": "0x6",
1174 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
1175 "SampleAfterValue": "2000003",
1176 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
1177 "CounterMask": "6",
1178 "CounterHTOff": "0,1,2,3"
1179 },
1180 {
1181 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1182 "EventCode": "0x00",
1183 "Counter": "Fixed counter 2",
1184 "UMask": "0x2",
1185 "AnyThread": "1",
1186 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1187 "SampleAfterValue": "2000003",
1188 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
1189 "CounterHTOff": "Fixed counter 2"
1190 },
1191 {
1192 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1193 "EventCode": "0x3C",
1194 "Counter": "0,1,2,3",
1195 "UMask": "0x0",
1196 "AnyThread": "1",
1197 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1198 "SampleAfterValue": "2000003",
1199 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
1200 "CounterHTOff": "0,1,2,3,4,5,6,7"
1201 },
1202 {
1203 "EventCode": "0x3C",
1204 "Counter": "0,1,2,3",
1205 "UMask": "0x1",
1206 "AnyThread": "1",
1207 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1208 "SampleAfterValue": "2000003",
1209 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
1210 "CounterHTOff": "0,1,2,3,4,5,6,7"
1211 },
1212 {
1213 "EventCode": "0x0D",
1214 "Counter": "0,1,2,3",
1215 "UMask": "0x3",
1216 "AnyThread": "1",
1217 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1218 "SampleAfterValue": "2000003",
1219 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1220 "CounterMask": "1",
1221 "CounterHTOff": "0,1,2,3,4,5,6,7"
1222 },
1223 {
1224 "PublicDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1225 "EventCode": "0xB1",
1226 "Counter": "0,1,2,3",
1227 "UMask": "0x2",
1228 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1229 "SampleAfterValue": "2000003",
1230 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core",
1231 "CounterMask": "1",
1232 "CounterHTOff": "0,1,2,3,4,5,6,7"
1233 },
1234 {
1235 "PublicDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1236 "EventCode": "0xB1",
1237 "Counter": "0,1,2,3",
1238 "UMask": "0x2",
1239 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1240 "SampleAfterValue": "2000003",
1241 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core",
1242 "CounterMask": "2",
1243 "CounterHTOff": "0,1,2,3,4,5,6,7"
1244 },
1245 {
1246 "PublicDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1247 "EventCode": "0xB1",
1248 "Counter": "0,1,2,3",
1249 "UMask": "0x2",
1250 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1251 "SampleAfterValue": "2000003",
1252 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core",
1253 "CounterMask": "3",
1254 "CounterHTOff": "0,1,2,3,4,5,6,7"
1255 },
1256 {
1257 "PublicDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1258 "EventCode": "0xB1",
1259 "Counter": "0,1,2,3",
1260 "UMask": "0x2",
1261 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1262 "SampleAfterValue": "2000003",
1263 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core",
1264 "CounterMask": "4",
1265 "CounterHTOff": "0,1,2,3,4,5,6,7"
1266 },
1267 {
1268 "PublicDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1269 "EventCode": "0xB1",
1270 "Invert": "1",
1271 "Counter": "0,1,2,3",
1272 "UMask": "0x2",
1273 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1274 "SampleAfterValue": "2000003",
1275 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core",
1276 "CounterHTOff": "0,1,2,3,4,5,6,7"
1277 },
1278 {
1279 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
1280 "EventCode": "0x3C",
1281 "Counter": "0,1,2,3",
1282 "UMask": "0x1",
1283 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1284 "SampleAfterValue": "2000003",
1285 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
1287 },
1288 {
1289 "EventCode": "0x3C",
1290 "Counter": "0,1,2,3",
1291 "UMask": "0x1",
1292 "AnyThread": "1",
1293 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1294 "SampleAfterValue": "2000003",
1295 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
1296 "CounterHTOff": "0,1,2,3,4,5,6,7"
1297 },
1298 {
1299 "EventCode": "0x3C",
1300 "Counter": "0,1,2,3",
1301 "UMask": "0x2",
1302 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1303 "SampleAfterValue": "2000003",
1304 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1305 "CounterHTOff": "0,1,2,3,4,5,6,7"
1306 } 1308 }
1307] \ No newline at end of file 1309] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/ivybridge/virtual-memory.json b/tools/perf/pmu-events/arch/x86/ivybridge/virtual-memory.json
index f036f5398906..f243551b4d12 100644
--- a/tools/perf/pmu-events/arch/x86/ivybridge/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/ivybridge/virtual-memory.json
@@ -1,5 +1,35 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "Misses in all TLB levels that cause a page walk of any page size from demand loads.",
4 "EventCode": "0x08",
5 "Counter": "0,1,2,3",
6 "UMask": "0x81",
7 "EventName": "DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK",
8 "SampleAfterValue": "100003",
9 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes an page walk of any page size.",
10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 },
12 {
13 "PublicDescription": "Misses in all TLB levels that caused page walk completed of any size by demand loads.",
14 "EventCode": "0x08",
15 "Counter": "0,1,2,3",
16 "UMask": "0x82",
17 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
18 "SampleAfterValue": "100003",
19 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "PublicDescription": "Cycle PMH is busy with a walk due to demand loads.",
24 "EventCode": "0x08",
25 "Counter": "0,1,2,3",
26 "UMask": "0x84",
27 "EventName": "DTLB_LOAD_MISSES.WALK_DURATION",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Demand load cycles page miss handler (PMH) is busy with this walk.",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
3 "EventCode": "0x08", 33 "EventCode": "0x08",
4 "Counter": "0,1,2,3", 34 "Counter": "0,1,2,3",
5 "UMask": "0x88", 35 "UMask": "0x88",
@@ -146,35 +176,5 @@
146 "SampleAfterValue": "100007", 176 "SampleAfterValue": "100007",
147 "BriefDescription": "STLB flush attempts", 177 "BriefDescription": "STLB flush attempts",
148 "CounterHTOff": "0,1,2,3,4,5,6,7" 178 "CounterHTOff": "0,1,2,3,4,5,6,7"
149 },
150 {
151 "PublicDescription": "Misses in all TLB levels that cause a page walk of any page size from demand loads.",
152 "EventCode": "0x08",
153 "Counter": "0,1,2,3",
154 "UMask": "0x81",
155 "EventName": "DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK",
156 "SampleAfterValue": "100003",
157 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes an page walk of any page size.",
158 "CounterHTOff": "0,1,2,3,4,5,6,7"
159 },
160 {
161 "PublicDescription": "Misses in all TLB levels that caused page walk completed of any size by demand loads.",
162 "EventCode": "0x08",
163 "Counter": "0,1,2,3",
164 "UMask": "0x82",
165 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
166 "SampleAfterValue": "100003",
167 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
168 "CounterHTOff": "0,1,2,3,4,5,6,7"
169 },
170 {
171 "PublicDescription": "Cycle PMH is busy with a walk due to demand loads.",
172 "EventCode": "0x08",
173 "Counter": "0,1,2,3",
174 "UMask": "0x84",
175 "EventName": "DTLB_LOAD_MISSES.WALK_DURATION",
176 "SampleAfterValue": "2000003",
177 "BriefDescription": "Demand load cycles page miss handler (PMH) is busy with this walk.",
178 "CounterHTOff": "0,1,2,3,4,5,6,7"
179 } 179 }
180] \ No newline at end of file 180] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/cache.json b/tools/perf/pmu-events/arch/x86/ivytown/cache.json
index ff27a620edd8..6dad3ad6b102 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/cache.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/cache.json
@@ -10,6 +10,16 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "Counts any demand and L1 HW prefetch data load requests to L2.",
14 "EventCode": "0x24",
15 "Counter": "0,1,2,3",
16 "UMask": "0x3",
17 "EventName": "L2_RQSTS.ALL_DEMAND_DATA_RD",
18 "SampleAfterValue": "200003",
19 "BriefDescription": "Demand Data Read requests",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
13 "PublicDescription": "RFO requests that hit L2 cache.", 23 "PublicDescription": "RFO requests that hit L2 cache.",
14 "EventCode": "0x24", 24 "EventCode": "0x24",
15 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
@@ -30,6 +40,16 @@
30 "CounterHTOff": "0,1,2,3,4,5,6,7" 40 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 }, 41 },
32 { 42 {
43 "PublicDescription": "Counts all L2 store RFO requests.",
44 "EventCode": "0x24",
45 "Counter": "0,1,2,3",
46 "UMask": "0xc",
47 "EventName": "L2_RQSTS.ALL_RFO",
48 "SampleAfterValue": "200003",
49 "BriefDescription": "RFO requests to L2 cache",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
33 "PublicDescription": "Number of instruction fetches that hit the L2 cache.", 53 "PublicDescription": "Number of instruction fetches that hit the L2 cache.",
34 "EventCode": "0x24", 54 "EventCode": "0x24",
35 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
@@ -50,6 +70,16 @@
50 "CounterHTOff": "0,1,2,3,4,5,6,7" 70 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 }, 71 },
52 { 72 {
73 "PublicDescription": "Counts all L2 code requests.",
74 "EventCode": "0x24",
75 "Counter": "0,1,2,3",
76 "UMask": "0x30",
77 "EventName": "L2_RQSTS.ALL_CODE_RD",
78 "SampleAfterValue": "200003",
79 "BriefDescription": "L2 code requests",
80 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 },
82 {
53 "PublicDescription": "Counts all L2 HW prefetcher requests that hit L2.", 83 "PublicDescription": "Counts all L2 HW prefetcher requests that hit L2.",
54 "EventCode": "0x24", 84 "EventCode": "0x24",
55 "Counter": "0,1,2,3", 85 "Counter": "0,1,2,3",
@@ -70,36 +100,6 @@
70 "CounterHTOff": "0,1,2,3,4,5,6,7" 100 "CounterHTOff": "0,1,2,3,4,5,6,7"
71 }, 101 },
72 { 102 {
73 "PublicDescription": "Counts any demand and L1 HW prefetch data load requests to L2.",
74 "EventCode": "0x24",
75 "Counter": "0,1,2,3",
76 "UMask": "0x3",
77 "EventName": "L2_RQSTS.ALL_DEMAND_DATA_RD",
78 "SampleAfterValue": "200003",
79 "BriefDescription": "Demand Data Read requests",
80 "CounterHTOff": "0,1,2,3,4,5,6,7"
81 },
82 {
83 "PublicDescription": "Counts all L2 store RFO requests.",
84 "EventCode": "0x24",
85 "Counter": "0,1,2,3",
86 "UMask": "0xc",
87 "EventName": "L2_RQSTS.ALL_RFO",
88 "SampleAfterValue": "200003",
89 "BriefDescription": "RFO requests to L2 cache",
90 "CounterHTOff": "0,1,2,3,4,5,6,7"
91 },
92 {
93 "PublicDescription": "Counts all L2 code requests.",
94 "EventCode": "0x24",
95 "Counter": "0,1,2,3",
96 "UMask": "0x30",
97 "EventName": "L2_RQSTS.ALL_CODE_RD",
98 "SampleAfterValue": "200003",
99 "BriefDescription": "L2 code requests",
100 "CounterHTOff": "0,1,2,3,4,5,6,7"
101 },
102 {
103 "PublicDescription": "Counts all L2 HW prefetcher requests.", 103 "PublicDescription": "Counts all L2 HW prefetcher requests.",
104 "EventCode": "0x24", 104 "EventCode": "0x24",
105 "Counter": "0,1,2,3", 105 "Counter": "0,1,2,3",
@@ -219,6 +219,29 @@
219 "CounterHTOff": "2" 219 "CounterHTOff": "2"
220 }, 220 },
221 { 221 {
222 "PublicDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
223 "EventCode": "0x48",
224 "Counter": "2",
225 "UMask": "0x1",
226 "AnyThread": "1",
227 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
228 "SampleAfterValue": "2000003",
229 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core",
230 "CounterMask": "1",
231 "CounterHTOff": "2"
232 },
233 {
234 "PublicDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
235 "EventCode": "0x48",
236 "Counter": "0,1,2,3",
237 "UMask": "0x2",
238 "EventName": "L1D_PEND_MISS.FB_FULL",
239 "SampleAfterValue": "2000003",
240 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability",
241 "CounterMask": "1",
242 "CounterHTOff": "0,1,2,3,4,5,6,7"
243 },
244 {
222 "PublicDescription": "Counts the number of lines brought into the L1 data cache.", 245 "PublicDescription": "Counts the number of lines brought into the L1 data cache.",
223 "EventCode": "0x51", 246 "EventCode": "0x51",
224 "Counter": "0,1,2,3", 247 "Counter": "0,1,2,3",
@@ -239,76 +262,87 @@
239 "CounterHTOff": "0,1,2,3,4,5,6,7" 262 "CounterHTOff": "0,1,2,3,4,5,6,7"
240 }, 263 },
241 { 264 {
242 "PublicDescription": "Offcore outstanding Demand Code Read transactions in SQ to uncore. Set Cmask=1 to count cycles.", 265 "PublicDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
243 "EventCode": "0x60", 266 "EventCode": "0x60",
244 "Counter": "0,1,2,3", 267 "Counter": "0,1,2,3",
245 "UMask": "0x2", 268 "UMask": "0x1",
246 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", 269 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
247 "SampleAfterValue": "2000003", 270 "SampleAfterValue": "2000003",
248 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 271 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
272 "CounterMask": "1",
249 "CounterHTOff": "0,1,2,3,4,5,6,7" 273 "CounterHTOff": "0,1,2,3,4,5,6,7"
250 }, 274 },
251 { 275 {
252 "PublicDescription": "Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles.", 276 "PublicDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
253 "EventCode": "0x60", 277 "EventCode": "0x60",
254 "Counter": "0,1,2,3", 278 "Counter": "0,1,2,3",
255 "UMask": "0x4", 279 "UMask": "0x1",
256 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", 280 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
257 "SampleAfterValue": "2000003", 281 "SampleAfterValue": "2000003",
258 "BriefDescription": "Offcore outstanding RFO store transactions in SuperQueue (SQ), queue to uncore", 282 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue",
283 "CounterMask": "6",
259 "CounterHTOff": "0,1,2,3,4,5,6,7" 284 "CounterHTOff": "0,1,2,3,4,5,6,7"
260 }, 285 },
261 { 286 {
262 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.", 287 "PublicDescription": "Offcore outstanding Demand Code Read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
263 "EventCode": "0x60", 288 "EventCode": "0x60",
264 "Counter": "0,1,2,3", 289 "Counter": "0,1,2,3",
265 "UMask": "0x8", 290 "UMask": "0x2",
266 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", 291 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
267 "SampleAfterValue": "2000003", 292 "SampleAfterValue": "2000003",
268 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore", 293 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
269 "CounterHTOff": "0,1,2,3,4,5,6,7" 294 "CounterHTOff": "0,1,2,3,4,5,6,7"
270 }, 295 },
271 { 296 {
272 "PublicDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 297 "PublicDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
273 "EventCode": "0x60", 298 "EventCode": "0x60",
274 "Counter": "0,1,2,3", 299 "Counter": "0,1,2,3",
275 "UMask": "0x1", 300 "UMask": "0x2",
276 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD", 301 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD",
277 "SampleAfterValue": "2000003", 302 "SampleAfterValue": "2000003",
278 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore", 303 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
279 "CounterMask": "1", 304 "CounterMask": "1",
280 "CounterHTOff": "0,1,2,3,4,5,6,7" 305 "CounterHTOff": "0,1,2,3,4,5,6,7"
281 }, 306 },
282 { 307 {
283 "PublicDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.", 308 "PublicDescription": "Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles.",
284 "EventCode": "0x60", 309 "EventCode": "0x60",
285 "Counter": "0,1,2,3", 310 "Counter": "0,1,2,3",
286 "UMask": "0x8", 311 "UMask": "0x4",
287 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD", 312 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO",
288 "SampleAfterValue": "2000003", 313 "SampleAfterValue": "2000003",
289 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore", 314 "BriefDescription": "Offcore outstanding RFO store transactions in SuperQueue (SQ), queue to uncore",
290 "CounterMask": "1",
291 "CounterHTOff": "0,1,2,3,4,5,6,7" 315 "CounterHTOff": "0,1,2,3,4,5,6,7"
292 }, 316 },
293 { 317 {
294 "PublicDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle.", 318 "PublicDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.",
295 "EventCode": "0x60", 319 "EventCode": "0x60",
296 "Counter": "0,1,2,3", 320 "Counter": "0,1,2,3",
297 "UMask": "0x2", 321 "UMask": "0x4",
298 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD", 322 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
299 "SampleAfterValue": "2000003", 323 "SampleAfterValue": "2000003",
300 "BriefDescription": "Offcore outstanding code reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 324 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
301 "CounterMask": "1", 325 "CounterMask": "1",
302 "CounterHTOff": "0,1,2,3,4,5,6,7" 326 "CounterHTOff": "0,1,2,3,4,5,6,7"
303 }, 327 },
304 { 328 {
305 "PublicDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle.", 329 "PublicDescription": "Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles.",
306 "EventCode": "0x60", 330 "EventCode": "0x60",
307 "Counter": "0,1,2,3", 331 "Counter": "0,1,2,3",
308 "UMask": "0x4", 332 "UMask": "0x8",
309 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO", 333 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
310 "SampleAfterValue": "2000003", 334 "SampleAfterValue": "2000003",
311 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle", 335 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
336 "CounterHTOff": "0,1,2,3,4,5,6,7"
337 },
338 {
339 "PublicDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
340 "EventCode": "0x60",
341 "Counter": "0,1,2,3",
342 "UMask": "0x8",
343 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD",
344 "SampleAfterValue": "2000003",
345 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore",
312 "CounterMask": "1", 346 "CounterMask": "1",
313 "CounterHTOff": "0,1,2,3,4,5,6,7" 347 "CounterHTOff": "0,1,2,3,4,5,6,7"
314 }, 348 },
@@ -379,7 +413,7 @@
379 "UMask": "0x11", 413 "UMask": "0x11",
380 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS", 414 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_LOADS",
381 "SampleAfterValue": "100003", 415 "SampleAfterValue": "100003",
382 "BriefDescription": "Retired load uops that miss the STLB.", 416 "BriefDescription": "Retired load uops that miss the STLB. (Precise Event)",
383 "CounterHTOff": "0,1,2,3" 417 "CounterHTOff": "0,1,2,3"
384 }, 418 },
385 { 419 {
@@ -389,7 +423,7 @@
389 "UMask": "0x12", 423 "UMask": "0x12",
390 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES", 424 "EventName": "MEM_UOPS_RETIRED.STLB_MISS_STORES",
391 "SampleAfterValue": "100003", 425 "SampleAfterValue": "100003",
392 "BriefDescription": "Retired store uops that miss the STLB.", 426 "BriefDescription": "Retired store uops that miss the STLB. (Precise Event)",
393 "CounterHTOff": "0,1,2,3" 427 "CounterHTOff": "0,1,2,3"
394 }, 428 },
395 { 429 {
@@ -399,7 +433,7 @@
399 "UMask": "0x21", 433 "UMask": "0x21",
400 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS", 434 "EventName": "MEM_UOPS_RETIRED.LOCK_LOADS",
401 "SampleAfterValue": "100007", 435 "SampleAfterValue": "100007",
402 "BriefDescription": "Retired load uops with locked access.", 436 "BriefDescription": "Retired load uops with locked access. (Precise Event)",
403 "CounterHTOff": "0,1,2,3" 437 "CounterHTOff": "0,1,2,3"
404 }, 438 },
405 { 439 {
@@ -409,7 +443,7 @@
409 "UMask": "0x41", 443 "UMask": "0x41",
410 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS", 444 "EventName": "MEM_UOPS_RETIRED.SPLIT_LOADS",
411 "SampleAfterValue": "100003", 445 "SampleAfterValue": "100003",
412 "BriefDescription": "Retired load uops that split across a cacheline boundary.", 446 "BriefDescription": "Retired load uops that split across a cacheline boundary. (Precise Event)",
413 "CounterHTOff": "0,1,2,3" 447 "CounterHTOff": "0,1,2,3"
414 }, 448 },
415 { 449 {
@@ -419,7 +453,7 @@
419 "UMask": "0x42", 453 "UMask": "0x42",
420 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES", 454 "EventName": "MEM_UOPS_RETIRED.SPLIT_STORES",
421 "SampleAfterValue": "100003", 455 "SampleAfterValue": "100003",
422 "BriefDescription": "Retired store uops that split across a cacheline boundary.", 456 "BriefDescription": "Retired store uops that split across a cacheline boundary. (Precise Event)",
423 "CounterHTOff": "0,1,2,3" 457 "CounterHTOff": "0,1,2,3"
424 }, 458 },
425 { 459 {
@@ -429,7 +463,7 @@
429 "UMask": "0x81", 463 "UMask": "0x81",
430 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 464 "EventName": "MEM_UOPS_RETIRED.ALL_LOADS",
431 "SampleAfterValue": "2000003", 465 "SampleAfterValue": "2000003",
432 "BriefDescription": "All retired load uops.", 466 "BriefDescription": "All retired load uops. (Precise Event)",
433 "CounterHTOff": "0,1,2,3" 467 "CounterHTOff": "0,1,2,3"
434 }, 468 },
435 { 469 {
@@ -439,67 +473,61 @@
439 "UMask": "0x82", 473 "UMask": "0x82",
440 "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 474 "EventName": "MEM_UOPS_RETIRED.ALL_STORES",
441 "SampleAfterValue": "2000003", 475 "SampleAfterValue": "2000003",
442 "BriefDescription": "All retired store uops.", 476 "BriefDescription": "All retired store uops. (Precise Event)",
443 "CounterHTOff": "0,1,2,3" 477 "CounterHTOff": "0,1,2,3"
444 }, 478 },
445 { 479 {
446 "PEBS": "1", 480 "PEBS": "1",
447 "PublicDescription": "Retired load uops with L1 cache hits as data sources.",
448 "EventCode": "0xD1", 481 "EventCode": "0xD1",
449 "Counter": "0,1,2,3", 482 "Counter": "0,1,2,3",
450 "UMask": "0x1", 483 "UMask": "0x1",
451 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT", 484 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT",
452 "SampleAfterValue": "2000003", 485 "SampleAfterValue": "2000003",
453 "BriefDescription": "Retired load uops with L1 cache hits as data sources. ", 486 "BriefDescription": "Retired load uops with L1 cache hits as data sources.",
454 "CounterHTOff": "0,1,2,3" 487 "CounterHTOff": "0,1,2,3"
455 }, 488 },
456 { 489 {
457 "PEBS": "1", 490 "PEBS": "1",
458 "PublicDescription": "Retired load uops with L2 cache hits as data sources.",
459 "EventCode": "0xD1", 491 "EventCode": "0xD1",
460 "Counter": "0,1,2,3", 492 "Counter": "0,1,2,3",
461 "UMask": "0x2", 493 "UMask": "0x2",
462 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 494 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT",
463 "SampleAfterValue": "100003", 495 "SampleAfterValue": "100003",
464 "BriefDescription": "Retired load uops with L2 cache hits as data sources. ", 496 "BriefDescription": "Retired load uops with L2 cache hits as data sources.",
465 "CounterHTOff": "0,1,2,3" 497 "CounterHTOff": "0,1,2,3"
466 }, 498 },
467 { 499 {
468 "PEBS": "1", 500 "PEBS": "1",
469 "PublicDescription": "Retired load uops whose data source was LLC hit with no snoop required.",
470 "EventCode": "0xD1", 501 "EventCode": "0xD1",
471 "Counter": "0,1,2,3", 502 "Counter": "0,1,2,3",
472 "UMask": "0x4", 503 "UMask": "0x4",
473 "EventName": "MEM_LOAD_UOPS_RETIRED.LLC_HIT", 504 "EventName": "MEM_LOAD_UOPS_RETIRED.LLC_HIT",
474 "SampleAfterValue": "50021", 505 "SampleAfterValue": "50021",
475 "BriefDescription": "Retired load uops which data sources were data hits in LLC without snoops required. ", 506 "BriefDescription": "Retired load uops which data sources were data hits in LLC without snoops required.",
476 "CounterHTOff": "0,1,2,3" 507 "CounterHTOff": "0,1,2,3"
477 }, 508 },
478 { 509 {
479 "PEBS": "1", 510 "PEBS": "1",
480 "PublicDescription": "Retired load uops whose data source followed an L1 miss.",
481 "EventCode": "0xD1", 511 "EventCode": "0xD1",
482 "Counter": "0,1,2,3", 512 "Counter": "0,1,2,3",
483 "UMask": "0x8", 513 "UMask": "0x8",
484 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 514 "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS",
485 "SampleAfterValue": "100003", 515 "SampleAfterValue": "100003",
486 "BriefDescription": "Retired load uops which data sources following L1 data-cache miss", 516 "BriefDescription": "Retired load uops which data sources following L1 data-cache miss.",
487 "CounterHTOff": "0,1,2,3" 517 "CounterHTOff": "0,1,2,3"
488 }, 518 },
489 { 519 {
490 "PEBS": "1", 520 "PEBS": "1",
491 "PublicDescription": "Retired load uops that missed L2, excluding unknown sources.",
492 "EventCode": "0xD1", 521 "EventCode": "0xD1",
493 "Counter": "0,1,2,3", 522 "Counter": "0,1,2,3",
494 "UMask": "0x10", 523 "UMask": "0x10",
495 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 524 "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS",
496 "SampleAfterValue": "50021", 525 "SampleAfterValue": "50021",
497 "BriefDescription": "Miss in mid-level (L2) cache. Excludes Unknown data-source.", 526 "BriefDescription": "Retired load uops with L2 cache misses as data sources.",
498 "CounterHTOff": "0,1,2,3" 527 "CounterHTOff": "0,1,2,3"
499 }, 528 },
500 { 529 {
501 "PEBS": "1", 530 "PEBS": "1",
502 "PublicDescription": "Retired load uops whose data source is LLC miss.",
503 "EventCode": "0xD1", 531 "EventCode": "0xD1",
504 "Counter": "0,1,2,3", 532 "Counter": "0,1,2,3",
505 "UMask": "0x20", 533 "UMask": "0x20",
@@ -510,67 +538,61 @@
510 }, 538 },
511 { 539 {
512 "PEBS": "1", 540 "PEBS": "1",
513 "PublicDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.",
514 "EventCode": "0xD1", 541 "EventCode": "0xD1",
515 "Counter": "0,1,2,3", 542 "Counter": "0,1,2,3",
516 "UMask": "0x40", 543 "UMask": "0x40",
517 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB", 544 "EventName": "MEM_LOAD_UOPS_RETIRED.HIT_LFB",
518 "SampleAfterValue": "100003", 545 "SampleAfterValue": "100003",
519 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready. ", 546 "BriefDescription": "Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to the same cache line with data not ready.",
520 "CounterHTOff": "0,1,2,3" 547 "CounterHTOff": "0,1,2,3"
521 }, 548 },
522 { 549 {
523 "PEBS": "1", 550 "PEBS": "1",
524 "PublicDescription": "Retired load uops whose data source was an on-package core cache LLC hit and cross-core snoop missed.",
525 "EventCode": "0xD2", 551 "EventCode": "0xD2",
526 "Counter": "0,1,2,3", 552 "Counter": "0,1,2,3",
527 "UMask": "0x1", 553 "UMask": "0x1",
528 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS", 554 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS",
529 "SampleAfterValue": "20011", 555 "SampleAfterValue": "20011",
530 "BriefDescription": "Retired load uops which data sources were LLC hit and cross-core snoop missed in on-pkg core cache. ", 556 "BriefDescription": "Retired load uops which data sources were LLC hit and cross-core snoop missed in on-pkg core cache.",
531 "CounterHTOff": "0,1,2,3" 557 "CounterHTOff": "0,1,2,3"
532 }, 558 },
533 { 559 {
534 "PEBS": "1", 560 "PEBS": "1",
535 "PublicDescription": "Retired load uops whose data source was an on-package LLC hit and cross-core snoop hits.",
536 "EventCode": "0xD2", 561 "EventCode": "0xD2",
537 "Counter": "0,1,2,3", 562 "Counter": "0,1,2,3",
538 "UMask": "0x2", 563 "UMask": "0x2",
539 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT", 564 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT",
540 "SampleAfterValue": "20011", 565 "SampleAfterValue": "20011",
541 "BriefDescription": "Retired load uops which data sources were LLC and cross-core snoop hits in on-pkg core cache. ", 566 "BriefDescription": "Retired load uops which data sources were LLC and cross-core snoop hits in on-pkg core cache.",
542 "CounterHTOff": "0,1,2,3" 567 "CounterHTOff": "0,1,2,3"
543 }, 568 },
544 { 569 {
545 "PEBS": "1", 570 "PEBS": "1",
546 "PublicDescription": "Retired load uops whose data source was an on-package core cache with HitM responses.",
547 "EventCode": "0xD2", 571 "EventCode": "0xD2",
548 "Counter": "0,1,2,3", 572 "Counter": "0,1,2,3",
549 "UMask": "0x4", 573 "UMask": "0x4",
550 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM", 574 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM",
551 "SampleAfterValue": "20011", 575 "SampleAfterValue": "20011",
552 "BriefDescription": "Retired load uops which data sources were HitM responses from shared LLC. ", 576 "BriefDescription": "Retired load uops which data sources were HitM responses from shared LLC.",
553 "CounterHTOff": "0,1,2,3" 577 "CounterHTOff": "0,1,2,3"
554 }, 578 },
555 { 579 {
556 "PEBS": "1", 580 "PEBS": "1",
557 "PublicDescription": "Retired load uops whose data source was LLC hit with no snoop required.",
558 "EventCode": "0xD2", 581 "EventCode": "0xD2",
559 "Counter": "0,1,2,3", 582 "Counter": "0,1,2,3",
560 "UMask": "0x8", 583 "UMask": "0x8",
561 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", 584 "EventName": "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE",
562 "SampleAfterValue": "100003", 585 "SampleAfterValue": "100003",
563 "BriefDescription": "Retired load uops which data sources were hits in LLC without snoops required. ", 586 "BriefDescription": "Retired load uops which data sources were hits in LLC without snoops required.",
564 "CounterHTOff": "0,1,2,3" 587 "CounterHTOff": "0,1,2,3"
565 }, 588 },
566 { 589 {
567 "PublicDescription": "Retired load uop whose Data Source was: local DRAM either Snoop not needed or Snoop Miss (RspI)",
568 "EventCode": "0xD3", 590 "EventCode": "0xD3",
569 "Counter": "0,1,2,3", 591 "Counter": "0,1,2,3",
570 "UMask": "0x1", 592 "UMask": "0x3",
571 "EventName": "MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", 593 "EventName": "MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM",
572 "SampleAfterValue": "100007", 594 "SampleAfterValue": "100007",
573 "BriefDescription": "Retired load uops which data sources missed LLC but serviced from local dram.", 595 "BriefDescription": "Retired load uops whose data source was local DRAM (Snoop not needed, Snoop Miss, or Snoop Hit data not forwarded).",
574 "CounterHTOff": "0,1,2,3" 596 "CounterHTOff": "0,1,2,3"
575 }, 597 },
576 { 598 {
@@ -780,40 +802,6 @@
780 "CounterHTOff": "0,1,2,3,4,5,6,7" 802 "CounterHTOff": "0,1,2,3,4,5,6,7"
781 }, 803 },
782 { 804 {
783 "PublicDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
784 "EventCode": "0x60",
785 "Counter": "0,1,2,3",
786 "UMask": "0x1",
787 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
788 "SampleAfterValue": "2000003",
789 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue",
790 "CounterMask": "6",
791 "CounterHTOff": "0,1,2,3,4,5,6,7"
792 },
793 {
794 "PublicDescription": "Cycles with L1D load Misses outstanding from any thread on physical core.",
795 "EventCode": "0x48",
796 "Counter": "2",
797 "UMask": "0x1",
798 "AnyThread": "1",
799 "EventName": "L1D_PEND_MISS.PENDING_CYCLES_ANY",
800 "SampleAfterValue": "2000003",
801 "BriefDescription": "Cycles with L1D load Misses outstanding from any thread on physical core",
802 "CounterMask": "1",
803 "CounterHTOff": "2"
804 },
805 {
806 "PublicDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability.",
807 "EventCode": "0x48",
808 "Counter": "0,1,2,3",
809 "UMask": "0x2",
810 "EventName": "L1D_PEND_MISS.FB_FULL",
811 "SampleAfterValue": "2000003",
812 "BriefDescription": "Cycles a demand request was blocked due to Fill Buffers inavailability",
813 "CounterMask": "1",
814 "CounterHTOff": "0,1,2,3,4,5,6,7"
815 },
816 {
817 "EventCode": "0xB7, 0xBB", 805 "EventCode": "0xB7, 0xBB",
818 "MSRValue": "0x4003c0091", 806 "MSRValue": "0x4003c0091",
819 "Counter": "0,1,2,3", 807 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/frontend.json b/tools/perf/pmu-events/arch/x86/ivytown/frontend.json
index de72b84b3536..efaa949ead31 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/frontend.json
@@ -20,76 +20,45 @@
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.", 23 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.",
24 "EventCode": "0x79",
25 "Counter": "0,1,2,3",
26 "UMask": "0x8",
27 "EventName": "IDQ.DSB_UOPS",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 },
32 {
33 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
34 "EventCode": "0x79",
35 "Counter": "0,1,2,3",
36 "UMask": "0x10",
37 "EventName": "IDQ.MS_DSB_UOPS",
38 "SampleAfterValue": "2000003",
39 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 },
42 {
43 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
44 "EventCode": "0x79",
45 "Counter": "0,1,2,3",
46 "UMask": "0x20",
47 "EventName": "IDQ.MS_MITE_UOPS",
48 "SampleAfterValue": "2000003",
49 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
53 "PublicDescription": "Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles.",
54 "EventCode": "0x79", 24 "EventCode": "0x79",
55 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
56 "UMask": "0x30", 26 "UMask": "0x4",
57 "EventName": "IDQ.MS_UOPS", 27 "EventName": "IDQ.MITE_CYCLES",
58 "SampleAfterValue": "2000003", 28 "SampleAfterValue": "2000003",
59 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 29 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path",
30 "CounterMask": "1",
60 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 }, 32 },
62 { 33 {
63 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy.", 34 "PublicDescription": "Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles.",
64 "EventCode": "0x79", 35 "EventCode": "0x79",
65 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
66 "UMask": "0x30", 37 "UMask": "0x8",
67 "EventName": "IDQ.MS_CYCLES", 38 "EventName": "IDQ.DSB_UOPS",
68 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
69 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 40 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
70 "CounterMask": "1",
71 "CounterHTOff": "0,1,2,3,4,5,6,7" 41 "CounterHTOff": "0,1,2,3,4,5,6,7"
72 }, 42 },
73 { 43 {
74 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path.", 44 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.",
75 "EventCode": "0x79", 45 "EventCode": "0x79",
76 "Counter": "0,1,2,3", 46 "Counter": "0,1,2,3",
77 "UMask": "0x4", 47 "UMask": "0x8",
78 "EventName": "IDQ.MITE_CYCLES", 48 "EventName": "IDQ.DSB_CYCLES",
79 "SampleAfterValue": "2000003", 49 "SampleAfterValue": "2000003",
80 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path", 50 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path",
81 "CounterMask": "1", 51 "CounterMask": "1",
82 "CounterHTOff": "0,1,2,3,4,5,6,7" 52 "CounterHTOff": "0,1,2,3,4,5,6,7"
83 }, 53 },
84 { 54 {
85 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path.", 55 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set Cmask = 1 to count cycles. Add Edge=1 to count # of delivery.",
86 "EventCode": "0x79", 56 "EventCode": "0x79",
87 "Counter": "0,1,2,3", 57 "Counter": "0,1,2,3",
88 "UMask": "0x8", 58 "UMask": "0x10",
89 "EventName": "IDQ.DSB_CYCLES", 59 "EventName": "IDQ.MS_DSB_UOPS",
90 "SampleAfterValue": "2000003", 60 "SampleAfterValue": "2000003",
91 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path", 61 "BriefDescription": "Uops initiated by Decode Stream Buffer (DSB) that are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
92 "CounterMask": "1",
93 "CounterHTOff": "0,1,2,3,4,5,6,7" 62 "CounterHTOff": "0,1,2,3,4,5,6,7"
94 }, 63 },
95 { 64 {
@@ -138,6 +107,16 @@
138 "CounterHTOff": "0,1,2,3,4,5,6,7" 107 "CounterHTOff": "0,1,2,3,4,5,6,7"
139 }, 108 },
140 { 109 {
110 "PublicDescription": "Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set Cmask = 1 to count cycles.",
111 "EventCode": "0x79",
112 "Counter": "0,1,2,3",
113 "UMask": "0x20",
114 "EventName": "IDQ.MS_MITE_UOPS",
115 "SampleAfterValue": "2000003",
116 "BriefDescription": "Uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
117 "CounterHTOff": "0,1,2,3,4,5,6,7"
118 },
119 {
141 "PublicDescription": "Counts cycles MITE is delivered four uops. Set Cmask = 4.", 120 "PublicDescription": "Counts cycles MITE is delivered four uops. Set Cmask = 4.",
142 "EventCode": "0x79", 121 "EventCode": "0x79",
143 "Counter": "0,1,2,3", 122 "Counter": "0,1,2,3",
@@ -160,6 +139,39 @@
160 "CounterHTOff": "0,1,2,3,4,5,6,7" 139 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 }, 140 },
162 { 141 {
142 "PublicDescription": "Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles.",
143 "EventCode": "0x79",
144 "Counter": "0,1,2,3",
145 "UMask": "0x30",
146 "EventName": "IDQ.MS_UOPS",
147 "SampleAfterValue": "2000003",
148 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
149 "CounterHTOff": "0,1,2,3,4,5,6,7"
150 },
151 {
152 "PublicDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy.",
153 "EventCode": "0x79",
154 "Counter": "0,1,2,3",
155 "UMask": "0x30",
156 "EventName": "IDQ.MS_CYCLES",
157 "SampleAfterValue": "2000003",
158 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
159 "CounterMask": "1",
160 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 },
162 {
163 "PublicDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
164 "EventCode": "0x79",
165 "Counter": "0,1,2,3",
166 "UMask": "0x30",
167 "EdgeDetect": "1",
168 "EventName": "IDQ.MS_SWITCHES",
169 "SampleAfterValue": "2000003",
170 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer",
171 "CounterMask": "1",
172 "CounterHTOff": "0,1,2,3,4,5,6,7"
173 },
174 {
163 "PublicDescription": "Number of uops delivered to IDQ from any path.", 175 "PublicDescription": "Number of uops delivered to IDQ from any path.",
164 "EventCode": "0x79", 176 "EventCode": "0x79",
165 "Counter": "0,1,2,3", 177 "Counter": "0,1,2,3",
@@ -206,7 +218,7 @@
206 "UMask": "0x1", 218 "UMask": "0x1",
207 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE", 219 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE",
208 "SampleAfterValue": "2000003", 220 "SampleAfterValue": "2000003",
209 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled ", 221 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled",
210 "CounterHTOff": "0,1,2,3" 222 "CounterHTOff": "0,1,2,3"
211 }, 223 },
212 { 224 {
@@ -289,17 +301,5 @@
289 "SampleAfterValue": "2000003", 301 "SampleAfterValue": "2000003",
290 "BriefDescription": "Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB) lines", 302 "BriefDescription": "Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB) lines",
291 "CounterHTOff": "0,1,2,3,4,5,6,7" 303 "CounterHTOff": "0,1,2,3,4,5,6,7"
292 },
293 {
294 "PublicDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
295 "EventCode": "0x79",
296 "Counter": "0,1,2,3",
297 "UMask": "0x30",
298 "EdgeDetect": "1",
299 "EventName": "IDQ.MS_SWITCHES",
300 "SampleAfterValue": "2000003",
301 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer",
302 "CounterMask": "1",
303 "CounterHTOff": "0,1,2,3,4,5,6,7"
304 } 304 }
305] \ No newline at end of file 305] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/memory.json b/tools/perf/pmu-events/arch/x86/ivytown/memory.json
index 437d98f3e344..3a7b86af8816 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/memory.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/memory.json
@@ -30,18 +30,6 @@
30 }, 30 },
31 { 31 {
32 "PEBS": "2", 32 "PEBS": "2",
33 "EventCode": "0xCD",
34 "Counter": "3",
35 "UMask": "0x2",
36 "EventName": "MEM_TRANS_RETIRED.PRECISE_STORE",
37 "SampleAfterValue": "2000003",
38 "BriefDescription": "Sample stores and collect precise store operation via PEBS record. PMC3 only.",
39 "PRECISE_STORE": "1",
40 "TakenAlone": "1",
41 "CounterHTOff": "3"
42 },
43 {
44 "PEBS": "2",
45 "PublicDescription": "Loads with latency value being above 4.", 33 "PublicDescription": "Loads with latency value being above 4.",
46 "EventCode": "0xCD", 34 "EventCode": "0xCD",
47 "MSRValue": "0x4", 35 "MSRValue": "0x4",
@@ -153,6 +141,18 @@
153 "CounterHTOff": "3" 141 "CounterHTOff": "3"
154 }, 142 },
155 { 143 {
144 "PEBS": "2",
145 "EventCode": "0xCD",
146 "Counter": "3",
147 "UMask": "0x2",
148 "EventName": "MEM_TRANS_RETIRED.PRECISE_STORE",
149 "SampleAfterValue": "2000003",
150 "BriefDescription": "Sample stores and collect precise store operation via PEBS record. PMC3 only.",
151 "PRECISE_STORE": "1",
152 "TakenAlone": "1",
153 "CounterHTOff": "3"
154 },
155 {
156 "EventCode": "0xB7, 0xBB", 156 "EventCode": "0xB7, 0xBB",
157 "MSRValue": "0x3fffc00244", 157 "MSRValue": "0x3fffc00244",
158 "Counter": "0,1,2,3", 158 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/other.json b/tools/perf/pmu-events/arch/x86/ivytown/other.json
index 9c2dd0511a32..4eb83ee40412 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/other.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/other.json
@@ -10,16 +10,6 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
14 "EventCode": "0x5C",
15 "Counter": "0,1,2,3",
16 "UMask": "0x2",
17 "EventName": "CPL_CYCLES.RING123",
18 "SampleAfterValue": "2000003",
19 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 },
22 {
23 "PublicDescription": "Number of intervals between processor halts while thread is in ring 0.", 13 "PublicDescription": "Number of intervals between processor halts while thread is in ring 0.",
24 "EventCode": "0x5C", 14 "EventCode": "0x5C",
25 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
@@ -32,6 +22,16 @@
32 "CounterHTOff": "0,1,2,3,4,5,6,7" 22 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 }, 23 },
34 { 24 {
25 "PublicDescription": "Unhalted core cycles when the thread is not in ring 0.",
26 "EventCode": "0x5C",
27 "Counter": "0,1,2,3",
28 "UMask": "0x2",
29 "EventName": "CPL_CYCLES.RING123",
30 "SampleAfterValue": "2000003",
31 "BriefDescription": "Unhalted core cycles when thread is in rings 1, 2, or 3",
32 "CounterHTOff": "0,1,2,3,4,5,6,7"
33 },
34 {
35 "PublicDescription": "Cycles in which the L1D and L2 are locked, due to a UC lock or split lock.", 35 "PublicDescription": "Cycles in which the L1D and L2 are locked, due to a UC lock or split lock.",
36 "EventCode": "0x63", 36 "EventCode": "0x63",
37 "Counter": "0,1,2,3", 37 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/pipeline.json b/tools/perf/pmu-events/arch/x86/ivytown/pipeline.json
index 2145c28193f7..0afbfd95ea30 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/pipeline.json
@@ -1,30 +1,41 @@
1[ 1[
2 { 2 {
3 "EventCode": "0x00", 3 "EventCode": "0x00",
4 "Counter": "Fixed counter 1", 4 "Counter": "Fixed counter 0",
5 "UMask": "0x1", 5 "UMask": "0x1",
6 "EventName": "INST_RETIRED.ANY", 6 "EventName": "INST_RETIRED.ANY",
7 "SampleAfterValue": "2000003", 7 "SampleAfterValue": "2000003",
8 "BriefDescription": "Instructions retired from execution.", 8 "BriefDescription": "Instructions retired from execution.",
9 "CounterHTOff": "Fixed counter 1" 9 "CounterHTOff": "Fixed counter 0"
10 }, 10 },
11 { 11 {
12 "EventCode": "0x00", 12 "EventCode": "0x00",
13 "Counter": "Fixed counter 2", 13 "Counter": "Fixed counter 1",
14 "UMask": "0x2", 14 "UMask": "0x2",
15 "EventName": "CPU_CLK_UNHALTED.THREAD", 15 "EventName": "CPU_CLK_UNHALTED.THREAD",
16 "SampleAfterValue": "2000003", 16 "SampleAfterValue": "2000003",
17 "BriefDescription": "Core cycles when the thread is not in halt state.", 17 "BriefDescription": "Core cycles when the thread is not in halt state.",
18 "CounterHTOff": "Fixed counter 2" 18 "CounterHTOff": "Fixed counter 1"
19 }, 19 },
20 { 20 {
21 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
21 "EventCode": "0x00", 22 "EventCode": "0x00",
22 "Counter": "Fixed counter 3", 23 "Counter": "Fixed counter 1",
24 "UMask": "0x2",
25 "AnyThread": "1",
26 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
27 "SampleAfterValue": "2000003",
28 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
29 "CounterHTOff": "Fixed counter 1"
30 },
31 {
32 "EventCode": "0x00",
33 "Counter": "Fixed counter 2",
23 "UMask": "0x3", 34 "UMask": "0x3",
24 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 35 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
25 "SampleAfterValue": "2000003", 36 "SampleAfterValue": "2000003",
26 "BriefDescription": "Reference cycles when the core is not in halt state.", 37 "BriefDescription": "Reference cycles when the core is not in halt state.",
27 "CounterHTOff": "Fixed counter 3" 38 "CounterHTOff": "Fixed counter 2"
28 }, 39 },
29 { 40 {
30 "PublicDescription": "Loads blocked by overlapping with store buffer that cannot be forwarded.", 41 "PublicDescription": "Loads blocked by overlapping with store buffer that cannot be forwarded.",
@@ -78,6 +89,17 @@
78 "CounterHTOff": "0,1,2,3,4,5,6,7" 89 "CounterHTOff": "0,1,2,3,4,5,6,7"
79 }, 90 },
80 { 91 {
92 "EventCode": "0x0D",
93 "Counter": "0,1,2,3",
94 "UMask": "0x3",
95 "AnyThread": "1",
96 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
97 "SampleAfterValue": "2000003",
98 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
99 "CounterMask": "1",
100 "CounterHTOff": "0,1,2,3,4,5,6,7"
101 },
102 {
81 "PublicDescription": "Increments each cycle the # of Uops issued by the RAT to RS. Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core.", 103 "PublicDescription": "Increments each cycle the # of Uops issued by the RAT to RS. Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core.",
82 "EventCode": "0x0E", 104 "EventCode": "0x0E",
83 "Counter": "0,1,2,3", 105 "Counter": "0,1,2,3",
@@ -175,6 +197,17 @@
175 "CounterHTOff": "0,1,2,3,4,5,6,7" 197 "CounterHTOff": "0,1,2,3,4,5,6,7"
176 }, 198 },
177 { 199 {
200 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
201 "EventCode": "0x3C",
202 "Counter": "0,1,2,3",
203 "UMask": "0x0",
204 "AnyThread": "1",
205 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
206 "SampleAfterValue": "2000003",
207 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
208 "CounterHTOff": "0,1,2,3,4,5,6,7"
209 },
210 {
178 "PublicDescription": "Increments at the frequency of XCLK (100 MHz) when not halted.", 211 "PublicDescription": "Increments at the frequency of XCLK (100 MHz) when not halted.",
179 "EventCode": "0x3C", 212 "EventCode": "0x3C",
180 "Counter": "0,1,2,3", 213 "Counter": "0,1,2,3",
@@ -187,6 +220,36 @@
187 { 220 {
188 "EventCode": "0x3C", 221 "EventCode": "0x3C",
189 "Counter": "0,1,2,3", 222 "Counter": "0,1,2,3",
223 "UMask": "0x1",
224 "AnyThread": "1",
225 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
226 "SampleAfterValue": "2000003",
227 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
228 "CounterHTOff": "0,1,2,3,4,5,6,7"
229 },
230 {
231 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
232 "EventCode": "0x3C",
233 "Counter": "0,1,2,3",
234 "UMask": "0x1",
235 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
236 "SampleAfterValue": "2000003",
237 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
238 "CounterHTOff": "0,1,2,3,4,5,6,7"
239 },
240 {
241 "EventCode": "0x3C",
242 "Counter": "0,1,2,3",
243 "UMask": "0x1",
244 "AnyThread": "1",
245 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
246 "SampleAfterValue": "2000003",
247 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
248 "CounterHTOff": "0,1,2,3,4,5,6,7"
249 },
250 {
251 "EventCode": "0x3C",
252 "Counter": "0,1,2,3",
190 "UMask": "0x2", 253 "UMask": "0x2",
191 "EventName": "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE", 254 "EventName": "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE",
192 "SampleAfterValue": "2000003", 255 "SampleAfterValue": "2000003",
@@ -194,6 +257,15 @@
194 "CounterHTOff": "0,1,2,3" 257 "CounterHTOff": "0,1,2,3"
195 }, 258 },
196 { 259 {
260 "EventCode": "0x3C",
261 "Counter": "0,1,2,3",
262 "UMask": "0x2",
263 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
264 "SampleAfterValue": "2000003",
265 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
266 "CounterHTOff": "0,1,2,3,4,5,6,7"
267 },
268 {
197 "PublicDescription": "Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.", 269 "PublicDescription": "Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.",
198 "EventCode": "0x4C", 270 "EventCode": "0x4C",
199 "Counter": "0,1,2,3", 271 "Counter": "0,1,2,3",
@@ -216,37 +288,37 @@
216 { 288 {
217 "EventCode": "0x58", 289 "EventCode": "0x58",
218 "Counter": "0,1,2,3", 290 "Counter": "0,1,2,3",
219 "UMask": "0x4", 291 "UMask": "0x1",
220 "EventName": "MOVE_ELIMINATION.INT_NOT_ELIMINATED", 292 "EventName": "MOVE_ELIMINATION.INT_ELIMINATED",
221 "SampleAfterValue": "1000003", 293 "SampleAfterValue": "1000003",
222 "BriefDescription": "Number of integer Move Elimination candidate uops that were not eliminated.", 294 "BriefDescription": "Number of integer Move Elimination candidate uops that were eliminated.",
223 "CounterHTOff": "0,1,2,3,4,5,6,7" 295 "CounterHTOff": "0,1,2,3,4,5,6,7"
224 }, 296 },
225 { 297 {
226 "EventCode": "0x58", 298 "EventCode": "0x58",
227 "Counter": "0,1,2,3", 299 "Counter": "0,1,2,3",
228 "UMask": "0x8", 300 "UMask": "0x2",
229 "EventName": "MOVE_ELIMINATION.SIMD_NOT_ELIMINATED", 301 "EventName": "MOVE_ELIMINATION.SIMD_ELIMINATED",
230 "SampleAfterValue": "1000003", 302 "SampleAfterValue": "1000003",
231 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were not eliminated.", 303 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were eliminated.",
232 "CounterHTOff": "0,1,2,3,4,5,6,7" 304 "CounterHTOff": "0,1,2,3,4,5,6,7"
233 }, 305 },
234 { 306 {
235 "EventCode": "0x58", 307 "EventCode": "0x58",
236 "Counter": "0,1,2,3", 308 "Counter": "0,1,2,3",
237 "UMask": "0x1", 309 "UMask": "0x4",
238 "EventName": "MOVE_ELIMINATION.INT_ELIMINATED", 310 "EventName": "MOVE_ELIMINATION.INT_NOT_ELIMINATED",
239 "SampleAfterValue": "1000003", 311 "SampleAfterValue": "1000003",
240 "BriefDescription": "Number of integer Move Elimination candidate uops that were eliminated.", 312 "BriefDescription": "Number of integer Move Elimination candidate uops that were not eliminated.",
241 "CounterHTOff": "0,1,2,3,4,5,6,7" 313 "CounterHTOff": "0,1,2,3,4,5,6,7"
242 }, 314 },
243 { 315 {
244 "EventCode": "0x58", 316 "EventCode": "0x58",
245 "Counter": "0,1,2,3", 317 "Counter": "0,1,2,3",
246 "UMask": "0x2", 318 "UMask": "0x8",
247 "EventName": "MOVE_ELIMINATION.SIMD_ELIMINATED", 319 "EventName": "MOVE_ELIMINATION.SIMD_NOT_ELIMINATED",
248 "SampleAfterValue": "1000003", 320 "SampleAfterValue": "1000003",
249 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were eliminated.", 321 "BriefDescription": "Number of SIMD Move Elimination candidate uops that were not eliminated.",
250 "CounterHTOff": "0,1,2,3,4,5,6,7" 322 "CounterHTOff": "0,1,2,3,4,5,6,7"
251 }, 323 },
252 { 324 {
@@ -260,6 +332,18 @@
260 "CounterHTOff": "0,1,2,3,4,5,6,7" 332 "CounterHTOff": "0,1,2,3,4,5,6,7"
261 }, 333 },
262 { 334 {
335 "EventCode": "0x5E",
336 "Invert": "1",
337 "Counter": "0,1,2,3",
338 "UMask": "0x1",
339 "EdgeDetect": "1",
340 "EventName": "RS_EVENTS.EMPTY_END",
341 "SampleAfterValue": "200003",
342 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
343 "CounterMask": "1",
344 "CounterHTOff": "0,1,2,3,4,5,6,7"
345 },
346 {
263 "EventCode": "0x87", 347 "EventCode": "0x87",
264 "Counter": "0,1,2,3", 348 "Counter": "0,1,2,3",
265 "UMask": "0x1", 349 "UMask": "0x1",
@@ -498,118 +582,118 @@
498 "CounterHTOff": "0,1,2,3,4,5,6,7" 582 "CounterHTOff": "0,1,2,3,4,5,6,7"
499 }, 583 },
500 { 584 {
501 "PublicDescription": "Cycles which a Uop is dispatched on port 1.", 585 "PublicDescription": "Cycles per core when uops are dispatched to port 0.",
502 "EventCode": "0xA1", 586 "EventCode": "0xA1",
503 "Counter": "0,1,2,3", 587 "Counter": "0,1,2,3",
504 "UMask": "0x2", 588 "UMask": "0x1",
505 "EventName": "UOPS_DISPATCHED_PORT.PORT_1", 589 "AnyThread": "1",
590 "EventName": "UOPS_DISPATCHED_PORT.PORT_0_CORE",
506 "SampleAfterValue": "2000003", 591 "SampleAfterValue": "2000003",
507 "BriefDescription": "Cycles per thread when uops are dispatched to port 1", 592 "BriefDescription": "Cycles per core when uops are dispatched to port 0",
508 "CounterHTOff": "0,1,2,3,4,5,6,7" 593 "CounterHTOff": "0,1,2,3,4,5,6,7"
509 }, 594 },
510 { 595 {
511 "PublicDescription": "Cycles which a Uop is dispatched on port 4.", 596 "PublicDescription": "Cycles which a Uop is dispatched on port 1.",
512 "EventCode": "0xA1", 597 "EventCode": "0xA1",
513 "Counter": "0,1,2,3", 598 "Counter": "0,1,2,3",
514 "UMask": "0x40", 599 "UMask": "0x2",
515 "EventName": "UOPS_DISPATCHED_PORT.PORT_4", 600 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
516 "SampleAfterValue": "2000003", 601 "SampleAfterValue": "2000003",
517 "BriefDescription": "Cycles per thread when uops are dispatched to port 4", 602 "BriefDescription": "Cycles per thread when uops are dispatched to port 1",
518 "CounterHTOff": "0,1,2,3,4,5,6,7" 603 "CounterHTOff": "0,1,2,3,4,5,6,7"
519 }, 604 },
520 { 605 {
521 "PublicDescription": "Cycles which a Uop is dispatched on port 5.", 606 "PublicDescription": "Cycles per core when uops are dispatched to port 1.",
522 "EventCode": "0xA1", 607 "EventCode": "0xA1",
523 "Counter": "0,1,2,3", 608 "Counter": "0,1,2,3",
524 "UMask": "0x80", 609 "UMask": "0x2",
525 "EventName": "UOPS_DISPATCHED_PORT.PORT_5", 610 "AnyThread": "1",
611 "EventName": "UOPS_DISPATCHED_PORT.PORT_1_CORE",
526 "SampleAfterValue": "2000003", 612 "SampleAfterValue": "2000003",
527 "BriefDescription": "Cycles per thread when uops are dispatched to port 5", 613 "BriefDescription": "Cycles per core when uops are dispatched to port 1",
528 "CounterHTOff": "0,1,2,3,4,5,6,7" 614 "CounterHTOff": "0,1,2,3,4,5,6,7"
529 }, 615 },
530 { 616 {
531 "PublicDescription": "Cycles per core when uops are dispatched to port 0.", 617 "PublicDescription": "Cycles which a Uop is dispatched on port 2.",
532 "EventCode": "0xA1", 618 "EventCode": "0xA1",
533 "Counter": "0,1,2,3", 619 "Counter": "0,1,2,3",
534 "UMask": "0x1", 620 "UMask": "0xc",
535 "AnyThread": "1", 621 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
536 "EventName": "UOPS_DISPATCHED_PORT.PORT_0_CORE",
537 "SampleAfterValue": "2000003", 622 "SampleAfterValue": "2000003",
538 "BriefDescription": "Cycles per core when uops are dispatched to port 0", 623 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 2",
539 "CounterHTOff": "0,1,2,3,4,5,6,7" 624 "CounterHTOff": "0,1,2,3,4,5,6,7"
540 }, 625 },
541 { 626 {
542 "PublicDescription": "Cycles per core when uops are dispatched to port 1.",
543 "EventCode": "0xA1", 627 "EventCode": "0xA1",
544 "Counter": "0,1,2,3", 628 "Counter": "0,1,2,3",
545 "UMask": "0x2", 629 "UMask": "0xc",
546 "AnyThread": "1", 630 "AnyThread": "1",
547 "EventName": "UOPS_DISPATCHED_PORT.PORT_1_CORE", 631 "EventName": "UOPS_DISPATCHED_PORT.PORT_2_CORE",
548 "SampleAfterValue": "2000003", 632 "SampleAfterValue": "2000003",
549 "BriefDescription": "Cycles per core when uops are dispatched to port 1", 633 "BriefDescription": "Uops dispatched to port 2, loads and stores per core (speculative and retired).",
550 "CounterHTOff": "0,1,2,3,4,5,6,7" 634 "CounterHTOff": "0,1,2,3,4,5,6,7"
551 }, 635 },
552 { 636 {
553 "PublicDescription": "Cycles per core when uops are dispatched to port 4.", 637 "PublicDescription": "Cycles which a Uop is dispatched on port 3.",
554 "EventCode": "0xA1", 638 "EventCode": "0xA1",
555 "Counter": "0,1,2,3", 639 "Counter": "0,1,2,3",
556 "UMask": "0x40", 640 "UMask": "0x30",
557 "AnyThread": "1", 641 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
558 "EventName": "UOPS_DISPATCHED_PORT.PORT_4_CORE",
559 "SampleAfterValue": "2000003", 642 "SampleAfterValue": "2000003",
560 "BriefDescription": "Cycles per core when uops are dispatched to port 4", 643 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 3",
561 "CounterHTOff": "0,1,2,3,4,5,6,7" 644 "CounterHTOff": "0,1,2,3,4,5,6,7"
562 }, 645 },
563 { 646 {
564 "PublicDescription": "Cycles per core when uops are dispatched to port 5.", 647 "PublicDescription": "Cycles per core when load or STA uops are dispatched to port 3.",
565 "EventCode": "0xA1", 648 "EventCode": "0xA1",
566 "Counter": "0,1,2,3", 649 "Counter": "0,1,2,3",
567 "UMask": "0x80", 650 "UMask": "0x30",
568 "AnyThread": "1", 651 "AnyThread": "1",
569 "EventName": "UOPS_DISPATCHED_PORT.PORT_5_CORE", 652 "EventName": "UOPS_DISPATCHED_PORT.PORT_3_CORE",
570 "SampleAfterValue": "2000003", 653 "SampleAfterValue": "2000003",
571 "BriefDescription": "Cycles per core when uops are dispatched to port 5", 654 "BriefDescription": "Cycles per core when load or STA uops are dispatched to port 3",
572 "CounterHTOff": "0,1,2,3,4,5,6,7" 655 "CounterHTOff": "0,1,2,3,4,5,6,7"
573 }, 656 },
574 { 657 {
575 "PublicDescription": "Cycles which a Uop is dispatched on port 2.", 658 "PublicDescription": "Cycles which a Uop is dispatched on port 4.",
576 "EventCode": "0xA1", 659 "EventCode": "0xA1",
577 "Counter": "0,1,2,3", 660 "Counter": "0,1,2,3",
578 "UMask": "0xc", 661 "UMask": "0x40",
579 "EventName": "UOPS_DISPATCHED_PORT.PORT_2", 662 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
580 "SampleAfterValue": "2000003", 663 "SampleAfterValue": "2000003",
581 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 2", 664 "BriefDescription": "Cycles per thread when uops are dispatched to port 4",
582 "CounterHTOff": "0,1,2,3,4,5,6,7" 665 "CounterHTOff": "0,1,2,3,4,5,6,7"
583 }, 666 },
584 { 667 {
585 "PublicDescription": "Cycles which a Uop is dispatched on port 3.", 668 "PublicDescription": "Cycles per core when uops are dispatched to port 4.",
586 "EventCode": "0xA1", 669 "EventCode": "0xA1",
587 "Counter": "0,1,2,3", 670 "Counter": "0,1,2,3",
588 "UMask": "0x30", 671 "UMask": "0x40",
589 "EventName": "UOPS_DISPATCHED_PORT.PORT_3", 672 "AnyThread": "1",
673 "EventName": "UOPS_DISPATCHED_PORT.PORT_4_CORE",
590 "SampleAfterValue": "2000003", 674 "SampleAfterValue": "2000003",
591 "BriefDescription": "Cycles per thread when load or STA uops are dispatched to port 3", 675 "BriefDescription": "Cycles per core when uops are dispatched to port 4",
592 "CounterHTOff": "0,1,2,3,4,5,6,7" 676 "CounterHTOff": "0,1,2,3,4,5,6,7"
593 }, 677 },
594 { 678 {
679 "PublicDescription": "Cycles which a Uop is dispatched on port 5.",
595 "EventCode": "0xA1", 680 "EventCode": "0xA1",
596 "Counter": "0,1,2,3", 681 "Counter": "0,1,2,3",
597 "UMask": "0xc", 682 "UMask": "0x80",
598 "AnyThread": "1", 683 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
599 "EventName": "UOPS_DISPATCHED_PORT.PORT_2_CORE",
600 "SampleAfterValue": "2000003", 684 "SampleAfterValue": "2000003",
601 "BriefDescription": "Uops dispatched to port 2, loads and stores per core (speculative and retired).", 685 "BriefDescription": "Cycles per thread when uops are dispatched to port 5",
602 "CounterHTOff": "0,1,2,3,4,5,6,7" 686 "CounterHTOff": "0,1,2,3,4,5,6,7"
603 }, 687 },
604 { 688 {
605 "PublicDescription": "Cycles per core when load or STA uops are dispatched to port 3.", 689 "PublicDescription": "Cycles per core when uops are dispatched to port 5.",
606 "EventCode": "0xA1", 690 "EventCode": "0xA1",
607 "Counter": "0,1,2,3", 691 "Counter": "0,1,2,3",
608 "UMask": "0x30", 692 "UMask": "0x80",
609 "AnyThread": "1", 693 "AnyThread": "1",
610 "EventName": "UOPS_DISPATCHED_PORT.PORT_3_CORE", 694 "EventName": "UOPS_DISPATCHED_PORT.PORT_5_CORE",
611 "SampleAfterValue": "2000003", 695 "SampleAfterValue": "2000003",
612 "BriefDescription": "Cycles per core when load or STA uops are dispatched to port 3", 696 "BriefDescription": "Cycles per core when uops are dispatched to port 5",
613 "CounterHTOff": "0,1,2,3,4,5,6,7" 697 "CounterHTOff": "0,1,2,3,4,5,6,7"
614 }, 698 },
615 { 699 {
@@ -662,15 +746,14 @@
662 "CounterHTOff": "0,1,2,3,4,5,6,7" 746 "CounterHTOff": "0,1,2,3,4,5,6,7"
663 }, 747 },
664 { 748 {
665 "PublicDescription": "Cycles with pending L1 cache miss loads. Set AnyThread to count per core.",
666 "EventCode": "0xA3", 749 "EventCode": "0xA3",
667 "Counter": "2", 750 "Counter": "0,1,2,3",
668 "UMask": "0x8", 751 "UMask": "0x1",
669 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING", 752 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
670 "SampleAfterValue": "2000003", 753 "SampleAfterValue": "2000003",
671 "BriefDescription": "Cycles with pending L1 cache miss loads.", 754 "BriefDescription": "Cycles while L2 cache miss load* is outstanding.",
672 "CounterMask": "8", 755 "CounterMask": "1",
673 "CounterHTOff": "2" 756 "CounterHTOff": "0,1,2,3,4,5,6,7"
674 }, 757 },
675 { 758 {
676 "PublicDescription": "Cycles with pending memory loads. Set AnyThread to count per core.", 759 "PublicDescription": "Cycles with pending memory loads. Set AnyThread to count per core.",
@@ -684,13 +767,33 @@
684 "CounterHTOff": "0,1,2,3" 767 "CounterHTOff": "0,1,2,3"
685 }, 768 },
686 { 769 {
770 "EventCode": "0xA3",
771 "Counter": "0,1,2,3",
772 "UMask": "0x2",
773 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
774 "SampleAfterValue": "2000003",
775 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
776 "CounterMask": "2",
777 "CounterHTOff": "0,1,2,3"
778 },
779 {
687 "PublicDescription": "Total execution stalls.", 780 "PublicDescription": "Total execution stalls.",
688 "EventCode": "0xA3", 781 "EventCode": "0xA3",
689 "Counter": "0,1,2,3", 782 "Counter": "0,1,2,3",
690 "UMask": "0x4", 783 "UMask": "0x4",
691 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE", 784 "EventName": "CYCLE_ACTIVITY.CYCLES_NO_EXECUTE",
692 "SampleAfterValue": "2000003", 785 "SampleAfterValue": "2000003",
693 "BriefDescription": "Total execution stalls", 786 "BriefDescription": "This event increments by 1 for every cycle where there was no execute for this thread.",
787 "CounterMask": "4",
788 "CounterHTOff": "0,1,2,3"
789 },
790 {
791 "EventCode": "0xA3",
792 "Counter": "0,1,2,3",
793 "UMask": "0x4",
794 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
795 "SampleAfterValue": "2000003",
796 "BriefDescription": "Total execution stalls.",
694 "CounterMask": "4", 797 "CounterMask": "4",
695 "CounterHTOff": "0,1,2,3" 798 "CounterHTOff": "0,1,2,3"
696 }, 799 },
@@ -708,6 +811,16 @@
708 { 811 {
709 "EventCode": "0xA3", 812 "EventCode": "0xA3",
710 "Counter": "0,1,2,3", 813 "Counter": "0,1,2,3",
814 "UMask": "0x5",
815 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
816 "SampleAfterValue": "2000003",
817 "BriefDescription": "Execution stalls while L2 cache miss load* is outstanding.",
818 "CounterMask": "5",
819 "CounterHTOff": "0,1,2,3"
820 },
821 {
822 "EventCode": "0xA3",
823 "Counter": "0,1,2,3",
711 "UMask": "0x6", 824 "UMask": "0x6",
712 "EventName": "CYCLE_ACTIVITY.STALLS_LDM_PENDING", 825 "EventName": "CYCLE_ACTIVITY.STALLS_LDM_PENDING",
713 "SampleAfterValue": "2000003", 826 "SampleAfterValue": "2000003",
@@ -716,6 +829,37 @@
716 "CounterHTOff": "0,1,2,3" 829 "CounterHTOff": "0,1,2,3"
717 }, 830 },
718 { 831 {
832 "EventCode": "0xA3",
833 "Counter": "0,1,2,3",
834 "UMask": "0x6",
835 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
836 "SampleAfterValue": "2000003",
837 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
838 "CounterMask": "6",
839 "CounterHTOff": "0,1,2,3"
840 },
841 {
842 "PublicDescription": "Cycles with pending L1 cache miss loads. Set AnyThread to count per core.",
843 "EventCode": "0xA3",
844 "Counter": "2",
845 "UMask": "0x8",
846 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_PENDING",
847 "SampleAfterValue": "2000003",
848 "BriefDescription": "Cycles with pending L1 cache miss loads.",
849 "CounterMask": "8",
850 "CounterHTOff": "2"
851 },
852 {
853 "EventCode": "0xA3",
854 "Counter": "2",
855 "UMask": "0x8",
856 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
857 "SampleAfterValue": "2000003",
858 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
859 "CounterMask": "8",
860 "CounterHTOff": "2"
861 },
862 {
719 "PublicDescription": "Execution stalls due to L1 data cache miss loads. Set Cmask=0CH.", 863 "PublicDescription": "Execution stalls due to L1 data cache miss loads. Set Cmask=0CH.",
720 "EventCode": "0xA3", 864 "EventCode": "0xA3",
721 "Counter": "2", 865 "Counter": "2",
@@ -727,6 +871,16 @@
727 "CounterHTOff": "2" 871 "CounterHTOff": "2"
728 }, 872 },
729 { 873 {
874 "EventCode": "0xA3",
875 "Counter": "2",
876 "UMask": "0xc",
877 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
878 "SampleAfterValue": "2000003",
879 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
880 "CounterMask": "12",
881 "CounterHTOff": "2"
882 },
883 {
730 "EventCode": "0xA8", 884 "EventCode": "0xA8",
731 "Counter": "0,1,2,3", 885 "Counter": "0,1,2,3",
732 "UMask": "0x1", 886 "UMask": "0x1",
@@ -747,6 +901,17 @@
747 "CounterHTOff": "0,1,2,3,4,5,6,7" 901 "CounterHTOff": "0,1,2,3,4,5,6,7"
748 }, 902 },
749 { 903 {
904 "PublicDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
905 "EventCode": "0xA8",
906 "Counter": "0,1,2,3",
907 "UMask": "0x1",
908 "EventName": "LSD.CYCLES_4_UOPS",
909 "SampleAfterValue": "2000003",
910 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder",
911 "CounterMask": "4",
912 "CounterHTOff": "0,1,2,3,4,5,6,7"
913 },
914 {
750 "PublicDescription": "Counts total number of uops to be executed per-thread each cycle. Set Cmask = 1, INV =1 to count stall cycles.", 915 "PublicDescription": "Counts total number of uops to be executed per-thread each cycle. Set Cmask = 1, INV =1 to count stall cycles.",
751 "EventCode": "0xB1", 916 "EventCode": "0xB1",
752 "Counter": "0,1,2,3", 917 "Counter": "0,1,2,3",
@@ -757,6 +922,61 @@
757 "CounterHTOff": "0,1,2,3,4,5,6,7" 922 "CounterHTOff": "0,1,2,3,4,5,6,7"
758 }, 923 },
759 { 924 {
925 "EventCode": "0xB1",
926 "Invert": "1",
927 "Counter": "0,1,2,3",
928 "UMask": "0x1",
929 "EventName": "UOPS_EXECUTED.STALL_CYCLES",
930 "SampleAfterValue": "2000003",
931 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
932 "CounterMask": "1",
933 "CounterHTOff": "0,1,2,3"
934 },
935 {
936 "PublicDescription": "Cycles where at least 1 uop was executed per-thread.",
937 "EventCode": "0xB1",
938 "Counter": "0,1,2,3",
939 "UMask": "0x1",
940 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
941 "SampleAfterValue": "2000003",
942 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
943 "CounterMask": "1",
944 "CounterHTOff": "0,1,2,3,4,5,6,7"
945 },
946 {
947 "PublicDescription": "Cycles where at least 2 uops were executed per-thread.",
948 "EventCode": "0xB1",
949 "Counter": "0,1,2,3",
950 "UMask": "0x1",
951 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
952 "SampleAfterValue": "2000003",
953 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
954 "CounterMask": "2",
955 "CounterHTOff": "0,1,2,3,4,5,6,7"
956 },
957 {
958 "PublicDescription": "Cycles where at least 3 uops were executed per-thread.",
959 "EventCode": "0xB1",
960 "Counter": "0,1,2,3",
961 "UMask": "0x1",
962 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
963 "SampleAfterValue": "2000003",
964 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
965 "CounterMask": "3",
966 "CounterHTOff": "0,1,2,3,4,5,6,7"
967 },
968 {
969 "PublicDescription": "Cycles where at least 4 uops were executed per-thread.",
970 "EventCode": "0xB1",
971 "Counter": "0,1,2,3",
972 "UMask": "0x1",
973 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
974 "SampleAfterValue": "2000003",
975 "BriefDescription": "Cycles where at least 4 uops were executed per-thread",
976 "CounterMask": "4",
977 "CounterHTOff": "0,1,2,3,4,5,6,7"
978 },
979 {
760 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.", 980 "PublicDescription": "Counts total number of uops to be executed per-core each cycle.",
761 "EventCode": "0xB1", 981 "EventCode": "0xB1",
762 "Counter": "0,1,2,3", 982 "Counter": "0,1,2,3",
@@ -767,15 +987,59 @@
767 "CounterHTOff": "0,1,2,3,4,5,6,7" 987 "CounterHTOff": "0,1,2,3,4,5,6,7"
768 }, 988 },
769 { 989 {
990 "PublicDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
770 "EventCode": "0xB1", 991 "EventCode": "0xB1",
771 "Invert": "1",
772 "Counter": "0,1,2,3", 992 "Counter": "0,1,2,3",
773 "UMask": "0x1", 993 "UMask": "0x2",
774 "EventName": "UOPS_EXECUTED.STALL_CYCLES", 994 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
775 "SampleAfterValue": "2000003", 995 "SampleAfterValue": "2000003",
776 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.", 996 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core",
777 "CounterMask": "1", 997 "CounterMask": "1",
778 "CounterHTOff": "0,1,2,3" 998 "CounterHTOff": "0,1,2,3,4,5,6,7"
999 },
1000 {
1001 "PublicDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1002 "EventCode": "0xB1",
1003 "Counter": "0,1,2,3",
1004 "UMask": "0x2",
1005 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1006 "SampleAfterValue": "2000003",
1007 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core",
1008 "CounterMask": "2",
1009 "CounterHTOff": "0,1,2,3,4,5,6,7"
1010 },
1011 {
1012 "PublicDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1013 "EventCode": "0xB1",
1014 "Counter": "0,1,2,3",
1015 "UMask": "0x2",
1016 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1017 "SampleAfterValue": "2000003",
1018 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core",
1019 "CounterMask": "3",
1020 "CounterHTOff": "0,1,2,3,4,5,6,7"
1021 },
1022 {
1023 "PublicDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1024 "EventCode": "0xB1",
1025 "Counter": "0,1,2,3",
1026 "UMask": "0x2",
1027 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1028 "SampleAfterValue": "2000003",
1029 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core",
1030 "CounterMask": "4",
1031 "CounterHTOff": "0,1,2,3,4,5,6,7"
1032 },
1033 {
1034 "PublicDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1035 "EventCode": "0xB1",
1036 "Invert": "1",
1037 "Counter": "0,1,2,3",
1038 "UMask": "0x2",
1039 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1040 "SampleAfterValue": "2000003",
1041 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core",
1042 "CounterHTOff": "0,1,2,3,4,5,6,7"
779 }, 1043 },
780 { 1044 {
781 "PublicDescription": "Number of instructions at retirement.", 1045 "PublicDescription": "Number of instructions at retirement.",
@@ -809,24 +1073,12 @@
809 }, 1073 },
810 { 1074 {
811 "PEBS": "1", 1075 "PEBS": "1",
812 "PublicDescription": "Counts the number of micro-ops retired, Use cmask=1 and invert to count active cycles or stalled cycles.",
813 "EventCode": "0xC2", 1076 "EventCode": "0xC2",
814 "Counter": "0,1,2,3", 1077 "Counter": "0,1,2,3",
815 "UMask": "0x1", 1078 "UMask": "0x1",
816 "EventName": "UOPS_RETIRED.ALL", 1079 "EventName": "UOPS_RETIRED.ALL",
817 "SampleAfterValue": "2000003", 1080 "SampleAfterValue": "2000003",
818 "BriefDescription": "Actually retired uops. ", 1081 "BriefDescription": "Retired uops.",
819 "CounterHTOff": "0,1,2,3,4,5,6,7"
820 },
821 {
822 "PEBS": "1",
823 "PublicDescription": "Counts the number of retirement slots used each cycle.",
824 "EventCode": "0xC2",
825 "Counter": "0,1,2,3",
826 "UMask": "0x2",
827 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
828 "SampleAfterValue": "2000003",
829 "BriefDescription": "Retirement slots used. ",
830 "CounterHTOff": "0,1,2,3,4,5,6,7" 1082 "CounterHTOff": "0,1,2,3,4,5,6,7"
831 }, 1083 },
832 { 1084 {
@@ -864,6 +1116,27 @@
864 "CounterHTOff": "0,1,2,3" 1116 "CounterHTOff": "0,1,2,3"
865 }, 1117 },
866 { 1118 {
1119 "PEBS": "1",
1120 "EventCode": "0xC2",
1121 "Counter": "0,1,2,3",
1122 "UMask": "0x2",
1123 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
1124 "SampleAfterValue": "2000003",
1125 "BriefDescription": "Retirement slots used.",
1126 "CounterHTOff": "0,1,2,3,4,5,6,7"
1127 },
1128 {
1129 "EventCode": "0xC3",
1130 "Counter": "0,1,2,3",
1131 "UMask": "0x1",
1132 "EdgeDetect": "1",
1133 "EventName": "MACHINE_CLEARS.COUNT",
1134 "SampleAfterValue": "100003",
1135 "BriefDescription": "Number of machine clears (nukes) of any type.",
1136 "CounterMask": "1",
1137 "CounterHTOff": "0,1,2,3,4,5,6,7"
1138 },
1139 {
867 "PublicDescription": "Number of self-modifying-code machine clears detected.", 1140 "PublicDescription": "Number of self-modifying-code machine clears detected.",
868 "EventCode": "0xC3", 1141 "EventCode": "0xC3",
869 "Counter": "0,1,2,3", 1142 "Counter": "0,1,2,3",
@@ -880,50 +1153,67 @@
880 "UMask": "0x20", 1153 "UMask": "0x20",
881 "EventName": "MACHINE_CLEARS.MASKMOV", 1154 "EventName": "MACHINE_CLEARS.MASKMOV",
882 "SampleAfterValue": "100003", 1155 "SampleAfterValue": "100003",
883 "BriefDescription": "This event counts the number of executed Intel AVX masked load operations that refer to an illegal address range with the mask bits set to 0. ", 1156 "BriefDescription": "This event counts the number of executed Intel AVX masked load operations that refer to an illegal address range with the mask bits set to 0.",
1157 "CounterHTOff": "0,1,2,3,4,5,6,7"
1158 },
1159 {
1160 "PublicDescription": "Branch instructions at retirement.",
1161 "EventCode": "0xC4",
1162 "Counter": "0,1,2,3",
1163 "UMask": "0x0",
1164 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
1165 "SampleAfterValue": "400009",
1166 "BriefDescription": "All (macro) branch instructions retired.",
884 "CounterHTOff": "0,1,2,3,4,5,6,7" 1167 "CounterHTOff": "0,1,2,3,4,5,6,7"
885 }, 1168 },
886 { 1169 {
887 "PEBS": "1", 1170 "PEBS": "1",
888 "PublicDescription": "Counts the number of conditional branch instructions retired.",
889 "EventCode": "0xC4", 1171 "EventCode": "0xC4",
890 "Counter": "0,1,2,3", 1172 "Counter": "0,1,2,3",
891 "UMask": "0x1", 1173 "UMask": "0x1",
892 "EventName": "BR_INST_RETIRED.CONDITIONAL", 1174 "EventName": "BR_INST_RETIRED.CONDITIONAL",
893 "SampleAfterValue": "400009", 1175 "SampleAfterValue": "400009",
894 "BriefDescription": "Conditional branch instructions retired. ", 1176 "BriefDescription": "Conditional branch instructions retired.",
895 "CounterHTOff": "0,1,2,3,4,5,6,7" 1177 "CounterHTOff": "0,1,2,3,4,5,6,7"
896 }, 1178 },
897 { 1179 {
898 "PEBS": "1", 1180 "PEBS": "1",
899 "PublicDescription": "Direct and indirect near call instructions retired.",
900 "EventCode": "0xC4", 1181 "EventCode": "0xC4",
901 "Counter": "0,1,2,3", 1182 "Counter": "0,1,2,3",
902 "UMask": "0x2", 1183 "UMask": "0x2",
903 "EventName": "BR_INST_RETIRED.NEAR_CALL", 1184 "EventName": "BR_INST_RETIRED.NEAR_CALL",
904 "SampleAfterValue": "100007", 1185 "SampleAfterValue": "100007",
905 "BriefDescription": "Direct and indirect near call instructions retired. ", 1186 "BriefDescription": "Direct and indirect near call instructions retired.",
906 "CounterHTOff": "0,1,2,3,4,5,6,7" 1187 "CounterHTOff": "0,1,2,3,4,5,6,7"
907 }, 1188 },
908 { 1189 {
909 "PublicDescription": "Branch instructions at retirement.", 1190 "PEBS": "1",
910 "EventCode": "0xC4", 1191 "EventCode": "0xC4",
911 "Counter": "0,1,2,3", 1192 "Counter": "0,1,2,3",
912 "UMask": "0x0", 1193 "UMask": "0x2",
913 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 1194 "EventName": "BR_INST_RETIRED.NEAR_CALL_R3",
1195 "SampleAfterValue": "100007",
1196 "BriefDescription": "Direct and indirect macro near call instructions retired (captured in ring 3).",
1197 "CounterHTOff": "0,1,2,3,4,5,6,7"
1198 },
1199 {
1200 "PEBS": "2",
1201 "EventCode": "0xC4",
1202 "Counter": "0,1,2,3",
1203 "UMask": "0x4",
1204 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
914 "SampleAfterValue": "400009", 1205 "SampleAfterValue": "400009",
915 "BriefDescription": "All (macro) branch instructions retired.", 1206 "BriefDescription": "All (macro) branch instructions retired.",
916 "CounterHTOff": "0,1,2,3,4,5,6,7" 1207 "CounterHTOff": "0,1,2,3"
917 }, 1208 },
918 { 1209 {
919 "PEBS": "1", 1210 "PEBS": "1",
920 "PublicDescription": "Counts the number of near return instructions retired.",
921 "EventCode": "0xC4", 1211 "EventCode": "0xC4",
922 "Counter": "0,1,2,3", 1212 "Counter": "0,1,2,3",
923 "UMask": "0x8", 1213 "UMask": "0x8",
924 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 1214 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
925 "SampleAfterValue": "100007", 1215 "SampleAfterValue": "100007",
926 "BriefDescription": "Return instructions retired. ", 1216 "BriefDescription": "Return instructions retired.",
927 "CounterHTOff": "0,1,2,3,4,5,6,7" 1217 "CounterHTOff": "0,1,2,3,4,5,6,7"
928 }, 1218 },
929 { 1219 {
@@ -933,18 +1223,17 @@
933 "UMask": "0x10", 1223 "UMask": "0x10",
934 "EventName": "BR_INST_RETIRED.NOT_TAKEN", 1224 "EventName": "BR_INST_RETIRED.NOT_TAKEN",
935 "SampleAfterValue": "400009", 1225 "SampleAfterValue": "400009",
936 "BriefDescription": "Not taken branch instructions retired. ", 1226 "BriefDescription": "Not taken branch instructions retired.",
937 "CounterHTOff": "0,1,2,3,4,5,6,7" 1227 "CounterHTOff": "0,1,2,3,4,5,6,7"
938 }, 1228 },
939 { 1229 {
940 "PEBS": "1", 1230 "PEBS": "1",
941 "PublicDescription": "Number of near taken branches retired.",
942 "EventCode": "0xC4", 1231 "EventCode": "0xC4",
943 "Counter": "0,1,2,3", 1232 "Counter": "0,1,2,3",
944 "UMask": "0x20", 1233 "UMask": "0x20",
945 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 1234 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
946 "SampleAfterValue": "400009", 1235 "SampleAfterValue": "400009",
947 "BriefDescription": "Taken branch instructions retired. ", 1236 "BriefDescription": "Taken branch instructions retired.",
948 "CounterHTOff": "0,1,2,3,4,5,6,7" 1237 "CounterHTOff": "0,1,2,3,4,5,6,7"
949 }, 1238 },
950 { 1239 {
@@ -954,28 +1243,7 @@
954 "UMask": "0x40", 1243 "UMask": "0x40",
955 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 1244 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
956 "SampleAfterValue": "100007", 1245 "SampleAfterValue": "100007",
957 "BriefDescription": "Far branch instructions retired. ", 1246 "BriefDescription": "Far branch instructions retired.",
958 "CounterHTOff": "0,1,2,3,4,5,6,7"
959 },
960 {
961 "PEBS": "2",
962 "EventCode": "0xC4",
963 "Counter": "0,1,2,3",
964 "UMask": "0x4",
965 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
966 "SampleAfterValue": "400009",
967 "BriefDescription": "All (macro) branch instructions retired.",
968 "CounterHTOff": "0,1,2,3"
969 },
970 {
971 "PEBS": "1",
972 "PublicDescription": "Mispredicted conditional branch instructions retired.",
973 "EventCode": "0xC5",
974 "Counter": "0,1,2,3",
975 "UMask": "0x1",
976 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
977 "SampleAfterValue": "400009",
978 "BriefDescription": "Mispredicted conditional branch instructions retired. ",
979 "CounterHTOff": "0,1,2,3,4,5,6,7" 1247 "CounterHTOff": "0,1,2,3,4,5,6,7"
980 }, 1248 },
981 { 1249 {
@@ -990,13 +1258,12 @@
990 }, 1258 },
991 { 1259 {
992 "PEBS": "1", 1260 "PEBS": "1",
993 "PublicDescription": "Mispredicted taken branch instructions retired.",
994 "EventCode": "0xC5", 1261 "EventCode": "0xC5",
995 "Counter": "0,1,2,3", 1262 "Counter": "0,1,2,3",
996 "UMask": "0x20", 1263 "UMask": "0x1",
997 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 1264 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
998 "SampleAfterValue": "400009", 1265 "SampleAfterValue": "400009",
999 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken. ", 1266 "BriefDescription": "Mispredicted conditional branch instructions retired.",
1000 "CounterHTOff": "0,1,2,3,4,5,6,7" 1267 "CounterHTOff": "0,1,2,3,4,5,6,7"
1001 }, 1268 },
1002 { 1269 {
@@ -1010,6 +1277,16 @@
1010 "CounterHTOff": "0,1,2,3" 1277 "CounterHTOff": "0,1,2,3"
1011 }, 1278 },
1012 { 1279 {
1280 "PEBS": "1",
1281 "EventCode": "0xC5",
1282 "Counter": "0,1,2,3",
1283 "UMask": "0x20",
1284 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
1285 "SampleAfterValue": "400009",
1286 "BriefDescription": "number of near branch instructions retired that were mispredicted and taken.",
1287 "CounterHTOff": "0,1,2,3,4,5,6,7"
1288 },
1289 {
1013 "PublicDescription": "Count cases of saving new LBR records by hardware.", 1290 "PublicDescription": "Count cases of saving new LBR records by hardware.",
1014 "EventCode": "0xCC", 1291 "EventCode": "0xCC",
1015 "Counter": "0,1,2,3", 1292 "Counter": "0,1,2,3",
@@ -1028,280 +1305,5 @@
1028 "SampleAfterValue": "100003", 1305 "SampleAfterValue": "100003",
1029 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.", 1306 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.",
1030 "CounterHTOff": "0,1,2,3,4,5,6,7" 1307 "CounterHTOff": "0,1,2,3,4,5,6,7"
1031 },
1032 {
1033 "PublicDescription": "Cycles where at least 1 uop was executed per-thread.",
1034 "EventCode": "0xB1",
1035 "Counter": "0,1,2,3",
1036 "UMask": "0x1",
1037 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
1038 "SampleAfterValue": "2000003",
1039 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
1040 "CounterMask": "1",
1041 "CounterHTOff": "0,1,2,3,4,5,6,7"
1042 },
1043 {
1044 "PublicDescription": "Cycles where at least 2 uops were executed per-thread.",
1045 "EventCode": "0xB1",
1046 "Counter": "0,1,2,3",
1047 "UMask": "0x1",
1048 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
1049 "SampleAfterValue": "2000003",
1050 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
1051 "CounterMask": "2",
1052 "CounterHTOff": "0,1,2,3,4,5,6,7"
1053 },
1054 {
1055 "PublicDescription": "Cycles where at least 3 uops were executed per-thread.",
1056 "EventCode": "0xB1",
1057 "Counter": "0,1,2,3",
1058 "UMask": "0x1",
1059 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
1060 "SampleAfterValue": "2000003",
1061 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
1062 "CounterMask": "3",
1063 "CounterHTOff": "0,1,2,3,4,5,6,7"
1064 },
1065 {
1066 "PublicDescription": "Cycles where at least 4 uops were executed per-thread.",
1067 "EventCode": "0xB1",
1068 "Counter": "0,1,2,3",
1069 "UMask": "0x1",
1070 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
1071 "SampleAfterValue": "2000003",
1072 "BriefDescription": "Cycles where at least 4 uops were executed per-thread",
1073 "CounterMask": "4",
1074 "CounterHTOff": "0,1,2,3,4,5,6,7"
1075 },
1076 {
1077 "EventCode": "0x5E",
1078 "Invert": "1",
1079 "Counter": "0,1,2,3",
1080 "UMask": "0x1",
1081 "EdgeDetect": "1",
1082 "EventName": "RS_EVENTS.EMPTY_END",
1083 "SampleAfterValue": "200003",
1084 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
1085 "CounterMask": "1",
1086 "CounterHTOff": "0,1,2,3,4,5,6,7"
1087 },
1088 {
1089 "EventCode": "0xC3",
1090 "Counter": "0,1,2,3",
1091 "UMask": "0x1",
1092 "EdgeDetect": "1",
1093 "EventName": "MACHINE_CLEARS.COUNT",
1094 "SampleAfterValue": "100003",
1095 "BriefDescription": "Number of machine clears (nukes) of any type.",
1096 "CounterMask": "1",
1097 "CounterHTOff": "0,1,2,3,4,5,6,7"
1098 },
1099 {
1100 "PublicDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
1101 "EventCode": "0xA8",
1102 "Counter": "0,1,2,3",
1103 "UMask": "0x1",
1104 "EventName": "LSD.CYCLES_4_UOPS",
1105 "SampleAfterValue": "2000003",
1106 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder",
1107 "CounterMask": "4",
1108 "CounterHTOff": "0,1,2,3,4,5,6,7"
1109 },
1110 {
1111 "EventCode": "0xA3",
1112 "Counter": "2",
1113 "UMask": "0x8",
1114 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
1115 "SampleAfterValue": "2000003",
1116 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
1117 "CounterMask": "8",
1118 "CounterHTOff": "2"
1119 },
1120 {
1121 "EventCode": "0xA3",
1122 "Counter": "0,1,2,3",
1123 "UMask": "0x1",
1124 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
1125 "SampleAfterValue": "2000003",
1126 "BriefDescription": "Cycles while L2 cache miss load* is outstanding.",
1127 "CounterMask": "1",
1128 "CounterHTOff": "0,1,2,3,4,5,6,7"
1129 },
1130 {
1131 "EventCode": "0xA3",
1132 "Counter": "0,1,2,3",
1133 "UMask": "0x2",
1134 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
1135 "SampleAfterValue": "2000003",
1136 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
1137 "CounterMask": "2",
1138 "CounterHTOff": "0,1,2,3"
1139 },
1140 {
1141 "EventCode": "0xA3",
1142 "Counter": "0,1,2,3",
1143 "UMask": "0x4",
1144 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
1145 "SampleAfterValue": "2000003",
1146 "BriefDescription": "Total execution stalls.",
1147 "CounterMask": "4",
1148 "CounterHTOff": "0,1,2,3"
1149 },
1150 {
1151 "EventCode": "0xA3",
1152 "Counter": "2",
1153 "UMask": "0xc",
1154 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
1155 "SampleAfterValue": "2000003",
1156 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
1157 "CounterMask": "12",
1158 "CounterHTOff": "2"
1159 },
1160 {
1161 "EventCode": "0xA3",
1162 "Counter": "0,1,2,3",
1163 "UMask": "0x5",
1164 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
1165 "SampleAfterValue": "2000003",
1166 "BriefDescription": "Execution stalls while L2 cache miss load* is outstanding.",
1167 "CounterMask": "5",
1168 "CounterHTOff": "0,1,2,3"
1169 },
1170 {
1171 "EventCode": "0xA3",
1172 "Counter": "0,1,2,3",
1173 "UMask": "0x6",
1174 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
1175 "SampleAfterValue": "2000003",
1176 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
1177 "CounterMask": "6",
1178 "CounterHTOff": "0,1,2,3"
1179 },
1180 {
1181 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1182 "EventCode": "0x00",
1183 "Counter": "Fixed counter 2",
1184 "UMask": "0x2",
1185 "AnyThread": "1",
1186 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
1187 "SampleAfterValue": "2000003",
1188 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
1189 "CounterHTOff": "Fixed counter 2"
1190 },
1191 {
1192 "PublicDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
1193 "EventCode": "0x3C",
1194 "Counter": "0,1,2,3",
1195 "UMask": "0x0",
1196 "AnyThread": "1",
1197 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
1198 "SampleAfterValue": "2000003",
1199 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state",
1200 "CounterHTOff": "0,1,2,3,4,5,6,7"
1201 },
1202 {
1203 "EventCode": "0x3C",
1204 "Counter": "0,1,2,3",
1205 "UMask": "0x1",
1206 "AnyThread": "1",
1207 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
1208 "SampleAfterValue": "2000003",
1209 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
1210 "CounterHTOff": "0,1,2,3,4,5,6,7"
1211 },
1212 {
1213 "EventCode": "0x0D",
1214 "Counter": "0,1,2,3",
1215 "UMask": "0x3",
1216 "AnyThread": "1",
1217 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
1218 "SampleAfterValue": "2000003",
1219 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
1220 "CounterMask": "1",
1221 "CounterHTOff": "0,1,2,3,4,5,6,7"
1222 },
1223 {
1224 "PublicDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
1225 "EventCode": "0xB1",
1226 "Counter": "0,1,2,3",
1227 "UMask": "0x2",
1228 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
1229 "SampleAfterValue": "2000003",
1230 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core",
1231 "CounterMask": "1",
1232 "CounterHTOff": "0,1,2,3,4,5,6,7"
1233 },
1234 {
1235 "PublicDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
1236 "EventCode": "0xB1",
1237 "Counter": "0,1,2,3",
1238 "UMask": "0x2",
1239 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
1240 "SampleAfterValue": "2000003",
1241 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core",
1242 "CounterMask": "2",
1243 "CounterHTOff": "0,1,2,3,4,5,6,7"
1244 },
1245 {
1246 "PublicDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
1247 "EventCode": "0xB1",
1248 "Counter": "0,1,2,3",
1249 "UMask": "0x2",
1250 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
1251 "SampleAfterValue": "2000003",
1252 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core",
1253 "CounterMask": "3",
1254 "CounterHTOff": "0,1,2,3,4,5,6,7"
1255 },
1256 {
1257 "PublicDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
1258 "EventCode": "0xB1",
1259 "Counter": "0,1,2,3",
1260 "UMask": "0x2",
1261 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
1262 "SampleAfterValue": "2000003",
1263 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core",
1264 "CounterMask": "4",
1265 "CounterHTOff": "0,1,2,3,4,5,6,7"
1266 },
1267 {
1268 "PublicDescription": "Cycles with no micro-ops executed from any thread on physical core.",
1269 "EventCode": "0xB1",
1270 "Invert": "1",
1271 "Counter": "0,1,2,3",
1272 "UMask": "0x2",
1273 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
1274 "SampleAfterValue": "2000003",
1275 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core",
1276 "CounterHTOff": "0,1,2,3,4,5,6,7"
1277 },
1278 {
1279 "PublicDescription": "Reference cycles when the thread is unhalted. (counts at 100 MHz rate)",
1280 "EventCode": "0x3C",
1281 "Counter": "0,1,2,3",
1282 "UMask": "0x1",
1283 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
1284 "SampleAfterValue": "2000003",
1285 "BriefDescription": "Reference cycles when the thread is unhalted (counts at 100 MHz rate)",
1286 "CounterHTOff": "0,1,2,3,4,5,6,7"
1287 },
1288 {
1289 "EventCode": "0x3C",
1290 "Counter": "0,1,2,3",
1291 "UMask": "0x1",
1292 "AnyThread": "1",
1293 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
1294 "SampleAfterValue": "2000003",
1295 "BriefDescription": "Reference cycles when the at least one thread on the physical core is unhalted. (counts at 100 MHz rate)",
1296 "CounterHTOff": "0,1,2,3,4,5,6,7"
1297 },
1298 {
1299 "EventCode": "0x3C",
1300 "Counter": "0,1,2,3",
1301 "UMask": "0x2",
1302 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
1303 "SampleAfterValue": "2000003",
1304 "BriefDescription": "Count XClk pulses when this thread is unhalted and the other thread is halted.",
1305 "CounterHTOff": "0,1,2,3,4,5,6,7"
1306 } 1308 }
1307] \ No newline at end of file 1309] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/virtual-memory.json b/tools/perf/pmu-events/arch/x86/ivytown/virtual-memory.json
index c8de548b78fa..4645e9d3f460 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/virtual-memory.json
@@ -1,5 +1,15 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "Misses in all TLB levels that cause a page walk of any page size from demand loads.",
4 "EventCode": "0x08",
5 "Counter": "0,1,2,3",
6 "UMask": "0x81",
7 "EventName": "DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK",
8 "SampleAfterValue": "100003",
9 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes an page walk of any page size.",
10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 },
12 {
3 "EventCode": "0x08", 13 "EventCode": "0x08",
4 "Counter": "0,1,2,3", 14 "Counter": "0,1,2,3",
5 "UMask": "0x82", 15 "UMask": "0x82",
@@ -9,6 +19,16 @@
9 "CounterHTOff": "0,1,2,3,4,5,6,7" 19 "CounterHTOff": "0,1,2,3,4,5,6,7"
10 }, 20 },
11 { 21 {
22 "PublicDescription": "Misses in all TLB levels that caused page walk completed of any size by demand loads.",
23 "EventCode": "0x08",
24 "Counter": "0,1,2,3",
25 "UMask": "0x82",
26 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
27 "SampleAfterValue": "100003",
28 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
29 "CounterHTOff": "0,1,2,3,4,5,6,7"
30 },
31 {
12 "EventCode": "0x08", 32 "EventCode": "0x08",
13 "Counter": "0,1,2,3", 33 "Counter": "0,1,2,3",
14 "UMask": "0x84", 34 "UMask": "0x84",
@@ -18,6 +38,16 @@
18 "CounterHTOff": "0,1,2,3,4,5,6,7" 38 "CounterHTOff": "0,1,2,3,4,5,6,7"
19 }, 39 },
20 { 40 {
41 "PublicDescription": "Cycle PMH is busy with a walk due to demand loads.",
42 "EventCode": "0x08",
43 "Counter": "0,1,2,3",
44 "UMask": "0x84",
45 "EventName": "DTLB_LOAD_MISSES.WALK_DURATION",
46 "SampleAfterValue": "2000003",
47 "BriefDescription": "Demand load cycles page miss handler (PMH) is busy with this walk.",
48 "CounterHTOff": "0,1,2,3,4,5,6,7"
49 },
50 {
21 "EventCode": "0x08", 51 "EventCode": "0x08",
22 "Counter": "0,1,2,3", 52 "Counter": "0,1,2,3",
23 "UMask": "0x88", 53 "UMask": "0x88",
@@ -164,35 +194,5 @@
164 "SampleAfterValue": "100007", 194 "SampleAfterValue": "100007",
165 "BriefDescription": "STLB flush attempts", 195 "BriefDescription": "STLB flush attempts",
166 "CounterHTOff": "0,1,2,3,4,5,6,7" 196 "CounterHTOff": "0,1,2,3,4,5,6,7"
167 },
168 {
169 "PublicDescription": "Misses in all TLB levels that cause a page walk of any page size from demand loads.",
170 "EventCode": "0x08",
171 "Counter": "0,1,2,3",
172 "UMask": "0x81",
173 "EventName": "DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK",
174 "SampleAfterValue": "100003",
175 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes an page walk of any page size.",
176 "CounterHTOff": "0,1,2,3,4,5,6,7"
177 },
178 {
179 "PublicDescription": "Misses in all TLB levels that caused page walk completed of any size by demand loads.",
180 "EventCode": "0x08",
181 "Counter": "0,1,2,3",
182 "UMask": "0x82",
183 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
184 "SampleAfterValue": "100003",
185 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes of any page size.",
186 "CounterHTOff": "0,1,2,3,4,5,6,7"
187 },
188 {
189 "PublicDescription": "Cycle PMH is busy with a walk due to demand loads.",
190 "EventCode": "0x08",
191 "Counter": "0,1,2,3",
192 "UMask": "0x84",
193 "EventName": "DTLB_LOAD_MISSES.WALK_DURATION",
194 "SampleAfterValue": "2000003",
195 "BriefDescription": "Demand load cycles page miss handler (PMH) is busy with this walk.",
196 "CounterHTOff": "0,1,2,3,4,5,6,7"
197 } 197 }
198] \ No newline at end of file 198] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/mapfile.csv b/tools/perf/pmu-events/arch/x86/mapfile.csv
index fe1a2c47cabf..93656f2fd53a 100644
--- a/tools/perf/pmu-events/arch/x86/mapfile.csv
+++ b/tools/perf/pmu-events/arch/x86/mapfile.csv
@@ -23,10 +23,7 @@ GenuineIntel-6-1E,v2,nehalemep,core
23GenuineIntel-6-1F,v2,nehalemep,core 23GenuineIntel-6-1F,v2,nehalemep,core
24GenuineIntel-6-1A,v2,nehalemep,core 24GenuineIntel-6-1A,v2,nehalemep,core
25GenuineIntel-6-2E,v2,nehalemex,core 25GenuineIntel-6-2E,v2,nehalemex,core
26GenuineIntel-6-4E,v24,skylake,core 26GenuineIntel-6-[4589]E,v24,skylake,core
27GenuineIntel-6-5E,v24,skylake,core
28GenuineIntel-6-8E,v24,skylake,core
29GenuineIntel-6-9E,v24,skylake,core
30GenuineIntel-6-37,v13,silvermont,core 27GenuineIntel-6-37,v13,silvermont,core
31GenuineIntel-6-4D,v13,silvermont,core 28GenuineIntel-6-4D,v13,silvermont,core
32GenuineIntel-6-4C,v13,silvermont,core 29GenuineIntel-6-4C,v13,silvermont,core
diff --git a/tools/perf/pmu-events/arch/x86/silvermont/cache.json b/tools/perf/pmu-events/arch/x86/silvermont/cache.json
index 0bd1bc5302de..82be7d1b8b81 100644
--- a/tools/perf/pmu-events/arch/x86/silvermont/cache.json
+++ b/tools/perf/pmu-events/arch/x86/silvermont/cache.json
@@ -36,12 +36,13 @@
36 "BriefDescription": "L2 cache request misses" 36 "BriefDescription": "L2 cache request misses"
37 }, 37 },
38 { 38 {
39 "PublicDescription": "Counts cycles that fetch is stalled due to an outstanding ICache miss. That is, the decoder queue is able to accept bytes, but the fetch unit is unable to provide bytes due to an ICache miss. Note: this event is not the same as the total number of cycles spent retrieving instruction cache lines from the memory hierarchy.\r\nCounts cycles that fetch is stalled due to any reason. That is, the decoder queue is able to accept bytes, but the fetch unit is unable to provide bytes. This will include cycles due to an ITLB miss, ICache miss and other events. \r\n",
39 "EventCode": "0x86", 40 "EventCode": "0x86",
40 "Counter": "0,1", 41 "Counter": "0,1",
41 "UMask": "0x4", 42 "UMask": "0x4",
42 "EventName": "FETCH_STALL.ICACHE_FILL_PENDING_CYCLES", 43 "EventName": "FETCH_STALL.ICACHE_FILL_PENDING_CYCLES",
43 "SampleAfterValue": "200003", 44 "SampleAfterValue": "200003",
44 "BriefDescription": "Counts the number of cycles the NIP stalls because of an icache miss. This is a cumulative count of cycles the NIP stalled for all icache misses." 45 "BriefDescription": "Cycles code-fetch stalled due to an outstanding ICache miss."
45 }, 46 },
46 { 47 {
47 "PEBS": "1", 48 "PEBS": "1",
diff --git a/tools/perf/pmu-events/arch/x86/skylake/cache.json b/tools/perf/pmu-events/arch/x86/skylake/cache.json
index 0551a9ba865d..54bfe9e4045c 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/cache.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/cache.json
@@ -1,442 +1,6 @@
1[ 1[
2 { 2 {
3 "PEBS": "1", 3 "PublicDescription": "Counts the number of demand Data Read requests that miss L2 cache. Only not rejected loads are counted.",
4 "EventCode": "0xD0",
5 "Counter": "0,1,2,3",
6 "UMask": "0x11",
7 "EventName": "MEM_INST_RETIRED.STLB_MISS_LOADS",
8 "SampleAfterValue": "100003",
9 "BriefDescription": "Retired load instructions that miss the STLB.",
10 "CounterHTOff": "0,1,2,3",
11 "Data_LA": "1"
12 },
13 {
14 "PEBS": "1",
15 "EventCode": "0xD0",
16 "Counter": "0,1,2,3",
17 "UMask": "0x12",
18 "EventName": "MEM_INST_RETIRED.STLB_MISS_STORES",
19 "SampleAfterValue": "100003",
20 "BriefDescription": "Retired store instructions that miss the STLB.",
21 "CounterHTOff": "0,1,2,3",
22 "Data_LA": "1",
23 "L1_Hit_Indication": "1"
24 },
25 {
26 "PEBS": "1",
27 "EventCode": "0xD0",
28 "Counter": "0,1,2,3",
29 "UMask": "0x21",
30 "EventName": "MEM_INST_RETIRED.LOCK_LOADS",
31 "SampleAfterValue": "100007",
32 "BriefDescription": "Retired load instructions with locked access.",
33 "CounterHTOff": "0,1,2,3",
34 "Data_LA": "1"
35 },
36 {
37 "PEBS": "1",
38 "EventCode": "0xD0",
39 "Counter": "0,1,2,3",
40 "UMask": "0x41",
41 "EventName": "MEM_INST_RETIRED.SPLIT_LOADS",
42 "SampleAfterValue": "100003",
43 "BriefDescription": "Retired load instructions that split across a cacheline boundary.",
44 "CounterHTOff": "0,1,2,3",
45 "Data_LA": "1"
46 },
47 {
48 "PEBS": "1",
49 "EventCode": "0xD0",
50 "Counter": "0,1,2,3",
51 "UMask": "0x42",
52 "EventName": "MEM_INST_RETIRED.SPLIT_STORES",
53 "SampleAfterValue": "100003",
54 "BriefDescription": "Retired store instructions that split across a cacheline boundary.",
55 "CounterHTOff": "0,1,2,3",
56 "Data_LA": "1",
57 "L1_Hit_Indication": "1"
58 },
59 {
60 "PEBS": "1",
61 "EventCode": "0xD0",
62 "Counter": "0,1,2,3",
63 "UMask": "0x81",
64 "EventName": "MEM_INST_RETIRED.ALL_LOADS",
65 "SampleAfterValue": "2000003",
66 "BriefDescription": "All retired load instructions.",
67 "CounterHTOff": "0,1,2,3",
68 "Data_LA": "1"
69 },
70 {
71 "PEBS": "1",
72 "EventCode": "0xD0",
73 "Counter": "0,1,2,3",
74 "UMask": "0x82",
75 "EventName": "MEM_INST_RETIRED.ALL_STORES",
76 "SampleAfterValue": "2000003",
77 "BriefDescription": "All retired store instructions.",
78 "CounterHTOff": "0,1,2,3",
79 "Data_LA": "1",
80 "L1_Hit_Indication": "1"
81 },
82 {
83 "PEBS": "1",
84 "PublicDescription": "Retired load instructions with L1 cache hits as data sources.",
85 "EventCode": "0xD1",
86 "Counter": "0,1,2,3",
87 "UMask": "0x1",
88 "EventName": "MEM_LOAD_RETIRED.L1_HIT",
89 "SampleAfterValue": "2000003",
90 "BriefDescription": "Retired load instructions with L1 cache hits as data sources",
91 "CounterHTOff": "0,1,2,3",
92 "Data_LA": "1"
93 },
94 {
95 "PEBS": "1",
96 "PublicDescription": "Retired load instructions with L2 cache hits as data sources.",
97 "EventCode": "0xD1",
98 "Counter": "0,1,2,3",
99 "UMask": "0x2",
100 "EventName": "MEM_LOAD_RETIRED.L2_HIT",
101 "SampleAfterValue": "100003",
102 "BriefDescription": "Retired load instructions with L2 cache hits as data sources",
103 "CounterHTOff": "0,1,2,3",
104 "Data_LA": "1"
105 },
106 {
107 "PEBS": "1",
108 "PublicDescription": "Retired load instructions with L3 cache hits as data sources.",
109 "EventCode": "0xD1",
110 "Counter": "0,1,2,3",
111 "UMask": "0x4",
112 "EventName": "MEM_LOAD_RETIRED.L3_HIT",
113 "SampleAfterValue": "50021",
114 "BriefDescription": "Retired load instructions with L3 cache hits as data sources",
115 "CounterHTOff": "0,1,2,3",
116 "Data_LA": "1"
117 },
118 {
119 "PEBS": "1",
120 "PublicDescription": "Retired load instructions missed L1 cache as data sources.",
121 "EventCode": "0xD1",
122 "Counter": "0,1,2,3",
123 "UMask": "0x8",
124 "EventName": "MEM_LOAD_RETIRED.L1_MISS",
125 "SampleAfterValue": "100003",
126 "BriefDescription": "Retired load instructions missed L1 cache as data sources",
127 "CounterHTOff": "0,1,2,3",
128 "Data_LA": "1"
129 },
130 {
131 "PEBS": "1",
132 "PublicDescription": "Retired load instructions missed L2 cache as data sources.",
133 "EventCode": "0xD1",
134 "Counter": "0,1,2,3",
135 "UMask": "0x10",
136 "EventName": "MEM_LOAD_RETIRED.L2_MISS",
137 "SampleAfterValue": "50021",
138 "BriefDescription": "Retired load instructions missed L2 cache as data sources",
139 "CounterHTOff": "0,1,2,3",
140 "Data_LA": "1"
141 },
142 {
143 "PEBS": "1",
144 "PublicDescription": "Retired load instructions missed L3 cache as data sources.",
145 "EventCode": "0xD1",
146 "Counter": "0,1,2,3",
147 "UMask": "0x20",
148 "EventName": "MEM_LOAD_RETIRED.L3_MISS",
149 "SampleAfterValue": "100007",
150 "BriefDescription": "Retired load instructions missed L3 cache as data sources",
151 "CounterHTOff": "0,1,2,3",
152 "Data_LA": "1"
153 },
154 {
155 "PEBS": "1",
156 "PublicDescription": "Retired load instructions which data sources were load missed L1 but hit FB due to preceding miss to the same cache line with data not ready.",
157 "EventCode": "0xD1",
158 "Counter": "0,1,2,3",
159 "UMask": "0x40",
160 "EventName": "MEM_LOAD_RETIRED.FB_HIT",
161 "SampleAfterValue": "100007",
162 "BriefDescription": "Retired load instructions which data sources were load missed L1 but hit FB due to preceding miss to the same cache line with data not ready",
163 "CounterHTOff": "0,1,2,3",
164 "Data_LA": "1"
165 },
166 {
167 "PEBS": "1",
168 "EventCode": "0xD2",
169 "Counter": "0,1,2,3",
170 "UMask": "0x1",
171 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS",
172 "SampleAfterValue": "20011",
173 "BriefDescription": "Retired load instructions which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.",
174 "CounterHTOff": "0,1,2,3",
175 "Data_LA": "1"
176 },
177 {
178 "PEBS": "1",
179 "PublicDescription": "Retired load instructions which data sources were L3 and cross-core snoop hits in on-pkg core cache.",
180 "EventCode": "0xD2",
181 "Counter": "0,1,2,3",
182 "UMask": "0x2",
183 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_HIT",
184 "SampleAfterValue": "20011",
185 "BriefDescription": "Retired load instructions which data sources were L3 and cross-core snoop hits in on-pkg core cache",
186 "CounterHTOff": "0,1,2,3",
187 "Data_LA": "1"
188 },
189 {
190 "PEBS": "1",
191 "PublicDescription": "Retired load instructions which data sources were HitM responses from shared L3.",
192 "EventCode": "0xD2",
193 "Counter": "0,1,2,3",
194 "UMask": "0x4",
195 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_HITM",
196 "SampleAfterValue": "20011",
197 "BriefDescription": "Retired load instructions which data sources were HitM responses from shared L3",
198 "CounterHTOff": "0,1,2,3",
199 "Data_LA": "1"
200 },
201 {
202 "PEBS": "1",
203 "PublicDescription": "Retired load instructions which data sources were hits in L3 without snoops required.",
204 "EventCode": "0xD2",
205 "Counter": "0,1,2,3",
206 "UMask": "0x8",
207 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_NONE",
208 "SampleAfterValue": "100003",
209 "BriefDescription": "Retired load instructions which data sources were hits in L3 without snoops required",
210 "CounterHTOff": "0,1,2,3",
211 "Data_LA": "1"
212 },
213 {
214 "PEBS": "1",
215 "EventCode": "0xD4",
216 "Counter": "0,1,2,3",
217 "UMask": "0x4",
218 "EventName": "MEM_LOAD_MISC_RETIRED.UC",
219 "SampleAfterValue": "100007",
220 "BriefDescription": "Retired instructions with at least 1 uncacheable load or lock.",
221 "CounterHTOff": "0,1,2,3",
222 "Data_LA": "1"
223 },
224 {
225 "PublicDescription": "This event counts L1D data line replacements including opportunistic replacements, and replacements that require stall-for-replace or block-for-replace.",
226 "EventCode": "0x51",
227 "Counter": "0,1,2,3",
228 "UMask": "0x1",
229 "EventName": "L1D.REPLACEMENT",
230 "SampleAfterValue": "2000003",
231 "BriefDescription": "L1D data line replacements",
232 "CounterHTOff": "0,1,2,3,4,5,6,7"
233 },
234 {
235 "PublicDescription": "This event counts duration of L1D miss outstanding, that is each cycle number of Fill Buffers (FB) outstanding required by Demand Reads. FB either is held by demand loads, or it is held by non-demand loads and gets hit at least once by demand. The valid outstanding interval is defined until the FB deallocation by one of the following ways: from FB allocation, if FB is allocated by demand\n from the demand Hit FB, if it is allocated by hardware or software prefetch.\nNote: In the L1D, a Demand Read contains cacheable or noncacheable demand loads, including ones causing cache-line splits and reads due to page walks resulted from any request type.",
236 "EventCode": "0x48",
237 "Counter": "0,1,2,3",
238 "UMask": "0x1",
239 "EventName": "L1D_PEND_MISS.PENDING",
240 "SampleAfterValue": "2000003",
241 "BriefDescription": "L1D miss outstandings duration in cycles",
242 "CounterHTOff": "0,1,2,3,4,5,6,7"
243 },
244 {
245 "EventCode": "0x48",
246 "Counter": "0,1,2,3",
247 "UMask": "0x2",
248 "EventName": "L1D_PEND_MISS.FB_FULL",
249 "SampleAfterValue": "2000003",
250 "BriefDescription": "Number of times a request needed a FB entry but there was no entry available for it. That is the FB unavailability was dominant reason for blocking the request. A request includes cacheable/uncacheable demands that is load, store or SW prefetch.",
251 "CounterHTOff": "0,1,2,3,4,5,6,7"
252 },
253 {
254 "PublicDescription": "This event counts duration of L1D miss outstanding in cycles.",
255 "EventCode": "0x48",
256 "Counter": "0,1,2,3",
257 "UMask": "0x1",
258 "EventName": "L1D_PEND_MISS.PENDING_CYCLES",
259 "SampleAfterValue": "2000003",
260 "BriefDescription": "Cycles with L1D load Misses outstanding.",
261 "CounterMask": "1",
262 "CounterHTOff": "0,1,2,3,4,5,6,7"
263 },
264 {
265 "PublicDescription": "This event counts the Demand Data Read requests sent to uncore. Use it in conjunction with OFFCORE_REQUESTS_OUTSTANDING to determine average latency in the uncore.",
266 "EventCode": "0xB0",
267 "Counter": "0,1,2,3",
268 "UMask": "0x1",
269 "EventName": "OFFCORE_REQUESTS.DEMAND_DATA_RD",
270 "SampleAfterValue": "100003",
271 "BriefDescription": "Demand Data Read requests sent to uncore",
272 "CounterHTOff": "0,1,2,3,4,5,6,7"
273 },
274 {
275 "PublicDescription": "This event counts both cacheable and noncachaeble code read requests.",
276 "EventCode": "0xB0",
277 "Counter": "0,1,2,3",
278 "UMask": "0x2",
279 "EventName": "OFFCORE_REQUESTS.DEMAND_CODE_RD",
280 "SampleAfterValue": "100003",
281 "BriefDescription": "Cacheable and noncachaeble code read requests",
282 "CounterHTOff": "0,1,2,3,4,5,6,7"
283 },
284 {
285 "PublicDescription": "This event counts the demand RFO (read for ownership) requests including regular RFOs, locks, ItoM.",
286 "EventCode": "0xB0",
287 "Counter": "0,1,2,3",
288 "UMask": "0x4",
289 "EventName": "OFFCORE_REQUESTS.DEMAND_RFO",
290 "SampleAfterValue": "100003",
291 "BriefDescription": "Demand RFO requests including regular RFOs, locks, ItoM",
292 "CounterHTOff": "0,1,2,3,4,5,6,7"
293 },
294 {
295 "PublicDescription": "This event counts the demand and prefetch data reads. All Core Data Reads include cacheable 'Demands' and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.",
296 "EventCode": "0xB0",
297 "Counter": "0,1,2,3",
298 "UMask": "0x8",
299 "EventName": "OFFCORE_REQUESTS.ALL_DATA_RD",
300 "SampleAfterValue": "100003",
301 "BriefDescription": "Demand and prefetch data reads",
302 "CounterHTOff": "0,1,2,3,4,5,6,7"
303 },
304 {
305 "PublicDescription": "This event counts memory transactions reached the super queue including requests initiated by the core, all L3 prefetches, page walks, and so on.",
306 "EventCode": "0xB0",
307 "Counter": "0,1,2,3",
308 "UMask": "0x80",
309 "EventName": "OFFCORE_REQUESTS.ALL_REQUESTS",
310 "SampleAfterValue": "100003",
311 "BriefDescription": "Any memory transaction that reached the SQ.",
312 "CounterHTOff": "0,1,2,3,4,5,6,7"
313 },
314 {
315 "PublicDescription": "This event counts the number of offcore outstanding Demand Data Read transactions in the super queue (SQ) every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor. See the corresponding Umask under OFFCORE_REQUESTS.\nNote: A prefetch promoted to Demand is counted from the promotion point.",
316 "EventCode": "0x60",
317 "Counter": "0,1,2,3",
318 "UMask": "0x1",
319 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD",
320 "SampleAfterValue": "2000003",
321 "BriefDescription": "Offcore outstanding Demand Data Read transactions in uncore queue.",
322 "CounterHTOff": "0,1,2,3,4,5,6,7"
323 },
324 {
325 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
326 "EventCode": "0x60",
327 "Counter": "0,1,2,3",
328 "UMask": "0x2",
329 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
330 "SampleAfterValue": "2000003",
331 "BriefDescription": "Offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle. ",
332 "CounterHTOff": "0,1,2,3,4,5,6,7"
333 },
334 {
335 "PublicDescription": "This event counts the number of offcore outstanding RFO (store) transactions in the super queue (SQ) every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
336 "EventCode": "0x60",
337 "Counter": "0,1,2,3",
338 "UMask": "0x4",
339 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO",
340 "SampleAfterValue": "2000003",
341 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
342 "CounterHTOff": "0,1,2,3,4,5,6,7"
343 },
344 {
345 "PublicDescription": "This event counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
346 "EventCode": "0x60",
347 "Counter": "0,1,2,3",
348 "UMask": "0x8",
349 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
350 "SampleAfterValue": "2000003",
351 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
352 "CounterHTOff": "0,1,2,3,4,5,6,7"
353 },
354 {
355 "PublicDescription": "This event counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).",
356 "EventCode": "0x60",
357 "Counter": "0,1,2,3",
358 "UMask": "0x1",
359 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
360 "SampleAfterValue": "2000003",
361 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
362 "CounterMask": "1",
363 "CounterHTOff": "0,1,2,3,4,5,6,7"
364 },
365 {
366 "PublicDescription": "This event counts cycles when offcore outstanding cacheable Core Data Read transactions are present in the super queue. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
367 "EventCode": "0x60",
368 "Counter": "0,1,2,3",
369 "UMask": "0x8",
370 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD",
371 "SampleAfterValue": "2000003",
372 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
373 "CounterMask": "1",
374 "CounterHTOff": "0,1,2,3,4,5,6,7"
375 },
376 {
377 "PublicDescription": "This event counts the number of cases when the offcore requests buffer cannot take more entries for the core. This can happen when the superqueue does not contain eligible entries, or when L1D writeback pending FIFO requests is full.\nNote: Writeback pending FIFO has six entries.",
378 "EventCode": "0xB2",
379 "Counter": "0,1,2,3",
380 "UMask": "0x1",
381 "EventName": "OFFCORE_REQUESTS_BUFFER.SQ_FULL",
382 "SampleAfterValue": "2000003",
383 "BriefDescription": "Offcore requests buffer cannot take more entries for this thread core.",
384 "CounterHTOff": "0,1,2,3,4,5,6,7"
385 },
386 {
387 "PublicDescription": "This event counts L2 writebacks that access L2 cache.",
388 "EventCode": "0xF0",
389 "Counter": "0,1,2,3",
390 "UMask": "0x40",
391 "EventName": "L2_TRANS.L2_WB",
392 "SampleAfterValue": "200003",
393 "BriefDescription": "L2 writebacks that access L2 cache",
394 "CounterHTOff": "0,1,2,3,4,5,6,7"
395 },
396 {
397 "PublicDescription": "This event counts core-originated cacheable demand requests that miss the last level cache (LLC). Demand requests include loads, RFOs, and hardware prefetches from L1D, and instruction fetches from IFU.",
398 "EventCode": "0x2E",
399 "Counter": "0,1,2,3",
400 "UMask": "0x41",
401 "Errata": "SKL057",
402 "EventName": "LONGEST_LAT_CACHE.MISS",
403 "SampleAfterValue": "100003",
404 "BriefDescription": "Core-originated cacheable demand requests missed L3",
405 "CounterHTOff": "0,1,2,3,4,5,6,7"
406 },
407 {
408 "PublicDescription": "This event counts core-originated cacheable demand requests that refer to the last level cache (LLC). Demand requests include loads, RFOs, and hardware prefetches from L1D, and instruction fetches from IFU.",
409 "EventCode": "0x2E",
410 "Counter": "0,1,2,3",
411 "UMask": "0x4f",
412 "Errata": "SKL057",
413 "EventName": "LONGEST_LAT_CACHE.REFERENCE",
414 "SampleAfterValue": "100003",
415 "BriefDescription": "Core-originated cacheable demand requests that refer to L3",
416 "CounterHTOff": "0,1,2,3,4,5,6,7"
417 },
418 {
419 "PublicDescription": "This event counts the number of cache line split locks sent to the uncore.",
420 "EventCode": "0xF4",
421 "Counter": "0,1,2,3",
422 "UMask": "0x10",
423 "EventName": "SQ_MISC.SPLIT_LOCK",
424 "SampleAfterValue": "100003",
425 "BriefDescription": "Number of cache line split locks sent to uncore.",
426 "CounterHTOff": "0,1,2,3,4,5,6,7"
427 },
428 {
429 "PublicDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
430 "EventCode": "0xB7, 0xBB",
431 "Counter": "0,1,2,3",
432 "UMask": "0x1",
433 "EventName": "OFFCORE_RESPONSE",
434 "SampleAfterValue": "100003",
435 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction",
436 "CounterHTOff": "0,1,2,3"
437 },
438 {
439 "PublicDescription": "This event counts the number of demand Data Read requests that miss L2 cache. Only not rejected loads are counted.",
440 "EventCode": "0x24", 4 "EventCode": "0x24",
441 "Counter": "0,1,2,3", 5 "Counter": "0,1,2,3",
442 "UMask": "0x21", 6 "UMask": "0x21",
@@ -446,122 +10,123 @@
446 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
447 }, 11 },
448 { 12 {
449 "PublicDescription": "This event counts the number of demand Data Read requests that hit L2 cache. Only not rejected loads are counted.", 13 "PublicDescription": "Counts the RFO (Read-for-Ownership) requests that miss L2 cache.",
450 "EventCode": "0x24", 14 "EventCode": "0x24",
451 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
452 "UMask": "0x41", 16 "UMask": "0x22",
453 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT", 17 "EventName": "L2_RQSTS.RFO_MISS",
454 "SampleAfterValue": "200003", 18 "SampleAfterValue": "200003",
455 "BriefDescription": "Demand Data Read requests that hit L2 cache", 19 "BriefDescription": "RFO requests that miss L2 cache",
456 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
457 }, 21 },
458 { 22 {
459 "PublicDescription": "This event counts the number of demand Data Read requests (including requests from L1D hardware prefetchers). These loads may hit or miss L2 cache. Only non rejected loads are counted.", 23 "PublicDescription": "Counts L2 cache misses when fetching instructions.",
460 "EventCode": "0x24", 24 "EventCode": "0x24",
461 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
462 "UMask": "0xe1", 26 "UMask": "0x24",
463 "EventName": "L2_RQSTS.ALL_DEMAND_DATA_RD", 27 "EventName": "L2_RQSTS.CODE_RD_MISS",
464 "SampleAfterValue": "200003", 28 "SampleAfterValue": "200003",
465 "BriefDescription": "Demand Data Read requests", 29 "BriefDescription": "L2 cache misses when fetching instructions",
466 "CounterHTOff": "0,1,2,3,4,5,6,7" 30 "CounterHTOff": "0,1,2,3,4,5,6,7"
467 }, 31 },
468 { 32 {
469 "PublicDescription": "This event counts the total number of RFO (read for ownership) requests to L2 cache. L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches.", 33 "PublicDescription": "Demand requests that miss L2 cache.",
470 "EventCode": "0x24", 34 "EventCode": "0x24",
471 "Counter": "0,1,2,3", 35 "Counter": "0,1,2,3",
472 "UMask": "0xe2", 36 "UMask": "0x27",
473 "EventName": "L2_RQSTS.ALL_RFO", 37 "EventName": "L2_RQSTS.ALL_DEMAND_MISS",
474 "SampleAfterValue": "200003", 38 "SampleAfterValue": "200003",
475 "BriefDescription": "RFO requests to L2 cache", 39 "BriefDescription": "Demand requests that miss L2 cache",
476 "CounterHTOff": "0,1,2,3,4,5,6,7" 40 "CounterHTOff": "0,1,2,3,4,5,6,7"
477 }, 41 },
478 { 42 {
479 "PublicDescription": "This event counts the total number of L2 code requests.", 43 "PublicDescription": "Counts requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that miss L2 cache.",
480 "EventCode": "0x24", 44 "EventCode": "0x24",
481 "Counter": "0,1,2,3", 45 "Counter": "0,1,2,3",
482 "UMask": "0xe4", 46 "UMask": "0x38",
483 "EventName": "L2_RQSTS.ALL_CODE_RD", 47 "EventName": "L2_RQSTS.PF_MISS",
484 "SampleAfterValue": "200003", 48 "SampleAfterValue": "200003",
485 "BriefDescription": "L2 code requests", 49 "BriefDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that miss L2 cache",
486 "CounterHTOff": "0,1,2,3,4,5,6,7" 50 "CounterHTOff": "0,1,2,3,4,5,6,7"
487 }, 51 },
488 { 52 {
489 "PublicDescription": "This event counts the total number of requests from the L2 hardware prefetchers.", 53 "PublicDescription": "All requests that miss L2 cache.",
490 "EventCode": "0x24", 54 "EventCode": "0x24",
491 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
492 "UMask": "0xf8", 56 "UMask": "0x3f",
493 "EventName": "L2_RQSTS.ALL_PF", 57 "EventName": "L2_RQSTS.MISS",
494 "SampleAfterValue": "200003", 58 "SampleAfterValue": "200003",
495 "BriefDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches", 59 "BriefDescription": "All requests that miss L2 cache",
496 "CounterHTOff": "0,1,2,3,4,5,6,7" 60 "CounterHTOff": "0,1,2,3,4,5,6,7"
497 }, 61 },
498 { 62 {
499 "PublicDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that miss L2 cache.", 63 "PublicDescription": "Counts the number of demand Data Read requests that hit L2 cache. Only non rejected loads are counted.",
500 "EventCode": "0x24", 64 "EventCode": "0x24",
501 "Counter": "0,1,2,3", 65 "Counter": "0,1,2,3",
502 "UMask": "0x38", 66 "UMask": "0x41",
503 "EventName": "L2_RQSTS.PF_MISS", 67 "EventName": "L2_RQSTS.DEMAND_DATA_RD_HIT",
504 "SampleAfterValue": "200003", 68 "SampleAfterValue": "200003",
505 "BriefDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that miss L2 cache", 69 "BriefDescription": "Demand Data Read requests that hit L2 cache",
506 "CounterHTOff": "0,1,2,3,4,5,6,7" 70 "CounterHTOff": "0,1,2,3,4,5,6,7"
507 }, 71 },
508 { 72 {
509 "PublicDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that hit L2 cache.", 73 "PublicDescription": "Counts the RFO (Read-for-Ownership) requests that hit L2 cache.",
510 "EventCode": "0x24", 74 "EventCode": "0x24",
511 "Counter": "0,1,2,3", 75 "Counter": "0,1,2,3",
512 "UMask": "0xd8", 76 "UMask": "0x42",
513 "EventName": "L2_RQSTS.PF_HIT", 77 "EventName": "L2_RQSTS.RFO_HIT",
514 "SampleAfterValue": "200003", 78 "SampleAfterValue": "200003",
515 "BriefDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that hit L2 cache", 79 "BriefDescription": "RFO requests that hit L2 cache",
516 "CounterHTOff": "0,1,2,3,4,5,6,7" 80 "CounterHTOff": "0,1,2,3,4,5,6,7"
517 }, 81 },
518 { 82 {
519 "PublicDescription": "RFO requests that hit L2 cache.", 83 "PublicDescription": "Counts L2 cache hits when fetching instructions, code reads.",
520 "EventCode": "0x24", 84 "EventCode": "0x24",
521 "Counter": "0,1,2,3", 85 "Counter": "0,1,2,3",
522 "UMask": "0x42", 86 "UMask": "0x44",
523 "EventName": "L2_RQSTS.RFO_HIT", 87 "EventName": "L2_RQSTS.CODE_RD_HIT",
524 "SampleAfterValue": "200003", 88 "SampleAfterValue": "200003",
525 "BriefDescription": "RFO requests that hit L2 cache", 89 "BriefDescription": "L2 cache hits when fetching instructions, code reads.",
526 "CounterHTOff": "0,1,2,3,4,5,6,7" 90 "CounterHTOff": "0,1,2,3,4,5,6,7"
527 }, 91 },
528 { 92 {
529 "PublicDescription": "RFO requests that miss L2 cache.", 93 "PublicDescription": "Counts requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that hit L2 cache.",
530 "EventCode": "0x24", 94 "EventCode": "0x24",
531 "Counter": "0,1,2,3", 95 "Counter": "0,1,2,3",
532 "UMask": "0x22", 96 "UMask": "0xd8",
533 "EventName": "L2_RQSTS.RFO_MISS", 97 "EventName": "L2_RQSTS.PF_HIT",
534 "SampleAfterValue": "200003", 98 "SampleAfterValue": "200003",
535 "BriefDescription": "RFO requests that miss L2 cache", 99 "BriefDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches that hit L2 cache",
536 "CounterHTOff": "0,1,2,3,4,5,6,7" 100 "CounterHTOff": "0,1,2,3,4,5,6,7"
537 }, 101 },
538 { 102 {
103 "PublicDescription": "Counts the number of demand Data Read requests (including requests from L1D hardware prefetchers). These loads may hit or miss L2 cache. Only non rejected loads are counted.",
539 "EventCode": "0x24", 104 "EventCode": "0x24",
540 "Counter": "0,1,2,3", 105 "Counter": "0,1,2,3",
541 "UMask": "0x44", 106 "UMask": "0xe1",
542 "EventName": "L2_RQSTS.CODE_RD_HIT", 107 "EventName": "L2_RQSTS.ALL_DEMAND_DATA_RD",
543 "SampleAfterValue": "200003", 108 "SampleAfterValue": "200003",
544 "BriefDescription": "L2 cache hits when fetching instructions, code reads.", 109 "BriefDescription": "Demand Data Read requests",
545 "CounterHTOff": "0,1,2,3,4,5,6,7" 110 "CounterHTOff": "0,1,2,3,4,5,6,7"
546 }, 111 },
547 { 112 {
548 "PublicDescription": "L2 cache misses when fetching instructions.", 113 "PublicDescription": "Counts the total number of RFO (read for ownership) requests to L2 cache. L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches.",
549 "EventCode": "0x24", 114 "EventCode": "0x24",
550 "Counter": "0,1,2,3", 115 "Counter": "0,1,2,3",
551 "UMask": "0x24", 116 "UMask": "0xe2",
552 "EventName": "L2_RQSTS.CODE_RD_MISS", 117 "EventName": "L2_RQSTS.ALL_RFO",
553 "SampleAfterValue": "200003", 118 "SampleAfterValue": "200003",
554 "BriefDescription": "L2 cache misses when fetching instructions", 119 "BriefDescription": "RFO requests to L2 cache",
555 "CounterHTOff": "0,1,2,3,4,5,6,7" 120 "CounterHTOff": "0,1,2,3,4,5,6,7"
556 }, 121 },
557 { 122 {
558 "PublicDescription": "Demand requests that miss L2 cache.", 123 "PublicDescription": "Counts the total number of L2 code requests.",
559 "EventCode": "0x24", 124 "EventCode": "0x24",
560 "Counter": "0,1,2,3", 125 "Counter": "0,1,2,3",
561 "UMask": "0x27", 126 "UMask": "0xe4",
562 "EventName": "L2_RQSTS.ALL_DEMAND_MISS", 127 "EventName": "L2_RQSTS.ALL_CODE_RD",
563 "SampleAfterValue": "200003", 128 "SampleAfterValue": "200003",
564 "BriefDescription": "Demand requests that miss L2 cache", 129 "BriefDescription": "L2 code requests",
565 "CounterHTOff": "0,1,2,3,4,5,6,7" 130 "CounterHTOff": "0,1,2,3,4,5,6,7"
566 }, 131 },
567 { 132 {
@@ -575,13 +140,13 @@
575 "CounterHTOff": "0,1,2,3,4,5,6,7" 140 "CounterHTOff": "0,1,2,3,4,5,6,7"
576 }, 141 },
577 { 142 {
578 "PublicDescription": "All requests that miss L2 cache.", 143 "PublicDescription": "Counts the total number of requests from the L2 hardware prefetchers.",
579 "EventCode": "0x24", 144 "EventCode": "0x24",
580 "Counter": "0,1,2,3", 145 "Counter": "0,1,2,3",
581 "UMask": "0x3f", 146 "UMask": "0xf8",
582 "EventName": "L2_RQSTS.MISS", 147 "EventName": "L2_RQSTS.ALL_PF",
583 "SampleAfterValue": "200003", 148 "SampleAfterValue": "200003",
584 "BriefDescription": "All requests that miss L2 cache", 149 "BriefDescription": "Requests from the L1/L2/L3 hardware prefetchers or Load software prefetches",
585 "CounterHTOff": "0,1,2,3,4,5,6,7" 150 "CounterHTOff": "0,1,2,3,4,5,6,7"
586 }, 151 },
587 { 152 {
@@ -595,62 +160,45 @@
595 "CounterHTOff": "0,1,2,3,4,5,6,7" 160 "CounterHTOff": "0,1,2,3,4,5,6,7"
596 }, 161 },
597 { 162 {
598 "EventCode": "0xF2", 163 "PublicDescription": "Counts core-originated cacheable requests that miss the L3 cache (Longest Latency cache). Requests include data and code reads, Reads-for-Ownership (RFOs), speculative accesses and hardware prefetches from L1 and L2. It does not include all misses to the L3.",
599 "Counter": "0,1,2,3", 164 "EventCode": "0x2E",
600 "UMask": "0x1",
601 "EventName": "L2_LINES_OUT.SILENT",
602 "SampleAfterValue": "200003",
603 "BriefDescription": "Counts the number of lines that are silently dropped by L2 cache when triggered by an L2 cache fill. These lines are typically in Shared or Exclusive state. A non-threaded event.",
604 "CounterHTOff": "0,1,2,3,4,5,6,7"
605 },
606 {
607 "EventCode": "0xF2",
608 "Counter": "0,1,2,3",
609 "UMask": "0x2",
610 "EventName": "L2_LINES_OUT.NON_SILENT",
611 "SampleAfterValue": "200003",
612 "BriefDescription": "Counts the number of lines that are evicted by L2 cache when triggered by an L2 cache fill. Those lines are in Modified state. Modified lines are written back to L3",
613 "CounterHTOff": "0,1,2,3,4,5,6,7"
614 },
615 {
616 "PublicDescription": "Counts the number of lines that have been hardware prefetched but not used and now evicted by L2 cache.",
617 "EventCode": "0xF2",
618 "Counter": "0,1,2,3", 165 "Counter": "0,1,2,3",
619 "UMask": "0x4", 166 "UMask": "0x41",
620 "EventName": "L2_LINES_OUT.USELESS_PREF", 167 "Errata": "SKL057",
621 "SampleAfterValue": "200003", 168 "EventName": "LONGEST_LAT_CACHE.MISS",
622 "BriefDescription": "Counts the number of lines that have been hardware prefetched but not used and now evicted by L2 cache", 169 "SampleAfterValue": "100003",
170 "BriefDescription": "Core-originated cacheable demand requests missed L3",
623 "CounterHTOff": "0,1,2,3,4,5,6,7" 171 "CounterHTOff": "0,1,2,3,4,5,6,7"
624 }, 172 },
625 { 173 {
626 "PublicDescription": "This event counts the number of L2 cache lines filling the L2. Counting does not cover rejects.", 174 "PublicDescription": "Counts core-originated cacheable requests to the L3 cache (Longest Latency cache). Requests include data and code reads, Reads-for-Ownership (RFOs), speculative accesses and hardware prefetches from L1 and L2. It does not include all accesses to the L3.",
627 "EventCode": "0xF1", 175 "EventCode": "0x2E",
628 "Counter": "0,1,2,3", 176 "Counter": "0,1,2,3",
629 "UMask": "0x1f", 177 "UMask": "0x4f",
630 "EventName": "L2_LINES_IN.ALL", 178 "Errata": "SKL057",
179 "EventName": "LONGEST_LAT_CACHE.REFERENCE",
631 "SampleAfterValue": "100003", 180 "SampleAfterValue": "100003",
632 "BriefDescription": "L2 cache lines filling L2", 181 "BriefDescription": "Core-originated cacheable demand requests that refer to L3",
633 "CounterHTOff": "0,1,2,3,4,5,6,7" 182 "CounterHTOff": "0,1,2,3,4,5,6,7"
634 }, 183 },
635 { 184 {
636 "PublicDescription": "This event counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.", 185 "PublicDescription": "Counts duration of L1D miss outstanding, that is each cycle number of Fill Buffers (FB) outstanding required by Demand Reads. FB either is held by demand loads, or it is held by non-demand loads and gets hit at least once by demand. The valid outstanding interval is defined until the FB deallocation by one of the following ways: from FB allocation, if FB is allocated by demand from the demand Hit FB, if it is allocated by hardware or software prefetch.Note: In the L1D, a Demand Read contains cacheable or noncacheable demand loads, including ones causing cache-line splits and reads due to page walks resulted from any request type.",
637 "EventCode": "0x60", 186 "EventCode": "0x48",
638 "Counter": "0,1,2,3", 187 "Counter": "0,1,2,3",
639 "UMask": "0x2", 188 "UMask": "0x1",
640 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD", 189 "EventName": "L1D_PEND_MISS.PENDING",
641 "SampleAfterValue": "2000003", 190 "SampleAfterValue": "2000003",
642 "BriefDescription": "Cycles with offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore.", 191 "BriefDescription": "L1D miss outstandings duration in cycles",
643 "CounterMask": "1",
644 "CounterHTOff": "0,1,2,3,4,5,6,7" 192 "CounterHTOff": "0,1,2,3,4,5,6,7"
645 }, 193 },
646 { 194 {
647 "PublicDescription": "This event counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.", 195 "PublicDescription": "Counts duration of L1D miss outstanding in cycles.",
648 "EventCode": "0x60", 196 "EventCode": "0x48",
649 "Counter": "0,1,2,3", 197 "Counter": "0,1,2,3",
650 "UMask": "0x4", 198 "UMask": "0x1",
651 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO", 199 "EventName": "L1D_PEND_MISS.PENDING_CYCLES",
652 "SampleAfterValue": "2000003", 200 "SampleAfterValue": "2000003",
653 "BriefDescription": "Cycles with offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore.", 201 "BriefDescription": "Cycles with L1D load Misses outstanding.",
654 "CounterMask": "1", 202 "CounterMask": "1",
655 "CounterHTOff": "0,1,2,3,4,5,6,7" 203 "CounterHTOff": "0,1,2,3,4,5,6,7"
656 }, 204 },
@@ -666,3121 +214,483 @@
666 "CounterHTOff": "0,1,2,3,4,5,6,7" 214 "CounterHTOff": "0,1,2,3,4,5,6,7"
667 }, 215 },
668 { 216 {
669 "EventCode": "0x60", 217 "PublicDescription": "Number of times a request needed a FB (Fill Buffer) entry but there was no entry available for it. A request includes cacheable/uncacheable demands that are load, store or SW prefetch instructions.",
218 "EventCode": "0x48",
670 "Counter": "0,1,2,3", 219 "Counter": "0,1,2,3",
671 "UMask": "0x1", 220 "UMask": "0x2",
672 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6", 221 "EventName": "L1D_PEND_MISS.FB_FULL",
673 "SampleAfterValue": "2000003", 222 "SampleAfterValue": "2000003",
674 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.", 223 "BriefDescription": "Number of times a request needed a FB entry but there was no entry available for it. That is the FB unavailability was dominant reason for blocking the request. A request includes cacheable/uncacheable demands that is load, store or SW prefetch.",
675 "CounterMask": "6",
676 "CounterHTOff": "0,1,2,3,4,5,6,7"
677 },
678 {
679 "EventCode": "0xF2",
680 "Counter": "0,1,2,3",
681 "UMask": "0x4",
682 "EventName": "L2_LINES_OUT.USELESS_HWPF",
683 "SampleAfterValue": "200003",
684 "BriefDescription": "Counts the number of lines that have been hardware prefetched but not used and now evicted by L2 cache",
685 "CounterHTOff": "0,1,2,3,4,5,6,7" 224 "CounterHTOff": "0,1,2,3,4,5,6,7"
686 }, 225 },
687 { 226 {
688 "EventCode": "0xB7, 0xBB", 227 "PublicDescription": "Counts L1D data line replacements including opportunistic replacements, and replacements that require stall-for-replace or block-for-replace.",
689 "MSRValue": "0x3fc0408000 ", 228 "EventCode": "0x51",
690 "Counter": "0,1,2,3",
691 "UMask": "0x1",
692 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.ANY_SNOOP",
693 "MSRIndex": "0x1a6,0x1a7",
694 "SampleAfterValue": "100003",
695 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & ANY_SNOOP",
696 "Offcore": "1",
697 "CounterHTOff": "0,1,2,3"
698 },
699 {
700 "EventCode": "0xB7, 0xBB",
701 "MSRValue": "0x1000408000 ",
702 "Counter": "0,1,2,3",
703 "UMask": "0x1",
704 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SNOOP_HITM",
705 "MSRIndex": "0x1a6,0x1a7",
706 "SampleAfterValue": "100003",
707 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SNOOP_HITM",
708 "Offcore": "1",
709 "CounterHTOff": "0,1,2,3"
710 },
711 {
712 "EventCode": "0xB7, 0xBB",
713 "MSRValue": "0x0400408000 ",
714 "Counter": "0,1,2,3",
715 "UMask": "0x1",
716 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SNOOP_HIT_NO_FWD",
717 "MSRIndex": "0x1a6,0x1a7",
718 "SampleAfterValue": "100003",
719 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SNOOP_HIT_NO_FWD",
720 "Offcore": "1",
721 "CounterHTOff": "0,1,2,3"
722 },
723 {
724 "EventCode": "0xB7, 0xBB",
725 "MSRValue": "0x0200408000 ",
726 "Counter": "0,1,2,3",
727 "UMask": "0x1",
728 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SNOOP_MISS",
729 "MSRIndex": "0x1a6,0x1a7",
730 "SampleAfterValue": "100003",
731 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SNOOP_MISS",
732 "Offcore": "1",
733 "CounterHTOff": "0,1,2,3"
734 },
735 {
736 "EventCode": "0xB7, 0xBB",
737 "MSRValue": "0x0100408000 ",
738 "Counter": "0,1,2,3",
739 "UMask": "0x1",
740 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SNOOP_NOT_NEEDED",
741 "MSRIndex": "0x1a6,0x1a7",
742 "SampleAfterValue": "100003",
743 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SNOOP_NOT_NEEDED",
744 "Offcore": "1",
745 "CounterHTOff": "0,1,2,3"
746 },
747 {
748 "EventCode": "0xB7, 0xBB",
749 "MSRValue": "0x0080408000 ",
750 "Counter": "0,1,2,3",
751 "UMask": "0x1",
752 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SNOOP_NONE",
753 "MSRIndex": "0x1a6,0x1a7",
754 "SampleAfterValue": "100003",
755 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SNOOP_NONE",
756 "Offcore": "1",
757 "CounterHTOff": "0,1,2,3"
758 },
759 {
760 "EventCode": "0xB7, 0xBB",
761 "MSRValue": "0x0040408000 ",
762 "Counter": "0,1,2,3",
763 "UMask": "0x1",
764 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SPL_HIT",
765 "MSRIndex": "0x1a6,0x1a7",
766 "SampleAfterValue": "100003",
767 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SPL_HIT",
768 "Offcore": "1",
769 "CounterHTOff": "0,1,2,3"
770 },
771 {
772 "EventCode": "0xB7, 0xBB",
773 "MSRValue": "0x3fc01c8000 ",
774 "Counter": "0,1,2,3",
775 "UMask": "0x1",
776 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.ANY_SNOOP",
777 "MSRIndex": "0x1a6,0x1a7",
778 "SampleAfterValue": "100003",
779 "BriefDescription": "OTHER & L3_HIT & ANY_SNOOP",
780 "Offcore": "1",
781 "CounterHTOff": "0,1,2,3"
782 },
783 {
784 "EventCode": "0xB7, 0xBB",
785 "MSRValue": "0x10001c8000 ",
786 "Counter": "0,1,2,3",
787 "UMask": "0x1",
788 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_HITM",
789 "MSRIndex": "0x1a6,0x1a7",
790 "SampleAfterValue": "100003",
791 "BriefDescription": "OTHER & L3_HIT & SNOOP_HITM",
792 "Offcore": "1",
793 "CounterHTOff": "0,1,2,3"
794 },
795 {
796 "EventCode": "0xB7, 0xBB",
797 "MSRValue": "0x04001c8000 ",
798 "Counter": "0,1,2,3",
799 "UMask": "0x1",
800 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_HIT_NO_FWD",
801 "MSRIndex": "0x1a6,0x1a7",
802 "SampleAfterValue": "100003",
803 "BriefDescription": "Counts any other requests that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded.",
804 "Offcore": "1",
805 "CounterHTOff": "0,1,2,3"
806 },
807 {
808 "EventCode": "0xB7, 0xBB",
809 "MSRValue": "0x02001c8000 ",
810 "Counter": "0,1,2,3",
811 "UMask": "0x1",
812 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_MISS",
813 "MSRIndex": "0x1a6,0x1a7",
814 "SampleAfterValue": "100003",
815 "BriefDescription": "Counts any other requests that hit in the L3 and the snoops sent to sibling cores return clean response.",
816 "Offcore": "1",
817 "CounterHTOff": "0,1,2,3"
818 },
819 {
820 "EventCode": "0xB7, 0xBB",
821 "MSRValue": "0x01001c8000 ",
822 "Counter": "0,1,2,3",
823 "UMask": "0x1",
824 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_NOT_NEEDED",
825 "MSRIndex": "0x1a6,0x1a7",
826 "SampleAfterValue": "100003",
827 "BriefDescription": "Counts any other requests that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.",
828 "Offcore": "1",
829 "CounterHTOff": "0,1,2,3"
830 },
831 {
832 "EventCode": "0xB7, 0xBB",
833 "MSRValue": "0x00801c8000 ",
834 "Counter": "0,1,2,3",
835 "UMask": "0x1",
836 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_NONE",
837 "MSRIndex": "0x1a6,0x1a7",
838 "SampleAfterValue": "100003",
839 "BriefDescription": "OTHER & L3_HIT & SNOOP_NONE",
840 "Offcore": "1",
841 "CounterHTOff": "0,1,2,3"
842 },
843 {
844 "EventCode": "0xB7, 0xBB",
845 "MSRValue": "0x00401c8000 ",
846 "Counter": "0,1,2,3",
847 "UMask": "0x1",
848 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SPL_HIT",
849 "MSRIndex": "0x1a6,0x1a7",
850 "SampleAfterValue": "100003",
851 "BriefDescription": "OTHER & L3_HIT & SPL_HIT",
852 "Offcore": "1",
853 "CounterHTOff": "0,1,2,3"
854 },
855 {
856 "EventCode": "0xB7, 0xBB",
857 "MSRValue": "0x3fc0108000 ",
858 "Counter": "0,1,2,3",
859 "UMask": "0x1",
860 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.ANY_SNOOP",
861 "MSRIndex": "0x1a6,0x1a7",
862 "SampleAfterValue": "100003",
863 "BriefDescription": "OTHER & L3_HIT_S & ANY_SNOOP",
864 "Offcore": "1",
865 "CounterHTOff": "0,1,2,3"
866 },
867 {
868 "EventCode": "0xB7, 0xBB",
869 "MSRValue": "0x1000108000 ",
870 "Counter": "0,1,2,3",
871 "UMask": "0x1",
872 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SNOOP_HITM",
873 "MSRIndex": "0x1a6,0x1a7",
874 "SampleAfterValue": "100003",
875 "BriefDescription": "OTHER & L3_HIT_S & SNOOP_HITM",
876 "Offcore": "1",
877 "CounterHTOff": "0,1,2,3"
878 },
879 {
880 "EventCode": "0xB7, 0xBB",
881 "MSRValue": "0x0400108000 ",
882 "Counter": "0,1,2,3",
883 "UMask": "0x1",
884 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SNOOP_HIT_NO_FWD",
885 "MSRIndex": "0x1a6,0x1a7",
886 "SampleAfterValue": "100003",
887 "BriefDescription": "OTHER & L3_HIT_S & SNOOP_HIT_NO_FWD",
888 "Offcore": "1",
889 "CounterHTOff": "0,1,2,3"
890 },
891 {
892 "EventCode": "0xB7, 0xBB",
893 "MSRValue": "0x0200108000 ",
894 "Counter": "0,1,2,3",
895 "UMask": "0x1",
896 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SNOOP_MISS",
897 "MSRIndex": "0x1a6,0x1a7",
898 "SampleAfterValue": "100003",
899 "BriefDescription": "OTHER & L3_HIT_S & SNOOP_MISS",
900 "Offcore": "1",
901 "CounterHTOff": "0,1,2,3"
902 },
903 {
904 "EventCode": "0xB7, 0xBB",
905 "MSRValue": "0x0100108000 ",
906 "Counter": "0,1,2,3",
907 "UMask": "0x1",
908 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SNOOP_NOT_NEEDED",
909 "MSRIndex": "0x1a6,0x1a7",
910 "SampleAfterValue": "100003",
911 "BriefDescription": "OTHER & L3_HIT_S & SNOOP_NOT_NEEDED",
912 "Offcore": "1",
913 "CounterHTOff": "0,1,2,3"
914 },
915 {
916 "EventCode": "0xB7, 0xBB",
917 "MSRValue": "0x0080108000 ",
918 "Counter": "0,1,2,3",
919 "UMask": "0x1",
920 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SNOOP_NONE",
921 "MSRIndex": "0x1a6,0x1a7",
922 "SampleAfterValue": "100003",
923 "BriefDescription": "OTHER & L3_HIT_S & SNOOP_NONE",
924 "Offcore": "1",
925 "CounterHTOff": "0,1,2,3"
926 },
927 {
928 "EventCode": "0xB7, 0xBB",
929 "MSRValue": "0x0040108000 ",
930 "Counter": "0,1,2,3",
931 "UMask": "0x1",
932 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SPL_HIT",
933 "MSRIndex": "0x1a6,0x1a7",
934 "SampleAfterValue": "100003",
935 "BriefDescription": "OTHER & L3_HIT_S & SPL_HIT",
936 "Offcore": "1",
937 "CounterHTOff": "0,1,2,3"
938 },
939 {
940 "EventCode": "0xB7, 0xBB",
941 "MSRValue": "0x3fc0088000 ",
942 "Counter": "0,1,2,3",
943 "UMask": "0x1",
944 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.ANY_SNOOP",
945 "MSRIndex": "0x1a6,0x1a7",
946 "SampleAfterValue": "100003",
947 "BriefDescription": "OTHER & L3_HIT_E & ANY_SNOOP",
948 "Offcore": "1",
949 "CounterHTOff": "0,1,2,3"
950 },
951 {
952 "EventCode": "0xB7, 0xBB",
953 "MSRValue": "0x1000088000 ",
954 "Counter": "0,1,2,3",
955 "UMask": "0x1",
956 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SNOOP_HITM",
957 "MSRIndex": "0x1a6,0x1a7",
958 "SampleAfterValue": "100003",
959 "BriefDescription": "OTHER & L3_HIT_E & SNOOP_HITM",
960 "Offcore": "1",
961 "CounterHTOff": "0,1,2,3"
962 },
963 {
964 "EventCode": "0xB7, 0xBB",
965 "MSRValue": "0x0400088000 ",
966 "Counter": "0,1,2,3",
967 "UMask": "0x1",
968 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SNOOP_HIT_NO_FWD",
969 "MSRIndex": "0x1a6,0x1a7",
970 "SampleAfterValue": "100003",
971 "BriefDescription": "OTHER & L3_HIT_E & SNOOP_HIT_NO_FWD",
972 "Offcore": "1",
973 "CounterHTOff": "0,1,2,3"
974 },
975 {
976 "EventCode": "0xB7, 0xBB",
977 "MSRValue": "0x0200088000 ",
978 "Counter": "0,1,2,3",
979 "UMask": "0x1",
980 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SNOOP_MISS",
981 "MSRIndex": "0x1a6,0x1a7",
982 "SampleAfterValue": "100003",
983 "BriefDescription": "OTHER & L3_HIT_E & SNOOP_MISS",
984 "Offcore": "1",
985 "CounterHTOff": "0,1,2,3"
986 },
987 {
988 "EventCode": "0xB7, 0xBB",
989 "MSRValue": "0x0100088000 ",
990 "Counter": "0,1,2,3",
991 "UMask": "0x1",
992 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SNOOP_NOT_NEEDED",
993 "MSRIndex": "0x1a6,0x1a7",
994 "SampleAfterValue": "100003",
995 "BriefDescription": "OTHER & L3_HIT_E & SNOOP_NOT_NEEDED",
996 "Offcore": "1",
997 "CounterHTOff": "0,1,2,3"
998 },
999 {
1000 "EventCode": "0xB7, 0xBB",
1001 "MSRValue": "0x0080088000 ",
1002 "Counter": "0,1,2,3",
1003 "UMask": "0x1",
1004 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SNOOP_NONE",
1005 "MSRIndex": "0x1a6,0x1a7",
1006 "SampleAfterValue": "100003",
1007 "BriefDescription": "OTHER & L3_HIT_E & SNOOP_NONE",
1008 "Offcore": "1",
1009 "CounterHTOff": "0,1,2,3"
1010 },
1011 {
1012 "EventCode": "0xB7, 0xBB",
1013 "MSRValue": "0x0040088000 ",
1014 "Counter": "0,1,2,3",
1015 "UMask": "0x1",
1016 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SPL_HIT",
1017 "MSRIndex": "0x1a6,0x1a7",
1018 "SampleAfterValue": "100003",
1019 "BriefDescription": "OTHER & L3_HIT_E & SPL_HIT",
1020 "Offcore": "1",
1021 "CounterHTOff": "0,1,2,3"
1022 },
1023 {
1024 "EventCode": "0xB7, 0xBB",
1025 "MSRValue": "0x3fc0048000 ",
1026 "Counter": "0,1,2,3",
1027 "UMask": "0x1",
1028 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.ANY_SNOOP",
1029 "MSRIndex": "0x1a6,0x1a7",
1030 "SampleAfterValue": "100003",
1031 "BriefDescription": "OTHER & L3_HIT_M & ANY_SNOOP",
1032 "Offcore": "1",
1033 "CounterHTOff": "0,1,2,3"
1034 },
1035 {
1036 "EventCode": "0xB7, 0xBB",
1037 "MSRValue": "0x1000048000 ",
1038 "Counter": "0,1,2,3",
1039 "UMask": "0x1",
1040 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SNOOP_HITM",
1041 "MSRIndex": "0x1a6,0x1a7",
1042 "SampleAfterValue": "100003",
1043 "BriefDescription": "OTHER & L3_HIT_M & SNOOP_HITM",
1044 "Offcore": "1",
1045 "CounterHTOff": "0,1,2,3"
1046 },
1047 {
1048 "EventCode": "0xB7, 0xBB",
1049 "MSRValue": "0x0400048000 ",
1050 "Counter": "0,1,2,3",
1051 "UMask": "0x1",
1052 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SNOOP_HIT_NO_FWD",
1053 "MSRIndex": "0x1a6,0x1a7",
1054 "SampleAfterValue": "100003",
1055 "BriefDescription": "OTHER & L3_HIT_M & SNOOP_HIT_NO_FWD",
1056 "Offcore": "1",
1057 "CounterHTOff": "0,1,2,3"
1058 },
1059 {
1060 "EventCode": "0xB7, 0xBB",
1061 "MSRValue": "0x0200048000 ",
1062 "Counter": "0,1,2,3",
1063 "UMask": "0x1",
1064 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SNOOP_MISS",
1065 "MSRIndex": "0x1a6,0x1a7",
1066 "SampleAfterValue": "100003",
1067 "BriefDescription": "OTHER & L3_HIT_M & SNOOP_MISS",
1068 "Offcore": "1",
1069 "CounterHTOff": "0,1,2,3"
1070 },
1071 {
1072 "EventCode": "0xB7, 0xBB",
1073 "MSRValue": "0x0100048000 ",
1074 "Counter": "0,1,2,3",
1075 "UMask": "0x1",
1076 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SNOOP_NOT_NEEDED",
1077 "MSRIndex": "0x1a6,0x1a7",
1078 "SampleAfterValue": "100003",
1079 "BriefDescription": "OTHER & L3_HIT_M & SNOOP_NOT_NEEDED",
1080 "Offcore": "1",
1081 "CounterHTOff": "0,1,2,3"
1082 },
1083 {
1084 "EventCode": "0xB7, 0xBB",
1085 "MSRValue": "0x0080048000 ",
1086 "Counter": "0,1,2,3",
1087 "UMask": "0x1",
1088 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SNOOP_NONE",
1089 "MSRIndex": "0x1a6,0x1a7",
1090 "SampleAfterValue": "100003",
1091 "BriefDescription": "OTHER & L3_HIT_M & SNOOP_NONE",
1092 "Offcore": "1",
1093 "CounterHTOff": "0,1,2,3"
1094 },
1095 {
1096 "EventCode": "0xB7, 0xBB",
1097 "MSRValue": "0x0040048000 ",
1098 "Counter": "0,1,2,3",
1099 "UMask": "0x1",
1100 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SPL_HIT",
1101 "MSRIndex": "0x1a6,0x1a7",
1102 "SampleAfterValue": "100003",
1103 "BriefDescription": "OTHER & L3_HIT_M & SPL_HIT",
1104 "Offcore": "1",
1105 "CounterHTOff": "0,1,2,3"
1106 },
1107 {
1108 "EventCode": "0xB7, 0xBB",
1109 "MSRValue": "0x3fc0028000 ",
1110 "Counter": "0,1,2,3",
1111 "UMask": "0x1",
1112 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.ANY_SNOOP",
1113 "MSRIndex": "0x1a6,0x1a7",
1114 "SampleAfterValue": "100003",
1115 "BriefDescription": "OTHER & SUPPLIER_NONE & ANY_SNOOP",
1116 "Offcore": "1",
1117 "CounterHTOff": "0,1,2,3"
1118 },
1119 {
1120 "EventCode": "0xB7, 0xBB",
1121 "MSRValue": "0x1000028000 ",
1122 "Counter": "0,1,2,3",
1123 "UMask": "0x1",
1124 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SNOOP_HITM",
1125 "MSRIndex": "0x1a6,0x1a7",
1126 "SampleAfterValue": "100003",
1127 "BriefDescription": "OTHER & SUPPLIER_NONE & SNOOP_HITM",
1128 "Offcore": "1",
1129 "CounterHTOff": "0,1,2,3"
1130 },
1131 {
1132 "EventCode": "0xB7, 0xBB",
1133 "MSRValue": "0x0400028000 ",
1134 "Counter": "0,1,2,3",
1135 "UMask": "0x1",
1136 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SNOOP_HIT_NO_FWD",
1137 "MSRIndex": "0x1a6,0x1a7",
1138 "SampleAfterValue": "100003",
1139 "BriefDescription": "OTHER & SUPPLIER_NONE & SNOOP_HIT_NO_FWD",
1140 "Offcore": "1",
1141 "CounterHTOff": "0,1,2,3"
1142 },
1143 {
1144 "EventCode": "0xB7, 0xBB",
1145 "MSRValue": "0x0200028000 ",
1146 "Counter": "0,1,2,3",
1147 "UMask": "0x1",
1148 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SNOOP_MISS",
1149 "MSRIndex": "0x1a6,0x1a7",
1150 "SampleAfterValue": "100003",
1151 "BriefDescription": "OTHER & SUPPLIER_NONE & SNOOP_MISS",
1152 "Offcore": "1",
1153 "CounterHTOff": "0,1,2,3"
1154 },
1155 {
1156 "EventCode": "0xB7, 0xBB",
1157 "MSRValue": "0x0100028000 ",
1158 "Counter": "0,1,2,3",
1159 "UMask": "0x1",
1160 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SNOOP_NOT_NEEDED",
1161 "MSRIndex": "0x1a6,0x1a7",
1162 "SampleAfterValue": "100003",
1163 "BriefDescription": "OTHER & SUPPLIER_NONE & SNOOP_NOT_NEEDED",
1164 "Offcore": "1",
1165 "CounterHTOff": "0,1,2,3"
1166 },
1167 {
1168 "EventCode": "0xB7, 0xBB",
1169 "MSRValue": "0x0080028000 ",
1170 "Counter": "0,1,2,3",
1171 "UMask": "0x1",
1172 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SNOOP_NONE",
1173 "MSRIndex": "0x1a6,0x1a7",
1174 "SampleAfterValue": "100003",
1175 "BriefDescription": "OTHER & SUPPLIER_NONE & SNOOP_NONE",
1176 "Offcore": "1",
1177 "CounterHTOff": "0,1,2,3"
1178 },
1179 {
1180 "EventCode": "0xB7, 0xBB",
1181 "MSRValue": "0x0040028000 ",
1182 "Counter": "0,1,2,3",
1183 "UMask": "0x1",
1184 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SPL_HIT",
1185 "MSRIndex": "0x1a6,0x1a7",
1186 "SampleAfterValue": "100003",
1187 "BriefDescription": "OTHER & SUPPLIER_NONE & SPL_HIT",
1188 "Offcore": "1",
1189 "CounterHTOff": "0,1,2,3"
1190 },
1191 {
1192 "EventCode": "0xB7, 0xBB",
1193 "MSRValue": "0x0000018000 ",
1194 "Counter": "0,1,2,3",
1195 "UMask": "0x1",
1196 "EventName": "OFFCORE_RESPONSE.OTHER.ANY_RESPONSE",
1197 "MSRIndex": "0x1a6,0x1a7",
1198 "SampleAfterValue": "100003",
1199 "BriefDescription": "Counts any other requests that have any response type.",
1200 "Offcore": "1",
1201 "CounterHTOff": "0,1,2,3"
1202 },
1203 {
1204 "EventCode": "0xB7, 0xBB",
1205 "MSRValue": "0x3fc0400800 ",
1206 "Counter": "0,1,2,3",
1207 "UMask": "0x1",
1208 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.ANY_SNOOP",
1209 "MSRIndex": "0x1a6,0x1a7",
1210 "SampleAfterValue": "100003",
1211 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & ANY_SNOOP",
1212 "Offcore": "1",
1213 "CounterHTOff": "0,1,2,3"
1214 },
1215 {
1216 "EventCode": "0xB7, 0xBB",
1217 "MSRValue": "0x1000400800 ",
1218 "Counter": "0,1,2,3",
1219 "UMask": "0x1",
1220 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SNOOP_HITM",
1221 "MSRIndex": "0x1a6,0x1a7",
1222 "SampleAfterValue": "100003",
1223 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SNOOP_HITM",
1224 "Offcore": "1",
1225 "CounterHTOff": "0,1,2,3"
1226 },
1227 {
1228 "EventCode": "0xB7, 0xBB",
1229 "MSRValue": "0x0400400800 ",
1230 "Counter": "0,1,2,3",
1231 "UMask": "0x1",
1232 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SNOOP_HIT_NO_FWD",
1233 "MSRIndex": "0x1a6,0x1a7",
1234 "SampleAfterValue": "100003",
1235 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SNOOP_HIT_NO_FWD",
1236 "Offcore": "1",
1237 "CounterHTOff": "0,1,2,3"
1238 },
1239 {
1240 "EventCode": "0xB7, 0xBB",
1241 "MSRValue": "0x0200400800 ",
1242 "Counter": "0,1,2,3",
1243 "UMask": "0x1",
1244 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SNOOP_MISS",
1245 "MSRIndex": "0x1a6,0x1a7",
1246 "SampleAfterValue": "100003",
1247 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SNOOP_MISS",
1248 "Offcore": "1",
1249 "CounterHTOff": "0,1,2,3"
1250 },
1251 {
1252 "EventCode": "0xB7, 0xBB",
1253 "MSRValue": "0x0100400800 ",
1254 "Counter": "0,1,2,3",
1255 "UMask": "0x1",
1256 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SNOOP_NOT_NEEDED",
1257 "MSRIndex": "0x1a6,0x1a7",
1258 "SampleAfterValue": "100003",
1259 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SNOOP_NOT_NEEDED",
1260 "Offcore": "1",
1261 "CounterHTOff": "0,1,2,3"
1262 },
1263 {
1264 "EventCode": "0xB7, 0xBB",
1265 "MSRValue": "0x0080400800 ",
1266 "Counter": "0,1,2,3",
1267 "UMask": "0x1",
1268 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SNOOP_NONE",
1269 "MSRIndex": "0x1a6,0x1a7",
1270 "SampleAfterValue": "100003",
1271 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SNOOP_NONE",
1272 "Offcore": "1",
1273 "CounterHTOff": "0,1,2,3"
1274 },
1275 {
1276 "EventCode": "0xB7, 0xBB",
1277 "MSRValue": "0x0040400800 ",
1278 "Counter": "0,1,2,3",
1279 "UMask": "0x1",
1280 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SPL_HIT",
1281 "MSRIndex": "0x1a6,0x1a7",
1282 "SampleAfterValue": "100003",
1283 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SPL_HIT",
1284 "Offcore": "1",
1285 "CounterHTOff": "0,1,2,3"
1286 },
1287 {
1288 "EventCode": "0xB7, 0xBB",
1289 "MSRValue": "0x3fc01c0800 ",
1290 "Counter": "0,1,2,3",
1291 "UMask": "0x1",
1292 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.ANY_SNOOP",
1293 "MSRIndex": "0x1a6,0x1a7",
1294 "SampleAfterValue": "100003",
1295 "BriefDescription": "STREAMING_STORES & L3_HIT & ANY_SNOOP",
1296 "Offcore": "1",
1297 "CounterHTOff": "0,1,2,3"
1298 },
1299 {
1300 "EventCode": "0xB7, 0xBB",
1301 "MSRValue": "0x10001c0800 ",
1302 "Counter": "0,1,2,3",
1303 "UMask": "0x1",
1304 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SNOOP_HITM",
1305 "MSRIndex": "0x1a6,0x1a7",
1306 "SampleAfterValue": "100003",
1307 "BriefDescription": "STREAMING_STORES & L3_HIT & SNOOP_HITM",
1308 "Offcore": "1",
1309 "CounterHTOff": "0,1,2,3"
1310 },
1311 {
1312 "EventCode": "0xB7, 0xBB",
1313 "MSRValue": "0x04001c0800 ",
1314 "Counter": "0,1,2,3",
1315 "UMask": "0x1",
1316 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SNOOP_HIT_NO_FWD",
1317 "MSRIndex": "0x1a6,0x1a7",
1318 "SampleAfterValue": "100003",
1319 "BriefDescription": "Counts streaming stores that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded.",
1320 "Offcore": "1",
1321 "CounterHTOff": "0,1,2,3"
1322 },
1323 {
1324 "EventCode": "0xB7, 0xBB",
1325 "MSRValue": "0x02001c0800 ",
1326 "Counter": "0,1,2,3",
1327 "UMask": "0x1",
1328 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SNOOP_MISS",
1329 "MSRIndex": "0x1a6,0x1a7",
1330 "SampleAfterValue": "100003",
1331 "BriefDescription": "Counts streaming stores that hit in the L3 and the snoops sent to sibling cores return clean response.",
1332 "Offcore": "1",
1333 "CounterHTOff": "0,1,2,3"
1334 },
1335 {
1336 "EventCode": "0xB7, 0xBB",
1337 "MSRValue": "0x01001c0800 ",
1338 "Counter": "0,1,2,3",
1339 "UMask": "0x1",
1340 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SNOOP_NOT_NEEDED",
1341 "MSRIndex": "0x1a6,0x1a7",
1342 "SampleAfterValue": "100003",
1343 "BriefDescription": "Counts streaming stores that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.",
1344 "Offcore": "1",
1345 "CounterHTOff": "0,1,2,3"
1346 },
1347 {
1348 "EventCode": "0xB7, 0xBB",
1349 "MSRValue": "0x00801c0800 ",
1350 "Counter": "0,1,2,3",
1351 "UMask": "0x1",
1352 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SNOOP_NONE",
1353 "MSRIndex": "0x1a6,0x1a7",
1354 "SampleAfterValue": "100003",
1355 "BriefDescription": "STREAMING_STORES & L3_HIT & SNOOP_NONE",
1356 "Offcore": "1",
1357 "CounterHTOff": "0,1,2,3"
1358 },
1359 {
1360 "EventCode": "0xB7, 0xBB",
1361 "MSRValue": "0x00401c0800 ",
1362 "Counter": "0,1,2,3",
1363 "UMask": "0x1",
1364 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SPL_HIT",
1365 "MSRIndex": "0x1a6,0x1a7",
1366 "SampleAfterValue": "100003",
1367 "BriefDescription": "STREAMING_STORES & L3_HIT & SPL_HIT",
1368 "Offcore": "1",
1369 "CounterHTOff": "0,1,2,3"
1370 },
1371 {
1372 "EventCode": "0xB7, 0xBB",
1373 "MSRValue": "0x3fc0100800 ",
1374 "Counter": "0,1,2,3",
1375 "UMask": "0x1",
1376 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.ANY_SNOOP",
1377 "MSRIndex": "0x1a6,0x1a7",
1378 "SampleAfterValue": "100003",
1379 "BriefDescription": "STREAMING_STORES & L3_HIT_S & ANY_SNOOP",
1380 "Offcore": "1",
1381 "CounterHTOff": "0,1,2,3"
1382 },
1383 {
1384 "EventCode": "0xB7, 0xBB",
1385 "MSRValue": "0x1000100800 ",
1386 "Counter": "0,1,2,3",
1387 "UMask": "0x1",
1388 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SNOOP_HITM",
1389 "MSRIndex": "0x1a6,0x1a7",
1390 "SampleAfterValue": "100003",
1391 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SNOOP_HITM",
1392 "Offcore": "1",
1393 "CounterHTOff": "0,1,2,3"
1394 },
1395 {
1396 "EventCode": "0xB7, 0xBB",
1397 "MSRValue": "0x0400100800 ",
1398 "Counter": "0,1,2,3",
1399 "UMask": "0x1",
1400 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SNOOP_HIT_NO_FWD",
1401 "MSRIndex": "0x1a6,0x1a7",
1402 "SampleAfterValue": "100003",
1403 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SNOOP_HIT_NO_FWD",
1404 "Offcore": "1",
1405 "CounterHTOff": "0,1,2,3"
1406 },
1407 {
1408 "EventCode": "0xB7, 0xBB",
1409 "MSRValue": "0x0200100800 ",
1410 "Counter": "0,1,2,3",
1411 "UMask": "0x1",
1412 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SNOOP_MISS",
1413 "MSRIndex": "0x1a6,0x1a7",
1414 "SampleAfterValue": "100003",
1415 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SNOOP_MISS",
1416 "Offcore": "1",
1417 "CounterHTOff": "0,1,2,3"
1418 },
1419 {
1420 "EventCode": "0xB7, 0xBB",
1421 "MSRValue": "0x0100100800 ",
1422 "Counter": "0,1,2,3",
1423 "UMask": "0x1",
1424 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SNOOP_NOT_NEEDED",
1425 "MSRIndex": "0x1a6,0x1a7",
1426 "SampleAfterValue": "100003",
1427 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SNOOP_NOT_NEEDED",
1428 "Offcore": "1",
1429 "CounterHTOff": "0,1,2,3"
1430 },
1431 {
1432 "EventCode": "0xB7, 0xBB",
1433 "MSRValue": "0x0080100800 ",
1434 "Counter": "0,1,2,3",
1435 "UMask": "0x1",
1436 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SNOOP_NONE",
1437 "MSRIndex": "0x1a6,0x1a7",
1438 "SampleAfterValue": "100003",
1439 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SNOOP_NONE",
1440 "Offcore": "1",
1441 "CounterHTOff": "0,1,2,3"
1442 },
1443 {
1444 "EventCode": "0xB7, 0xBB",
1445 "MSRValue": "0x0040100800 ",
1446 "Counter": "0,1,2,3",
1447 "UMask": "0x1",
1448 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SPL_HIT",
1449 "MSRIndex": "0x1a6,0x1a7",
1450 "SampleAfterValue": "100003",
1451 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SPL_HIT",
1452 "Offcore": "1",
1453 "CounterHTOff": "0,1,2,3"
1454 },
1455 {
1456 "EventCode": "0xB7, 0xBB",
1457 "MSRValue": "0x3fc0080800 ",
1458 "Counter": "0,1,2,3",
1459 "UMask": "0x1",
1460 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.ANY_SNOOP",
1461 "MSRIndex": "0x1a6,0x1a7",
1462 "SampleAfterValue": "100003",
1463 "BriefDescription": "STREAMING_STORES & L3_HIT_E & ANY_SNOOP",
1464 "Offcore": "1",
1465 "CounterHTOff": "0,1,2,3"
1466 },
1467 {
1468 "EventCode": "0xB7, 0xBB",
1469 "MSRValue": "0x1000080800 ",
1470 "Counter": "0,1,2,3",
1471 "UMask": "0x1",
1472 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SNOOP_HITM",
1473 "MSRIndex": "0x1a6,0x1a7",
1474 "SampleAfterValue": "100003",
1475 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SNOOP_HITM",
1476 "Offcore": "1",
1477 "CounterHTOff": "0,1,2,3"
1478 },
1479 {
1480 "EventCode": "0xB7, 0xBB",
1481 "MSRValue": "0x0400080800 ",
1482 "Counter": "0,1,2,3",
1483 "UMask": "0x1",
1484 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SNOOP_HIT_NO_FWD",
1485 "MSRIndex": "0x1a6,0x1a7",
1486 "SampleAfterValue": "100003",
1487 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SNOOP_HIT_NO_FWD",
1488 "Offcore": "1",
1489 "CounterHTOff": "0,1,2,3"
1490 },
1491 {
1492 "EventCode": "0xB7, 0xBB",
1493 "MSRValue": "0x0200080800 ",
1494 "Counter": "0,1,2,3",
1495 "UMask": "0x1",
1496 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SNOOP_MISS",
1497 "MSRIndex": "0x1a6,0x1a7",
1498 "SampleAfterValue": "100003",
1499 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SNOOP_MISS",
1500 "Offcore": "1",
1501 "CounterHTOff": "0,1,2,3"
1502 },
1503 {
1504 "EventCode": "0xB7, 0xBB",
1505 "MSRValue": "0x0100080800 ",
1506 "Counter": "0,1,2,3",
1507 "UMask": "0x1",
1508 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SNOOP_NOT_NEEDED",
1509 "MSRIndex": "0x1a6,0x1a7",
1510 "SampleAfterValue": "100003",
1511 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SNOOP_NOT_NEEDED",
1512 "Offcore": "1",
1513 "CounterHTOff": "0,1,2,3"
1514 },
1515 {
1516 "EventCode": "0xB7, 0xBB",
1517 "MSRValue": "0x0080080800 ",
1518 "Counter": "0,1,2,3",
1519 "UMask": "0x1",
1520 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SNOOP_NONE",
1521 "MSRIndex": "0x1a6,0x1a7",
1522 "SampleAfterValue": "100003",
1523 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SNOOP_NONE",
1524 "Offcore": "1",
1525 "CounterHTOff": "0,1,2,3"
1526 },
1527 {
1528 "EventCode": "0xB7, 0xBB",
1529 "MSRValue": "0x0040080800 ",
1530 "Counter": "0,1,2,3",
1531 "UMask": "0x1",
1532 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SPL_HIT",
1533 "MSRIndex": "0x1a6,0x1a7",
1534 "SampleAfterValue": "100003",
1535 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SPL_HIT",
1536 "Offcore": "1",
1537 "CounterHTOff": "0,1,2,3"
1538 },
1539 {
1540 "EventCode": "0xB7, 0xBB",
1541 "MSRValue": "0x3fc0040800 ",
1542 "Counter": "0,1,2,3",
1543 "UMask": "0x1",
1544 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.ANY_SNOOP",
1545 "MSRIndex": "0x1a6,0x1a7",
1546 "SampleAfterValue": "100003",
1547 "BriefDescription": "STREAMING_STORES & L3_HIT_M & ANY_SNOOP",
1548 "Offcore": "1",
1549 "CounterHTOff": "0,1,2,3"
1550 },
1551 {
1552 "EventCode": "0xB7, 0xBB",
1553 "MSRValue": "0x1000040800 ",
1554 "Counter": "0,1,2,3",
1555 "UMask": "0x1",
1556 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SNOOP_HITM",
1557 "MSRIndex": "0x1a6,0x1a7",
1558 "SampleAfterValue": "100003",
1559 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SNOOP_HITM",
1560 "Offcore": "1",
1561 "CounterHTOff": "0,1,2,3"
1562 },
1563 {
1564 "EventCode": "0xB7, 0xBB",
1565 "MSRValue": "0x0400040800 ",
1566 "Counter": "0,1,2,3",
1567 "UMask": "0x1",
1568 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SNOOP_HIT_NO_FWD",
1569 "MSRIndex": "0x1a6,0x1a7",
1570 "SampleAfterValue": "100003",
1571 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SNOOP_HIT_NO_FWD",
1572 "Offcore": "1",
1573 "CounterHTOff": "0,1,2,3"
1574 },
1575 {
1576 "EventCode": "0xB7, 0xBB",
1577 "MSRValue": "0x0200040800 ",
1578 "Counter": "0,1,2,3",
1579 "UMask": "0x1",
1580 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SNOOP_MISS",
1581 "MSRIndex": "0x1a6,0x1a7",
1582 "SampleAfterValue": "100003",
1583 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SNOOP_MISS",
1584 "Offcore": "1",
1585 "CounterHTOff": "0,1,2,3"
1586 },
1587 {
1588 "EventCode": "0xB7, 0xBB",
1589 "MSRValue": "0x0100040800 ",
1590 "Counter": "0,1,2,3",
1591 "UMask": "0x1",
1592 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SNOOP_NOT_NEEDED",
1593 "MSRIndex": "0x1a6,0x1a7",
1594 "SampleAfterValue": "100003",
1595 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SNOOP_NOT_NEEDED",
1596 "Offcore": "1",
1597 "CounterHTOff": "0,1,2,3"
1598 },
1599 {
1600 "EventCode": "0xB7, 0xBB",
1601 "MSRValue": "0x0080040800 ",
1602 "Counter": "0,1,2,3",
1603 "UMask": "0x1",
1604 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SNOOP_NONE",
1605 "MSRIndex": "0x1a6,0x1a7",
1606 "SampleAfterValue": "100003",
1607 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SNOOP_NONE",
1608 "Offcore": "1",
1609 "CounterHTOff": "0,1,2,3"
1610 },
1611 {
1612 "EventCode": "0xB7, 0xBB",
1613 "MSRValue": "0x0040040800 ",
1614 "Counter": "0,1,2,3",
1615 "UMask": "0x1",
1616 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SPL_HIT",
1617 "MSRIndex": "0x1a6,0x1a7",
1618 "SampleAfterValue": "100003",
1619 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SPL_HIT",
1620 "Offcore": "1",
1621 "CounterHTOff": "0,1,2,3"
1622 },
1623 {
1624 "EventCode": "0xB7, 0xBB",
1625 "MSRValue": "0x3fc0020800 ",
1626 "Counter": "0,1,2,3",
1627 "UMask": "0x1",
1628 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.ANY_SNOOP",
1629 "MSRIndex": "0x1a6,0x1a7",
1630 "SampleAfterValue": "100003",
1631 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & ANY_SNOOP",
1632 "Offcore": "1",
1633 "CounterHTOff": "0,1,2,3"
1634 },
1635 {
1636 "EventCode": "0xB7, 0xBB",
1637 "MSRValue": "0x1000020800 ",
1638 "Counter": "0,1,2,3",
1639 "UMask": "0x1",
1640 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SNOOP_HITM",
1641 "MSRIndex": "0x1a6,0x1a7",
1642 "SampleAfterValue": "100003",
1643 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SNOOP_HITM",
1644 "Offcore": "1",
1645 "CounterHTOff": "0,1,2,3"
1646 },
1647 {
1648 "EventCode": "0xB7, 0xBB",
1649 "MSRValue": "0x0400020800 ",
1650 "Counter": "0,1,2,3",
1651 "UMask": "0x1",
1652 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SNOOP_HIT_NO_FWD",
1653 "MSRIndex": "0x1a6,0x1a7",
1654 "SampleAfterValue": "100003",
1655 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SNOOP_HIT_NO_FWD",
1656 "Offcore": "1",
1657 "CounterHTOff": "0,1,2,3"
1658 },
1659 {
1660 "EventCode": "0xB7, 0xBB",
1661 "MSRValue": "0x0200020800 ",
1662 "Counter": "0,1,2,3",
1663 "UMask": "0x1",
1664 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SNOOP_MISS",
1665 "MSRIndex": "0x1a6,0x1a7",
1666 "SampleAfterValue": "100003",
1667 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SNOOP_MISS",
1668 "Offcore": "1",
1669 "CounterHTOff": "0,1,2,3"
1670 },
1671 {
1672 "EventCode": "0xB7, 0xBB",
1673 "MSRValue": "0x0100020800 ",
1674 "Counter": "0,1,2,3",
1675 "UMask": "0x1",
1676 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SNOOP_NOT_NEEDED",
1677 "MSRIndex": "0x1a6,0x1a7",
1678 "SampleAfterValue": "100003",
1679 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SNOOP_NOT_NEEDED",
1680 "Offcore": "1",
1681 "CounterHTOff": "0,1,2,3"
1682 },
1683 {
1684 "EventCode": "0xB7, 0xBB",
1685 "MSRValue": "0x0080020800 ",
1686 "Counter": "0,1,2,3",
1687 "UMask": "0x1",
1688 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SNOOP_NONE",
1689 "MSRIndex": "0x1a6,0x1a7",
1690 "SampleAfterValue": "100003",
1691 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SNOOP_NONE",
1692 "Offcore": "1",
1693 "CounterHTOff": "0,1,2,3"
1694 },
1695 {
1696 "EventCode": "0xB7, 0xBB",
1697 "MSRValue": "0x0040020800 ",
1698 "Counter": "0,1,2,3",
1699 "UMask": "0x1",
1700 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SPL_HIT",
1701 "MSRIndex": "0x1a6,0x1a7",
1702 "SampleAfterValue": "100003",
1703 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SPL_HIT",
1704 "Offcore": "1",
1705 "CounterHTOff": "0,1,2,3"
1706 },
1707 {
1708 "EventCode": "0xB7, 0xBB",
1709 "MSRValue": "0x0000010800 ",
1710 "Counter": "0,1,2,3",
1711 "UMask": "0x1",
1712 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.ANY_RESPONSE",
1713 "MSRIndex": "0x1a6,0x1a7",
1714 "SampleAfterValue": "100003",
1715 "BriefDescription": "Counts streaming stores that have any response type.",
1716 "Offcore": "1",
1717 "CounterHTOff": "0,1,2,3"
1718 },
1719 {
1720 "EventCode": "0xB7, 0xBB",
1721 "MSRValue": "0x3fc0400100 ",
1722 "Counter": "0,1,2,3",
1723 "UMask": "0x1",
1724 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.ANY_SNOOP",
1725 "MSRIndex": "0x1a6,0x1a7",
1726 "SampleAfterValue": "100003",
1727 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & ANY_SNOOP",
1728 "Offcore": "1",
1729 "CounterHTOff": "0,1,2,3"
1730 },
1731 {
1732 "EventCode": "0xB7, 0xBB",
1733 "MSRValue": "0x1000400100 ",
1734 "Counter": "0,1,2,3",
1735 "UMask": "0x1",
1736 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SNOOP_HITM",
1737 "MSRIndex": "0x1a6,0x1a7",
1738 "SampleAfterValue": "100003",
1739 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SNOOP_HITM",
1740 "Offcore": "1",
1741 "CounterHTOff": "0,1,2,3"
1742 },
1743 {
1744 "EventCode": "0xB7, 0xBB",
1745 "MSRValue": "0x0400400100 ",
1746 "Counter": "0,1,2,3",
1747 "UMask": "0x1",
1748 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SNOOP_HIT_NO_FWD",
1749 "MSRIndex": "0x1a6,0x1a7",
1750 "SampleAfterValue": "100003",
1751 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SNOOP_HIT_NO_FWD",
1752 "Offcore": "1",
1753 "CounterHTOff": "0,1,2,3"
1754 },
1755 {
1756 "EventCode": "0xB7, 0xBB",
1757 "MSRValue": "0x0200400100 ",
1758 "Counter": "0,1,2,3",
1759 "UMask": "0x1",
1760 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SNOOP_MISS",
1761 "MSRIndex": "0x1a6,0x1a7",
1762 "SampleAfterValue": "100003",
1763 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SNOOP_MISS",
1764 "Offcore": "1",
1765 "CounterHTOff": "0,1,2,3"
1766 },
1767 {
1768 "EventCode": "0xB7, 0xBB",
1769 "MSRValue": "0x0100400100 ",
1770 "Counter": "0,1,2,3",
1771 "UMask": "0x1",
1772 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SNOOP_NOT_NEEDED",
1773 "MSRIndex": "0x1a6,0x1a7",
1774 "SampleAfterValue": "100003",
1775 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SNOOP_NOT_NEEDED",
1776 "Offcore": "1",
1777 "CounterHTOff": "0,1,2,3"
1778 },
1779 {
1780 "EventCode": "0xB7, 0xBB",
1781 "MSRValue": "0x0080400100 ",
1782 "Counter": "0,1,2,3",
1783 "UMask": "0x1",
1784 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SNOOP_NONE",
1785 "MSRIndex": "0x1a6,0x1a7",
1786 "SampleAfterValue": "100003",
1787 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SNOOP_NONE",
1788 "Offcore": "1",
1789 "CounterHTOff": "0,1,2,3"
1790 },
1791 {
1792 "EventCode": "0xB7, 0xBB",
1793 "MSRValue": "0x0040400100 ",
1794 "Counter": "0,1,2,3",
1795 "UMask": "0x1",
1796 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SPL_HIT",
1797 "MSRIndex": "0x1a6,0x1a7",
1798 "SampleAfterValue": "100003",
1799 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SPL_HIT",
1800 "Offcore": "1",
1801 "CounterHTOff": "0,1,2,3"
1802 },
1803 {
1804 "EventCode": "0xB7, 0xBB",
1805 "MSRValue": "0x3fc01c0100 ",
1806 "Counter": "0,1,2,3",
1807 "UMask": "0x1",
1808 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.ANY_SNOOP",
1809 "MSRIndex": "0x1a6,0x1a7",
1810 "SampleAfterValue": "100003",
1811 "BriefDescription": "PF_L3_RFO & L3_HIT & ANY_SNOOP",
1812 "Offcore": "1",
1813 "CounterHTOff": "0,1,2,3"
1814 },
1815 {
1816 "EventCode": "0xB7, 0xBB",
1817 "MSRValue": "0x10001c0100 ",
1818 "Counter": "0,1,2,3",
1819 "UMask": "0x1",
1820 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_HITM",
1821 "MSRIndex": "0x1a6,0x1a7",
1822 "SampleAfterValue": "100003",
1823 "BriefDescription": "PF_L3_RFO & L3_HIT & SNOOP_HITM",
1824 "Offcore": "1",
1825 "CounterHTOff": "0,1,2,3"
1826 },
1827 {
1828 "EventCode": "0xB7, 0xBB",
1829 "MSRValue": "0x04001c0100 ",
1830 "Counter": "0,1,2,3",
1831 "UMask": "0x1",
1832 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_HIT_NO_FWD",
1833 "MSRIndex": "0x1a6,0x1a7",
1834 "SampleAfterValue": "100003",
1835 "BriefDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded.",
1836 "Offcore": "1",
1837 "CounterHTOff": "0,1,2,3"
1838 },
1839 {
1840 "EventCode": "0xB7, 0xBB",
1841 "MSRValue": "0x02001c0100 ",
1842 "Counter": "0,1,2,3",
1843 "UMask": "0x1",
1844 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_MISS",
1845 "MSRIndex": "0x1a6,0x1a7",
1846 "SampleAfterValue": "100003",
1847 "BriefDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoops sent to sibling cores return clean response.",
1848 "Offcore": "1",
1849 "CounterHTOff": "0,1,2,3"
1850 },
1851 {
1852 "EventCode": "0xB7, 0xBB",
1853 "MSRValue": "0x01001c0100 ",
1854 "Counter": "0,1,2,3",
1855 "UMask": "0x1",
1856 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_NOT_NEEDED",
1857 "MSRIndex": "0x1a6,0x1a7",
1858 "SampleAfterValue": "100003",
1859 "BriefDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.",
1860 "Offcore": "1",
1861 "CounterHTOff": "0,1,2,3"
1862 },
1863 {
1864 "EventCode": "0xB7, 0xBB",
1865 "MSRValue": "0x00801c0100 ",
1866 "Counter": "0,1,2,3",
1867 "UMask": "0x1",
1868 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_NONE",
1869 "MSRIndex": "0x1a6,0x1a7",
1870 "SampleAfterValue": "100003",
1871 "BriefDescription": "PF_L3_RFO & L3_HIT & SNOOP_NONE",
1872 "Offcore": "1",
1873 "CounterHTOff": "0,1,2,3"
1874 },
1875 {
1876 "EventCode": "0xB7, 0xBB",
1877 "MSRValue": "0x00401c0100 ",
1878 "Counter": "0,1,2,3",
1879 "UMask": "0x1",
1880 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SPL_HIT",
1881 "MSRIndex": "0x1a6,0x1a7",
1882 "SampleAfterValue": "100003",
1883 "BriefDescription": "PF_L3_RFO & L3_HIT & SPL_HIT",
1884 "Offcore": "1",
1885 "CounterHTOff": "0,1,2,3"
1886 },
1887 {
1888 "EventCode": "0xB7, 0xBB",
1889 "MSRValue": "0x3fc0100100 ",
1890 "Counter": "0,1,2,3",
1891 "UMask": "0x1",
1892 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.ANY_SNOOP",
1893 "MSRIndex": "0x1a6,0x1a7",
1894 "SampleAfterValue": "100003",
1895 "BriefDescription": "PF_L3_RFO & L3_HIT_S & ANY_SNOOP",
1896 "Offcore": "1",
1897 "CounterHTOff": "0,1,2,3"
1898 },
1899 {
1900 "EventCode": "0xB7, 0xBB",
1901 "MSRValue": "0x1000100100 ",
1902 "Counter": "0,1,2,3",
1903 "UMask": "0x1",
1904 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SNOOP_HITM",
1905 "MSRIndex": "0x1a6,0x1a7",
1906 "SampleAfterValue": "100003",
1907 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SNOOP_HITM",
1908 "Offcore": "1",
1909 "CounterHTOff": "0,1,2,3"
1910 },
1911 {
1912 "EventCode": "0xB7, 0xBB",
1913 "MSRValue": "0x0400100100 ",
1914 "Counter": "0,1,2,3",
1915 "UMask": "0x1",
1916 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SNOOP_HIT_NO_FWD",
1917 "MSRIndex": "0x1a6,0x1a7",
1918 "SampleAfterValue": "100003",
1919 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SNOOP_HIT_NO_FWD",
1920 "Offcore": "1",
1921 "CounterHTOff": "0,1,2,3"
1922 },
1923 {
1924 "EventCode": "0xB7, 0xBB",
1925 "MSRValue": "0x0200100100 ",
1926 "Counter": "0,1,2,3",
1927 "UMask": "0x1",
1928 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SNOOP_MISS",
1929 "MSRIndex": "0x1a6,0x1a7",
1930 "SampleAfterValue": "100003",
1931 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SNOOP_MISS",
1932 "Offcore": "1",
1933 "CounterHTOff": "0,1,2,3"
1934 },
1935 {
1936 "EventCode": "0xB7, 0xBB",
1937 "MSRValue": "0x0100100100 ",
1938 "Counter": "0,1,2,3",
1939 "UMask": "0x1",
1940 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SNOOP_NOT_NEEDED",
1941 "MSRIndex": "0x1a6,0x1a7",
1942 "SampleAfterValue": "100003",
1943 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SNOOP_NOT_NEEDED",
1944 "Offcore": "1",
1945 "CounterHTOff": "0,1,2,3"
1946 },
1947 {
1948 "EventCode": "0xB7, 0xBB",
1949 "MSRValue": "0x0080100100 ",
1950 "Counter": "0,1,2,3",
1951 "UMask": "0x1",
1952 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SNOOP_NONE",
1953 "MSRIndex": "0x1a6,0x1a7",
1954 "SampleAfterValue": "100003",
1955 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SNOOP_NONE",
1956 "Offcore": "1",
1957 "CounterHTOff": "0,1,2,3"
1958 },
1959 {
1960 "EventCode": "0xB7, 0xBB",
1961 "MSRValue": "0x0040100100 ",
1962 "Counter": "0,1,2,3",
1963 "UMask": "0x1",
1964 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SPL_HIT",
1965 "MSRIndex": "0x1a6,0x1a7",
1966 "SampleAfterValue": "100003",
1967 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SPL_HIT",
1968 "Offcore": "1",
1969 "CounterHTOff": "0,1,2,3"
1970 },
1971 {
1972 "EventCode": "0xB7, 0xBB",
1973 "MSRValue": "0x3fc0080100 ",
1974 "Counter": "0,1,2,3",
1975 "UMask": "0x1",
1976 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.ANY_SNOOP",
1977 "MSRIndex": "0x1a6,0x1a7",
1978 "SampleAfterValue": "100003",
1979 "BriefDescription": "PF_L3_RFO & L3_HIT_E & ANY_SNOOP",
1980 "Offcore": "1",
1981 "CounterHTOff": "0,1,2,3"
1982 },
1983 {
1984 "EventCode": "0xB7, 0xBB",
1985 "MSRValue": "0x1000080100 ",
1986 "Counter": "0,1,2,3",
1987 "UMask": "0x1",
1988 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SNOOP_HITM",
1989 "MSRIndex": "0x1a6,0x1a7",
1990 "SampleAfterValue": "100003",
1991 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SNOOP_HITM",
1992 "Offcore": "1",
1993 "CounterHTOff": "0,1,2,3"
1994 },
1995 {
1996 "EventCode": "0xB7, 0xBB",
1997 "MSRValue": "0x0400080100 ",
1998 "Counter": "0,1,2,3",
1999 "UMask": "0x1",
2000 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SNOOP_HIT_NO_FWD",
2001 "MSRIndex": "0x1a6,0x1a7",
2002 "SampleAfterValue": "100003",
2003 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SNOOP_HIT_NO_FWD",
2004 "Offcore": "1",
2005 "CounterHTOff": "0,1,2,3"
2006 },
2007 {
2008 "EventCode": "0xB7, 0xBB",
2009 "MSRValue": "0x0200080100 ",
2010 "Counter": "0,1,2,3",
2011 "UMask": "0x1",
2012 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SNOOP_MISS",
2013 "MSRIndex": "0x1a6,0x1a7",
2014 "SampleAfterValue": "100003",
2015 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SNOOP_MISS",
2016 "Offcore": "1",
2017 "CounterHTOff": "0,1,2,3"
2018 },
2019 {
2020 "EventCode": "0xB7, 0xBB",
2021 "MSRValue": "0x0100080100 ",
2022 "Counter": "0,1,2,3",
2023 "UMask": "0x1",
2024 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SNOOP_NOT_NEEDED",
2025 "MSRIndex": "0x1a6,0x1a7",
2026 "SampleAfterValue": "100003",
2027 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SNOOP_NOT_NEEDED",
2028 "Offcore": "1",
2029 "CounterHTOff": "0,1,2,3"
2030 },
2031 {
2032 "EventCode": "0xB7, 0xBB",
2033 "MSRValue": "0x0080080100 ",
2034 "Counter": "0,1,2,3",
2035 "UMask": "0x1",
2036 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SNOOP_NONE",
2037 "MSRIndex": "0x1a6,0x1a7",
2038 "SampleAfterValue": "100003",
2039 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SNOOP_NONE",
2040 "Offcore": "1",
2041 "CounterHTOff": "0,1,2,3"
2042 },
2043 {
2044 "EventCode": "0xB7, 0xBB",
2045 "MSRValue": "0x0040080100 ",
2046 "Counter": "0,1,2,3",
2047 "UMask": "0x1",
2048 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SPL_HIT",
2049 "MSRIndex": "0x1a6,0x1a7",
2050 "SampleAfterValue": "100003",
2051 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SPL_HIT",
2052 "Offcore": "1",
2053 "CounterHTOff": "0,1,2,3"
2054 },
2055 {
2056 "EventCode": "0xB7, 0xBB",
2057 "MSRValue": "0x3fc0040100 ",
2058 "Counter": "0,1,2,3",
2059 "UMask": "0x1",
2060 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.ANY_SNOOP",
2061 "MSRIndex": "0x1a6,0x1a7",
2062 "SampleAfterValue": "100003",
2063 "BriefDescription": "PF_L3_RFO & L3_HIT_M & ANY_SNOOP",
2064 "Offcore": "1",
2065 "CounterHTOff": "0,1,2,3"
2066 },
2067 {
2068 "EventCode": "0xB7, 0xBB",
2069 "MSRValue": "0x1000040100 ",
2070 "Counter": "0,1,2,3",
2071 "UMask": "0x1",
2072 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SNOOP_HITM",
2073 "MSRIndex": "0x1a6,0x1a7",
2074 "SampleAfterValue": "100003",
2075 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SNOOP_HITM",
2076 "Offcore": "1",
2077 "CounterHTOff": "0,1,2,3"
2078 },
2079 {
2080 "EventCode": "0xB7, 0xBB",
2081 "MSRValue": "0x0400040100 ",
2082 "Counter": "0,1,2,3",
2083 "UMask": "0x1",
2084 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SNOOP_HIT_NO_FWD",
2085 "MSRIndex": "0x1a6,0x1a7",
2086 "SampleAfterValue": "100003",
2087 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SNOOP_HIT_NO_FWD",
2088 "Offcore": "1",
2089 "CounterHTOff": "0,1,2,3"
2090 },
2091 {
2092 "EventCode": "0xB7, 0xBB",
2093 "MSRValue": "0x0200040100 ",
2094 "Counter": "0,1,2,3",
2095 "UMask": "0x1",
2096 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SNOOP_MISS",
2097 "MSRIndex": "0x1a6,0x1a7",
2098 "SampleAfterValue": "100003",
2099 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SNOOP_MISS",
2100 "Offcore": "1",
2101 "CounterHTOff": "0,1,2,3"
2102 },
2103 {
2104 "EventCode": "0xB7, 0xBB",
2105 "MSRValue": "0x0100040100 ",
2106 "Counter": "0,1,2,3",
2107 "UMask": "0x1",
2108 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SNOOP_NOT_NEEDED",
2109 "MSRIndex": "0x1a6,0x1a7",
2110 "SampleAfterValue": "100003",
2111 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SNOOP_NOT_NEEDED",
2112 "Offcore": "1",
2113 "CounterHTOff": "0,1,2,3"
2114 },
2115 {
2116 "EventCode": "0xB7, 0xBB",
2117 "MSRValue": "0x0080040100 ",
2118 "Counter": "0,1,2,3",
2119 "UMask": "0x1",
2120 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SNOOP_NONE",
2121 "MSRIndex": "0x1a6,0x1a7",
2122 "SampleAfterValue": "100003",
2123 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SNOOP_NONE",
2124 "Offcore": "1",
2125 "CounterHTOff": "0,1,2,3"
2126 },
2127 {
2128 "EventCode": "0xB7, 0xBB",
2129 "MSRValue": "0x0040040100 ",
2130 "Counter": "0,1,2,3",
2131 "UMask": "0x1",
2132 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SPL_HIT",
2133 "MSRIndex": "0x1a6,0x1a7",
2134 "SampleAfterValue": "100003",
2135 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SPL_HIT",
2136 "Offcore": "1",
2137 "CounterHTOff": "0,1,2,3"
2138 },
2139 {
2140 "EventCode": "0xB7, 0xBB",
2141 "MSRValue": "0x3fc0020100 ",
2142 "Counter": "0,1,2,3",
2143 "UMask": "0x1",
2144 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.ANY_SNOOP",
2145 "MSRIndex": "0x1a6,0x1a7",
2146 "SampleAfterValue": "100003",
2147 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & ANY_SNOOP",
2148 "Offcore": "1",
2149 "CounterHTOff": "0,1,2,3"
2150 },
2151 {
2152 "EventCode": "0xB7, 0xBB",
2153 "MSRValue": "0x1000020100 ",
2154 "Counter": "0,1,2,3",
2155 "UMask": "0x1",
2156 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SNOOP_HITM",
2157 "MSRIndex": "0x1a6,0x1a7",
2158 "SampleAfterValue": "100003",
2159 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SNOOP_HITM",
2160 "Offcore": "1",
2161 "CounterHTOff": "0,1,2,3"
2162 },
2163 {
2164 "EventCode": "0xB7, 0xBB",
2165 "MSRValue": "0x0400020100 ",
2166 "Counter": "0,1,2,3",
2167 "UMask": "0x1",
2168 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SNOOP_HIT_NO_FWD",
2169 "MSRIndex": "0x1a6,0x1a7",
2170 "SampleAfterValue": "100003",
2171 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SNOOP_HIT_NO_FWD",
2172 "Offcore": "1",
2173 "CounterHTOff": "0,1,2,3"
2174 },
2175 {
2176 "EventCode": "0xB7, 0xBB",
2177 "MSRValue": "0x0200020100 ",
2178 "Counter": "0,1,2,3",
2179 "UMask": "0x1",
2180 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SNOOP_MISS",
2181 "MSRIndex": "0x1a6,0x1a7",
2182 "SampleAfterValue": "100003",
2183 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SNOOP_MISS",
2184 "Offcore": "1",
2185 "CounterHTOff": "0,1,2,3"
2186 },
2187 {
2188 "EventCode": "0xB7, 0xBB",
2189 "MSRValue": "0x0100020100 ",
2190 "Counter": "0,1,2,3",
2191 "UMask": "0x1",
2192 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SNOOP_NOT_NEEDED",
2193 "MSRIndex": "0x1a6,0x1a7",
2194 "SampleAfterValue": "100003",
2195 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SNOOP_NOT_NEEDED",
2196 "Offcore": "1",
2197 "CounterHTOff": "0,1,2,3"
2198 },
2199 {
2200 "EventCode": "0xB7, 0xBB",
2201 "MSRValue": "0x0080020100 ",
2202 "Counter": "0,1,2,3",
2203 "UMask": "0x1",
2204 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SNOOP_NONE",
2205 "MSRIndex": "0x1a6,0x1a7",
2206 "SampleAfterValue": "100003",
2207 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SNOOP_NONE",
2208 "Offcore": "1",
2209 "CounterHTOff": "0,1,2,3"
2210 },
2211 {
2212 "EventCode": "0xB7, 0xBB",
2213 "MSRValue": "0x0040020100 ",
2214 "Counter": "0,1,2,3",
2215 "UMask": "0x1",
2216 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SPL_HIT",
2217 "MSRIndex": "0x1a6,0x1a7",
2218 "SampleAfterValue": "100003",
2219 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SPL_HIT",
2220 "Offcore": "1",
2221 "CounterHTOff": "0,1,2,3"
2222 },
2223 {
2224 "EventCode": "0xB7, 0xBB",
2225 "MSRValue": "0x0000010100 ",
2226 "Counter": "0,1,2,3",
2227 "UMask": "0x1",
2228 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.ANY_RESPONSE",
2229 "MSRIndex": "0x1a6,0x1a7",
2230 "SampleAfterValue": "100003",
2231 "BriefDescription": "Counts all prefetch (that bring data to LLC only) RFOs that have any response type.",
2232 "Offcore": "1",
2233 "CounterHTOff": "0,1,2,3"
2234 },
2235 {
2236 "EventCode": "0xB7, 0xBB",
2237 "MSRValue": "0x3fc0400080 ",
2238 "Counter": "0,1,2,3",
2239 "UMask": "0x1",
2240 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.ANY_SNOOP",
2241 "MSRIndex": "0x1a6,0x1a7",
2242 "SampleAfterValue": "100003",
2243 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & ANY_SNOOP",
2244 "Offcore": "1",
2245 "CounterHTOff": "0,1,2,3"
2246 },
2247 {
2248 "EventCode": "0xB7, 0xBB",
2249 "MSRValue": "0x1000400080 ",
2250 "Counter": "0,1,2,3",
2251 "UMask": "0x1",
2252 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_HITM",
2253 "MSRIndex": "0x1a6,0x1a7",
2254 "SampleAfterValue": "100003",
2255 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_HITM",
2256 "Offcore": "1",
2257 "CounterHTOff": "0,1,2,3"
2258 },
2259 {
2260 "EventCode": "0xB7, 0xBB",
2261 "MSRValue": "0x0400400080 ",
2262 "Counter": "0,1,2,3",
2263 "UMask": "0x1",
2264 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_HIT_NO_FWD",
2265 "MSRIndex": "0x1a6,0x1a7",
2266 "SampleAfterValue": "100003",
2267 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_HIT_NO_FWD",
2268 "Offcore": "1",
2269 "CounterHTOff": "0,1,2,3"
2270 },
2271 {
2272 "EventCode": "0xB7, 0xBB",
2273 "MSRValue": "0x0200400080 ",
2274 "Counter": "0,1,2,3",
2275 "UMask": "0x1",
2276 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_MISS",
2277 "MSRIndex": "0x1a6,0x1a7",
2278 "SampleAfterValue": "100003",
2279 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_MISS",
2280 "Offcore": "1",
2281 "CounterHTOff": "0,1,2,3"
2282 },
2283 {
2284 "EventCode": "0xB7, 0xBB",
2285 "MSRValue": "0x0100400080 ",
2286 "Counter": "0,1,2,3",
2287 "UMask": "0x1",
2288 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_NOT_NEEDED",
2289 "MSRIndex": "0x1a6,0x1a7",
2290 "SampleAfterValue": "100003",
2291 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_NOT_NEEDED",
2292 "Offcore": "1",
2293 "CounterHTOff": "0,1,2,3"
2294 },
2295 {
2296 "EventCode": "0xB7, 0xBB",
2297 "MSRValue": "0x0080400080 ",
2298 "Counter": "0,1,2,3",
2299 "UMask": "0x1",
2300 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_NONE",
2301 "MSRIndex": "0x1a6,0x1a7",
2302 "SampleAfterValue": "100003",
2303 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_NONE",
2304 "Offcore": "1",
2305 "CounterHTOff": "0,1,2,3"
2306 },
2307 {
2308 "EventCode": "0xB7, 0xBB",
2309 "MSRValue": "0x0040400080 ",
2310 "Counter": "0,1,2,3",
2311 "UMask": "0x1",
2312 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SPL_HIT",
2313 "MSRIndex": "0x1a6,0x1a7",
2314 "SampleAfterValue": "100003",
2315 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SPL_HIT",
2316 "Offcore": "1",
2317 "CounterHTOff": "0,1,2,3"
2318 },
2319 {
2320 "EventCode": "0xB7, 0xBB",
2321 "MSRValue": "0x3fc01c0080 ",
2322 "Counter": "0,1,2,3",
2323 "UMask": "0x1",
2324 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.ANY_SNOOP",
2325 "MSRIndex": "0x1a6,0x1a7",
2326 "SampleAfterValue": "100003",
2327 "BriefDescription": "PF_L3_DATA_RD & L3_HIT & ANY_SNOOP",
2328 "Offcore": "1",
2329 "CounterHTOff": "0,1,2,3"
2330 },
2331 {
2332 "EventCode": "0xB7, 0xBB",
2333 "MSRValue": "0x10001c0080 ",
2334 "Counter": "0,1,2,3",
2335 "UMask": "0x1",
2336 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_HITM",
2337 "MSRIndex": "0x1a6,0x1a7",
2338 "SampleAfterValue": "100003",
2339 "BriefDescription": "PF_L3_DATA_RD & L3_HIT & SNOOP_HITM",
2340 "Offcore": "1",
2341 "CounterHTOff": "0,1,2,3"
2342 },
2343 {
2344 "EventCode": "0xB7, 0xBB",
2345 "MSRValue": "0x04001c0080 ",
2346 "Counter": "0,1,2,3",
2347 "UMask": "0x1",
2348 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_HIT_NO_FWD",
2349 "MSRIndex": "0x1a6,0x1a7",
2350 "SampleAfterValue": "100003",
2351 "BriefDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded.",
2352 "Offcore": "1",
2353 "CounterHTOff": "0,1,2,3"
2354 },
2355 {
2356 "EventCode": "0xB7, 0xBB",
2357 "MSRValue": "0x02001c0080 ",
2358 "Counter": "0,1,2,3",
2359 "UMask": "0x1",
2360 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_MISS",
2361 "MSRIndex": "0x1a6,0x1a7",
2362 "SampleAfterValue": "100003",
2363 "BriefDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoops sent to sibling cores return clean response.",
2364 "Offcore": "1",
2365 "CounterHTOff": "0,1,2,3"
2366 },
2367 {
2368 "EventCode": "0xB7, 0xBB",
2369 "MSRValue": "0x01001c0080 ",
2370 "Counter": "0,1,2,3",
2371 "UMask": "0x1",
2372 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_NOT_NEEDED",
2373 "MSRIndex": "0x1a6,0x1a7",
2374 "SampleAfterValue": "100003",
2375 "BriefDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.",
2376 "Offcore": "1",
2377 "CounterHTOff": "0,1,2,3"
2378 },
2379 {
2380 "EventCode": "0xB7, 0xBB",
2381 "MSRValue": "0x00801c0080 ",
2382 "Counter": "0,1,2,3",
2383 "UMask": "0x1",
2384 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_NONE",
2385 "MSRIndex": "0x1a6,0x1a7",
2386 "SampleAfterValue": "100003",
2387 "BriefDescription": "PF_L3_DATA_RD & L3_HIT & SNOOP_NONE",
2388 "Offcore": "1",
2389 "CounterHTOff": "0,1,2,3"
2390 },
2391 {
2392 "EventCode": "0xB7, 0xBB",
2393 "MSRValue": "0x00401c0080 ",
2394 "Counter": "0,1,2,3",
2395 "UMask": "0x1",
2396 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SPL_HIT",
2397 "MSRIndex": "0x1a6,0x1a7",
2398 "SampleAfterValue": "100003",
2399 "BriefDescription": "PF_L3_DATA_RD & L3_HIT & SPL_HIT",
2400 "Offcore": "1",
2401 "CounterHTOff": "0,1,2,3"
2402 },
2403 {
2404 "EventCode": "0xB7, 0xBB",
2405 "MSRValue": "0x3fc0100080 ",
2406 "Counter": "0,1,2,3",
2407 "UMask": "0x1",
2408 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.ANY_SNOOP",
2409 "MSRIndex": "0x1a6,0x1a7",
2410 "SampleAfterValue": "100003",
2411 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & ANY_SNOOP",
2412 "Offcore": "1",
2413 "CounterHTOff": "0,1,2,3"
2414 },
2415 {
2416 "EventCode": "0xB7, 0xBB",
2417 "MSRValue": "0x1000100080 ",
2418 "Counter": "0,1,2,3",
2419 "UMask": "0x1",
2420 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SNOOP_HITM",
2421 "MSRIndex": "0x1a6,0x1a7",
2422 "SampleAfterValue": "100003",
2423 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SNOOP_HITM",
2424 "Offcore": "1",
2425 "CounterHTOff": "0,1,2,3"
2426 },
2427 {
2428 "EventCode": "0xB7, 0xBB",
2429 "MSRValue": "0x0400100080 ",
2430 "Counter": "0,1,2,3",
2431 "UMask": "0x1",
2432 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SNOOP_HIT_NO_FWD",
2433 "MSRIndex": "0x1a6,0x1a7",
2434 "SampleAfterValue": "100003",
2435 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SNOOP_HIT_NO_FWD",
2436 "Offcore": "1",
2437 "CounterHTOff": "0,1,2,3"
2438 },
2439 {
2440 "EventCode": "0xB7, 0xBB",
2441 "MSRValue": "0x0200100080 ",
2442 "Counter": "0,1,2,3",
2443 "UMask": "0x1",
2444 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SNOOP_MISS",
2445 "MSRIndex": "0x1a6,0x1a7",
2446 "SampleAfterValue": "100003",
2447 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SNOOP_MISS",
2448 "Offcore": "1",
2449 "CounterHTOff": "0,1,2,3"
2450 },
2451 {
2452 "EventCode": "0xB7, 0xBB",
2453 "MSRValue": "0x0100100080 ",
2454 "Counter": "0,1,2,3",
2455 "UMask": "0x1",
2456 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SNOOP_NOT_NEEDED",
2457 "MSRIndex": "0x1a6,0x1a7",
2458 "SampleAfterValue": "100003",
2459 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SNOOP_NOT_NEEDED",
2460 "Offcore": "1",
2461 "CounterHTOff": "0,1,2,3"
2462 },
2463 {
2464 "EventCode": "0xB7, 0xBB",
2465 "MSRValue": "0x0080100080 ",
2466 "Counter": "0,1,2,3",
2467 "UMask": "0x1",
2468 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SNOOP_NONE",
2469 "MSRIndex": "0x1a6,0x1a7",
2470 "SampleAfterValue": "100003",
2471 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SNOOP_NONE",
2472 "Offcore": "1",
2473 "CounterHTOff": "0,1,2,3"
2474 },
2475 {
2476 "EventCode": "0xB7, 0xBB",
2477 "MSRValue": "0x0040100080 ",
2478 "Counter": "0,1,2,3",
2479 "UMask": "0x1",
2480 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SPL_HIT",
2481 "MSRIndex": "0x1a6,0x1a7",
2482 "SampleAfterValue": "100003",
2483 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SPL_HIT",
2484 "Offcore": "1",
2485 "CounterHTOff": "0,1,2,3"
2486 },
2487 {
2488 "EventCode": "0xB7, 0xBB",
2489 "MSRValue": "0x3fc0080080 ",
2490 "Counter": "0,1,2,3",
2491 "UMask": "0x1",
2492 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.ANY_SNOOP",
2493 "MSRIndex": "0x1a6,0x1a7",
2494 "SampleAfterValue": "100003",
2495 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & ANY_SNOOP",
2496 "Offcore": "1",
2497 "CounterHTOff": "0,1,2,3"
2498 },
2499 {
2500 "EventCode": "0xB7, 0xBB",
2501 "MSRValue": "0x1000080080 ",
2502 "Counter": "0,1,2,3",
2503 "UMask": "0x1",
2504 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SNOOP_HITM",
2505 "MSRIndex": "0x1a6,0x1a7",
2506 "SampleAfterValue": "100003",
2507 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SNOOP_HITM",
2508 "Offcore": "1",
2509 "CounterHTOff": "0,1,2,3"
2510 },
2511 {
2512 "EventCode": "0xB7, 0xBB",
2513 "MSRValue": "0x0400080080 ",
2514 "Counter": "0,1,2,3",
2515 "UMask": "0x1",
2516 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SNOOP_HIT_NO_FWD",
2517 "MSRIndex": "0x1a6,0x1a7",
2518 "SampleAfterValue": "100003",
2519 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SNOOP_HIT_NO_FWD",
2520 "Offcore": "1",
2521 "CounterHTOff": "0,1,2,3"
2522 },
2523 {
2524 "EventCode": "0xB7, 0xBB",
2525 "MSRValue": "0x0200080080 ",
2526 "Counter": "0,1,2,3",
2527 "UMask": "0x1",
2528 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SNOOP_MISS",
2529 "MSRIndex": "0x1a6,0x1a7",
2530 "SampleAfterValue": "100003",
2531 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SNOOP_MISS",
2532 "Offcore": "1",
2533 "CounterHTOff": "0,1,2,3"
2534 },
2535 {
2536 "EventCode": "0xB7, 0xBB",
2537 "MSRValue": "0x0100080080 ",
2538 "Counter": "0,1,2,3",
2539 "UMask": "0x1",
2540 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SNOOP_NOT_NEEDED",
2541 "MSRIndex": "0x1a6,0x1a7",
2542 "SampleAfterValue": "100003",
2543 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SNOOP_NOT_NEEDED",
2544 "Offcore": "1",
2545 "CounterHTOff": "0,1,2,3"
2546 },
2547 {
2548 "EventCode": "0xB7, 0xBB",
2549 "MSRValue": "0x0080080080 ",
2550 "Counter": "0,1,2,3",
2551 "UMask": "0x1",
2552 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SNOOP_NONE",
2553 "MSRIndex": "0x1a6,0x1a7",
2554 "SampleAfterValue": "100003",
2555 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SNOOP_NONE",
2556 "Offcore": "1",
2557 "CounterHTOff": "0,1,2,3"
2558 },
2559 {
2560 "EventCode": "0xB7, 0xBB",
2561 "MSRValue": "0x0040080080 ",
2562 "Counter": "0,1,2,3",
2563 "UMask": "0x1",
2564 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SPL_HIT",
2565 "MSRIndex": "0x1a6,0x1a7",
2566 "SampleAfterValue": "100003",
2567 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SPL_HIT",
2568 "Offcore": "1",
2569 "CounterHTOff": "0,1,2,3"
2570 },
2571 {
2572 "EventCode": "0xB7, 0xBB",
2573 "MSRValue": "0x3fc0040080 ",
2574 "Counter": "0,1,2,3",
2575 "UMask": "0x1",
2576 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.ANY_SNOOP",
2577 "MSRIndex": "0x1a6,0x1a7",
2578 "SampleAfterValue": "100003",
2579 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & ANY_SNOOP",
2580 "Offcore": "1",
2581 "CounterHTOff": "0,1,2,3"
2582 },
2583 {
2584 "EventCode": "0xB7, 0xBB",
2585 "MSRValue": "0x1000040080 ",
2586 "Counter": "0,1,2,3",
2587 "UMask": "0x1",
2588 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SNOOP_HITM",
2589 "MSRIndex": "0x1a6,0x1a7",
2590 "SampleAfterValue": "100003",
2591 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SNOOP_HITM",
2592 "Offcore": "1",
2593 "CounterHTOff": "0,1,2,3"
2594 },
2595 {
2596 "EventCode": "0xB7, 0xBB",
2597 "MSRValue": "0x0400040080 ",
2598 "Counter": "0,1,2,3",
2599 "UMask": "0x1",
2600 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SNOOP_HIT_NO_FWD",
2601 "MSRIndex": "0x1a6,0x1a7",
2602 "SampleAfterValue": "100003",
2603 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SNOOP_HIT_NO_FWD",
2604 "Offcore": "1",
2605 "CounterHTOff": "0,1,2,3"
2606 },
2607 {
2608 "EventCode": "0xB7, 0xBB",
2609 "MSRValue": "0x0200040080 ",
2610 "Counter": "0,1,2,3",
2611 "UMask": "0x1",
2612 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SNOOP_MISS",
2613 "MSRIndex": "0x1a6,0x1a7",
2614 "SampleAfterValue": "100003",
2615 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SNOOP_MISS",
2616 "Offcore": "1",
2617 "CounterHTOff": "0,1,2,3"
2618 },
2619 {
2620 "EventCode": "0xB7, 0xBB",
2621 "MSRValue": "0x0100040080 ",
2622 "Counter": "0,1,2,3",
2623 "UMask": "0x1",
2624 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SNOOP_NOT_NEEDED",
2625 "MSRIndex": "0x1a6,0x1a7",
2626 "SampleAfterValue": "100003",
2627 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SNOOP_NOT_NEEDED",
2628 "Offcore": "1",
2629 "CounterHTOff": "0,1,2,3"
2630 },
2631 {
2632 "EventCode": "0xB7, 0xBB",
2633 "MSRValue": "0x0080040080 ",
2634 "Counter": "0,1,2,3",
2635 "UMask": "0x1",
2636 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SNOOP_NONE",
2637 "MSRIndex": "0x1a6,0x1a7",
2638 "SampleAfterValue": "100003",
2639 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SNOOP_NONE",
2640 "Offcore": "1",
2641 "CounterHTOff": "0,1,2,3"
2642 },
2643 {
2644 "EventCode": "0xB7, 0xBB",
2645 "MSRValue": "0x0040040080 ",
2646 "Counter": "0,1,2,3",
2647 "UMask": "0x1",
2648 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SPL_HIT",
2649 "MSRIndex": "0x1a6,0x1a7",
2650 "SampleAfterValue": "100003",
2651 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SPL_HIT",
2652 "Offcore": "1",
2653 "CounterHTOff": "0,1,2,3"
2654 },
2655 {
2656 "EventCode": "0xB7, 0xBB",
2657 "MSRValue": "0x3fc0020080 ",
2658 "Counter": "0,1,2,3",
2659 "UMask": "0x1",
2660 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.ANY_SNOOP",
2661 "MSRIndex": "0x1a6,0x1a7",
2662 "SampleAfterValue": "100003",
2663 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & ANY_SNOOP",
2664 "Offcore": "1",
2665 "CounterHTOff": "0,1,2,3"
2666 },
2667 {
2668 "EventCode": "0xB7, 0xBB",
2669 "MSRValue": "0x1000020080 ",
2670 "Counter": "0,1,2,3",
2671 "UMask": "0x1",
2672 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SNOOP_HITM",
2673 "MSRIndex": "0x1a6,0x1a7",
2674 "SampleAfterValue": "100003",
2675 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SNOOP_HITM",
2676 "Offcore": "1",
2677 "CounterHTOff": "0,1,2,3"
2678 },
2679 {
2680 "EventCode": "0xB7, 0xBB",
2681 "MSRValue": "0x0400020080 ",
2682 "Counter": "0,1,2,3",
2683 "UMask": "0x1",
2684 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SNOOP_HIT_NO_FWD",
2685 "MSRIndex": "0x1a6,0x1a7",
2686 "SampleAfterValue": "100003",
2687 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SNOOP_HIT_NO_FWD",
2688 "Offcore": "1",
2689 "CounterHTOff": "0,1,2,3"
2690 },
2691 {
2692 "EventCode": "0xB7, 0xBB",
2693 "MSRValue": "0x0200020080 ",
2694 "Counter": "0,1,2,3",
2695 "UMask": "0x1",
2696 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SNOOP_MISS",
2697 "MSRIndex": "0x1a6,0x1a7",
2698 "SampleAfterValue": "100003",
2699 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SNOOP_MISS",
2700 "Offcore": "1",
2701 "CounterHTOff": "0,1,2,3"
2702 },
2703 {
2704 "EventCode": "0xB7, 0xBB",
2705 "MSRValue": "0x0100020080 ",
2706 "Counter": "0,1,2,3",
2707 "UMask": "0x1",
2708 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SNOOP_NOT_NEEDED",
2709 "MSRIndex": "0x1a6,0x1a7",
2710 "SampleAfterValue": "100003",
2711 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SNOOP_NOT_NEEDED",
2712 "Offcore": "1",
2713 "CounterHTOff": "0,1,2,3"
2714 },
2715 {
2716 "EventCode": "0xB7, 0xBB",
2717 "MSRValue": "0x0080020080 ",
2718 "Counter": "0,1,2,3",
2719 "UMask": "0x1",
2720 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SNOOP_NONE",
2721 "MSRIndex": "0x1a6,0x1a7",
2722 "SampleAfterValue": "100003",
2723 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SNOOP_NONE",
2724 "Offcore": "1",
2725 "CounterHTOff": "0,1,2,3"
2726 },
2727 {
2728 "EventCode": "0xB7, 0xBB",
2729 "MSRValue": "0x0040020080 ",
2730 "Counter": "0,1,2,3",
2731 "UMask": "0x1",
2732 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SPL_HIT",
2733 "MSRIndex": "0x1a6,0x1a7",
2734 "SampleAfterValue": "100003",
2735 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SPL_HIT",
2736 "Offcore": "1",
2737 "CounterHTOff": "0,1,2,3"
2738 },
2739 {
2740 "EventCode": "0xB7, 0xBB",
2741 "MSRValue": "0x0000010080 ",
2742 "Counter": "0,1,2,3",
2743 "UMask": "0x1",
2744 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.ANY_RESPONSE",
2745 "MSRIndex": "0x1a6,0x1a7",
2746 "SampleAfterValue": "100003",
2747 "BriefDescription": "Counts all prefetch (that bring data to LLC only) data reads that have any response type.",
2748 "Offcore": "1",
2749 "CounterHTOff": "0,1,2,3"
2750 },
2751 {
2752 "EventCode": "0xB7, 0xBB",
2753 "MSRValue": "0x3fc0400004 ",
2754 "Counter": "0,1,2,3",
2755 "UMask": "0x1",
2756 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.ANY_SNOOP",
2757 "MSRIndex": "0x1a6,0x1a7",
2758 "SampleAfterValue": "100003",
2759 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & ANY_SNOOP",
2760 "Offcore": "1",
2761 "CounterHTOff": "0,1,2,3"
2762 },
2763 {
2764 "EventCode": "0xB7, 0xBB",
2765 "MSRValue": "0x1000400004 ",
2766 "Counter": "0,1,2,3",
2767 "UMask": "0x1",
2768 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SNOOP_HITM",
2769 "MSRIndex": "0x1a6,0x1a7",
2770 "SampleAfterValue": "100003",
2771 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SNOOP_HITM",
2772 "Offcore": "1",
2773 "CounterHTOff": "0,1,2,3"
2774 },
2775 {
2776 "EventCode": "0xB7, 0xBB",
2777 "MSRValue": "0x0400400004 ",
2778 "Counter": "0,1,2,3",
2779 "UMask": "0x1",
2780 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SNOOP_HIT_NO_FWD",
2781 "MSRIndex": "0x1a6,0x1a7",
2782 "SampleAfterValue": "100003",
2783 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SNOOP_HIT_NO_FWD",
2784 "Offcore": "1",
2785 "CounterHTOff": "0,1,2,3"
2786 },
2787 {
2788 "EventCode": "0xB7, 0xBB",
2789 "MSRValue": "0x0200400004 ",
2790 "Counter": "0,1,2,3",
2791 "UMask": "0x1",
2792 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SNOOP_MISS",
2793 "MSRIndex": "0x1a6,0x1a7",
2794 "SampleAfterValue": "100003",
2795 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SNOOP_MISS",
2796 "Offcore": "1",
2797 "CounterHTOff": "0,1,2,3"
2798 },
2799 {
2800 "EventCode": "0xB7, 0xBB",
2801 "MSRValue": "0x0100400004 ",
2802 "Counter": "0,1,2,3",
2803 "UMask": "0x1",
2804 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SNOOP_NOT_NEEDED",
2805 "MSRIndex": "0x1a6,0x1a7",
2806 "SampleAfterValue": "100003",
2807 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SNOOP_NOT_NEEDED",
2808 "Offcore": "1",
2809 "CounterHTOff": "0,1,2,3"
2810 },
2811 {
2812 "EventCode": "0xB7, 0xBB",
2813 "MSRValue": "0x0080400004 ",
2814 "Counter": "0,1,2,3",
2815 "UMask": "0x1",
2816 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SNOOP_NONE",
2817 "MSRIndex": "0x1a6,0x1a7",
2818 "SampleAfterValue": "100003",
2819 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SNOOP_NONE",
2820 "Offcore": "1",
2821 "CounterHTOff": "0,1,2,3"
2822 },
2823 {
2824 "EventCode": "0xB7, 0xBB",
2825 "MSRValue": "0x0040400004 ",
2826 "Counter": "0,1,2,3",
2827 "UMask": "0x1",
2828 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SPL_HIT",
2829 "MSRIndex": "0x1a6,0x1a7",
2830 "SampleAfterValue": "100003",
2831 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SPL_HIT",
2832 "Offcore": "1",
2833 "CounterHTOff": "0,1,2,3"
2834 },
2835 {
2836 "EventCode": "0xB7, 0xBB",
2837 "MSRValue": "0x3fc01c0004 ",
2838 "Counter": "0,1,2,3",
2839 "UMask": "0x1",
2840 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.ANY_SNOOP",
2841 "MSRIndex": "0x1a6,0x1a7",
2842 "SampleAfterValue": "100003",
2843 "BriefDescription": "DEMAND_CODE_RD & L3_HIT & ANY_SNOOP",
2844 "Offcore": "1",
2845 "CounterHTOff": "0,1,2,3"
2846 },
2847 {
2848 "EventCode": "0xB7, 0xBB",
2849 "MSRValue": "0x10001c0004 ",
2850 "Counter": "0,1,2,3",
2851 "UMask": "0x1",
2852 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_HITM",
2853 "MSRIndex": "0x1a6,0x1a7",
2854 "SampleAfterValue": "100003",
2855 "BriefDescription": "DEMAND_CODE_RD & L3_HIT & SNOOP_HITM",
2856 "Offcore": "1",
2857 "CounterHTOff": "0,1,2,3"
2858 },
2859 {
2860 "EventCode": "0xB7, 0xBB",
2861 "MSRValue": "0x04001c0004 ",
2862 "Counter": "0,1,2,3",
2863 "UMask": "0x1",
2864 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_HIT_NO_FWD",
2865 "MSRIndex": "0x1a6,0x1a7",
2866 "SampleAfterValue": "100003",
2867 "BriefDescription": "Counts all demand code reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded.",
2868 "Offcore": "1",
2869 "CounterHTOff": "0,1,2,3"
2870 },
2871 {
2872 "EventCode": "0xB7, 0xBB",
2873 "MSRValue": "0x02001c0004 ",
2874 "Counter": "0,1,2,3",
2875 "UMask": "0x1",
2876 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_MISS",
2877 "MSRIndex": "0x1a6,0x1a7",
2878 "SampleAfterValue": "100003",
2879 "BriefDescription": "Counts all demand code reads that hit in the L3 and the snoops sent to sibling cores return clean response.",
2880 "Offcore": "1",
2881 "CounterHTOff": "0,1,2,3"
2882 },
2883 {
2884 "EventCode": "0xB7, 0xBB",
2885 "MSRValue": "0x01001c0004 ",
2886 "Counter": "0,1,2,3",
2887 "UMask": "0x1",
2888 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_NOT_NEEDED",
2889 "MSRIndex": "0x1a6,0x1a7",
2890 "SampleAfterValue": "100003",
2891 "BriefDescription": "Counts all demand code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.",
2892 "Offcore": "1",
2893 "CounterHTOff": "0,1,2,3"
2894 },
2895 {
2896 "EventCode": "0xB7, 0xBB",
2897 "MSRValue": "0x00801c0004 ",
2898 "Counter": "0,1,2,3",
2899 "UMask": "0x1",
2900 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_NONE",
2901 "MSRIndex": "0x1a6,0x1a7",
2902 "SampleAfterValue": "100003",
2903 "BriefDescription": "DEMAND_CODE_RD & L3_HIT & SNOOP_NONE",
2904 "Offcore": "1",
2905 "CounterHTOff": "0,1,2,3"
2906 },
2907 {
2908 "EventCode": "0xB7, 0xBB",
2909 "MSRValue": "0x00401c0004 ",
2910 "Counter": "0,1,2,3",
2911 "UMask": "0x1",
2912 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SPL_HIT",
2913 "MSRIndex": "0x1a6,0x1a7",
2914 "SampleAfterValue": "100003",
2915 "BriefDescription": "DEMAND_CODE_RD & L3_HIT & SPL_HIT",
2916 "Offcore": "1",
2917 "CounterHTOff": "0,1,2,3"
2918 },
2919 {
2920 "EventCode": "0xB7, 0xBB",
2921 "MSRValue": "0x3fc0100004 ",
2922 "Counter": "0,1,2,3",
2923 "UMask": "0x1",
2924 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.ANY_SNOOP",
2925 "MSRIndex": "0x1a6,0x1a7",
2926 "SampleAfterValue": "100003",
2927 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & ANY_SNOOP",
2928 "Offcore": "1",
2929 "CounterHTOff": "0,1,2,3"
2930 },
2931 {
2932 "EventCode": "0xB7, 0xBB",
2933 "MSRValue": "0x1000100004 ",
2934 "Counter": "0,1,2,3",
2935 "UMask": "0x1",
2936 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SNOOP_HITM",
2937 "MSRIndex": "0x1a6,0x1a7",
2938 "SampleAfterValue": "100003",
2939 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SNOOP_HITM",
2940 "Offcore": "1",
2941 "CounterHTOff": "0,1,2,3"
2942 },
2943 {
2944 "EventCode": "0xB7, 0xBB",
2945 "MSRValue": "0x0400100004 ",
2946 "Counter": "0,1,2,3",
2947 "UMask": "0x1",
2948 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SNOOP_HIT_NO_FWD",
2949 "MSRIndex": "0x1a6,0x1a7",
2950 "SampleAfterValue": "100003",
2951 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SNOOP_HIT_NO_FWD",
2952 "Offcore": "1",
2953 "CounterHTOff": "0,1,2,3"
2954 },
2955 {
2956 "EventCode": "0xB7, 0xBB",
2957 "MSRValue": "0x0200100004 ",
2958 "Counter": "0,1,2,3",
2959 "UMask": "0x1",
2960 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SNOOP_MISS",
2961 "MSRIndex": "0x1a6,0x1a7",
2962 "SampleAfterValue": "100003",
2963 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SNOOP_MISS",
2964 "Offcore": "1",
2965 "CounterHTOff": "0,1,2,3"
2966 },
2967 {
2968 "EventCode": "0xB7, 0xBB",
2969 "MSRValue": "0x0100100004 ",
2970 "Counter": "0,1,2,3",
2971 "UMask": "0x1",
2972 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SNOOP_NOT_NEEDED",
2973 "MSRIndex": "0x1a6,0x1a7",
2974 "SampleAfterValue": "100003",
2975 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SNOOP_NOT_NEEDED",
2976 "Offcore": "1",
2977 "CounterHTOff": "0,1,2,3"
2978 },
2979 {
2980 "EventCode": "0xB7, 0xBB",
2981 "MSRValue": "0x0080100004 ",
2982 "Counter": "0,1,2,3",
2983 "UMask": "0x1",
2984 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SNOOP_NONE",
2985 "MSRIndex": "0x1a6,0x1a7",
2986 "SampleAfterValue": "100003",
2987 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SNOOP_NONE",
2988 "Offcore": "1",
2989 "CounterHTOff": "0,1,2,3"
2990 },
2991 {
2992 "EventCode": "0xB7, 0xBB",
2993 "MSRValue": "0x0040100004 ",
2994 "Counter": "0,1,2,3",
2995 "UMask": "0x1",
2996 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SPL_HIT",
2997 "MSRIndex": "0x1a6,0x1a7",
2998 "SampleAfterValue": "100003",
2999 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SPL_HIT",
3000 "Offcore": "1",
3001 "CounterHTOff": "0,1,2,3"
3002 },
3003 {
3004 "EventCode": "0xB7, 0xBB",
3005 "MSRValue": "0x3fc0080004 ",
3006 "Counter": "0,1,2,3",
3007 "UMask": "0x1",
3008 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.ANY_SNOOP",
3009 "MSRIndex": "0x1a6,0x1a7",
3010 "SampleAfterValue": "100003",
3011 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & ANY_SNOOP",
3012 "Offcore": "1",
3013 "CounterHTOff": "0,1,2,3"
3014 },
3015 {
3016 "EventCode": "0xB7, 0xBB",
3017 "MSRValue": "0x1000080004 ",
3018 "Counter": "0,1,2,3",
3019 "UMask": "0x1",
3020 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SNOOP_HITM",
3021 "MSRIndex": "0x1a6,0x1a7",
3022 "SampleAfterValue": "100003",
3023 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SNOOP_HITM",
3024 "Offcore": "1",
3025 "CounterHTOff": "0,1,2,3"
3026 },
3027 {
3028 "EventCode": "0xB7, 0xBB",
3029 "MSRValue": "0x0400080004 ",
3030 "Counter": "0,1,2,3",
3031 "UMask": "0x1",
3032 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SNOOP_HIT_NO_FWD",
3033 "MSRIndex": "0x1a6,0x1a7",
3034 "SampleAfterValue": "100003",
3035 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SNOOP_HIT_NO_FWD",
3036 "Offcore": "1",
3037 "CounterHTOff": "0,1,2,3"
3038 },
3039 {
3040 "EventCode": "0xB7, 0xBB",
3041 "MSRValue": "0x0200080004 ",
3042 "Counter": "0,1,2,3",
3043 "UMask": "0x1",
3044 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SNOOP_MISS",
3045 "MSRIndex": "0x1a6,0x1a7",
3046 "SampleAfterValue": "100003",
3047 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SNOOP_MISS",
3048 "Offcore": "1",
3049 "CounterHTOff": "0,1,2,3"
3050 },
3051 {
3052 "EventCode": "0xB7, 0xBB",
3053 "MSRValue": "0x0100080004 ",
3054 "Counter": "0,1,2,3",
3055 "UMask": "0x1",
3056 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SNOOP_NOT_NEEDED",
3057 "MSRIndex": "0x1a6,0x1a7",
3058 "SampleAfterValue": "100003",
3059 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SNOOP_NOT_NEEDED",
3060 "Offcore": "1",
3061 "CounterHTOff": "0,1,2,3"
3062 },
3063 {
3064 "EventCode": "0xB7, 0xBB",
3065 "MSRValue": "0x0080080004 ",
3066 "Counter": "0,1,2,3",
3067 "UMask": "0x1",
3068 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SNOOP_NONE",
3069 "MSRIndex": "0x1a6,0x1a7",
3070 "SampleAfterValue": "100003",
3071 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SNOOP_NONE",
3072 "Offcore": "1",
3073 "CounterHTOff": "0,1,2,3"
3074 },
3075 {
3076 "EventCode": "0xB7, 0xBB",
3077 "MSRValue": "0x0040080004 ",
3078 "Counter": "0,1,2,3",
3079 "UMask": "0x1",
3080 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SPL_HIT",
3081 "MSRIndex": "0x1a6,0x1a7",
3082 "SampleAfterValue": "100003",
3083 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SPL_HIT",
3084 "Offcore": "1",
3085 "CounterHTOff": "0,1,2,3"
3086 },
3087 {
3088 "EventCode": "0xB7, 0xBB",
3089 "MSRValue": "0x3fc0040004 ",
3090 "Counter": "0,1,2,3",
3091 "UMask": "0x1",
3092 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.ANY_SNOOP",
3093 "MSRIndex": "0x1a6,0x1a7",
3094 "SampleAfterValue": "100003",
3095 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & ANY_SNOOP",
3096 "Offcore": "1",
3097 "CounterHTOff": "0,1,2,3"
3098 },
3099 {
3100 "EventCode": "0xB7, 0xBB",
3101 "MSRValue": "0x1000040004 ",
3102 "Counter": "0,1,2,3",
3103 "UMask": "0x1",
3104 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SNOOP_HITM",
3105 "MSRIndex": "0x1a6,0x1a7",
3106 "SampleAfterValue": "100003",
3107 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SNOOP_HITM",
3108 "Offcore": "1",
3109 "CounterHTOff": "0,1,2,3"
3110 },
3111 {
3112 "EventCode": "0xB7, 0xBB",
3113 "MSRValue": "0x0400040004 ",
3114 "Counter": "0,1,2,3",
3115 "UMask": "0x1",
3116 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SNOOP_HIT_NO_FWD",
3117 "MSRIndex": "0x1a6,0x1a7",
3118 "SampleAfterValue": "100003",
3119 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SNOOP_HIT_NO_FWD",
3120 "Offcore": "1",
3121 "CounterHTOff": "0,1,2,3"
3122 },
3123 {
3124 "EventCode": "0xB7, 0xBB",
3125 "MSRValue": "0x0200040004 ",
3126 "Counter": "0,1,2,3",
3127 "UMask": "0x1",
3128 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SNOOP_MISS",
3129 "MSRIndex": "0x1a6,0x1a7",
3130 "SampleAfterValue": "100003",
3131 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SNOOP_MISS",
3132 "Offcore": "1",
3133 "CounterHTOff": "0,1,2,3"
3134 },
3135 {
3136 "EventCode": "0xB7, 0xBB",
3137 "MSRValue": "0x0100040004 ",
3138 "Counter": "0,1,2,3",
3139 "UMask": "0x1",
3140 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SNOOP_NOT_NEEDED",
3141 "MSRIndex": "0x1a6,0x1a7",
3142 "SampleAfterValue": "100003",
3143 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SNOOP_NOT_NEEDED",
3144 "Offcore": "1",
3145 "CounterHTOff": "0,1,2,3"
3146 },
3147 {
3148 "EventCode": "0xB7, 0xBB",
3149 "MSRValue": "0x0080040004 ",
3150 "Counter": "0,1,2,3",
3151 "UMask": "0x1",
3152 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SNOOP_NONE",
3153 "MSRIndex": "0x1a6,0x1a7",
3154 "SampleAfterValue": "100003",
3155 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SNOOP_NONE",
3156 "Offcore": "1",
3157 "CounterHTOff": "0,1,2,3"
3158 },
3159 {
3160 "EventCode": "0xB7, 0xBB",
3161 "MSRValue": "0x0040040004 ",
3162 "Counter": "0,1,2,3",
3163 "UMask": "0x1",
3164 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SPL_HIT",
3165 "MSRIndex": "0x1a6,0x1a7",
3166 "SampleAfterValue": "100003",
3167 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SPL_HIT",
3168 "Offcore": "1",
3169 "CounterHTOff": "0,1,2,3"
3170 },
3171 {
3172 "EventCode": "0xB7, 0xBB",
3173 "MSRValue": "0x3fc0020004 ",
3174 "Counter": "0,1,2,3",
3175 "UMask": "0x1",
3176 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.ANY_SNOOP",
3177 "MSRIndex": "0x1a6,0x1a7",
3178 "SampleAfterValue": "100003",
3179 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & ANY_SNOOP",
3180 "Offcore": "1",
3181 "CounterHTOff": "0,1,2,3"
3182 },
3183 {
3184 "EventCode": "0xB7, 0xBB",
3185 "MSRValue": "0x1000020004 ",
3186 "Counter": "0,1,2,3",
3187 "UMask": "0x1",
3188 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SNOOP_HITM",
3189 "MSRIndex": "0x1a6,0x1a7",
3190 "SampleAfterValue": "100003",
3191 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SNOOP_HITM",
3192 "Offcore": "1",
3193 "CounterHTOff": "0,1,2,3"
3194 },
3195 {
3196 "EventCode": "0xB7, 0xBB",
3197 "MSRValue": "0x0400020004 ",
3198 "Counter": "0,1,2,3",
3199 "UMask": "0x1",
3200 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SNOOP_HIT_NO_FWD",
3201 "MSRIndex": "0x1a6,0x1a7",
3202 "SampleAfterValue": "100003",
3203 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SNOOP_HIT_NO_FWD",
3204 "Offcore": "1",
3205 "CounterHTOff": "0,1,2,3"
3206 },
3207 {
3208 "EventCode": "0xB7, 0xBB",
3209 "MSRValue": "0x0200020004 ",
3210 "Counter": "0,1,2,3",
3211 "UMask": "0x1",
3212 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SNOOP_MISS",
3213 "MSRIndex": "0x1a6,0x1a7",
3214 "SampleAfterValue": "100003",
3215 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SNOOP_MISS",
3216 "Offcore": "1",
3217 "CounterHTOff": "0,1,2,3"
3218 },
3219 {
3220 "EventCode": "0xB7, 0xBB",
3221 "MSRValue": "0x0100020004 ",
3222 "Counter": "0,1,2,3",
3223 "UMask": "0x1",
3224 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SNOOP_NOT_NEEDED",
3225 "MSRIndex": "0x1a6,0x1a7",
3226 "SampleAfterValue": "100003",
3227 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SNOOP_NOT_NEEDED",
3228 "Offcore": "1",
3229 "CounterHTOff": "0,1,2,3"
3230 },
3231 {
3232 "EventCode": "0xB7, 0xBB",
3233 "MSRValue": "0x0080020004 ",
3234 "Counter": "0,1,2,3",
3235 "UMask": "0x1",
3236 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SNOOP_NONE",
3237 "MSRIndex": "0x1a6,0x1a7",
3238 "SampleAfterValue": "100003",
3239 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SNOOP_NONE",
3240 "Offcore": "1",
3241 "CounterHTOff": "0,1,2,3"
3242 },
3243 {
3244 "EventCode": "0xB7, 0xBB",
3245 "MSRValue": "0x0040020004 ",
3246 "Counter": "0,1,2,3",
3247 "UMask": "0x1",
3248 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SPL_HIT",
3249 "MSRIndex": "0x1a6,0x1a7",
3250 "SampleAfterValue": "100003",
3251 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SPL_HIT",
3252 "Offcore": "1",
3253 "CounterHTOff": "0,1,2,3"
3254 },
3255 {
3256 "EventCode": "0xB7, 0xBB",
3257 "MSRValue": "0x0000010004 ",
3258 "Counter": "0,1,2,3",
3259 "UMask": "0x1",
3260 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.ANY_RESPONSE",
3261 "MSRIndex": "0x1a6,0x1a7",
3262 "SampleAfterValue": "100003",
3263 "BriefDescription": "Counts all demand code reads that have any response type.",
3264 "Offcore": "1",
3265 "CounterHTOff": "0,1,2,3"
3266 },
3267 {
3268 "EventCode": "0xB7, 0xBB",
3269 "MSRValue": "0x3fc0400002 ",
3270 "Counter": "0,1,2,3", 229 "Counter": "0,1,2,3",
3271 "UMask": "0x1", 230 "UMask": "0x1",
3272 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.ANY_SNOOP", 231 "EventName": "L1D.REPLACEMENT",
3273 "MSRIndex": "0x1a6,0x1a7", 232 "SampleAfterValue": "2000003",
3274 "SampleAfterValue": "100003", 233 "BriefDescription": "L1D data line replacements",
3275 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & ANY_SNOOP", 234 "CounterHTOff": "0,1,2,3,4,5,6,7"
3276 "Offcore": "1",
3277 "CounterHTOff": "0,1,2,3"
3278 }, 235 },
3279 { 236 {
3280 "EventCode": "0xB7, 0xBB", 237 "PublicDescription": "Counts the number of offcore outstanding Demand Data Read transactions in the super queue (SQ) every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor. See the corresponding Umask under OFFCORE_REQUESTS.Note: A prefetch promoted to Demand is counted from the promotion point.",
3281 "MSRValue": "0x1000400002 ", 238 "EventCode": "0x60",
3282 "Counter": "0,1,2,3", 239 "Counter": "0,1,2,3",
3283 "UMask": "0x1", 240 "UMask": "0x1",
3284 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SNOOP_HITM", 241 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD",
3285 "MSRIndex": "0x1a6,0x1a7", 242 "SampleAfterValue": "2000003",
3286 "SampleAfterValue": "100003", 243 "BriefDescription": "Offcore outstanding Demand Data Read transactions in uncore queue.",
3287 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SNOOP_HITM", 244 "CounterHTOff": "0,1,2,3,4,5,6,7"
3288 "Offcore": "1",
3289 "CounterHTOff": "0,1,2,3"
3290 }, 245 },
3291 { 246 {
3292 "EventCode": "0xB7, 0xBB", 247 "PublicDescription": "Counts cycles when offcore outstanding Demand Data Read transactions are present in the super queue (SQ). A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation).",
3293 "MSRValue": "0x0400400002 ", 248 "EventCode": "0x60",
3294 "Counter": "0,1,2,3", 249 "Counter": "0,1,2,3",
3295 "UMask": "0x1", 250 "UMask": "0x1",
3296 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SNOOP_HIT_NO_FWD", 251 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_DATA_RD",
3297 "MSRIndex": "0x1a6,0x1a7", 252 "SampleAfterValue": "2000003",
3298 "SampleAfterValue": "100003", 253 "BriefDescription": "Cycles when offcore outstanding Demand Data Read transactions are present in SuperQueue (SQ), queue to uncore",
3299 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SNOOP_HIT_NO_FWD", 254 "CounterMask": "1",
3300 "Offcore": "1", 255 "CounterHTOff": "0,1,2,3,4,5,6,7"
3301 "CounterHTOff": "0,1,2,3"
3302 }, 256 },
3303 { 257 {
3304 "EventCode": "0xB7, 0xBB", 258 "EventCode": "0x60",
3305 "MSRValue": "0x0200400002 ",
3306 "Counter": "0,1,2,3", 259 "Counter": "0,1,2,3",
3307 "UMask": "0x1", 260 "UMask": "0x1",
3308 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SNOOP_MISS", 261 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD_GE_6",
3309 "MSRIndex": "0x1a6,0x1a7", 262 "SampleAfterValue": "2000003",
3310 "SampleAfterValue": "100003", 263 "BriefDescription": "Cycles with at least 6 offcore outstanding Demand Data Read transactions in uncore queue.",
3311 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SNOOP_MISS", 264 "CounterMask": "6",
3312 "Offcore": "1", 265 "CounterHTOff": "0,1,2,3,4,5,6,7"
3313 "CounterHTOff": "0,1,2,3"
3314 }, 266 },
3315 { 267 {
3316 "EventCode": "0xB7, 0xBB", 268 "PublicDescription": "Counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
3317 "MSRValue": "0x0100400002 ", 269 "EventCode": "0x60",
3318 "Counter": "0,1,2,3", 270 "Counter": "0,1,2,3",
3319 "UMask": "0x1", 271 "UMask": "0x2",
3320 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SNOOP_NOT_NEEDED", 272 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
3321 "MSRIndex": "0x1a6,0x1a7", 273 "SampleAfterValue": "2000003",
3322 "SampleAfterValue": "100003", 274 "BriefDescription": "Offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle.",
3323 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SNOOP_NOT_NEEDED", 275 "CounterHTOff": "0,1,2,3,4,5,6,7"
3324 "Offcore": "1",
3325 "CounterHTOff": "0,1,2,3"
3326 }, 276 },
3327 { 277 {
3328 "EventCode": "0xB7, 0xBB", 278 "PublicDescription": "Counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
3329 "MSRValue": "0x0080400002 ", 279 "EventCode": "0x60",
3330 "Counter": "0,1,2,3", 280 "Counter": "0,1,2,3",
3331 "UMask": "0x1", 281 "UMask": "0x2",
3332 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SNOOP_NONE", 282 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD",
3333 "MSRIndex": "0x1a6,0x1a7", 283 "SampleAfterValue": "2000003",
3334 "SampleAfterValue": "100003", 284 "BriefDescription": "Cycles with offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore.",
3335 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SNOOP_NONE", 285 "CounterMask": "1",
3336 "Offcore": "1", 286 "CounterHTOff": "0,1,2,3,4,5,6,7"
3337 "CounterHTOff": "0,1,2,3"
3338 }, 287 },
3339 { 288 {
3340 "EventCode": "0xB7, 0xBB", 289 "PublicDescription": "Counts the number of offcore outstanding RFO (store) transactions in the super queue (SQ) every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
3341 "MSRValue": "0x0040400002 ", 290 "EventCode": "0x60",
3342 "Counter": "0,1,2,3", 291 "Counter": "0,1,2,3",
3343 "UMask": "0x1", 292 "UMask": "0x4",
3344 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SPL_HIT", 293 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO",
3345 "MSRIndex": "0x1a6,0x1a7", 294 "SampleAfterValue": "2000003",
3346 "SampleAfterValue": "100003", 295 "BriefDescription": "Offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore, every cycle",
3347 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SPL_HIT", 296 "CounterHTOff": "0,1,2,3,4,5,6,7"
3348 "Offcore": "1",
3349 "CounterHTOff": "0,1,2,3"
3350 }, 297 },
3351 { 298 {
3352 "EventCode": "0xB7, 0xBB", 299 "PublicDescription": "Counts the number of offcore outstanding demand rfo Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
3353 "MSRValue": "0x3fc01c0002 ", 300 "EventCode": "0x60",
3354 "Counter": "0,1,2,3", 301 "Counter": "0,1,2,3",
3355 "UMask": "0x1", 302 "UMask": "0x4",
3356 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.ANY_SNOOP", 303 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_RFO",
3357 "MSRIndex": "0x1a6,0x1a7", 304 "SampleAfterValue": "2000003",
3358 "SampleAfterValue": "100003", 305 "BriefDescription": "Cycles with offcore outstanding demand rfo reads transactions in SuperQueue (SQ), queue to uncore.",
3359 "BriefDescription": "DEMAND_RFO & L3_HIT & ANY_SNOOP", 306 "CounterMask": "1",
3360 "Offcore": "1", 307 "CounterHTOff": "0,1,2,3,4,5,6,7"
3361 "CounterHTOff": "0,1,2,3"
3362 }, 308 },
3363 { 309 {
3364 "EventCode": "0xB7, 0xBB", 310 "PublicDescription": "Counts the number of offcore outstanding cacheable Core Data Read transactions in the super queue every cycle. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
3365 "MSRValue": "0x10001c0002 ", 311 "EventCode": "0x60",
3366 "Counter": "0,1,2,3", 312 "Counter": "0,1,2,3",
3367 "UMask": "0x1", 313 "UMask": "0x8",
3368 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_HITM", 314 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",
3369 "MSRIndex": "0x1a6,0x1a7", 315 "SampleAfterValue": "2000003",
3370 "SampleAfterValue": "100003", 316 "BriefDescription": "Offcore outstanding cacheable Core Data Read transactions in SuperQueue (SQ), queue to uncore",
3371 "BriefDescription": "DEMAND_RFO & L3_HIT & SNOOP_HITM", 317 "CounterHTOff": "0,1,2,3,4,5,6,7"
3372 "Offcore": "1",
3373 "CounterHTOff": "0,1,2,3"
3374 }, 318 },
3375 { 319 {
3376 "EventCode": "0xB7, 0xBB", 320 "PublicDescription": "Counts cycles when offcore outstanding cacheable Core Data Read transactions are present in the super queue. A transaction is considered to be in the Offcore outstanding state between L2 miss and transaction completion sent to requestor (SQ de-allocation). See corresponding Umask under OFFCORE_REQUESTS.",
3377 "MSRValue": "0x04001c0002 ", 321 "EventCode": "0x60",
3378 "Counter": "0,1,2,3", 322 "Counter": "0,1,2,3",
3379 "UMask": "0x1", 323 "UMask": "0x8",
3380 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_HIT_NO_FWD", 324 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DATA_RD",
3381 "MSRIndex": "0x1a6,0x1a7", 325 "SampleAfterValue": "2000003",
3382 "SampleAfterValue": "100003", 326 "BriefDescription": "Cycles when offcore outstanding cacheable Core Data Read transactions are present in SuperQueue (SQ), queue to uncore.",
3383 "BriefDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded.", 327 "CounterMask": "1",
3384 "Offcore": "1", 328 "CounterHTOff": "0,1,2,3,4,5,6,7"
3385 "CounterHTOff": "0,1,2,3"
3386 }, 329 },
3387 { 330 {
3388 "EventCode": "0xB7, 0xBB", 331 "PublicDescription": "Counts the Demand Data Read requests sent to uncore. Use it in conjunction with OFFCORE_REQUESTS_OUTSTANDING to determine average latency in the uncore.",
3389 "MSRValue": "0x02001c0002 ", 332 "EventCode": "0xB0",
3390 "Counter": "0,1,2,3", 333 "Counter": "0,1,2,3",
3391 "UMask": "0x1", 334 "UMask": "0x1",
3392 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_MISS", 335 "EventName": "OFFCORE_REQUESTS.DEMAND_DATA_RD",
3393 "MSRIndex": "0x1a6,0x1a7",
3394 "SampleAfterValue": "100003", 336 "SampleAfterValue": "100003",
3395 "BriefDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoops sent to sibling cores return clean response.", 337 "BriefDescription": "Demand Data Read requests sent to uncore",
3396 "Offcore": "1", 338 "CounterHTOff": "0,1,2,3,4,5,6,7"
3397 "CounterHTOff": "0,1,2,3"
3398 }, 339 },
3399 { 340 {
3400 "EventCode": "0xB7, 0xBB", 341 "PublicDescription": "Counts both cacheable and non-cacheable code read requests.",
3401 "MSRValue": "0x01001c0002 ", 342 "EventCode": "0xB0",
3402 "Counter": "0,1,2,3", 343 "Counter": "0,1,2,3",
3403 "UMask": "0x1", 344 "UMask": "0x2",
3404 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_NOT_NEEDED", 345 "EventName": "OFFCORE_REQUESTS.DEMAND_CODE_RD",
3405 "MSRIndex": "0x1a6,0x1a7",
3406 "SampleAfterValue": "100003", 346 "SampleAfterValue": "100003",
3407 "BriefDescription": "Counts all demand data writes (RFOs) that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.", 347 "BriefDescription": "Cacheable and noncachaeble code read requests",
3408 "Offcore": "1", 348 "CounterHTOff": "0,1,2,3,4,5,6,7"
3409 "CounterHTOff": "0,1,2,3"
3410 }, 349 },
3411 { 350 {
3412 "EventCode": "0xB7, 0xBB", 351 "PublicDescription": "Counts the demand RFO (read for ownership) requests including regular RFOs, locks, ItoM.",
3413 "MSRValue": "0x00801c0002 ", 352 "EventCode": "0xB0",
3414 "Counter": "0,1,2,3", 353 "Counter": "0,1,2,3",
3415 "UMask": "0x1", 354 "UMask": "0x4",
3416 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_NONE", 355 "EventName": "OFFCORE_REQUESTS.DEMAND_RFO",
3417 "MSRIndex": "0x1a6,0x1a7",
3418 "SampleAfterValue": "100003", 356 "SampleAfterValue": "100003",
3419 "BriefDescription": "DEMAND_RFO & L3_HIT & SNOOP_NONE", 357 "BriefDescription": "Demand RFO requests including regular RFOs, locks, ItoM",
3420 "Offcore": "1", 358 "CounterHTOff": "0,1,2,3,4,5,6,7"
3421 "CounterHTOff": "0,1,2,3"
3422 }, 359 },
3423 { 360 {
3424 "EventCode": "0xB7, 0xBB", 361 "PublicDescription": "Counts the demand and prefetch data reads. All Core Data Reads include cacheable 'Demands' and L2 prefetchers (not L3 prefetchers). Counting also covers reads due to page walks resulted from any request type.",
3425 "MSRValue": "0x00401c0002 ", 362 "EventCode": "0xB0",
3426 "Counter": "0,1,2,3", 363 "Counter": "0,1,2,3",
3427 "UMask": "0x1", 364 "UMask": "0x8",
3428 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SPL_HIT", 365 "EventName": "OFFCORE_REQUESTS.ALL_DATA_RD",
3429 "MSRIndex": "0x1a6,0x1a7",
3430 "SampleAfterValue": "100003", 366 "SampleAfterValue": "100003",
3431 "BriefDescription": "DEMAND_RFO & L3_HIT & SPL_HIT", 367 "BriefDescription": "Demand and prefetch data reads",
3432 "Offcore": "1", 368 "CounterHTOff": "0,1,2,3,4,5,6,7"
3433 "CounterHTOff": "0,1,2,3"
3434 }, 369 },
3435 { 370 {
3436 "EventCode": "0xB7, 0xBB", 371 "PublicDescription": "Counts memory transactions reached the super queue including requests initiated by the core, all L3 prefetches, page walks, etc..",
3437 "MSRValue": "0x3fc0100002 ", 372 "EventCode": "0xB0",
3438 "Counter": "0,1,2,3", 373 "Counter": "0,1,2,3",
3439 "UMask": "0x1", 374 "UMask": "0x80",
3440 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.ANY_SNOOP", 375 "EventName": "OFFCORE_REQUESTS.ALL_REQUESTS",
3441 "MSRIndex": "0x1a6,0x1a7",
3442 "SampleAfterValue": "100003", 376 "SampleAfterValue": "100003",
3443 "BriefDescription": "DEMAND_RFO & L3_HIT_S & ANY_SNOOP", 377 "BriefDescription": "Any memory transaction that reached the SQ.",
3444 "Offcore": "1", 378 "CounterHTOff": "0,1,2,3,4,5,6,7"
3445 "CounterHTOff": "0,1,2,3"
3446 }, 379 },
3447 { 380 {
3448 "EventCode": "0xB7, 0xBB", 381 "PublicDescription": "Counts the number of cases when the offcore requests buffer cannot take more entries for the core. This can happen when the superqueue does not contain eligible entries, or when L1D writeback pending FIFO requests is full.Note: Writeback pending FIFO has six entries.",
3449 "MSRValue": "0x1000100002 ", 382 "EventCode": "0xB2",
3450 "Counter": "0,1,2,3", 383 "Counter": "0,1,2,3",
3451 "UMask": "0x1", 384 "UMask": "0x1",
3452 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SNOOP_HITM", 385 "EventName": "OFFCORE_REQUESTS_BUFFER.SQ_FULL",
3453 "MSRIndex": "0x1a6,0x1a7", 386 "SampleAfterValue": "2000003",
3454 "SampleAfterValue": "100003", 387 "BriefDescription": "Offcore requests buffer cannot take more entries for this thread core.",
3455 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SNOOP_HITM", 388 "CounterHTOff": "0,1,2,3,4,5,6,7"
3456 "Offcore": "1",
3457 "CounterHTOff": "0,1,2,3"
3458 }, 389 },
3459 { 390 {
391 "PublicDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3460 "EventCode": "0xB7, 0xBB", 392 "EventCode": "0xB7, 0xBB",
3461 "MSRValue": "0x0400100002 ",
3462 "Counter": "0,1,2,3", 393 "Counter": "0,1,2,3",
3463 "UMask": "0x1", 394 "UMask": "0x1",
3464 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SNOOP_HIT_NO_FWD", 395 "EventName": "OFFCORE_RESPONSE",
3465 "MSRIndex": "0x1a6,0x1a7",
3466 "SampleAfterValue": "100003", 396 "SampleAfterValue": "100003",
3467 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SNOOP_HIT_NO_FWD", 397 "BriefDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction",
3468 "Offcore": "1",
3469 "CounterHTOff": "0,1,2,3" 398 "CounterHTOff": "0,1,2,3"
3470 }, 399 },
3471 { 400 {
3472 "EventCode": "0xB7, 0xBB", 401 "PEBS": "1",
3473 "MSRValue": "0x0200100002 ", 402 "PublicDescription": "Retired load instructions that miss the STLB.",
403 "EventCode": "0xD0",
3474 "Counter": "0,1,2,3", 404 "Counter": "0,1,2,3",
3475 "UMask": "0x1", 405 "UMask": "0x11",
3476 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SNOOP_MISS", 406 "EventName": "MEM_INST_RETIRED.STLB_MISS_LOADS",
3477 "MSRIndex": "0x1a6,0x1a7",
3478 "SampleAfterValue": "100003", 407 "SampleAfterValue": "100003",
3479 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SNOOP_MISS", 408 "BriefDescription": "Retired load instructions that miss the STLB. (Precise Event)",
3480 "Offcore": "1", 409 "CounterHTOff": "0,1,2,3",
3481 "CounterHTOff": "0,1,2,3" 410 "Data_LA": "1"
3482 }, 411 },
3483 { 412 {
3484 "EventCode": "0xB7, 0xBB", 413 "PEBS": "1",
3485 "MSRValue": "0x0100100002 ", 414 "PublicDescription": "Retired store instructions that miss the STLB.",
415 "EventCode": "0xD0",
3486 "Counter": "0,1,2,3", 416 "Counter": "0,1,2,3",
3487 "UMask": "0x1", 417 "UMask": "0x12",
3488 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SNOOP_NOT_NEEDED", 418 "EventName": "MEM_INST_RETIRED.STLB_MISS_STORES",
3489 "MSRIndex": "0x1a6,0x1a7",
3490 "SampleAfterValue": "100003", 419 "SampleAfterValue": "100003",
3491 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SNOOP_NOT_NEEDED", 420 "BriefDescription": "Retired store instructions that miss the STLB. (Precise Event)",
3492 "Offcore": "1", 421 "CounterHTOff": "0,1,2,3",
3493 "CounterHTOff": "0,1,2,3" 422 "Data_LA": "1",
423 "L1_Hit_Indication": "1"
3494 }, 424 },
3495 { 425 {
3496 "EventCode": "0xB7, 0xBB", 426 "PEBS": "1",
3497 "MSRValue": "0x0080100002 ", 427 "EventCode": "0xD0",
3498 "Counter": "0,1,2,3", 428 "Counter": "0,1,2,3",
3499 "UMask": "0x1", 429 "UMask": "0x21",
3500 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SNOOP_NONE", 430 "EventName": "MEM_INST_RETIRED.LOCK_LOADS",
3501 "MSRIndex": "0x1a6,0x1a7", 431 "SampleAfterValue": "100007",
3502 "SampleAfterValue": "100003", 432 "BriefDescription": "Retired load instructions with locked access. (Precise Event)",
3503 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SNOOP_NONE", 433 "CounterHTOff": "0,1,2,3",
3504 "Offcore": "1", 434 "Data_LA": "1"
3505 "CounterHTOff": "0,1,2,3"
3506 }, 435 },
3507 { 436 {
3508 "EventCode": "0xB7, 0xBB", 437 "PEBS": "1",
3509 "MSRValue": "0x0040100002 ", 438 "EventCode": "0xD0",
3510 "Counter": "0,1,2,3", 439 "Counter": "0,1,2,3",
3511 "UMask": "0x1", 440 "UMask": "0x41",
3512 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SPL_HIT", 441 "EventName": "MEM_INST_RETIRED.SPLIT_LOADS",
3513 "MSRIndex": "0x1a6,0x1a7",
3514 "SampleAfterValue": "100003", 442 "SampleAfterValue": "100003",
3515 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SPL_HIT", 443 "BriefDescription": "Retired load instructions that split across a cacheline boundary. (Precise Event)",
3516 "Offcore": "1", 444 "CounterHTOff": "0,1,2,3",
3517 "CounterHTOff": "0,1,2,3" 445 "Data_LA": "1"
3518 }, 446 },
3519 { 447 {
3520 "EventCode": "0xB7, 0xBB", 448 "PEBS": "1",
3521 "MSRValue": "0x3fc0080002 ", 449 "EventCode": "0xD0",
3522 "Counter": "0,1,2,3", 450 "Counter": "0,1,2,3",
3523 "UMask": "0x1", 451 "UMask": "0x42",
3524 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.ANY_SNOOP", 452 "EventName": "MEM_INST_RETIRED.SPLIT_STORES",
3525 "MSRIndex": "0x1a6,0x1a7",
3526 "SampleAfterValue": "100003", 453 "SampleAfterValue": "100003",
3527 "BriefDescription": "DEMAND_RFO & L3_HIT_E & ANY_SNOOP", 454 "BriefDescription": "Retired store instructions that split across a cacheline boundary. (Precise Event)",
3528 "Offcore": "1", 455 "CounterHTOff": "0,1,2,3",
3529 "CounterHTOff": "0,1,2,3" 456 "Data_LA": "1",
457 "L1_Hit_Indication": "1"
3530 }, 458 },
3531 { 459 {
3532 "EventCode": "0xB7, 0xBB", 460 "PEBS": "1",
3533 "MSRValue": "0x1000080002 ", 461 "EventCode": "0xD0",
3534 "Counter": "0,1,2,3", 462 "Counter": "0,1,2,3",
3535 "UMask": "0x1", 463 "UMask": "0x81",
3536 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SNOOP_HITM", 464 "EventName": "MEM_INST_RETIRED.ALL_LOADS",
3537 "MSRIndex": "0x1a6,0x1a7", 465 "SampleAfterValue": "2000003",
3538 "SampleAfterValue": "100003", 466 "BriefDescription": "All retired load instructions. (Precise Event)",
3539 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SNOOP_HITM", 467 "CounterHTOff": "0,1,2,3",
3540 "Offcore": "1", 468 "Data_LA": "1"
3541 "CounterHTOff": "0,1,2,3"
3542 }, 469 },
3543 { 470 {
3544 "EventCode": "0xB7, 0xBB", 471 "PEBS": "1",
3545 "MSRValue": "0x0400080002 ", 472 "PublicDescription": "All retired store instructions.",
473 "EventCode": "0xD0",
3546 "Counter": "0,1,2,3", 474 "Counter": "0,1,2,3",
3547 "UMask": "0x1", 475 "UMask": "0x82",
3548 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SNOOP_HIT_NO_FWD", 476 "EventName": "MEM_INST_RETIRED.ALL_STORES",
3549 "MSRIndex": "0x1a6,0x1a7", 477 "SampleAfterValue": "2000003",
3550 "SampleAfterValue": "100003", 478 "BriefDescription": "All retired store instructions. (Precise Event)",
3551 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SNOOP_HIT_NO_FWD", 479 "CounterHTOff": "0,1,2,3",
3552 "Offcore": "1", 480 "Data_LA": "1",
3553 "CounterHTOff": "0,1,2,3" 481 "L1_Hit_Indication": "1"
3554 }, 482 },
3555 { 483 {
3556 "EventCode": "0xB7, 0xBB", 484 "PEBS": "1",
3557 "MSRValue": "0x0200080002 ", 485 "PublicDescription": "Counts retired load instructions with at least one uop that hit in the L1 data cache. This event includes all SW prefetches and lock instructions regardless of the data source.\r\n",
486 "EventCode": "0xD1",
3558 "Counter": "0,1,2,3", 487 "Counter": "0,1,2,3",
3559 "UMask": "0x1", 488 "UMask": "0x1",
3560 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SNOOP_MISS", 489 "EventName": "MEM_LOAD_RETIRED.L1_HIT",
3561 "MSRIndex": "0x1a6,0x1a7", 490 "SampleAfterValue": "2000003",
3562 "SampleAfterValue": "100003", 491 "BriefDescription": "Retired load instructions with L1 cache hits as data sources",
3563 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SNOOP_MISS", 492 "CounterHTOff": "0,1,2,3",
3564 "Offcore": "1", 493 "Data_LA": "1"
3565 "CounterHTOff": "0,1,2,3"
3566 }, 494 },
3567 { 495 {
3568 "EventCode": "0xB7, 0xBB", 496 "PEBS": "1",
3569 "MSRValue": "0x0100080002 ", 497 "PublicDescription": "Retired load instructions with L2 cache hits as data sources.",
498 "EventCode": "0xD1",
3570 "Counter": "0,1,2,3", 499 "Counter": "0,1,2,3",
3571 "UMask": "0x1", 500 "UMask": "0x2",
3572 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SNOOP_NOT_NEEDED", 501 "EventName": "MEM_LOAD_RETIRED.L2_HIT",
3573 "MSRIndex": "0x1a6,0x1a7",
3574 "SampleAfterValue": "100003", 502 "SampleAfterValue": "100003",
3575 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SNOOP_NOT_NEEDED", 503 "BriefDescription": "Retired load instructions with L2 cache hits as data sources",
3576 "Offcore": "1", 504 "CounterHTOff": "0,1,2,3",
3577 "CounterHTOff": "0,1,2,3" 505 "Data_LA": "1"
3578 }, 506 },
3579 { 507 {
3580 "EventCode": "0xB7, 0xBB", 508 "PEBS": "1",
3581 "MSRValue": "0x0080080002 ", 509 "PublicDescription": "Retired load instructions with L3 cache hits as data sources.",
510 "EventCode": "0xD1",
3582 "Counter": "0,1,2,3", 511 "Counter": "0,1,2,3",
3583 "UMask": "0x1", 512 "UMask": "0x4",
3584 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SNOOP_NONE", 513 "EventName": "MEM_LOAD_RETIRED.L3_HIT",
3585 "MSRIndex": "0x1a6,0x1a7", 514 "SampleAfterValue": "50021",
3586 "SampleAfterValue": "100003", 515 "BriefDescription": "Retired load instructions with L3 cache hits as data sources",
3587 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SNOOP_NONE", 516 "CounterHTOff": "0,1,2,3",
3588 "Offcore": "1", 517 "Data_LA": "1"
3589 "CounterHTOff": "0,1,2,3"
3590 }, 518 },
3591 { 519 {
3592 "EventCode": "0xB7, 0xBB", 520 "PEBS": "1",
3593 "MSRValue": "0x0040080002 ", 521 "PublicDescription": "Counts retired load instructions with at least one uop that missed in the L1 cache.",
522 "EventCode": "0xD1",
3594 "Counter": "0,1,2,3", 523 "Counter": "0,1,2,3",
3595 "UMask": "0x1", 524 "UMask": "0x8",
3596 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SPL_HIT", 525 "EventName": "MEM_LOAD_RETIRED.L1_MISS",
3597 "MSRIndex": "0x1a6,0x1a7",
3598 "SampleAfterValue": "100003", 526 "SampleAfterValue": "100003",
3599 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SPL_HIT", 527 "BriefDescription": "Retired load instructions missed L1 cache as data sources",
3600 "Offcore": "1", 528 "CounterHTOff": "0,1,2,3",
3601 "CounterHTOff": "0,1,2,3" 529 "Data_LA": "1"
3602 }, 530 },
3603 { 531 {
3604 "EventCode": "0xB7, 0xBB", 532 "PEBS": "1",
3605 "MSRValue": "0x3fc0040002 ", 533 "PublicDescription": "Retired load instructions missed L2 cache as data sources.",
534 "EventCode": "0xD1",
3606 "Counter": "0,1,2,3", 535 "Counter": "0,1,2,3",
3607 "UMask": "0x1", 536 "UMask": "0x10",
3608 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.ANY_SNOOP", 537 "EventName": "MEM_LOAD_RETIRED.L2_MISS",
3609 "MSRIndex": "0x1a6,0x1a7", 538 "SampleAfterValue": "50021",
3610 "SampleAfterValue": "100003", 539 "BriefDescription": "Retired load instructions missed L2 cache as data sources",
3611 "BriefDescription": "DEMAND_RFO & L3_HIT_M & ANY_SNOOP", 540 "CounterHTOff": "0,1,2,3",
3612 "Offcore": "1", 541 "Data_LA": "1"
3613 "CounterHTOff": "0,1,2,3"
3614 }, 542 },
3615 { 543 {
3616 "EventCode": "0xB7, 0xBB", 544 "PEBS": "1",
3617 "MSRValue": "0x1000040002 ", 545 "PublicDescription": "Retired load instructions missed L3 cache as data sources.",
546 "EventCode": "0xD1",
3618 "Counter": "0,1,2,3", 547 "Counter": "0,1,2,3",
3619 "UMask": "0x1", 548 "UMask": "0x20",
3620 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SNOOP_HITM", 549 "EventName": "MEM_LOAD_RETIRED.L3_MISS",
3621 "MSRIndex": "0x1a6,0x1a7", 550 "SampleAfterValue": "100007",
3622 "SampleAfterValue": "100003", 551 "BriefDescription": "Retired load instructions missed L3 cache as data sources",
3623 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SNOOP_HITM", 552 "CounterHTOff": "0,1,2,3",
3624 "Offcore": "1", 553 "Data_LA": "1"
3625 "CounterHTOff": "0,1,2,3"
3626 }, 554 },
3627 { 555 {
3628 "EventCode": "0xB7, 0xBB", 556 "PEBS": "1",
3629 "MSRValue": "0x0400040002 ", 557 "PublicDescription": "Counts retired load instructions with at least one uop was load missed in L1 but hit FB (Fill Buffers) due to preceding miss to the same cache line with data not ready. \r\n",
558 "EventCode": "0xD1",
3630 "Counter": "0,1,2,3", 559 "Counter": "0,1,2,3",
3631 "UMask": "0x1", 560 "UMask": "0x40",
3632 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SNOOP_HIT_NO_FWD", 561 "EventName": "MEM_LOAD_RETIRED.FB_HIT",
3633 "MSRIndex": "0x1a6,0x1a7", 562 "SampleAfterValue": "100007",
3634 "SampleAfterValue": "100003", 563 "BriefDescription": "Retired load instructions which data sources were load missed L1 but hit FB due to preceding miss to the same cache line with data not ready",
3635 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SNOOP_HIT_NO_FWD", 564 "CounterHTOff": "0,1,2,3",
3636 "Offcore": "1", 565 "Data_LA": "1"
3637 "CounterHTOff": "0,1,2,3"
3638 }, 566 },
3639 { 567 {
3640 "EventCode": "0xB7, 0xBB", 568 "PEBS": "1",
3641 "MSRValue": "0x0200040002 ", 569 "EventCode": "0xD2",
3642 "Counter": "0,1,2,3", 570 "Counter": "0,1,2,3",
3643 "UMask": "0x1", 571 "UMask": "0x1",
3644 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SNOOP_MISS", 572 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS",
3645 "MSRIndex": "0x1a6,0x1a7", 573 "SampleAfterValue": "20011",
3646 "SampleAfterValue": "100003", 574 "BriefDescription": "Retired load instructions which data sources were L3 hit and cross-core snoop missed in on-pkg core cache.",
3647 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SNOOP_MISS", 575 "CounterHTOff": "0,1,2,3",
3648 "Offcore": "1", 576 "Data_LA": "1"
3649 "CounterHTOff": "0,1,2,3"
3650 }, 577 },
3651 { 578 {
3652 "EventCode": "0xB7, 0xBB", 579 "PEBS": "1",
3653 "MSRValue": "0x0100040002 ", 580 "PublicDescription": "Retired load instructions which data sources were L3 and cross-core snoop hits in on-pkg core cache.",
581 "EventCode": "0xD2",
3654 "Counter": "0,1,2,3", 582 "Counter": "0,1,2,3",
3655 "UMask": "0x1", 583 "UMask": "0x2",
3656 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SNOOP_NOT_NEEDED", 584 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_HIT",
3657 "MSRIndex": "0x1a6,0x1a7", 585 "SampleAfterValue": "20011",
3658 "SampleAfterValue": "100003", 586 "BriefDescription": "Retired load instructions which data sources were L3 and cross-core snoop hits in on-pkg core cache",
3659 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SNOOP_NOT_NEEDED", 587 "CounterHTOff": "0,1,2,3",
3660 "Offcore": "1", 588 "Data_LA": "1"
3661 "CounterHTOff": "0,1,2,3"
3662 }, 589 },
3663 { 590 {
3664 "EventCode": "0xB7, 0xBB", 591 "PEBS": "1",
3665 "MSRValue": "0x0080040002 ", 592 "PublicDescription": "Retired load instructions which data sources were HitM responses from shared L3.",
593 "EventCode": "0xD2",
3666 "Counter": "0,1,2,3", 594 "Counter": "0,1,2,3",
3667 "UMask": "0x1", 595 "UMask": "0x4",
3668 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SNOOP_NONE", 596 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_HITM",
3669 "MSRIndex": "0x1a6,0x1a7", 597 "SampleAfterValue": "20011",
3670 "SampleAfterValue": "100003", 598 "BriefDescription": "Retired load instructions which data sources were HitM responses from shared L3",
3671 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SNOOP_NONE", 599 "CounterHTOff": "0,1,2,3",
3672 "Offcore": "1", 600 "Data_LA": "1"
3673 "CounterHTOff": "0,1,2,3"
3674 }, 601 },
3675 { 602 {
3676 "EventCode": "0xB7, 0xBB", 603 "PEBS": "1",
3677 "MSRValue": "0x0040040002 ", 604 "PublicDescription": "Retired load instructions which data sources were hits in L3 without snoops required.",
605 "EventCode": "0xD2",
3678 "Counter": "0,1,2,3", 606 "Counter": "0,1,2,3",
3679 "UMask": "0x1", 607 "UMask": "0x8",
3680 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SPL_HIT", 608 "EventName": "MEM_LOAD_L3_HIT_RETIRED.XSNP_NONE",
3681 "MSRIndex": "0x1a6,0x1a7",
3682 "SampleAfterValue": "100003", 609 "SampleAfterValue": "100003",
3683 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SPL_HIT", 610 "BriefDescription": "Retired load instructions which data sources were hits in L3 without snoops required",
3684 "Offcore": "1", 611 "CounterHTOff": "0,1,2,3",
3685 "CounterHTOff": "0,1,2,3" 612 "Data_LA": "1"
3686 }, 613 },
3687 { 614 {
3688 "EventCode": "0xB7, 0xBB", 615 "PEBS": "1",
3689 "MSRValue": "0x3fc0020002 ", 616 "EventCode": "0xD4",
3690 "Counter": "0,1,2,3", 617 "Counter": "0,1,2,3",
3691 "UMask": "0x1", 618 "UMask": "0x4",
3692 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.ANY_SNOOP", 619 "EventName": "MEM_LOAD_MISC_RETIRED.UC",
3693 "MSRIndex": "0x1a6,0x1a7", 620 "SampleAfterValue": "100007",
3694 "SampleAfterValue": "100003", 621 "BriefDescription": "Retired instructions with at least 1 uncacheable load or lock.",
3695 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & ANY_SNOOP", 622 "CounterHTOff": "0,1,2,3",
3696 "Offcore": "1", 623 "Data_LA": "1"
3697 "CounterHTOff": "0,1,2,3"
3698 }, 624 },
3699 { 625 {
3700 "EventCode": "0xB7, 0xBB", 626 "PublicDescription": "Counts L2 writebacks that access L2 cache.",
3701 "MSRValue": "0x1000020002 ", 627 "EventCode": "0xF0",
3702 "Counter": "0,1,2,3", 628 "Counter": "0,1,2,3",
3703 "UMask": "0x1", 629 "UMask": "0x40",
3704 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SNOOP_HITM", 630 "EventName": "L2_TRANS.L2_WB",
3705 "MSRIndex": "0x1a6,0x1a7", 631 "SampleAfterValue": "200003",
3706 "SampleAfterValue": "100003", 632 "BriefDescription": "L2 writebacks that access L2 cache",
3707 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SNOOP_HITM", 633 "CounterHTOff": "0,1,2,3,4,5,6,7"
3708 "Offcore": "1",
3709 "CounterHTOff": "0,1,2,3"
3710 }, 634 },
3711 { 635 {
3712 "EventCode": "0xB7, 0xBB", 636 "PublicDescription": "Counts the number of L2 cache lines filling the L2. Counting does not cover rejects.",
3713 "MSRValue": "0x0400020002 ", 637 "EventCode": "0xF1",
3714 "Counter": "0,1,2,3", 638 "Counter": "0,1,2,3",
3715 "UMask": "0x1", 639 "UMask": "0x1f",
3716 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SNOOP_HIT_NO_FWD", 640 "EventName": "L2_LINES_IN.ALL",
3717 "MSRIndex": "0x1a6,0x1a7",
3718 "SampleAfterValue": "100003", 641 "SampleAfterValue": "100003",
3719 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SNOOP_HIT_NO_FWD", 642 "BriefDescription": "L2 cache lines filling L2",
3720 "Offcore": "1", 643 "CounterHTOff": "0,1,2,3,4,5,6,7"
3721 "CounterHTOff": "0,1,2,3"
3722 }, 644 },
3723 { 645 {
3724 "EventCode": "0xB7, 0xBB", 646 "EventCode": "0xF2",
3725 "MSRValue": "0x0200020002 ",
3726 "Counter": "0,1,2,3", 647 "Counter": "0,1,2,3",
3727 "UMask": "0x1", 648 "UMask": "0x1",
3728 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SNOOP_MISS", 649 "EventName": "L2_LINES_OUT.SILENT",
3729 "MSRIndex": "0x1a6,0x1a7", 650 "SampleAfterValue": "200003",
3730 "SampleAfterValue": "100003", 651 "BriefDescription": "Counts the number of lines that are silently dropped by L2 cache when triggered by an L2 cache fill. These lines are typically in Shared or Exclusive state. A non-threaded event.",
3731 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SNOOP_MISS", 652 "CounterHTOff": "0,1,2,3,4,5,6,7"
3732 "Offcore": "1",
3733 "CounterHTOff": "0,1,2,3"
3734 }, 653 },
3735 { 654 {
3736 "EventCode": "0xB7, 0xBB", 655 "EventCode": "0xF2",
3737 "MSRValue": "0x0100020002 ",
3738 "Counter": "0,1,2,3", 656 "Counter": "0,1,2,3",
3739 "UMask": "0x1", 657 "UMask": "0x2",
3740 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SNOOP_NOT_NEEDED", 658 "EventName": "L2_LINES_OUT.NON_SILENT",
3741 "MSRIndex": "0x1a6,0x1a7", 659 "SampleAfterValue": "200003",
3742 "SampleAfterValue": "100003", 660 "BriefDescription": "Counts the number of lines that are evicted by L2 cache when triggered by an L2 cache fill. Those lines are in Modified state. Modified lines are written back to L3",
3743 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SNOOP_NOT_NEEDED", 661 "CounterHTOff": "0,1,2,3,4,5,6,7"
3744 "Offcore": "1",
3745 "CounterHTOff": "0,1,2,3"
3746 }, 662 },
3747 { 663 {
3748 "EventCode": "0xB7, 0xBB", 664 "PublicDescription": "Counts the number of lines that have been hardware prefetched but not used and now evicted by L2 cache.",
3749 "MSRValue": "0x0080020002 ", 665 "EventCode": "0xF2",
3750 "Counter": "0,1,2,3", 666 "Counter": "0,1,2,3",
3751 "UMask": "0x1", 667 "UMask": "0x4",
3752 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SNOOP_NONE", 668 "EventName": "L2_LINES_OUT.USELESS_PREF",
3753 "MSRIndex": "0x1a6,0x1a7", 669 "SampleAfterValue": "200003",
3754 "SampleAfterValue": "100003", 670 "BriefDescription": "Counts the number of lines that have been hardware prefetched but not used and now evicted by L2 cache",
3755 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SNOOP_NONE", 671 "CounterHTOff": "0,1,2,3,4,5,6,7"
3756 "Offcore": "1",
3757 "CounterHTOff": "0,1,2,3"
3758 }, 672 },
3759 { 673 {
3760 "EventCode": "0xB7, 0xBB", 674 "EventCode": "0xF2",
3761 "MSRValue": "0x0040020002 ",
3762 "Counter": "0,1,2,3", 675 "Counter": "0,1,2,3",
3763 "UMask": "0x1", 676 "UMask": "0x4",
3764 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SPL_HIT", 677 "EventName": "L2_LINES_OUT.USELESS_HWPF",
3765 "MSRIndex": "0x1a6,0x1a7", 678 "SampleAfterValue": "200003",
3766 "SampleAfterValue": "100003", 679 "BriefDescription": "Counts the number of lines that have been hardware prefetched but not used and now evicted by L2 cache",
3767 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SPL_HIT", 680 "CounterHTOff": "0,1,2,3,4,5,6,7"
3768 "Offcore": "1",
3769 "CounterHTOff": "0,1,2,3"
3770 }, 681 },
3771 { 682 {
3772 "EventCode": "0xB7, 0xBB", 683 "PublicDescription": "Counts the number of cache line split locks sent to the uncore.",
3773 "MSRValue": "0x0000010002 ", 684 "EventCode": "0xF4",
3774 "Counter": "0,1,2,3", 685 "Counter": "0,1,2,3",
3775 "UMask": "0x1", 686 "UMask": "0x10",
3776 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.ANY_RESPONSE", 687 "EventName": "SQ_MISC.SPLIT_LOCK",
3777 "MSRIndex": "0x1a6,0x1a7",
3778 "SampleAfterValue": "100003", 688 "SampleAfterValue": "100003",
3779 "BriefDescription": "Counts all demand data writes (RFOs) that have any response type.", 689 "BriefDescription": "Number of cache line split locks sent to uncore.",
3780 "Offcore": "1", 690 "CounterHTOff": "0,1,2,3,4,5,6,7"
3781 "CounterHTOff": "0,1,2,3"
3782 }, 691 },
3783 { 692 {
693 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3784 "EventCode": "0xB7, 0xBB", 694 "EventCode": "0xB7, 0xBB",
3785 "MSRValue": "0x3fc0400001 ", 695 "MSRValue": "0x3fc0400001 ",
3786 "Counter": "0,1,2,3", 696 "Counter": "0,1,2,3",
@@ -3793,6 +703,7 @@
3793 "CounterHTOff": "0,1,2,3" 703 "CounterHTOff": "0,1,2,3"
3794 }, 704 },
3795 { 705 {
706 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3796 "EventCode": "0xB7, 0xBB", 707 "EventCode": "0xB7, 0xBB",
3797 "MSRValue": "0x1000400001 ", 708 "MSRValue": "0x1000400001 ",
3798 "Counter": "0,1,2,3", 709 "Counter": "0,1,2,3",
@@ -3805,6 +716,7 @@
3805 "CounterHTOff": "0,1,2,3" 716 "CounterHTOff": "0,1,2,3"
3806 }, 717 },
3807 { 718 {
719 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3808 "EventCode": "0xB7, 0xBB", 720 "EventCode": "0xB7, 0xBB",
3809 "MSRValue": "0x0400400001 ", 721 "MSRValue": "0x0400400001 ",
3810 "Counter": "0,1,2,3", 722 "Counter": "0,1,2,3",
@@ -3817,6 +729,7 @@
3817 "CounterHTOff": "0,1,2,3" 729 "CounterHTOff": "0,1,2,3"
3818 }, 730 },
3819 { 731 {
732 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3820 "EventCode": "0xB7, 0xBB", 733 "EventCode": "0xB7, 0xBB",
3821 "MSRValue": "0x0200400001 ", 734 "MSRValue": "0x0200400001 ",
3822 "Counter": "0,1,2,3", 735 "Counter": "0,1,2,3",
@@ -3829,6 +742,7 @@
3829 "CounterHTOff": "0,1,2,3" 742 "CounterHTOff": "0,1,2,3"
3830 }, 743 },
3831 { 744 {
745 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3832 "EventCode": "0xB7, 0xBB", 746 "EventCode": "0xB7, 0xBB",
3833 "MSRValue": "0x0100400001 ", 747 "MSRValue": "0x0100400001 ",
3834 "Counter": "0,1,2,3", 748 "Counter": "0,1,2,3",
@@ -3841,6 +755,7 @@
3841 "CounterHTOff": "0,1,2,3" 755 "CounterHTOff": "0,1,2,3"
3842 }, 756 },
3843 { 757 {
758 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3844 "EventCode": "0xB7, 0xBB", 759 "EventCode": "0xB7, 0xBB",
3845 "MSRValue": "0x0080400001 ", 760 "MSRValue": "0x0080400001 ",
3846 "Counter": "0,1,2,3", 761 "Counter": "0,1,2,3",
@@ -3853,18 +768,7 @@
3853 "CounterHTOff": "0,1,2,3" 768 "CounterHTOff": "0,1,2,3"
3854 }, 769 },
3855 { 770 {
3856 "EventCode": "0xB7, 0xBB", 771 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3857 "MSRValue": "0x0040400001 ",
3858 "Counter": "0,1,2,3",
3859 "UMask": "0x1",
3860 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L4_HIT_LOCAL_L4.SPL_HIT",
3861 "MSRIndex": "0x1a6,0x1a7",
3862 "SampleAfterValue": "100003",
3863 "BriefDescription": "DEMAND_DATA_RD & L4_HIT_LOCAL_L4 & SPL_HIT",
3864 "Offcore": "1",
3865 "CounterHTOff": "0,1,2,3"
3866 },
3867 {
3868 "EventCode": "0xB7, 0xBB", 772 "EventCode": "0xB7, 0xBB",
3869 "MSRValue": "0x3fc01c0001 ", 773 "MSRValue": "0x3fc01c0001 ",
3870 "Counter": "0,1,2,3", 774 "Counter": "0,1,2,3",
@@ -3877,6 +781,7 @@
3877 "CounterHTOff": "0,1,2,3" 781 "CounterHTOff": "0,1,2,3"
3878 }, 782 },
3879 { 783 {
784 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3880 "EventCode": "0xB7, 0xBB", 785 "EventCode": "0xB7, 0xBB",
3881 "MSRValue": "0x10001c0001 ", 786 "MSRValue": "0x10001c0001 ",
3882 "Counter": "0,1,2,3", 787 "Counter": "0,1,2,3",
@@ -3889,6 +794,7 @@
3889 "CounterHTOff": "0,1,2,3" 794 "CounterHTOff": "0,1,2,3"
3890 }, 795 },
3891 { 796 {
797 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoops to sibling cores hit in either E/S state and the line is not forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3892 "EventCode": "0xB7, 0xBB", 798 "EventCode": "0xB7, 0xBB",
3893 "MSRValue": "0x04001c0001 ", 799 "MSRValue": "0x04001c0001 ",
3894 "Counter": "0,1,2,3", 800 "Counter": "0,1,2,3",
@@ -3901,6 +807,7 @@
3901 "CounterHTOff": "0,1,2,3" 807 "CounterHTOff": "0,1,2,3"
3902 }, 808 },
3903 { 809 {
810 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoops sent to sibling cores return clean response. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3904 "EventCode": "0xB7, 0xBB", 811 "EventCode": "0xB7, 0xBB",
3905 "MSRValue": "0x02001c0001 ", 812 "MSRValue": "0x02001c0001 ",
3906 "Counter": "0,1,2,3", 813 "Counter": "0,1,2,3",
@@ -3913,6 +820,7 @@
3913 "CounterHTOff": "0,1,2,3" 820 "CounterHTOff": "0,1,2,3"
3914 }, 821 },
3915 { 822 {
823 "PublicDescription": "Counts demand data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3916 "EventCode": "0xB7, 0xBB", 824 "EventCode": "0xB7, 0xBB",
3917 "MSRValue": "0x01001c0001 ", 825 "MSRValue": "0x01001c0001 ",
3918 "Counter": "0,1,2,3", 826 "Counter": "0,1,2,3",
@@ -3925,6 +833,7 @@
3925 "CounterHTOff": "0,1,2,3" 833 "CounterHTOff": "0,1,2,3"
3926 }, 834 },
3927 { 835 {
836 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3928 "EventCode": "0xB7, 0xBB", 837 "EventCode": "0xB7, 0xBB",
3929 "MSRValue": "0x00801c0001 ", 838 "MSRValue": "0x00801c0001 ",
3930 "Counter": "0,1,2,3", 839 "Counter": "0,1,2,3",
@@ -3937,270 +846,7 @@
3937 "CounterHTOff": "0,1,2,3" 846 "CounterHTOff": "0,1,2,3"
3938 }, 847 },
3939 { 848 {
3940 "EventCode": "0xB7, 0xBB", 849 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
3941 "MSRValue": "0x00401c0001 ",
3942 "Counter": "0,1,2,3",
3943 "UMask": "0x1",
3944 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.SPL_HIT",
3945 "MSRIndex": "0x1a6,0x1a7",
3946 "SampleAfterValue": "100003",
3947 "BriefDescription": "DEMAND_DATA_RD & L3_HIT & SPL_HIT",
3948 "Offcore": "1",
3949 "CounterHTOff": "0,1,2,3"
3950 },
3951 {
3952 "EventCode": "0xB7, 0xBB",
3953 "MSRValue": "0x3fc0100001 ",
3954 "Counter": "0,1,2,3",
3955 "UMask": "0x1",
3956 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.ANY_SNOOP",
3957 "MSRIndex": "0x1a6,0x1a7",
3958 "SampleAfterValue": "100003",
3959 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & ANY_SNOOP",
3960 "Offcore": "1",
3961 "CounterHTOff": "0,1,2,3"
3962 },
3963 {
3964 "EventCode": "0xB7, 0xBB",
3965 "MSRValue": "0x1000100001 ",
3966 "Counter": "0,1,2,3",
3967 "UMask": "0x1",
3968 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SNOOP_HITM",
3969 "MSRIndex": "0x1a6,0x1a7",
3970 "SampleAfterValue": "100003",
3971 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SNOOP_HITM",
3972 "Offcore": "1",
3973 "CounterHTOff": "0,1,2,3"
3974 },
3975 {
3976 "EventCode": "0xB7, 0xBB",
3977 "MSRValue": "0x0400100001 ",
3978 "Counter": "0,1,2,3",
3979 "UMask": "0x1",
3980 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SNOOP_HIT_NO_FWD",
3981 "MSRIndex": "0x1a6,0x1a7",
3982 "SampleAfterValue": "100003",
3983 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SNOOP_HIT_NO_FWD",
3984 "Offcore": "1",
3985 "CounterHTOff": "0,1,2,3"
3986 },
3987 {
3988 "EventCode": "0xB7, 0xBB",
3989 "MSRValue": "0x0200100001 ",
3990 "Counter": "0,1,2,3",
3991 "UMask": "0x1",
3992 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SNOOP_MISS",
3993 "MSRIndex": "0x1a6,0x1a7",
3994 "SampleAfterValue": "100003",
3995 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SNOOP_MISS",
3996 "Offcore": "1",
3997 "CounterHTOff": "0,1,2,3"
3998 },
3999 {
4000 "EventCode": "0xB7, 0xBB",
4001 "MSRValue": "0x0100100001 ",
4002 "Counter": "0,1,2,3",
4003 "UMask": "0x1",
4004 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SNOOP_NOT_NEEDED",
4005 "MSRIndex": "0x1a6,0x1a7",
4006 "SampleAfterValue": "100003",
4007 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SNOOP_NOT_NEEDED",
4008 "Offcore": "1",
4009 "CounterHTOff": "0,1,2,3"
4010 },
4011 {
4012 "EventCode": "0xB7, 0xBB",
4013 "MSRValue": "0x0080100001 ",
4014 "Counter": "0,1,2,3",
4015 "UMask": "0x1",
4016 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SNOOP_NONE",
4017 "MSRIndex": "0x1a6,0x1a7",
4018 "SampleAfterValue": "100003",
4019 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SNOOP_NONE",
4020 "Offcore": "1",
4021 "CounterHTOff": "0,1,2,3"
4022 },
4023 {
4024 "EventCode": "0xB7, 0xBB",
4025 "MSRValue": "0x0040100001 ",
4026 "Counter": "0,1,2,3",
4027 "UMask": "0x1",
4028 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SPL_HIT",
4029 "MSRIndex": "0x1a6,0x1a7",
4030 "SampleAfterValue": "100003",
4031 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SPL_HIT",
4032 "Offcore": "1",
4033 "CounterHTOff": "0,1,2,3"
4034 },
4035 {
4036 "EventCode": "0xB7, 0xBB",
4037 "MSRValue": "0x3fc0080001 ",
4038 "Counter": "0,1,2,3",
4039 "UMask": "0x1",
4040 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.ANY_SNOOP",
4041 "MSRIndex": "0x1a6,0x1a7",
4042 "SampleAfterValue": "100003",
4043 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & ANY_SNOOP",
4044 "Offcore": "1",
4045 "CounterHTOff": "0,1,2,3"
4046 },
4047 {
4048 "EventCode": "0xB7, 0xBB",
4049 "MSRValue": "0x1000080001 ",
4050 "Counter": "0,1,2,3",
4051 "UMask": "0x1",
4052 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SNOOP_HITM",
4053 "MSRIndex": "0x1a6,0x1a7",
4054 "SampleAfterValue": "100003",
4055 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SNOOP_HITM",
4056 "Offcore": "1",
4057 "CounterHTOff": "0,1,2,3"
4058 },
4059 {
4060 "EventCode": "0xB7, 0xBB",
4061 "MSRValue": "0x0400080001 ",
4062 "Counter": "0,1,2,3",
4063 "UMask": "0x1",
4064 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SNOOP_HIT_NO_FWD",
4065 "MSRIndex": "0x1a6,0x1a7",
4066 "SampleAfterValue": "100003",
4067 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SNOOP_HIT_NO_FWD",
4068 "Offcore": "1",
4069 "CounterHTOff": "0,1,2,3"
4070 },
4071 {
4072 "EventCode": "0xB7, 0xBB",
4073 "MSRValue": "0x0200080001 ",
4074 "Counter": "0,1,2,3",
4075 "UMask": "0x1",
4076 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SNOOP_MISS",
4077 "MSRIndex": "0x1a6,0x1a7",
4078 "SampleAfterValue": "100003",
4079 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SNOOP_MISS",
4080 "Offcore": "1",
4081 "CounterHTOff": "0,1,2,3"
4082 },
4083 {
4084 "EventCode": "0xB7, 0xBB",
4085 "MSRValue": "0x0100080001 ",
4086 "Counter": "0,1,2,3",
4087 "UMask": "0x1",
4088 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SNOOP_NOT_NEEDED",
4089 "MSRIndex": "0x1a6,0x1a7",
4090 "SampleAfterValue": "100003",
4091 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SNOOP_NOT_NEEDED",
4092 "Offcore": "1",
4093 "CounterHTOff": "0,1,2,3"
4094 },
4095 {
4096 "EventCode": "0xB7, 0xBB",
4097 "MSRValue": "0x0080080001 ",
4098 "Counter": "0,1,2,3",
4099 "UMask": "0x1",
4100 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SNOOP_NONE",
4101 "MSRIndex": "0x1a6,0x1a7",
4102 "SampleAfterValue": "100003",
4103 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SNOOP_NONE",
4104 "Offcore": "1",
4105 "CounterHTOff": "0,1,2,3"
4106 },
4107 {
4108 "EventCode": "0xB7, 0xBB",
4109 "MSRValue": "0x0040080001 ",
4110 "Counter": "0,1,2,3",
4111 "UMask": "0x1",
4112 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SPL_HIT",
4113 "MSRIndex": "0x1a6,0x1a7",
4114 "SampleAfterValue": "100003",
4115 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SPL_HIT",
4116 "Offcore": "1",
4117 "CounterHTOff": "0,1,2,3"
4118 },
4119 {
4120 "EventCode": "0xB7, 0xBB",
4121 "MSRValue": "0x3fc0040001 ",
4122 "Counter": "0,1,2,3",
4123 "UMask": "0x1",
4124 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.ANY_SNOOP",
4125 "MSRIndex": "0x1a6,0x1a7",
4126 "SampleAfterValue": "100003",
4127 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & ANY_SNOOP",
4128 "Offcore": "1",
4129 "CounterHTOff": "0,1,2,3"
4130 },
4131 {
4132 "EventCode": "0xB7, 0xBB",
4133 "MSRValue": "0x1000040001 ",
4134 "Counter": "0,1,2,3",
4135 "UMask": "0x1",
4136 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SNOOP_HITM",
4137 "MSRIndex": "0x1a6,0x1a7",
4138 "SampleAfterValue": "100003",
4139 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SNOOP_HITM",
4140 "Offcore": "1",
4141 "CounterHTOff": "0,1,2,3"
4142 },
4143 {
4144 "EventCode": "0xB7, 0xBB",
4145 "MSRValue": "0x0400040001 ",
4146 "Counter": "0,1,2,3",
4147 "UMask": "0x1",
4148 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SNOOP_HIT_NO_FWD",
4149 "MSRIndex": "0x1a6,0x1a7",
4150 "SampleAfterValue": "100003",
4151 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SNOOP_HIT_NO_FWD",
4152 "Offcore": "1",
4153 "CounterHTOff": "0,1,2,3"
4154 },
4155 {
4156 "EventCode": "0xB7, 0xBB",
4157 "MSRValue": "0x0200040001 ",
4158 "Counter": "0,1,2,3",
4159 "UMask": "0x1",
4160 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SNOOP_MISS",
4161 "MSRIndex": "0x1a6,0x1a7",
4162 "SampleAfterValue": "100003",
4163 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SNOOP_MISS",
4164 "Offcore": "1",
4165 "CounterHTOff": "0,1,2,3"
4166 },
4167 {
4168 "EventCode": "0xB7, 0xBB",
4169 "MSRValue": "0x0100040001 ",
4170 "Counter": "0,1,2,3",
4171 "UMask": "0x1",
4172 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SNOOP_NOT_NEEDED",
4173 "MSRIndex": "0x1a6,0x1a7",
4174 "SampleAfterValue": "100003",
4175 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SNOOP_NOT_NEEDED",
4176 "Offcore": "1",
4177 "CounterHTOff": "0,1,2,3"
4178 },
4179 {
4180 "EventCode": "0xB7, 0xBB",
4181 "MSRValue": "0x0080040001 ",
4182 "Counter": "0,1,2,3",
4183 "UMask": "0x1",
4184 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SNOOP_NONE",
4185 "MSRIndex": "0x1a6,0x1a7",
4186 "SampleAfterValue": "100003",
4187 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SNOOP_NONE",
4188 "Offcore": "1",
4189 "CounterHTOff": "0,1,2,3"
4190 },
4191 {
4192 "EventCode": "0xB7, 0xBB",
4193 "MSRValue": "0x0040040001 ",
4194 "Counter": "0,1,2,3",
4195 "UMask": "0x1",
4196 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SPL_HIT",
4197 "MSRIndex": "0x1a6,0x1a7",
4198 "SampleAfterValue": "100003",
4199 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SPL_HIT",
4200 "Offcore": "1",
4201 "CounterHTOff": "0,1,2,3"
4202 },
4203 {
4204 "EventCode": "0xB7, 0xBB", 850 "EventCode": "0xB7, 0xBB",
4205 "MSRValue": "0x3fc0020001 ", 851 "MSRValue": "0x3fc0020001 ",
4206 "Counter": "0,1,2,3", 852 "Counter": "0,1,2,3",
@@ -4213,6 +859,7 @@
4213 "CounterHTOff": "0,1,2,3" 859 "CounterHTOff": "0,1,2,3"
4214 }, 860 },
4215 { 861 {
862 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
4216 "EventCode": "0xB7, 0xBB", 863 "EventCode": "0xB7, 0xBB",
4217 "MSRValue": "0x1000020001 ", 864 "MSRValue": "0x1000020001 ",
4218 "Counter": "0,1,2,3", 865 "Counter": "0,1,2,3",
@@ -4225,6 +872,7 @@
4225 "CounterHTOff": "0,1,2,3" 872 "CounterHTOff": "0,1,2,3"
4226 }, 873 },
4227 { 874 {
875 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
4228 "EventCode": "0xB7, 0xBB", 876 "EventCode": "0xB7, 0xBB",
4229 "MSRValue": "0x0400020001 ", 877 "MSRValue": "0x0400020001 ",
4230 "Counter": "0,1,2,3", 878 "Counter": "0,1,2,3",
@@ -4237,6 +885,7 @@
4237 "CounterHTOff": "0,1,2,3" 885 "CounterHTOff": "0,1,2,3"
4238 }, 886 },
4239 { 887 {
888 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
4240 "EventCode": "0xB7, 0xBB", 889 "EventCode": "0xB7, 0xBB",
4241 "MSRValue": "0x0200020001 ", 890 "MSRValue": "0x0200020001 ",
4242 "Counter": "0,1,2,3", 891 "Counter": "0,1,2,3",
@@ -4249,6 +898,7 @@
4249 "CounterHTOff": "0,1,2,3" 898 "CounterHTOff": "0,1,2,3"
4250 }, 899 },
4251 { 900 {
901 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
4252 "EventCode": "0xB7, 0xBB", 902 "EventCode": "0xB7, 0xBB",
4253 "MSRValue": "0x0100020001 ", 903 "MSRValue": "0x0100020001 ",
4254 "Counter": "0,1,2,3", 904 "Counter": "0,1,2,3",
@@ -4261,6 +911,7 @@
4261 "CounterHTOff": "0,1,2,3" 911 "CounterHTOff": "0,1,2,3"
4262 }, 912 },
4263 { 913 {
914 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
4264 "EventCode": "0xB7, 0xBB", 915 "EventCode": "0xB7, 0xBB",
4265 "MSRValue": "0x0080020001 ", 916 "MSRValue": "0x0080020001 ",
4266 "Counter": "0,1,2,3", 917 "Counter": "0,1,2,3",
@@ -4273,18 +924,7 @@
4273 "CounterHTOff": "0,1,2,3" 924 "CounterHTOff": "0,1,2,3"
4274 }, 925 },
4275 { 926 {
4276 "EventCode": "0xB7, 0xBB", 927 "PublicDescription": "Counts demand data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
4277 "MSRValue": "0x0040020001 ",
4278 "Counter": "0,1,2,3",
4279 "UMask": "0x1",
4280 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.SUPPLIER_NONE.SPL_HIT",
4281 "MSRIndex": "0x1a6,0x1a7",
4282 "SampleAfterValue": "100003",
4283 "BriefDescription": "DEMAND_DATA_RD & SUPPLIER_NONE & SPL_HIT",
4284 "Offcore": "1",
4285 "CounterHTOff": "0,1,2,3"
4286 },
4287 {
4288 "EventCode": "0xB7, 0xBB", 928 "EventCode": "0xB7, 0xBB",
4289 "MSRValue": "0x0000010001 ", 929 "MSRValue": "0x0000010001 ",
4290 "Counter": "0,1,2,3", 930 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/skylake/floating-point.json b/tools/perf/pmu-events/arch/x86/skylake/floating-point.json
index 3c6b59af5d54..213dd6230cf2 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/floating-point.json
@@ -27,13 +27,12 @@
27 "CounterHTOff": "0,1,2,3,4,5,6,7" 27 "CounterHTOff": "0,1,2,3,4,5,6,7"
28 }, 28 },
29 { 29 {
30 "PublicDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
31 "EventCode": "0xC7", 30 "EventCode": "0xC7",
32 "Counter": "0,1,2,3", 31 "Counter": "0,1,2,3",
33 "UMask": "0x8", 32 "UMask": "0x8",
34 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE", 33 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE",
35 "SampleAfterValue": "2000003", 34 "SampleAfterValue": "2000003",
36 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ", 35 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
37 "CounterHTOff": "0,1,2,3,4,5,6,7" 36 "CounterHTOff": "0,1,2,3,4,5,6,7"
38 }, 37 },
39 { 38 {
@@ -55,7 +54,7 @@
55 "CounterHTOff": "0,1,2,3,4,5,6,7" 54 "CounterHTOff": "0,1,2,3,4,5,6,7"
56 }, 55 },
57 { 56 {
58 "PublicDescription": "This event counts cycles with any input and output SSE or x87 FP assist. If an input and output assist are detected on the same cycle the event increments by 1.", 57 "PublicDescription": "Counts cycles with any input and output SSE or x87 FP assist. If an input and output assist are detected on the same cycle the event increments by 1.",
59 "EventCode": "0xCA", 58 "EventCode": "0xCA",
60 "Counter": "0,1,2,3", 59 "Counter": "0,1,2,3",
61 "UMask": "0x1e", 60 "UMask": "0x1e",
diff --git a/tools/perf/pmu-events/arch/x86/skylake/frontend.json b/tools/perf/pmu-events/arch/x86/skylake/frontend.json
index e697dbd63e6e..578dff5bd823 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/frontend.json
@@ -1,62 +1,81 @@
1[ 1[
2 { 2 {
3 "EventCode": "0x80", 3 "PublicDescription": "Counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may 'bypass' the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).",
4 "EventCode": "0x79",
4 "Counter": "0,1,2,3", 5 "Counter": "0,1,2,3",
5 "UMask": "0x4", 6 "UMask": "0x4",
6 "EventName": "ICACHE_16B.IFDATA_STALL", 7 "EventName": "IDQ.MITE_UOPS",
7 "SampleAfterValue": "2000003", 8 "SampleAfterValue": "2000003",
8 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction cache miss.", 9 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path",
9 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
10 }, 11 },
11 { 12 {
12 "EventCode": "0x83", 13 "PublicDescription": "Counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may 'bypass' the IDQ.",
14 "EventCode": "0x79",
13 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
14 "UMask": "0x1", 16 "UMask": "0x4",
15 "EventName": "ICACHE_64B.IFTAG_HIT", 17 "EventName": "IDQ.MITE_CYCLES",
16 "SampleAfterValue": "200003", 18 "SampleAfterValue": "2000003",
17 "BriefDescription": "Instruction fetch tag lookups that hit in the instruction cache (L1I). Counts at 64-byte cache-line granularity.", 19 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path",
20 "CounterMask": "1",
18 "CounterHTOff": "0,1,2,3,4,5,6,7" 21 "CounterHTOff": "0,1,2,3,4,5,6,7"
19 }, 22 },
20 { 23 {
21 "EventCode": "0x83", 24 "PublicDescription": "Counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may 'bypass' the IDQ.",
25 "EventCode": "0x79",
22 "Counter": "0,1,2,3", 26 "Counter": "0,1,2,3",
23 "UMask": "0x2", 27 "UMask": "0x8",
24 "EventName": "ICACHE_64B.IFTAG_MISS", 28 "EventName": "IDQ.DSB_UOPS",
25 "SampleAfterValue": "200003", 29 "SampleAfterValue": "2000003",
26 "BriefDescription": "Instruction fetch tag lookups that miss in the instruction cache (L1I). Counts at 64-byte cache-line granularity.", 30 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path",
27 "CounterHTOff": "0,1,2,3,4,5,6,7" 31 "CounterHTOff": "0,1,2,3,4,5,6,7"
28 }, 32 },
29 { 33 {
30 "EventCode": "0x83", 34 "PublicDescription": "Counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may 'bypass' the IDQ.",
35 "EventCode": "0x79",
31 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
32 "UMask": "0x4", 37 "UMask": "0x8",
33 "EventName": "ICACHE_64B.IFTAG_STALL", 38 "EventName": "IDQ.DSB_CYCLES",
34 "SampleAfterValue": "200003", 39 "SampleAfterValue": "2000003",
35 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction cache tag miss.", 40 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path",
41 "CounterMask": "1",
36 "CounterHTOff": "0,1,2,3,4,5,6,7" 42 "CounterHTOff": "0,1,2,3,4,5,6,7"
37 }, 43 },
38 { 44 {
39 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may 'bypass' the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 45 "PublicDescription": "Counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may 'bypass' the IDQ.",
40 "EventCode": "0x79", 46 "EventCode": "0x79",
41 "Counter": "0,1,2,3", 47 "Counter": "0,1,2,3",
42 "UMask": "0x4", 48 "UMask": "0x10",
43 "EventName": "IDQ.MITE_UOPS", 49 "EventName": "IDQ.MS_DSB_CYCLES",
44 "SampleAfterValue": "2000003", 50 "SampleAfterValue": "2000003",
45 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from MITE path", 51 "BriefDescription": "Cycles when uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
52 "CounterMask": "1",
46 "CounterHTOff": "0,1,2,3,4,5,6,7" 53 "CounterHTOff": "0,1,2,3,4,5,6,7"
47 }, 54 },
48 { 55 {
49 "PublicDescription": "This event counts the number of uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may 'bypass' the IDQ.", 56 "PublicDescription": "Counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Count includes uops that may 'bypass' the IDQ.",
50 "EventCode": "0x79", 57 "EventCode": "0x79",
51 "Counter": "0,1,2,3", 58 "Counter": "0,1,2,3",
52 "UMask": "0x8", 59 "UMask": "0x18",
53 "EventName": "IDQ.DSB_UOPS", 60 "EventName": "IDQ.ALL_DSB_CYCLES_4_UOPS",
54 "SampleAfterValue": "2000003", 61 "SampleAfterValue": "2000003",
55 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path", 62 "BriefDescription": "Cycles Decode Stream Buffer (DSB) is delivering 4 Uops",
63 "CounterMask": "4",
56 "CounterHTOff": "0,1,2,3,4,5,6,7" 64 "CounterHTOff": "0,1,2,3,4,5,6,7"
57 }, 65 },
58 { 66 {
59 "PublicDescription": "This event counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may 'bypass' the IDQ.", 67 "PublicDescription": "Counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Count includes uops that may 'bypass' the IDQ.",
68 "EventCode": "0x79",
69 "Counter": "0,1,2,3",
70 "UMask": "0x18",
71 "EventName": "IDQ.ALL_DSB_CYCLES_ANY_UOPS",
72 "SampleAfterValue": "2000003",
73 "BriefDescription": "Cycles Decode Stream Buffer (DSB) is delivering any Uop",
74 "CounterMask": "1",
75 "CounterHTOff": "0,1,2,3,4,5,6,7"
76 },
77 {
78 "PublicDescription": "Counts the number of uops initiated by MITE and delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may 'bypass' the IDQ.",
60 "EventCode": "0x79", 79 "EventCode": "0x79",
61 "Counter": "0,1,2,3", 80 "Counter": "0,1,2,3",
62 "UMask": "0x20", 81 "UMask": "0x20",
@@ -66,95 +85,99 @@
66 "CounterHTOff": "0,1,2,3,4,5,6,7" 85 "CounterHTOff": "0,1,2,3,4,5,6,7"
67 }, 86 },
68 { 87 {
69 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may 'bypass' the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.", 88 "PublicDescription": "Counts the number of cycles 4 uops were delivered to the Instruction Decode Queue (IDQ) from the MITE (legacy decode pipeline) path. Counting includes uops that may 'bypass' the IDQ. During these cycles uops are not being delivered from the Decode Stream Buffer (DSB).",
70 "EventCode": "0x79", 89 "EventCode": "0x79",
71 "Counter": "0,1,2,3", 90 "Counter": "0,1,2,3",
72 "UMask": "0x30", 91 "UMask": "0x24",
73 "EventName": "IDQ.MS_CYCLES", 92 "EventName": "IDQ.ALL_MITE_CYCLES_4_UOPS",
74 "SampleAfterValue": "2000003", 93 "SampleAfterValue": "2000003",
75 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 94 "BriefDescription": "Cycles MITE is delivering 4 Uops",
76 "CounterMask": "1", 95 "CounterMask": "4",
77 "CounterHTOff": "0,1,2,3,4,5,6,7" 96 "CounterHTOff": "0,1,2,3,4,5,6,7"
78 }, 97 },
79 { 98 {
80 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may 'bypass' the IDQ.", 99 "PublicDescription": "Counts the number of cycles uops were delivered to the Instruction Decode Queue (IDQ) from the MITE (legacy decode pipeline) path. Counting includes uops that may 'bypass' the IDQ. During these cycles uops are not being delivered from the Decode Stream Buffer (DSB).",
81 "EventCode": "0x79", 100 "EventCode": "0x79",
82 "Counter": "0,1,2,3", 101 "Counter": "0,1,2,3",
83 "UMask": "0x4", 102 "UMask": "0x24",
84 "EventName": "IDQ.MITE_CYCLES", 103 "EventName": "IDQ.ALL_MITE_CYCLES_ANY_UOPS",
85 "SampleAfterValue": "2000003", 104 "SampleAfterValue": "2000003",
86 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from MITE path", 105 "BriefDescription": "Cycles MITE is delivering any Uop",
87 "CounterMask": "1", 106 "CounterMask": "1",
88 "CounterHTOff": "0,1,2,3,4,5,6,7" 107 "CounterHTOff": "0,1,2,3,4,5,6,7"
89 }, 108 },
90 { 109 {
91 "PublicDescription": "This event counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may 'bypass' the IDQ.", 110 "PublicDescription": "Counts cycles during which uops are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may 'bypass' the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
92 "EventCode": "0x79", 111 "EventCode": "0x79",
93 "Counter": "0,1,2,3", 112 "Counter": "0,1,2,3",
94 "UMask": "0x8", 113 "UMask": "0x30",
95 "EventName": "IDQ.DSB_CYCLES", 114 "EventName": "IDQ.MS_CYCLES",
96 "SampleAfterValue": "2000003", 115 "SampleAfterValue": "2000003",
97 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) from Decode Stream Buffer (DSB) path", 116 "BriefDescription": "Cycles when uops are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
98 "CounterMask": "1", 117 "CounterMask": "1",
99 "CounterHTOff": "0,1,2,3,4,5,6,7" 118 "CounterHTOff": "0,1,2,3,4,5,6,7"
100 }, 119 },
101 { 120 {
102 "PublicDescription": "This event counts cycles during which uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while the Microcode Sequencer (MS) is busy. Counting includes uops that may 'bypass' the IDQ.", 121 "PublicDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
103 "EventCode": "0x79", 122 "EventCode": "0x79",
104 "Counter": "0,1,2,3", 123 "Counter": "0,1,2,3",
105 "UMask": "0x10", 124 "UMask": "0x30",
106 "EventName": "IDQ.MS_DSB_CYCLES", 125 "EdgeDetect": "1",
126 "EventName": "IDQ.MS_SWITCHES",
107 "SampleAfterValue": "2000003", 127 "SampleAfterValue": "2000003",
108 "BriefDescription": "Cycles when uops initiated by Decode Stream Buffer (DSB) are being delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy", 128 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer",
109 "CounterMask": "1", 129 "CounterMask": "1",
110 "CounterHTOff": "0,1,2,3,4,5,6,7" 130 "CounterHTOff": "0,1,2,3,4,5,6,7"
111 }, 131 },
112 { 132 {
113 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may 'bypass' the IDQ.", 133 "PublicDescription": "Counts the total number of uops delivered by the Microcode Sequencer (MS). Any instruction over 4 uops will be delivered by the MS. Some instructions such as transcendentals may additionally generate uops from the MS.",
114 "EventCode": "0x79", 134 "EventCode": "0x79",
115 "Counter": "0,1,2,3", 135 "Counter": "0,1,2,3",
116 "UMask": "0x18", 136 "UMask": "0x30",
117 "EventName": "IDQ.ALL_DSB_CYCLES_4_UOPS", 137 "EventName": "IDQ.MS_UOPS",
118 "SampleAfterValue": "2000003", 138 "SampleAfterValue": "2000003",
119 "BriefDescription": "Cycles Decode Stream Buffer (DSB) is delivering 4 Uops", 139 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
120 "CounterMask": "4",
121 "CounterHTOff": "0,1,2,3,4,5,6,7" 140 "CounterHTOff": "0,1,2,3,4,5,6,7"
122 }, 141 },
123 { 142 {
124 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the Decode Stream Buffer (DSB) path. Counting includes uops that may 'bypass' the IDQ.", 143 "PublicDescription": "Cycles where a code line fetch is stalled due to an L1 instruction cache miss. The legacy decode pipeline works at a 16 Byte granularity.",
125 "EventCode": "0x79", 144 "EventCode": "0x80",
126 "Counter": "0,1,2,3", 145 "Counter": "0,1,2,3",
127 "UMask": "0x18", 146 "UMask": "0x4",
128 "EventName": "IDQ.ALL_DSB_CYCLES_ANY_UOPS", 147 "EventName": "ICACHE_16B.IFDATA_STALL",
129 "SampleAfterValue": "2000003", 148 "SampleAfterValue": "2000003",
130 "BriefDescription": "Cycles Decode Stream Buffer (DSB) is delivering any Uop", 149 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction cache miss.",
131 "CounterMask": "1",
132 "CounterHTOff": "0,1,2,3,4,5,6,7" 150 "CounterHTOff": "0,1,2,3,4,5,6,7"
133 }, 151 },
134 { 152 {
135 "PublicDescription": "This event counts the number of cycles 4 uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may 'bypass' the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 153 "EventCode": "0x83",
136 "EventCode": "0x79",
137 "Counter": "0,1,2,3", 154 "Counter": "0,1,2,3",
138 "UMask": "0x24", 155 "UMask": "0x1",
139 "EventName": "IDQ.ALL_MITE_CYCLES_4_UOPS", 156 "EventName": "ICACHE_64B.IFTAG_HIT",
140 "SampleAfterValue": "2000003", 157 "SampleAfterValue": "200003",
141 "BriefDescription": "Cycles MITE is delivering 4 Uops", 158 "BriefDescription": "Instruction fetch tag lookups that hit in the instruction cache (L1I). Counts at 64-byte cache-line granularity.",
142 "CounterMask": "4",
143 "CounterHTOff": "0,1,2,3,4,5,6,7" 159 "CounterHTOff": "0,1,2,3,4,5,6,7"
144 }, 160 },
145 { 161 {
146 "PublicDescription": "This event counts the number of cycles uops were delivered to Instruction Decode Queue (IDQ) from the MITE path. Counting includes uops that may 'bypass' the IDQ. This also means that uops are not being delivered from the Decode Stream Buffer (DSB).", 162 "EventCode": "0x83",
147 "EventCode": "0x79",
148 "Counter": "0,1,2,3", 163 "Counter": "0,1,2,3",
149 "UMask": "0x24", 164 "UMask": "0x2",
150 "EventName": "IDQ.ALL_MITE_CYCLES_ANY_UOPS", 165 "EventName": "ICACHE_64B.IFTAG_MISS",
151 "SampleAfterValue": "2000003", 166 "SampleAfterValue": "200003",
152 "BriefDescription": "Cycles MITE is delivering any Uop", 167 "BriefDescription": "Instruction fetch tag lookups that miss in the instruction cache (L1I). Counts at 64-byte cache-line granularity.",
153 "CounterMask": "1", 168 "CounterHTOff": "0,1,2,3,4,5,6,7"
169 },
170 {
171 "EventCode": "0x83",
172 "Counter": "0,1,2,3",
173 "UMask": "0x4",
174 "EventName": "ICACHE_64B.IFTAG_STALL",
175 "SampleAfterValue": "200003",
176 "BriefDescription": "Cycles where a code fetch is stalled due to L1 instruction cache tag miss.",
154 "CounterHTOff": "0,1,2,3,4,5,6,7" 177 "CounterHTOff": "0,1,2,3,4,5,6,7"
155 }, 178 },
156 { 179 {
157 "PublicDescription": "This event counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding ?4 ? x? when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when:\n a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread\n\n b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions)\n \n c. Instruction Decode Queue (IDQ) delivers four uops.", 180 "PublicDescription": "Counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding 4 x when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when: a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread. b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions). c. Instruction Decode Queue (IDQ) delivers four uops.",
158 "EventCode": "0x9C", 181 "EventCode": "0x9C",
159 "Counter": "0,1,2,3", 182 "Counter": "0,1,2,3",
160 "UMask": "0x1", 183 "UMask": "0x1",
@@ -164,7 +187,7 @@
164 "CounterHTOff": "0,1,2,3,4,5,6,7" 187 "CounterHTOff": "0,1,2,3,4,5,6,7"
165 }, 188 },
166 { 189 {
167 "PublicDescription": "This event counts, on the per-thread basis, cycles when no uops are delivered to Resource Allocation Table (RAT). IDQ_Uops_Not_Delivered.core =4.", 190 "PublicDescription": "Counts, on the per-thread basis, cycles when no uops are delivered to Resource Allocation Table (RAT). IDQ_Uops_Not_Delivered.core =4.",
168 "EventCode": "0x9C", 191 "EventCode": "0x9C",
169 "Counter": "0,1,2,3", 192 "Counter": "0,1,2,3",
170 "UMask": "0x1", 193 "UMask": "0x1",
@@ -175,7 +198,7 @@
175 "CounterHTOff": "0,1,2,3,4,5,6,7" 198 "CounterHTOff": "0,1,2,3,4,5,6,7"
176 }, 199 },
177 { 200 {
178 "PublicDescription": "This event counts, on the per-thread basis, cycles when less than 1 uop is delivered to Resource Allocation Table (RAT). IDQ_Uops_Not_Delivered.core >=3.", 201 "PublicDescription": "Counts, on the per-thread basis, cycles when less than 1 uop is delivered to Resource Allocation Table (RAT). IDQ_Uops_Not_Delivered.core >= 3.",
179 "EventCode": "0x9C", 202 "EventCode": "0x9C",
180 "Counter": "0,1,2,3", 203 "Counter": "0,1,2,3",
181 "UMask": "0x1", 204 "UMask": "0x1",
@@ -186,6 +209,7 @@
186 "CounterHTOff": "0,1,2,3,4,5,6,7" 209 "CounterHTOff": "0,1,2,3,4,5,6,7"
187 }, 210 },
188 { 211 {
212 "PublicDescription": "Cycles with less than 2 uops delivered by the front-end.",
189 "EventCode": "0x9C", 213 "EventCode": "0x9C",
190 "Counter": "0,1,2,3", 214 "Counter": "0,1,2,3",
191 "UMask": "0x1", 215 "UMask": "0x1",
@@ -196,6 +220,7 @@
196 "CounterHTOff": "0,1,2,3,4,5,6,7" 220 "CounterHTOff": "0,1,2,3,4,5,6,7"
197 }, 221 },
198 { 222 {
223 "PublicDescription": "Cycles with less than 3 uops delivered by the front-end.",
199 "EventCode": "0x9C", 224 "EventCode": "0x9C",
200 "Counter": "0,1,2,3", 225 "Counter": "0,1,2,3",
201 "UMask": "0x1", 226 "UMask": "0x1",
@@ -217,7 +242,7 @@
217 "CounterHTOff": "0,1,2,3,4,5,6,7" 242 "CounterHTOff": "0,1,2,3,4,5,6,7"
218 }, 243 },
219 { 244 {
220 "PublicDescription": "This event counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. \nMM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.\nPenalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 0?2 cycles.", 245 "PublicDescription": "Counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. MM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.Penalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 02 cycles.",
221 "EventCode": "0xAB", 246 "EventCode": "0xAB",
222 "Counter": "0,1,2,3", 247 "Counter": "0,1,2,3",
223 "UMask": "0x2", 248 "UMask": "0x2",
@@ -228,6 +253,7 @@
228 }, 253 },
229 { 254 {
230 "PEBS": "1", 255 "PEBS": "1",
256 "PublicDescription": "Counts retired Instructions that experienced DSB (Decode stream buffer i.e. the decoded instruction-cache) miss. \r\n",
231 "EventCode": "0xC6", 257 "EventCode": "0xC6",
232 "MSRValue": "0x11", 258 "MSRValue": "0x11",
233 "Counter": "0,1,2,3", 259 "Counter": "0,1,2,3",
@@ -235,7 +261,7 @@
235 "EventName": "FRONTEND_RETIRED.DSB_MISS", 261 "EventName": "FRONTEND_RETIRED.DSB_MISS",
236 "MSRIndex": "0x3F7", 262 "MSRIndex": "0x3F7",
237 "SampleAfterValue": "100007", 263 "SampleAfterValue": "100007",
238 "BriefDescription": "Retired Instructions who experienced decode stream buffer (DSB - the decoded instruction-cache) miss.", 264 "BriefDescription": "Retired Instructions who experienced decode stream buffer (DSB - the decoded instruction-cache) miss. Precise Event.",
239 "TakenAlone": "1", 265 "TakenAlone": "1",
240 "CounterHTOff": "0,1,2,3" 266 "CounterHTOff": "0,1,2,3"
241 }, 267 },
@@ -248,7 +274,7 @@
248 "EventName": "FRONTEND_RETIRED.L1I_MISS", 274 "EventName": "FRONTEND_RETIRED.L1I_MISS",
249 "MSRIndex": "0x3F7", 275 "MSRIndex": "0x3F7",
250 "SampleAfterValue": "100007", 276 "SampleAfterValue": "100007",
251 "BriefDescription": "Retired Instructions who experienced Instruction L1 Cache true miss.", 277 "BriefDescription": "Retired Instructions who experienced Instruction L1 Cache true miss. Precise Event.",
252 "TakenAlone": "1", 278 "TakenAlone": "1",
253 "CounterHTOff": "0,1,2,3" 279 "CounterHTOff": "0,1,2,3"
254 }, 280 },
@@ -261,12 +287,13 @@
261 "EventName": "FRONTEND_RETIRED.L2_MISS", 287 "EventName": "FRONTEND_RETIRED.L2_MISS",
262 "MSRIndex": "0x3F7", 288 "MSRIndex": "0x3F7",
263 "SampleAfterValue": "100007", 289 "SampleAfterValue": "100007",
264 "BriefDescription": "Retired Instructions who experienced Instruction L2 Cache true miss.", 290 "BriefDescription": "Retired Instructions who experienced Instruction L2 Cache true miss. Precise Event.",
265 "TakenAlone": "1", 291 "TakenAlone": "1",
266 "CounterHTOff": "0,1,2,3" 292 "CounterHTOff": "0,1,2,3"
267 }, 293 },
268 { 294 {
269 "PEBS": "1", 295 "PEBS": "1",
296 "PublicDescription": "Counts retired Instructions that experienced iTLB (Instruction TLB) true miss.",
270 "EventCode": "0xC6", 297 "EventCode": "0xC6",
271 "MSRValue": "0x14", 298 "MSRValue": "0x14",
272 "Counter": "0,1,2,3", 299 "Counter": "0,1,2,3",
@@ -274,12 +301,13 @@
274 "EventName": "FRONTEND_RETIRED.ITLB_MISS", 301 "EventName": "FRONTEND_RETIRED.ITLB_MISS",
275 "MSRIndex": "0x3F7", 302 "MSRIndex": "0x3F7",
276 "SampleAfterValue": "100007", 303 "SampleAfterValue": "100007",
277 "BriefDescription": "Retired Instructions who experienced iTLB true miss.", 304 "BriefDescription": "Retired Instructions who experienced iTLB true miss. Precise Event.",
278 "TakenAlone": "1", 305 "TakenAlone": "1",
279 "CounterHTOff": "0,1,2,3" 306 "CounterHTOff": "0,1,2,3"
280 }, 307 },
281 { 308 {
282 "PEBS": "1", 309 "PEBS": "1",
310 "PublicDescription": "Counts retired Instructions that experienced STLB (2nd level TLB) true miss.",
283 "EventCode": "0xC6", 311 "EventCode": "0xC6",
284 "MSRValue": "0x15", 312 "MSRValue": "0x15",
285 "Counter": "0,1,2,3", 313 "Counter": "0,1,2,3",
@@ -287,7 +315,7 @@
287 "EventName": "FRONTEND_RETIRED.STLB_MISS", 315 "EventName": "FRONTEND_RETIRED.STLB_MISS",
288 "MSRIndex": "0x3F7", 316 "MSRIndex": "0x3F7",
289 "SampleAfterValue": "100007", 317 "SampleAfterValue": "100007",
290 "BriefDescription": "Retired Instructions who experienced STLB (2nd level TLB) true miss.", 318 "BriefDescription": "Retired Instructions who experienced STLB (2nd level TLB) true miss. Precise Event.",
291 "TakenAlone": "1", 319 "TakenAlone": "1",
292 "CounterHTOff": "0,1,2,3" 320 "CounterHTOff": "0,1,2,3"
293 }, 321 },
@@ -300,7 +328,7 @@
300 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2", 328 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2",
301 "MSRIndex": "0x3F7", 329 "MSRIndex": "0x3F7",
302 "SampleAfterValue": "100007", 330 "SampleAfterValue": "100007",
303 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 2 cycles which was not interrupted by a back-end stall.", 331 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
304 "TakenAlone": "1", 332 "TakenAlone": "1",
305 "CounterHTOff": "0,1,2,3" 333 "CounterHTOff": "0,1,2,3"
306 }, 334 },
@@ -313,7 +341,7 @@
313 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_2", 341 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_2",
314 "MSRIndex": "0x3F7", 342 "MSRIndex": "0x3F7",
315 "SampleAfterValue": "100007", 343 "SampleAfterValue": "100007",
316 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 2 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall.", 344 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 2 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
317 "TakenAlone": "1", 345 "TakenAlone": "1",
318 "CounterHTOff": "0,1,2,3" 346 "CounterHTOff": "0,1,2,3"
319 }, 347 },
@@ -326,34 +354,13 @@
326 "EventName": "FRONTEND_RETIRED.LATENCY_GE_4", 354 "EventName": "FRONTEND_RETIRED.LATENCY_GE_4",
327 "MSRIndex": "0x3F7", 355 "MSRIndex": "0x3F7",
328 "SampleAfterValue": "100007", 356 "SampleAfterValue": "100007",
329 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 4 cycles which was not interrupted by a back-end stall.", 357 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 4 cycles which was not interrupted by a back-end stall. Precise Event.",
330 "TakenAlone": "1", 358 "TakenAlone": "1",
331 "CounterHTOff": "0,1,2,3" 359 "CounterHTOff": "0,1,2,3"
332 }, 360 },
333 { 361 {
334 "PublicDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer.",
335 "EventCode": "0x79",
336 "Counter": "0,1,2,3",
337 "UMask": "0x30",
338 "EdgeDetect": "1",
339 "EventName": "IDQ.MS_SWITCHES",
340 "SampleAfterValue": "2000003",
341 "BriefDescription": "Number of switches from DSB (Decode Stream Buffer) or MITE (legacy decode pipeline) to the Microcode Sequencer",
342 "CounterMask": "1",
343 "CounterHTOff": "0,1,2,3,4,5,6,7"
344 },
345 {
346 "PublicDescription": "This event counts the total number of uops delivered to Instruction Decode Queue (IDQ) while the Microcode Sequenser (MS) is busy. Counting includes uops that may 'bypass' the IDQ. Uops maybe initiated by Decode Stream Buffer (DSB) or MITE.",
347 "EventCode": "0x79",
348 "Counter": "0,1,2,3",
349 "UMask": "0x30",
350 "EventName": "IDQ.MS_UOPS",
351 "SampleAfterValue": "2000003",
352 "BriefDescription": "Uops delivered to Instruction Decode Queue (IDQ) while Microcode Sequenser (MS) is busy",
353 "CounterHTOff": "0,1,2,3,4,5,6,7"
354 },
355 {
356 "PEBS": "1", 362 "PEBS": "1",
363 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 8 cycles. During this period the front-end delivered no uops. \r\n",
357 "EventCode": "0xC6", 364 "EventCode": "0xC6",
358 "MSRValue": "0x400806", 365 "MSRValue": "0x400806",
359 "Counter": "0,1,2,3", 366 "Counter": "0,1,2,3",
@@ -367,6 +374,7 @@
367 }, 374 },
368 { 375 {
369 "PEBS": "1", 376 "PEBS": "1",
377 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 16 cycles. During this period the front-end delivered no uops.\r\n",
370 "EventCode": "0xC6", 378 "EventCode": "0xC6",
371 "MSRValue": "0x401006", 379 "MSRValue": "0x401006",
372 "Counter": "0,1,2,3", 380 "Counter": "0,1,2,3",
@@ -374,12 +382,13 @@
374 "EventName": "FRONTEND_RETIRED.LATENCY_GE_16", 382 "EventName": "FRONTEND_RETIRED.LATENCY_GE_16",
375 "MSRIndex": "0x3F7", 383 "MSRIndex": "0x3F7",
376 "SampleAfterValue": "100007", 384 "SampleAfterValue": "100007",
377 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 16 cycles which was not interrupted by a back-end stall.", 385 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 16 cycles which was not interrupted by a back-end stall. Precise Event.",
378 "TakenAlone": "1", 386 "TakenAlone": "1",
379 "CounterHTOff": "0,1,2,3" 387 "CounterHTOff": "0,1,2,3"
380 }, 388 },
381 { 389 {
382 "PEBS": "1", 390 "PEBS": "1",
391 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 32 cycles. During this period the front-end delivered no uops.\r\n",
383 "EventCode": "0xC6", 392 "EventCode": "0xC6",
384 "MSRValue": "0x402006", 393 "MSRValue": "0x402006",
385 "Counter": "0,1,2,3", 394 "Counter": "0,1,2,3",
@@ -387,7 +396,7 @@
387 "EventName": "FRONTEND_RETIRED.LATENCY_GE_32", 396 "EventName": "FRONTEND_RETIRED.LATENCY_GE_32",
388 "MSRIndex": "0x3F7", 397 "MSRIndex": "0x3F7",
389 "SampleAfterValue": "100007", 398 "SampleAfterValue": "100007",
390 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 32 cycles which was not interrupted by a back-end stall.", 399 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 32 cycles which was not interrupted by a back-end stall. Precise Event.",
391 "TakenAlone": "1", 400 "TakenAlone": "1",
392 "CounterHTOff": "0,1,2,3" 401 "CounterHTOff": "0,1,2,3"
393 }, 402 },
@@ -400,7 +409,7 @@
400 "EventName": "FRONTEND_RETIRED.LATENCY_GE_64", 409 "EventName": "FRONTEND_RETIRED.LATENCY_GE_64",
401 "MSRIndex": "0x3F7", 410 "MSRIndex": "0x3F7",
402 "SampleAfterValue": "100007", 411 "SampleAfterValue": "100007",
403 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 64 cycles which was not interrupted by a back-end stall.", 412 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 64 cycles which was not interrupted by a back-end stall. Precise Event.",
404 "TakenAlone": "1", 413 "TakenAlone": "1",
405 "CounterHTOff": "0,1,2,3" 414 "CounterHTOff": "0,1,2,3"
406 }, 415 },
@@ -413,7 +422,7 @@
413 "EventName": "FRONTEND_RETIRED.LATENCY_GE_128", 422 "EventName": "FRONTEND_RETIRED.LATENCY_GE_128",
414 "MSRIndex": "0x3F7", 423 "MSRIndex": "0x3F7",
415 "SampleAfterValue": "100007", 424 "SampleAfterValue": "100007",
416 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 128 cycles which was not interrupted by a back-end stall.", 425 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 128 cycles which was not interrupted by a back-end stall. Precise Event.",
417 "TakenAlone": "1", 426 "TakenAlone": "1",
418 "CounterHTOff": "0,1,2,3" 427 "CounterHTOff": "0,1,2,3"
419 }, 428 },
@@ -426,7 +435,7 @@
426 "EventName": "FRONTEND_RETIRED.LATENCY_GE_256", 435 "EventName": "FRONTEND_RETIRED.LATENCY_GE_256",
427 "MSRIndex": "0x3F7", 436 "MSRIndex": "0x3F7",
428 "SampleAfterValue": "100007", 437 "SampleAfterValue": "100007",
429 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 256 cycles which was not interrupted by a back-end stall.", 438 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 256 cycles which was not interrupted by a back-end stall. Precise Event.",
430 "TakenAlone": "1", 439 "TakenAlone": "1",
431 "CounterHTOff": "0,1,2,3" 440 "CounterHTOff": "0,1,2,3"
432 }, 441 },
@@ -439,12 +448,13 @@
439 "EventName": "FRONTEND_RETIRED.LATENCY_GE_512", 448 "EventName": "FRONTEND_RETIRED.LATENCY_GE_512",
440 "MSRIndex": "0x3F7", 449 "MSRIndex": "0x3F7",
441 "SampleAfterValue": "100007", 450 "SampleAfterValue": "100007",
442 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 512 cycles which was not interrupted by a back-end stall.", 451 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 512 cycles which was not interrupted by a back-end stall. Precise Event.",
443 "TakenAlone": "1", 452 "TakenAlone": "1",
444 "CounterHTOff": "0,1,2,3" 453 "CounterHTOff": "0,1,2,3"
445 }, 454 },
446 { 455 {
447 "PEBS": "1", 456 "PEBS": "1",
457 "PublicDescription": "Counts retired instructions that are delivered to the back-end after the front-end had at least 1 bubble-slot for a period of 2 cycles. A bubble-slot is an empty issue-pipeline slot while there was no RAT stall.\r\n",
448 "EventCode": "0xC6", 458 "EventCode": "0xC6",
449 "MSRValue": "0x100206", 459 "MSRValue": "0x100206",
450 "Counter": "0,1,2,3", 460 "Counter": "0,1,2,3",
@@ -452,7 +462,7 @@
452 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1", 462 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1",
453 "MSRIndex": "0x3F7", 463 "MSRIndex": "0x3F7",
454 "SampleAfterValue": "100007", 464 "SampleAfterValue": "100007",
455 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 1 bubble-slot for a period of 2 cycles which was not interrupted by a back-end stall.", 465 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 1 bubble-slot for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
456 "TakenAlone": "1", 466 "TakenAlone": "1",
457 "CounterHTOff": "0,1,2,3" 467 "CounterHTOff": "0,1,2,3"
458 }, 468 },
@@ -465,7 +475,7 @@
465 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_3", 475 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_3",
466 "MSRIndex": "0x3F7", 476 "MSRIndex": "0x3F7",
467 "SampleAfterValue": "100007", 477 "SampleAfterValue": "100007",
468 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 3 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall.", 478 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 3 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
469 "TakenAlone": "1", 479 "TakenAlone": "1",
470 "CounterHTOff": "0,1,2,3" 480 "CounterHTOff": "0,1,2,3"
471 } 481 }
diff --git a/tools/perf/pmu-events/arch/x86/skylake/memory.json b/tools/perf/pmu-events/arch/x86/skylake/memory.json
index d7fd5b06825b..3bd8b712c889 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/memory.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/memory.json
@@ -1,6 +1,74 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "Unfriendly TSX abort triggered by a flowmarker.", 3 "PublicDescription": "Number of times a TSX line had a cache conflict.",
4 "EventCode": "0x54",
5 "Counter": "0,1,2,3",
6 "UMask": "0x1",
7 "EventName": "TX_MEM.ABORT_CONFLICT",
8 "SampleAfterValue": "2000003",
9 "BriefDescription": "Number of times a transactional abort was signaled due to a data conflict on a transactionally accessed address",
10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 },
12 {
13 "EventCode": "0x54",
14 "Counter": "0,1,2,3",
15 "UMask": "0x2",
16 "EventName": "TX_MEM.ABORT_CAPACITY",
17 "SampleAfterValue": "2000003",
18 "BriefDescription": "Number of times a transactional abort was signaled due to a data capacity limitation for transactional reads or writes.",
19 "CounterHTOff": "0,1,2,3,4,5,6,7"
20 },
21 {
22 "PublicDescription": "Number of times a TSX Abort was triggered due to a non-release/commit store to lock.",
23 "EventCode": "0x54",
24 "Counter": "0,1,2,3",
25 "UMask": "0x4",
26 "EventName": "TX_MEM.ABORT_HLE_STORE_TO_ELIDED_LOCK",
27 "SampleAfterValue": "2000003",
28 "BriefDescription": "Number of times a HLE transactional region aborted due to a non XRELEASE prefixed instruction writing to an elided lock in the elision buffer",
29 "CounterHTOff": "0,1,2,3,4,5,6,7"
30 },
31 {
32 "PublicDescription": "Number of times a TSX Abort was triggered due to commit but Lock Buffer not empty.",
33 "EventCode": "0x54",
34 "Counter": "0,1,2,3",
35 "UMask": "0x8",
36 "EventName": "TX_MEM.ABORT_HLE_ELISION_BUFFER_NOT_EMPTY",
37 "SampleAfterValue": "2000003",
38 "BriefDescription": "Number of times an HLE transactional execution aborted due to NoAllocatedElisionBuffer being non-zero.",
39 "CounterHTOff": "0,1,2,3,4,5,6,7"
40 },
41 {
42 "PublicDescription": "Number of times a TSX Abort was triggered due to release/commit but data and address mismatch.",
43 "EventCode": "0x54",
44 "Counter": "0,1,2,3",
45 "UMask": "0x10",
46 "EventName": "TX_MEM.ABORT_HLE_ELISION_BUFFER_MISMATCH",
47 "SampleAfterValue": "2000003",
48 "BriefDescription": "Number of times an HLE transactional execution aborted due to XRELEASE lock not satisfying the address and value requirements in the elision buffer",
49 "CounterHTOff": "0,1,2,3,4,5,6,7"
50 },
51 {
52 "PublicDescription": "Number of times a TSX Abort was triggered due to attempting an unsupported alignment from Lock Buffer.",
53 "EventCode": "0x54",
54 "Counter": "0,1,2,3",
55 "UMask": "0x20",
56 "EventName": "TX_MEM.ABORT_HLE_ELISION_BUFFER_UNSUPPORTED_ALIGNMENT",
57 "SampleAfterValue": "2000003",
58 "BriefDescription": "Number of times an HLE transactional execution aborted due to an unsupported read alignment from the elision buffer.",
59 "CounterHTOff": "0,1,2,3,4,5,6,7"
60 },
61 {
62 "PublicDescription": "Number of times we could not allocate Lock Buffer.",
63 "EventCode": "0x54",
64 "Counter": "0,1,2,3",
65 "UMask": "0x40",
66 "EventName": "TX_MEM.HLE_ELISION_BUFFER_FULL",
67 "SampleAfterValue": "2000003",
68 "BriefDescription": "Number of times HLE lock could not be elided due to ElisionBufferAvailable being zero.",
69 "CounterHTOff": "0,1,2,3,4,5,6,7"
70 },
71 {
4 "EventCode": "0x5d", 72 "EventCode": "0x5d",
5 "Counter": "0,1,2,3", 73 "Counter": "0,1,2,3",
6 "UMask": "0x1", 74 "UMask": "0x1",
@@ -10,7 +78,7 @@
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 78 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 }, 79 },
12 { 80 {
13 "PublicDescription": "Unfriendly TSX abort triggered by a vzeroupper instruction.", 81 "PublicDescription": "Unfriendly TSX abort triggered by a vzeroupper instruction.",
14 "EventCode": "0x5d", 82 "EventCode": "0x5d",
15 "Counter": "0,1,2,3", 83 "Counter": "0,1,2,3",
16 "UMask": "0x2", 84 "UMask": "0x2",
@@ -50,7 +118,77 @@
50 "CounterHTOff": "0,1,2,3,4,5,6,7" 118 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 }, 119 },
52 { 120 {
53 "PublicDescription": "Number of times we entered an HLE region\n does not count nested transactions.", 121 "EventCode": "0x60",
122 "Counter": "0,1,2,3",
123 "UMask": "0x10",
124 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.L3_MISS_DEMAND_DATA_RD",
125 "SampleAfterValue": "2000003",
126 "BriefDescription": "Counts number of Offcore outstanding Demand Data Read requests that miss L3 cache in the superQ every cycle.",
127 "CounterHTOff": "0,1,2,3,4,5,6,7"
128 },
129 {
130 "EventCode": "0x60",
131 "Counter": "0,1,2,3",
132 "UMask": "0x10",
133 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_L3_MISS_DEMAND_DATA_RD",
134 "SampleAfterValue": "2000003",
135 "BriefDescription": "Cycles with at least 1 Demand Data Read requests who miss L3 cache in the superQ.",
136 "CounterMask": "1",
137 "CounterHTOff": "0,1,2,3,4,5,6,7"
138 },
139 {
140 "EventCode": "0x60",
141 "Counter": "0,1,2,3",
142 "UMask": "0x10",
143 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.L3_MISS_DEMAND_DATA_RD_GE_6",
144 "SampleAfterValue": "2000003",
145 "BriefDescription": "Cycles with at least 6 Demand Data Read requests that miss L3 cache in the superQ.",
146 "CounterMask": "6",
147 "CounterHTOff": "0,1,2,3,4,5,6,7"
148 },
149 {
150 "EventCode": "0xA3",
151 "Counter": "0,1,2,3",
152 "UMask": "0x2",
153 "EventName": "CYCLE_ACTIVITY.CYCLES_L3_MISS",
154 "SampleAfterValue": "2000003",
155 "BriefDescription": "Cycles while L3 cache miss demand load is outstanding.",
156 "CounterMask": "2",
157 "CounterHTOff": "0,1,2,3,4,5,6,7"
158 },
159 {
160 "EventCode": "0xA3",
161 "Counter": "0,1,2,3",
162 "UMask": "0x6",
163 "EventName": "CYCLE_ACTIVITY.STALLS_L3_MISS",
164 "SampleAfterValue": "2000003",
165 "BriefDescription": "Execution stalls while L3 cache miss demand load is outstanding.",
166 "CounterMask": "6",
167 "CounterHTOff": "0,1,2,3,4,5,6,7"
168 },
169 {
170 "PublicDescription": "Demand Data Read requests who miss L3 cache.",
171 "EventCode": "0xB0",
172 "Counter": "0,1,2,3",
173 "UMask": "0x10",
174 "EventName": "OFFCORE_REQUESTS.L3_MISS_DEMAND_DATA_RD",
175 "SampleAfterValue": "100003",
176 "BriefDescription": "Demand Data Read requests who miss L3 cache",
177 "CounterHTOff": "0,1,2,3,4,5,6,7"
178 },
179 {
180 "PublicDescription": "Counts the number of memory ordering Machine Clears detected. Memory Ordering Machine Clears can result from one of the following:a. memory disambiguation,b. external snoop, orc. cross SMT-HW-thread snoop (stores) hitting load buffer.",
181 "EventCode": "0xC3",
182 "Counter": "0,1,2,3",
183 "UMask": "0x2",
184 "Errata": "SKL089",
185 "EventName": "MACHINE_CLEARS.MEMORY_ORDERING",
186 "SampleAfterValue": "100003",
187 "BriefDescription": "Counts the number of machine clears due to memory order conflicts.",
188 "CounterHTOff": "0,1,2,3,4,5,6,7"
189 },
190 {
191 "PublicDescription": "Number of times we entered an HLE region. Does not count nested transactions.",
54 "EventCode": "0xC8", 192 "EventCode": "0xC8",
55 "Counter": "0,1,2,3", 193 "Counter": "0,1,2,3",
56 "UMask": "0x1", 194 "UMask": "0x1",
@@ -71,7 +209,7 @@
71 }, 209 },
72 { 210 {
73 "PEBS": "1", 211 "PEBS": "1",
74 "PublicDescription": "Number of times HLE abort was triggered.", 212 "PublicDescription": "Number of times HLE abort was triggered. (PEBS)",
75 "EventCode": "0xC8", 213 "EventCode": "0xC8",
76 "Counter": "0,1,2,3", 214 "Counter": "0,1,2,3",
77 "UMask": "0x4", 215 "UMask": "0x4",
@@ -99,13 +237,12 @@
99 "CounterHTOff": "0,1,2,3,4,5,6,7" 237 "CounterHTOff": "0,1,2,3,4,5,6,7"
100 }, 238 },
101 { 239 {
102 "PublicDescription": "Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.).",
103 "EventCode": "0xC8", 240 "EventCode": "0xC8",
104 "Counter": "0,1,2,3", 241 "Counter": "0,1,2,3",
105 "UMask": "0x20", 242 "UMask": "0x20",
106 "EventName": "HLE_RETIRED.ABORTED_UNFRIENDLY", 243 "EventName": "HLE_RETIRED.ABORTED_UNFRIENDLY",
107 "SampleAfterValue": "2000003", 244 "SampleAfterValue": "2000003",
108 "BriefDescription": "Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.). ", 245 "BriefDescription": "Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.).",
109 "CounterHTOff": "0,1,2,3,4,5,6,7" 246 "CounterHTOff": "0,1,2,3,4,5,6,7"
110 }, 247 },
111 { 248 {
@@ -128,7 +265,7 @@
128 "CounterHTOff": "0,1,2,3,4,5,6,7" 265 "CounterHTOff": "0,1,2,3,4,5,6,7"
129 }, 266 },
130 { 267 {
131 "PublicDescription": "Number of times we entered an RTM region\n does not count nested transactions.", 268 "PublicDescription": "Number of times we entered an RTM region. Does not count nested transactions.",
132 "EventCode": "0xC9", 269 "EventCode": "0xC9",
133 "Counter": "0,1,2,3", 270 "Counter": "0,1,2,3",
134 "UMask": "0x1", 271 "UMask": "0x1",
@@ -149,7 +286,7 @@
149 }, 286 },
150 { 287 {
151 "PEBS": "1", 288 "PEBS": "1",
152 "PublicDescription": "Number of times RTM abort was triggered.", 289 "PublicDescription": "Number of times RTM abort was triggered. (PEBS)",
153 "EventCode": "0xC9", 290 "EventCode": "0xC9",
154 "Counter": "0,1,2,3", 291 "Counter": "0,1,2,3",
155 "UMask": "0x4", 292 "UMask": "0x4",
@@ -208,17 +345,6 @@
208 "CounterHTOff": "0,1,2,3,4,5,6,7" 345 "CounterHTOff": "0,1,2,3,4,5,6,7"
209 }, 346 },
210 { 347 {
211 "PublicDescription": "This event counts the number of memory ordering Machine Clears detected. Memory Ordering Machine Clears can result from one of the following:\n1. memory disambiguation,\n2. external snoop, or\n3. cross SMT-HW-thread snoop (stores) hitting load buffer.",
212 "EventCode": "0xC3",
213 "Counter": "0,1,2,3",
214 "UMask": "0x2",
215 "Errata": "SKL089",
216 "EventName": "MACHINE_CLEARS.MEMORY_ORDERING",
217 "SampleAfterValue": "100003",
218 "BriefDescription": "Counts the number of machine clears due to memory order conflicts.",
219 "CounterHTOff": "0,1,2,3,4,5,6,7"
220 },
221 {
222 "PEBS": "2", 348 "PEBS": "2",
223 "PublicDescription": "Counts loads when the latency from first dispatch to completion is greater than 4 cycles. Reported latency may be longer than just the memory latency.", 349 "PublicDescription": "Counts loads when the latency from first dispatch to completion is greater than 4 cycles. Reported latency may be longer than just the memory latency.",
224 "EventCode": "0xCD", 350 "EventCode": "0xCD",
@@ -331,1718 +457,7 @@
331 "CounterHTOff": "0,1,2,3" 457 "CounterHTOff": "0,1,2,3"
332 }, 458 },
333 { 459 {
334 "PublicDescription": "Number of times a TSX line had a cache conflict.", 460 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
335 "EventCode": "0x54",
336 "Counter": "0,1,2,3",
337 "UMask": "0x1",
338 "EventName": "TX_MEM.ABORT_CONFLICT",
339 "SampleAfterValue": "2000003",
340 "BriefDescription": "Number of times a transactional abort was signaled due to a data conflict on a transactionally accessed address",
341 "CounterHTOff": "0,1,2,3,4,5,6,7"
342 },
343 {
344 "EventCode": "0x54",
345 "Counter": "0,1,2,3",
346 "UMask": "0x2",
347 "EventName": "TX_MEM.ABORT_CAPACITY",
348 "SampleAfterValue": "2000003",
349 "BriefDescription": "Number of times a transactional abort was signaled due to a data capacity limitation for transactional reads or writes.",
350 "CounterHTOff": "0,1,2,3,4,5,6,7"
351 },
352 {
353 "PublicDescription": "Number of times a TSX Abort was triggered due to a non-release/commit store to lock.",
354 "EventCode": "0x54",
355 "Counter": "0,1,2,3",
356 "UMask": "0x4",
357 "EventName": "TX_MEM.ABORT_HLE_STORE_TO_ELIDED_LOCK",
358 "SampleAfterValue": "2000003",
359 "BriefDescription": "Number of times a HLE transactional region aborted due to a non XRELEASE prefixed instruction writing to an elided lock in the elision buffer",
360 "CounterHTOff": "0,1,2,3,4,5,6,7"
361 },
362 {
363 "PublicDescription": "Number of times a TSX Abort was triggered due to commit but Lock Buffer not empty.",
364 "EventCode": "0x54",
365 "Counter": "0,1,2,3",
366 "UMask": "0x8",
367 "EventName": "TX_MEM.ABORT_HLE_ELISION_BUFFER_NOT_EMPTY",
368 "SampleAfterValue": "2000003",
369 "BriefDescription": "Number of times an HLE transactional execution aborted due to NoAllocatedElisionBuffer being non-zero.",
370 "CounterHTOff": "0,1,2,3,4,5,6,7"
371 },
372 {
373 "PublicDescription": "Number of times a TSX Abort was triggered due to release/commit but data and address mismatch.",
374 "EventCode": "0x54",
375 "Counter": "0,1,2,3",
376 "UMask": "0x10",
377 "EventName": "TX_MEM.ABORT_HLE_ELISION_BUFFER_MISMATCH",
378 "SampleAfterValue": "2000003",
379 "BriefDescription": "Number of times an HLE transactional execution aborted due to XRELEASE lock not satisfying the address and value requirements in the elision buffer",
380 "CounterHTOff": "0,1,2,3,4,5,6,7"
381 },
382 {
383 "PublicDescription": "Number of times a TSX Abort was triggered due to attempting an unsupported alignment from Lock Buffer.",
384 "EventCode": "0x54",
385 "Counter": "0,1,2,3",
386 "UMask": "0x20",
387 "EventName": "TX_MEM.ABORT_HLE_ELISION_BUFFER_UNSUPPORTED_ALIGNMENT",
388 "SampleAfterValue": "2000003",
389 "BriefDescription": "Number of times an HLE transactional execution aborted due to an unsupported read alignment from the elision buffer.",
390 "CounterHTOff": "0,1,2,3,4,5,6,7"
391 },
392 {
393 "PublicDescription": "Number of times we could not allocate Lock Buffer.",
394 "EventCode": "0x54",
395 "Counter": "0,1,2,3",
396 "UMask": "0x40",
397 "EventName": "TX_MEM.HLE_ELISION_BUFFER_FULL",
398 "SampleAfterValue": "2000003",
399 "BriefDescription": "Number of times HLE lock could not be elided due to ElisionBufferAvailable being zero.",
400 "CounterHTOff": "0,1,2,3,4,5,6,7"
401 },
402 {
403 "PublicDescription": "Demand Data Read requests who miss L3 cache.",
404 "EventCode": "0xB0",
405 "Counter": "0,1,2,3",
406 "UMask": "0x10",
407 "EventName": "OFFCORE_REQUESTS.L3_MISS_DEMAND_DATA_RD",
408 "SampleAfterValue": "100003",
409 "BriefDescription": "Demand Data Read requests who miss L3 cache",
410 "CounterHTOff": "0,1,2,3,4,5,6,7"
411 },
412 {
413 "EventCode": "0x60",
414 "Counter": "0,1,2,3",
415 "UMask": "0x10",
416 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.L3_MISS_DEMAND_DATA_RD",
417 "SampleAfterValue": "2000003",
418 "BriefDescription": "Counts number of Offcore outstanding Demand Data Read requests that miss L3 cache in the superQ every cycle.",
419 "CounterHTOff": "0,1,2,3,4,5,6,7"
420 },
421 {
422 "EventCode": "0xA3",
423 "Counter": "0,1,2,3",
424 "UMask": "0x2",
425 "EventName": "CYCLE_ACTIVITY.CYCLES_L3_MISS",
426 "SampleAfterValue": "2000003",
427 "BriefDescription": "Cycles while L3 cache miss demand load is outstanding.",
428 "CounterMask": "2",
429 "CounterHTOff": "0,1,2,3,4,5,6,7"
430 },
431 {
432 "EventCode": "0xA3",
433 "Counter": "0,1,2,3",
434 "UMask": "0x6",
435 "EventName": "CYCLE_ACTIVITY.STALLS_L3_MISS",
436 "SampleAfterValue": "2000003",
437 "BriefDescription": "Execution stalls while L3 cache miss demand load is outstanding.",
438 "CounterMask": "6",
439 "CounterHTOff": "0,1,2,3,4,5,6,7"
440 },
441 {
442 "EventCode": "0x60",
443 "Counter": "0,1,2,3",
444 "UMask": "0x10",
445 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_L3_MISS_DEMAND_DATA_RD",
446 "SampleAfterValue": "2000003",
447 "BriefDescription": "Cycles with at least 1 Demand Data Read requests who miss L3 cache in the superQ.",
448 "CounterMask": "1",
449 "CounterHTOff": "0,1,2,3,4,5,6,7"
450 },
451 {
452 "EventCode": "0x60",
453 "Counter": "0,1,2,3",
454 "UMask": "0x10",
455 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.L3_MISS_DEMAND_DATA_RD_GE_6",
456 "SampleAfterValue": "2000003",
457 "BriefDescription": "Cycles with at least 6 Demand Data Read requests that miss L3 cache in the superQ.",
458 "CounterMask": "6",
459 "CounterHTOff": "0,1,2,3,4,5,6,7"
460 },
461 {
462 "EventCode": "0xB7, 0xBB",
463 "MSRValue": "0x3ffc008000 ",
464 "Counter": "0,1,2,3",
465 "UMask": "0x1",
466 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.ANY_SNOOP",
467 "MSRIndex": "0x1a6,0x1a7",
468 "SampleAfterValue": "100003",
469 "BriefDescription": "OTHER & L3_MISS & ANY_SNOOP",
470 "Offcore": "1",
471 "CounterHTOff": "0,1,2,3"
472 },
473 {
474 "EventCode": "0xB7, 0xBB",
475 "MSRValue": "0x203c008000 ",
476 "Counter": "0,1,2,3",
477 "UMask": "0x1",
478 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_NON_DRAM",
479 "MSRIndex": "0x1a6,0x1a7",
480 "SampleAfterValue": "100003",
481 "BriefDescription": "OTHER & L3_MISS & SNOOP_NON_DRAM",
482 "Offcore": "1",
483 "CounterHTOff": "0,1,2,3"
484 },
485 {
486 "EventCode": "0xB7, 0xBB",
487 "MSRValue": "0x103c008000 ",
488 "Counter": "0,1,2,3",
489 "UMask": "0x1",
490 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_HITM",
491 "MSRIndex": "0x1a6,0x1a7",
492 "SampleAfterValue": "100003",
493 "BriefDescription": "OTHER & L3_MISS & SNOOP_HITM",
494 "Offcore": "1",
495 "CounterHTOff": "0,1,2,3"
496 },
497 {
498 "EventCode": "0xB7, 0xBB",
499 "MSRValue": "0x043c008000 ",
500 "Counter": "0,1,2,3",
501 "UMask": "0x1",
502 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_HIT_NO_FWD",
503 "MSRIndex": "0x1a6,0x1a7",
504 "SampleAfterValue": "100003",
505 "BriefDescription": "OTHER & L3_MISS & SNOOP_HIT_NO_FWD",
506 "Offcore": "1",
507 "CounterHTOff": "0,1,2,3"
508 },
509 {
510 "EventCode": "0xB7, 0xBB",
511 "MSRValue": "0x023c008000 ",
512 "Counter": "0,1,2,3",
513 "UMask": "0x1",
514 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_MISS",
515 "MSRIndex": "0x1a6,0x1a7",
516 "SampleAfterValue": "100003",
517 "BriefDescription": "OTHER & L3_MISS & SNOOP_MISS",
518 "Offcore": "1",
519 "CounterHTOff": "0,1,2,3"
520 },
521 {
522 "EventCode": "0xB7, 0xBB",
523 "MSRValue": "0x013c008000 ",
524 "Counter": "0,1,2,3",
525 "UMask": "0x1",
526 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_NOT_NEEDED",
527 "MSRIndex": "0x1a6,0x1a7",
528 "SampleAfterValue": "100003",
529 "BriefDescription": "OTHER & L3_MISS & SNOOP_NOT_NEEDED",
530 "Offcore": "1",
531 "CounterHTOff": "0,1,2,3"
532 },
533 {
534 "EventCode": "0xB7, 0xBB",
535 "MSRValue": "0x00bc008000 ",
536 "Counter": "0,1,2,3",
537 "UMask": "0x1",
538 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_NONE",
539 "MSRIndex": "0x1a6,0x1a7",
540 "SampleAfterValue": "100003",
541 "BriefDescription": "OTHER & L3_MISS & SNOOP_NONE",
542 "Offcore": "1",
543 "CounterHTOff": "0,1,2,3"
544 },
545 {
546 "EventCode": "0xB7, 0xBB",
547 "MSRValue": "0x007c008000 ",
548 "Counter": "0,1,2,3",
549 "UMask": "0x1",
550 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SPL_HIT",
551 "MSRIndex": "0x1a6,0x1a7",
552 "SampleAfterValue": "100003",
553 "BriefDescription": "OTHER & L3_MISS & SPL_HIT",
554 "Offcore": "1",
555 "CounterHTOff": "0,1,2,3"
556 },
557 {
558 "EventCode": "0xB7, 0xBB",
559 "MSRValue": "0x3fc4008000 ",
560 "Counter": "0,1,2,3",
561 "UMask": "0x1",
562 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.ANY_SNOOP",
563 "MSRIndex": "0x1a6,0x1a7",
564 "SampleAfterValue": "100003",
565 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & ANY_SNOOP",
566 "Offcore": "1",
567 "CounterHTOff": "0,1,2,3"
568 },
569 {
570 "EventCode": "0xB7, 0xBB",
571 "MSRValue": "0x2004008000 ",
572 "Counter": "0,1,2,3",
573 "UMask": "0x1",
574 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
575 "MSRIndex": "0x1a6,0x1a7",
576 "SampleAfterValue": "100003",
577 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
578 "Offcore": "1",
579 "CounterHTOff": "0,1,2,3"
580 },
581 {
582 "EventCode": "0xB7, 0xBB",
583 "MSRValue": "0x1004008000 ",
584 "Counter": "0,1,2,3",
585 "UMask": "0x1",
586 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_HITM",
587 "MSRIndex": "0x1a6,0x1a7",
588 "SampleAfterValue": "100003",
589 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SNOOP_HITM",
590 "Offcore": "1",
591 "CounterHTOff": "0,1,2,3"
592 },
593 {
594 "EventCode": "0xB7, 0xBB",
595 "MSRValue": "0x0404008000 ",
596 "Counter": "0,1,2,3",
597 "UMask": "0x1",
598 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_HIT_NO_FWD",
599 "MSRIndex": "0x1a6,0x1a7",
600 "SampleAfterValue": "100003",
601 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SNOOP_HIT_NO_FWD",
602 "Offcore": "1",
603 "CounterHTOff": "0,1,2,3"
604 },
605 {
606 "EventCode": "0xB7, 0xBB",
607 "MSRValue": "0x0204008000 ",
608 "Counter": "0,1,2,3",
609 "UMask": "0x1",
610 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_MISS",
611 "MSRIndex": "0x1a6,0x1a7",
612 "SampleAfterValue": "100003",
613 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SNOOP_MISS",
614 "Offcore": "1",
615 "CounterHTOff": "0,1,2,3"
616 },
617 {
618 "EventCode": "0xB7, 0xBB",
619 "MSRValue": "0x0104008000 ",
620 "Counter": "0,1,2,3",
621 "UMask": "0x1",
622 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_NOT_NEEDED",
623 "MSRIndex": "0x1a6,0x1a7",
624 "SampleAfterValue": "100003",
625 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SNOOP_NOT_NEEDED",
626 "Offcore": "1",
627 "CounterHTOff": "0,1,2,3"
628 },
629 {
630 "EventCode": "0xB7, 0xBB",
631 "MSRValue": "0x0084008000 ",
632 "Counter": "0,1,2,3",
633 "UMask": "0x1",
634 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_NONE",
635 "MSRIndex": "0x1a6,0x1a7",
636 "SampleAfterValue": "100003",
637 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
638 "Offcore": "1",
639 "CounterHTOff": "0,1,2,3"
640 },
641 {
642 "EventCode": "0xB7, 0xBB",
643 "MSRValue": "0x0044008000 ",
644 "Counter": "0,1,2,3",
645 "UMask": "0x1",
646 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SPL_HIT",
647 "MSRIndex": "0x1a6,0x1a7",
648 "SampleAfterValue": "100003",
649 "BriefDescription": "OTHER & L3_MISS_LOCAL_DRAM & SPL_HIT",
650 "Offcore": "1",
651 "CounterHTOff": "0,1,2,3"
652 },
653 {
654 "EventCode": "0xB7, 0xBB",
655 "MSRValue": "0x2000408000 ",
656 "Counter": "0,1,2,3",
657 "UMask": "0x1",
658 "EventName": "OFFCORE_RESPONSE.OTHER.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
659 "MSRIndex": "0x1a6,0x1a7",
660 "SampleAfterValue": "100003",
661 "BriefDescription": "OTHER & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
662 "Offcore": "1",
663 "CounterHTOff": "0,1,2,3"
664 },
665 {
666 "EventCode": "0xB7, 0xBB",
667 "MSRValue": "0x20001c8000 ",
668 "Counter": "0,1,2,3",
669 "UMask": "0x1",
670 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_NON_DRAM",
671 "MSRIndex": "0x1a6,0x1a7",
672 "SampleAfterValue": "100003",
673 "BriefDescription": "OTHER & L3_HIT & SNOOP_NON_DRAM",
674 "Offcore": "1",
675 "CounterHTOff": "0,1,2,3"
676 },
677 {
678 "EventCode": "0xB7, 0xBB",
679 "MSRValue": "0x2000108000 ",
680 "Counter": "0,1,2,3",
681 "UMask": "0x1",
682 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_S.SNOOP_NON_DRAM",
683 "MSRIndex": "0x1a6,0x1a7",
684 "SampleAfterValue": "100003",
685 "BriefDescription": "OTHER & L3_HIT_S & SNOOP_NON_DRAM",
686 "Offcore": "1",
687 "CounterHTOff": "0,1,2,3"
688 },
689 {
690 "EventCode": "0xB7, 0xBB",
691 "MSRValue": "0x2000088000 ",
692 "Counter": "0,1,2,3",
693 "UMask": "0x1",
694 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_E.SNOOP_NON_DRAM",
695 "MSRIndex": "0x1a6,0x1a7",
696 "SampleAfterValue": "100003",
697 "BriefDescription": "OTHER & L3_HIT_E & SNOOP_NON_DRAM",
698 "Offcore": "1",
699 "CounterHTOff": "0,1,2,3"
700 },
701 {
702 "EventCode": "0xB7, 0xBB",
703 "MSRValue": "0x2000048000 ",
704 "Counter": "0,1,2,3",
705 "UMask": "0x1",
706 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT_M.SNOOP_NON_DRAM",
707 "MSRIndex": "0x1a6,0x1a7",
708 "SampleAfterValue": "100003",
709 "BriefDescription": "OTHER & L3_HIT_M & SNOOP_NON_DRAM",
710 "Offcore": "1",
711 "CounterHTOff": "0,1,2,3"
712 },
713 {
714 "EventCode": "0xB7, 0xBB",
715 "MSRValue": "0x2000028000 ",
716 "Counter": "0,1,2,3",
717 "UMask": "0x1",
718 "EventName": "OFFCORE_RESPONSE.OTHER.SUPPLIER_NONE.SNOOP_NON_DRAM",
719 "MSRIndex": "0x1a6,0x1a7",
720 "SampleAfterValue": "100003",
721 "BriefDescription": "OTHER & SUPPLIER_NONE & SNOOP_NON_DRAM",
722 "Offcore": "1",
723 "CounterHTOff": "0,1,2,3"
724 },
725 {
726 "EventCode": "0xB7, 0xBB",
727 "MSRValue": "0x3ffc000800 ",
728 "Counter": "0,1,2,3",
729 "UMask": "0x1",
730 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.ANY_SNOOP",
731 "MSRIndex": "0x1a6,0x1a7",
732 "SampleAfterValue": "100003",
733 "BriefDescription": "STREAMING_STORES & L3_MISS & ANY_SNOOP",
734 "Offcore": "1",
735 "CounterHTOff": "0,1,2,3"
736 },
737 {
738 "EventCode": "0xB7, 0xBB",
739 "MSRValue": "0x203c000800 ",
740 "Counter": "0,1,2,3",
741 "UMask": "0x1",
742 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SNOOP_NON_DRAM",
743 "MSRIndex": "0x1a6,0x1a7",
744 "SampleAfterValue": "100003",
745 "BriefDescription": "STREAMING_STORES & L3_MISS & SNOOP_NON_DRAM",
746 "Offcore": "1",
747 "CounterHTOff": "0,1,2,3"
748 },
749 {
750 "EventCode": "0xB7, 0xBB",
751 "MSRValue": "0x103c000800 ",
752 "Counter": "0,1,2,3",
753 "UMask": "0x1",
754 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SNOOP_HITM",
755 "MSRIndex": "0x1a6,0x1a7",
756 "SampleAfterValue": "100003",
757 "BriefDescription": "STREAMING_STORES & L3_MISS & SNOOP_HITM",
758 "Offcore": "1",
759 "CounterHTOff": "0,1,2,3"
760 },
761 {
762 "EventCode": "0xB7, 0xBB",
763 "MSRValue": "0x043c000800 ",
764 "Counter": "0,1,2,3",
765 "UMask": "0x1",
766 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SNOOP_HIT_NO_FWD",
767 "MSRIndex": "0x1a6,0x1a7",
768 "SampleAfterValue": "100003",
769 "BriefDescription": "STREAMING_STORES & L3_MISS & SNOOP_HIT_NO_FWD",
770 "Offcore": "1",
771 "CounterHTOff": "0,1,2,3"
772 },
773 {
774 "EventCode": "0xB7, 0xBB",
775 "MSRValue": "0x023c000800 ",
776 "Counter": "0,1,2,3",
777 "UMask": "0x1",
778 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SNOOP_MISS",
779 "MSRIndex": "0x1a6,0x1a7",
780 "SampleAfterValue": "100003",
781 "BriefDescription": "STREAMING_STORES & L3_MISS & SNOOP_MISS",
782 "Offcore": "1",
783 "CounterHTOff": "0,1,2,3"
784 },
785 {
786 "EventCode": "0xB7, 0xBB",
787 "MSRValue": "0x013c000800 ",
788 "Counter": "0,1,2,3",
789 "UMask": "0x1",
790 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SNOOP_NOT_NEEDED",
791 "MSRIndex": "0x1a6,0x1a7",
792 "SampleAfterValue": "100003",
793 "BriefDescription": "STREAMING_STORES & L3_MISS & SNOOP_NOT_NEEDED",
794 "Offcore": "1",
795 "CounterHTOff": "0,1,2,3"
796 },
797 {
798 "EventCode": "0xB7, 0xBB",
799 "MSRValue": "0x00bc000800 ",
800 "Counter": "0,1,2,3",
801 "UMask": "0x1",
802 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SNOOP_NONE",
803 "MSRIndex": "0x1a6,0x1a7",
804 "SampleAfterValue": "100003",
805 "BriefDescription": "STREAMING_STORES & L3_MISS & SNOOP_NONE",
806 "Offcore": "1",
807 "CounterHTOff": "0,1,2,3"
808 },
809 {
810 "EventCode": "0xB7, 0xBB",
811 "MSRValue": "0x007c000800 ",
812 "Counter": "0,1,2,3",
813 "UMask": "0x1",
814 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS.SPL_HIT",
815 "MSRIndex": "0x1a6,0x1a7",
816 "SampleAfterValue": "100003",
817 "BriefDescription": "STREAMING_STORES & L3_MISS & SPL_HIT",
818 "Offcore": "1",
819 "CounterHTOff": "0,1,2,3"
820 },
821 {
822 "EventCode": "0xB7, 0xBB",
823 "MSRValue": "0x3fc4000800 ",
824 "Counter": "0,1,2,3",
825 "UMask": "0x1",
826 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.ANY_SNOOP",
827 "MSRIndex": "0x1a6,0x1a7",
828 "SampleAfterValue": "100003",
829 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & ANY_SNOOP",
830 "Offcore": "1",
831 "CounterHTOff": "0,1,2,3"
832 },
833 {
834 "EventCode": "0xB7, 0xBB",
835 "MSRValue": "0x2004000800 ",
836 "Counter": "0,1,2,3",
837 "UMask": "0x1",
838 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
839 "MSRIndex": "0x1a6,0x1a7",
840 "SampleAfterValue": "100003",
841 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
842 "Offcore": "1",
843 "CounterHTOff": "0,1,2,3"
844 },
845 {
846 "EventCode": "0xB7, 0xBB",
847 "MSRValue": "0x1004000800 ",
848 "Counter": "0,1,2,3",
849 "UMask": "0x1",
850 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SNOOP_HITM",
851 "MSRIndex": "0x1a6,0x1a7",
852 "SampleAfterValue": "100003",
853 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SNOOP_HITM",
854 "Offcore": "1",
855 "CounterHTOff": "0,1,2,3"
856 },
857 {
858 "EventCode": "0xB7, 0xBB",
859 "MSRValue": "0x0404000800 ",
860 "Counter": "0,1,2,3",
861 "UMask": "0x1",
862 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SNOOP_HIT_NO_FWD",
863 "MSRIndex": "0x1a6,0x1a7",
864 "SampleAfterValue": "100003",
865 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SNOOP_HIT_NO_FWD",
866 "Offcore": "1",
867 "CounterHTOff": "0,1,2,3"
868 },
869 {
870 "EventCode": "0xB7, 0xBB",
871 "MSRValue": "0x0204000800 ",
872 "Counter": "0,1,2,3",
873 "UMask": "0x1",
874 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SNOOP_MISS",
875 "MSRIndex": "0x1a6,0x1a7",
876 "SampleAfterValue": "100003",
877 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SNOOP_MISS",
878 "Offcore": "1",
879 "CounterHTOff": "0,1,2,3"
880 },
881 {
882 "EventCode": "0xB7, 0xBB",
883 "MSRValue": "0x0104000800 ",
884 "Counter": "0,1,2,3",
885 "UMask": "0x1",
886 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SNOOP_NOT_NEEDED",
887 "MSRIndex": "0x1a6,0x1a7",
888 "SampleAfterValue": "100003",
889 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SNOOP_NOT_NEEDED",
890 "Offcore": "1",
891 "CounterHTOff": "0,1,2,3"
892 },
893 {
894 "EventCode": "0xB7, 0xBB",
895 "MSRValue": "0x0084000800 ",
896 "Counter": "0,1,2,3",
897 "UMask": "0x1",
898 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SNOOP_NONE",
899 "MSRIndex": "0x1a6,0x1a7",
900 "SampleAfterValue": "100003",
901 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
902 "Offcore": "1",
903 "CounterHTOff": "0,1,2,3"
904 },
905 {
906 "EventCode": "0xB7, 0xBB",
907 "MSRValue": "0x0044000800 ",
908 "Counter": "0,1,2,3",
909 "UMask": "0x1",
910 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_MISS_LOCAL_DRAM.SPL_HIT",
911 "MSRIndex": "0x1a6,0x1a7",
912 "SampleAfterValue": "100003",
913 "BriefDescription": "STREAMING_STORES & L3_MISS_LOCAL_DRAM & SPL_HIT",
914 "Offcore": "1",
915 "CounterHTOff": "0,1,2,3"
916 },
917 {
918 "EventCode": "0xB7, 0xBB",
919 "MSRValue": "0x2000400800 ",
920 "Counter": "0,1,2,3",
921 "UMask": "0x1",
922 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
923 "MSRIndex": "0x1a6,0x1a7",
924 "SampleAfterValue": "100003",
925 "BriefDescription": "STREAMING_STORES & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
926 "Offcore": "1",
927 "CounterHTOff": "0,1,2,3"
928 },
929 {
930 "EventCode": "0xB7, 0xBB",
931 "MSRValue": "0x20001c0800 ",
932 "Counter": "0,1,2,3",
933 "UMask": "0x1",
934 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT.SNOOP_NON_DRAM",
935 "MSRIndex": "0x1a6,0x1a7",
936 "SampleAfterValue": "100003",
937 "BriefDescription": "STREAMING_STORES & L3_HIT & SNOOP_NON_DRAM",
938 "Offcore": "1",
939 "CounterHTOff": "0,1,2,3"
940 },
941 {
942 "EventCode": "0xB7, 0xBB",
943 "MSRValue": "0x2000100800 ",
944 "Counter": "0,1,2,3",
945 "UMask": "0x1",
946 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_S.SNOOP_NON_DRAM",
947 "MSRIndex": "0x1a6,0x1a7",
948 "SampleAfterValue": "100003",
949 "BriefDescription": "STREAMING_STORES & L3_HIT_S & SNOOP_NON_DRAM",
950 "Offcore": "1",
951 "CounterHTOff": "0,1,2,3"
952 },
953 {
954 "EventCode": "0xB7, 0xBB",
955 "MSRValue": "0x2000080800 ",
956 "Counter": "0,1,2,3",
957 "UMask": "0x1",
958 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_E.SNOOP_NON_DRAM",
959 "MSRIndex": "0x1a6,0x1a7",
960 "SampleAfterValue": "100003",
961 "BriefDescription": "STREAMING_STORES & L3_HIT_E & SNOOP_NON_DRAM",
962 "Offcore": "1",
963 "CounterHTOff": "0,1,2,3"
964 },
965 {
966 "EventCode": "0xB7, 0xBB",
967 "MSRValue": "0x2000040800 ",
968 "Counter": "0,1,2,3",
969 "UMask": "0x1",
970 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.L3_HIT_M.SNOOP_NON_DRAM",
971 "MSRIndex": "0x1a6,0x1a7",
972 "SampleAfterValue": "100003",
973 "BriefDescription": "STREAMING_STORES & L3_HIT_M & SNOOP_NON_DRAM",
974 "Offcore": "1",
975 "CounterHTOff": "0,1,2,3"
976 },
977 {
978 "EventCode": "0xB7, 0xBB",
979 "MSRValue": "0x2000020800 ",
980 "Counter": "0,1,2,3",
981 "UMask": "0x1",
982 "EventName": "OFFCORE_RESPONSE.STREAMING_STORES.SUPPLIER_NONE.SNOOP_NON_DRAM",
983 "MSRIndex": "0x1a6,0x1a7",
984 "SampleAfterValue": "100003",
985 "BriefDescription": "STREAMING_STORES & SUPPLIER_NONE & SNOOP_NON_DRAM",
986 "Offcore": "1",
987 "CounterHTOff": "0,1,2,3"
988 },
989 {
990 "EventCode": "0xB7, 0xBB",
991 "MSRValue": "0x3ffc000100 ",
992 "Counter": "0,1,2,3",
993 "UMask": "0x1",
994 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.ANY_SNOOP",
995 "MSRIndex": "0x1a6,0x1a7",
996 "SampleAfterValue": "100003",
997 "BriefDescription": "PF_L3_RFO & L3_MISS & ANY_SNOOP",
998 "Offcore": "1",
999 "CounterHTOff": "0,1,2,3"
1000 },
1001 {
1002 "EventCode": "0xB7, 0xBB",
1003 "MSRValue": "0x203c000100 ",
1004 "Counter": "0,1,2,3",
1005 "UMask": "0x1",
1006 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_NON_DRAM",
1007 "MSRIndex": "0x1a6,0x1a7",
1008 "SampleAfterValue": "100003",
1009 "BriefDescription": "PF_L3_RFO & L3_MISS & SNOOP_NON_DRAM",
1010 "Offcore": "1",
1011 "CounterHTOff": "0,1,2,3"
1012 },
1013 {
1014 "EventCode": "0xB7, 0xBB",
1015 "MSRValue": "0x103c000100 ",
1016 "Counter": "0,1,2,3",
1017 "UMask": "0x1",
1018 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_HITM",
1019 "MSRIndex": "0x1a6,0x1a7",
1020 "SampleAfterValue": "100003",
1021 "BriefDescription": "PF_L3_RFO & L3_MISS & SNOOP_HITM",
1022 "Offcore": "1",
1023 "CounterHTOff": "0,1,2,3"
1024 },
1025 {
1026 "EventCode": "0xB7, 0xBB",
1027 "MSRValue": "0x043c000100 ",
1028 "Counter": "0,1,2,3",
1029 "UMask": "0x1",
1030 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_HIT_NO_FWD",
1031 "MSRIndex": "0x1a6,0x1a7",
1032 "SampleAfterValue": "100003",
1033 "BriefDescription": "PF_L3_RFO & L3_MISS & SNOOP_HIT_NO_FWD",
1034 "Offcore": "1",
1035 "CounterHTOff": "0,1,2,3"
1036 },
1037 {
1038 "EventCode": "0xB7, 0xBB",
1039 "MSRValue": "0x023c000100 ",
1040 "Counter": "0,1,2,3",
1041 "UMask": "0x1",
1042 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_MISS",
1043 "MSRIndex": "0x1a6,0x1a7",
1044 "SampleAfterValue": "100003",
1045 "BriefDescription": "PF_L3_RFO & L3_MISS & SNOOP_MISS",
1046 "Offcore": "1",
1047 "CounterHTOff": "0,1,2,3"
1048 },
1049 {
1050 "EventCode": "0xB7, 0xBB",
1051 "MSRValue": "0x013c000100 ",
1052 "Counter": "0,1,2,3",
1053 "UMask": "0x1",
1054 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_NOT_NEEDED",
1055 "MSRIndex": "0x1a6,0x1a7",
1056 "SampleAfterValue": "100003",
1057 "BriefDescription": "PF_L3_RFO & L3_MISS & SNOOP_NOT_NEEDED",
1058 "Offcore": "1",
1059 "CounterHTOff": "0,1,2,3"
1060 },
1061 {
1062 "EventCode": "0xB7, 0xBB",
1063 "MSRValue": "0x00bc000100 ",
1064 "Counter": "0,1,2,3",
1065 "UMask": "0x1",
1066 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_NONE",
1067 "MSRIndex": "0x1a6,0x1a7",
1068 "SampleAfterValue": "100003",
1069 "BriefDescription": "PF_L3_RFO & L3_MISS & SNOOP_NONE",
1070 "Offcore": "1",
1071 "CounterHTOff": "0,1,2,3"
1072 },
1073 {
1074 "EventCode": "0xB7, 0xBB",
1075 "MSRValue": "0x007c000100 ",
1076 "Counter": "0,1,2,3",
1077 "UMask": "0x1",
1078 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SPL_HIT",
1079 "MSRIndex": "0x1a6,0x1a7",
1080 "SampleAfterValue": "100003",
1081 "BriefDescription": "PF_L3_RFO & L3_MISS & SPL_HIT",
1082 "Offcore": "1",
1083 "CounterHTOff": "0,1,2,3"
1084 },
1085 {
1086 "EventCode": "0xB7, 0xBB",
1087 "MSRValue": "0x3fc4000100 ",
1088 "Counter": "0,1,2,3",
1089 "UMask": "0x1",
1090 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.ANY_SNOOP",
1091 "MSRIndex": "0x1a6,0x1a7",
1092 "SampleAfterValue": "100003",
1093 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & ANY_SNOOP",
1094 "Offcore": "1",
1095 "CounterHTOff": "0,1,2,3"
1096 },
1097 {
1098 "EventCode": "0xB7, 0xBB",
1099 "MSRValue": "0x2004000100 ",
1100 "Counter": "0,1,2,3",
1101 "UMask": "0x1",
1102 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
1103 "MSRIndex": "0x1a6,0x1a7",
1104 "SampleAfterValue": "100003",
1105 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
1106 "Offcore": "1",
1107 "CounterHTOff": "0,1,2,3"
1108 },
1109 {
1110 "EventCode": "0xB7, 0xBB",
1111 "MSRValue": "0x1004000100 ",
1112 "Counter": "0,1,2,3",
1113 "UMask": "0x1",
1114 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_HITM",
1115 "MSRIndex": "0x1a6,0x1a7",
1116 "SampleAfterValue": "100003",
1117 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SNOOP_HITM",
1118 "Offcore": "1",
1119 "CounterHTOff": "0,1,2,3"
1120 },
1121 {
1122 "EventCode": "0xB7, 0xBB",
1123 "MSRValue": "0x0404000100 ",
1124 "Counter": "0,1,2,3",
1125 "UMask": "0x1",
1126 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_HIT_NO_FWD",
1127 "MSRIndex": "0x1a6,0x1a7",
1128 "SampleAfterValue": "100003",
1129 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SNOOP_HIT_NO_FWD",
1130 "Offcore": "1",
1131 "CounterHTOff": "0,1,2,3"
1132 },
1133 {
1134 "EventCode": "0xB7, 0xBB",
1135 "MSRValue": "0x0204000100 ",
1136 "Counter": "0,1,2,3",
1137 "UMask": "0x1",
1138 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS",
1139 "MSRIndex": "0x1a6,0x1a7",
1140 "SampleAfterValue": "100003",
1141 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SNOOP_MISS",
1142 "Offcore": "1",
1143 "CounterHTOff": "0,1,2,3"
1144 },
1145 {
1146 "EventCode": "0xB7, 0xBB",
1147 "MSRValue": "0x0104000100 ",
1148 "Counter": "0,1,2,3",
1149 "UMask": "0x1",
1150 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_NOT_NEEDED",
1151 "MSRIndex": "0x1a6,0x1a7",
1152 "SampleAfterValue": "100003",
1153 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SNOOP_NOT_NEEDED",
1154 "Offcore": "1",
1155 "CounterHTOff": "0,1,2,3"
1156 },
1157 {
1158 "EventCode": "0xB7, 0xBB",
1159 "MSRValue": "0x0084000100 ",
1160 "Counter": "0,1,2,3",
1161 "UMask": "0x1",
1162 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_NONE",
1163 "MSRIndex": "0x1a6,0x1a7",
1164 "SampleAfterValue": "100003",
1165 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
1166 "Offcore": "1",
1167 "CounterHTOff": "0,1,2,3"
1168 },
1169 {
1170 "EventCode": "0xB7, 0xBB",
1171 "MSRValue": "0x0044000100 ",
1172 "Counter": "0,1,2,3",
1173 "UMask": "0x1",
1174 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SPL_HIT",
1175 "MSRIndex": "0x1a6,0x1a7",
1176 "SampleAfterValue": "100003",
1177 "BriefDescription": "PF_L3_RFO & L3_MISS_LOCAL_DRAM & SPL_HIT",
1178 "Offcore": "1",
1179 "CounterHTOff": "0,1,2,3"
1180 },
1181 {
1182 "EventCode": "0xB7, 0xBB",
1183 "MSRValue": "0x2000400100 ",
1184 "Counter": "0,1,2,3",
1185 "UMask": "0x1",
1186 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
1187 "MSRIndex": "0x1a6,0x1a7",
1188 "SampleAfterValue": "100003",
1189 "BriefDescription": "PF_L3_RFO & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
1190 "Offcore": "1",
1191 "CounterHTOff": "0,1,2,3"
1192 },
1193 {
1194 "EventCode": "0xB7, 0xBB",
1195 "MSRValue": "0x20001c0100 ",
1196 "Counter": "0,1,2,3",
1197 "UMask": "0x1",
1198 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_NON_DRAM",
1199 "MSRIndex": "0x1a6,0x1a7",
1200 "SampleAfterValue": "100003",
1201 "BriefDescription": "PF_L3_RFO & L3_HIT & SNOOP_NON_DRAM",
1202 "Offcore": "1",
1203 "CounterHTOff": "0,1,2,3"
1204 },
1205 {
1206 "EventCode": "0xB7, 0xBB",
1207 "MSRValue": "0x2000100100 ",
1208 "Counter": "0,1,2,3",
1209 "UMask": "0x1",
1210 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_S.SNOOP_NON_DRAM",
1211 "MSRIndex": "0x1a6,0x1a7",
1212 "SampleAfterValue": "100003",
1213 "BriefDescription": "PF_L3_RFO & L3_HIT_S & SNOOP_NON_DRAM",
1214 "Offcore": "1",
1215 "CounterHTOff": "0,1,2,3"
1216 },
1217 {
1218 "EventCode": "0xB7, 0xBB",
1219 "MSRValue": "0x2000080100 ",
1220 "Counter": "0,1,2,3",
1221 "UMask": "0x1",
1222 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_E.SNOOP_NON_DRAM",
1223 "MSRIndex": "0x1a6,0x1a7",
1224 "SampleAfterValue": "100003",
1225 "BriefDescription": "PF_L3_RFO & L3_HIT_E & SNOOP_NON_DRAM",
1226 "Offcore": "1",
1227 "CounterHTOff": "0,1,2,3"
1228 },
1229 {
1230 "EventCode": "0xB7, 0xBB",
1231 "MSRValue": "0x2000040100 ",
1232 "Counter": "0,1,2,3",
1233 "UMask": "0x1",
1234 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT_M.SNOOP_NON_DRAM",
1235 "MSRIndex": "0x1a6,0x1a7",
1236 "SampleAfterValue": "100003",
1237 "BriefDescription": "PF_L3_RFO & L3_HIT_M & SNOOP_NON_DRAM",
1238 "Offcore": "1",
1239 "CounterHTOff": "0,1,2,3"
1240 },
1241 {
1242 "EventCode": "0xB7, 0xBB",
1243 "MSRValue": "0x2000020100 ",
1244 "Counter": "0,1,2,3",
1245 "UMask": "0x1",
1246 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.SUPPLIER_NONE.SNOOP_NON_DRAM",
1247 "MSRIndex": "0x1a6,0x1a7",
1248 "SampleAfterValue": "100003",
1249 "BriefDescription": "PF_L3_RFO & SUPPLIER_NONE & SNOOP_NON_DRAM",
1250 "Offcore": "1",
1251 "CounterHTOff": "0,1,2,3"
1252 },
1253 {
1254 "EventCode": "0xB7, 0xBB",
1255 "MSRValue": "0x3ffc000080 ",
1256 "Counter": "0,1,2,3",
1257 "UMask": "0x1",
1258 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.ANY_SNOOP",
1259 "MSRIndex": "0x1a6,0x1a7",
1260 "SampleAfterValue": "100003",
1261 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & ANY_SNOOP",
1262 "Offcore": "1",
1263 "CounterHTOff": "0,1,2,3"
1264 },
1265 {
1266 "EventCode": "0xB7, 0xBB",
1267 "MSRValue": "0x203c000080 ",
1268 "Counter": "0,1,2,3",
1269 "UMask": "0x1",
1270 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_NON_DRAM",
1271 "MSRIndex": "0x1a6,0x1a7",
1272 "SampleAfterValue": "100003",
1273 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SNOOP_NON_DRAM",
1274 "Offcore": "1",
1275 "CounterHTOff": "0,1,2,3"
1276 },
1277 {
1278 "EventCode": "0xB7, 0xBB",
1279 "MSRValue": "0x103c000080 ",
1280 "Counter": "0,1,2,3",
1281 "UMask": "0x1",
1282 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_HITM",
1283 "MSRIndex": "0x1a6,0x1a7",
1284 "SampleAfterValue": "100003",
1285 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SNOOP_HITM",
1286 "Offcore": "1",
1287 "CounterHTOff": "0,1,2,3"
1288 },
1289 {
1290 "EventCode": "0xB7, 0xBB",
1291 "MSRValue": "0x043c000080 ",
1292 "Counter": "0,1,2,3",
1293 "UMask": "0x1",
1294 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_HIT_NO_FWD",
1295 "MSRIndex": "0x1a6,0x1a7",
1296 "SampleAfterValue": "100003",
1297 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SNOOP_HIT_NO_FWD",
1298 "Offcore": "1",
1299 "CounterHTOff": "0,1,2,3"
1300 },
1301 {
1302 "EventCode": "0xB7, 0xBB",
1303 "MSRValue": "0x023c000080 ",
1304 "Counter": "0,1,2,3",
1305 "UMask": "0x1",
1306 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_MISS",
1307 "MSRIndex": "0x1a6,0x1a7",
1308 "SampleAfterValue": "100003",
1309 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SNOOP_MISS",
1310 "Offcore": "1",
1311 "CounterHTOff": "0,1,2,3"
1312 },
1313 {
1314 "EventCode": "0xB7, 0xBB",
1315 "MSRValue": "0x013c000080 ",
1316 "Counter": "0,1,2,3",
1317 "UMask": "0x1",
1318 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_NOT_NEEDED",
1319 "MSRIndex": "0x1a6,0x1a7",
1320 "SampleAfterValue": "100003",
1321 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SNOOP_NOT_NEEDED",
1322 "Offcore": "1",
1323 "CounterHTOff": "0,1,2,3"
1324 },
1325 {
1326 "EventCode": "0xB7, 0xBB",
1327 "MSRValue": "0x00bc000080 ",
1328 "Counter": "0,1,2,3",
1329 "UMask": "0x1",
1330 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_NONE",
1331 "MSRIndex": "0x1a6,0x1a7",
1332 "SampleAfterValue": "100003",
1333 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SNOOP_NONE",
1334 "Offcore": "1",
1335 "CounterHTOff": "0,1,2,3"
1336 },
1337 {
1338 "EventCode": "0xB7, 0xBB",
1339 "MSRValue": "0x007c000080 ",
1340 "Counter": "0,1,2,3",
1341 "UMask": "0x1",
1342 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SPL_HIT",
1343 "MSRIndex": "0x1a6,0x1a7",
1344 "SampleAfterValue": "100003",
1345 "BriefDescription": "PF_L3_DATA_RD & L3_MISS & SPL_HIT",
1346 "Offcore": "1",
1347 "CounterHTOff": "0,1,2,3"
1348 },
1349 {
1350 "EventCode": "0xB7, 0xBB",
1351 "MSRValue": "0x3fc4000080 ",
1352 "Counter": "0,1,2,3",
1353 "UMask": "0x1",
1354 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.ANY_SNOOP",
1355 "MSRIndex": "0x1a6,0x1a7",
1356 "SampleAfterValue": "100003",
1357 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & ANY_SNOOP",
1358 "Offcore": "1",
1359 "CounterHTOff": "0,1,2,3"
1360 },
1361 {
1362 "EventCode": "0xB7, 0xBB",
1363 "MSRValue": "0x2004000080 ",
1364 "Counter": "0,1,2,3",
1365 "UMask": "0x1",
1366 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
1367 "MSRIndex": "0x1a6,0x1a7",
1368 "SampleAfterValue": "100003",
1369 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
1370 "Offcore": "1",
1371 "CounterHTOff": "0,1,2,3"
1372 },
1373 {
1374 "EventCode": "0xB7, 0xBB",
1375 "MSRValue": "0x1004000080 ",
1376 "Counter": "0,1,2,3",
1377 "UMask": "0x1",
1378 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_HITM",
1379 "MSRIndex": "0x1a6,0x1a7",
1380 "SampleAfterValue": "100003",
1381 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_HITM",
1382 "Offcore": "1",
1383 "CounterHTOff": "0,1,2,3"
1384 },
1385 {
1386 "EventCode": "0xB7, 0xBB",
1387 "MSRValue": "0x0404000080 ",
1388 "Counter": "0,1,2,3",
1389 "UMask": "0x1",
1390 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_HIT_NO_FWD",
1391 "MSRIndex": "0x1a6,0x1a7",
1392 "SampleAfterValue": "100003",
1393 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_HIT_NO_FWD",
1394 "Offcore": "1",
1395 "CounterHTOff": "0,1,2,3"
1396 },
1397 {
1398 "EventCode": "0xB7, 0xBB",
1399 "MSRValue": "0x0204000080 ",
1400 "Counter": "0,1,2,3",
1401 "UMask": "0x1",
1402 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS",
1403 "MSRIndex": "0x1a6,0x1a7",
1404 "SampleAfterValue": "100003",
1405 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_MISS",
1406 "Offcore": "1",
1407 "CounterHTOff": "0,1,2,3"
1408 },
1409 {
1410 "EventCode": "0xB7, 0xBB",
1411 "MSRValue": "0x0104000080 ",
1412 "Counter": "0,1,2,3",
1413 "UMask": "0x1",
1414 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_NOT_NEEDED",
1415 "MSRIndex": "0x1a6,0x1a7",
1416 "SampleAfterValue": "100003",
1417 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_NOT_NEEDED",
1418 "Offcore": "1",
1419 "CounterHTOff": "0,1,2,3"
1420 },
1421 {
1422 "EventCode": "0xB7, 0xBB",
1423 "MSRValue": "0x0084000080 ",
1424 "Counter": "0,1,2,3",
1425 "UMask": "0x1",
1426 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_NONE",
1427 "MSRIndex": "0x1a6,0x1a7",
1428 "SampleAfterValue": "100003",
1429 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
1430 "Offcore": "1",
1431 "CounterHTOff": "0,1,2,3"
1432 },
1433 {
1434 "EventCode": "0xB7, 0xBB",
1435 "MSRValue": "0x0044000080 ",
1436 "Counter": "0,1,2,3",
1437 "UMask": "0x1",
1438 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SPL_HIT",
1439 "MSRIndex": "0x1a6,0x1a7",
1440 "SampleAfterValue": "100003",
1441 "BriefDescription": "PF_L3_DATA_RD & L3_MISS_LOCAL_DRAM & SPL_HIT",
1442 "Offcore": "1",
1443 "CounterHTOff": "0,1,2,3"
1444 },
1445 {
1446 "EventCode": "0xB7, 0xBB",
1447 "MSRValue": "0x2000400080 ",
1448 "Counter": "0,1,2,3",
1449 "UMask": "0x1",
1450 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
1451 "MSRIndex": "0x1a6,0x1a7",
1452 "SampleAfterValue": "100003",
1453 "BriefDescription": "PF_L3_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
1454 "Offcore": "1",
1455 "CounterHTOff": "0,1,2,3"
1456 },
1457 {
1458 "EventCode": "0xB7, 0xBB",
1459 "MSRValue": "0x20001c0080 ",
1460 "Counter": "0,1,2,3",
1461 "UMask": "0x1",
1462 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_NON_DRAM",
1463 "MSRIndex": "0x1a6,0x1a7",
1464 "SampleAfterValue": "100003",
1465 "BriefDescription": "PF_L3_DATA_RD & L3_HIT & SNOOP_NON_DRAM",
1466 "Offcore": "1",
1467 "CounterHTOff": "0,1,2,3"
1468 },
1469 {
1470 "EventCode": "0xB7, 0xBB",
1471 "MSRValue": "0x2000100080 ",
1472 "Counter": "0,1,2,3",
1473 "UMask": "0x1",
1474 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_S.SNOOP_NON_DRAM",
1475 "MSRIndex": "0x1a6,0x1a7",
1476 "SampleAfterValue": "100003",
1477 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_S & SNOOP_NON_DRAM",
1478 "Offcore": "1",
1479 "CounterHTOff": "0,1,2,3"
1480 },
1481 {
1482 "EventCode": "0xB7, 0xBB",
1483 "MSRValue": "0x2000080080 ",
1484 "Counter": "0,1,2,3",
1485 "UMask": "0x1",
1486 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_E.SNOOP_NON_DRAM",
1487 "MSRIndex": "0x1a6,0x1a7",
1488 "SampleAfterValue": "100003",
1489 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_E & SNOOP_NON_DRAM",
1490 "Offcore": "1",
1491 "CounterHTOff": "0,1,2,3"
1492 },
1493 {
1494 "EventCode": "0xB7, 0xBB",
1495 "MSRValue": "0x2000040080 ",
1496 "Counter": "0,1,2,3",
1497 "UMask": "0x1",
1498 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT_M.SNOOP_NON_DRAM",
1499 "MSRIndex": "0x1a6,0x1a7",
1500 "SampleAfterValue": "100003",
1501 "BriefDescription": "PF_L3_DATA_RD & L3_HIT_M & SNOOP_NON_DRAM",
1502 "Offcore": "1",
1503 "CounterHTOff": "0,1,2,3"
1504 },
1505 {
1506 "EventCode": "0xB7, 0xBB",
1507 "MSRValue": "0x2000020080 ",
1508 "Counter": "0,1,2,3",
1509 "UMask": "0x1",
1510 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.SUPPLIER_NONE.SNOOP_NON_DRAM",
1511 "MSRIndex": "0x1a6,0x1a7",
1512 "SampleAfterValue": "100003",
1513 "BriefDescription": "PF_L3_DATA_RD & SUPPLIER_NONE & SNOOP_NON_DRAM",
1514 "Offcore": "1",
1515 "CounterHTOff": "0,1,2,3"
1516 },
1517 {
1518 "EventCode": "0xB7, 0xBB",
1519 "MSRValue": "0x3ffc000004 ",
1520 "Counter": "0,1,2,3",
1521 "UMask": "0x1",
1522 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.ANY_SNOOP",
1523 "MSRIndex": "0x1a6,0x1a7",
1524 "SampleAfterValue": "100003",
1525 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & ANY_SNOOP",
1526 "Offcore": "1",
1527 "CounterHTOff": "0,1,2,3"
1528 },
1529 {
1530 "EventCode": "0xB7, 0xBB",
1531 "MSRValue": "0x203c000004 ",
1532 "Counter": "0,1,2,3",
1533 "UMask": "0x1",
1534 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_NON_DRAM",
1535 "MSRIndex": "0x1a6,0x1a7",
1536 "SampleAfterValue": "100003",
1537 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SNOOP_NON_DRAM",
1538 "Offcore": "1",
1539 "CounterHTOff": "0,1,2,3"
1540 },
1541 {
1542 "EventCode": "0xB7, 0xBB",
1543 "MSRValue": "0x103c000004 ",
1544 "Counter": "0,1,2,3",
1545 "UMask": "0x1",
1546 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_HITM",
1547 "MSRIndex": "0x1a6,0x1a7",
1548 "SampleAfterValue": "100003",
1549 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SNOOP_HITM",
1550 "Offcore": "1",
1551 "CounterHTOff": "0,1,2,3"
1552 },
1553 {
1554 "EventCode": "0xB7, 0xBB",
1555 "MSRValue": "0x043c000004 ",
1556 "Counter": "0,1,2,3",
1557 "UMask": "0x1",
1558 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_HIT_NO_FWD",
1559 "MSRIndex": "0x1a6,0x1a7",
1560 "SampleAfterValue": "100003",
1561 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SNOOP_HIT_NO_FWD",
1562 "Offcore": "1",
1563 "CounterHTOff": "0,1,2,3"
1564 },
1565 {
1566 "EventCode": "0xB7, 0xBB",
1567 "MSRValue": "0x023c000004 ",
1568 "Counter": "0,1,2,3",
1569 "UMask": "0x1",
1570 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_MISS",
1571 "MSRIndex": "0x1a6,0x1a7",
1572 "SampleAfterValue": "100003",
1573 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SNOOP_MISS",
1574 "Offcore": "1",
1575 "CounterHTOff": "0,1,2,3"
1576 },
1577 {
1578 "EventCode": "0xB7, 0xBB",
1579 "MSRValue": "0x013c000004 ",
1580 "Counter": "0,1,2,3",
1581 "UMask": "0x1",
1582 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_NOT_NEEDED",
1583 "MSRIndex": "0x1a6,0x1a7",
1584 "SampleAfterValue": "100003",
1585 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SNOOP_NOT_NEEDED",
1586 "Offcore": "1",
1587 "CounterHTOff": "0,1,2,3"
1588 },
1589 {
1590 "EventCode": "0xB7, 0xBB",
1591 "MSRValue": "0x00bc000004 ",
1592 "Counter": "0,1,2,3",
1593 "UMask": "0x1",
1594 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_NONE",
1595 "MSRIndex": "0x1a6,0x1a7",
1596 "SampleAfterValue": "100003",
1597 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SNOOP_NONE",
1598 "Offcore": "1",
1599 "CounterHTOff": "0,1,2,3"
1600 },
1601 {
1602 "EventCode": "0xB7, 0xBB",
1603 "MSRValue": "0x007c000004 ",
1604 "Counter": "0,1,2,3",
1605 "UMask": "0x1",
1606 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SPL_HIT",
1607 "MSRIndex": "0x1a6,0x1a7",
1608 "SampleAfterValue": "100003",
1609 "BriefDescription": "DEMAND_CODE_RD & L3_MISS & SPL_HIT",
1610 "Offcore": "1",
1611 "CounterHTOff": "0,1,2,3"
1612 },
1613 {
1614 "EventCode": "0xB7, 0xBB",
1615 "MSRValue": "0x3fc4000004 ",
1616 "Counter": "0,1,2,3",
1617 "UMask": "0x1",
1618 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.ANY_SNOOP",
1619 "MSRIndex": "0x1a6,0x1a7",
1620 "SampleAfterValue": "100003",
1621 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & ANY_SNOOP",
1622 "Offcore": "1",
1623 "CounterHTOff": "0,1,2,3"
1624 },
1625 {
1626 "EventCode": "0xB7, 0xBB",
1627 "MSRValue": "0x2004000004 ",
1628 "Counter": "0,1,2,3",
1629 "UMask": "0x1",
1630 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
1631 "MSRIndex": "0x1a6,0x1a7",
1632 "SampleAfterValue": "100003",
1633 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
1634 "Offcore": "1",
1635 "CounterHTOff": "0,1,2,3"
1636 },
1637 {
1638 "EventCode": "0xB7, 0xBB",
1639 "MSRValue": "0x1004000004 ",
1640 "Counter": "0,1,2,3",
1641 "UMask": "0x1",
1642 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_HITM",
1643 "MSRIndex": "0x1a6,0x1a7",
1644 "SampleAfterValue": "100003",
1645 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SNOOP_HITM",
1646 "Offcore": "1",
1647 "CounterHTOff": "0,1,2,3"
1648 },
1649 {
1650 "EventCode": "0xB7, 0xBB",
1651 "MSRValue": "0x0404000004 ",
1652 "Counter": "0,1,2,3",
1653 "UMask": "0x1",
1654 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_HIT_NO_FWD",
1655 "MSRIndex": "0x1a6,0x1a7",
1656 "SampleAfterValue": "100003",
1657 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SNOOP_HIT_NO_FWD",
1658 "Offcore": "1",
1659 "CounterHTOff": "0,1,2,3"
1660 },
1661 {
1662 "EventCode": "0xB7, 0xBB",
1663 "MSRValue": "0x0204000004 ",
1664 "Counter": "0,1,2,3",
1665 "UMask": "0x1",
1666 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS",
1667 "MSRIndex": "0x1a6,0x1a7",
1668 "SampleAfterValue": "100003",
1669 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SNOOP_MISS",
1670 "Offcore": "1",
1671 "CounterHTOff": "0,1,2,3"
1672 },
1673 {
1674 "EventCode": "0xB7, 0xBB",
1675 "MSRValue": "0x0104000004 ",
1676 "Counter": "0,1,2,3",
1677 "UMask": "0x1",
1678 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_NOT_NEEDED",
1679 "MSRIndex": "0x1a6,0x1a7",
1680 "SampleAfterValue": "100003",
1681 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SNOOP_NOT_NEEDED",
1682 "Offcore": "1",
1683 "CounterHTOff": "0,1,2,3"
1684 },
1685 {
1686 "EventCode": "0xB7, 0xBB",
1687 "MSRValue": "0x0084000004 ",
1688 "Counter": "0,1,2,3",
1689 "UMask": "0x1",
1690 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_NONE",
1691 "MSRIndex": "0x1a6,0x1a7",
1692 "SampleAfterValue": "100003",
1693 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
1694 "Offcore": "1",
1695 "CounterHTOff": "0,1,2,3"
1696 },
1697 {
1698 "EventCode": "0xB7, 0xBB",
1699 "MSRValue": "0x0044000004 ",
1700 "Counter": "0,1,2,3",
1701 "UMask": "0x1",
1702 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SPL_HIT",
1703 "MSRIndex": "0x1a6,0x1a7",
1704 "SampleAfterValue": "100003",
1705 "BriefDescription": "DEMAND_CODE_RD & L3_MISS_LOCAL_DRAM & SPL_HIT",
1706 "Offcore": "1",
1707 "CounterHTOff": "0,1,2,3"
1708 },
1709 {
1710 "EventCode": "0xB7, 0xBB",
1711 "MSRValue": "0x2000400004 ",
1712 "Counter": "0,1,2,3",
1713 "UMask": "0x1",
1714 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
1715 "MSRIndex": "0x1a6,0x1a7",
1716 "SampleAfterValue": "100003",
1717 "BriefDescription": "DEMAND_CODE_RD & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
1718 "Offcore": "1",
1719 "CounterHTOff": "0,1,2,3"
1720 },
1721 {
1722 "EventCode": "0xB7, 0xBB",
1723 "MSRValue": "0x20001c0004 ",
1724 "Counter": "0,1,2,3",
1725 "UMask": "0x1",
1726 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_NON_DRAM",
1727 "MSRIndex": "0x1a6,0x1a7",
1728 "SampleAfterValue": "100003",
1729 "BriefDescription": "DEMAND_CODE_RD & L3_HIT & SNOOP_NON_DRAM",
1730 "Offcore": "1",
1731 "CounterHTOff": "0,1,2,3"
1732 },
1733 {
1734 "EventCode": "0xB7, 0xBB",
1735 "MSRValue": "0x2000100004 ",
1736 "Counter": "0,1,2,3",
1737 "UMask": "0x1",
1738 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_S.SNOOP_NON_DRAM",
1739 "MSRIndex": "0x1a6,0x1a7",
1740 "SampleAfterValue": "100003",
1741 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_S & SNOOP_NON_DRAM",
1742 "Offcore": "1",
1743 "CounterHTOff": "0,1,2,3"
1744 },
1745 {
1746 "EventCode": "0xB7, 0xBB",
1747 "MSRValue": "0x2000080004 ",
1748 "Counter": "0,1,2,3",
1749 "UMask": "0x1",
1750 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_E.SNOOP_NON_DRAM",
1751 "MSRIndex": "0x1a6,0x1a7",
1752 "SampleAfterValue": "100003",
1753 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_E & SNOOP_NON_DRAM",
1754 "Offcore": "1",
1755 "CounterHTOff": "0,1,2,3"
1756 },
1757 {
1758 "EventCode": "0xB7, 0xBB",
1759 "MSRValue": "0x2000040004 ",
1760 "Counter": "0,1,2,3",
1761 "UMask": "0x1",
1762 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT_M.SNOOP_NON_DRAM",
1763 "MSRIndex": "0x1a6,0x1a7",
1764 "SampleAfterValue": "100003",
1765 "BriefDescription": "DEMAND_CODE_RD & L3_HIT_M & SNOOP_NON_DRAM",
1766 "Offcore": "1",
1767 "CounterHTOff": "0,1,2,3"
1768 },
1769 {
1770 "EventCode": "0xB7, 0xBB",
1771 "MSRValue": "0x2000020004 ",
1772 "Counter": "0,1,2,3",
1773 "UMask": "0x1",
1774 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.SUPPLIER_NONE.SNOOP_NON_DRAM",
1775 "MSRIndex": "0x1a6,0x1a7",
1776 "SampleAfterValue": "100003",
1777 "BriefDescription": "DEMAND_CODE_RD & SUPPLIER_NONE & SNOOP_NON_DRAM",
1778 "Offcore": "1",
1779 "CounterHTOff": "0,1,2,3"
1780 },
1781 {
1782 "EventCode": "0xB7, 0xBB",
1783 "MSRValue": "0x3ffc000002 ",
1784 "Counter": "0,1,2,3",
1785 "UMask": "0x1",
1786 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.ANY_SNOOP",
1787 "MSRIndex": "0x1a6,0x1a7",
1788 "SampleAfterValue": "100003",
1789 "BriefDescription": "DEMAND_RFO & L3_MISS & ANY_SNOOP",
1790 "Offcore": "1",
1791 "CounterHTOff": "0,1,2,3"
1792 },
1793 {
1794 "EventCode": "0xB7, 0xBB",
1795 "MSRValue": "0x203c000002 ",
1796 "Counter": "0,1,2,3",
1797 "UMask": "0x1",
1798 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_NON_DRAM",
1799 "MSRIndex": "0x1a6,0x1a7",
1800 "SampleAfterValue": "100003",
1801 "BriefDescription": "DEMAND_RFO & L3_MISS & SNOOP_NON_DRAM",
1802 "Offcore": "1",
1803 "CounterHTOff": "0,1,2,3"
1804 },
1805 {
1806 "EventCode": "0xB7, 0xBB",
1807 "MSRValue": "0x103c000002 ",
1808 "Counter": "0,1,2,3",
1809 "UMask": "0x1",
1810 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_HITM",
1811 "MSRIndex": "0x1a6,0x1a7",
1812 "SampleAfterValue": "100003",
1813 "BriefDescription": "DEMAND_RFO & L3_MISS & SNOOP_HITM",
1814 "Offcore": "1",
1815 "CounterHTOff": "0,1,2,3"
1816 },
1817 {
1818 "EventCode": "0xB7, 0xBB",
1819 "MSRValue": "0x043c000002 ",
1820 "Counter": "0,1,2,3",
1821 "UMask": "0x1",
1822 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_HIT_NO_FWD",
1823 "MSRIndex": "0x1a6,0x1a7",
1824 "SampleAfterValue": "100003",
1825 "BriefDescription": "DEMAND_RFO & L3_MISS & SNOOP_HIT_NO_FWD",
1826 "Offcore": "1",
1827 "CounterHTOff": "0,1,2,3"
1828 },
1829 {
1830 "EventCode": "0xB7, 0xBB",
1831 "MSRValue": "0x023c000002 ",
1832 "Counter": "0,1,2,3",
1833 "UMask": "0x1",
1834 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_MISS",
1835 "MSRIndex": "0x1a6,0x1a7",
1836 "SampleAfterValue": "100003",
1837 "BriefDescription": "DEMAND_RFO & L3_MISS & SNOOP_MISS",
1838 "Offcore": "1",
1839 "CounterHTOff": "0,1,2,3"
1840 },
1841 {
1842 "EventCode": "0xB7, 0xBB",
1843 "MSRValue": "0x013c000002 ",
1844 "Counter": "0,1,2,3",
1845 "UMask": "0x1",
1846 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_NOT_NEEDED",
1847 "MSRIndex": "0x1a6,0x1a7",
1848 "SampleAfterValue": "100003",
1849 "BriefDescription": "DEMAND_RFO & L3_MISS & SNOOP_NOT_NEEDED",
1850 "Offcore": "1",
1851 "CounterHTOff": "0,1,2,3"
1852 },
1853 {
1854 "EventCode": "0xB7, 0xBB",
1855 "MSRValue": "0x00bc000002 ",
1856 "Counter": "0,1,2,3",
1857 "UMask": "0x1",
1858 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_NONE",
1859 "MSRIndex": "0x1a6,0x1a7",
1860 "SampleAfterValue": "100003",
1861 "BriefDescription": "DEMAND_RFO & L3_MISS & SNOOP_NONE",
1862 "Offcore": "1",
1863 "CounterHTOff": "0,1,2,3"
1864 },
1865 {
1866 "EventCode": "0xB7, 0xBB",
1867 "MSRValue": "0x007c000002 ",
1868 "Counter": "0,1,2,3",
1869 "UMask": "0x1",
1870 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SPL_HIT",
1871 "MSRIndex": "0x1a6,0x1a7",
1872 "SampleAfterValue": "100003",
1873 "BriefDescription": "DEMAND_RFO & L3_MISS & SPL_HIT",
1874 "Offcore": "1",
1875 "CounterHTOff": "0,1,2,3"
1876 },
1877 {
1878 "EventCode": "0xB7, 0xBB",
1879 "MSRValue": "0x3fc4000002 ",
1880 "Counter": "0,1,2,3",
1881 "UMask": "0x1",
1882 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.ANY_SNOOP",
1883 "MSRIndex": "0x1a6,0x1a7",
1884 "SampleAfterValue": "100003",
1885 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & ANY_SNOOP",
1886 "Offcore": "1",
1887 "CounterHTOff": "0,1,2,3"
1888 },
1889 {
1890 "EventCode": "0xB7, 0xBB",
1891 "MSRValue": "0x2004000002 ",
1892 "Counter": "0,1,2,3",
1893 "UMask": "0x1",
1894 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
1895 "MSRIndex": "0x1a6,0x1a7",
1896 "SampleAfterValue": "100003",
1897 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
1898 "Offcore": "1",
1899 "CounterHTOff": "0,1,2,3"
1900 },
1901 {
1902 "EventCode": "0xB7, 0xBB",
1903 "MSRValue": "0x1004000002 ",
1904 "Counter": "0,1,2,3",
1905 "UMask": "0x1",
1906 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_HITM",
1907 "MSRIndex": "0x1a6,0x1a7",
1908 "SampleAfterValue": "100003",
1909 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SNOOP_HITM",
1910 "Offcore": "1",
1911 "CounterHTOff": "0,1,2,3"
1912 },
1913 {
1914 "EventCode": "0xB7, 0xBB",
1915 "MSRValue": "0x0404000002 ",
1916 "Counter": "0,1,2,3",
1917 "UMask": "0x1",
1918 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_HIT_NO_FWD",
1919 "MSRIndex": "0x1a6,0x1a7",
1920 "SampleAfterValue": "100003",
1921 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SNOOP_HIT_NO_FWD",
1922 "Offcore": "1",
1923 "CounterHTOff": "0,1,2,3"
1924 },
1925 {
1926 "EventCode": "0xB7, 0xBB",
1927 "MSRValue": "0x0204000002 ",
1928 "Counter": "0,1,2,3",
1929 "UMask": "0x1",
1930 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS",
1931 "MSRIndex": "0x1a6,0x1a7",
1932 "SampleAfterValue": "100003",
1933 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SNOOP_MISS",
1934 "Offcore": "1",
1935 "CounterHTOff": "0,1,2,3"
1936 },
1937 {
1938 "EventCode": "0xB7, 0xBB",
1939 "MSRValue": "0x0104000002 ",
1940 "Counter": "0,1,2,3",
1941 "UMask": "0x1",
1942 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_NOT_NEEDED",
1943 "MSRIndex": "0x1a6,0x1a7",
1944 "SampleAfterValue": "100003",
1945 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SNOOP_NOT_NEEDED",
1946 "Offcore": "1",
1947 "CounterHTOff": "0,1,2,3"
1948 },
1949 {
1950 "EventCode": "0xB7, 0xBB",
1951 "MSRValue": "0x0084000002 ",
1952 "Counter": "0,1,2,3",
1953 "UMask": "0x1",
1954 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_NONE",
1955 "MSRIndex": "0x1a6,0x1a7",
1956 "SampleAfterValue": "100003",
1957 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
1958 "Offcore": "1",
1959 "CounterHTOff": "0,1,2,3"
1960 },
1961 {
1962 "EventCode": "0xB7, 0xBB",
1963 "MSRValue": "0x0044000002 ",
1964 "Counter": "0,1,2,3",
1965 "UMask": "0x1",
1966 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SPL_HIT",
1967 "MSRIndex": "0x1a6,0x1a7",
1968 "SampleAfterValue": "100003",
1969 "BriefDescription": "DEMAND_RFO & L3_MISS_LOCAL_DRAM & SPL_HIT",
1970 "Offcore": "1",
1971 "CounterHTOff": "0,1,2,3"
1972 },
1973 {
1974 "EventCode": "0xB7, 0xBB",
1975 "MSRValue": "0x2000400002 ",
1976 "Counter": "0,1,2,3",
1977 "UMask": "0x1",
1978 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
1979 "MSRIndex": "0x1a6,0x1a7",
1980 "SampleAfterValue": "100003",
1981 "BriefDescription": "DEMAND_RFO & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
1982 "Offcore": "1",
1983 "CounterHTOff": "0,1,2,3"
1984 },
1985 {
1986 "EventCode": "0xB7, 0xBB",
1987 "MSRValue": "0x20001c0002 ",
1988 "Counter": "0,1,2,3",
1989 "UMask": "0x1",
1990 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_NON_DRAM",
1991 "MSRIndex": "0x1a6,0x1a7",
1992 "SampleAfterValue": "100003",
1993 "BriefDescription": "DEMAND_RFO & L3_HIT & SNOOP_NON_DRAM",
1994 "Offcore": "1",
1995 "CounterHTOff": "0,1,2,3"
1996 },
1997 {
1998 "EventCode": "0xB7, 0xBB",
1999 "MSRValue": "0x2000100002 ",
2000 "Counter": "0,1,2,3",
2001 "UMask": "0x1",
2002 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_S.SNOOP_NON_DRAM",
2003 "MSRIndex": "0x1a6,0x1a7",
2004 "SampleAfterValue": "100003",
2005 "BriefDescription": "DEMAND_RFO & L3_HIT_S & SNOOP_NON_DRAM",
2006 "Offcore": "1",
2007 "CounterHTOff": "0,1,2,3"
2008 },
2009 {
2010 "EventCode": "0xB7, 0xBB",
2011 "MSRValue": "0x2000080002 ",
2012 "Counter": "0,1,2,3",
2013 "UMask": "0x1",
2014 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_E.SNOOP_NON_DRAM",
2015 "MSRIndex": "0x1a6,0x1a7",
2016 "SampleAfterValue": "100003",
2017 "BriefDescription": "DEMAND_RFO & L3_HIT_E & SNOOP_NON_DRAM",
2018 "Offcore": "1",
2019 "CounterHTOff": "0,1,2,3"
2020 },
2021 {
2022 "EventCode": "0xB7, 0xBB",
2023 "MSRValue": "0x2000040002 ",
2024 "Counter": "0,1,2,3",
2025 "UMask": "0x1",
2026 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT_M.SNOOP_NON_DRAM",
2027 "MSRIndex": "0x1a6,0x1a7",
2028 "SampleAfterValue": "100003",
2029 "BriefDescription": "DEMAND_RFO & L3_HIT_M & SNOOP_NON_DRAM",
2030 "Offcore": "1",
2031 "CounterHTOff": "0,1,2,3"
2032 },
2033 {
2034 "EventCode": "0xB7, 0xBB",
2035 "MSRValue": "0x2000020002 ",
2036 "Counter": "0,1,2,3",
2037 "UMask": "0x1",
2038 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.SUPPLIER_NONE.SNOOP_NON_DRAM",
2039 "MSRIndex": "0x1a6,0x1a7",
2040 "SampleAfterValue": "100003",
2041 "BriefDescription": "DEMAND_RFO & SUPPLIER_NONE & SNOOP_NON_DRAM",
2042 "Offcore": "1",
2043 "CounterHTOff": "0,1,2,3"
2044 },
2045 {
2046 "EventCode": "0xB7, 0xBB", 461 "EventCode": "0xB7, 0xBB",
2047 "MSRValue": "0x3ffc000001 ", 462 "MSRValue": "0x3ffc000001 ",
2048 "Counter": "0,1,2,3", 463 "Counter": "0,1,2,3",
@@ -2055,18 +470,7 @@
2055 "CounterHTOff": "0,1,2,3" 470 "CounterHTOff": "0,1,2,3"
2056 }, 471 },
2057 { 472 {
2058 "EventCode": "0xB7, 0xBB", 473 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2059 "MSRValue": "0x203c000001 ",
2060 "Counter": "0,1,2,3",
2061 "UMask": "0x1",
2062 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.SNOOP_NON_DRAM",
2063 "MSRIndex": "0x1a6,0x1a7",
2064 "SampleAfterValue": "100003",
2065 "BriefDescription": "DEMAND_DATA_RD & L3_MISS & SNOOP_NON_DRAM",
2066 "Offcore": "1",
2067 "CounterHTOff": "0,1,2,3"
2068 },
2069 {
2070 "EventCode": "0xB7, 0xBB", 474 "EventCode": "0xB7, 0xBB",
2071 "MSRValue": "0x103c000001 ", 475 "MSRValue": "0x103c000001 ",
2072 "Counter": "0,1,2,3", 476 "Counter": "0,1,2,3",
@@ -2079,6 +483,7 @@
2079 "CounterHTOff": "0,1,2,3" 483 "CounterHTOff": "0,1,2,3"
2080 }, 484 },
2081 { 485 {
486 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2082 "EventCode": "0xB7, 0xBB", 487 "EventCode": "0xB7, 0xBB",
2083 "MSRValue": "0x043c000001 ", 488 "MSRValue": "0x043c000001 ",
2084 "Counter": "0,1,2,3", 489 "Counter": "0,1,2,3",
@@ -2091,6 +496,7 @@
2091 "CounterHTOff": "0,1,2,3" 496 "CounterHTOff": "0,1,2,3"
2092 }, 497 },
2093 { 498 {
499 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2094 "EventCode": "0xB7, 0xBB", 500 "EventCode": "0xB7, 0xBB",
2095 "MSRValue": "0x023c000001 ", 501 "MSRValue": "0x023c000001 ",
2096 "Counter": "0,1,2,3", 502 "Counter": "0,1,2,3",
@@ -2103,6 +509,7 @@
2103 "CounterHTOff": "0,1,2,3" 509 "CounterHTOff": "0,1,2,3"
2104 }, 510 },
2105 { 511 {
512 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2106 "EventCode": "0xB7, 0xBB", 513 "EventCode": "0xB7, 0xBB",
2107 "MSRValue": "0x013c000001 ", 514 "MSRValue": "0x013c000001 ",
2108 "Counter": "0,1,2,3", 515 "Counter": "0,1,2,3",
@@ -2115,6 +522,7 @@
2115 "CounterHTOff": "0,1,2,3" 522 "CounterHTOff": "0,1,2,3"
2116 }, 523 },
2117 { 524 {
525 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2118 "EventCode": "0xB7, 0xBB", 526 "EventCode": "0xB7, 0xBB",
2119 "MSRValue": "0x00bc000001 ", 527 "MSRValue": "0x00bc000001 ",
2120 "Counter": "0,1,2,3", 528 "Counter": "0,1,2,3",
@@ -2127,18 +535,7 @@
2127 "CounterHTOff": "0,1,2,3" 535 "CounterHTOff": "0,1,2,3"
2128 }, 536 },
2129 { 537 {
2130 "EventCode": "0xB7, 0xBB", 538 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2131 "MSRValue": "0x007c000001 ",
2132 "Counter": "0,1,2,3",
2133 "UMask": "0x1",
2134 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.SPL_HIT",
2135 "MSRIndex": "0x1a6,0x1a7",
2136 "SampleAfterValue": "100003",
2137 "BriefDescription": "DEMAND_DATA_RD & L3_MISS & SPL_HIT",
2138 "Offcore": "1",
2139 "CounterHTOff": "0,1,2,3"
2140 },
2141 {
2142 "EventCode": "0xB7, 0xBB", 539 "EventCode": "0xB7, 0xBB",
2143 "MSRValue": "0x3fc4000001 ", 540 "MSRValue": "0x3fc4000001 ",
2144 "Counter": "0,1,2,3", 541 "Counter": "0,1,2,3",
@@ -2151,18 +548,7 @@
2151 "CounterHTOff": "0,1,2,3" 548 "CounterHTOff": "0,1,2,3"
2152 }, 549 },
2153 { 550 {
2154 "EventCode": "0xB7, 0xBB", 551 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2155 "MSRValue": "0x2004000001 ",
2156 "Counter": "0,1,2,3",
2157 "UMask": "0x1",
2158 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_NON_DRAM",
2159 "MSRIndex": "0x1a6,0x1a7",
2160 "SampleAfterValue": "100003",
2161 "BriefDescription": "DEMAND_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_NON_DRAM",
2162 "Offcore": "1",
2163 "CounterHTOff": "0,1,2,3"
2164 },
2165 {
2166 "EventCode": "0xB7, 0xBB", 552 "EventCode": "0xB7, 0xBB",
2167 "MSRValue": "0x1004000001 ", 553 "MSRValue": "0x1004000001 ",
2168 "Counter": "0,1,2,3", 554 "Counter": "0,1,2,3",
@@ -2175,6 +561,7 @@
2175 "CounterHTOff": "0,1,2,3" 561 "CounterHTOff": "0,1,2,3"
2176 }, 562 },
2177 { 563 {
564 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2178 "EventCode": "0xB7, 0xBB", 565 "EventCode": "0xB7, 0xBB",
2179 "MSRValue": "0x0404000001 ", 566 "MSRValue": "0x0404000001 ",
2180 "Counter": "0,1,2,3", 567 "Counter": "0,1,2,3",
@@ -2187,6 +574,7 @@
2187 "CounterHTOff": "0,1,2,3" 574 "CounterHTOff": "0,1,2,3"
2188 }, 575 },
2189 { 576 {
577 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2190 "EventCode": "0xB7, 0xBB", 578 "EventCode": "0xB7, 0xBB",
2191 "MSRValue": "0x0204000001 ", 579 "MSRValue": "0x0204000001 ",
2192 "Counter": "0,1,2,3", 580 "Counter": "0,1,2,3",
@@ -2199,6 +587,7 @@
2199 "CounterHTOff": "0,1,2,3" 587 "CounterHTOff": "0,1,2,3"
2200 }, 588 },
2201 { 589 {
590 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2202 "EventCode": "0xB7, 0xBB", 591 "EventCode": "0xB7, 0xBB",
2203 "MSRValue": "0x0104000001 ", 592 "MSRValue": "0x0104000001 ",
2204 "Counter": "0,1,2,3", 593 "Counter": "0,1,2,3",
@@ -2211,6 +600,7 @@
2211 "CounterHTOff": "0,1,2,3" 600 "CounterHTOff": "0,1,2,3"
2212 }, 601 },
2213 { 602 {
603 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
2214 "EventCode": "0xB7, 0xBB", 604 "EventCode": "0xB7, 0xBB",
2215 "MSRValue": "0x0084000001 ", 605 "MSRValue": "0x0084000001 ",
2216 "Counter": "0,1,2,3", 606 "Counter": "0,1,2,3",
@@ -2221,89 +611,5 @@
2221 "BriefDescription": "DEMAND_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_NONE", 611 "BriefDescription": "DEMAND_DATA_RD & L3_MISS_LOCAL_DRAM & SNOOP_NONE",
2222 "Offcore": "1", 612 "Offcore": "1",
2223 "CounterHTOff": "0,1,2,3" 613 "CounterHTOff": "0,1,2,3"
2224 },
2225 {
2226 "EventCode": "0xB7, 0xBB",
2227 "MSRValue": "0x0044000001 ",
2228 "Counter": "0,1,2,3",
2229 "UMask": "0x1",
2230 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS_LOCAL_DRAM.SPL_HIT",
2231 "MSRIndex": "0x1a6,0x1a7",
2232 "SampleAfterValue": "100003",
2233 "BriefDescription": "DEMAND_DATA_RD & L3_MISS_LOCAL_DRAM & SPL_HIT",
2234 "Offcore": "1",
2235 "CounterHTOff": "0,1,2,3"
2236 },
2237 {
2238 "EventCode": "0xB7, 0xBB",
2239 "MSRValue": "0x2000400001 ",
2240 "Counter": "0,1,2,3",
2241 "UMask": "0x1",
2242 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L4_HIT_LOCAL_L4.SNOOP_NON_DRAM",
2243 "MSRIndex": "0x1a6,0x1a7",
2244 "SampleAfterValue": "100003",
2245 "BriefDescription": "DEMAND_DATA_RD & L4_HIT_LOCAL_L4 & SNOOP_NON_DRAM",
2246 "Offcore": "1",
2247 "CounterHTOff": "0,1,2,3"
2248 },
2249 {
2250 "EventCode": "0xB7, 0xBB",
2251 "MSRValue": "0x20001c0001 ",
2252 "Counter": "0,1,2,3",
2253 "UMask": "0x1",
2254 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.SNOOP_NON_DRAM",
2255 "MSRIndex": "0x1a6,0x1a7",
2256 "SampleAfterValue": "100003",
2257 "BriefDescription": "DEMAND_DATA_RD & L3_HIT & SNOOP_NON_DRAM",
2258 "Offcore": "1",
2259 "CounterHTOff": "0,1,2,3"
2260 },
2261 {
2262 "EventCode": "0xB7, 0xBB",
2263 "MSRValue": "0x2000100001 ",
2264 "Counter": "0,1,2,3",
2265 "UMask": "0x1",
2266 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_S.SNOOP_NON_DRAM",
2267 "MSRIndex": "0x1a6,0x1a7",
2268 "SampleAfterValue": "100003",
2269 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_S & SNOOP_NON_DRAM",
2270 "Offcore": "1",
2271 "CounterHTOff": "0,1,2,3"
2272 },
2273 {
2274 "EventCode": "0xB7, 0xBB",
2275 "MSRValue": "0x2000080001 ",
2276 "Counter": "0,1,2,3",
2277 "UMask": "0x1",
2278 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_E.SNOOP_NON_DRAM",
2279 "MSRIndex": "0x1a6,0x1a7",
2280 "SampleAfterValue": "100003",
2281 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_E & SNOOP_NON_DRAM",
2282 "Offcore": "1",
2283 "CounterHTOff": "0,1,2,3"
2284 },
2285 {
2286 "EventCode": "0xB7, 0xBB",
2287 "MSRValue": "0x2000040001 ",
2288 "Counter": "0,1,2,3",
2289 "UMask": "0x1",
2290 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT_M.SNOOP_NON_DRAM",
2291 "MSRIndex": "0x1a6,0x1a7",
2292 "SampleAfterValue": "100003",
2293 "BriefDescription": "DEMAND_DATA_RD & L3_HIT_M & SNOOP_NON_DRAM",
2294 "Offcore": "1",
2295 "CounterHTOff": "0,1,2,3"
2296 },
2297 {
2298 "EventCode": "0xB7, 0xBB",
2299 "MSRValue": "0x2000020001 ",
2300 "Counter": "0,1,2,3",
2301 "UMask": "0x1",
2302 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.SUPPLIER_NONE.SNOOP_NON_DRAM",
2303 "MSRIndex": "0x1a6,0x1a7",
2304 "SampleAfterValue": "100003",
2305 "BriefDescription": "DEMAND_DATA_RD & SUPPLIER_NONE & SNOOP_NON_DRAM",
2306 "Offcore": "1",
2307 "CounterHTOff": "0,1,2,3"
2308 } 614 }
2309] \ No newline at end of file 615] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/skylake/other.json b/tools/perf/pmu-events/arch/x86/skylake/other.json
index cfdc323acc82..84a316d380ac 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/other.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/other.json
@@ -1,11 +1,47 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "This event counts the number of hardware interruptions received by the processor.", 3 "EventCode": "0x32",
4 "Counter": "0,1,2,3",
5 "UMask": "0x1",
6 "EventName": "SW_PREFETCH_ACCESS.NTA",
7 "SampleAfterValue": "2000003",
8 "BriefDescription": "Number of PREFETCHNTA instructions executed.",
9 "CounterHTOff": "0,1,2,3,4,5,6,7"
10 },
11 {
12 "EventCode": "0x32",
13 "Counter": "0,1,2,3",
14 "UMask": "0x2",
15 "EventName": "SW_PREFETCH_ACCESS.T0",
16 "SampleAfterValue": "2000003",
17 "BriefDescription": "Number of PREFETCHT0 instructions executed.",
18 "CounterHTOff": "0,1,2,3,4,5,6,7"
19 },
20 {
21 "EventCode": "0x32",
22 "Counter": "0,1,2,3",
23 "UMask": "0x4",
24 "EventName": "SW_PREFETCH_ACCESS.T1_T2",
25 "SampleAfterValue": "2000003",
26 "BriefDescription": "Number of PREFETCHT1 or PREFETCHT2 instructions executed.",
27 "CounterHTOff": "0,1,2,3,4,5,6,7"
28 },
29 {
30 "EventCode": "0x32",
31 "Counter": "0,1,2,3",
32 "UMask": "0x8",
33 "EventName": "SW_PREFETCH_ACCESS.PREFETCHW",
34 "SampleAfterValue": "2000003",
35 "BriefDescription": "Number of PREFETCHW instructions executed.",
36 "CounterHTOff": "0,1,2,3,4,5,6,7"
37 },
38 {
39 "PublicDescription": "Counts the number of hardware interruptions received by the processor.",
4 "EventCode": "0xCB", 40 "EventCode": "0xCB",
5 "Counter": "0,1,2,3", 41 "Counter": "0,1,2,3",
6 "UMask": "0x1", 42 "UMask": "0x1",
7 "EventName": "HW_INTERRUPTS.RECEIVED", 43 "EventName": "HW_INTERRUPTS.RECEIVED",
8 "SampleAfterValue": "100003", 44 "SampleAfterValue": "203",
9 "BriefDescription": "Number of hardware interrupts received by the processor.", 45 "BriefDescription": "Number of hardware interrupts received by the processor.",
10 "CounterHTOff": "0,1,2,3,4,5,6,7" 46 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 } 47 }
diff --git a/tools/perf/pmu-events/arch/x86/skylake/pipeline.json b/tools/perf/pmu-events/arch/x86/skylake/pipeline.json
index 0f7adb809be3..bc6d2afbcd8a 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/pipeline.json
@@ -1,80 +1,92 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "This event counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, this event counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. \nNotes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. \nCounting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 3 "PublicDescription": "Counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, Counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. Notes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. Counting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
4 "EventCode": "0x00", 4 "EventCode": "0x00",
5 "Counter": "Fixed counter 1", 5 "Counter": "Fixed counter 0",
6 "UMask": "0x1", 6 "UMask": "0x1",
7 "EventName": "INST_RETIRED.ANY", 7 "EventName": "INST_RETIRED.ANY",
8 "SampleAfterValue": "2000003", 8 "SampleAfterValue": "2000003",
9 "BriefDescription": "Instructions retired from execution.", 9 "BriefDescription": "Instructions retired from execution.",
10 "CounterHTOff": "Fixed counter 1" 10 "CounterHTOff": "Fixed counter 0"
11 }, 11 },
12 { 12 {
13 "PublicDescription": "This event counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.", 13 "PublicDescription": "Counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.",
14 "EventCode": "0x00", 14 "EventCode": "0x00",
15 "Counter": "Fixed counter 2", 15 "Counter": "Fixed counter 1",
16 "UMask": "0x2", 16 "UMask": "0x2",
17 "EventName": "CPU_CLK_UNHALTED.THREAD", 17 "EventName": "CPU_CLK_UNHALTED.THREAD",
18 "SampleAfterValue": "2000003", 18 "SampleAfterValue": "2000003",
19 "BriefDescription": "Core cycles when the thread is not in halt state", 19 "BriefDescription": "Core cycles when the thread is not in halt state",
20 "CounterHTOff": "Fixed counter 2" 20 "CounterHTOff": "Fixed counter 1"
21 },
22 {
23 "EventCode": "0x00",
24 "Counter": "Fixed counter 1",
25 "UMask": "0x2",
26 "AnyThread": "1",
27 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
28 "SampleAfterValue": "2000003",
29 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
30 "CounterHTOff": "Fixed counter 1"
21 }, 31 },
22 { 32 {
23 "PublicDescription": "This event counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. Note: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.", 33 "PublicDescription": "Counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. Note: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.",
24 "EventCode": "0x00", 34 "EventCode": "0x00",
25 "Counter": "Fixed counter 3", 35 "Counter": "Fixed counter 2",
26 "UMask": "0x3", 36 "UMask": "0x3",
27 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 37 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
28 "SampleAfterValue": "2000003", 38 "SampleAfterValue": "2000003",
29 "BriefDescription": "Reference cycles when the core is not in halt state.", 39 "BriefDescription": "Reference cycles when the core is not in halt state.",
30 "CounterHTOff": "Fixed counter 3" 40 "CounterHTOff": "Fixed counter 2"
31 }, 41 },
32 { 42 {
33 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.", 43 "PublicDescription": "Counts how many times the load operation got the true Block-on-Store blocking code preventing store forwarding. This includes cases when:a. preceding store conflicts with the load (incomplete overlap),b. store forwarding is impossible due to u-arch limitations,c. preceding lock RMW operations are not forwarded,d. store has the no-forward bit set (uncacheable/page-split/masked stores),e. all-blocking stores are used (mostly, fences and port I/O), and others.The most common case is a load blocked due to its address range overlapping with a preceding smaller uncompleted store. Note: This event does not take into account cases of out-of-SW-control (for example, SbTailHit), unknown physical STA, and cases of blocking loads on store due to being non-WB memory type or a lock. These cases are covered by other events. See the table of not supported store forwards in the Optimization Guide.",
34 "EventCode": "0x3C", 44 "EventCode": "0x03",
35 "Counter": "0,1,2,3", 45 "Counter": "0,1,2,3",
36 "UMask": "0x0", 46 "UMask": "0x2",
37 "EventName": "CPU_CLK_UNHALTED.THREAD_P", 47 "EventName": "LD_BLOCKS.STORE_FORWARD",
38 "SampleAfterValue": "2000003", 48 "SampleAfterValue": "100003",
39 "BriefDescription": "Thread cycles when thread is not in halt state", 49 "BriefDescription": "Loads blocked by overlapping with store buffer that cannot be forwarded .",
40 "CounterHTOff": "0,1,2,3,4,5,6,7" 50 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 }, 51 },
42 { 52 {
43 "EventCode": "0xE6", 53 "PublicDescription": "The number of times that split load operations are temporarily blocked because all resources for handling the split accesses are in use.",
54 "EventCode": "0x03",
44 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
45 "UMask": "0x1", 56 "UMask": "0x8",
46 "EventName": "BACLEARS.ANY", 57 "EventName": "LD_BLOCKS.NO_SR",
47 "SampleAfterValue": "100003", 58 "SampleAfterValue": "100003",
48 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.", 59 "BriefDescription": "The number of times that split load operations are temporarily blocked because all resources for handling the split accesses are in use",
49 "CounterHTOff": "0,1,2,3,4,5,6,7" 60 "CounterHTOff": "0,1,2,3,4,5,6,7"
50 }, 61 },
51 { 62 {
52 "EventCode": "0xA8", 63 "PublicDescription": "Counts false dependencies in MOB when the partial comparison upon loose net check and dependency was resolved by the Enhanced Loose net mechanism. This may not result in high performance penalties. Loose net checks can fail when loads and stores are 4k aliased.",
64 "EventCode": "0x07",
53 "Counter": "0,1,2,3", 65 "Counter": "0,1,2,3",
54 "UMask": "0x1", 66 "UMask": "0x1",
55 "EventName": "LSD.UOPS", 67 "EventName": "LD_BLOCKS_PARTIAL.ADDRESS_ALIAS",
56 "SampleAfterValue": "2000003", 68 "SampleAfterValue": "100003",
57 "BriefDescription": "Number of Uops delivered by the LSD.", 69 "BriefDescription": "False dependencies in MOB due to partial compare on address.",
58 "CounterHTOff": "0,1,2,3,4,5,6,7" 70 "CounterHTOff": "0,1,2,3,4,5,6,7"
59 }, 71 },
60 { 72 {
61 "PublicDescription": "This event counts stalls occured due to changing prefix length (66, 67 or REX.W when they change the length of the decoded instruction). Occurrences counting is proportional to the number of prefixes in a 16B-line. This may result in the following penalties: three-cycle penalty for each LCP in a 16-byte chunk.", 73 "PublicDescription": "Core cycles the Resource allocator was stalled due to recovery from an earlier branch misprediction or machine clear event.",
62 "EventCode": "0x87", 74 "EventCode": "0x0D",
63 "Counter": "0,1,2,3", 75 "Counter": "0,1,2,3",
64 "UMask": "0x1", 76 "UMask": "0x1",
65 "EventName": "ILD_STALL.LCP", 77 "EventName": "INT_MISC.RECOVERY_CYCLES",
66 "SampleAfterValue": "2000003", 78 "SampleAfterValue": "2000003",
67 "BriefDescription": "Stalls caused by changing prefix length of the instruction.", 79 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)",
68 "CounterHTOff": "0,1,2,3,4,5,6,7" 80 "CounterHTOff": "0,1,2,3,4,5,6,7"
69 }, 81 },
70 { 82 {
71 "PublicDescription": "Cycles checkpoints in Resource Allocation Table (RAT) are recovering from JEClear or machine clear.",
72 "EventCode": "0x0D", 83 "EventCode": "0x0D",
73 "Counter": "0,1,2,3", 84 "Counter": "0,1,2,3",
74 "UMask": "0x1", 85 "UMask": "0x1",
75 "EventName": "INT_MISC.RECOVERY_CYCLES", 86 "AnyThread": "1",
87 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY",
76 "SampleAfterValue": "2000003", 88 "SampleAfterValue": "2000003",
77 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for this thread (e.g. misprediction or memory nuke)", 89 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).",
78 "CounterHTOff": "0,1,2,3,4,5,6,7" 90 "CounterHTOff": "0,1,2,3,4,5,6,7"
79 }, 91 },
80 { 92 {
@@ -87,33 +99,35 @@
87 "CounterHTOff": "0,1,2,3,4,5,6,7" 99 "CounterHTOff": "0,1,2,3,4,5,6,7"
88 }, 100 },
89 { 101 {
90 "PublicDescription": "This event counts resource-related stall cycles. Reasons for stalls can be as follows:\n - *any* u-arch structure got full (LB, SB, RS, ROB, BOB, LM, Physical Register Reclaim Table (PRRT), or Physical History Table (PHT) slots)\n - *any* u-arch structure got empty (like INT/SIMD FreeLists)\n - FPU control word (FPCW), MXCSR\nand others. This counts cycles that the pipeline backend blocked uop delivery from the front end.", 102 "PublicDescription": "Counts the number of uops that the Resource Allocation Table (RAT) issues to the Reservation Station (RS).",
91 "EventCode": "0xA2", 103 "EventCode": "0x0E",
92 "Counter": "0,1,2,3", 104 "Counter": "0,1,2,3",
93 "UMask": "0x1", 105 "UMask": "0x1",
94 "EventName": "RESOURCE_STALLS.ANY", 106 "EventName": "UOPS_ISSUED.ANY",
95 "SampleAfterValue": "2000003", 107 "SampleAfterValue": "2000003",
96 "BriefDescription": "Resource-related stall cycles", 108 "BriefDescription": "Uops that Resource Allocation Table (RAT) issues to Reservation Station (RS)",
97 "CounterHTOff": "0,1,2,3,4,5,6,7" 109 "CounterHTOff": "0,1,2,3,4,5,6,7"
98 }, 110 },
99 { 111 {
100 "PublicDescription": "This event counts stall cycles caused by the store buffer (SB) overflow (excluding draining from synch). This counts cycles that the pipeline backend blocked uop delivery from the front end.", 112 "PublicDescription": "Counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.",
101 "EventCode": "0xA2", 113 "EventCode": "0x0E",
114 "Invert": "1",
102 "Counter": "0,1,2,3", 115 "Counter": "0,1,2,3",
103 "UMask": "0x8", 116 "UMask": "0x1",
104 "EventName": "RESOURCE_STALLS.SB", 117 "EventName": "UOPS_ISSUED.STALL_CYCLES",
105 "SampleAfterValue": "2000003", 118 "SampleAfterValue": "2000003",
106 "BriefDescription": "Cycles stalled due to no store buffers available. (not including draining form sync).", 119 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread",
120 "CounterMask": "1",
107 "CounterHTOff": "0,1,2,3,4,5,6,7" 121 "CounterHTOff": "0,1,2,3,4,5,6,7"
108 }, 122 },
109 { 123 {
110 "PublicDescription": "This event counts the number of Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS).", 124 "PublicDescription": "Counts the number of Blend Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS) in order to preserve upper bits of vector registers. Starting with the Skylake microarchitecture, these Blend uops are needed since every Intel SSE instruction executed in Dirty Upper State needs to preserve bits 128-255 of the destination register. For more information, refer to Mixing Intel AVX and Intel SSE Code section of the Optimization Guide.",
111 "EventCode": "0x0E", 125 "EventCode": "0x0E",
112 "Counter": "0,1,2,3", 126 "Counter": "0,1,2,3",
113 "UMask": "0x1", 127 "UMask": "0x2",
114 "EventName": "UOPS_ISSUED.ANY", 128 "EventName": "UOPS_ISSUED.VECTOR_WIDTH_MISMATCH",
115 "SampleAfterValue": "2000003", 129 "SampleAfterValue": "2000003",
116 "BriefDescription": "Uops that Resource Allocation Table (RAT) issues to Reservation Station (RS)", 130 "BriefDescription": "Uops inserted at issue-stage in order to preserve upper bits of vector registers.",
117 "CounterHTOff": "0,1,2,3,4,5,6,7" 131 "CounterHTOff": "0,1,2,3,4,5,6,7"
118 }, 132 },
119 { 133 {
@@ -126,361 +140,318 @@
126 "CounterHTOff": "0,1,2,3,4,5,6,7" 140 "CounterHTOff": "0,1,2,3,4,5,6,7"
127 }, 141 },
128 { 142 {
129 "PublicDescription": "This event counts cycles during which the Resource Allocation Table (RAT) does not issue any Uops to the reservation station (RS) for the current thread.", 143 "EventCode": "0x14",
130 "EventCode": "0x0E",
131 "Invert": "1",
132 "Counter": "0,1,2,3", 144 "Counter": "0,1,2,3",
133 "UMask": "0x1", 145 "UMask": "0x1",
134 "EventName": "UOPS_ISSUED.STALL_CYCLES", 146 "EventName": "ARITH.DIVIDER_ACTIVE",
135 "SampleAfterValue": "2000003", 147 "SampleAfterValue": "2000003",
136 "BriefDescription": "Cycles when Resource Allocation Table (RAT) does not issue Uops to Reservation Station (RS) for the thread", 148 "BriefDescription": "Cycles when divide unit is busy executing divide or square root operations. Accounts for integer and floating-point operations.",
137 "CounterMask": "1", 149 "CounterMask": "1",
138 "CounterHTOff": "0,1,2,3,4,5,6,7" 150 "CounterHTOff": "0,1,2,3,4,5,6,7"
139 }, 151 },
140 { 152 {
141 "PublicDescription": "This event counts cycles during which the reservation station (RS) is empty for the thread.\nNote: In ST-mode, not active thread should drive 0. This is usually caused by severely costly branch mispredictions, or allocator/FE issues.", 153 "PublicDescription": "This is an architectural event that counts the number of thread cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. The core frequency may change from time to time due to power or thermal throttling. For this reason, this event may have a changing ratio with regards to wall clock time.",
142 "EventCode": "0x5E", 154 "EventCode": "0x3C",
143 "Counter": "0,1,2,3", 155 "Counter": "0,1,2,3",
144 "UMask": "0x1", 156 "UMask": "0x0",
145 "EventName": "RS_EVENTS.EMPTY_CYCLES", 157 "EventName": "CPU_CLK_UNHALTED.THREAD_P",
146 "SampleAfterValue": "2000003", 158 "SampleAfterValue": "2000003",
147 "BriefDescription": "Cycles when Reservation Station (RS) is empty for the thread", 159 "BriefDescription": "Thread cycles when thread is not in halt state",
148 "CounterHTOff": "0,1,2,3,4,5,6,7" 160 "CounterHTOff": "0,1,2,3,4,5,6,7"
149 }, 161 },
150 { 162 {
151 "EventCode": "0x5E", 163 "EventCode": "0x3C",
152 "Invert": "1",
153 "Counter": "0,1,2,3", 164 "Counter": "0,1,2,3",
154 "UMask": "0x1", 165 "UMask": "0x0",
155 "EdgeDetect": "1", 166 "AnyThread": "1",
156 "EventName": "RS_EVENTS.EMPTY_END", 167 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY",
157 "SampleAfterValue": "2000003", 168 "SampleAfterValue": "2000003",
158 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.", 169 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
159 "CounterMask": "1",
160 "CounterHTOff": "0,1,2,3,4,5,6,7" 170 "CounterHTOff": "0,1,2,3,4,5,6,7"
161 }, 171 },
162 { 172 {
163 "PublicDescription": "Increments when an entry is added to the Last Branch Record (LBR) array (or removed from the array in case of RETURNs in call stack mode). The event requires LBR enable via IA32_DEBUGCTL MSR and branch type selection via MSR_LBR_SELECT.", 173 "PublicDescription": "Counts when the Current Privilege Level (CPL) transitions from ring 1, 2 or 3 to ring 0 (Kernel).",
164 "EventCode": "0xCC", 174 "EventCode": "0x3C",
165 "Counter": "0,1,2,3", 175 "Counter": "0,1,2,3",
166 "UMask": "0x20", 176 "UMask": "0x0",
167 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS", 177 "EdgeDetect": "1",
168 "SampleAfterValue": "2000003", 178 "EventName": "CPU_CLK_UNHALTED.RING0_TRANS",
169 "BriefDescription": "Increments whenever there is an update to the LBR array.", 179 "SampleAfterValue": "100007",
180 "BriefDescription": "Counts when there is a transition from ring 1, 2 or 3 to ring 0.",
181 "CounterMask": "1",
170 "CounterHTOff": "0,1,2,3,4,5,6,7" 182 "CounterHTOff": "0,1,2,3,4,5,6,7"
171 }, 183 },
172 { 184 {
173 "PublicDescription": "Number of machine clears (nukes) of any type.", 185 "EventCode": "0x3C",
174 "EventCode": "0xC3",
175 "Counter": "0,1,2,3", 186 "Counter": "0,1,2,3",
176 "UMask": "0x1", 187 "UMask": "0x1",
177 "EdgeDetect": "1", 188 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK",
178 "EventName": "MACHINE_CLEARS.COUNT", 189 "SampleAfterValue": "2503",
179 "SampleAfterValue": "100003", 190 "BriefDescription": "Core crystal clock cycles when the thread is unhalted.",
180 "BriefDescription": "Number of machine clears (nukes) of any type. ",
181 "CounterMask": "1",
182 "CounterHTOff": "0,1,2,3,4,5,6,7" 191 "CounterHTOff": "0,1,2,3,4,5,6,7"
183 }, 192 },
184 { 193 {
185 "PublicDescription": "This event counts self-modifying code (SMC) detected, which causes a machine clear.", 194 "EventCode": "0x3C",
186 "EventCode": "0xC3",
187 "Counter": "0,1,2,3", 195 "Counter": "0,1,2,3",
188 "UMask": "0x4", 196 "UMask": "0x1",
189 "EventName": "MACHINE_CLEARS.SMC", 197 "AnyThread": "1",
190 "SampleAfterValue": "100003", 198 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY",
191 "BriefDescription": "Self-modifying code (SMC) detected.", 199 "SampleAfterValue": "2503",
200 "BriefDescription": "Core crystal clock cycles when at least one thread on the physical core is unhalted.",
192 "CounterHTOff": "0,1,2,3,4,5,6,7" 201 "CounterHTOff": "0,1,2,3,4,5,6,7"
193 }, 202 },
194 { 203 {
195 "PublicDescription": "This event counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).", 204 "EventCode": "0x3C",
196 "EventCode": "0xC0",
197 "Counter": "0,1,2,3", 205 "Counter": "0,1,2,3",
198 "UMask": "0x0", 206 "UMask": "0x1",
199 "Errata": "SKL091, SKL044", 207 "EventName": "CPU_CLK_UNHALTED.REF_XCLK",
200 "EventName": "INST_RETIRED.ANY_P", 208 "SampleAfterValue": "2503",
201 "SampleAfterValue": "2000003", 209 "BriefDescription": "Core crystal clock cycles when the thread is unhalted.",
202 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
203 "CounterHTOff": "0,1,2,3,4,5,6,7" 210 "CounterHTOff": "0,1,2,3,4,5,6,7"
204 }, 211 },
205 { 212 {
206 "PEBS": "2", 213 "EventCode": "0x3C",
207 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts instructions retired.", 214 "Counter": "0,1,2,3",
208 "EventCode": "0xC0",
209 "Counter": "1",
210 "UMask": "0x1", 215 "UMask": "0x1",
211 "Errata": "SKL091, SKL044", 216 "AnyThread": "1",
212 "EventName": "INST_RETIRED.PREC_DIST", 217 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY",
213 "SampleAfterValue": "2000003", 218 "SampleAfterValue": "2503",
214 "BriefDescription": "Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution", 219 "BriefDescription": "Core crystal clock cycles when at least one thread on the physical core is unhalted.",
215 "CounterHTOff": "1" 220 "CounterHTOff": "0,1,2,3,4,5,6,7"
216 }, 221 },
217 { 222 {
218 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts the number of retirement slots used.", 223 "EventCode": "0x3C",
219 "EventCode": "0xC2",
220 "Counter": "0,1,2,3", 224 "Counter": "0,1,2,3",
221 "UMask": "0x2", 225 "UMask": "0x2",
222 "EventName": "UOPS_RETIRED.RETIRE_SLOTS", 226 "EventName": "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE",
223 "SampleAfterValue": "2000003", 227 "SampleAfterValue": "2000003",
224 "BriefDescription": "Retirement slots used.", 228 "BriefDescription": "Core crystal clock cycles when this thread is unhalted and the other thread is halted.",
225 "CounterHTOff": "0,1,2,3,4,5,6,7" 229 "CounterHTOff": "0,1,2,3,4,5,6,7"
226 }, 230 },
227 { 231 {
228 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts cycles without actually retired uops.", 232 "EventCode": "0x3C",
229 "EventCode": "0xC2",
230 "Invert": "1",
231 "Counter": "0,1,2,3", 233 "Counter": "0,1,2,3",
232 "UMask": "0x1", 234 "UMask": "0x2",
233 "EventName": "UOPS_RETIRED.STALL_CYCLES", 235 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE",
234 "SampleAfterValue": "2000003", 236 "SampleAfterValue": "2503",
235 "BriefDescription": "Cycles without actually retired uops.", 237 "BriefDescription": "Core crystal clock cycles when this thread is unhalted and the other thread is halted.",
236 "CounterMask": "1",
237 "CounterHTOff": "0,1,2,3,4,5,6,7" 238 "CounterHTOff": "0,1,2,3,4,5,6,7"
238 }, 239 },
239 { 240 {
240 "PublicDescription": "Number of cycles using always true condition (uops_ret < 16) applied to non PEBS uops retired event.", 241 "PublicDescription": "Counts all not software-prefetch load dispatches that hit the fill buffer (FB) allocated for the software prefetch. It can also be incremented by some lock instructions. So it should only be used with profiling so that the locks can be excluded by ASM (Assembly File) inspection of the nearby instructions.",
241 "EventCode": "0xC2", 242 "EventCode": "0x4C",
242 "Invert": "1",
243 "Counter": "0,1,2,3", 243 "Counter": "0,1,2,3",
244 "UMask": "0x1", 244 "UMask": "0x1",
245 "EventName": "UOPS_RETIRED.TOTAL_CYCLES", 245 "EventName": "LOAD_HIT_PRE.SW_PF",
246 "SampleAfterValue": "2000003", 246 "SampleAfterValue": "100003",
247 "BriefDescription": "Cycles with less than 10 actually retired uops.", 247 "BriefDescription": "Demand load dispatches that hit L1D fill buffer (FB) allocated for software prefetch.",
248 "CounterMask": "10",
249 "CounterHTOff": "0,1,2,3,4,5,6,7" 248 "CounterHTOff": "0,1,2,3,4,5,6,7"
250 }, 249 },
251 { 250 {
252 "PEBS": "1", 251 "PublicDescription": "Counts cycles during which the reservation station (RS) is empty for the thread.; Note: In ST-mode, not active thread should drive 0. This is usually caused by severely costly branch mispredictions, or allocator/FE issues.",
253 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts conditional branch instructions retired.", 252 "EventCode": "0x5E",
254 "EventCode": "0xC4",
255 "Counter": "0,1,2,3", 253 "Counter": "0,1,2,3",
256 "UMask": "0x1", 254 "UMask": "0x1",
257 "Errata": "SKL091", 255 "EventName": "RS_EVENTS.EMPTY_CYCLES",
258 "EventName": "BR_INST_RETIRED.CONDITIONAL", 256 "SampleAfterValue": "2000003",
259 "SampleAfterValue": "400009", 257 "BriefDescription": "Cycles when Reservation Station (RS) is empty for the thread",
260 "BriefDescription": "Conditional branch instructions retired.",
261 "CounterHTOff": "0,1,2,3,4,5,6,7" 258 "CounterHTOff": "0,1,2,3,4,5,6,7"
262 }, 259 },
263 { 260 {
264 "PEBS": "1", 261 "PublicDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate front-end Latency Bound issues.",
265 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts both direct and indirect near call instructions retired.", 262 "EventCode": "0x5E",
266 "EventCode": "0xC4", 263 "Invert": "1",
267 "Counter": "0,1,2,3", 264 "Counter": "0,1,2,3",
268 "UMask": "0x2", 265 "UMask": "0x1",
269 "Errata": "SKL091", 266 "EdgeDetect": "1",
270 "EventName": "BR_INST_RETIRED.NEAR_CALL", 267 "EventName": "RS_EVENTS.EMPTY_END",
271 "SampleAfterValue": "100007", 268 "SampleAfterValue": "2000003",
272 "BriefDescription": "Direct and indirect near call instructions retired.", 269 "BriefDescription": "Counts end of periods where the Reservation Station (RS) was empty. Could be useful to precisely locate Frontend Latency Bound issues.",
270 "CounterMask": "1",
273 "CounterHTOff": "0,1,2,3,4,5,6,7" 271 "CounterHTOff": "0,1,2,3,4,5,6,7"
274 }, 272 },
275 { 273 {
276 "PublicDescription": "This event counts all (macro) branch instructions retired.", 274 "PublicDescription": "Counts cycles that the Instruction Length decoder (ILD) stalls occurred due to dynamically changing prefix length of the decoded instruction (by operand size prefix instruction 0x66, address size prefix instruction 0x67 or REX.W for Intel64). Count is proportional to the number of prefixes in a 16B-line. This may result in a three-cycle penalty for each LCP (Length changing prefix) in a 16-byte chunk.",
277 "EventCode": "0xC4", 275 "EventCode": "0x87",
278 "Counter": "0,1,2,3", 276 "Counter": "0,1,2,3",
279 "UMask": "0x0", 277 "UMask": "0x1",
280 "Errata": "SKL091", 278 "EventName": "ILD_STALL.LCP",
281 "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 279 "SampleAfterValue": "2000003",
282 "SampleAfterValue": "400009", 280 "BriefDescription": "Stalls caused by changing prefix length of the instruction.",
283 "BriefDescription": "All (macro) branch instructions retired.",
284 "CounterHTOff": "0,1,2,3,4,5,6,7" 281 "CounterHTOff": "0,1,2,3,4,5,6,7"
285 }, 282 },
286 { 283 {
287 "PEBS": "1", 284 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 0.",
288 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts return instructions retired.", 285 "EventCode": "0xA1",
289 "EventCode": "0xC4",
290 "Counter": "0,1,2,3", 286 "Counter": "0,1,2,3",
291 "UMask": "0x8", 287 "UMask": "0x1",
292 "Errata": "SKL091", 288 "EventName": "UOPS_DISPATCHED_PORT.PORT_0",
293 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 289 "SampleAfterValue": "2000003",
294 "SampleAfterValue": "100007", 290 "BriefDescription": "Cycles per thread when uops are executed in port 0",
295 "BriefDescription": "Return instructions retired.",
296 "CounterHTOff": "0,1,2,3,4,5,6,7" 291 "CounterHTOff": "0,1,2,3,4,5,6,7"
297 }, 292 },
298 { 293 {
299 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts not taken branch instructions retired.", 294 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 1.",
300 "EventCode": "0xC4", 295 "EventCode": "0xA1",
301 "Counter": "0,1,2,3", 296 "Counter": "0,1,2,3",
302 "UMask": "0x10", 297 "UMask": "0x2",
303 "Errata": "SKL091", 298 "EventName": "UOPS_DISPATCHED_PORT.PORT_1",
304 "EventName": "BR_INST_RETIRED.NOT_TAKEN", 299 "SampleAfterValue": "2000003",
305 "SampleAfterValue": "400009", 300 "BriefDescription": "Cycles per thread when uops are executed in port 1",
306 "BriefDescription": "Not taken branch instructions retired.",
307 "CounterHTOff": "0,1,2,3,4,5,6,7" 301 "CounterHTOff": "0,1,2,3,4,5,6,7"
308 }, 302 },
309 { 303 {
310 "PEBS": "1", 304 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 2.",
311 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts taken branch instructions retired.", 305 "EventCode": "0xA1",
312 "EventCode": "0xC4",
313 "Counter": "0,1,2,3", 306 "Counter": "0,1,2,3",
314 "UMask": "0x20", 307 "UMask": "0x4",
315 "Errata": "SKL091", 308 "EventName": "UOPS_DISPATCHED_PORT.PORT_2",
316 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 309 "SampleAfterValue": "2000003",
317 "SampleAfterValue": "400009", 310 "BriefDescription": "Cycles per thread when uops are executed in port 2",
318 "BriefDescription": "Taken branch instructions retired.",
319 "CounterHTOff": "0,1,2,3,4,5,6,7" 311 "CounterHTOff": "0,1,2,3,4,5,6,7"
320 }, 312 },
321 { 313 {
322 "PEBS": "1", 314 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 3.",
323 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts far branch instructions retired.", 315 "EventCode": "0xA1",
324 "EventCode": "0xC4",
325 "Counter": "0,1,2,3", 316 "Counter": "0,1,2,3",
326 "UMask": "0x40", 317 "UMask": "0x8",
327 "Errata": "SKL091", 318 "EventName": "UOPS_DISPATCHED_PORT.PORT_3",
328 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 319 "SampleAfterValue": "2000003",
329 "SampleAfterValue": "100007", 320 "BriefDescription": "Cycles per thread when uops are executed in port 3",
330 "BriefDescription": "Far branch instructions retired.",
331 "CounterHTOff": "0,1,2,3,4,5,6,7" 321 "CounterHTOff": "0,1,2,3,4,5,6,7"
332 }, 322 },
333 { 323 {
334 "PEBS": "2", 324 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 4.",
335 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.", 325 "EventCode": "0xA1",
336 "EventCode": "0xC4",
337 "Counter": "0,1,2,3",
338 "UMask": "0x4",
339 "Errata": "SKL091",
340 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
341 "SampleAfterValue": "400009",
342 "BriefDescription": "All (macro) branch instructions retired. ",
343 "CounterHTOff": "0,1,2,3"
344 },
345 {
346 "PEBS": "1",
347 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted conditional branch instructions retired.",
348 "EventCode": "0xC5",
349 "Counter": "0,1,2,3", 326 "Counter": "0,1,2,3",
350 "UMask": "0x1", 327 "UMask": "0x10",
351 "EventName": "BR_MISP_RETIRED.CONDITIONAL", 328 "EventName": "UOPS_DISPATCHED_PORT.PORT_4",
352 "SampleAfterValue": "400009", 329 "SampleAfterValue": "2000003",
353 "BriefDescription": "Mispredicted conditional branch instructions retired.", 330 "BriefDescription": "Cycles per thread when uops are executed in port 4",
354 "CounterHTOff": "0,1,2,3,4,5,6,7" 331 "CounterHTOff": "0,1,2,3,4,5,6,7"
355 }, 332 },
356 { 333 {
357 "PEBS": "1", 334 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 5.",
358 "PublicDescription": "This event counts both taken and not taken retired mispredicted direct and indirect near calls, including both register and memory indirect.", 335 "EventCode": "0xA1",
359 "EventCode": "0xC5",
360 "Counter": "0,1,2,3", 336 "Counter": "0,1,2,3",
361 "UMask": "0x2", 337 "UMask": "0x20",
362 "EventName": "BR_MISP_RETIRED.NEAR_CALL", 338 "EventName": "UOPS_DISPATCHED_PORT.PORT_5",
363 "SampleAfterValue": "400009", 339 "SampleAfterValue": "2000003",
364 "BriefDescription": "Mispredicted direct and indirect near call instructions retired.", 340 "BriefDescription": "Cycles per thread when uops are executed in port 5",
365 "CounterHTOff": "0,1,2,3,4,5,6,7" 341 "CounterHTOff": "0,1,2,3,4,5,6,7"
366 }, 342 },
367 { 343 {
368 "PublicDescription": "This event counts all mispredicted macro branch instructions retired.", 344 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 6.",
369 "EventCode": "0xC5", 345 "EventCode": "0xA1",
370 "Counter": "0,1,2,3", 346 "Counter": "0,1,2,3",
371 "UMask": "0x0", 347 "UMask": "0x40",
372 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES", 348 "EventName": "UOPS_DISPATCHED_PORT.PORT_6",
373 "SampleAfterValue": "400009", 349 "SampleAfterValue": "2000003",
374 "BriefDescription": "All mispredicted macro branch instructions retired.", 350 "BriefDescription": "Cycles per thread when uops are executed in port 6",
375 "CounterHTOff": "0,1,2,3,4,5,6,7" 351 "CounterHTOff": "0,1,2,3,4,5,6,7"
376 }, 352 },
377 { 353 {
378 "PEBS": "1", 354 "PublicDescription": "Counts, on the per-thread basis, cycles during which at least one uop is dispatched from the Reservation Station (RS) to port 7.",
379 "EventCode": "0xC5", 355 "EventCode": "0xA1",
380 "Counter": "0,1,2,3", 356 "Counter": "0,1,2,3",
381 "UMask": "0x20", 357 "UMask": "0x80",
382 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 358 "EventName": "UOPS_DISPATCHED_PORT.PORT_7",
383 "SampleAfterValue": "400009", 359 "SampleAfterValue": "2000003",
384 "BriefDescription": "Number of near branch instructions retired that were mispredicted and taken.", 360 "BriefDescription": "Cycles per thread when uops are executed in port 7",
385 "CounterHTOff": "0,1,2,3,4,5,6,7" 361 "CounterHTOff": "0,1,2,3,4,5,6,7"
386 }, 362 },
387 { 363 {
388 "PEBS": "2", 364 "PublicDescription": "Counts resource-related stall cycles. Reasons for stalls can be as follows:a. *any* u-arch structure got full (LB, SB, RS, ROB, BOB, LM, Physical Register Reclaim Table (PRRT), or Physical History Table (PHT) slots).b. *any* u-arch structure got empty (like INT/SIMD FreeLists).c. FPU control word (FPCW), MXCSR.and others. This counts cycles that the pipeline back-end blocked uop delivery from the front-end.",
389 "PublicDescription": "This is a precise version of BR_MISP_RETIRED.ALL_BRANCHES that counts all mispredicted macro branch instructions retired.", 365 "EventCode": "0xA2",
390 "EventCode": "0xC5",
391 "Counter": "0,1,2,3", 366 "Counter": "0,1,2,3",
392 "UMask": "0x4", 367 "UMask": "0x1",
393 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS", 368 "EventName": "RESOURCE_STALLS.ANY",
394 "SampleAfterValue": "400009", 369 "SampleAfterValue": "2000003",
395 "BriefDescription": "Mispredicted macro branch instructions retired. ", 370 "BriefDescription": "Resource-related stall cycles",
396 "CounterHTOff": "0,1,2,3" 371 "CounterHTOff": "0,1,2,3,4,5,6,7"
397 }, 372 },
398 { 373 {
399 "PublicDescription": "Number of uops to be executed per-thread each cycle.", 374 "PublicDescription": "Counts allocation stall cycles caused by the store buffer (SB) being full. This counts cycles that the pipeline back-end blocked uop delivery from the front-end.",
400 "EventCode": "0xB1", 375 "EventCode": "0xA2",
401 "Counter": "0,1,2,3", 376 "Counter": "0,1,2,3",
402 "UMask": "0x1", 377 "UMask": "0x8",
403 "EventName": "UOPS_EXECUTED.THREAD", 378 "EventName": "RESOURCE_STALLS.SB",
404 "SampleAfterValue": "2000003", 379 "SampleAfterValue": "2000003",
405 "BriefDescription": "Counts the number of uops to be executed per-thread each cycle.", 380 "BriefDescription": "Cycles stalled due to no store buffers available. (not including draining form sync).",
406 "CounterHTOff": "0,1,2,3,4,5,6,7" 381 "CounterHTOff": "0,1,2,3,4,5,6,7"
407 }, 382 },
408 { 383 {
409 "PublicDescription": "Number of uops executed from any thread.", 384 "EventCode": "0xA3",
410 "EventCode": "0xB1",
411 "Counter": "0,1,2,3", 385 "Counter": "0,1,2,3",
412 "UMask": "0x2", 386 "UMask": "0x1",
413 "EventName": "UOPS_EXECUTED.CORE", 387 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS",
414 "SampleAfterValue": "2000003", 388 "SampleAfterValue": "2000003",
415 "BriefDescription": "Number of uops executed on the core.", 389 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.",
390 "CounterMask": "1",
416 "CounterHTOff": "0,1,2,3,4,5,6,7" 391 "CounterHTOff": "0,1,2,3,4,5,6,7"
417 }, 392 },
418 { 393 {
419 "EventCode": "0xB1", 394 "EventCode": "0xA3",
420 "Counter": "0,1,2,3", 395 "Counter": "0,1,2,3",
421 "UMask": "0x10", 396 "UMask": "0x4",
422 "EventName": "UOPS_EXECUTED.X87", 397 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL",
423 "SampleAfterValue": "2000003", 398 "SampleAfterValue": "2000003",
424 "BriefDescription": "Counts the number of x87 uops dispatched.", 399 "BriefDescription": "Total execution stalls.",
400 "CounterMask": "4",
425 "CounterHTOff": "0,1,2,3,4,5,6,7" 401 "CounterHTOff": "0,1,2,3,4,5,6,7"
426 }, 402 },
427 { 403 {
428 "PublicDescription": "This event counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.", 404 "EventCode": "0xA3",
429 "EventCode": "0xB1",
430 "Invert": "1",
431 "Counter": "0,1,2,3", 405 "Counter": "0,1,2,3",
432 "UMask": "0x1", 406 "UMask": "0x5",
433 "EventName": "UOPS_EXECUTED.STALL_CYCLES", 407 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS",
434 "SampleAfterValue": "2000003", 408 "SampleAfterValue": "2000003",
435 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.", 409 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.",
436 "CounterMask": "1", 410 "CounterMask": "5",
437 "CounterHTOff": "0,1,2,3,4,5,6,7" 411 "CounterHTOff": "0,1,2,3,4,5,6,7"
438 }, 412 },
439 { 413 {
440 "PublicDescription": "Cycles where at least 1 uop was executed per-thread.", 414 "EventCode": "0xA3",
441 "EventCode": "0xB1",
442 "Counter": "0,1,2,3", 415 "Counter": "0,1,2,3",
443 "UMask": "0x1", 416 "UMask": "0x8",
444 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC", 417 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS",
445 "SampleAfterValue": "2000003", 418 "SampleAfterValue": "2000003",
446 "BriefDescription": "Cycles where at least 1 uop was executed per-thread", 419 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.",
447 "CounterMask": "1", 420 "CounterMask": "8",
448 "CounterHTOff": "0,1,2,3,4,5,6,7" 421 "CounterHTOff": "0,1,2,3,4,5,6,7"
449 }, 422 },
450 { 423 {
451 "PublicDescription": "Cycles where at least 2 uops were executed per-thread.", 424 "EventCode": "0xA3",
452 "EventCode": "0xB1",
453 "Counter": "0,1,2,3", 425 "Counter": "0,1,2,3",
454 "UMask": "0x1", 426 "UMask": "0xc",
455 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC", 427 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS",
456 "SampleAfterValue": "2000003", 428 "SampleAfterValue": "2000003",
457 "BriefDescription": "Cycles where at least 2 uops were executed per-thread", 429 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.",
458 "CounterMask": "2", 430 "CounterMask": "12",
459 "CounterHTOff": "0,1,2,3,4,5,6,7" 431 "CounterHTOff": "0,1,2,3,4,5,6,7"
460 }, 432 },
461 { 433 {
462 "PublicDescription": "Cycles where at least 3 uops were executed per-thread.", 434 "EventCode": "0xA3",
463 "EventCode": "0xB1",
464 "Counter": "0,1,2,3", 435 "Counter": "0,1,2,3",
465 "UMask": "0x1", 436 "UMask": "0x10",
466 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC", 437 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY",
467 "SampleAfterValue": "2000003", 438 "SampleAfterValue": "2000003",
468 "BriefDescription": "Cycles where at least 3 uops were executed per-thread", 439 "BriefDescription": "Cycles while memory subsystem has an outstanding load.",
469 "CounterMask": "3", 440 "CounterMask": "16",
470 "CounterHTOff": "0,1,2,3,4,5,6,7" 441 "CounterHTOff": "0,1,2,3,4,5,6,7"
471 }, 442 },
472 { 443 {
473 "PublicDescription": "Cycles where at least 4 uops were executed per-thread.", 444 "EventCode": "0xA3",
474 "EventCode": "0xB1",
475 "Counter": "0,1,2,3", 445 "Counter": "0,1,2,3",
476 "UMask": "0x1", 446 "UMask": "0x14",
477 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC", 447 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY",
478 "SampleAfterValue": "2000003", 448 "SampleAfterValue": "2000003",
479 "BriefDescription": "Cycles where at least 4 uops were executed per-thread", 449 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.",
480 "CounterMask": "4", 450 "CounterMask": "20",
481 "CounterHTOff": "0,1,2,3,4,5,6,7" 451 "CounterHTOff": "0,1,2,3"
482 }, 452 },
483 { 453 {
454 "PublicDescription": "Counts cycles during which no uops were executed on all ports and Reservation Station (RS) was not empty.",
484 "EventCode": "0xA6", 455 "EventCode": "0xA6",
485 "Counter": "0,1,2,3", 456 "Counter": "0,1,2,3",
486 "UMask": "0x1", 457 "UMask": "0x1",
@@ -490,6 +461,7 @@
490 "CounterHTOff": "0,1,2,3,4,5,6,7" 461 "CounterHTOff": "0,1,2,3,4,5,6,7"
491 }, 462 },
492 { 463 {
464 "PublicDescription": "Counts cycles during which a total of 1 uop was executed on all ports and Reservation Station (RS) was not empty.",
493 "EventCode": "0xA6", 465 "EventCode": "0xA6",
494 "Counter": "0,1,2,3", 466 "Counter": "0,1,2,3",
495 "UMask": "0x2", 467 "UMask": "0x2",
@@ -499,6 +471,7 @@
499 "CounterHTOff": "0,1,2,3,4,5,6,7" 471 "CounterHTOff": "0,1,2,3,4,5,6,7"
500 }, 472 },
501 { 473 {
474 "PublicDescription": "Counts cycles during which a total of 2 uops were executed on all ports and Reservation Station (RS) was not empty.",
502 "EventCode": "0xA6", 475 "EventCode": "0xA6",
503 "Counter": "0,1,2,3", 476 "Counter": "0,1,2,3",
504 "UMask": "0x4", 477 "UMask": "0x4",
@@ -508,6 +481,7 @@
508 "CounterHTOff": "0,1,2,3,4,5,6,7" 481 "CounterHTOff": "0,1,2,3,4,5,6,7"
509 }, 482 },
510 { 483 {
484 "PublicDescription": "Cycles total of 3 uops are executed on all ports and Reservation Station (RS) was not empty.",
511 "EventCode": "0xA6", 485 "EventCode": "0xA6",
512 "Counter": "0,1,2,3", 486 "Counter": "0,1,2,3",
513 "UMask": "0x8", 487 "UMask": "0x8",
@@ -517,6 +491,7 @@
517 "CounterHTOff": "0,1,2,3,4,5,6,7" 491 "CounterHTOff": "0,1,2,3,4,5,6,7"
518 }, 492 },
519 { 493 {
494 "PublicDescription": "Cycles total of 4 uops are executed on all ports and Reservation Station (RS) was not empty.",
520 "EventCode": "0xA6", 495 "EventCode": "0xA6",
521 "Counter": "0,1,2,3", 496 "Counter": "0,1,2,3",
522 "UMask": "0x10", 497 "UMask": "0x10",
@@ -535,212 +510,196 @@
535 "CounterHTOff": "0,1,2,3,4,5,6,7" 510 "CounterHTOff": "0,1,2,3,4,5,6,7"
536 }, 511 },
537 { 512 {
538 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 0.", 513 "PublicDescription": "Number of uops delivered to the back-end by the LSD(Loop Stream Detector).",
539 "EventCode": "0xA1", 514 "EventCode": "0xA8",
540 "Counter": "0,1,2,3", 515 "Counter": "0,1,2,3",
541 "UMask": "0x1", 516 "UMask": "0x1",
542 "EventName": "UOPS_DISPATCHED_PORT.PORT_0", 517 "EventName": "LSD.UOPS",
543 "SampleAfterValue": "2000003", 518 "SampleAfterValue": "2000003",
544 "BriefDescription": "Cycles per thread when uops are executed in port 0", 519 "BriefDescription": "Number of Uops delivered by the LSD.",
545 "CounterHTOff": "0,1,2,3,4,5,6,7" 520 "CounterHTOff": "0,1,2,3,4,5,6,7"
546 }, 521 },
547 { 522 {
548 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 1.", 523 "PublicDescription": "Counts the cycles when at least one uop is delivered by the LSD (Loop-stream detector).",
549 "EventCode": "0xA1", 524 "EventCode": "0xA8",
550 "Counter": "0,1,2,3", 525 "Counter": "0,1,2,3",
551 "UMask": "0x2", 526 "UMask": "0x1",
552 "EventName": "UOPS_DISPATCHED_PORT.PORT_1", 527 "EventName": "LSD.CYCLES_ACTIVE",
553 "SampleAfterValue": "2000003", 528 "SampleAfterValue": "2000003",
554 "BriefDescription": "Cycles per thread when uops are executed in port 1", 529 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.",
530 "CounterMask": "1",
555 "CounterHTOff": "0,1,2,3,4,5,6,7" 531 "CounterHTOff": "0,1,2,3,4,5,6,7"
556 }, 532 },
557 { 533 {
558 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 2.", 534 "PublicDescription": "Counts the cycles when 4 uops are delivered by the LSD (Loop-stream detector).",
559 "EventCode": "0xA1", 535 "EventCode": "0xA8",
560 "Counter": "0,1,2,3", 536 "Counter": "0,1,2,3",
561 "UMask": "0x4", 537 "UMask": "0x1",
562 "EventName": "UOPS_DISPATCHED_PORT.PORT_2", 538 "EventName": "LSD.CYCLES_4_UOPS",
563 "SampleAfterValue": "2000003", 539 "SampleAfterValue": "2000003",
564 "BriefDescription": "Cycles per thread when uops are executed in port 2", 540 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.",
541 "CounterMask": "4",
565 "CounterHTOff": "0,1,2,3,4,5,6,7" 542 "CounterHTOff": "0,1,2,3,4,5,6,7"
566 }, 543 },
567 { 544 {
568 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 3.", 545 "PublicDescription": "Number of uops to be executed per-thread each cycle.",
569 "EventCode": "0xA1", 546 "EventCode": "0xB1",
570 "Counter": "0,1,2,3", 547 "Counter": "0,1,2,3",
571 "UMask": "0x8", 548 "UMask": "0x1",
572 "EventName": "UOPS_DISPATCHED_PORT.PORT_3", 549 "EventName": "UOPS_EXECUTED.THREAD",
573 "SampleAfterValue": "2000003", 550 "SampleAfterValue": "2000003",
574 "BriefDescription": "Cycles per thread when uops are executed in port 3", 551 "BriefDescription": "Counts the number of uops to be executed per-thread each cycle.",
575 "CounterHTOff": "0,1,2,3,4,5,6,7" 552 "CounterHTOff": "0,1,2,3,4,5,6,7"
576 }, 553 },
577 { 554 {
578 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 4.", 555 "PublicDescription": "Counts cycles during which no uops were dispatched from the Reservation Station (RS) per thread.",
579 "EventCode": "0xA1", 556 "EventCode": "0xB1",
557 "Invert": "1",
580 "Counter": "0,1,2,3", 558 "Counter": "0,1,2,3",
581 "UMask": "0x10", 559 "UMask": "0x1",
582 "EventName": "UOPS_DISPATCHED_PORT.PORT_4", 560 "EventName": "UOPS_EXECUTED.STALL_CYCLES",
583 "SampleAfterValue": "2000003", 561 "SampleAfterValue": "2000003",
584 "BriefDescription": "Cycles per thread when uops are executed in port 4", 562 "BriefDescription": "Counts number of cycles no uops were dispatched to be executed on this thread.",
563 "CounterMask": "1",
585 "CounterHTOff": "0,1,2,3,4,5,6,7" 564 "CounterHTOff": "0,1,2,3,4,5,6,7"
586 }, 565 },
587 { 566 {
588 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 5.", 567 "PublicDescription": "Cycles where at least 1 uop was executed per-thread.",
589 "EventCode": "0xA1", 568 "EventCode": "0xB1",
590 "Counter": "0,1,2,3", 569 "Counter": "0,1,2,3",
591 "UMask": "0x20", 570 "UMask": "0x1",
592 "EventName": "UOPS_DISPATCHED_PORT.PORT_5", 571 "EventName": "UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC",
593 "SampleAfterValue": "2000003", 572 "SampleAfterValue": "2000003",
594 "BriefDescription": "Cycles per thread when uops are executed in port 5", 573 "BriefDescription": "Cycles where at least 1 uop was executed per-thread",
574 "CounterMask": "1",
595 "CounterHTOff": "0,1,2,3,4,5,6,7" 575 "CounterHTOff": "0,1,2,3,4,5,6,7"
596 }, 576 },
597 { 577 {
598 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 6.", 578 "PublicDescription": "Cycles where at least 2 uops were executed per-thread.",
599 "EventCode": "0xA1", 579 "EventCode": "0xB1",
600 "Counter": "0,1,2,3", 580 "Counter": "0,1,2,3",
601 "UMask": "0x40", 581 "UMask": "0x1",
602 "EventName": "UOPS_DISPATCHED_PORT.PORT_6", 582 "EventName": "UOPS_EXECUTED.CYCLES_GE_2_UOPS_EXEC",
603 "SampleAfterValue": "2000003", 583 "SampleAfterValue": "2000003",
604 "BriefDescription": "Cycles per thread when uops are executed in port 6", 584 "BriefDescription": "Cycles where at least 2 uops were executed per-thread",
585 "CounterMask": "2",
605 "CounterHTOff": "0,1,2,3,4,5,6,7" 586 "CounterHTOff": "0,1,2,3,4,5,6,7"
606 }, 587 },
607 { 588 {
608 "PublicDescription": "This event counts, on the per-thread basis, cycles during which uops are dispatched from the Reservation Station (RS) to port 7.", 589 "PublicDescription": "Cycles where at least 3 uops were executed per-thread.",
609 "EventCode": "0xA1", 590 "EventCode": "0xB1",
610 "Counter": "0,1,2,3", 591 "Counter": "0,1,2,3",
611 "UMask": "0x80", 592 "UMask": "0x1",
612 "EventName": "UOPS_DISPATCHED_PORT.PORT_7", 593 "EventName": "UOPS_EXECUTED.CYCLES_GE_3_UOPS_EXEC",
613 "SampleAfterValue": "2000003", 594 "SampleAfterValue": "2000003",
614 "BriefDescription": "Cycles per thread when uops are executed in port 7", 595 "BriefDescription": "Cycles where at least 3 uops were executed per-thread",
596 "CounterMask": "3",
615 "CounterHTOff": "0,1,2,3,4,5,6,7" 597 "CounterHTOff": "0,1,2,3,4,5,6,7"
616 }, 598 },
617 { 599 {
618 "EventCode": "0xA3", 600 "PublicDescription": "Cycles where at least 4 uops were executed per-thread.",
601 "EventCode": "0xB1",
619 "Counter": "0,1,2,3", 602 "Counter": "0,1,2,3",
620 "UMask": "0x4", 603 "UMask": "0x1",
621 "EventName": "CYCLE_ACTIVITY.STALLS_TOTAL", 604 "EventName": "UOPS_EXECUTED.CYCLES_GE_4_UOPS_EXEC",
622 "SampleAfterValue": "2000003", 605 "SampleAfterValue": "2000003",
623 "BriefDescription": "Total execution stalls.", 606 "BriefDescription": "Cycles where at least 4 uops were executed per-thread",
624 "CounterMask": "4", 607 "CounterMask": "4",
625 "CounterHTOff": "0,1,2,3,4,5,6,7" 608 "CounterHTOff": "0,1,2,3,4,5,6,7"
626 }, 609 },
627 { 610 {
628 "EventCode": "0xA3", 611 "PublicDescription": "Number of uops executed from any thread.",
612 "EventCode": "0xB1",
629 "Counter": "0,1,2,3", 613 "Counter": "0,1,2,3",
630 "UMask": "0x8", 614 "UMask": "0x2",
631 "EventName": "CYCLE_ACTIVITY.CYCLES_L1D_MISS", 615 "EventName": "UOPS_EXECUTED.CORE",
632 "SampleAfterValue": "2000003", 616 "SampleAfterValue": "2000003",
633 "BriefDescription": "Cycles while L1 cache miss demand load is outstanding.", 617 "BriefDescription": "Number of uops executed on the core.",
634 "CounterMask": "8",
635 "CounterHTOff": "0,1,2,3,4,5,6,7" 618 "CounterHTOff": "0,1,2,3,4,5,6,7"
636 }, 619 },
637 { 620 {
638 "EventCode": "0xA3", 621 "EventCode": "0xB1",
639 "Counter": "0,1,2,3", 622 "Counter": "0,1,2,3",
640 "UMask": "0xc", 623 "UMask": "0x2",
641 "EventName": "CYCLE_ACTIVITY.STALLS_L1D_MISS", 624 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1",
642 "SampleAfterValue": "2000003", 625 "SampleAfterValue": "2000003",
643 "BriefDescription": "Execution stalls while L1 cache miss demand load is outstanding.", 626 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.",
644 "CounterMask": "12", 627 "CounterMask": "1",
645 "CounterHTOff": "0,1,2,3,4,5,6,7"
646 },
647 {
648 "PublicDescription": "This event counts all not software-prefetch load dispatches that hit the fill buffer (FB) allocated for the software prefetch. It can also be incremented by some lock instructions. So it should only be used with profiling so that the locks can be excluded by asm inspection of the nearby instructions.",
649 "EventCode": "0x4C",
650 "Counter": "0,1,2,3",
651 "UMask": "0x1",
652 "EventName": "LOAD_HIT_PRE.SW_PF",
653 "SampleAfterValue": "100003",
654 "BriefDescription": "Demand load dispatches that hit L1D fill buffer (FB) allocated for software prefetch.",
655 "CounterHTOff": "0,1,2,3,4,5,6,7" 628 "CounterHTOff": "0,1,2,3,4,5,6,7"
656 }, 629 },
657 { 630 {
658 "PublicDescription": "This event counts how many times the load operation got the true Block-on-Store blocking code preventing store forwarding. This includes cases when:\n - preceding store conflicts with the load (incomplete overlap)\n\n - store forwarding is impossible due to u-arch limitations\n\n - preceding lock RMW operations are not forwarded\n\n - store has the no-forward bit set (uncacheable/page-split/masked stores)\n\n - all-blocking stores are used (mostly, fences and port I/O)\n\nand others.\nThe most common case is a load blocked due to its address range overlapping with a preceding smaller uncompleted store. Note: This event does not take into account cases of out-of-SW-control (for example, SbTailHit), unknown physical STA, and cases of blocking loads on store due to being non-WB memory type or a lock. These cases are covered by other events.\nSee the table of not supported store forwards in the Optimization Guide.", 631 "EventCode": "0xB1",
659 "EventCode": "0x03",
660 "Counter": "0,1,2,3", 632 "Counter": "0,1,2,3",
661 "UMask": "0x2", 633 "UMask": "0x2",
662 "EventName": "LD_BLOCKS.STORE_FORWARD", 634 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2",
663 "SampleAfterValue": "100003", 635 "SampleAfterValue": "2000003",
664 "BriefDescription": "Loads blocked by overlapping with store buffer that cannot be forwarded .", 636 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.",
665 "CounterHTOff": "0,1,2,3,4,5,6,7" 637 "CounterMask": "2",
666 },
667 {
668 "PublicDescription": "The number of times that split load operations are temporarily blocked because all resources for handling the split accesses are in use.",
669 "EventCode": "0x03",
670 "Counter": "0,1,2,3",
671 "UMask": "0x8",
672 "EventName": "LD_BLOCKS.NO_SR",
673 "SampleAfterValue": "100003",
674 "BriefDescription": "The number of times that split load operations are temporarily blocked because all resources for handling the split accesses are in use",
675 "CounterHTOff": "0,1,2,3,4,5,6,7" 638 "CounterHTOff": "0,1,2,3,4,5,6,7"
676 }, 639 },
677 { 640 {
678 "PublicDescription": "This event counts false dependencies in MOB when the partial comparison upon loose net check and dependency was resolved by the Enhanced Loose net mechanism. This may not result in high performance penalties. Loose net checks can fail when loads and stores are 4k aliased.", 641 "EventCode": "0xB1",
679 "EventCode": "0x07",
680 "Counter": "0,1,2,3", 642 "Counter": "0,1,2,3",
681 "UMask": "0x1", 643 "UMask": "0x2",
682 "EventName": "LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", 644 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3",
683 "SampleAfterValue": "100003", 645 "SampleAfterValue": "2000003",
684 "BriefDescription": "False dependencies in MOB due to partial compare on address.", 646 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.",
647 "CounterMask": "3",
685 "CounterHTOff": "0,1,2,3,4,5,6,7" 648 "CounterHTOff": "0,1,2,3,4,5,6,7"
686 }, 649 },
687 { 650 {
688 "EventCode": "0xA3", 651 "EventCode": "0xB1",
689 "Counter": "0,1,2,3", 652 "Counter": "0,1,2,3",
690 "UMask": "0x1", 653 "UMask": "0x2",
691 "EventName": "CYCLE_ACTIVITY.CYCLES_L2_MISS", 654 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4",
692 "SampleAfterValue": "2000003", 655 "SampleAfterValue": "2000003",
693 "BriefDescription": "Cycles while L2 cache miss demand load is outstanding.", 656 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.",
694 "CounterMask": "1", 657 "CounterMask": "4",
695 "CounterHTOff": "0,1,2,3,4,5,6,7" 658 "CounterHTOff": "0,1,2,3,4,5,6,7"
696 }, 659 },
697 { 660 {
698 "EventCode": "0xA3", 661 "EventCode": "0xB1",
662 "Invert": "1",
699 "Counter": "0,1,2,3", 663 "Counter": "0,1,2,3",
700 "UMask": "0x5", 664 "UMask": "0x2",
701 "EventName": "CYCLE_ACTIVITY.STALLS_L2_MISS", 665 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE",
702 "SampleAfterValue": "2000003", 666 "SampleAfterValue": "2000003",
703 "BriefDescription": "Execution stalls while L2 cache miss demand load is outstanding.", 667 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.",
704 "CounterMask": "5", 668 "CounterMask": "1",
705 "CounterHTOff": "0,1,2,3,4,5,6,7" 669 "CounterHTOff": "0,1,2,3,4,5,6,7"
706 }, 670 },
707 { 671 {
708 "EventCode": "0xA3", 672 "PublicDescription": "Counts the number of x87 uops executed.",
673 "EventCode": "0xB1",
709 "Counter": "0,1,2,3", 674 "Counter": "0,1,2,3",
710 "UMask": "0x10", 675 "UMask": "0x10",
711 "EventName": "CYCLE_ACTIVITY.CYCLES_MEM_ANY", 676 "EventName": "UOPS_EXECUTED.X87",
712 "SampleAfterValue": "2000003", 677 "SampleAfterValue": "2000003",
713 "BriefDescription": "Cycles while memory subsystem has an outstanding load.", 678 "BriefDescription": "Counts the number of x87 uops dispatched.",
714 "CounterMask": "16",
715 "CounterHTOff": "0,1,2,3,4,5,6,7" 679 "CounterHTOff": "0,1,2,3,4,5,6,7"
716 }, 680 },
717 { 681 {
718 "EventCode": "0xA3", 682 "PublicDescription": "Counts the number of instructions (EOMs) retired. Counting covers macro-fused instructions individually (that is, increments by two).",
683 "EventCode": "0xC0",
719 "Counter": "0,1,2,3", 684 "Counter": "0,1,2,3",
720 "UMask": "0x14", 685 "UMask": "0x0",
721 "EventName": "CYCLE_ACTIVITY.STALLS_MEM_ANY", 686 "Errata": "SKL091, SKL044",
687 "EventName": "INST_RETIRED.ANY_P",
722 "SampleAfterValue": "2000003", 688 "SampleAfterValue": "2000003",
723 "BriefDescription": "Execution stalls while memory subsystem has an outstanding load.", 689 "BriefDescription": "Number of instructions retired. General Counter - architectural event",
724 "CounterMask": "20",
725 "CounterHTOff": "0,1,2,3"
726 },
727 {
728 "EventCode": "0x3C",
729 "Counter": "0,1,2,3",
730 "UMask": "0x1",
731 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK",
732 "SampleAfterValue": "2503",
733 "BriefDescription": "Core crystal clock cycles when the thread is unhalted.",
734 "CounterHTOff": "0,1,2,3,4,5,6,7" 690 "CounterHTOff": "0,1,2,3,4,5,6,7"
735 }, 691 },
736 { 692 {
737 "EventCode": "0x3C", 693 "PEBS": "2",
738 "Counter": "0,1,2,3", 694 "PublicDescription": "A version of INST_RETIRED that allows for a more unbiased distribution of samples across instructions retired. It utilizes the Precise Distribution of Instructions Retired (PDIR) feature to mitigate some bias in how retired instructions get sampled.",
739 "UMask": "0x2", 695 "EventCode": "0xC0",
740 "EventName": "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE", 696 "Counter": "1",
697 "UMask": "0x1",
698 "Errata": "SKL091, SKL044",
699 "EventName": "INST_RETIRED.PREC_DIST",
741 "SampleAfterValue": "2000003", 700 "SampleAfterValue": "2000003",
742 "BriefDescription": "Core crystal clock cycles when this thread is unhalted and the other thread is halted.", 701 "BriefDescription": "Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution",
743 "CounterHTOff": "0,1,2,3,4,5,6,7" 702 "CounterHTOff": "1"
744 }, 703 },
745 { 704 {
746 "PEBS": "2", 705 "PEBS": "2",
@@ -757,183 +716,235 @@
757 "CounterHTOff": "0,2,3" 716 "CounterHTOff": "0,2,3"
758 }, 717 },
759 { 718 {
760 "EventCode": "0x14", 719 "EventCode": "0xC1",
761 "Counter": "0,1,2,3", 720 "Counter": "0,1,2,3",
762 "UMask": "0x1", 721 "UMask": "0x3f",
763 "EventName": "ARITH.DIVIDER_ACTIVE", 722 "EventName": "OTHER_ASSISTS.ANY",
723 "SampleAfterValue": "100003",
724 "BriefDescription": "Number of times a microcode assist is invoked by HW other than FP-assist. Examples include AD (page Access Dirty) and AVX* related assists.",
725 "CounterHTOff": "0,1,2,3,4,5,6,7"
726 },
727 {
728 "PublicDescription": "Counts the retirement slots used.",
729 "EventCode": "0xC2",
730 "Counter": "0,1,2,3",
731 "UMask": "0x2",
732 "EventName": "UOPS_RETIRED.RETIRE_SLOTS",
764 "SampleAfterValue": "2000003", 733 "SampleAfterValue": "2000003",
765 "BriefDescription": "Cycles when divide unit is busy executing divide or square root operations. Accounts for integer and floating-point operations.", 734 "BriefDescription": "Retirement slots used.",
766 "CounterMask": "1",
767 "CounterHTOff": "0,1,2,3,4,5,6,7" 735 "CounterHTOff": "0,1,2,3,4,5,6,7"
768 }, 736 },
769 { 737 {
770 "EventCode": "0xA8", 738 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts cycles without actually retired uops.",
739 "EventCode": "0xC2",
740 "Invert": "1",
771 "Counter": "0,1,2,3", 741 "Counter": "0,1,2,3",
772 "UMask": "0x1", 742 "UMask": "0x2",
773 "EventName": "LSD.CYCLES_ACTIVE", 743 "EventName": "UOPS_RETIRED.STALL_CYCLES",
774 "SampleAfterValue": "2000003", 744 "SampleAfterValue": "2000003",
775 "BriefDescription": "Cycles Uops delivered by the LSD, but didn't come from the decoder.", 745 "BriefDescription": "Cycles without actually retired uops.",
776 "CounterMask": "1", 746 "CounterMask": "1",
777 "CounterHTOff": "0,1,2,3,4,5,6,7" 747 "CounterHTOff": "0,1,2,3,4,5,6,7"
778 }, 748 },
779 { 749 {
780 "EventCode": "0xA8", 750 "PublicDescription": "Number of cycles using always true condition (uops_ret < 16) applied to non PEBS uops retired event.",
751 "EventCode": "0xC2",
752 "Invert": "1",
781 "Counter": "0,1,2,3", 753 "Counter": "0,1,2,3",
782 "UMask": "0x1", 754 "UMask": "0x2",
783 "EventName": "LSD.CYCLES_4_UOPS", 755 "EventName": "UOPS_RETIRED.TOTAL_CYCLES",
784 "SampleAfterValue": "2000003", 756 "SampleAfterValue": "2000003",
785 "BriefDescription": "Cycles 4 Uops delivered by the LSD, but didn't come from the decoder.", 757 "BriefDescription": "Cycles with less than 10 actually retired uops.",
786 "CounterMask": "4", 758 "CounterMask": "10",
787 "CounterHTOff": "0,1,2,3,4,5,6,7" 759 "CounterHTOff": "0,1,2,3,4,5,6,7"
788 }, 760 },
789 { 761 {
790 "EventCode": "0xC1", 762 "EventCode": "0xC3",
791 "Counter": "0,1,2,3", 763 "Counter": "0,1,2,3",
792 "UMask": "0x3f", 764 "UMask": "0x1",
793 "EventName": "OTHER_ASSISTS.ANY", 765 "EdgeDetect": "1",
766 "EventName": "MACHINE_CLEARS.COUNT",
794 "SampleAfterValue": "100003", 767 "SampleAfterValue": "100003",
795 "BriefDescription": "Number of times a microcode assist is invoked by HW other than FP-assist. Examples include AD (page Access Dirty) and AVX* related assists.", 768 "BriefDescription": "Number of machine clears (nukes) of any type.",
769 "CounterMask": "1",
796 "CounterHTOff": "0,1,2,3,4,5,6,7" 770 "CounterHTOff": "0,1,2,3,4,5,6,7"
797 }, 771 },
798 { 772 {
799 "PublicDescription": "This event counts the number of Blend Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS) in order to preserve upper bits of vector registers. Starting the Skylake microarchitecture, these Blend uops are needed since every Intel SSE instruction executed in Dirty Upper State needs to preserve bits 128-255 of the destination register.\r\nFor more information, refer to ?Mixing Intel AVX and Intel SSE Code? section of the Optimization Guide.", 773 "PublicDescription": "Counts self-modifying code (SMC) detected, which causes a machine clear.",
800 "EventCode": "0x0E", 774 "EventCode": "0xC3",
801 "Counter": "0,1,2,3", 775 "Counter": "0,1,2,3",
802 "UMask": "0x2", 776 "UMask": "0x4",
803 "EventName": "UOPS_ISSUED.VECTOR_WIDTH_MISMATCH", 777 "EventName": "MACHINE_CLEARS.SMC",
804 "SampleAfterValue": "2000003", 778 "SampleAfterValue": "100003",
805 "BriefDescription": "Uops inserted at issue-stage in order to preserve upper bits of vector registers.", 779 "BriefDescription": "Self-modifying code (SMC) detected.",
806 "CounterHTOff": "0,1,2,3,4,5,6,7" 780 "CounterHTOff": "0,1,2,3,4,5,6,7"
807 }, 781 },
808 { 782 {
809 "EventCode": "0x00", 783 "PublicDescription": "Counts all (macro) branch instructions retired.",
810 "Counter": "Fixed counter 2", 784 "EventCode": "0xC4",
811 "UMask": "0x2",
812 "AnyThread": "1",
813 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
814 "SampleAfterValue": "2000003",
815 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
816 "CounterHTOff": "Fixed counter 2"
817 },
818 {
819 "EventCode": "0x3C",
820 "Counter": "0,1,2,3", 785 "Counter": "0,1,2,3",
821 "UMask": "0x0", 786 "UMask": "0x0",
822 "AnyThread": "1", 787 "Errata": "SKL091",
823 "EventName": "CPU_CLK_UNHALTED.THREAD_P_ANY", 788 "EventName": "BR_INST_RETIRED.ALL_BRANCHES",
824 "SampleAfterValue": "2000003", 789 "SampleAfterValue": "400009",
825 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.", 790 "BriefDescription": "All (macro) branch instructions retired.",
826 "CounterHTOff": "0,1,2,3,4,5,6,7" 791 "CounterHTOff": "0,1,2,3,4,5,6,7"
827 }, 792 },
828 { 793 {
829 "EventCode": "0x3C", 794 "PEBS": "1",
795 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts conditional branch instructions retired.",
796 "EventCode": "0xC4",
830 "Counter": "0,1,2,3", 797 "Counter": "0,1,2,3",
831 "UMask": "0x1", 798 "UMask": "0x1",
832 "AnyThread": "1", 799 "Errata": "SKL091",
833 "EventName": "CPU_CLK_THREAD_UNHALTED.REF_XCLK_ANY", 800 "EventName": "BR_INST_RETIRED.CONDITIONAL",
834 "SampleAfterValue": "2503", 801 "SampleAfterValue": "400009",
835 "BriefDescription": "Core crystal clock cycles when at least one thread on the physical core is unhalted.", 802 "BriefDescription": "Conditional branch instructions retired.",
836 "CounterHTOff": "0,1,2,3,4,5,6,7" 803 "CounterHTOff": "0,1,2,3,4,5,6,7"
837 }, 804 },
838 { 805 {
839 "EventCode": "0x0D", 806 "PEBS": "1",
807 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect near call instructions retired.",
808 "EventCode": "0xC4",
840 "Counter": "0,1,2,3", 809 "Counter": "0,1,2,3",
841 "UMask": "0x1", 810 "UMask": "0x2",
842 "AnyThread": "1", 811 "Errata": "SKL091",
843 "EventName": "INT_MISC.RECOVERY_CYCLES_ANY", 812 "EventName": "BR_INST_RETIRED.NEAR_CALL",
844 "SampleAfterValue": "2000003", 813 "SampleAfterValue": "100007",
845 "BriefDescription": "Core cycles the allocator was stalled due to recovery from earlier clear event for any thread running on the physical core (e.g. misprediction or memory nuke).", 814 "BriefDescription": "Direct and indirect near call instructions retired.",
846 "CounterHTOff": "0,1,2,3,4,5,6,7" 815 "CounterHTOff": "0,1,2,3,4,5,6,7"
847 }, 816 },
848 { 817 {
849 "EventCode": "0xB1", 818 "PEBS": "2",
819 "PublicDescription": "This is a precise version of BR_INST_RETIRED.ALL_BRANCHES that counts all (macro) branch instructions retired.",
820 "EventCode": "0xC4",
850 "Counter": "0,1,2,3", 821 "Counter": "0,1,2,3",
851 "UMask": "0x2", 822 "UMask": "0x4",
852 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_1", 823 "Errata": "SKL091",
853 "SampleAfterValue": "2000003", 824 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
854 "BriefDescription": "Cycles at least 1 micro-op is executed from any thread on physical core.", 825 "SampleAfterValue": "400009",
855 "CounterMask": "1", 826 "BriefDescription": "All (macro) branch instructions retired.",
856 "CounterHTOff": "0,1,2,3,4,5,6,7" 827 "CounterHTOff": "0,1,2,3"
857 }, 828 },
858 { 829 {
859 "EventCode": "0xB1", 830 "PEBS": "1",
831 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts return instructions retired.",
832 "EventCode": "0xC4",
860 "Counter": "0,1,2,3", 833 "Counter": "0,1,2,3",
861 "UMask": "0x2", 834 "UMask": "0x8",
862 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_2", 835 "Errata": "SKL091",
863 "SampleAfterValue": "2000003", 836 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
864 "BriefDescription": "Cycles at least 2 micro-op is executed from any thread on physical core.", 837 "SampleAfterValue": "100007",
865 "CounterMask": "2", 838 "BriefDescription": "Return instructions retired.",
866 "CounterHTOff": "0,1,2,3,4,5,6,7" 839 "CounterHTOff": "0,1,2,3,4,5,6,7"
867 }, 840 },
868 { 841 {
869 "EventCode": "0xB1", 842 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts not taken branch instructions retired.",
843 "EventCode": "0xC4",
870 "Counter": "0,1,2,3", 844 "Counter": "0,1,2,3",
871 "UMask": "0x2", 845 "UMask": "0x10",
872 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_3", 846 "Errata": "SKL091",
873 "SampleAfterValue": "2000003", 847 "EventName": "BR_INST_RETIRED.NOT_TAKEN",
874 "BriefDescription": "Cycles at least 3 micro-op is executed from any thread on physical core.", 848 "SampleAfterValue": "400009",
875 "CounterMask": "3", 849 "BriefDescription": "Not taken branch instructions retired.",
876 "CounterHTOff": "0,1,2,3,4,5,6,7" 850 "CounterHTOff": "0,1,2,3,4,5,6,7"
877 }, 851 },
878 { 852 {
879 "EventCode": "0xB1", 853 "PEBS": "1",
854 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts taken branch instructions retired.",
855 "EventCode": "0xC4",
880 "Counter": "0,1,2,3", 856 "Counter": "0,1,2,3",
881 "UMask": "0x2", 857 "UMask": "0x20",
882 "EventName": "UOPS_EXECUTED.CORE_CYCLES_GE_4", 858 "Errata": "SKL091",
883 "SampleAfterValue": "2000003", 859 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
884 "BriefDescription": "Cycles at least 4 micro-op is executed from any thread on physical core.", 860 "SampleAfterValue": "400009",
885 "CounterMask": "4", 861 "BriefDescription": "Taken branch instructions retired.",
886 "CounterHTOff": "0,1,2,3,4,5,6,7" 862 "CounterHTOff": "0,1,2,3,4,5,6,7"
887 }, 863 },
888 { 864 {
889 "EventCode": "0xB1", 865 "PEBS": "1",
890 "Invert": "1", 866 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts far branch instructions retired.",
867 "EventCode": "0xC4",
891 "Counter": "0,1,2,3", 868 "Counter": "0,1,2,3",
892 "UMask": "0x2", 869 "UMask": "0x40",
893 "EventName": "UOPS_EXECUTED.CORE_CYCLES_NONE", 870 "Errata": "SKL091",
894 "SampleAfterValue": "2000003", 871 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
895 "BriefDescription": "Cycles with no micro-ops executed from any thread on physical core.", 872 "SampleAfterValue": "100007",
896 "CounterMask": "1", 873 "BriefDescription": "Counts the number of far branch instructions retired.",
897 "CounterHTOff": "0,1,2,3,4,5,6,7" 874 "CounterHTOff": "0,1,2,3,4,5,6,7"
898 }, 875 },
899 { 876 {
900 "PublicDescription": "This event counts when the Current Privilege Level (CPL) transitions from ring 1, 2 or 3 to ring 0 (Kernel).", 877 "PublicDescription": "Counts all the retired branch instructions that were mispredicted by the processor. A branch misprediction occurs when the processor incorrectly predicts the destination of the branch. When the misprediction is discovered at execution, all the instructions executed in the wrong (speculative) path must be discarded, and the processor must start fetching from the correct path.",
901 "EventCode": "0x3C", 878 "EventCode": "0xC5",
902 "Counter": "0,1,2,3", 879 "Counter": "0,1,2,3",
903 "UMask": "0x0", 880 "UMask": "0x0",
904 "EdgeDetect": "1", 881 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES",
905 "EventName": "CPU_CLK_UNHALTED.RING0_TRANS", 882 "SampleAfterValue": "400009",
906 "SampleAfterValue": "100007", 883 "BriefDescription": "All mispredicted macro branch instructions retired.",
907 "BriefDescription": "Counts when there is a transition from ring 1, 2 or 3 to ring 0.",
908 "CounterMask": "1",
909 "CounterHTOff": "0,1,2,3,4,5,6,7" 884 "CounterHTOff": "0,1,2,3,4,5,6,7"
910 }, 885 },
911 { 886 {
912 "EventCode": "0x3C", 887 "PEBS": "1",
888 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted conditional branch instructions retired.",
889 "EventCode": "0xC5",
913 "Counter": "0,1,2,3", 890 "Counter": "0,1,2,3",
914 "UMask": "0x1", 891 "UMask": "0x1",
915 "EventName": "CPU_CLK_UNHALTED.REF_XCLK", 892 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
916 "SampleAfterValue": "2503", 893 "SampleAfterValue": "400009",
917 "BriefDescription": "Core crystal clock cycles when the thread is unhalted.", 894 "BriefDescription": "Mispredicted conditional branch instructions retired.",
918 "CounterHTOff": "0,1,2,3,4,5,6,7" 895 "CounterHTOff": "0,1,2,3,4,5,6,7"
919 }, 896 },
920 { 897 {
921 "EventCode": "0x3C", 898 "PEBS": "1",
899 "PublicDescription": "This event counts both taken and not taken retired mispredicted direct and indirect near calls, including both register and memory indirect.",
900 "EventCode": "0xC5",
922 "Counter": "0,1,2,3", 901 "Counter": "0,1,2,3",
923 "UMask": "0x1", 902 "UMask": "0x2",
924 "AnyThread": "1", 903 "EventName": "BR_MISP_RETIRED.NEAR_CALL",
925 "EventName": "CPU_CLK_UNHALTED.REF_XCLK_ANY", 904 "SampleAfterValue": "400009",
926 "SampleAfterValue": "2503", 905 "BriefDescription": "Mispredicted direct and indirect near call instructions retired.",
927 "BriefDescription": "Core crystal clock cycles when at least one thread on the physical core is unhalted.",
928 "CounterHTOff": "0,1,2,3,4,5,6,7" 906 "CounterHTOff": "0,1,2,3,4,5,6,7"
929 }, 907 },
930 { 908 {
931 "EventCode": "0x3C", 909 "PEBS": "2",
910 "PublicDescription": "This is a precise version of BR_MISP_RETIRED.ALL_BRANCHES that counts all mispredicted macro branch instructions retired.",
911 "EventCode": "0xC5",
932 "Counter": "0,1,2,3", 912 "Counter": "0,1,2,3",
933 "UMask": "0x2", 913 "UMask": "0x4",
934 "EventName": "CPU_CLK_UNHALTED.ONE_THREAD_ACTIVE", 914 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS",
935 "SampleAfterValue": "2503", 915 "SampleAfterValue": "400009",
936 "BriefDescription": "Core crystal clock cycles when this thread is unhalted and the other thread is halted.", 916 "BriefDescription": "Mispredicted macro branch instructions retired.",
917 "CounterHTOff": "0,1,2,3"
918 },
919 {
920 "PEBS": "1",
921 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken.",
922 "EventCode": "0xC5",
923 "Counter": "0,1,2,3",
924 "UMask": "0x20",
925 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
926 "SampleAfterValue": "400009",
927 "BriefDescription": "Number of near branch instructions retired that were mispredicted and taken. ",
928 "CounterHTOff": "0,1,2,3,4,5,6,7"
929 },
930 {
931 "PublicDescription": "Increments when an entry is added to the Last Branch Record (LBR) array (or removed from the array in case of RETURNs in call stack mode). The event requires LBR enable via IA32_DEBUGCTL MSR and branch type selection via MSR_LBR_SELECT.",
932 "EventCode": "0xCC",
933 "Counter": "0,1,2,3",
934 "UMask": "0x20",
935 "EventName": "ROB_MISC_EVENTS.LBR_INSERTS",
936 "SampleAfterValue": "2000003",
937 "BriefDescription": "Increments whenever there is an update to the LBR array.",
938 "CounterHTOff": "0,1,2,3,4,5,6,7"
939 },
940 {
941 "PublicDescription": "Counts the number of times the front-end is resteered when it finds a branch instruction in a fetch line. This occurs for the first time a branch instruction is fetched or when the branch is not tracked by the BPU (Branch Prediction Unit) anymore.",
942 "EventCode": "0xE6",
943 "Counter": "0,1,2,3",
944 "UMask": "0x1",
945 "EventName": "BACLEARS.ANY",
946 "SampleAfterValue": "100003",
947 "BriefDescription": "Counts the total number when the front end is resteered, mainly when the BPU cannot provide a correct prediction and this is corrected by other branch handling mechanisms at the front end.",
937 "CounterHTOff": "0,1,2,3,4,5,6,7" 948 "CounterHTOff": "0,1,2,3,4,5,6,7"
938 } 949 }
939] \ No newline at end of file 950] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/skylake/virtual-memory.json b/tools/perf/pmu-events/arch/x86/skylake/virtual-memory.json
index 02f32cbf6789..2bcba7daca14 100644
--- a/tools/perf/pmu-events/arch/x86/skylake/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/skylake/virtual-memory.json
@@ -1,83 +1,6 @@
1[ 1[
2 { 2 {
3 "PublicDescription": "This event counts the number of flushes of the big or small ITLB pages. Counting include both TLB Flush (covering all sets) and TLB Set Clear (set-specific).", 3 "PublicDescription": "Counts demand data loads that caused a page walk of any page size (4K/2M/4M/1G). This implies it missed in all TLB levels, but the walk need not have completed.",
4 "EventCode": "0xAE",
5 "Counter": "0,1,2,3",
6 "UMask": "0x1",
7 "EventName": "ITLB.ITLB_FLUSH",
8 "SampleAfterValue": "100007",
9 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.",
10 "CounterHTOff": "0,1,2,3,4,5,6,7"
11 },
12 {
13 "EventCode": "0x4F",
14 "Counter": "0,1,2,3",
15 "UMask": "0x10",
16 "EventName": "EPT.WALK_PENDING",
17 "SampleAfterValue": "2000003",
18 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a EPT (Extended Page Table) walk for any request type.",
19 "CounterHTOff": "0,1,2,3,4,5,6,7"
20 },
21 {
22 "PublicDescription": "This event counts store misses in all DTLB levels that cause page walks of any page size (4K/2M/4M/1G).",
23 "EventCode": "0x85",
24 "Counter": "0,1,2,3",
25 "UMask": "0x1",
26 "EventName": "ITLB_MISSES.MISS_CAUSES_A_WALK",
27 "SampleAfterValue": "100003",
28 "BriefDescription": "Misses at all ITLB levels that cause page walks",
29 "CounterHTOff": "0,1,2,3,4,5,6,7"
30 },
31 {
32 "PublicDescription": "This event counts store misses in all DTLB levels that cause a completed page walk (4K page size). The page walk can end with or without a fault.",
33 "EventCode": "0x85",
34 "Counter": "0,1,2,3",
35 "UMask": "0x2",
36 "EventName": "ITLB_MISSES.WALK_COMPLETED_4K",
37 "SampleAfterValue": "100003",
38 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (4K)",
39 "CounterHTOff": "0,1,2,3,4,5,6,7"
40 },
41 {
42 "PublicDescription": "This event counts store misses in all DTLB levels that cause a completed page walk (2M and 4M page sizes). The page walk can end with or without a fault.",
43 "EventCode": "0x85",
44 "Counter": "0,1,2,3",
45 "UMask": "0x4",
46 "EventName": "ITLB_MISSES.WALK_COMPLETED_2M_4M",
47 "SampleAfterValue": "100003",
48 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (2M/4M)",
49 "CounterHTOff": "0,1,2,3,4,5,6,7"
50 },
51 {
52 "PublicDescription": "This event counts store misses in all DTLB levels that cause a completed page walk (1G page size). The page walk can end with or without a fault.",
53 "EventCode": "0x85",
54 "Counter": "0,1,2,3",
55 "UMask": "0x8",
56 "EventName": "ITLB_MISSES.WALK_COMPLETED_1G",
57 "SampleAfterValue": "100003",
58 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (1G)",
59 "CounterHTOff": "0,1,2,3,4,5,6,7"
60 },
61 {
62 "EventCode": "0x85",
63 "Counter": "0,1,2,3",
64 "UMask": "0x10",
65 "EventName": "ITLB_MISSES.WALK_PENDING",
66 "SampleAfterValue": "100003",
67 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake. ",
68 "CounterHTOff": "0,1,2,3,4,5,6,7"
69 },
70 {
71 "EventCode": "0x85",
72 "Counter": "0,1,2,3",
73 "UMask": "0x20",
74 "EventName": "ITLB_MISSES.STLB_HIT",
75 "SampleAfterValue": "100003",
76 "BriefDescription": "Instruction fetch requests that miss the ITLB and hit the STLB.",
77 "CounterHTOff": "0,1,2,3,4,5,6,7"
78 },
79 {
80 "PublicDescription": "This event counts load misses in all DTLB levels that cause page walks of any page size (4K/2M/4M/1G).",
81 "EventCode": "0x08", 4 "EventCode": "0x08",
82 "Counter": "0,1,2,3", 5 "Counter": "0,1,2,3",
83 "UMask": "0x1", 6 "UMask": "0x1",
@@ -87,45 +10,68 @@
87 "CounterHTOff": "0,1,2,3,4,5,6,7" 10 "CounterHTOff": "0,1,2,3,4,5,6,7"
88 }, 11 },
89 { 12 {
90 "PublicDescription": "This event counts load misses in all DTLB levels that cause a completed page walk (4K page size). The page walk can end with or without a fault.", 13 "PublicDescription": "Counts page walks completed due to demand data loads whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.",
91 "EventCode": "0x08", 14 "EventCode": "0x08",
92 "Counter": "0,1,2,3", 15 "Counter": "0,1,2,3",
93 "UMask": "0x2", 16 "UMask": "0x2",
94 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_4K", 17 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_4K",
95 "SampleAfterValue": "2000003", 18 "SampleAfterValue": "2000003",
96 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes (4K).", 19 "BriefDescription": "Page walk completed due to a demand data load to a 4K page",
97 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
98 }, 21 },
99 { 22 {
100 "PublicDescription": "This event counts load misses in all DTLB levels that cause a completed page walk (2M and 4M page sizes). The page walk can end with or without a fault.", 23 "PublicDescription": "Counts page walks completed due to demand data loads whose address translations missed in the TLB and were mapped to 2M/4M pages. The page walks can end with or without a page fault.",
101 "EventCode": "0x08", 24 "EventCode": "0x08",
102 "Counter": "0,1,2,3", 25 "Counter": "0,1,2,3",
103 "UMask": "0x4", 26 "UMask": "0x4",
104 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M", 27 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M",
105 "SampleAfterValue": "2000003", 28 "SampleAfterValue": "2000003",
106 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes (2M/4M).", 29 "BriefDescription": "Page walk completed due to a demand data load to a 2M/4M page",
107 "CounterHTOff": "0,1,2,3,4,5,6,7" 30 "CounterHTOff": "0,1,2,3,4,5,6,7"
108 }, 31 },
109 { 32 {
110 "PublicDescription": "This event counts load misses in all DTLB levels that cause a completed page walk (1G page size). The page walk can end with or without a fault.", 33 "PublicDescription": "Counts page walks completed due to demand data loads whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.",
111 "EventCode": "0x08", 34 "EventCode": "0x08",
112 "Counter": "0,1,2,3", 35 "Counter": "0,1,2,3",
113 "UMask": "0x8", 36 "UMask": "0x8",
114 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_1G", 37 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_1G",
115 "SampleAfterValue": "2000003", 38 "SampleAfterValue": "2000003",
116 "BriefDescription": "Load miss in all TLB levels causes a page walk that completes. (1G)", 39 "BriefDescription": "Page walk completed due to a demand data load to a 1G page",
117 "CounterHTOff": "0,1,2,3,4,5,6,7" 40 "CounterHTOff": "0,1,2,3,4,5,6,7"
118 }, 41 },
119 { 42 {
43 "PublicDescription": "Counts demand data loads that caused a completed page walk of any page size (4K/2M/4M/1G). This implies it missed in all TLB levels. The page walk can end with or without a fault.",
44 "EventCode": "0x08",
45 "Counter": "0,1,2,3",
46 "UMask": "0xe",
47 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED",
48 "SampleAfterValue": "100003",
49 "BriefDescription": "Load miss in all TLB levels causes a page walk that completes. (All page sizes)",
50 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 },
52 {
53 "PublicDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake microarchitecture.",
120 "EventCode": "0x08", 54 "EventCode": "0x08",
121 "Counter": "0,1,2,3", 55 "Counter": "0,1,2,3",
122 "UMask": "0x10", 56 "UMask": "0x10",
123 "EventName": "DTLB_LOAD_MISSES.WALK_PENDING", 57 "EventName": "DTLB_LOAD_MISSES.WALK_PENDING",
124 "SampleAfterValue": "2000003", 58 "SampleAfterValue": "2000003",
125 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake. ", 59 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake.",
60 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 },
62 {
63 "PublicDescription": "Counts cycles when at least one PMH (Page Miss Handler) is busy with a page walk for a load.",
64 "EventCode": "0x08",
65 "Counter": "0,1,2,3",
66 "UMask": "0x10",
67 "EventName": "DTLB_LOAD_MISSES.WALK_ACTIVE",
68 "SampleAfterValue": "100003",
69 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a load. EPT page walk duration are excluded in Skylake.",
70 "CounterMask": "1",
126 "CounterHTOff": "0,1,2,3,4,5,6,7" 71 "CounterHTOff": "0,1,2,3,4,5,6,7"
127 }, 72 },
128 { 73 {
74 "PublicDescription": "Counts loads that miss the DTLB (Data TLB) and hit the STLB (Second level TLB).",
129 "EventCode": "0x08", 75 "EventCode": "0x08",
130 "Counter": "0,1,2,3", 76 "Counter": "0,1,2,3",
131 "UMask": "0x20", 77 "UMask": "0x20",
@@ -135,7 +81,7 @@
135 "CounterHTOff": "0,1,2,3,4,5,6,7" 81 "CounterHTOff": "0,1,2,3,4,5,6,7"
136 }, 82 },
137 { 83 {
138 "PublicDescription": "This event counts store misses in all DTLB levels that cause page walks of any page size (4K/2M/4M/1G).", 84 "PublicDescription": "Counts demand data stores that caused a page walk of any page size (4K/2M/4M/1G). This implies it missed in all TLB levels, but the walk need not have completed.",
139 "EventCode": "0x49", 85 "EventCode": "0x49",
140 "Counter": "0,1,2,3", 86 "Counter": "0,1,2,3",
141 "UMask": "0x1", 87 "UMask": "0x1",
@@ -145,45 +91,68 @@
145 "CounterHTOff": "0,1,2,3,4,5,6,7" 91 "CounterHTOff": "0,1,2,3,4,5,6,7"
146 }, 92 },
147 { 93 {
148 "PublicDescription": "This event counts store misses in all DTLB levels that cause a completed page walk (4K page size). The page walk can end with or without a fault.", 94 "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.",
149 "EventCode": "0x49", 95 "EventCode": "0x49",
150 "Counter": "0,1,2,3", 96 "Counter": "0,1,2,3",
151 "UMask": "0x2", 97 "UMask": "0x2",
152 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_4K", 98 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_4K",
153 "SampleAfterValue": "100003", 99 "SampleAfterValue": "100003",
154 "BriefDescription": "Store miss in all TLB levels causes a page walk that completes. (4K)", 100 "BriefDescription": "Page walk completed due to a demand data store to a 4K page",
155 "CounterHTOff": "0,1,2,3,4,5,6,7" 101 "CounterHTOff": "0,1,2,3,4,5,6,7"
156 }, 102 },
157 { 103 {
158 "PublicDescription": "This event counts store misses in all DTLB levels that cause a completed page walk (2M and 4M page sizes). The page walk can end with or without a fault.", 104 "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 2M/4M pages. The page walks can end with or without a page fault.",
159 "EventCode": "0x49", 105 "EventCode": "0x49",
160 "Counter": "0,1,2,3", 106 "Counter": "0,1,2,3",
161 "UMask": "0x4", 107 "UMask": "0x4",
162 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M", 108 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M",
163 "SampleAfterValue": "100003", 109 "SampleAfterValue": "100003",
164 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks (2M/4M)", 110 "BriefDescription": "Page walk completed due to a demand data store to a 2M/4M page",
165 "CounterHTOff": "0,1,2,3,4,5,6,7" 111 "CounterHTOff": "0,1,2,3,4,5,6,7"
166 }, 112 },
167 { 113 {
168 "PublicDescription": "This event counts store misses in all DTLB levels that cause a completed page walk (1G page size). The page walk can end with or without a fault.", 114 "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 1G pages. The page walks can end with or without a page fault.",
169 "EventCode": "0x49", 115 "EventCode": "0x49",
170 "Counter": "0,1,2,3", 116 "Counter": "0,1,2,3",
171 "UMask": "0x8", 117 "UMask": "0x8",
172 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_1G", 118 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_1G",
173 "SampleAfterValue": "100003", 119 "SampleAfterValue": "100003",
174 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks (1G)", 120 "BriefDescription": "Page walk completed due to a demand data store to a 1G page",
121 "CounterHTOff": "0,1,2,3,4,5,6,7"
122 },
123 {
124 "PublicDescription": "Counts demand data stores that caused a completed page walk of any page size (4K/2M/4M/1G). This implies it missed in all TLB levels. The page walk can end with or without a fault.",
125 "EventCode": "0x49",
126 "Counter": "0,1,2,3",
127 "UMask": "0xe",
128 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED",
129 "SampleAfterValue": "100003",
130 "BriefDescription": "Store misses in all TLB levels causes a page walk that completes. (All page sizes)",
175 "CounterHTOff": "0,1,2,3,4,5,6,7" 131 "CounterHTOff": "0,1,2,3,4,5,6,7"
176 }, 132 },
177 { 133 {
134 "PublicDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake microarchitecture.",
178 "EventCode": "0x49", 135 "EventCode": "0x49",
179 "Counter": "0,1,2,3", 136 "Counter": "0,1,2,3",
180 "UMask": "0x10", 137 "UMask": "0x10",
181 "EventName": "DTLB_STORE_MISSES.WALK_PENDING", 138 "EventName": "DTLB_STORE_MISSES.WALK_PENDING",
182 "SampleAfterValue": "2000003", 139 "SampleAfterValue": "2000003",
183 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake. ", 140 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake.",
141 "CounterHTOff": "0,1,2,3,4,5,6,7"
142 },
143 {
144 "PublicDescription": "Counts cycles when at least one PMH (Page Miss Handler) is busy with a page walk for a store.",
145 "EventCode": "0x49",
146 "Counter": "0,1,2,3",
147 "UMask": "0x10",
148 "EventName": "DTLB_STORE_MISSES.WALK_ACTIVE",
149 "SampleAfterValue": "100003",
150 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a store. EPT page walk duration are excluded in Skylake.",
151 "CounterMask": "1",
184 "CounterHTOff": "0,1,2,3,4,5,6,7" 152 "CounterHTOff": "0,1,2,3,4,5,6,7"
185 }, 153 },
186 { 154 {
155 "PublicDescription": "Stores that miss the DTLB (Data TLB) and hit the STLB (2nd Level TLB).",
187 "EventCode": "0x49", 156 "EventCode": "0x49",
188 "Counter": "0,1,2,3", 157 "Counter": "0,1,2,3",
189 "UMask": "0x20", 158 "UMask": "0x20",
@@ -193,73 +162,77 @@
193 "CounterHTOff": "0,1,2,3,4,5,6,7" 162 "CounterHTOff": "0,1,2,3,4,5,6,7"
194 }, 163 },
195 { 164 {
196 "PublicDescription": "This event counts the number of DTLB flush attempts of the thread-specific entries.", 165 "PublicDescription": "Counts cycles for each PMH (Page Miss Handler) that is busy with an EPT (Extended Page Table) walk for any request type.",
197 "EventCode": "0xBD", 166 "EventCode": "0x4F",
198 "Counter": "0,1,2,3", 167 "Counter": "0,1,2,3",
199 "UMask": "0x1", 168 "UMask": "0x10",
200 "EventName": "TLB_FLUSH.DTLB_THREAD", 169 "EventName": "EPT.WALK_PENDING",
201 "SampleAfterValue": "100007", 170 "SampleAfterValue": "2000003",
202 "BriefDescription": "DTLB flush attempts of the thread-specific entries", 171 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a EPT (Extended Page Table) walk for any request type.",
203 "CounterHTOff": "0,1,2,3,4,5,6,7" 172 "CounterHTOff": "0,1,2,3,4,5,6,7"
204 }, 173 },
205 { 174 {
206 "PublicDescription": "This event counts the number of any STLB flush attempts (such as entire, VPID, PCID, InvPage, CR3 write, and so on).", 175 "PublicDescription": "Counts page walks of any page size (4K/2M/4M/1G) caused by a code fetch. This implies it missed in the ITLB and further levels of TLB, but the walk need not have completed.",
207 "EventCode": "0xBD", 176 "EventCode": "0x85",
208 "Counter": "0,1,2,3", 177 "Counter": "0,1,2,3",
209 "UMask": "0x20", 178 "UMask": "0x1",
210 "EventName": "TLB_FLUSH.STLB_ANY", 179 "EventName": "ITLB_MISSES.MISS_CAUSES_A_WALK",
211 "SampleAfterValue": "100007", 180 "SampleAfterValue": "100003",
212 "BriefDescription": "STLB flush attempts", 181 "BriefDescription": "Misses at all ITLB levels that cause page walks",
213 "CounterHTOff": "0,1,2,3,4,5,6,7" 182 "CounterHTOff": "0,1,2,3,4,5,6,7"
214 }, 183 },
215 { 184 {
185 "PublicDescription": "Counts completed page walks (4K page size) caused by a code fetch. This implies it missed in the ITLB and further levels of TLB. The page walk can end with or without a fault.",
216 "EventCode": "0x85", 186 "EventCode": "0x85",
217 "Counter": "0,1,2,3", 187 "Counter": "0,1,2,3",
218 "UMask": "0xe", 188 "UMask": "0x2",
219 "EventName": "ITLB_MISSES.WALK_COMPLETED", 189 "EventName": "ITLB_MISSES.WALK_COMPLETED_4K",
220 "SampleAfterValue": "100003", 190 "SampleAfterValue": "100003",
221 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (All page sizes)", 191 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (4K)",
222 "CounterHTOff": "0,1,2,3,4,5,6,7" 192 "CounterHTOff": "0,1,2,3,4,5,6,7"
223 }, 193 },
224 { 194 {
225 "EventCode": "0x08", 195 "PublicDescription": "Counts code misses in all ITLB levels that caused a completed page walk (2M and 4M page sizes). The page walk can end with or without a fault.",
196 "EventCode": "0x85",
226 "Counter": "0,1,2,3", 197 "Counter": "0,1,2,3",
227 "UMask": "0xe", 198 "UMask": "0x4",
228 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED", 199 "EventName": "ITLB_MISSES.WALK_COMPLETED_2M_4M",
229 "SampleAfterValue": "100003", 200 "SampleAfterValue": "100003",
230 "BriefDescription": "Load miss in all TLB levels causes a page walk that completes. (All page sizes)", 201 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (2M/4M)",
231 "CounterHTOff": "0,1,2,3,4,5,6,7" 202 "CounterHTOff": "0,1,2,3,4,5,6,7"
232 }, 203 },
233 { 204 {
234 "EventCode": "0x49", 205 "PublicDescription": "Counts store misses in all DTLB levels that cause a completed page walk (1G page size). The page walk can end with or without a fault.",
206 "EventCode": "0x85",
235 "Counter": "0,1,2,3", 207 "Counter": "0,1,2,3",
236 "UMask": "0xe", 208 "UMask": "0x8",
237 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED", 209 "EventName": "ITLB_MISSES.WALK_COMPLETED_1G",
238 "SampleAfterValue": "100003", 210 "SampleAfterValue": "100003",
239 "BriefDescription": "Store misses in all TLB levels causes a page walk that completes. (All page sizes)", 211 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (1G)",
240 "CounterHTOff": "0,1,2,3,4,5,6,7" 212 "CounterHTOff": "0,1,2,3,4,5,6,7"
241 }, 213 },
242 { 214 {
243 "EventCode": "0x49", 215 "PublicDescription": "Counts completed page walks (2M and 4M page sizes) caused by a code fetch. This implies it missed in the ITLB and further levels of TLB. The page walk can end with or without a fault.",
216 "EventCode": "0x85",
244 "Counter": "0,1,2,3", 217 "Counter": "0,1,2,3",
245 "UMask": "0x10", 218 "UMask": "0xe",
246 "EventName": "DTLB_STORE_MISSES.WALK_ACTIVE", 219 "EventName": "ITLB_MISSES.WALK_COMPLETED",
247 "SampleAfterValue": "100003", 220 "SampleAfterValue": "100003",
248 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a store. EPT page walk duration are excluded in Skylake. ", 221 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (All page sizes)",
249 "CounterMask": "1",
250 "CounterHTOff": "0,1,2,3,4,5,6,7" 222 "CounterHTOff": "0,1,2,3,4,5,6,7"
251 }, 223 },
252 { 224 {
253 "EventCode": "0x08", 225 "PublicDescription": "Counts 1 per cycle for each PMH (Page Miss Handler) that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake michroarchitecture.",
226 "EventCode": "0x85",
254 "Counter": "0,1,2,3", 227 "Counter": "0,1,2,3",
255 "UMask": "0x10", 228 "UMask": "0x10",
256 "EventName": "DTLB_LOAD_MISSES.WALK_ACTIVE", 229 "EventName": "ITLB_MISSES.WALK_PENDING",
257 "SampleAfterValue": "100003", 230 "SampleAfterValue": "100003",
258 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a load. EPT page walk duration are excluded in Skylake. ", 231 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake.",
259 "CounterMask": "1",
260 "CounterHTOff": "0,1,2,3,4,5,6,7" 232 "CounterHTOff": "0,1,2,3,4,5,6,7"
261 }, 233 },
262 { 234 {
235 "PublicDescription": "Cycles when at least one PMH is busy with a page walk for code (instruction fetch) request. EPT page walk duration are excluded in Skylake microarchitecture.",
263 "EventCode": "0x85", 236 "EventCode": "0x85",
264 "Counter": "0,1,2,3", 237 "Counter": "0,1,2,3",
265 "UMask": "0x10", 238 "UMask": "0x10",
@@ -268,5 +241,44 @@
268 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for code (instruction fetch) request. EPT page walk duration are excluded in Skylake.", 241 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for code (instruction fetch) request. EPT page walk duration are excluded in Skylake.",
269 "CounterMask": "1", 242 "CounterMask": "1",
270 "CounterHTOff": "0,1,2,3,4,5,6,7" 243 "CounterHTOff": "0,1,2,3,4,5,6,7"
244 },
245 {
246 "EventCode": "0x85",
247 "Counter": "0,1,2,3",
248 "UMask": "0x20",
249 "EventName": "ITLB_MISSES.STLB_HIT",
250 "SampleAfterValue": "100003",
251 "BriefDescription": "Instruction fetch requests that miss the ITLB and hit the STLB.",
252 "CounterHTOff": "0,1,2,3,4,5,6,7"
253 },
254 {
255 "PublicDescription": "Counts the number of flushes of the big or small ITLB pages. Counting include both TLB Flush (covering all sets) and TLB Set Clear (set-specific).",
256 "EventCode": "0xAE",
257 "Counter": "0,1,2,3",
258 "UMask": "0x1",
259 "EventName": "ITLB.ITLB_FLUSH",
260 "SampleAfterValue": "100007",
261 "BriefDescription": "Flushing of the Instruction TLB (ITLB) pages, includes 4k/2M/4M pages.",
262 "CounterHTOff": "0,1,2,3,4,5,6,7"
263 },
264 {
265 "PublicDescription": "Counts the number of DTLB flush attempts of the thread-specific entries.",
266 "EventCode": "0xBD",
267 "Counter": "0,1,2,3",
268 "UMask": "0x1",
269 "EventName": "TLB_FLUSH.DTLB_THREAD",
270 "SampleAfterValue": "100007",
271 "BriefDescription": "DTLB flush attempts of the thread-specific entries",
272 "CounterHTOff": "0,1,2,3,4,5,6,7"
273 },
274 {
275 "PublicDescription": "Counts the number of any STLB flush attempts (such as entire, VPID, PCID, InvPage, CR3 write, etc.).",
276 "EventCode": "0xBD",
277 "Counter": "0,1,2,3",
278 "UMask": "0x20",
279 "EventName": "TLB_FLUSH.STLB_ANY",
280 "SampleAfterValue": "100007",
281 "BriefDescription": "STLB flush attempts",
282 "CounterHTOff": "0,1,2,3,4,5,6,7"
271 } 283 }
272] \ No newline at end of file 284] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/cache.json b/tools/perf/pmu-events/arch/x86/skylakex/cache.json
index b5bc742b6fbc..5c9940866acd 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/cache.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/cache.json
@@ -265,7 +265,7 @@
265 { 265 {
266 "EventCode": "0x60", 266 "EventCode": "0x60",
267 "UMask": "0x2", 267 "UMask": "0x2",
268 "BriefDescription": "Offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle. ", 268 "BriefDescription": "Offcore outstanding Code Reads transactions in the SuperQueue (SQ), queue to uncore, every cycle.",
269 "Counter": "0,1,2,3", 269 "Counter": "0,1,2,3",
270 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", 270 "EventName": "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD",
271 "PublicDescription": "Counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.", 271 "PublicDescription": "Counts the number of offcore outstanding Code Reads transactions in the super queue every cycle. The 'Offcore outstanding' state of the transaction lasts from the L2 miss until the sending transaction completion to requestor (SQ deallocation). See the corresponding Umask under OFFCORE_REQUESTS.",
@@ -398,22 +398,24 @@
398 { 398 {
399 "EventCode": "0xD0", 399 "EventCode": "0xD0",
400 "UMask": "0x11", 400 "UMask": "0x11",
401 "BriefDescription": "Retired load instructions that miss the STLB.", 401 "BriefDescription": "Retired load instructions that miss the STLB. (Precise Event)",
402 "Data_LA": "1", 402 "Data_LA": "1",
403 "PEBS": "1", 403 "PEBS": "1",
404 "Counter": "0,1,2,3", 404 "Counter": "0,1,2,3",
405 "EventName": "MEM_INST_RETIRED.STLB_MISS_LOADS", 405 "EventName": "MEM_INST_RETIRED.STLB_MISS_LOADS",
406 "PublicDescription": "Retired load instructions that miss the STLB.",
406 "SampleAfterValue": "100003", 407 "SampleAfterValue": "100003",
407 "CounterHTOff": "0,1,2,3" 408 "CounterHTOff": "0,1,2,3"
408 }, 409 },
409 { 410 {
410 "EventCode": "0xD0", 411 "EventCode": "0xD0",
411 "UMask": "0x12", 412 "UMask": "0x12",
412 "BriefDescription": "Retired store instructions that miss the STLB.", 413 "BriefDescription": "Retired store instructions that miss the STLB. (Precise Event)",
413 "Data_LA": "1", 414 "Data_LA": "1",
414 "PEBS": "1", 415 "PEBS": "1",
415 "Counter": "0,1,2,3", 416 "Counter": "0,1,2,3",
416 "EventName": "MEM_INST_RETIRED.STLB_MISS_STORES", 417 "EventName": "MEM_INST_RETIRED.STLB_MISS_STORES",
418 "PublicDescription": "Retired store instructions that miss the STLB.",
417 "SampleAfterValue": "100003", 419 "SampleAfterValue": "100003",
418 "L1_Hit_Indication": "1", 420 "L1_Hit_Indication": "1",
419 "CounterHTOff": "0,1,2,3" 421 "CounterHTOff": "0,1,2,3"
@@ -421,7 +423,7 @@
421 { 423 {
422 "EventCode": "0xD0", 424 "EventCode": "0xD0",
423 "UMask": "0x21", 425 "UMask": "0x21",
424 "BriefDescription": "Retired load instructions with locked access.", 426 "BriefDescription": "Retired load instructions with locked access. (Precise Event)",
425 "Data_LA": "1", 427 "Data_LA": "1",
426 "PEBS": "1", 428 "PEBS": "1",
427 "Counter": "0,1,2,3", 429 "Counter": "0,1,2,3",
@@ -432,24 +434,22 @@
432 { 434 {
433 "EventCode": "0xD0", 435 "EventCode": "0xD0",
434 "UMask": "0x41", 436 "UMask": "0x41",
435 "BriefDescription": "Retired load instructions that split across a cacheline boundary.", 437 "BriefDescription": "Retired load instructions that split across a cacheline boundary. (Precise Event)",
436 "Data_LA": "1", 438 "Data_LA": "1",
437 "PEBS": "1", 439 "PEBS": "1",
438 "Counter": "0,1,2,3", 440 "Counter": "0,1,2,3",
439 "EventName": "MEM_INST_RETIRED.SPLIT_LOADS", 441 "EventName": "MEM_INST_RETIRED.SPLIT_LOADS",
440 "PublicDescription": "Counts retired load instructions that split across a cacheline boundary.",
441 "SampleAfterValue": "100003", 442 "SampleAfterValue": "100003",
442 "CounterHTOff": "0,1,2,3" 443 "CounterHTOff": "0,1,2,3"
443 }, 444 },
444 { 445 {
445 "EventCode": "0xD0", 446 "EventCode": "0xD0",
446 "UMask": "0x42", 447 "UMask": "0x42",
447 "BriefDescription": "Retired store instructions that split across a cacheline boundary.", 448 "BriefDescription": "Retired store instructions that split across a cacheline boundary. (Precise Event)",
448 "Data_LA": "1", 449 "Data_LA": "1",
449 "PEBS": "1", 450 "PEBS": "1",
450 "Counter": "0,1,2,3", 451 "Counter": "0,1,2,3",
451 "EventName": "MEM_INST_RETIRED.SPLIT_STORES", 452 "EventName": "MEM_INST_RETIRED.SPLIT_STORES",
452 "PublicDescription": "Counts retired store instructions that split across a cacheline boundary.",
453 "SampleAfterValue": "100003", 453 "SampleAfterValue": "100003",
454 "L1_Hit_Indication": "1", 454 "L1_Hit_Indication": "1",
455 "CounterHTOff": "0,1,2,3" 455 "CounterHTOff": "0,1,2,3"
@@ -457,7 +457,7 @@
457 { 457 {
458 "EventCode": "0xD0", 458 "EventCode": "0xD0",
459 "UMask": "0x81", 459 "UMask": "0x81",
460 "BriefDescription": "All retired load instructions.", 460 "BriefDescription": "All retired load instructions. (Precise Event)",
461 "Data_LA": "1", 461 "Data_LA": "1",
462 "PEBS": "1", 462 "PEBS": "1",
463 "Counter": "0,1,2,3", 463 "Counter": "0,1,2,3",
@@ -468,11 +468,12 @@
468 { 468 {
469 "EventCode": "0xD0", 469 "EventCode": "0xD0",
470 "UMask": "0x82", 470 "UMask": "0x82",
471 "BriefDescription": "All retired store instructions.", 471 "BriefDescription": "All retired store instructions. (Precise Event)",
472 "Data_LA": "1", 472 "Data_LA": "1",
473 "PEBS": "1", 473 "PEBS": "1",
474 "Counter": "0,1,2,3", 474 "Counter": "0,1,2,3",
475 "EventName": "MEM_INST_RETIRED.ALL_STORES", 475 "EventName": "MEM_INST_RETIRED.ALL_STORES",
476 "PublicDescription": "All retired store instructions.",
476 "SampleAfterValue": "2000003", 477 "SampleAfterValue": "2000003",
477 "L1_Hit_Indication": "1", 478 "L1_Hit_Indication": "1",
478 "CounterHTOff": "0,1,2,3" 479 "CounterHTOff": "0,1,2,3"
@@ -485,7 +486,7 @@
485 "PEBS": "1", 486 "PEBS": "1",
486 "Counter": "0,1,2,3", 487 "Counter": "0,1,2,3",
487 "EventName": "MEM_LOAD_RETIRED.L1_HIT", 488 "EventName": "MEM_LOAD_RETIRED.L1_HIT",
488 "PublicDescription": "Counts retired load instructions with at least one uop that hit in the L1 data cache. This event includes all SW prefetches and lock instructions regardless of the data source.", 489 "PublicDescription": "Counts retired load instructions with at least one uop that hit in the L1 data cache. This event includes all SW prefetches and lock instructions regardless of the data source.\r\n",
489 "SampleAfterValue": "2000003", 490 "SampleAfterValue": "2000003",
490 "CounterHTOff": "0,1,2,3" 491 "CounterHTOff": "0,1,2,3"
491 }, 492 },
@@ -509,7 +510,7 @@
509 "PEBS": "1", 510 "PEBS": "1",
510 "Counter": "0,1,2,3", 511 "Counter": "0,1,2,3",
511 "EventName": "MEM_LOAD_RETIRED.L3_HIT", 512 "EventName": "MEM_LOAD_RETIRED.L3_HIT",
512 "PublicDescription": "Counts retired load instructions with at least one uop that hit in the L3 cache. ", 513 "PublicDescription": "Retired load instructions with L3 cache hits as data sources.",
513 "SampleAfterValue": "50021", 514 "SampleAfterValue": "50021",
514 "CounterHTOff": "0,1,2,3" 515 "CounterHTOff": "0,1,2,3"
515 }, 516 },
@@ -545,7 +546,7 @@
545 "PEBS": "1", 546 "PEBS": "1",
546 "Counter": "0,1,2,3", 547 "Counter": "0,1,2,3",
547 "EventName": "MEM_LOAD_RETIRED.L3_MISS", 548 "EventName": "MEM_LOAD_RETIRED.L3_MISS",
548 "PublicDescription": "Counts retired load instructions with at least one uop that missed in the L3 cache. ", 549 "PublicDescription": "Retired load instructions missed L3 cache as data sources.",
549 "SampleAfterValue": "100007", 550 "SampleAfterValue": "100007",
550 "CounterHTOff": "0,1,2,3" 551 "CounterHTOff": "0,1,2,3"
551 }, 552 },
@@ -557,7 +558,7 @@
557 "PEBS": "1", 558 "PEBS": "1",
558 "Counter": "0,1,2,3", 559 "Counter": "0,1,2,3",
559 "EventName": "MEM_LOAD_RETIRED.FB_HIT", 560 "EventName": "MEM_LOAD_RETIRED.FB_HIT",
560 "PublicDescription": "Counts retired load instructions with at least one uop was load missed in L1 but hit FB (Fill Buffers) due to preceding miss to the same cache line with data not ready. ", 561 "PublicDescription": "Counts retired load instructions with at least one uop was load missed in L1 but hit FB (Fill Buffers) due to preceding miss to the same cache line with data not ready. \r\n",
561 "SampleAfterValue": "100007", 562 "SampleAfterValue": "100007",
562 "CounterHTOff": "0,1,2,3" 563 "CounterHTOff": "0,1,2,3"
563 }, 564 },
@@ -616,7 +617,6 @@
616 "PEBS": "1", 617 "PEBS": "1",
617 "Counter": "0,1,2,3", 618 "Counter": "0,1,2,3",
618 "EventName": "MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM", 619 "EventName": "MEM_LOAD_L3_MISS_RETIRED.LOCAL_DRAM",
619 "PublicDescription": "Retired load instructions which data sources missed L3 but serviced from local DRAM.",
620 "SampleAfterValue": "100007", 620 "SampleAfterValue": "100007",
621 "CounterHTOff": "0,1,2,3" 621 "CounterHTOff": "0,1,2,3"
622 }, 622 },
@@ -639,7 +639,6 @@
639 "PEBS": "1", 639 "PEBS": "1",
640 "Counter": "0,1,2,3", 640 "Counter": "0,1,2,3",
641 "EventName": "MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM", 641 "EventName": "MEM_LOAD_L3_MISS_RETIRED.REMOTE_HITM",
642 "PublicDescription": "Retired load instructions whose data sources was remote HITM.",
643 "SampleAfterValue": "100007", 642 "SampleAfterValue": "100007",
644 "CounterHTOff": "0,1,2,3" 643 "CounterHTOff": "0,1,2,3"
645 }, 644 },
@@ -648,9 +647,9 @@
648 "UMask": "0x8", 647 "UMask": "0x8",
649 "BriefDescription": "Retired load instructions whose data sources was forwarded from a remote cache", 648 "BriefDescription": "Retired load instructions whose data sources was forwarded from a remote cache",
650 "Data_LA": "1", 649 "Data_LA": "1",
650 "PEBS": "1",
651 "Counter": "0,1,2,3", 651 "Counter": "0,1,2,3",
652 "EventName": "MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD", 652 "EventName": "MEM_LOAD_L3_MISS_RETIRED.REMOTE_FWD",
653 "PublicDescription": "Retired load instructions whose data sources was forwarded from a remote cache.",
654 "SampleAfterValue": "100007", 653 "SampleAfterValue": "100007",
655 "CounterHTOff": "0,1,2,3" 654 "CounterHTOff": "0,1,2,3"
656 }, 655 },
@@ -697,7 +696,7 @@
697 { 696 {
698 "EventCode": "0xF2", 697 "EventCode": "0xF2",
699 "UMask": "0x2", 698 "UMask": "0x2",
700 "BriefDescription": "Counts the number of lines that are evicted by L2 cache when triggered by an L2 cache fill. Those lines can be either in modified state or clean state. Modified lines may either be written back to L3 or directly written to memory and not allocated in L3. Clean lines may either be allocated in L3 or dropped ", 699 "BriefDescription": "Counts the number of lines that are evicted by L2 cache when triggered by an L2 cache fill. Those lines can be either in modified state or clean state. Modified lines may either be written back to L3 or directly written to memory and not allocated in L3. Clean lines may either be allocated in L3 or dropped",
701 "Counter": "0,1,2,3", 700 "Counter": "0,1,2,3",
702 "EventName": "L2_LINES_OUT.NON_SILENT", 701 "EventName": "L2_LINES_OUT.NON_SILENT",
703 "PublicDescription": "Counts the number of lines that are evicted by L2 cache when triggered by an L2 cache fill. Those lines can be either in modified state or clean state. Modified lines may either be written back to L3 or directly written to memory and not allocated in L3. Clean lines may either be allocated in L3 or dropped.", 702 "PublicDescription": "Counts the number of lines that are evicted by L2 cache when triggered by an L2 cache fill. Those lines can be either in modified state or clean state. Modified lines may either be written back to L3 or directly written to memory and not allocated in L3. Clean lines may either be allocated in L3 or dropped.",
@@ -742,7 +741,7 @@
742 "Counter": "0,1,2,3", 741 "Counter": "0,1,2,3",
743 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.ANY_RESPONSE", 742 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.ANY_RESPONSE",
744 "MSRIndex": "0x1a6,0x1a7", 743 "MSRIndex": "0x1a6,0x1a7",
745 "PublicDescription": "Counts demand data reads that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 744 "PublicDescription": "Counts demand data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
746 "SampleAfterValue": "100003", 745 "SampleAfterValue": "100003",
747 "CounterHTOff": "0,1,2,3" 746 "CounterHTOff": "0,1,2,3"
748 }, 747 },
@@ -755,7 +754,7 @@
755 "Counter": "0,1,2,3", 754 "Counter": "0,1,2,3",
756 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.NO_SNOOP_NEEDED", 755 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.NO_SNOOP_NEEDED",
757 "MSRIndex": "0x1a6,0x1a7", 756 "MSRIndex": "0x1a6,0x1a7",
758 "PublicDescription": "Counts demand data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 757 "PublicDescription": "Counts demand data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
759 "SampleAfterValue": "100003", 758 "SampleAfterValue": "100003",
760 "CounterHTOff": "0,1,2,3" 759 "CounterHTOff": "0,1,2,3"
761 }, 760 },
@@ -768,7 +767,7 @@
768 "Counter": "0,1,2,3", 767 "Counter": "0,1,2,3",
769 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD", 768 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD",
770 "MSRIndex": "0x1a6,0x1a7", 769 "MSRIndex": "0x1a6,0x1a7",
771 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 770 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
772 "SampleAfterValue": "100003", 771 "SampleAfterValue": "100003",
773 "CounterHTOff": "0,1,2,3" 772 "CounterHTOff": "0,1,2,3"
774 }, 773 },
@@ -781,7 +780,7 @@
781 "Counter": "0,1,2,3", 780 "Counter": "0,1,2,3",
782 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD", 781 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD",
783 "MSRIndex": "0x1a6,0x1a7", 782 "MSRIndex": "0x1a6,0x1a7",
784 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 783 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
785 "SampleAfterValue": "100003", 784 "SampleAfterValue": "100003",
786 "CounterHTOff": "0,1,2,3" 785 "CounterHTOff": "0,1,2,3"
787 }, 786 },
@@ -794,7 +793,7 @@
794 "Counter": "0,1,2,3", 793 "Counter": "0,1,2,3",
795 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.HITM_OTHER_CORE", 794 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.HITM_OTHER_CORE",
796 "MSRIndex": "0x1a6,0x1a7", 795 "MSRIndex": "0x1a6,0x1a7",
797 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 796 "PublicDescription": "Counts demand data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
798 "SampleAfterValue": "100003", 797 "SampleAfterValue": "100003",
799 "CounterHTOff": "0,1,2,3" 798 "CounterHTOff": "0,1,2,3"
800 }, 799 },
@@ -807,7 +806,7 @@
807 "Counter": "0,1,2,3", 806 "Counter": "0,1,2,3",
808 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.ANY_SNOOP", 807 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_HIT.ANY_SNOOP",
809 "MSRIndex": "0x1a6,0x1a7", 808 "MSRIndex": "0x1a6,0x1a7",
810 "PublicDescription": "Counts demand data reads that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 809 "PublicDescription": "Counts demand data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
811 "SampleAfterValue": "100003", 810 "SampleAfterValue": "100003",
812 "CounterHTOff": "0,1,2,3" 811 "CounterHTOff": "0,1,2,3"
813 }, 812 },
@@ -820,7 +819,7 @@
820 "Counter": "0,1,2,3", 819 "Counter": "0,1,2,3",
821 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.ANY_RESPONSE", 820 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.ANY_RESPONSE",
822 "MSRIndex": "0x1a6,0x1a7", 821 "MSRIndex": "0x1a6,0x1a7",
823 "PublicDescription": "Counts all demand data writes (RFOs) that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 822 "PublicDescription": "Counts all demand data writes (RFOs) that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
824 "SampleAfterValue": "100003", 823 "SampleAfterValue": "100003",
825 "CounterHTOff": "0,1,2,3" 824 "CounterHTOff": "0,1,2,3"
826 }, 825 },
@@ -833,7 +832,7 @@
833 "Counter": "0,1,2,3", 832 "Counter": "0,1,2,3",
834 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.NO_SNOOP_NEEDED", 833 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.NO_SNOOP_NEEDED",
835 "MSRIndex": "0x1a6,0x1a7", 834 "MSRIndex": "0x1a6,0x1a7",
836 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 835 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
837 "SampleAfterValue": "100003", 836 "SampleAfterValue": "100003",
838 "CounterHTOff": "0,1,2,3" 837 "CounterHTOff": "0,1,2,3"
839 }, 838 },
@@ -846,7 +845,7 @@
846 "Counter": "0,1,2,3", 845 "Counter": "0,1,2,3",
847 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD", 846 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD",
848 "MSRIndex": "0x1a6,0x1a7", 847 "MSRIndex": "0x1a6,0x1a7",
849 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 848 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
850 "SampleAfterValue": "100003", 849 "SampleAfterValue": "100003",
851 "CounterHTOff": "0,1,2,3" 850 "CounterHTOff": "0,1,2,3"
852 }, 851 },
@@ -859,7 +858,7 @@
859 "Counter": "0,1,2,3", 858 "Counter": "0,1,2,3",
860 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_HIT_WITH_FWD", 859 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.SNOOP_HIT_WITH_FWD",
861 "MSRIndex": "0x1a6,0x1a7", 860 "MSRIndex": "0x1a6,0x1a7",
862 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 861 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
863 "SampleAfterValue": "100003", 862 "SampleAfterValue": "100003",
864 "CounterHTOff": "0,1,2,3" 863 "CounterHTOff": "0,1,2,3"
865 }, 864 },
@@ -872,7 +871,7 @@
872 "Counter": "0,1,2,3", 871 "Counter": "0,1,2,3",
873 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.HITM_OTHER_CORE", 872 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.HITM_OTHER_CORE",
874 "MSRIndex": "0x1a6,0x1a7", 873 "MSRIndex": "0x1a6,0x1a7",
875 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 874 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
876 "SampleAfterValue": "100003", 875 "SampleAfterValue": "100003",
877 "CounterHTOff": "0,1,2,3" 876 "CounterHTOff": "0,1,2,3"
878 }, 877 },
@@ -885,7 +884,7 @@
885 "Counter": "0,1,2,3", 884 "Counter": "0,1,2,3",
886 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.ANY_SNOOP", 885 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_HIT.ANY_SNOOP",
887 "MSRIndex": "0x1a6,0x1a7", 886 "MSRIndex": "0x1a6,0x1a7",
888 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 887 "PublicDescription": "Counts all demand data writes (RFOs) that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
889 "SampleAfterValue": "100003", 888 "SampleAfterValue": "100003",
890 "CounterHTOff": "0,1,2,3" 889 "CounterHTOff": "0,1,2,3"
891 }, 890 },
@@ -898,7 +897,7 @@
898 "Counter": "0,1,2,3", 897 "Counter": "0,1,2,3",
899 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.ANY_RESPONSE", 898 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.ANY_RESPONSE",
900 "MSRIndex": "0x1a6,0x1a7", 899 "MSRIndex": "0x1a6,0x1a7",
901 "PublicDescription": "Counts all demand code reads that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 900 "PublicDescription": "Counts all demand code reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
902 "SampleAfterValue": "100003", 901 "SampleAfterValue": "100003",
903 "CounterHTOff": "0,1,2,3" 902 "CounterHTOff": "0,1,2,3"
904 }, 903 },
@@ -911,7 +910,7 @@
911 "Counter": "0,1,2,3", 910 "Counter": "0,1,2,3",
912 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.NO_SNOOP_NEEDED", 911 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.NO_SNOOP_NEEDED",
913 "MSRIndex": "0x1a6,0x1a7", 912 "MSRIndex": "0x1a6,0x1a7",
914 "PublicDescription": "Counts all demand code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 913 "PublicDescription": "Counts all demand code reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
915 "SampleAfterValue": "100003", 914 "SampleAfterValue": "100003",
916 "CounterHTOff": "0,1,2,3" 915 "CounterHTOff": "0,1,2,3"
917 }, 916 },
@@ -924,7 +923,7 @@
924 "Counter": "0,1,2,3", 923 "Counter": "0,1,2,3",
925 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD", 924 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD",
926 "MSRIndex": "0x1a6,0x1a7", 925 "MSRIndex": "0x1a6,0x1a7",
927 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 926 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
928 "SampleAfterValue": "100003", 927 "SampleAfterValue": "100003",
929 "CounterHTOff": "0,1,2,3" 928 "CounterHTOff": "0,1,2,3"
930 }, 929 },
@@ -937,7 +936,7 @@
937 "Counter": "0,1,2,3", 936 "Counter": "0,1,2,3",
938 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_HIT_WITH_FWD", 937 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.SNOOP_HIT_WITH_FWD",
939 "MSRIndex": "0x1a6,0x1a7", 938 "MSRIndex": "0x1a6,0x1a7",
940 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 939 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
941 "SampleAfterValue": "100003", 940 "SampleAfterValue": "100003",
942 "CounterHTOff": "0,1,2,3" 941 "CounterHTOff": "0,1,2,3"
943 }, 942 },
@@ -950,7 +949,7 @@
950 "Counter": "0,1,2,3", 949 "Counter": "0,1,2,3",
951 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.HITM_OTHER_CORE", 950 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.HITM_OTHER_CORE",
952 "MSRIndex": "0x1a6,0x1a7", 951 "MSRIndex": "0x1a6,0x1a7",
953 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 952 "PublicDescription": "Counts all demand code reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
954 "SampleAfterValue": "100003", 953 "SampleAfterValue": "100003",
955 "CounterHTOff": "0,1,2,3" 954 "CounterHTOff": "0,1,2,3"
956 }, 955 },
@@ -963,7 +962,7 @@
963 "Counter": "0,1,2,3", 962 "Counter": "0,1,2,3",
964 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.ANY_SNOOP", 963 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_HIT.ANY_SNOOP",
965 "MSRIndex": "0x1a6,0x1a7", 964 "MSRIndex": "0x1a6,0x1a7",
966 "PublicDescription": "Counts all demand code reads that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 965 "PublicDescription": "Counts all demand code reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
967 "SampleAfterValue": "100003", 966 "SampleAfterValue": "100003",
968 "CounterHTOff": "0,1,2,3" 967 "CounterHTOff": "0,1,2,3"
969 }, 968 },
@@ -976,7 +975,7 @@
976 "Counter": "0,1,2,3", 975 "Counter": "0,1,2,3",
977 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.ANY_RESPONSE", 976 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.ANY_RESPONSE",
978 "MSRIndex": "0x1a6,0x1a7", 977 "MSRIndex": "0x1a6,0x1a7",
979 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 978 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
980 "SampleAfterValue": "100003", 979 "SampleAfterValue": "100003",
981 "CounterHTOff": "0,1,2,3" 980 "CounterHTOff": "0,1,2,3"
982 }, 981 },
@@ -989,7 +988,7 @@
989 "Counter": "0,1,2,3", 988 "Counter": "0,1,2,3",
990 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.NO_SNOOP_NEEDED", 989 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.NO_SNOOP_NEEDED",
991 "MSRIndex": "0x1a6,0x1a7", 990 "MSRIndex": "0x1a6,0x1a7",
992 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 991 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
993 "SampleAfterValue": "100003", 992 "SampleAfterValue": "100003",
994 "CounterHTOff": "0,1,2,3" 993 "CounterHTOff": "0,1,2,3"
995 }, 994 },
@@ -1002,7 +1001,7 @@
1002 "Counter": "0,1,2,3", 1001 "Counter": "0,1,2,3",
1003 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1002 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1004 "MSRIndex": "0x1a6,0x1a7", 1003 "MSRIndex": "0x1a6,0x1a7",
1005 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1004 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1006 "SampleAfterValue": "100003", 1005 "SampleAfterValue": "100003",
1007 "CounterHTOff": "0,1,2,3" 1006 "CounterHTOff": "0,1,2,3"
1008 }, 1007 },
@@ -1015,7 +1014,7 @@
1015 "Counter": "0,1,2,3", 1014 "Counter": "0,1,2,3",
1016 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD", 1015 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD",
1017 "MSRIndex": "0x1a6,0x1a7", 1016 "MSRIndex": "0x1a6,0x1a7",
1018 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1017 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1019 "SampleAfterValue": "100003", 1018 "SampleAfterValue": "100003",
1020 "CounterHTOff": "0,1,2,3" 1019 "CounterHTOff": "0,1,2,3"
1021 }, 1020 },
@@ -1028,7 +1027,7 @@
1028 "Counter": "0,1,2,3", 1027 "Counter": "0,1,2,3",
1029 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.HITM_OTHER_CORE", 1028 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.HITM_OTHER_CORE",
1030 "MSRIndex": "0x1a6,0x1a7", 1029 "MSRIndex": "0x1a6,0x1a7",
1031 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1030 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1032 "SampleAfterValue": "100003", 1031 "SampleAfterValue": "100003",
1033 "CounterHTOff": "0,1,2,3" 1032 "CounterHTOff": "0,1,2,3"
1034 }, 1033 },
@@ -1041,7 +1040,7 @@
1041 "Counter": "0,1,2,3", 1040 "Counter": "0,1,2,3",
1042 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.ANY_SNOOP", 1041 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_HIT.ANY_SNOOP",
1043 "MSRIndex": "0x1a6,0x1a7", 1042 "MSRIndex": "0x1a6,0x1a7",
1044 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1043 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1045 "SampleAfterValue": "100003", 1044 "SampleAfterValue": "100003",
1046 "CounterHTOff": "0,1,2,3" 1045 "CounterHTOff": "0,1,2,3"
1047 }, 1046 },
@@ -1054,7 +1053,7 @@
1054 "Counter": "0,1,2,3", 1053 "Counter": "0,1,2,3",
1055 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.ANY_RESPONSE", 1054 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.ANY_RESPONSE",
1056 "MSRIndex": "0x1a6,0x1a7", 1055 "MSRIndex": "0x1a6,0x1a7",
1057 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1056 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1058 "SampleAfterValue": "100003", 1057 "SampleAfterValue": "100003",
1059 "CounterHTOff": "0,1,2,3" 1058 "CounterHTOff": "0,1,2,3"
1060 }, 1059 },
@@ -1067,7 +1066,7 @@
1067 "Counter": "0,1,2,3", 1066 "Counter": "0,1,2,3",
1068 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.NO_SNOOP_NEEDED", 1067 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.NO_SNOOP_NEEDED",
1069 "MSRIndex": "0x1a6,0x1a7", 1068 "MSRIndex": "0x1a6,0x1a7",
1070 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1069 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1071 "SampleAfterValue": "100003", 1070 "SampleAfterValue": "100003",
1072 "CounterHTOff": "0,1,2,3" 1071 "CounterHTOff": "0,1,2,3"
1073 }, 1072 },
@@ -1080,7 +1079,7 @@
1080 "Counter": "0,1,2,3", 1079 "Counter": "0,1,2,3",
1081 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1080 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1082 "MSRIndex": "0x1a6,0x1a7", 1081 "MSRIndex": "0x1a6,0x1a7",
1083 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1082 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1084 "SampleAfterValue": "100003", 1083 "SampleAfterValue": "100003",
1085 "CounterHTOff": "0,1,2,3" 1084 "CounterHTOff": "0,1,2,3"
1086 }, 1085 },
@@ -1093,7 +1092,7 @@
1093 "Counter": "0,1,2,3", 1092 "Counter": "0,1,2,3",
1094 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.SNOOP_HIT_WITH_FWD", 1093 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.SNOOP_HIT_WITH_FWD",
1095 "MSRIndex": "0x1a6,0x1a7", 1094 "MSRIndex": "0x1a6,0x1a7",
1096 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1095 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1097 "SampleAfterValue": "100003", 1096 "SampleAfterValue": "100003",
1098 "CounterHTOff": "0,1,2,3" 1097 "CounterHTOff": "0,1,2,3"
1099 }, 1098 },
@@ -1106,7 +1105,7 @@
1106 "Counter": "0,1,2,3", 1105 "Counter": "0,1,2,3",
1107 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.HITM_OTHER_CORE", 1106 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.HITM_OTHER_CORE",
1108 "MSRIndex": "0x1a6,0x1a7", 1107 "MSRIndex": "0x1a6,0x1a7",
1109 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1108 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1110 "SampleAfterValue": "100003", 1109 "SampleAfterValue": "100003",
1111 "CounterHTOff": "0,1,2,3" 1110 "CounterHTOff": "0,1,2,3"
1112 }, 1111 },
@@ -1119,7 +1118,7 @@
1119 "Counter": "0,1,2,3", 1118 "Counter": "0,1,2,3",
1120 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.ANY_SNOOP", 1119 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_HIT.ANY_SNOOP",
1121 "MSRIndex": "0x1a6,0x1a7", 1120 "MSRIndex": "0x1a6,0x1a7",
1122 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1121 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1123 "SampleAfterValue": "100003", 1122 "SampleAfterValue": "100003",
1124 "CounterHTOff": "0,1,2,3" 1123 "CounterHTOff": "0,1,2,3"
1125 }, 1124 },
@@ -1132,7 +1131,7 @@
1132 "Counter": "0,1,2,3", 1131 "Counter": "0,1,2,3",
1133 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.ANY_RESPONSE", 1132 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.ANY_RESPONSE",
1134 "MSRIndex": "0x1a6,0x1a7", 1133 "MSRIndex": "0x1a6,0x1a7",
1135 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1134 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1136 "SampleAfterValue": "100003", 1135 "SampleAfterValue": "100003",
1137 "CounterHTOff": "0,1,2,3" 1136 "CounterHTOff": "0,1,2,3"
1138 }, 1137 },
@@ -1145,7 +1144,7 @@
1145 "Counter": "0,1,2,3", 1144 "Counter": "0,1,2,3",
1146 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.NO_SNOOP_NEEDED", 1145 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.NO_SNOOP_NEEDED",
1147 "MSRIndex": "0x1a6,0x1a7", 1146 "MSRIndex": "0x1a6,0x1a7",
1148 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1147 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1149 "SampleAfterValue": "100003", 1148 "SampleAfterValue": "100003",
1150 "CounterHTOff": "0,1,2,3" 1149 "CounterHTOff": "0,1,2,3"
1151 }, 1150 },
@@ -1158,7 +1157,7 @@
1158 "Counter": "0,1,2,3", 1157 "Counter": "0,1,2,3",
1159 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1158 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1160 "MSRIndex": "0x1a6,0x1a7", 1159 "MSRIndex": "0x1a6,0x1a7",
1161 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1160 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1162 "SampleAfterValue": "100003", 1161 "SampleAfterValue": "100003",
1163 "CounterHTOff": "0,1,2,3" 1162 "CounterHTOff": "0,1,2,3"
1164 }, 1163 },
@@ -1171,7 +1170,7 @@
1171 "Counter": "0,1,2,3", 1170 "Counter": "0,1,2,3",
1172 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD", 1171 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD",
1173 "MSRIndex": "0x1a6,0x1a7", 1172 "MSRIndex": "0x1a6,0x1a7",
1174 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1173 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1175 "SampleAfterValue": "100003", 1174 "SampleAfterValue": "100003",
1176 "CounterHTOff": "0,1,2,3" 1175 "CounterHTOff": "0,1,2,3"
1177 }, 1176 },
@@ -1184,7 +1183,7 @@
1184 "Counter": "0,1,2,3", 1183 "Counter": "0,1,2,3",
1185 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.HITM_OTHER_CORE", 1184 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.HITM_OTHER_CORE",
1186 "MSRIndex": "0x1a6,0x1a7", 1185 "MSRIndex": "0x1a6,0x1a7",
1187 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1186 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1188 "SampleAfterValue": "100003", 1187 "SampleAfterValue": "100003",
1189 "CounterHTOff": "0,1,2,3" 1188 "CounterHTOff": "0,1,2,3"
1190 }, 1189 },
@@ -1197,7 +1196,7 @@
1197 "Counter": "0,1,2,3", 1196 "Counter": "0,1,2,3",
1198 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.ANY_SNOOP", 1197 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_HIT.ANY_SNOOP",
1199 "MSRIndex": "0x1a6,0x1a7", 1198 "MSRIndex": "0x1a6,0x1a7",
1200 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1199 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1201 "SampleAfterValue": "100003", 1200 "SampleAfterValue": "100003",
1202 "CounterHTOff": "0,1,2,3" 1201 "CounterHTOff": "0,1,2,3"
1203 }, 1202 },
@@ -1210,7 +1209,7 @@
1210 "Counter": "0,1,2,3", 1209 "Counter": "0,1,2,3",
1211 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.ANY_RESPONSE", 1210 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.ANY_RESPONSE",
1212 "MSRIndex": "0x1a6,0x1a7", 1211 "MSRIndex": "0x1a6,0x1a7",
1213 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1212 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1214 "SampleAfterValue": "100003", 1213 "SampleAfterValue": "100003",
1215 "CounterHTOff": "0,1,2,3" 1214 "CounterHTOff": "0,1,2,3"
1216 }, 1215 },
@@ -1223,7 +1222,7 @@
1223 "Counter": "0,1,2,3", 1222 "Counter": "0,1,2,3",
1224 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.NO_SNOOP_NEEDED", 1223 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.NO_SNOOP_NEEDED",
1225 "MSRIndex": "0x1a6,0x1a7", 1224 "MSRIndex": "0x1a6,0x1a7",
1226 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1225 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1227 "SampleAfterValue": "100003", 1226 "SampleAfterValue": "100003",
1228 "CounterHTOff": "0,1,2,3" 1227 "CounterHTOff": "0,1,2,3"
1229 }, 1228 },
@@ -1236,7 +1235,7 @@
1236 "Counter": "0,1,2,3", 1235 "Counter": "0,1,2,3",
1237 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1236 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1238 "MSRIndex": "0x1a6,0x1a7", 1237 "MSRIndex": "0x1a6,0x1a7",
1239 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1238 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1240 "SampleAfterValue": "100003", 1239 "SampleAfterValue": "100003",
1241 "CounterHTOff": "0,1,2,3" 1240 "CounterHTOff": "0,1,2,3"
1242 }, 1241 },
@@ -1249,7 +1248,7 @@
1249 "Counter": "0,1,2,3", 1248 "Counter": "0,1,2,3",
1250 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_HIT_WITH_FWD", 1249 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.SNOOP_HIT_WITH_FWD",
1251 "MSRIndex": "0x1a6,0x1a7", 1250 "MSRIndex": "0x1a6,0x1a7",
1252 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1251 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1253 "SampleAfterValue": "100003", 1252 "SampleAfterValue": "100003",
1254 "CounterHTOff": "0,1,2,3" 1253 "CounterHTOff": "0,1,2,3"
1255 }, 1254 },
@@ -1262,7 +1261,7 @@
1262 "Counter": "0,1,2,3", 1261 "Counter": "0,1,2,3",
1263 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.HITM_OTHER_CORE", 1262 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.HITM_OTHER_CORE",
1264 "MSRIndex": "0x1a6,0x1a7", 1263 "MSRIndex": "0x1a6,0x1a7",
1265 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1264 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1266 "SampleAfterValue": "100003", 1265 "SampleAfterValue": "100003",
1267 "CounterHTOff": "0,1,2,3" 1266 "CounterHTOff": "0,1,2,3"
1268 }, 1267 },
@@ -1275,7 +1274,7 @@
1275 "Counter": "0,1,2,3", 1274 "Counter": "0,1,2,3",
1276 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.ANY_SNOOP", 1275 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_HIT.ANY_SNOOP",
1277 "MSRIndex": "0x1a6,0x1a7", 1276 "MSRIndex": "0x1a6,0x1a7",
1278 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1277 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1279 "SampleAfterValue": "100003", 1278 "SampleAfterValue": "100003",
1280 "CounterHTOff": "0,1,2,3" 1279 "CounterHTOff": "0,1,2,3"
1281 }, 1280 },
@@ -1288,7 +1287,7 @@
1288 "Counter": "0,1,2,3", 1287 "Counter": "0,1,2,3",
1289 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.ANY_RESPONSE", 1288 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.ANY_RESPONSE",
1290 "MSRIndex": "0x1a6,0x1a7", 1289 "MSRIndex": "0x1a6,0x1a7",
1291 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1290 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1292 "SampleAfterValue": "100003", 1291 "SampleAfterValue": "100003",
1293 "CounterHTOff": "0,1,2,3" 1292 "CounterHTOff": "0,1,2,3"
1294 }, 1293 },
@@ -1301,7 +1300,7 @@
1301 "Counter": "0,1,2,3", 1300 "Counter": "0,1,2,3",
1302 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.NO_SNOOP_NEEDED", 1301 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.NO_SNOOP_NEEDED",
1303 "MSRIndex": "0x1a6,0x1a7", 1302 "MSRIndex": "0x1a6,0x1a7",
1304 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1303 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1305 "SampleAfterValue": "100003", 1304 "SampleAfterValue": "100003",
1306 "CounterHTOff": "0,1,2,3" 1305 "CounterHTOff": "0,1,2,3"
1307 }, 1306 },
@@ -1314,7 +1313,7 @@
1314 "Counter": "0,1,2,3", 1313 "Counter": "0,1,2,3",
1315 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1314 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1316 "MSRIndex": "0x1a6,0x1a7", 1315 "MSRIndex": "0x1a6,0x1a7",
1317 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1316 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1318 "SampleAfterValue": "100003", 1317 "SampleAfterValue": "100003",
1319 "CounterHTOff": "0,1,2,3" 1318 "CounterHTOff": "0,1,2,3"
1320 }, 1319 },
@@ -1327,7 +1326,7 @@
1327 "Counter": "0,1,2,3", 1326 "Counter": "0,1,2,3",
1328 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.SNOOP_HIT_WITH_FWD", 1327 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.SNOOP_HIT_WITH_FWD",
1329 "MSRIndex": "0x1a6,0x1a7", 1328 "MSRIndex": "0x1a6,0x1a7",
1330 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1329 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1331 "SampleAfterValue": "100003", 1330 "SampleAfterValue": "100003",
1332 "CounterHTOff": "0,1,2,3" 1331 "CounterHTOff": "0,1,2,3"
1333 }, 1332 },
@@ -1340,7 +1339,7 @@
1340 "Counter": "0,1,2,3", 1339 "Counter": "0,1,2,3",
1341 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.HITM_OTHER_CORE", 1340 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.HITM_OTHER_CORE",
1342 "MSRIndex": "0x1a6,0x1a7", 1341 "MSRIndex": "0x1a6,0x1a7",
1343 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1342 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1344 "SampleAfterValue": "100003", 1343 "SampleAfterValue": "100003",
1345 "CounterHTOff": "0,1,2,3" 1344 "CounterHTOff": "0,1,2,3"
1346 }, 1345 },
@@ -1353,7 +1352,85 @@
1353 "Counter": "0,1,2,3", 1352 "Counter": "0,1,2,3",
1354 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.ANY_SNOOP", 1353 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_HIT.ANY_SNOOP",
1355 "MSRIndex": "0x1a6,0x1a7", 1354 "MSRIndex": "0x1a6,0x1a7",
1356 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1355 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1356 "SampleAfterValue": "100003",
1357 "CounterHTOff": "0,1,2,3"
1358 },
1359 {
1360 "Offcore": "1",
1361 "EventCode": "0xB7, 0xBB",
1362 "UMask": "0x1",
1363 "BriefDescription": "Counts any other requests that have any response type.",
1364 "MSRValue": "0x0000018000 ",
1365 "Counter": "0,1,2,3",
1366 "EventName": "OFFCORE_RESPONSE.OTHER.ANY_RESPONSE",
1367 "MSRIndex": "0x1a6,0x1a7",
1368 "PublicDescription": "Counts any other requests that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1369 "SampleAfterValue": "100003",
1370 "CounterHTOff": "0,1,2,3"
1371 },
1372 {
1373 "Offcore": "1",
1374 "EventCode": "0xB7, 0xBB",
1375 "UMask": "0x1",
1376 "BriefDescription": "Counts any other requests that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.",
1377 "MSRValue": "0x01003c8000 ",
1378 "Counter": "0,1,2,3",
1379 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.NO_SNOOP_NEEDED",
1380 "MSRIndex": "0x1a6,0x1a7",
1381 "PublicDescription": "Counts any other requests that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1382 "SampleAfterValue": "100003",
1383 "CounterHTOff": "0,1,2,3"
1384 },
1385 {
1386 "Offcore": "1",
1387 "EventCode": "0xB7, 0xBB",
1388 "UMask": "0x1",
1389 "BriefDescription": "Counts any other requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.",
1390 "MSRValue": "0x04003c8000 ",
1391 "Counter": "0,1,2,3",
1392 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1393 "MSRIndex": "0x1a6,0x1a7",
1394 "PublicDescription": "Counts any other requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1395 "SampleAfterValue": "100003",
1396 "CounterHTOff": "0,1,2,3"
1397 },
1398 {
1399 "Offcore": "1",
1400 "EventCode": "0xB7, 0xBB",
1401 "UMask": "0x1",
1402 "BriefDescription": "OTHER & L3_HIT & SNOOP_HIT_WITH_FWD",
1403 "MSRValue": "0x08003c8000 ",
1404 "Counter": "0,1,2,3",
1405 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.SNOOP_HIT_WITH_FWD",
1406 "MSRIndex": "0x1a6,0x1a7",
1407 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1408 "SampleAfterValue": "100003",
1409 "CounterHTOff": "0,1,2,3"
1410 },
1411 {
1412 "Offcore": "1",
1413 "EventCode": "0xB7, 0xBB",
1414 "UMask": "0x1",
1415 "BriefDescription": "Counts any other requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.",
1416 "MSRValue": "0x10003c8000 ",
1417 "Counter": "0,1,2,3",
1418 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.HITM_OTHER_CORE",
1419 "MSRIndex": "0x1a6,0x1a7",
1420 "PublicDescription": "Counts any other requests that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1421 "SampleAfterValue": "100003",
1422 "CounterHTOff": "0,1,2,3"
1423 },
1424 {
1425 "Offcore": "1",
1426 "EventCode": "0xB7, 0xBB",
1427 "UMask": "0x1",
1428 "BriefDescription": "Counts any other requests that hit in the L3.",
1429 "MSRValue": "0x3f803c8000 ",
1430 "Counter": "0,1,2,3",
1431 "EventName": "OFFCORE_RESPONSE.OTHER.L3_HIT.ANY_SNOOP",
1432 "MSRIndex": "0x1a6,0x1a7",
1433 "PublicDescription": "Counts any other requests that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1357 "SampleAfterValue": "100003", 1434 "SampleAfterValue": "100003",
1358 "CounterHTOff": "0,1,2,3" 1435 "CounterHTOff": "0,1,2,3"
1359 }, 1436 },
@@ -1366,7 +1443,7 @@
1366 "Counter": "0,1,2,3", 1443 "Counter": "0,1,2,3",
1367 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.ANY_RESPONSE", 1444 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.ANY_RESPONSE",
1368 "MSRIndex": "0x1a6,0x1a7", 1445 "MSRIndex": "0x1a6,0x1a7",
1369 "PublicDescription": "Counts all prefetch data reads that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1446 "PublicDescription": "Counts all prefetch data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1370 "SampleAfterValue": "100003", 1447 "SampleAfterValue": "100003",
1371 "CounterHTOff": "0,1,2,3" 1448 "CounterHTOff": "0,1,2,3"
1372 }, 1449 },
@@ -1379,7 +1456,7 @@
1379 "Counter": "0,1,2,3", 1456 "Counter": "0,1,2,3",
1380 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.NO_SNOOP_NEEDED", 1457 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.NO_SNOOP_NEEDED",
1381 "MSRIndex": "0x1a6,0x1a7", 1458 "MSRIndex": "0x1a6,0x1a7",
1382 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1459 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1383 "SampleAfterValue": "100003", 1460 "SampleAfterValue": "100003",
1384 "CounterHTOff": "0,1,2,3" 1461 "CounterHTOff": "0,1,2,3"
1385 }, 1462 },
@@ -1392,7 +1469,7 @@
1392 "Counter": "0,1,2,3", 1469 "Counter": "0,1,2,3",
1393 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1470 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1394 "MSRIndex": "0x1a6,0x1a7", 1471 "MSRIndex": "0x1a6,0x1a7",
1395 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1472 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1396 "SampleAfterValue": "100003", 1473 "SampleAfterValue": "100003",
1397 "CounterHTOff": "0,1,2,3" 1474 "CounterHTOff": "0,1,2,3"
1398 }, 1475 },
@@ -1405,7 +1482,7 @@
1405 "Counter": "0,1,2,3", 1482 "Counter": "0,1,2,3",
1406 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD", 1483 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD",
1407 "MSRIndex": "0x1a6,0x1a7", 1484 "MSRIndex": "0x1a6,0x1a7",
1408 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1485 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1409 "SampleAfterValue": "100003", 1486 "SampleAfterValue": "100003",
1410 "CounterHTOff": "0,1,2,3" 1487 "CounterHTOff": "0,1,2,3"
1411 }, 1488 },
@@ -1418,7 +1495,7 @@
1418 "Counter": "0,1,2,3", 1495 "Counter": "0,1,2,3",
1419 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.HITM_OTHER_CORE", 1496 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.HITM_OTHER_CORE",
1420 "MSRIndex": "0x1a6,0x1a7", 1497 "MSRIndex": "0x1a6,0x1a7",
1421 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1498 "PublicDescription": "Counts all prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1422 "SampleAfterValue": "100003", 1499 "SampleAfterValue": "100003",
1423 "CounterHTOff": "0,1,2,3" 1500 "CounterHTOff": "0,1,2,3"
1424 }, 1501 },
@@ -1431,7 +1508,7 @@
1431 "Counter": "0,1,2,3", 1508 "Counter": "0,1,2,3",
1432 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.ANY_SNOOP", 1509 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_HIT.ANY_SNOOP",
1433 "MSRIndex": "0x1a6,0x1a7", 1510 "MSRIndex": "0x1a6,0x1a7",
1434 "PublicDescription": "Counts all prefetch data reads that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1511 "PublicDescription": "Counts all prefetch data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1435 "SampleAfterValue": "100003", 1512 "SampleAfterValue": "100003",
1436 "CounterHTOff": "0,1,2,3" 1513 "CounterHTOff": "0,1,2,3"
1437 }, 1514 },
@@ -1444,7 +1521,7 @@
1444 "Counter": "0,1,2,3", 1521 "Counter": "0,1,2,3",
1445 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.ANY_RESPONSE", 1522 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.ANY_RESPONSE",
1446 "MSRIndex": "0x1a6,0x1a7", 1523 "MSRIndex": "0x1a6,0x1a7",
1447 "PublicDescription": "Counts prefetch RFOs that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1524 "PublicDescription": "Counts prefetch RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1448 "SampleAfterValue": "100003", 1525 "SampleAfterValue": "100003",
1449 "CounterHTOff": "0,1,2,3" 1526 "CounterHTOff": "0,1,2,3"
1450 }, 1527 },
@@ -1457,7 +1534,7 @@
1457 "Counter": "0,1,2,3", 1534 "Counter": "0,1,2,3",
1458 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.NO_SNOOP_NEEDED", 1535 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.NO_SNOOP_NEEDED",
1459 "MSRIndex": "0x1a6,0x1a7", 1536 "MSRIndex": "0x1a6,0x1a7",
1460 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1537 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1461 "SampleAfterValue": "100003", 1538 "SampleAfterValue": "100003",
1462 "CounterHTOff": "0,1,2,3" 1539 "CounterHTOff": "0,1,2,3"
1463 }, 1540 },
@@ -1470,7 +1547,7 @@
1470 "Counter": "0,1,2,3", 1547 "Counter": "0,1,2,3",
1471 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1548 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1472 "MSRIndex": "0x1a6,0x1a7", 1549 "MSRIndex": "0x1a6,0x1a7",
1473 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1550 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1474 "SampleAfterValue": "100003", 1551 "SampleAfterValue": "100003",
1475 "CounterHTOff": "0,1,2,3" 1552 "CounterHTOff": "0,1,2,3"
1476 }, 1553 },
@@ -1483,7 +1560,7 @@
1483 "Counter": "0,1,2,3", 1560 "Counter": "0,1,2,3",
1484 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.SNOOP_HIT_WITH_FWD", 1561 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.SNOOP_HIT_WITH_FWD",
1485 "MSRIndex": "0x1a6,0x1a7", 1562 "MSRIndex": "0x1a6,0x1a7",
1486 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1563 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1487 "SampleAfterValue": "100003", 1564 "SampleAfterValue": "100003",
1488 "CounterHTOff": "0,1,2,3" 1565 "CounterHTOff": "0,1,2,3"
1489 }, 1566 },
@@ -1496,7 +1573,7 @@
1496 "Counter": "0,1,2,3", 1573 "Counter": "0,1,2,3",
1497 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.HITM_OTHER_CORE", 1574 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.HITM_OTHER_CORE",
1498 "MSRIndex": "0x1a6,0x1a7", 1575 "MSRIndex": "0x1a6,0x1a7",
1499 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1576 "PublicDescription": "Counts prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1500 "SampleAfterValue": "100003", 1577 "SampleAfterValue": "100003",
1501 "CounterHTOff": "0,1,2,3" 1578 "CounterHTOff": "0,1,2,3"
1502 }, 1579 },
@@ -1509,7 +1586,7 @@
1509 "Counter": "0,1,2,3", 1586 "Counter": "0,1,2,3",
1510 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.ANY_SNOOP", 1587 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_HIT.ANY_SNOOP",
1511 "MSRIndex": "0x1a6,0x1a7", 1588 "MSRIndex": "0x1a6,0x1a7",
1512 "PublicDescription": "Counts prefetch RFOs that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1589 "PublicDescription": "Counts prefetch RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1513 "SampleAfterValue": "100003", 1590 "SampleAfterValue": "100003",
1514 "CounterHTOff": "0,1,2,3" 1591 "CounterHTOff": "0,1,2,3"
1515 }, 1592 },
@@ -1522,7 +1599,7 @@
1522 "Counter": "0,1,2,3", 1599 "Counter": "0,1,2,3",
1523 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.ANY_RESPONSE", 1600 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.ANY_RESPONSE",
1524 "MSRIndex": "0x1a6,0x1a7", 1601 "MSRIndex": "0x1a6,0x1a7",
1525 "PublicDescription": "Counts all demand & prefetch data reads that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1602 "PublicDescription": "Counts all demand & prefetch data reads that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1526 "SampleAfterValue": "100003", 1603 "SampleAfterValue": "100003",
1527 "CounterHTOff": "0,1,2,3" 1604 "CounterHTOff": "0,1,2,3"
1528 }, 1605 },
@@ -1535,7 +1612,7 @@
1535 "Counter": "0,1,2,3", 1612 "Counter": "0,1,2,3",
1536 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.NO_SNOOP_NEEDED", 1613 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.NO_SNOOP_NEEDED",
1537 "MSRIndex": "0x1a6,0x1a7", 1614 "MSRIndex": "0x1a6,0x1a7",
1538 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1615 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1539 "SampleAfterValue": "100003", 1616 "SampleAfterValue": "100003",
1540 "CounterHTOff": "0,1,2,3" 1617 "CounterHTOff": "0,1,2,3"
1541 }, 1618 },
@@ -1548,7 +1625,7 @@
1548 "Counter": "0,1,2,3", 1625 "Counter": "0,1,2,3",
1549 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1626 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1550 "MSRIndex": "0x1a6,0x1a7", 1627 "MSRIndex": "0x1a6,0x1a7",
1551 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1628 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1552 "SampleAfterValue": "100003", 1629 "SampleAfterValue": "100003",
1553 "CounterHTOff": "0,1,2,3" 1630 "CounterHTOff": "0,1,2,3"
1554 }, 1631 },
@@ -1561,7 +1638,7 @@
1561 "Counter": "0,1,2,3", 1638 "Counter": "0,1,2,3",
1562 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD", 1639 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.SNOOP_HIT_WITH_FWD",
1563 "MSRIndex": "0x1a6,0x1a7", 1640 "MSRIndex": "0x1a6,0x1a7",
1564 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1641 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1565 "SampleAfterValue": "100003", 1642 "SampleAfterValue": "100003",
1566 "CounterHTOff": "0,1,2,3" 1643 "CounterHTOff": "0,1,2,3"
1567 }, 1644 },
@@ -1574,7 +1651,7 @@
1574 "Counter": "0,1,2,3", 1651 "Counter": "0,1,2,3",
1575 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.HITM_OTHER_CORE", 1652 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.HITM_OTHER_CORE",
1576 "MSRIndex": "0x1a6,0x1a7", 1653 "MSRIndex": "0x1a6,0x1a7",
1577 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1654 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1578 "SampleAfterValue": "100003", 1655 "SampleAfterValue": "100003",
1579 "CounterHTOff": "0,1,2,3" 1656 "CounterHTOff": "0,1,2,3"
1580 }, 1657 },
@@ -1587,7 +1664,7 @@
1587 "Counter": "0,1,2,3", 1664 "Counter": "0,1,2,3",
1588 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.ANY_SNOOP", 1665 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_HIT.ANY_SNOOP",
1589 "MSRIndex": "0x1a6,0x1a7", 1666 "MSRIndex": "0x1a6,0x1a7",
1590 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1667 "PublicDescription": "Counts all demand & prefetch data reads that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1591 "SampleAfterValue": "100003", 1668 "SampleAfterValue": "100003",
1592 "CounterHTOff": "0,1,2,3" 1669 "CounterHTOff": "0,1,2,3"
1593 }, 1670 },
@@ -1600,7 +1677,7 @@
1600 "Counter": "0,1,2,3", 1677 "Counter": "0,1,2,3",
1601 "EventName": "OFFCORE_RESPONSE.ALL_RFO.ANY_RESPONSE", 1678 "EventName": "OFFCORE_RESPONSE.ALL_RFO.ANY_RESPONSE",
1602 "MSRIndex": "0x1a6,0x1a7", 1679 "MSRIndex": "0x1a6,0x1a7",
1603 "PublicDescription": "Counts all demand & prefetch RFOs that have any response type.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1680 "PublicDescription": "Counts all demand & prefetch RFOs that have any response type. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1604 "SampleAfterValue": "100003", 1681 "SampleAfterValue": "100003",
1605 "CounterHTOff": "0,1,2,3" 1682 "CounterHTOff": "0,1,2,3"
1606 }, 1683 },
@@ -1613,7 +1690,7 @@
1613 "Counter": "0,1,2,3", 1690 "Counter": "0,1,2,3",
1614 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.NO_SNOOP_NEEDED", 1691 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.NO_SNOOP_NEEDED",
1615 "MSRIndex": "0x1a6,0x1a7", 1692 "MSRIndex": "0x1a6,0x1a7",
1616 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1693 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and sibling core snoops are not needed as either the core-valid bit is not set or the shared line is present in multiple cores. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1617 "SampleAfterValue": "100003", 1694 "SampleAfterValue": "100003",
1618 "CounterHTOff": "0,1,2,3" 1695 "CounterHTOff": "0,1,2,3"
1619 }, 1696 },
@@ -1626,7 +1703,7 @@
1626 "Counter": "0,1,2,3", 1703 "Counter": "0,1,2,3",
1627 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD", 1704 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.HIT_OTHER_CORE_NO_FWD",
1628 "MSRIndex": "0x1a6,0x1a7", 1705 "MSRIndex": "0x1a6,0x1a7",
1629 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1706 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1630 "SampleAfterValue": "100003", 1707 "SampleAfterValue": "100003",
1631 "CounterHTOff": "0,1,2,3" 1708 "CounterHTOff": "0,1,2,3"
1632 }, 1709 },
@@ -1639,7 +1716,7 @@
1639 "Counter": "0,1,2,3", 1716 "Counter": "0,1,2,3",
1640 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.SNOOP_HIT_WITH_FWD", 1717 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.SNOOP_HIT_WITH_FWD",
1641 "MSRIndex": "0x1a6,0x1a7", 1718 "MSRIndex": "0x1a6,0x1a7",
1642 "PublicDescription": "tbd; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1719 "PublicDescription": "tbd Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1643 "SampleAfterValue": "100003", 1720 "SampleAfterValue": "100003",
1644 "CounterHTOff": "0,1,2,3" 1721 "CounterHTOff": "0,1,2,3"
1645 }, 1722 },
@@ -1652,7 +1729,7 @@
1652 "Counter": "0,1,2,3", 1729 "Counter": "0,1,2,3",
1653 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.HITM_OTHER_CORE", 1730 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.HITM_OTHER_CORE",
1654 "MSRIndex": "0x1a6,0x1a7", 1731 "MSRIndex": "0x1a6,0x1a7",
1655 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1732 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3 and the snoop to one of the sibling cores hits the line in M state and the line is forwarded. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1656 "SampleAfterValue": "100003", 1733 "SampleAfterValue": "100003",
1657 "CounterHTOff": "0,1,2,3" 1734 "CounterHTOff": "0,1,2,3"
1658 }, 1735 },
@@ -1665,7 +1742,7 @@
1665 "Counter": "0,1,2,3", 1742 "Counter": "0,1,2,3",
1666 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.ANY_SNOOP", 1743 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_HIT.ANY_SNOOP",
1667 "MSRIndex": "0x1a6,0x1a7", 1744 "MSRIndex": "0x1a6,0x1a7",
1668 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3.; Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 1745 "PublicDescription": "Counts all demand & prefetch RFOs that hit in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1669 "SampleAfterValue": "100003", 1746 "SampleAfterValue": "100003",
1670 "CounterHTOff": "0,1,2,3" 1747 "CounterHTOff": "0,1,2,3"
1671 } 1748 }
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/floating-point.json b/tools/perf/pmu-events/arch/x86/skylakex/floating-point.json
index 1c09a328df36..286ed1a37ec9 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/floating-point.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/floating-point.json
@@ -29,10 +29,9 @@
29 { 29 {
30 "EventCode": "0xC7", 30 "EventCode": "0xC7",
31 "UMask": "0x8", 31 "UMask": "0x8",
32 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element. ", 32 "BriefDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
33 "Counter": "0,1,2,3", 33 "Counter": "0,1,2,3",
34 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE", 34 "EventName": "FP_ARITH_INST_RETIRED.128B_PACKED_SINGLE",
35 "PublicDescription": "Number of SSE/AVX computational 128-bit packed single precision floating-point instructions retired. Each count represents 4 computations. Applies to SSE* and AVX* packed single precision floating-point instructions: ADD SUB MUL DIV MIN MAX RCP RSQRT SQRT DPP FM(N)ADD/SUB. DPP and FM(N)ADD/SUB instructions count twice as they perform multiple calculations per element.",
36 "SampleAfterValue": "2000003", 35 "SampleAfterValue": "2000003",
37 "CounterHTOff": "0,1,2,3,4,5,6,7" 36 "CounterHTOff": "0,1,2,3,4,5,6,7"
38 }, 37 },
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/frontend.json b/tools/perf/pmu-events/arch/x86/skylakex/frontend.json
index 40abc0852cd6..403a4f89e9b2 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/frontend.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/frontend.json
@@ -182,7 +182,7 @@
182 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled", 182 "BriefDescription": "Uops not delivered to Resource Allocation Table (RAT) per thread when backend of the machine is not stalled",
183 "Counter": "0,1,2,3", 183 "Counter": "0,1,2,3",
184 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE", 184 "EventName": "IDQ_UOPS_NOT_DELIVERED.CORE",
185 "PublicDescription": "Counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding \u201c4 \u2013 x\u201d when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when: a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread. b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions). c. Instruction Decode Queue (IDQ) delivers four uops.", 185 "PublicDescription": "Counts the number of uops not delivered to Resource Allocation Table (RAT) per thread adding 4 x when Resource Allocation Table (RAT) is not stalled and Instruction Decode Queue (IDQ) delivers x uops to Resource Allocation Table (RAT) (where x belongs to {0,1,2,3}). Counting does not cover cases when: a. IDQ-Resource Allocation Table (RAT) pipe serves the other thread. b. Resource Allocation Table (RAT) is stalled for the thread (including uop drops and clear BE conditions). c. Instruction Decode Queue (IDQ) delivers four uops.",
186 "SampleAfterValue": "2000003", 186 "SampleAfterValue": "2000003",
187 "CounterHTOff": "0,1,2,3,4,5,6,7" 187 "CounterHTOff": "0,1,2,3,4,5,6,7"
188 }, 188 },
@@ -247,20 +247,20 @@
247 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.", 247 "BriefDescription": "Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles.",
248 "Counter": "0,1,2,3", 248 "Counter": "0,1,2,3",
249 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES", 249 "EventName": "DSB2MITE_SWITCHES.PENALTY_CYCLES",
250 "PublicDescription": "Counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. MM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.Penalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 0\u20132 cycles.", 250 "PublicDescription": "Counts Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles. These cycles do not include uops routed through because of the switch itself, for example, when Instruction Decode Queue (IDQ) pre-allocation is unavailable, or Instruction Decode Queue (IDQ) is full. SBD-to-MITE switch true penalty cycles happen after the merge mux (MM) receives Decode Stream Buffer (DSB) Sync-indication until receiving the first MITE uop. MM is placed before Instruction Decode Queue (IDQ) to merge uops being fed from the MITE and Decode Stream Buffer (DSB) paths. Decode Stream Buffer (DSB) inserts the Sync-indication whenever a Decode Stream Buffer (DSB)-to-MITE switch occurs.Penalty: A Decode Stream Buffer (DSB) hit followed by a Decode Stream Buffer (DSB) miss can cost up to six cycles in which no uops are delivered to the IDQ. Most often, such switches from the Decode Stream Buffer (DSB) to the legacy pipeline cost 02 cycles.",
251 "SampleAfterValue": "2000003", 251 "SampleAfterValue": "2000003",
252 "CounterHTOff": "0,1,2,3,4,5,6,7" 252 "CounterHTOff": "0,1,2,3,4,5,6,7"
253 }, 253 },
254 { 254 {
255 "EventCode": "0xC6", 255 "EventCode": "0xC6",
256 "UMask": "0x1", 256 "UMask": "0x1",
257 "BriefDescription": "Retired Instructions who experienced decode stream buffer (DSB - the decoded instruction-cache) miss.", 257 "BriefDescription": "Retired Instructions who experienced decode stream buffer (DSB - the decoded instruction-cache) miss. Precise Event.",
258 "PEBS": "1", 258 "PEBS": "1",
259 "MSRValue": "0x11", 259 "MSRValue": "0x11",
260 "Counter": "0,1,2,3", 260 "Counter": "0,1,2,3",
261 "EventName": "FRONTEND_RETIRED.DSB_MISS", 261 "EventName": "FRONTEND_RETIRED.DSB_MISS",
262 "MSRIndex": "0x3F7", 262 "MSRIndex": "0x3F7",
263 "PublicDescription": "Counts retired Instructions that experienced DSB (Decode stream buffer i.e. the decoded instruction-cache) miss. ", 263 "PublicDescription": "Counts retired Instructions that experienced DSB (Decode stream buffer i.e. the decoded instruction-cache) miss. \r\n",
264 "TakenAlone": "1", 264 "TakenAlone": "1",
265 "SampleAfterValue": "100007", 265 "SampleAfterValue": "100007",
266 "CounterHTOff": "0,1,2,3" 266 "CounterHTOff": "0,1,2,3"
@@ -268,7 +268,7 @@
268 { 268 {
269 "EventCode": "0xC6", 269 "EventCode": "0xC6",
270 "UMask": "0x1", 270 "UMask": "0x1",
271 "BriefDescription": "Retired Instructions who experienced Instruction L1 Cache true miss.", 271 "BriefDescription": "Retired Instructions who experienced Instruction L1 Cache true miss. Precise Event.",
272 "PEBS": "1", 272 "PEBS": "1",
273 "MSRValue": "0x12", 273 "MSRValue": "0x12",
274 "Counter": "0,1,2,3", 274 "Counter": "0,1,2,3",
@@ -281,7 +281,7 @@
281 { 281 {
282 "EventCode": "0xC6", 282 "EventCode": "0xC6",
283 "UMask": "0x1", 283 "UMask": "0x1",
284 "BriefDescription": "Retired Instructions who experienced Instruction L2 Cache true miss.", 284 "BriefDescription": "Retired Instructions who experienced Instruction L2 Cache true miss. Precise Event.",
285 "PEBS": "1", 285 "PEBS": "1",
286 "MSRValue": "0x13", 286 "MSRValue": "0x13",
287 "Counter": "0,1,2,3", 287 "Counter": "0,1,2,3",
@@ -294,7 +294,7 @@
294 { 294 {
295 "EventCode": "0xC6", 295 "EventCode": "0xC6",
296 "UMask": "0x1", 296 "UMask": "0x1",
297 "BriefDescription": "Retired Instructions who experienced iTLB true miss.", 297 "BriefDescription": "Retired Instructions who experienced iTLB true miss. Precise Event.",
298 "PEBS": "1", 298 "PEBS": "1",
299 "MSRValue": "0x14", 299 "MSRValue": "0x14",
300 "Counter": "0,1,2,3", 300 "Counter": "0,1,2,3",
@@ -308,13 +308,13 @@
308 { 308 {
309 "EventCode": "0xC6", 309 "EventCode": "0xC6",
310 "UMask": "0x1", 310 "UMask": "0x1",
311 "BriefDescription": "Retired Instructions who experienced STLB (2nd level TLB) true miss.", 311 "BriefDescription": "Retired Instructions who experienced STLB (2nd level TLB) true miss. Precise Event.",
312 "PEBS": "1", 312 "PEBS": "1",
313 "MSRValue": "0x15", 313 "MSRValue": "0x15",
314 "Counter": "0,1,2,3", 314 "Counter": "0,1,2,3",
315 "EventName": "FRONTEND_RETIRED.STLB_MISS", 315 "EventName": "FRONTEND_RETIRED.STLB_MISS",
316 "MSRIndex": "0x3F7", 316 "MSRIndex": "0x3F7",
317 "PublicDescription": "Counts retired Instructions that experienced STLB (2nd level TLB) true miss. ", 317 "PublicDescription": "Counts retired Instructions that experienced STLB (2nd level TLB) true miss.",
318 "TakenAlone": "1", 318 "TakenAlone": "1",
319 "SampleAfterValue": "100007", 319 "SampleAfterValue": "100007",
320 "CounterHTOff": "0,1,2,3" 320 "CounterHTOff": "0,1,2,3"
@@ -322,7 +322,7 @@
322 { 322 {
323 "EventCode": "0xC6", 323 "EventCode": "0xC6",
324 "UMask": "0x1", 324 "UMask": "0x1",
325 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 2 cycles which was not interrupted by a back-end stall.", 325 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
326 "PEBS": "1", 326 "PEBS": "1",
327 "MSRValue": "0x400206", 327 "MSRValue": "0x400206",
328 "Counter": "0,1,2,3", 328 "Counter": "0,1,2,3",
@@ -335,7 +335,7 @@
335 { 335 {
336 "EventCode": "0xC6", 336 "EventCode": "0xC6",
337 "UMask": "0x1", 337 "UMask": "0x1",
338 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 2 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall.", 338 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 2 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
339 "PEBS": "1", 339 "PEBS": "1",
340 "MSRValue": "0x200206", 340 "MSRValue": "0x200206",
341 "Counter": "0,1,2,3", 341 "Counter": "0,1,2,3",
@@ -348,7 +348,7 @@
348 { 348 {
349 "EventCode": "0xC6", 349 "EventCode": "0xC6",
350 "UMask": "0x1", 350 "UMask": "0x1",
351 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 4 cycles which was not interrupted by a back-end stall.", 351 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 4 cycles which was not interrupted by a back-end stall. Precise Event.",
352 "PEBS": "1", 352 "PEBS": "1",
353 "MSRValue": "0x400406", 353 "MSRValue": "0x400406",
354 "Counter": "0,1,2,3", 354 "Counter": "0,1,2,3",
@@ -367,7 +367,7 @@
367 "Counter": "0,1,2,3", 367 "Counter": "0,1,2,3",
368 "EventName": "FRONTEND_RETIRED.LATENCY_GE_8", 368 "EventName": "FRONTEND_RETIRED.LATENCY_GE_8",
369 "MSRIndex": "0x3F7", 369 "MSRIndex": "0x3F7",
370 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 8 cycles. During this period the front-end delivered no uops.", 370 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 8 cycles. During this period the front-end delivered no uops. \r\n",
371 "TakenAlone": "1", 371 "TakenAlone": "1",
372 "SampleAfterValue": "100007", 372 "SampleAfterValue": "100007",
373 "CounterHTOff": "0,1,2,3" 373 "CounterHTOff": "0,1,2,3"
@@ -375,13 +375,13 @@
375 { 375 {
376 "EventCode": "0xC6", 376 "EventCode": "0xC6",
377 "UMask": "0x1", 377 "UMask": "0x1",
378 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 16 cycles which was not interrupted by a back-end stall.", 378 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 16 cycles which was not interrupted by a back-end stall. Precise Event.",
379 "PEBS": "1", 379 "PEBS": "1",
380 "MSRValue": "0x401006", 380 "MSRValue": "0x401006",
381 "Counter": "0,1,2,3", 381 "Counter": "0,1,2,3",
382 "EventName": "FRONTEND_RETIRED.LATENCY_GE_16", 382 "EventName": "FRONTEND_RETIRED.LATENCY_GE_16",
383 "MSRIndex": "0x3F7", 383 "MSRIndex": "0x3F7",
384 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 16 cycles. During this period the front-end delivered no uops.", 384 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 16 cycles. During this period the front-end delivered no uops.\r\n",
385 "TakenAlone": "1", 385 "TakenAlone": "1",
386 "SampleAfterValue": "100007", 386 "SampleAfterValue": "100007",
387 "CounterHTOff": "0,1,2,3" 387 "CounterHTOff": "0,1,2,3"
@@ -389,13 +389,13 @@
389 { 389 {
390 "EventCode": "0xC6", 390 "EventCode": "0xC6",
391 "UMask": "0x1", 391 "UMask": "0x1",
392 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 32 cycles which was not interrupted by a back-end stall.", 392 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 32 cycles which was not interrupted by a back-end stall. Precise Event.",
393 "PEBS": "1", 393 "PEBS": "1",
394 "MSRValue": "0x402006", 394 "MSRValue": "0x402006",
395 "Counter": "0,1,2,3", 395 "Counter": "0,1,2,3",
396 "EventName": "FRONTEND_RETIRED.LATENCY_GE_32", 396 "EventName": "FRONTEND_RETIRED.LATENCY_GE_32",
397 "MSRIndex": "0x3F7", 397 "MSRIndex": "0x3F7",
398 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 32 cycles. During this period the front-end delivered no uops.", 398 "PublicDescription": "Counts retired instructions that are delivered to the back-end after a front-end stall of at least 32 cycles. During this period the front-end delivered no uops.\r\n",
399 "TakenAlone": "1", 399 "TakenAlone": "1",
400 "SampleAfterValue": "100007", 400 "SampleAfterValue": "100007",
401 "CounterHTOff": "0,1,2,3" 401 "CounterHTOff": "0,1,2,3"
@@ -403,7 +403,7 @@
403 { 403 {
404 "EventCode": "0xC6", 404 "EventCode": "0xC6",
405 "UMask": "0x1", 405 "UMask": "0x1",
406 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 64 cycles which was not interrupted by a back-end stall.", 406 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 64 cycles which was not interrupted by a back-end stall. Precise Event.",
407 "PEBS": "1", 407 "PEBS": "1",
408 "MSRValue": "0x404006", 408 "MSRValue": "0x404006",
409 "Counter": "0,1,2,3", 409 "Counter": "0,1,2,3",
@@ -416,7 +416,7 @@
416 { 416 {
417 "EventCode": "0xC6", 417 "EventCode": "0xC6",
418 "UMask": "0x1", 418 "UMask": "0x1",
419 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 128 cycles which was not interrupted by a back-end stall.", 419 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 128 cycles which was not interrupted by a back-end stall. Precise Event.",
420 "PEBS": "1", 420 "PEBS": "1",
421 "MSRValue": "0x408006", 421 "MSRValue": "0x408006",
422 "Counter": "0,1,2,3", 422 "Counter": "0,1,2,3",
@@ -429,7 +429,7 @@
429 { 429 {
430 "EventCode": "0xC6", 430 "EventCode": "0xC6",
431 "UMask": "0x1", 431 "UMask": "0x1",
432 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 256 cycles which was not interrupted by a back-end stall.", 432 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 256 cycles which was not interrupted by a back-end stall. Precise Event.",
433 "PEBS": "1", 433 "PEBS": "1",
434 "MSRValue": "0x410006", 434 "MSRValue": "0x410006",
435 "Counter": "0,1,2,3", 435 "Counter": "0,1,2,3",
@@ -442,7 +442,7 @@
442 { 442 {
443 "EventCode": "0xC6", 443 "EventCode": "0xC6",
444 "UMask": "0x1", 444 "UMask": "0x1",
445 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 512 cycles which was not interrupted by a back-end stall.", 445 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end delivered no uops for a period of 512 cycles which was not interrupted by a back-end stall. Precise Event.",
446 "PEBS": "1", 446 "PEBS": "1",
447 "MSRValue": "0x420006", 447 "MSRValue": "0x420006",
448 "Counter": "0,1,2,3", 448 "Counter": "0,1,2,3",
@@ -455,13 +455,13 @@
455 { 455 {
456 "EventCode": "0xC6", 456 "EventCode": "0xC6",
457 "UMask": "0x1", 457 "UMask": "0x1",
458 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 1 bubble-slot for a period of 2 cycles which was not interrupted by a back-end stall.", 458 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 1 bubble-slot for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
459 "PEBS": "1", 459 "PEBS": "1",
460 "MSRValue": "0x100206", 460 "MSRValue": "0x100206",
461 "Counter": "0,1,2,3", 461 "Counter": "0,1,2,3",
462 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1", 462 "EventName": "FRONTEND_RETIRED.LATENCY_GE_2_BUBBLES_GE_1",
463 "MSRIndex": "0x3F7", 463 "MSRIndex": "0x3F7",
464 "PublicDescription": "Counts retired instructions that are delivered to the back-end after the front-end had at least 1 bubble-slot for a period of 2 cycles. A bubble-slot is an empty issue-pipeline slot while there was no RAT stall.", 464 "PublicDescription": "Counts retired instructions that are delivered to the back-end after the front-end had at least 1 bubble-slot for a period of 2 cycles. A bubble-slot is an empty issue-pipeline slot while there was no RAT stall.\r\n",
465 "TakenAlone": "1", 465 "TakenAlone": "1",
466 "SampleAfterValue": "100007", 466 "SampleAfterValue": "100007",
467 "CounterHTOff": "0,1,2,3" 467 "CounterHTOff": "0,1,2,3"
@@ -469,7 +469,7 @@
469 { 469 {
470 "EventCode": "0xC6", 470 "EventCode": "0xC6",
471 "UMask": "0x1", 471 "UMask": "0x1",
472 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 3 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall.", 472 "BriefDescription": "Retired instructions that are fetched after an interval where the front-end had at least 3 bubble-slots for a period of 2 cycles which was not interrupted by a back-end stall. Precise Event.",
473 "PEBS": "1", 473 "PEBS": "1",
474 "MSRValue": "0x300206", 474 "MSRValue": "0x300206",
475 "Counter": "0,1,2,3", 475 "Counter": "0,1,2,3",
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/memory.json b/tools/perf/pmu-events/arch/x86/skylakex/memory.json
index ca22a22c1abd..e7f1aa31226d 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/memory.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/memory.json
@@ -214,7 +214,7 @@
214 "PEBS": "1", 214 "PEBS": "1",
215 "Counter": "0,1,2,3", 215 "Counter": "0,1,2,3",
216 "EventName": "HLE_RETIRED.ABORTED", 216 "EventName": "HLE_RETIRED.ABORTED",
217 "PublicDescription": "Number of times HLE abort was triggered.", 217 "PublicDescription": "Number of times HLE abort was triggered. (PEBS)",
218 "SampleAfterValue": "2000003", 218 "SampleAfterValue": "2000003",
219 "CounterHTOff": "0,1,2,3,4,5,6,7" 219 "CounterHTOff": "0,1,2,3,4,5,6,7"
220 }, 220 },
@@ -239,10 +239,9 @@
239 { 239 {
240 "EventCode": "0xC8", 240 "EventCode": "0xC8",
241 "UMask": "0x20", 241 "UMask": "0x20",
242 "BriefDescription": "Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.). ", 242 "BriefDescription": "Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.).",
243 "Counter": "0,1,2,3", 243 "Counter": "0,1,2,3",
244 "EventName": "HLE_RETIRED.ABORTED_UNFRIENDLY", 244 "EventName": "HLE_RETIRED.ABORTED_UNFRIENDLY",
245 "PublicDescription": "Number of times an HLE execution aborted due to HLE-unfriendly instructions and certain unfriendly events (such as AD assists etc.).",
246 "SampleAfterValue": "2000003", 245 "SampleAfterValue": "2000003",
247 "CounterHTOff": "0,1,2,3,4,5,6,7" 246 "CounterHTOff": "0,1,2,3,4,5,6,7"
248 }, 247 },
@@ -292,7 +291,7 @@
292 "PEBS": "1", 291 "PEBS": "1",
293 "Counter": "0,1,2,3", 292 "Counter": "0,1,2,3",
294 "EventName": "RTM_RETIRED.ABORTED", 293 "EventName": "RTM_RETIRED.ABORTED",
295 "PublicDescription": "Number of times RTM abort was triggered.", 294 "PublicDescription": "Number of times RTM abort was triggered. (PEBS)",
296 "SampleAfterValue": "2000003", 295 "SampleAfterValue": "2000003",
297 "CounterHTOff": "0,1,2,3,4,5,6,7" 296 "CounterHTOff": "0,1,2,3,4,5,6,7"
298 }, 297 },
@@ -466,7 +465,7 @@
466 "Counter": "0,1,2,3", 465 "Counter": "0,1,2,3",
467 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.ANY_SNOOP", 466 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.ANY_SNOOP",
468 "MSRIndex": "0x1a6,0x1a7", 467 "MSRIndex": "0x1a6,0x1a7",
469 "PublicDescription": "Counts demand data reads that miss in the L3. ", 468 "PublicDescription": "Counts demand data reads that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
470 "SampleAfterValue": "100003", 469 "SampleAfterValue": "100003",
471 "CounterHTOff": "0,1,2,3" 470 "CounterHTOff": "0,1,2,3"
472 }, 471 },
@@ -479,7 +478,7 @@
479 "Counter": "0,1,2,3", 478 "Counter": "0,1,2,3",
480 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD", 479 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD",
481 "MSRIndex": "0x1a6,0x1a7", 480 "MSRIndex": "0x1a6,0x1a7",
482 "PublicDescription": "Counts demand data reads that miss the L3 and clean or shared data is transferred from remote cache. ", 481 "PublicDescription": "Counts demand data reads that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
483 "SampleAfterValue": "100003", 482 "SampleAfterValue": "100003",
484 "CounterHTOff": "0,1,2,3" 483 "CounterHTOff": "0,1,2,3"
485 }, 484 },
@@ -492,7 +491,7 @@
492 "Counter": "0,1,2,3", 491 "Counter": "0,1,2,3",
493 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.REMOTE_HITM", 492 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.REMOTE_HITM",
494 "MSRIndex": "0x1a6,0x1a7", 493 "MSRIndex": "0x1a6,0x1a7",
495 "PublicDescription": "Counts demand data reads that miss the L3 and the modified data is transferred from remote cache. ", 494 "PublicDescription": "Counts demand data reads that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
496 "SampleAfterValue": "100003", 495 "SampleAfterValue": "100003",
497 "CounterHTOff": "0,1,2,3" 496 "CounterHTOff": "0,1,2,3"
498 }, 497 },
@@ -505,7 +504,7 @@
505 "Counter": "0,1,2,3", 504 "Counter": "0,1,2,3",
506 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD", 505 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD",
507 "MSRIndex": "0x1a6,0x1a7", 506 "MSRIndex": "0x1a6,0x1a7",
508 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from local or remote dram. ", 507 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
509 "SampleAfterValue": "100003", 508 "SampleAfterValue": "100003",
510 "CounterHTOff": "0,1,2,3" 509 "CounterHTOff": "0,1,2,3"
511 }, 510 },
@@ -518,7 +517,7 @@
518 "Counter": "0,1,2,3", 517 "Counter": "0,1,2,3",
519 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 518 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
520 "MSRIndex": "0x1a6,0x1a7", 519 "MSRIndex": "0x1a6,0x1a7",
521 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from remote dram. ", 520 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
522 "SampleAfterValue": "100003", 521 "SampleAfterValue": "100003",
523 "CounterHTOff": "0,1,2,3" 522 "CounterHTOff": "0,1,2,3"
524 }, 523 },
@@ -531,7 +530,7 @@
531 "Counter": "0,1,2,3", 530 "Counter": "0,1,2,3",
532 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 531 "EventName": "OFFCORE_RESPONSE.DEMAND_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
533 "MSRIndex": "0x1a6,0x1a7", 532 "MSRIndex": "0x1a6,0x1a7",
534 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from local dram. ", 533 "PublicDescription": "Counts demand data reads that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
535 "SampleAfterValue": "100003", 534 "SampleAfterValue": "100003",
536 "CounterHTOff": "0,1,2,3" 535 "CounterHTOff": "0,1,2,3"
537 }, 536 },
@@ -544,7 +543,7 @@
544 "Counter": "0,1,2,3", 543 "Counter": "0,1,2,3",
545 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.ANY_SNOOP", 544 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.ANY_SNOOP",
546 "MSRIndex": "0x1a6,0x1a7", 545 "MSRIndex": "0x1a6,0x1a7",
547 "PublicDescription": "Counts all demand data writes (RFOs) that miss in the L3. ", 546 "PublicDescription": "Counts all demand data writes (RFOs) that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
548 "SampleAfterValue": "100003", 547 "SampleAfterValue": "100003",
549 "CounterHTOff": "0,1,2,3" 548 "CounterHTOff": "0,1,2,3"
550 }, 549 },
@@ -557,7 +556,7 @@
557 "Counter": "0,1,2,3", 556 "Counter": "0,1,2,3",
558 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.REMOTE_HIT_FORWARD", 557 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.REMOTE_HIT_FORWARD",
559 "MSRIndex": "0x1a6,0x1a7", 558 "MSRIndex": "0x1a6,0x1a7",
560 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and clean or shared data is transferred from remote cache. ", 559 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
561 "SampleAfterValue": "100003", 560 "SampleAfterValue": "100003",
562 "CounterHTOff": "0,1,2,3" 561 "CounterHTOff": "0,1,2,3"
563 }, 562 },
@@ -570,7 +569,7 @@
570 "Counter": "0,1,2,3", 569 "Counter": "0,1,2,3",
571 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.REMOTE_HITM", 570 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.REMOTE_HITM",
572 "MSRIndex": "0x1a6,0x1a7", 571 "MSRIndex": "0x1a6,0x1a7",
573 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the modified data is transferred from remote cache. ", 572 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
574 "SampleAfterValue": "100003", 573 "SampleAfterValue": "100003",
575 "CounterHTOff": "0,1,2,3" 574 "CounterHTOff": "0,1,2,3"
576 }, 575 },
@@ -583,7 +582,7 @@
583 "Counter": "0,1,2,3", 582 "Counter": "0,1,2,3",
584 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD", 583 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD",
585 "MSRIndex": "0x1a6,0x1a7", 584 "MSRIndex": "0x1a6,0x1a7",
586 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from local or remote dram. ", 585 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
587 "SampleAfterValue": "100003", 586 "SampleAfterValue": "100003",
588 "CounterHTOff": "0,1,2,3" 587 "CounterHTOff": "0,1,2,3"
589 }, 588 },
@@ -596,7 +595,7 @@
596 "Counter": "0,1,2,3", 595 "Counter": "0,1,2,3",
597 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 596 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
598 "MSRIndex": "0x1a6,0x1a7", 597 "MSRIndex": "0x1a6,0x1a7",
599 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from remote dram. ", 598 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
600 "SampleAfterValue": "100003", 599 "SampleAfterValue": "100003",
601 "CounterHTOff": "0,1,2,3" 600 "CounterHTOff": "0,1,2,3"
602 }, 601 },
@@ -609,7 +608,7 @@
609 "Counter": "0,1,2,3", 608 "Counter": "0,1,2,3",
610 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 609 "EventName": "OFFCORE_RESPONSE.DEMAND_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
611 "MSRIndex": "0x1a6,0x1a7", 610 "MSRIndex": "0x1a6,0x1a7",
612 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from local dram. ", 611 "PublicDescription": "Counts all demand data writes (RFOs) that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
613 "SampleAfterValue": "100003", 612 "SampleAfterValue": "100003",
614 "CounterHTOff": "0,1,2,3" 613 "CounterHTOff": "0,1,2,3"
615 }, 614 },
@@ -622,7 +621,7 @@
622 "Counter": "0,1,2,3", 621 "Counter": "0,1,2,3",
623 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.ANY_SNOOP", 622 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.ANY_SNOOP",
624 "MSRIndex": "0x1a6,0x1a7", 623 "MSRIndex": "0x1a6,0x1a7",
625 "PublicDescription": "Counts all demand code reads that miss in the L3. ", 624 "PublicDescription": "Counts all demand code reads that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
626 "SampleAfterValue": "100003", 625 "SampleAfterValue": "100003",
627 "CounterHTOff": "0,1,2,3" 626 "CounterHTOff": "0,1,2,3"
628 }, 627 },
@@ -635,7 +634,7 @@
635 "Counter": "0,1,2,3", 634 "Counter": "0,1,2,3",
636 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.REMOTE_HIT_FORWARD", 635 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.REMOTE_HIT_FORWARD",
637 "MSRIndex": "0x1a6,0x1a7", 636 "MSRIndex": "0x1a6,0x1a7",
638 "PublicDescription": "Counts all demand code reads that miss the L3 and clean or shared data is transferred from remote cache. ", 637 "PublicDescription": "Counts all demand code reads that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
639 "SampleAfterValue": "100003", 638 "SampleAfterValue": "100003",
640 "CounterHTOff": "0,1,2,3" 639 "CounterHTOff": "0,1,2,3"
641 }, 640 },
@@ -648,7 +647,7 @@
648 "Counter": "0,1,2,3", 647 "Counter": "0,1,2,3",
649 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.REMOTE_HITM", 648 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.REMOTE_HITM",
650 "MSRIndex": "0x1a6,0x1a7", 649 "MSRIndex": "0x1a6,0x1a7",
651 "PublicDescription": "Counts all demand code reads that miss the L3 and the modified data is transferred from remote cache. ", 650 "PublicDescription": "Counts all demand code reads that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
652 "SampleAfterValue": "100003", 651 "SampleAfterValue": "100003",
653 "CounterHTOff": "0,1,2,3" 652 "CounterHTOff": "0,1,2,3"
654 }, 653 },
@@ -661,7 +660,7 @@
661 "Counter": "0,1,2,3", 660 "Counter": "0,1,2,3",
662 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD", 661 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD",
663 "MSRIndex": "0x1a6,0x1a7", 662 "MSRIndex": "0x1a6,0x1a7",
664 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from local or remote dram. ", 663 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
665 "SampleAfterValue": "100003", 664 "SampleAfterValue": "100003",
666 "CounterHTOff": "0,1,2,3" 665 "CounterHTOff": "0,1,2,3"
667 }, 666 },
@@ -674,7 +673,7 @@
674 "Counter": "0,1,2,3", 673 "Counter": "0,1,2,3",
675 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 674 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
676 "MSRIndex": "0x1a6,0x1a7", 675 "MSRIndex": "0x1a6,0x1a7",
677 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from remote dram. ", 676 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
678 "SampleAfterValue": "100003", 677 "SampleAfterValue": "100003",
679 "CounterHTOff": "0,1,2,3" 678 "CounterHTOff": "0,1,2,3"
680 }, 679 },
@@ -687,7 +686,7 @@
687 "Counter": "0,1,2,3", 686 "Counter": "0,1,2,3",
688 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 687 "EventName": "OFFCORE_RESPONSE.DEMAND_CODE_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
689 "MSRIndex": "0x1a6,0x1a7", 688 "MSRIndex": "0x1a6,0x1a7",
690 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from local dram. ", 689 "PublicDescription": "Counts all demand code reads that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
691 "SampleAfterValue": "100003", 690 "SampleAfterValue": "100003",
692 "CounterHTOff": "0,1,2,3" 691 "CounterHTOff": "0,1,2,3"
693 }, 692 },
@@ -700,7 +699,7 @@
700 "Counter": "0,1,2,3", 699 "Counter": "0,1,2,3",
701 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.ANY_SNOOP", 700 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.ANY_SNOOP",
702 "MSRIndex": "0x1a6,0x1a7", 701 "MSRIndex": "0x1a6,0x1a7",
703 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss in the L3. ", 702 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
704 "SampleAfterValue": "100003", 703 "SampleAfterValue": "100003",
705 "CounterHTOff": "0,1,2,3" 704 "CounterHTOff": "0,1,2,3"
706 }, 705 },
@@ -713,7 +712,7 @@
713 "Counter": "0,1,2,3", 712 "Counter": "0,1,2,3",
714 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD", 713 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD",
715 "MSRIndex": "0x1a6,0x1a7", 714 "MSRIndex": "0x1a6,0x1a7",
716 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and clean or shared data is transferred from remote cache. ", 715 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
717 "SampleAfterValue": "100003", 716 "SampleAfterValue": "100003",
718 "CounterHTOff": "0,1,2,3" 717 "CounterHTOff": "0,1,2,3"
719 }, 718 },
@@ -726,7 +725,7 @@
726 "Counter": "0,1,2,3", 725 "Counter": "0,1,2,3",
727 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.REMOTE_HITM", 726 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.REMOTE_HITM",
728 "MSRIndex": "0x1a6,0x1a7", 727 "MSRIndex": "0x1a6,0x1a7",
729 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the modified data is transferred from remote cache. ", 728 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
730 "SampleAfterValue": "100003", 729 "SampleAfterValue": "100003",
731 "CounterHTOff": "0,1,2,3" 730 "CounterHTOff": "0,1,2,3"
732 }, 731 },
@@ -739,7 +738,7 @@
739 "Counter": "0,1,2,3", 738 "Counter": "0,1,2,3",
740 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD", 739 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD",
741 "MSRIndex": "0x1a6,0x1a7", 740 "MSRIndex": "0x1a6,0x1a7",
742 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the data is returned from local or remote dram. ", 741 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
743 "SampleAfterValue": "100003", 742 "SampleAfterValue": "100003",
744 "CounterHTOff": "0,1,2,3" 743 "CounterHTOff": "0,1,2,3"
745 }, 744 },
@@ -752,7 +751,7 @@
752 "Counter": "0,1,2,3", 751 "Counter": "0,1,2,3",
753 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 752 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
754 "MSRIndex": "0x1a6,0x1a7", 753 "MSRIndex": "0x1a6,0x1a7",
755 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the data is returned from remote dram. ", 754 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
756 "SampleAfterValue": "100003", 755 "SampleAfterValue": "100003",
757 "CounterHTOff": "0,1,2,3" 756 "CounterHTOff": "0,1,2,3"
758 }, 757 },
@@ -765,7 +764,7 @@
765 "Counter": "0,1,2,3", 764 "Counter": "0,1,2,3",
766 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 765 "EventName": "OFFCORE_RESPONSE.PF_L2_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
767 "MSRIndex": "0x1a6,0x1a7", 766 "MSRIndex": "0x1a6,0x1a7",
768 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the data is returned from local dram. ", 767 "PublicDescription": "Counts prefetch (that bring data to L2) data reads that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
769 "SampleAfterValue": "100003", 768 "SampleAfterValue": "100003",
770 "CounterHTOff": "0,1,2,3" 769 "CounterHTOff": "0,1,2,3"
771 }, 770 },
@@ -778,7 +777,7 @@
778 "Counter": "0,1,2,3", 777 "Counter": "0,1,2,3",
779 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.ANY_SNOOP", 778 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.ANY_SNOOP",
780 "MSRIndex": "0x1a6,0x1a7", 779 "MSRIndex": "0x1a6,0x1a7",
781 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss in the L3. ", 780 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
782 "SampleAfterValue": "100003", 781 "SampleAfterValue": "100003",
783 "CounterHTOff": "0,1,2,3" 782 "CounterHTOff": "0,1,2,3"
784 }, 783 },
@@ -791,7 +790,7 @@
791 "Counter": "0,1,2,3", 790 "Counter": "0,1,2,3",
792 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.REMOTE_HIT_FORWARD", 791 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.REMOTE_HIT_FORWARD",
793 "MSRIndex": "0x1a6,0x1a7", 792 "MSRIndex": "0x1a6,0x1a7",
794 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and clean or shared data is transferred from remote cache. ", 793 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
795 "SampleAfterValue": "100003", 794 "SampleAfterValue": "100003",
796 "CounterHTOff": "0,1,2,3" 795 "CounterHTOff": "0,1,2,3"
797 }, 796 },
@@ -804,7 +803,7 @@
804 "Counter": "0,1,2,3", 803 "Counter": "0,1,2,3",
805 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.REMOTE_HITM", 804 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.REMOTE_HITM",
806 "MSRIndex": "0x1a6,0x1a7", 805 "MSRIndex": "0x1a6,0x1a7",
807 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the modified data is transferred from remote cache. ", 806 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
808 "SampleAfterValue": "100003", 807 "SampleAfterValue": "100003",
809 "CounterHTOff": "0,1,2,3" 808 "CounterHTOff": "0,1,2,3"
810 }, 809 },
@@ -817,7 +816,7 @@
817 "Counter": "0,1,2,3", 816 "Counter": "0,1,2,3",
818 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD", 817 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD",
819 "MSRIndex": "0x1a6,0x1a7", 818 "MSRIndex": "0x1a6,0x1a7",
820 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the data is returned from local or remote dram. ", 819 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
821 "SampleAfterValue": "100003", 820 "SampleAfterValue": "100003",
822 "CounterHTOff": "0,1,2,3" 821 "CounterHTOff": "0,1,2,3"
823 }, 822 },
@@ -830,7 +829,7 @@
830 "Counter": "0,1,2,3", 829 "Counter": "0,1,2,3",
831 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 830 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
832 "MSRIndex": "0x1a6,0x1a7", 831 "MSRIndex": "0x1a6,0x1a7",
833 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the data is returned from remote dram. ", 832 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
834 "SampleAfterValue": "100003", 833 "SampleAfterValue": "100003",
835 "CounterHTOff": "0,1,2,3" 834 "CounterHTOff": "0,1,2,3"
836 }, 835 },
@@ -843,7 +842,7 @@
843 "Counter": "0,1,2,3", 842 "Counter": "0,1,2,3",
844 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 843 "EventName": "OFFCORE_RESPONSE.PF_L2_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
845 "MSRIndex": "0x1a6,0x1a7", 844 "MSRIndex": "0x1a6,0x1a7",
846 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the data is returned from local dram. ", 845 "PublicDescription": "Counts all prefetch (that bring data to L2) RFOs that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
847 "SampleAfterValue": "100003", 846 "SampleAfterValue": "100003",
848 "CounterHTOff": "0,1,2,3" 847 "CounterHTOff": "0,1,2,3"
849 }, 848 },
@@ -856,7 +855,7 @@
856 "Counter": "0,1,2,3", 855 "Counter": "0,1,2,3",
857 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.ANY_SNOOP", 856 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.ANY_SNOOP",
858 "MSRIndex": "0x1a6,0x1a7", 857 "MSRIndex": "0x1a6,0x1a7",
859 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss in the L3. ", 858 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
860 "SampleAfterValue": "100003", 859 "SampleAfterValue": "100003",
861 "CounterHTOff": "0,1,2,3" 860 "CounterHTOff": "0,1,2,3"
862 }, 861 },
@@ -869,7 +868,7 @@
869 "Counter": "0,1,2,3", 868 "Counter": "0,1,2,3",
870 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD", 869 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD",
871 "MSRIndex": "0x1a6,0x1a7", 870 "MSRIndex": "0x1a6,0x1a7",
872 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and clean or shared data is transferred from remote cache. ", 871 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
873 "SampleAfterValue": "100003", 872 "SampleAfterValue": "100003",
874 "CounterHTOff": "0,1,2,3" 873 "CounterHTOff": "0,1,2,3"
875 }, 874 },
@@ -882,7 +881,7 @@
882 "Counter": "0,1,2,3", 881 "Counter": "0,1,2,3",
883 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.REMOTE_HITM", 882 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.REMOTE_HITM",
884 "MSRIndex": "0x1a6,0x1a7", 883 "MSRIndex": "0x1a6,0x1a7",
885 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the modified data is transferred from remote cache. ", 884 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
886 "SampleAfterValue": "100003", 885 "SampleAfterValue": "100003",
887 "CounterHTOff": "0,1,2,3" 886 "CounterHTOff": "0,1,2,3"
888 }, 887 },
@@ -895,7 +894,7 @@
895 "Counter": "0,1,2,3", 894 "Counter": "0,1,2,3",
896 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD", 895 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD",
897 "MSRIndex": "0x1a6,0x1a7", 896 "MSRIndex": "0x1a6,0x1a7",
898 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the data is returned from local or remote dram. ", 897 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
899 "SampleAfterValue": "100003", 898 "SampleAfterValue": "100003",
900 "CounterHTOff": "0,1,2,3" 899 "CounterHTOff": "0,1,2,3"
901 }, 900 },
@@ -908,7 +907,7 @@
908 "Counter": "0,1,2,3", 907 "Counter": "0,1,2,3",
909 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 908 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
910 "MSRIndex": "0x1a6,0x1a7", 909 "MSRIndex": "0x1a6,0x1a7",
911 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the data is returned from remote dram. ", 910 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
912 "SampleAfterValue": "100003", 911 "SampleAfterValue": "100003",
913 "CounterHTOff": "0,1,2,3" 912 "CounterHTOff": "0,1,2,3"
914 }, 913 },
@@ -921,7 +920,7 @@
921 "Counter": "0,1,2,3", 920 "Counter": "0,1,2,3",
922 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 921 "EventName": "OFFCORE_RESPONSE.PF_L3_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
923 "MSRIndex": "0x1a6,0x1a7", 922 "MSRIndex": "0x1a6,0x1a7",
924 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the data is returned from local dram. ", 923 "PublicDescription": "Counts all prefetch (that bring data to LLC only) data reads that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
925 "SampleAfterValue": "100003", 924 "SampleAfterValue": "100003",
926 "CounterHTOff": "0,1,2,3" 925 "CounterHTOff": "0,1,2,3"
927 }, 926 },
@@ -934,7 +933,7 @@
934 "Counter": "0,1,2,3", 933 "Counter": "0,1,2,3",
935 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.ANY_SNOOP", 934 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.ANY_SNOOP",
936 "MSRIndex": "0x1a6,0x1a7", 935 "MSRIndex": "0x1a6,0x1a7",
937 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss in the L3. ", 936 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
938 "SampleAfterValue": "100003", 937 "SampleAfterValue": "100003",
939 "CounterHTOff": "0,1,2,3" 938 "CounterHTOff": "0,1,2,3"
940 }, 939 },
@@ -947,7 +946,7 @@
947 "Counter": "0,1,2,3", 946 "Counter": "0,1,2,3",
948 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.REMOTE_HIT_FORWARD", 947 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.REMOTE_HIT_FORWARD",
949 "MSRIndex": "0x1a6,0x1a7", 948 "MSRIndex": "0x1a6,0x1a7",
950 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and clean or shared data is transferred from remote cache. ", 949 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
951 "SampleAfterValue": "100003", 950 "SampleAfterValue": "100003",
952 "CounterHTOff": "0,1,2,3" 951 "CounterHTOff": "0,1,2,3"
953 }, 952 },
@@ -960,7 +959,7 @@
960 "Counter": "0,1,2,3", 959 "Counter": "0,1,2,3",
961 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.REMOTE_HITM", 960 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.REMOTE_HITM",
962 "MSRIndex": "0x1a6,0x1a7", 961 "MSRIndex": "0x1a6,0x1a7",
963 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the modified data is transferred from remote cache. ", 962 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
964 "SampleAfterValue": "100003", 963 "SampleAfterValue": "100003",
965 "CounterHTOff": "0,1,2,3" 964 "CounterHTOff": "0,1,2,3"
966 }, 965 },
@@ -973,7 +972,7 @@
973 "Counter": "0,1,2,3", 972 "Counter": "0,1,2,3",
974 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD", 973 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD",
975 "MSRIndex": "0x1a6,0x1a7", 974 "MSRIndex": "0x1a6,0x1a7",
976 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the data is returned from local or remote dram. ", 975 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
977 "SampleAfterValue": "100003", 976 "SampleAfterValue": "100003",
978 "CounterHTOff": "0,1,2,3" 977 "CounterHTOff": "0,1,2,3"
979 }, 978 },
@@ -986,7 +985,7 @@
986 "Counter": "0,1,2,3", 985 "Counter": "0,1,2,3",
987 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 986 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
988 "MSRIndex": "0x1a6,0x1a7", 987 "MSRIndex": "0x1a6,0x1a7",
989 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the data is returned from remote dram. ", 988 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
990 "SampleAfterValue": "100003", 989 "SampleAfterValue": "100003",
991 "CounterHTOff": "0,1,2,3" 990 "CounterHTOff": "0,1,2,3"
992 }, 991 },
@@ -999,7 +998,7 @@
999 "Counter": "0,1,2,3", 998 "Counter": "0,1,2,3",
1000 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 999 "EventName": "OFFCORE_RESPONSE.PF_L3_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1001 "MSRIndex": "0x1a6,0x1a7", 1000 "MSRIndex": "0x1a6,0x1a7",
1002 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the data is returned from local dram. ", 1001 "PublicDescription": "Counts all prefetch (that bring data to LLC only) RFOs that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1003 "SampleAfterValue": "100003", 1002 "SampleAfterValue": "100003",
1004 "CounterHTOff": "0,1,2,3" 1003 "CounterHTOff": "0,1,2,3"
1005 }, 1004 },
@@ -1012,7 +1011,7 @@
1012 "Counter": "0,1,2,3", 1011 "Counter": "0,1,2,3",
1013 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.ANY_SNOOP", 1012 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.ANY_SNOOP",
1014 "MSRIndex": "0x1a6,0x1a7", 1013 "MSRIndex": "0x1a6,0x1a7",
1015 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss in the L3. ", 1014 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1016 "SampleAfterValue": "100003", 1015 "SampleAfterValue": "100003",
1017 "CounterHTOff": "0,1,2,3" 1016 "CounterHTOff": "0,1,2,3"
1018 }, 1017 },
@@ -1025,7 +1024,7 @@
1025 "Counter": "0,1,2,3", 1024 "Counter": "0,1,2,3",
1026 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.REMOTE_HIT_FORWARD", 1025 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.REMOTE_HIT_FORWARD",
1027 "MSRIndex": "0x1a6,0x1a7", 1026 "MSRIndex": "0x1a6,0x1a7",
1028 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and clean or shared data is transferred from remote cache. ", 1027 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1029 "SampleAfterValue": "100003", 1028 "SampleAfterValue": "100003",
1030 "CounterHTOff": "0,1,2,3" 1029 "CounterHTOff": "0,1,2,3"
1031 }, 1030 },
@@ -1038,7 +1037,7 @@
1038 "Counter": "0,1,2,3", 1037 "Counter": "0,1,2,3",
1039 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.REMOTE_HITM", 1038 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.REMOTE_HITM",
1040 "MSRIndex": "0x1a6,0x1a7", 1039 "MSRIndex": "0x1a6,0x1a7",
1041 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the modified data is transferred from remote cache. ", 1040 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1042 "SampleAfterValue": "100003", 1041 "SampleAfterValue": "100003",
1043 "CounterHTOff": "0,1,2,3" 1042 "CounterHTOff": "0,1,2,3"
1044 }, 1043 },
@@ -1051,7 +1050,7 @@
1051 "Counter": "0,1,2,3", 1050 "Counter": "0,1,2,3",
1052 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.SNOOP_MISS_OR_NO_FWD", 1051 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS.SNOOP_MISS_OR_NO_FWD",
1053 "MSRIndex": "0x1a6,0x1a7", 1052 "MSRIndex": "0x1a6,0x1a7",
1054 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the data is returned from local or remote dram. ", 1053 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1055 "SampleAfterValue": "100003", 1054 "SampleAfterValue": "100003",
1056 "CounterHTOff": "0,1,2,3" 1055 "CounterHTOff": "0,1,2,3"
1057 }, 1056 },
@@ -1064,7 +1063,7 @@
1064 "Counter": "0,1,2,3", 1063 "Counter": "0,1,2,3",
1065 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 1064 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
1066 "MSRIndex": "0x1a6,0x1a7", 1065 "MSRIndex": "0x1a6,0x1a7",
1067 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the data is returned from remote dram. ", 1066 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1068 "SampleAfterValue": "100003", 1067 "SampleAfterValue": "100003",
1069 "CounterHTOff": "0,1,2,3" 1068 "CounterHTOff": "0,1,2,3"
1070 }, 1069 },
@@ -1077,7 +1076,85 @@
1077 "Counter": "0,1,2,3", 1076 "Counter": "0,1,2,3",
1078 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 1077 "EventName": "OFFCORE_RESPONSE.PF_L1D_AND_SW.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1079 "MSRIndex": "0x1a6,0x1a7", 1078 "MSRIndex": "0x1a6,0x1a7",
1080 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the data is returned from local dram. ", 1079 "PublicDescription": "Counts L1 data cache hardware prefetch requests and software prefetch requests that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1080 "SampleAfterValue": "100003",
1081 "CounterHTOff": "0,1,2,3"
1082 },
1083 {
1084 "Offcore": "1",
1085 "EventCode": "0xB7, 0xBB",
1086 "UMask": "0x1",
1087 "BriefDescription": "Counts any other requests that miss in the L3.",
1088 "MSRValue": "0x3fbc008000 ",
1089 "Counter": "0,1,2,3",
1090 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.ANY_SNOOP",
1091 "MSRIndex": "0x1a6,0x1a7",
1092 "PublicDescription": "Counts any other requests that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1093 "SampleAfterValue": "100003",
1094 "CounterHTOff": "0,1,2,3"
1095 },
1096 {
1097 "Offcore": "1",
1098 "EventCode": "0xB7, 0xBB",
1099 "UMask": "0x1",
1100 "BriefDescription": "Counts any other requests that miss the L3 and clean or shared data is transferred from remote cache.",
1101 "MSRValue": "0x083fc08000 ",
1102 "Counter": "0,1,2,3",
1103 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.REMOTE_HIT_FORWARD",
1104 "MSRIndex": "0x1a6,0x1a7",
1105 "PublicDescription": "Counts any other requests that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1106 "SampleAfterValue": "100003",
1107 "CounterHTOff": "0,1,2,3"
1108 },
1109 {
1110 "Offcore": "1",
1111 "EventCode": "0xB7, 0xBB",
1112 "UMask": "0x1",
1113 "BriefDescription": "Counts any other requests that miss the L3 and the modified data is transferred from remote cache.",
1114 "MSRValue": "0x103fc08000 ",
1115 "Counter": "0,1,2,3",
1116 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.REMOTE_HITM",
1117 "MSRIndex": "0x1a6,0x1a7",
1118 "PublicDescription": "Counts any other requests that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1119 "SampleAfterValue": "100003",
1120 "CounterHTOff": "0,1,2,3"
1121 },
1122 {
1123 "Offcore": "1",
1124 "EventCode": "0xB7, 0xBB",
1125 "UMask": "0x1",
1126 "BriefDescription": "Counts any other requests that miss the L3 and the data is returned from local or remote dram.",
1127 "MSRValue": "0x063fc08000 ",
1128 "Counter": "0,1,2,3",
1129 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS.SNOOP_MISS_OR_NO_FWD",
1130 "MSRIndex": "0x1a6,0x1a7",
1131 "PublicDescription": "Counts any other requests that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1132 "SampleAfterValue": "100003",
1133 "CounterHTOff": "0,1,2,3"
1134 },
1135 {
1136 "Offcore": "1",
1137 "EventCode": "0xB7, 0xBB",
1138 "UMask": "0x1",
1139 "BriefDescription": "Counts any other requests that miss the L3 and the data is returned from remote dram.",
1140 "MSRValue": "0x063b808000 ",
1141 "Counter": "0,1,2,3",
1142 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
1143 "MSRIndex": "0x1a6,0x1a7",
1144 "PublicDescription": "Counts any other requests that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1145 "SampleAfterValue": "100003",
1146 "CounterHTOff": "0,1,2,3"
1147 },
1148 {
1149 "Offcore": "1",
1150 "EventCode": "0xB7, 0xBB",
1151 "UMask": "0x1",
1152 "BriefDescription": "Counts any other requests that miss the L3 and the data is returned from local dram.",
1153 "MSRValue": "0x0604008000 ",
1154 "Counter": "0,1,2,3",
1155 "EventName": "OFFCORE_RESPONSE.OTHER.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1156 "MSRIndex": "0x1a6,0x1a7",
1157 "PublicDescription": "Counts any other requests that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1081 "SampleAfterValue": "100003", 1158 "SampleAfterValue": "100003",
1082 "CounterHTOff": "0,1,2,3" 1159 "CounterHTOff": "0,1,2,3"
1083 }, 1160 },
@@ -1090,7 +1167,7 @@
1090 "Counter": "0,1,2,3", 1167 "Counter": "0,1,2,3",
1091 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.ANY_SNOOP", 1168 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.ANY_SNOOP",
1092 "MSRIndex": "0x1a6,0x1a7", 1169 "MSRIndex": "0x1a6,0x1a7",
1093 "PublicDescription": "Counts all prefetch data reads that miss in the L3. ", 1170 "PublicDescription": "Counts all prefetch data reads that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1094 "SampleAfterValue": "100003", 1171 "SampleAfterValue": "100003",
1095 "CounterHTOff": "0,1,2,3" 1172 "CounterHTOff": "0,1,2,3"
1096 }, 1173 },
@@ -1103,7 +1180,7 @@
1103 "Counter": "0,1,2,3", 1180 "Counter": "0,1,2,3",
1104 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD", 1181 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD",
1105 "MSRIndex": "0x1a6,0x1a7", 1182 "MSRIndex": "0x1a6,0x1a7",
1106 "PublicDescription": "Counts all prefetch data reads that miss the L3 and clean or shared data is transferred from remote cache. ", 1183 "PublicDescription": "Counts all prefetch data reads that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1107 "SampleAfterValue": "100003", 1184 "SampleAfterValue": "100003",
1108 "CounterHTOff": "0,1,2,3" 1185 "CounterHTOff": "0,1,2,3"
1109 }, 1186 },
@@ -1116,7 +1193,7 @@
1116 "Counter": "0,1,2,3", 1193 "Counter": "0,1,2,3",
1117 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.REMOTE_HITM", 1194 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.REMOTE_HITM",
1118 "MSRIndex": "0x1a6,0x1a7", 1195 "MSRIndex": "0x1a6,0x1a7",
1119 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the modified data is transferred from remote cache. ", 1196 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1120 "SampleAfterValue": "100003", 1197 "SampleAfterValue": "100003",
1121 "CounterHTOff": "0,1,2,3" 1198 "CounterHTOff": "0,1,2,3"
1122 }, 1199 },
@@ -1129,7 +1206,7 @@
1129 "Counter": "0,1,2,3", 1206 "Counter": "0,1,2,3",
1130 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD", 1207 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD",
1131 "MSRIndex": "0x1a6,0x1a7", 1208 "MSRIndex": "0x1a6,0x1a7",
1132 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the data is returned from local or remote dram. ", 1209 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1133 "SampleAfterValue": "100003", 1210 "SampleAfterValue": "100003",
1134 "CounterHTOff": "0,1,2,3" 1211 "CounterHTOff": "0,1,2,3"
1135 }, 1212 },
@@ -1142,7 +1219,7 @@
1142 "Counter": "0,1,2,3", 1219 "Counter": "0,1,2,3",
1143 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 1220 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
1144 "MSRIndex": "0x1a6,0x1a7", 1221 "MSRIndex": "0x1a6,0x1a7",
1145 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the data is returned from remote dram. ", 1222 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1146 "SampleAfterValue": "100003", 1223 "SampleAfterValue": "100003",
1147 "CounterHTOff": "0,1,2,3" 1224 "CounterHTOff": "0,1,2,3"
1148 }, 1225 },
@@ -1155,7 +1232,7 @@
1155 "Counter": "0,1,2,3", 1232 "Counter": "0,1,2,3",
1156 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 1233 "EventName": "OFFCORE_RESPONSE.ALL_PF_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1157 "MSRIndex": "0x1a6,0x1a7", 1234 "MSRIndex": "0x1a6,0x1a7",
1158 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the data is returned from local dram. ", 1235 "PublicDescription": "Counts all prefetch data reads that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1159 "SampleAfterValue": "100003", 1236 "SampleAfterValue": "100003",
1160 "CounterHTOff": "0,1,2,3" 1237 "CounterHTOff": "0,1,2,3"
1161 }, 1238 },
@@ -1168,7 +1245,7 @@
1168 "Counter": "0,1,2,3", 1245 "Counter": "0,1,2,3",
1169 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.ANY_SNOOP", 1246 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.ANY_SNOOP",
1170 "MSRIndex": "0x1a6,0x1a7", 1247 "MSRIndex": "0x1a6,0x1a7",
1171 "PublicDescription": "Counts prefetch RFOs that miss in the L3. ", 1248 "PublicDescription": "Counts prefetch RFOs that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1172 "SampleAfterValue": "100003", 1249 "SampleAfterValue": "100003",
1173 "CounterHTOff": "0,1,2,3" 1250 "CounterHTOff": "0,1,2,3"
1174 }, 1251 },
@@ -1181,7 +1258,7 @@
1181 "Counter": "0,1,2,3", 1258 "Counter": "0,1,2,3",
1182 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.REMOTE_HIT_FORWARD", 1259 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.REMOTE_HIT_FORWARD",
1183 "MSRIndex": "0x1a6,0x1a7", 1260 "MSRIndex": "0x1a6,0x1a7",
1184 "PublicDescription": "Counts prefetch RFOs that miss the L3 and clean or shared data is transferred from remote cache. ", 1261 "PublicDescription": "Counts prefetch RFOs that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1185 "SampleAfterValue": "100003", 1262 "SampleAfterValue": "100003",
1186 "CounterHTOff": "0,1,2,3" 1263 "CounterHTOff": "0,1,2,3"
1187 }, 1264 },
@@ -1194,7 +1271,7 @@
1194 "Counter": "0,1,2,3", 1271 "Counter": "0,1,2,3",
1195 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.REMOTE_HITM", 1272 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.REMOTE_HITM",
1196 "MSRIndex": "0x1a6,0x1a7", 1273 "MSRIndex": "0x1a6,0x1a7",
1197 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the modified data is transferred from remote cache. ", 1274 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1198 "SampleAfterValue": "100003", 1275 "SampleAfterValue": "100003",
1199 "CounterHTOff": "0,1,2,3" 1276 "CounterHTOff": "0,1,2,3"
1200 }, 1277 },
@@ -1207,7 +1284,7 @@
1207 "Counter": "0,1,2,3", 1284 "Counter": "0,1,2,3",
1208 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD", 1285 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD",
1209 "MSRIndex": "0x1a6,0x1a7", 1286 "MSRIndex": "0x1a6,0x1a7",
1210 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the data is returned from local or remote dram. ", 1287 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1211 "SampleAfterValue": "100003", 1288 "SampleAfterValue": "100003",
1212 "CounterHTOff": "0,1,2,3" 1289 "CounterHTOff": "0,1,2,3"
1213 }, 1290 },
@@ -1220,7 +1297,7 @@
1220 "Counter": "0,1,2,3", 1297 "Counter": "0,1,2,3",
1221 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 1298 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
1222 "MSRIndex": "0x1a6,0x1a7", 1299 "MSRIndex": "0x1a6,0x1a7",
1223 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the data is returned from remote dram. ", 1300 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1224 "SampleAfterValue": "100003", 1301 "SampleAfterValue": "100003",
1225 "CounterHTOff": "0,1,2,3" 1302 "CounterHTOff": "0,1,2,3"
1226 }, 1303 },
@@ -1233,7 +1310,7 @@
1233 "Counter": "0,1,2,3", 1310 "Counter": "0,1,2,3",
1234 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 1311 "EventName": "OFFCORE_RESPONSE.ALL_PF_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1235 "MSRIndex": "0x1a6,0x1a7", 1312 "MSRIndex": "0x1a6,0x1a7",
1236 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the data is returned from local dram. ", 1313 "PublicDescription": "Counts prefetch RFOs that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1237 "SampleAfterValue": "100003", 1314 "SampleAfterValue": "100003",
1238 "CounterHTOff": "0,1,2,3" 1315 "CounterHTOff": "0,1,2,3"
1239 }, 1316 },
@@ -1246,7 +1323,7 @@
1246 "Counter": "0,1,2,3", 1323 "Counter": "0,1,2,3",
1247 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.ANY_SNOOP", 1324 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.ANY_SNOOP",
1248 "MSRIndex": "0x1a6,0x1a7", 1325 "MSRIndex": "0x1a6,0x1a7",
1249 "PublicDescription": "Counts all demand & prefetch data reads that miss in the L3. ", 1326 "PublicDescription": "Counts all demand & prefetch data reads that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1250 "SampleAfterValue": "100003", 1327 "SampleAfterValue": "100003",
1251 "CounterHTOff": "0,1,2,3" 1328 "CounterHTOff": "0,1,2,3"
1252 }, 1329 },
@@ -1259,7 +1336,7 @@
1259 "Counter": "0,1,2,3", 1336 "Counter": "0,1,2,3",
1260 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD", 1337 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.REMOTE_HIT_FORWARD",
1261 "MSRIndex": "0x1a6,0x1a7", 1338 "MSRIndex": "0x1a6,0x1a7",
1262 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and clean or shared data is transferred from remote cache. ", 1339 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1263 "SampleAfterValue": "100003", 1340 "SampleAfterValue": "100003",
1264 "CounterHTOff": "0,1,2,3" 1341 "CounterHTOff": "0,1,2,3"
1265 }, 1342 },
@@ -1272,7 +1349,7 @@
1272 "Counter": "0,1,2,3", 1349 "Counter": "0,1,2,3",
1273 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.REMOTE_HITM", 1350 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.REMOTE_HITM",
1274 "MSRIndex": "0x1a6,0x1a7", 1351 "MSRIndex": "0x1a6,0x1a7",
1275 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the modified data is transferred from remote cache. ", 1352 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1276 "SampleAfterValue": "100003", 1353 "SampleAfterValue": "100003",
1277 "CounterHTOff": "0,1,2,3" 1354 "CounterHTOff": "0,1,2,3"
1278 }, 1355 },
@@ -1285,7 +1362,7 @@
1285 "Counter": "0,1,2,3", 1362 "Counter": "0,1,2,3",
1286 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD", 1363 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS.SNOOP_MISS_OR_NO_FWD",
1287 "MSRIndex": "0x1a6,0x1a7", 1364 "MSRIndex": "0x1a6,0x1a7",
1288 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local or remote dram. ", 1365 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1289 "SampleAfterValue": "100003", 1366 "SampleAfterValue": "100003",
1290 "CounterHTOff": "0,1,2,3" 1367 "CounterHTOff": "0,1,2,3"
1291 }, 1368 },
@@ -1298,7 +1375,7 @@
1298 "Counter": "0,1,2,3", 1375 "Counter": "0,1,2,3",
1299 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 1376 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
1300 "MSRIndex": "0x1a6,0x1a7", 1377 "MSRIndex": "0x1a6,0x1a7",
1301 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from remote dram. ", 1378 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1302 "SampleAfterValue": "100003", 1379 "SampleAfterValue": "100003",
1303 "CounterHTOff": "0,1,2,3" 1380 "CounterHTOff": "0,1,2,3"
1304 }, 1381 },
@@ -1311,7 +1388,7 @@
1311 "Counter": "0,1,2,3", 1388 "Counter": "0,1,2,3",
1312 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 1389 "EventName": "OFFCORE_RESPONSE.ALL_DATA_RD.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1313 "MSRIndex": "0x1a6,0x1a7", 1390 "MSRIndex": "0x1a6,0x1a7",
1314 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local dram. ", 1391 "PublicDescription": "Counts all demand & prefetch data reads that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1315 "SampleAfterValue": "100003", 1392 "SampleAfterValue": "100003",
1316 "CounterHTOff": "0,1,2,3" 1393 "CounterHTOff": "0,1,2,3"
1317 }, 1394 },
@@ -1324,7 +1401,7 @@
1324 "Counter": "0,1,2,3", 1401 "Counter": "0,1,2,3",
1325 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.ANY_SNOOP", 1402 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.ANY_SNOOP",
1326 "MSRIndex": "0x1a6,0x1a7", 1403 "MSRIndex": "0x1a6,0x1a7",
1327 "PublicDescription": "Counts all demand & prefetch RFOs that miss in the L3. ", 1404 "PublicDescription": "Counts all demand & prefetch RFOs that miss in the L3. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1328 "SampleAfterValue": "100003", 1405 "SampleAfterValue": "100003",
1329 "CounterHTOff": "0,1,2,3" 1406 "CounterHTOff": "0,1,2,3"
1330 }, 1407 },
@@ -1337,7 +1414,7 @@
1337 "Counter": "0,1,2,3", 1414 "Counter": "0,1,2,3",
1338 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.REMOTE_HIT_FORWARD", 1415 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.REMOTE_HIT_FORWARD",
1339 "MSRIndex": "0x1a6,0x1a7", 1416 "MSRIndex": "0x1a6,0x1a7",
1340 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and clean or shared data is transferred from remote cache. ", 1417 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and clean or shared data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1341 "SampleAfterValue": "100003", 1418 "SampleAfterValue": "100003",
1342 "CounterHTOff": "0,1,2,3" 1419 "CounterHTOff": "0,1,2,3"
1343 }, 1420 },
@@ -1350,7 +1427,7 @@
1350 "Counter": "0,1,2,3", 1427 "Counter": "0,1,2,3",
1351 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.REMOTE_HITM", 1428 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.REMOTE_HITM",
1352 "MSRIndex": "0x1a6,0x1a7", 1429 "MSRIndex": "0x1a6,0x1a7",
1353 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the modified data is transferred from remote cache. ", 1430 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the modified data is transferred from remote cache. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1354 "SampleAfterValue": "100003", 1431 "SampleAfterValue": "100003",
1355 "CounterHTOff": "0,1,2,3" 1432 "CounterHTOff": "0,1,2,3"
1356 }, 1433 },
@@ -1363,7 +1440,7 @@
1363 "Counter": "0,1,2,3", 1440 "Counter": "0,1,2,3",
1364 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD", 1441 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS.SNOOP_MISS_OR_NO_FWD",
1365 "MSRIndex": "0x1a6,0x1a7", 1442 "MSRIndex": "0x1a6,0x1a7",
1366 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local or remote dram. ", 1443 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local or remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1367 "SampleAfterValue": "100003", 1444 "SampleAfterValue": "100003",
1368 "CounterHTOff": "0,1,2,3" 1445 "CounterHTOff": "0,1,2,3"
1369 }, 1446 },
@@ -1376,7 +1453,7 @@
1376 "Counter": "0,1,2,3", 1453 "Counter": "0,1,2,3",
1377 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD", 1454 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS_REMOTE_DRAM.SNOOP_MISS_OR_NO_FWD",
1378 "MSRIndex": "0x1a6,0x1a7", 1455 "MSRIndex": "0x1a6,0x1a7",
1379 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from remote dram. ", 1456 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from remote dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1380 "SampleAfterValue": "100003", 1457 "SampleAfterValue": "100003",
1381 "CounterHTOff": "0,1,2,3" 1458 "CounterHTOff": "0,1,2,3"
1382 }, 1459 },
@@ -1389,8 +1466,8 @@
1389 "Counter": "0,1,2,3", 1466 "Counter": "0,1,2,3",
1390 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD", 1467 "EventName": "OFFCORE_RESPONSE.ALL_RFO.L3_MISS_LOCAL_DRAM.SNOOP_MISS_OR_NO_FWD",
1391 "MSRIndex": "0x1a6,0x1a7", 1468 "MSRIndex": "0x1a6,0x1a7",
1392 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local dram.", 1469 "PublicDescription": "Counts all demand & prefetch RFOs that miss the L3 and the data is returned from local dram. Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.",
1393 "SampleAfterValue": "100003", 1470 "SampleAfterValue": "100003",
1394 "CounterHTOff": "0,1,2,3" 1471 "CounterHTOff": "0,1,2,3"
1395 } 1472 }
1396] 1473] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/other.json b/tools/perf/pmu-events/arch/x86/skylakex/other.json
index 70243b0b0586..778a541463eb 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/other.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/other.json
@@ -40,6 +40,42 @@
40 "CounterHTOff": "0,1,2,3,4,5,6,7" 40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 }, 41 },
42 { 42 {
43 "EventCode": "0x32",
44 "UMask": "0x1",
45 "BriefDescription": "Number of PREFETCHNTA instructions executed.",
46 "Counter": "0,1,2,3",
47 "EventName": "SW_PREFETCH_ACCESS.NTA",
48 "SampleAfterValue": "2000003",
49 "CounterHTOff": "0,1,2,3,4,5,6,7"
50 },
51 {
52 "EventCode": "0x32",
53 "UMask": "0x2",
54 "BriefDescription": "Number of PREFETCHT0 instructions executed.",
55 "Counter": "0,1,2,3",
56 "EventName": "SW_PREFETCH_ACCESS.T0",
57 "SampleAfterValue": "2000003",
58 "CounterHTOff": "0,1,2,3,4,5,6,7"
59 },
60 {
61 "EventCode": "0x32",
62 "UMask": "0x4",
63 "BriefDescription": "Number of PREFETCHT1 or PREFETCHT2 instructions executed.",
64 "Counter": "0,1,2,3",
65 "EventName": "SW_PREFETCH_ACCESS.T1_T2",
66 "SampleAfterValue": "2000003",
67 "CounterHTOff": "0,1,2,3,4,5,6,7"
68 },
69 {
70 "EventCode": "0x32",
71 "UMask": "0x8",
72 "BriefDescription": "Number of PREFETCHW instructions executed.",
73 "Counter": "0,1,2,3",
74 "EventName": "SW_PREFETCH_ACCESS.PREFETCHW",
75 "SampleAfterValue": "2000003",
76 "CounterHTOff": "0,1,2,3,4,5,6,7"
77 },
78 {
43 "EventCode": "0xCB", 79 "EventCode": "0xCB",
44 "UMask": "0x1", 80 "UMask": "0x1",
45 "BriefDescription": "Number of hardware interrupts received by the processor.", 81 "BriefDescription": "Number of hardware interrupts received by the processor.",
@@ -50,6 +86,62 @@
50 "CounterHTOff": "0,1,2,3,4,5,6,7" 86 "CounterHTOff": "0,1,2,3,4,5,6,7"
51 }, 87 },
52 { 88 {
89 "EventCode": "0xEF",
90 "UMask": "0x1",
91 "Counter": "0,1,2,3",
92 "EventName": "CORE_SNOOP_RESPONSE.RSP_IHITI",
93 "SampleAfterValue": "2000003",
94 "CounterHTOff": "0,1,2,3,4,5,6,7"
95 },
96 {
97 "EventCode": "0xEF",
98 "UMask": "0x2",
99 "Counter": "0,1,2,3",
100 "EventName": "CORE_SNOOP_RESPONSE.RSP_IHITFSE",
101 "SampleAfterValue": "2000003",
102 "CounterHTOff": "0,1,2,3,4,5,6,7"
103 },
104 {
105 "EventCode": "0xEF",
106 "UMask": "0x4",
107 "Counter": "0,1,2,3",
108 "EventName": "CORE_SNOOP_RESPONSE.RSP_SHITFSE",
109 "SampleAfterValue": "2000003",
110 "CounterHTOff": "0,1,2,3,4,5,6,7"
111 },
112 {
113 "EventCode": "0xEF",
114 "UMask": "0x8",
115 "Counter": "0,1,2,3",
116 "EventName": "CORE_SNOOP_RESPONSE.RSP_SFWDM",
117 "SampleAfterValue": "2000003",
118 "CounterHTOff": "0,1,2,3,4,5,6,7"
119 },
120 {
121 "EventCode": "0xEF",
122 "UMask": "0x10",
123 "Counter": "0,1,2,3",
124 "EventName": "CORE_SNOOP_RESPONSE.RSP_IFWDM",
125 "SampleAfterValue": "2000003",
126 "CounterHTOff": "0,1,2,3,4,5,6,7"
127 },
128 {
129 "EventCode": "0xEF",
130 "UMask": "0x20",
131 "Counter": "0,1,2,3",
132 "EventName": "CORE_SNOOP_RESPONSE.RSP_IFWDFE",
133 "SampleAfterValue": "2000003",
134 "CounterHTOff": "0,1,2,3,4,5,6,7"
135 },
136 {
137 "EventCode": "0xEF",
138 "UMask": "0x40",
139 "Counter": "0,1,2,3",
140 "EventName": "CORE_SNOOP_RESPONSE.RSP_SFWDFE",
141 "SampleAfterValue": "2000003",
142 "CounterHTOff": "0,1,2,3,4,5,6,7"
143 },
144 {
53 "EventCode": "0xFE", 145 "EventCode": "0xFE",
54 "UMask": "0x2", 146 "UMask": "0x2",
55 "BriefDescription": "Counts number of cache lines that are allocated and written back to L3 with the intention that they are more likely to be reused shortly", 147 "BriefDescription": "Counts number of cache lines that are allocated and written back to L3 with the intention that they are more likely to be reused shortly",
@@ -69,4 +161,4 @@
69 "SampleAfterValue": "100003", 161 "SampleAfterValue": "100003",
70 "CounterHTOff": "0,1,2,3,4,5,6,7" 162 "CounterHTOff": "0,1,2,3,4,5,6,7"
71 } 163 }
72] 164] \ No newline at end of file
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/pipeline.json b/tools/perf/pmu-events/arch/x86/skylakex/pipeline.json
index 0895d1e52a4a..f99f7ae27820 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/pipeline.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/pipeline.json
@@ -3,41 +3,41 @@
3 "EventCode": "0x00", 3 "EventCode": "0x00",
4 "UMask": "0x1", 4 "UMask": "0x1",
5 "BriefDescription": "Instructions retired from execution.", 5 "BriefDescription": "Instructions retired from execution.",
6 "Counter": "Fixed counter 1", 6 "Counter": "Fixed counter 0",
7 "EventName": "INST_RETIRED.ANY", 7 "EventName": "INST_RETIRED.ANY",
8 "PublicDescription": "Counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, Counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. Notes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. Counting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.", 8 "PublicDescription": "Counts the number of instructions retired from execution. For instructions that consist of multiple micro-ops, Counts the retirement of the last micro-op of the instruction. Counting continues during hardware interrupts, traps, and inside interrupt handlers. Notes: INST_RETIRED.ANY is counted by a designated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. INST_RETIRED.ANY_P is counted by a programmable counter and it is an architectural performance event. Counting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions.",
9 "SampleAfterValue": "2000003", 9 "SampleAfterValue": "2000003",
10 "CounterHTOff": "Fixed counter 1" 10 "CounterHTOff": "Fixed counter 0"
11 }, 11 },
12 { 12 {
13 "EventCode": "0x00", 13 "EventCode": "0x00",
14 "UMask": "0x2", 14 "UMask": "0x2",
15 "BriefDescription": "Core cycles when the thread is not in halt state", 15 "BriefDescription": "Core cycles when the thread is not in halt state",
16 "Counter": "Fixed counter 2", 16 "Counter": "Fixed counter 1",
17 "EventName": "CPU_CLK_UNHALTED.THREAD", 17 "EventName": "CPU_CLK_UNHALTED.THREAD",
18 "PublicDescription": "Counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.", 18 "PublicDescription": "Counts the number of core cycles while the thread is not in a halt state. The thread enters the halt state when it is running the HLT instruction. This event is a component in many key event ratios. The core frequency may change from time to time due to transitions associated with Enhanced Intel SpeedStep Technology or TM2. For this reason this event may have a changing ratio with regards to time. When the core frequency is constant, this event can approximate elapsed time while the core was not in the halt state. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events.",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "Fixed counter 2" 20 "CounterHTOff": "Fixed counter 1"
21 }, 21 },
22 { 22 {
23 "EventCode": "0x00", 23 "EventCode": "0x00",
24 "UMask": "0x2", 24 "UMask": "0x2",
25 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.", 25 "BriefDescription": "Core cycles when at least one thread on the physical core is not in halt state.",
26 "Counter": "Fixed counter 2", 26 "Counter": "Fixed counter 1",
27 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY", 27 "EventName": "CPU_CLK_UNHALTED.THREAD_ANY",
28 "AnyThread": "1", 28 "AnyThread": "1",
29 "SampleAfterValue": "2000003", 29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "Fixed counter 2" 30 "CounterHTOff": "Fixed counter 1"
31 }, 31 },
32 { 32 {
33 "EventCode": "0x00", 33 "EventCode": "0x00",
34 "UMask": "0x3", 34 "UMask": "0x3",
35 "BriefDescription": "Reference cycles when the core is not in halt state.", 35 "BriefDescription": "Reference cycles when the core is not in halt state.",
36 "Counter": "Fixed counter 3", 36 "Counter": "Fixed counter 2",
37 "EventName": "CPU_CLK_UNHALTED.REF_TSC", 37 "EventName": "CPU_CLK_UNHALTED.REF_TSC",
38 "PublicDescription": "Counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. Note: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.", 38 "PublicDescription": "Counts the number of reference cycles when the core is not in a halt state. The core enters the halt state when it is running the HLT instruction or the MWAIT instruction. This event is not affected by core frequency changes (for example, P states, TM2 transitions) but has the same incrementing frequency as the time stamp counter. This event can approximate elapsed time while the core was not in a halt state. This event has a constant ratio with the CPU_CLK_UNHALTED.REF_XCLK event. It is counted on a dedicated fixed counter, leaving the four (eight when Hyperthreading is disabled) programmable counters available for other events. Note: On all current platforms this event stops counting during 'throttling (TM)' states duty off periods the processor is 'halted'. The counter update is done at a lower clock rate then the core clock the overflow status bit for this counter may appear 'sticky'. After the counter has overflowed and software clears the overflow status bit and resets the counter to less than MAX. The reset value to the counter is not clocked immediately so the overflow status bit will flip 'high (1)' and generate another PMI (if enabled) after which the reset value gets clocked into the counter. Therefore, software will get the interrupt, read the overflow status bit '1 for bit 34 while the counter value is less than MAX. Software should ignore this case.",
39 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
40 "CounterHTOff": "Fixed counter 3" 40 "CounterHTOff": "Fixed counter 2"
41 }, 41 },
42 { 42 {
43 "EventCode": "0x03", 43 "EventCode": "0x03",
@@ -126,7 +126,7 @@
126 "BriefDescription": "Uops inserted at issue-stage in order to preserve upper bits of vector registers.", 126 "BriefDescription": "Uops inserted at issue-stage in order to preserve upper bits of vector registers.",
127 "Counter": "0,1,2,3", 127 "Counter": "0,1,2,3",
128 "EventName": "UOPS_ISSUED.VECTOR_WIDTH_MISMATCH", 128 "EventName": "UOPS_ISSUED.VECTOR_WIDTH_MISMATCH",
129 "PublicDescription": "Counts the number of Blend Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS) in order to preserve upper bits of vector registers. Starting with the Skylake microarchitecture, these Blend uops are needed since every Intel SSE instruction executed in Dirty Upper State needs to preserve bits 128-255 of the destination register. For more information, refer to \u201cMixing Intel AVX and Intel SSE Code\u201d section of the Optimization Guide.", 129 "PublicDescription": "Counts the number of Blend Uops issued by the Resource Allocation Table (RAT) to the reservation station (RS) in order to preserve upper bits of vector registers. Starting with the Skylake microarchitecture, these Blend uops are needed since every Intel SSE instruction executed in Dirty Upper State needs to preserve bits 128-255 of the destination register. For more information, refer to Mixing Intel AVX and Intel SSE Code section of the Optimization Guide.",
130 "SampleAfterValue": "2000003", 130 "SampleAfterValue": "2000003",
131 "CounterHTOff": "0,1,2,3,4,5,6,7" 131 "CounterHTOff": "0,1,2,3,4,5,6,7"
132 }, 132 },
@@ -762,11 +762,10 @@
762 "EdgeDetect": "1", 762 "EdgeDetect": "1",
763 "EventCode": "0xC3", 763 "EventCode": "0xC3",
764 "UMask": "0x1", 764 "UMask": "0x1",
765 "BriefDescription": "Number of machine clears (nukes) of any type. ", 765 "BriefDescription": "Number of machine clears (nukes) of any type.",
766 "Counter": "0,1,2,3", 766 "Counter": "0,1,2,3",
767 "EventName": "MACHINE_CLEARS.COUNT", 767 "EventName": "MACHINE_CLEARS.COUNT",
768 "CounterMask": "1", 768 "CounterMask": "1",
769 "PublicDescription": "Number of machine clears (nukes) of any type.",
770 "SampleAfterValue": "100003", 769 "SampleAfterValue": "100003",
771 "CounterHTOff": "0,1,2,3,4,5,6,7" 770 "CounterHTOff": "0,1,2,3,4,5,6,7"
772 }, 771 },
@@ -799,7 +798,7 @@
799 "Counter": "0,1,2,3", 798 "Counter": "0,1,2,3",
800 "EventName": "BR_INST_RETIRED.CONDITIONAL", 799 "EventName": "BR_INST_RETIRED.CONDITIONAL",
801 "Errata": "SKL091", 800 "Errata": "SKL091",
802 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts conditional branch instructions retired.", 801 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts conditional branch instructions retired.",
803 "SampleAfterValue": "400009", 802 "SampleAfterValue": "400009",
804 "CounterHTOff": "0,1,2,3,4,5,6,7" 803 "CounterHTOff": "0,1,2,3,4,5,6,7"
805 }, 804 },
@@ -811,14 +810,14 @@
811 "Counter": "0,1,2,3", 810 "Counter": "0,1,2,3",
812 "EventName": "BR_INST_RETIRED.NEAR_CALL", 811 "EventName": "BR_INST_RETIRED.NEAR_CALL",
813 "Errata": "SKL091", 812 "Errata": "SKL091",
814 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts both direct and indirect near call instructions retired.", 813 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts both direct and indirect near call instructions retired.",
815 "SampleAfterValue": "100007", 814 "SampleAfterValue": "100007",
816 "CounterHTOff": "0,1,2,3,4,5,6,7" 815 "CounterHTOff": "0,1,2,3,4,5,6,7"
817 }, 816 },
818 { 817 {
819 "EventCode": "0xC4", 818 "EventCode": "0xC4",
820 "UMask": "0x4", 819 "UMask": "0x4",
821 "BriefDescription": "All (macro) branch instructions retired. ", 820 "BriefDescription": "All (macro) branch instructions retired.",
822 "PEBS": "2", 821 "PEBS": "2",
823 "Counter": "0,1,2,3", 822 "Counter": "0,1,2,3",
824 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS", 823 "EventName": "BR_INST_RETIRED.ALL_BRANCHES_PEBS",
@@ -835,7 +834,7 @@
835 "Counter": "0,1,2,3", 834 "Counter": "0,1,2,3",
836 "EventName": "BR_INST_RETIRED.NEAR_RETURN", 835 "EventName": "BR_INST_RETIRED.NEAR_RETURN",
837 "Errata": "SKL091", 836 "Errata": "SKL091",
838 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts return instructions retired.", 837 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts return instructions retired.",
839 "SampleAfterValue": "100007", 838 "SampleAfterValue": "100007",
840 "CounterHTOff": "0,1,2,3,4,5,6,7" 839 "CounterHTOff": "0,1,2,3,4,5,6,7"
841 }, 840 },
@@ -858,19 +857,19 @@
858 "Counter": "0,1,2,3", 857 "Counter": "0,1,2,3",
859 "EventName": "BR_INST_RETIRED.NEAR_TAKEN", 858 "EventName": "BR_INST_RETIRED.NEAR_TAKEN",
860 "Errata": "SKL091", 859 "Errata": "SKL091",
861 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts taken branch instructions retired.", 860 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts taken branch instructions retired.",
862 "SampleAfterValue": "400009", 861 "SampleAfterValue": "400009",
863 "CounterHTOff": "0,1,2,3,4,5,6,7" 862 "CounterHTOff": "0,1,2,3,4,5,6,7"
864 }, 863 },
865 { 864 {
866 "EventCode": "0xC4", 865 "EventCode": "0xC4",
867 "UMask": "0x40", 866 "UMask": "0x40",
868 "BriefDescription": "Far branch instructions retired.", 867 "BriefDescription": "Counts the number of far branch instructions retired.",
869 "PEBS": "1", 868 "PEBS": "1",
870 "Counter": "0,1,2,3", 869 "Counter": "0,1,2,3",
871 "EventName": "BR_INST_RETIRED.FAR_BRANCH", 870 "EventName": "BR_INST_RETIRED.FAR_BRANCH",
872 "Errata": "SKL091", 871 "Errata": "SKL091",
873 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts far branch instructions retired.", 872 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts far branch instructions retired.",
874 "SampleAfterValue": "100007", 873 "SampleAfterValue": "100007",
875 "CounterHTOff": "0,1,2,3,4,5,6,7" 874 "CounterHTOff": "0,1,2,3,4,5,6,7"
876 }, 875 },
@@ -891,7 +890,7 @@
891 "PEBS": "1", 890 "PEBS": "1",
892 "Counter": "0,1,2,3", 891 "Counter": "0,1,2,3",
893 "EventName": "BR_MISP_RETIRED.CONDITIONAL", 892 "EventName": "BR_MISP_RETIRED.CONDITIONAL",
894 "PublicDescription": "This is a non-precise version (that is, does not use PEBS) of the event that counts mispredicted conditional branch instructions retired.", 893 "PublicDescription": "This is a precise version (that is, uses PEBS) of the event that counts mispredicted conditional branch instructions retired.",
895 "SampleAfterValue": "400009", 894 "SampleAfterValue": "400009",
896 "CounterHTOff": "0,1,2,3,4,5,6,7" 895 "CounterHTOff": "0,1,2,3,4,5,6,7"
897 }, 896 },
@@ -902,14 +901,14 @@
902 "PEBS": "1", 901 "PEBS": "1",
903 "Counter": "0,1,2,3", 902 "Counter": "0,1,2,3",
904 "EventName": "BR_MISP_RETIRED.NEAR_CALL", 903 "EventName": "BR_MISP_RETIRED.NEAR_CALL",
905 "PublicDescription": "Counts both taken and not taken retired mispredicted direct and indirect near calls, including both register and memory indirect.", 904 "PublicDescription": "This event counts both taken and not taken retired mispredicted direct and indirect near calls, including both register and memory indirect.",
906 "SampleAfterValue": "400009", 905 "SampleAfterValue": "400009",
907 "CounterHTOff": "0,1,2,3,4,5,6,7" 906 "CounterHTOff": "0,1,2,3,4,5,6,7"
908 }, 907 },
909 { 908 {
910 "EventCode": "0xC5", 909 "EventCode": "0xC5",
911 "UMask": "0x4", 910 "UMask": "0x4",
912 "BriefDescription": "Mispredicted macro branch instructions retired. ", 911 "BriefDescription": "Mispredicted macro branch instructions retired.",
913 "PEBS": "2", 912 "PEBS": "2",
914 "Counter": "0,1,2,3", 913 "Counter": "0,1,2,3",
915 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS", 914 "EventName": "BR_MISP_RETIRED.ALL_BRANCHES_PEBS",
@@ -920,10 +919,11 @@
920 { 919 {
921 "EventCode": "0xC5", 920 "EventCode": "0xC5",
922 "UMask": "0x20", 921 "UMask": "0x20",
923 "BriefDescription": "Number of near branch instructions retired that were mispredicted and taken.", 922 "BriefDescription": "Number of near branch instructions retired that were mispredicted and taken. ",
924 "PEBS": "1", 923 "PEBS": "1",
925 "Counter": "0,1,2,3", 924 "Counter": "0,1,2,3",
926 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN", 925 "EventName": "BR_MISP_RETIRED.NEAR_TAKEN",
926 "PublicDescription": "Number of near branch instructions retired that were mispredicted and taken.",
927 "SampleAfterValue": "400009", 927 "SampleAfterValue": "400009",
928 "CounterHTOff": "0,1,2,3,4,5,6,7" 928 "CounterHTOff": "0,1,2,3,4,5,6,7"
929 }, 929 },
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json b/tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json
index 70750dab7ead..7f466c97e485 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json
@@ -12,30 +12,30 @@
12 { 12 {
13 "EventCode": "0x08", 13 "EventCode": "0x08",
14 "UMask": "0x2", 14 "UMask": "0x2",
15 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes (4K).", 15 "BriefDescription": "Page walk completed due to a demand data load to a 4K page",
16 "Counter": "0,1,2,3", 16 "Counter": "0,1,2,3",
17 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_4K", 17 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_4K",
18 "PublicDescription": "Counts demand data loads that caused a completed page walk (4K page size). This implies it missed in all TLB levels. The page walk can end with or without a fault.", 18 "PublicDescription": "Counts page walks completed due to demand data loads whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.",
19 "SampleAfterValue": "2000003", 19 "SampleAfterValue": "2000003",
20 "CounterHTOff": "0,1,2,3,4,5,6,7" 20 "CounterHTOff": "0,1,2,3,4,5,6,7"
21 }, 21 },
22 { 22 {
23 "EventCode": "0x08", 23 "EventCode": "0x08",
24 "UMask": "0x4", 24 "UMask": "0x4",
25 "BriefDescription": "Demand load Miss in all translation lookaside buffer (TLB) levels causes a page walk that completes (2M/4M).", 25 "BriefDescription": "Page walk completed due to a demand data load to a 2M/4M page",
26 "Counter": "0,1,2,3", 26 "Counter": "0,1,2,3",
27 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M", 27 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M",
28 "PublicDescription": "Counts demand data loads that caused a completed page walk (2M and 4M page sizes). This implies it missed in all TLB levels. The page walk can end with or without a fault.", 28 "PublicDescription": "Counts page walks completed due to demand data loads whose address translations missed in the TLB and were mapped to 2M/4M pages. The page walks can end with or without a page fault.",
29 "SampleAfterValue": "2000003", 29 "SampleAfterValue": "2000003",
30 "CounterHTOff": "0,1,2,3,4,5,6,7" 30 "CounterHTOff": "0,1,2,3,4,5,6,7"
31 }, 31 },
32 { 32 {
33 "EventCode": "0x08", 33 "EventCode": "0x08",
34 "UMask": "0x8", 34 "UMask": "0x8",
35 "BriefDescription": "Load miss in all TLB levels causes a page walk that completes. (1G)", 35 "BriefDescription": "Page walk completed due to a demand data load to a 1G page",
36 "Counter": "0,1,2,3", 36 "Counter": "0,1,2,3",
37 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_1G", 37 "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_1G",
38 "PublicDescription": "Counts load misses in all DTLB levels that cause a completed page walk (1G page size). The page walk can end with or without a fault.", 38 "PublicDescription": "Counts page walks completed due to demand data loads whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.",
39 "SampleAfterValue": "2000003", 39 "SampleAfterValue": "2000003",
40 "CounterHTOff": "0,1,2,3,4,5,6,7" 40 "CounterHTOff": "0,1,2,3,4,5,6,7"
41 }, 41 },
@@ -52,17 +52,17 @@
52 { 52 {
53 "EventCode": "0x08", 53 "EventCode": "0x08",
54 "UMask": "0x10", 54 "UMask": "0x10",
55 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake. ", 55 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake.",
56 "Counter": "0,1,2,3", 56 "Counter": "0,1,2,3",
57 "EventName": "DTLB_LOAD_MISSES.WALK_PENDING", 57 "EventName": "DTLB_LOAD_MISSES.WALK_PENDING",
58 "PublicDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake microarchitecture. ", 58 "PublicDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a load. EPT page walk duration are excluded in Skylake microarchitecture.",
59 "SampleAfterValue": "2000003", 59 "SampleAfterValue": "2000003",
60 "CounterHTOff": "0,1,2,3,4,5,6,7" 60 "CounterHTOff": "0,1,2,3,4,5,6,7"
61 }, 61 },
62 { 62 {
63 "EventCode": "0x08", 63 "EventCode": "0x08",
64 "UMask": "0x10", 64 "UMask": "0x10",
65 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a load. EPT page walk duration are excluded in Skylake. ", 65 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a load. EPT page walk duration are excluded in Skylake.",
66 "Counter": "0,1,2,3", 66 "Counter": "0,1,2,3",
67 "EventName": "DTLB_LOAD_MISSES.WALK_ACTIVE", 67 "EventName": "DTLB_LOAD_MISSES.WALK_ACTIVE",
68 "CounterMask": "1", 68 "CounterMask": "1",
@@ -93,30 +93,30 @@
93 { 93 {
94 "EventCode": "0x49", 94 "EventCode": "0x49",
95 "UMask": "0x2", 95 "UMask": "0x2",
96 "BriefDescription": "Store miss in all TLB levels causes a page walk that completes. (4K)", 96 "BriefDescription": "Page walk completed due to a demand data store to a 4K page",
97 "Counter": "0,1,2,3", 97 "Counter": "0,1,2,3",
98 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_4K", 98 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_4K",
99 "PublicDescription": "Counts demand data stores that caused a completed page walk (4K page size). This implies it missed in all TLB levels. The page walk can end with or without a fault.", 99 "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.",
100 "SampleAfterValue": "100003", 100 "SampleAfterValue": "100003",
101 "CounterHTOff": "0,1,2,3,4,5,6,7" 101 "CounterHTOff": "0,1,2,3,4,5,6,7"
102 }, 102 },
103 { 103 {
104 "EventCode": "0x49", 104 "EventCode": "0x49",
105 "UMask": "0x4", 105 "UMask": "0x4",
106 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks (2M/4M)", 106 "BriefDescription": "Page walk completed due to a demand data store to a 2M/4M page",
107 "Counter": "0,1,2,3", 107 "Counter": "0,1,2,3",
108 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M", 108 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M",
109 "PublicDescription": "Counts demand data stores that caused a completed page walk (2M and 4M page sizes). This implies it missed in all TLB levels. The page walk can end with or without a fault.", 109 "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 2M/4M pages. The page walks can end with or without a page fault.",
110 "SampleAfterValue": "100003", 110 "SampleAfterValue": "100003",
111 "CounterHTOff": "0,1,2,3,4,5,6,7" 111 "CounterHTOff": "0,1,2,3,4,5,6,7"
112 }, 112 },
113 { 113 {
114 "EventCode": "0x49", 114 "EventCode": "0x49",
115 "UMask": "0x8", 115 "UMask": "0x8",
116 "BriefDescription": "Store misses in all DTLB levels that cause completed page walks (1G)", 116 "BriefDescription": "Page walk completed due to a demand data store to a 1G page",
117 "Counter": "0,1,2,3", 117 "Counter": "0,1,2,3",
118 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_1G", 118 "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_1G",
119 "PublicDescription": "Counts store misses in all DTLB levels that cause a completed page walk (1G page size). The page walk can end with or without a fault.", 119 "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 1G pages. The page walks can end with or without a page fault.",
120 "SampleAfterValue": "100003", 120 "SampleAfterValue": "100003",
121 "CounterHTOff": "0,1,2,3,4,5,6,7" 121 "CounterHTOff": "0,1,2,3,4,5,6,7"
122 }, 122 },
@@ -133,17 +133,17 @@
133 { 133 {
134 "EventCode": "0x49", 134 "EventCode": "0x49",
135 "UMask": "0x10", 135 "UMask": "0x10",
136 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake. ", 136 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake.",
137 "Counter": "0,1,2,3", 137 "Counter": "0,1,2,3",
138 "EventName": "DTLB_STORE_MISSES.WALK_PENDING", 138 "EventName": "DTLB_STORE_MISSES.WALK_PENDING",
139 "PublicDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake microarchitecture. ", 139 "PublicDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for a store. EPT page walk duration are excluded in Skylake microarchitecture.",
140 "SampleAfterValue": "2000003", 140 "SampleAfterValue": "2000003",
141 "CounterHTOff": "0,1,2,3,4,5,6,7" 141 "CounterHTOff": "0,1,2,3,4,5,6,7"
142 }, 142 },
143 { 143 {
144 "EventCode": "0x49", 144 "EventCode": "0x49",
145 "UMask": "0x10", 145 "UMask": "0x10",
146 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a store. EPT page walk duration are excluded in Skylake. ", 146 "BriefDescription": "Cycles when at least one PMH is busy with a page walk for a store. EPT page walk duration are excluded in Skylake.",
147 "Counter": "0,1,2,3", 147 "Counter": "0,1,2,3",
148 "EventName": "DTLB_STORE_MISSES.WALK_ACTIVE", 148 "EventName": "DTLB_STORE_MISSES.WALK_ACTIVE",
149 "CounterMask": "1", 149 "CounterMask": "1",
@@ -197,7 +197,7 @@
197 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (2M/4M)", 197 "BriefDescription": "Code miss in all TLB levels causes a page walk that completes. (2M/4M)",
198 "Counter": "0,1,2,3", 198 "Counter": "0,1,2,3",
199 "EventName": "ITLB_MISSES.WALK_COMPLETED_2M_4M", 199 "EventName": "ITLB_MISSES.WALK_COMPLETED_2M_4M",
200 "PublicDescription": "Counts completed page walks of any page size (4K/2M/4M/1G) caused by a code fetch. This implies it missed in the ITLB and further levels of TLB. The page walk can end with or without a fault.", 200 "PublicDescription": "Counts code misses in all ITLB levels that caused a completed page walk (2M and 4M page sizes). The page walk can end with or without a fault.",
201 "SampleAfterValue": "100003", 201 "SampleAfterValue": "100003",
202 "CounterHTOff": "0,1,2,3,4,5,6,7" 202 "CounterHTOff": "0,1,2,3,4,5,6,7"
203 }, 203 },
@@ -224,10 +224,10 @@
224 { 224 {
225 "EventCode": "0x85", 225 "EventCode": "0x85",
226 "UMask": "0x10", 226 "UMask": "0x10",
227 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake. ", 227 "BriefDescription": "Counts 1 per cycle for each PMH that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake.",
228 "Counter": "0,1,2,3", 228 "Counter": "0,1,2,3",
229 "EventName": "ITLB_MISSES.WALK_PENDING", 229 "EventName": "ITLB_MISSES.WALK_PENDING",
230 "PublicDescription": "Counts 1 per cycle for each PMH (Page Miss Handler) that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake michroarchitecture. ", 230 "PublicDescription": "Counts 1 per cycle for each PMH (Page Miss Handler) that is busy with a page walk for an instruction fetch request. EPT page walk duration are excluded in Skylake michroarchitecture.",
231 "SampleAfterValue": "100003", 231 "SampleAfterValue": "100003",
232 "CounterHTOff": "0,1,2,3,4,5,6,7" 232 "CounterHTOff": "0,1,2,3,4,5,6,7"
233 }, 233 },
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 9eb7047bafe4..b578aa26e375 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -116,6 +116,43 @@ static void fixdesc(char *s)
116 *e = 0; 116 *e = 0;
117} 117}
118 118
119/* Add escapes for '\' so they are proper C strings. */
120static char *fixregex(char *s)
121{
122 int len = 0;
123 int esc_count = 0;
124 char *fixed = NULL;
125 char *p, *q;
126
127 /* Count the number of '\' in string */
128 for (p = s; *p; p++) {
129 ++len;
130 if (*p == '\\')
131 ++esc_count;
132 }
133
134 if (esc_count == 0)
135 return s;
136
137 /* allocate space for a new string */
138 fixed = (char *) malloc(len + 1);
139 if (!fixed)
140 return NULL;
141
142 /* copy over the characters */
143 q = fixed;
144 for (p = s; *p; p++) {
145 if (*p == '\\') {
146 *q = '\\';
147 ++q;
148 }
149 *q = *p;
150 ++q;
151 }
152 *q = '\0';
153 return fixed;
154}
155
119static struct msrmap { 156static struct msrmap {
120 const char *num; 157 const char *num;
121 const char *pname; 158 const char *pname;
@@ -648,7 +685,7 @@ static int process_mapfile(FILE *outfp, char *fpath)
648 } 685 }
649 line[strlen(line)-1] = '\0'; 686 line[strlen(line)-1] = '\0';
650 687
651 cpuid = strtok_r(p, ",", &save); 688 cpuid = fixregex(strtok_r(p, ",", &save));
652 version = strtok_r(NULL, ",", &save); 689 version = strtok_r(NULL, ",", &save);
653 fname = strtok_r(NULL, ",", &save); 690 fname = strtok_r(NULL, ",", &save);
654 type = strtok_r(NULL, ",", &save); 691 type = strtok_r(NULL, ",", &save);
diff --git a/tools/perf/scripts/python/bin/mem-phys-addr-record b/tools/perf/scripts/python/bin/mem-phys-addr-record
new file mode 100644
index 000000000000..5a875122a904
--- /dev/null
+++ b/tools/perf/scripts/python/bin/mem-phys-addr-record
@@ -0,0 +1,19 @@
1#!/bin/bash
2
3#
4# Profiling physical memory by all retired load instructions/uops event
5# MEM_INST_RETIRED.ALL_LOADS or MEM_UOPS_RETIRED.ALL_LOADS
6#
7
8load=`perf list | grep mem_inst_retired.all_loads`
9if [ -z "$load" ]; then
10 load=`perf list | grep mem_uops_retired.all_loads`
11fi
12if [ -z "$load" ]; then
13 echo "There is no event to count all retired load instructions/uops."
14 exit 1
15fi
16
17arg=$(echo $load | tr -d ' ')
18arg="$arg:P"
19perf record --phys-data -e $arg $@
diff --git a/tools/perf/scripts/python/bin/mem-phys-addr-report b/tools/perf/scripts/python/bin/mem-phys-addr-report
new file mode 100644
index 000000000000..3f2b847e2eab
--- /dev/null
+++ b/tools/perf/scripts/python/bin/mem-phys-addr-report
@@ -0,0 +1,3 @@
1#!/bin/bash
2# description: resolve physical address samples
3perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/mem-phys-addr.py
diff --git a/tools/perf/scripts/python/mem-phys-addr.py b/tools/perf/scripts/python/mem-phys-addr.py
new file mode 100644
index 000000000000..ebee2c5ae496
--- /dev/null
+++ b/tools/perf/scripts/python/mem-phys-addr.py
@@ -0,0 +1,95 @@
1# mem-phys-addr.py: Resolve physical address samples
2# SPDX-License-Identifier: GPL-2.0
3#
4# Copyright (c) 2018, Intel Corporation.
5
6from __future__ import division
7import os
8import sys
9import struct
10import re
11import bisect
12import collections
13
14sys.path.append(os.environ['PERF_EXEC_PATH'] + \
15 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
16
17#physical address ranges for System RAM
18system_ram = []
19#physical address ranges for Persistent Memory
20pmem = []
21#file object for proc iomem
22f = None
23#Count for each type of memory
24load_mem_type_cnt = collections.Counter()
25#perf event name
26event_name = None
27
28def parse_iomem():
29 global f
30 f = open('/proc/iomem', 'r')
31 for i, j in enumerate(f):
32 m = re.split('-|:',j,2)
33 if m[2].strip() == 'System RAM':
34 system_ram.append(long(m[0], 16))
35 system_ram.append(long(m[1], 16))
36 if m[2].strip() == 'Persistent Memory':
37 pmem.append(long(m[0], 16))
38 pmem.append(long(m[1], 16))
39
40def print_memory_type():
41 print "Event: %s" % (event_name)
42 print "%-40s %10s %10s\n" % ("Memory type", "count", "percentage"),
43 print "%-40s %10s %10s\n" % ("----------------------------------------", \
44 "-----------", "-----------"),
45 total = sum(load_mem_type_cnt.values())
46 for mem_type, count in sorted(load_mem_type_cnt.most_common(), \
47 key = lambda(k, v): (v, k), reverse = True):
48 print "%-40s %10d %10.1f%%\n" % (mem_type, count, 100 * count / total),
49
50def trace_begin():
51 parse_iomem()
52
53def trace_end():
54 print_memory_type()
55 f.close()
56
57def is_system_ram(phys_addr):
58 #/proc/iomem is sorted
59 position = bisect.bisect(system_ram, phys_addr)
60 if position % 2 == 0:
61 return False
62 return True
63
64def is_persistent_mem(phys_addr):
65 position = bisect.bisect(pmem, phys_addr)
66 if position % 2 == 0:
67 return False
68 return True
69
70def find_memory_type(phys_addr):
71 if phys_addr == 0:
72 return "N/A"
73 if is_system_ram(phys_addr):
74 return "System RAM"
75
76 if is_persistent_mem(phys_addr):
77 return "Persistent Memory"
78
79 #slow path, search all
80 f.seek(0, 0)
81 for j in f:
82 m = re.split('-|:',j,2)
83 if long(m[0], 16) <= phys_addr <= long(m[1], 16):
84 return m[2]
85 return "N/A"
86
87def process_event(param_dict):
88 name = param_dict["ev_name"]
89 sample = param_dict["sample"]
90 phys_addr = sample["phys_addr"]
91
92 global event_name
93 if event_name == None:
94 event_name = name
95 load_mem_type_cnt[find_memory_type(phys_addr)] += 1
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 0e1367f90af5..97f64ad7fa08 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -124,6 +124,12 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
124 WRITE_ASS(exclude_guest, "d"); 124 WRITE_ASS(exclude_guest, "d");
125 WRITE_ASS(exclude_callchain_kernel, "d"); 125 WRITE_ASS(exclude_callchain_kernel, "d");
126 WRITE_ASS(exclude_callchain_user, "d"); 126 WRITE_ASS(exclude_callchain_user, "d");
127 WRITE_ASS(mmap2, "d");
128 WRITE_ASS(comm_exec, "d");
129 WRITE_ASS(context_switch, "d");
130 WRITE_ASS(write_backward, "d");
131 WRITE_ASS(namespaces, "d");
132 WRITE_ASS(use_clockid, "d");
127 WRITE_ASS(wakeup_events, PRIu32); 133 WRITE_ASS(wakeup_events, PRIu32);
128 WRITE_ASS(bp_type, PRIu32); 134 WRITE_ASS(bp_type, PRIu32);
129 WRITE_ASS(config1, "llu"); 135 WRITE_ASS(config1, "llu");
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index 71b9a0b613d2..4035d43523c3 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -33,8 +33,8 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count,
33 for (i = 0; i < evlist->nr_mmaps; i++) { 33 for (i = 0; i < evlist->nr_mmaps; i++) {
34 union perf_event *event; 34 union perf_event *event;
35 35
36 perf_mmap__read_catchup(&evlist->backward_mmap[i]); 36 perf_mmap__read_catchup(&evlist->overwrite_mmap[i]);
37 while ((event = perf_mmap__read_backward(&evlist->backward_mmap[i])) != NULL) { 37 while ((event = perf_mmap__read_backward(&evlist->overwrite_mmap[i])) != NULL) {
38 const u32 type = event->header.type; 38 const u32 type = event->header.type;
39 39
40 switch (type) { 40 switch (type) {
@@ -59,7 +59,7 @@ static int do_test(struct perf_evlist *evlist, int mmap_pages,
59 int err; 59 int err;
60 char sbuf[STRERR_BUFSIZE]; 60 char sbuf[STRERR_BUFSIZE];
61 61
62 err = perf_evlist__mmap(evlist, mmap_pages, true); 62 err = perf_evlist__mmap(evlist, mmap_pages);
63 if (err < 0) { 63 if (err < 0) {
64 pr_debug("perf_evlist__mmap: %s\n", 64 pr_debug("perf_evlist__mmap: %s\n",
65 str_error_r(errno, sbuf, sizeof(sbuf))); 65 str_error_r(errno, sbuf, sizeof(sbuf)));
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index 335b695f4970..a467615c5a0e 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -296,7 +296,7 @@ bool test__bp_signal_is_supported(void)
296 * instruction breakpoint using the perf event interface. 296 * instruction breakpoint using the perf event interface.
297 * Once it's there we can release this. 297 * Once it's there we can release this.
298 */ 298 */
299#ifdef __powerpc__ 299#if defined(__powerpc__) || defined(__s390x__)
300 return false; 300 return false;
301#else 301#else
302 return true; 302 return true;
diff --git a/tools/perf/tests/bpf-script-example.c b/tools/perf/tests/bpf-script-example.c
index 268e5f8e4aa2..e4123c1b0e88 100644
--- a/tools/perf/tests/bpf-script-example.c
+++ b/tools/perf/tests/bpf-script-example.c
@@ -31,8 +31,8 @@ struct bpf_map_def SEC("maps") flip_table = {
31 .max_entries = 1, 31 .max_entries = 1,
32}; 32};
33 33
34SEC("func=SyS_epoll_wait") 34SEC("func=SyS_epoll_pwait")
35int bpf_func__SyS_epoll_wait(void *ctx) 35int bpf_func__SyS_epoll_pwait(void *ctx)
36{ 36{
37 int ind =0; 37 int ind =0;
38 int *flag = bpf_map_lookup_elem(&flip_table, &ind); 38 int *flag = bpf_map_lookup_elem(&flip_table, &ind);
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 34c22cdf4d5d..e8399beca62b 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -3,6 +3,7 @@
3#include <sys/epoll.h> 3#include <sys/epoll.h>
4#include <sys/types.h> 4#include <sys/types.h>
5#include <sys/stat.h> 5#include <sys/stat.h>
6#include <fcntl.h>
6#include <util/util.h> 7#include <util/util.h>
7#include <util/bpf-loader.h> 8#include <util/bpf-loader.h>
8#include <util/evlist.h> 9#include <util/evlist.h>
@@ -19,13 +20,13 @@
19 20
20#ifdef HAVE_LIBBPF_SUPPORT 21#ifdef HAVE_LIBBPF_SUPPORT
21 22
22static int epoll_wait_loop(void) 23static int epoll_pwait_loop(void)
23{ 24{
24 int i; 25 int i;
25 26
26 /* Should fail NR_ITERS times */ 27 /* Should fail NR_ITERS times */
27 for (i = 0; i < NR_ITERS; i++) 28 for (i = 0; i < NR_ITERS; i++)
28 epoll_wait(-(i + 1), NULL, 0, 0); 29 epoll_pwait(-(i + 1), NULL, 0, 0, NULL);
29 return 0; 30 return 0;
30} 31}
31 32
@@ -63,46 +64,41 @@ static struct {
63 bool pin; 64 bool pin;
64} bpf_testcase_table[] = { 65} bpf_testcase_table[] = {
65 { 66 {
66 LLVM_TESTCASE_BASE, 67 .prog_id = LLVM_TESTCASE_BASE,
67 "Basic BPF filtering", 68 .desc = "Basic BPF filtering",
68 "[basic_bpf_test]", 69 .name = "[basic_bpf_test]",
69 "fix 'perf test LLVM' first", 70 .msg_compile_fail = "fix 'perf test LLVM' first",
70 "load bpf object failed", 71 .msg_load_fail = "load bpf object failed",
71 &epoll_wait_loop, 72 .target_func = &epoll_pwait_loop,
72 (NR_ITERS + 1) / 2, 73 .expect_result = (NR_ITERS + 1) / 2,
73 false,
74 }, 74 },
75 { 75 {
76 LLVM_TESTCASE_BASE, 76 .prog_id = LLVM_TESTCASE_BASE,
77 "BPF pinning", 77 .desc = "BPF pinning",
78 "[bpf_pinning]", 78 .name = "[bpf_pinning]",
79 "fix kbuild first", 79 .msg_compile_fail = "fix kbuild first",
80 "check your vmlinux setting?", 80 .msg_load_fail = "check your vmlinux setting?",
81 &epoll_wait_loop, 81 .target_func = &epoll_pwait_loop,
82 (NR_ITERS + 1) / 2, 82 .expect_result = (NR_ITERS + 1) / 2,
83 true, 83 .pin = true,
84 }, 84 },
85#ifdef HAVE_BPF_PROLOGUE 85#ifdef HAVE_BPF_PROLOGUE
86 { 86 {
87 LLVM_TESTCASE_BPF_PROLOGUE, 87 .prog_id = LLVM_TESTCASE_BPF_PROLOGUE,
88 "BPF prologue generation", 88 .desc = "BPF prologue generation",
89 "[bpf_prologue_test]", 89 .name = "[bpf_prologue_test]",
90 "fix kbuild first", 90 .msg_compile_fail = "fix kbuild first",
91 "check your vmlinux setting?", 91 .msg_load_fail = "check your vmlinux setting?",
92 &llseek_loop, 92 .target_func = &llseek_loop,
93 (NR_ITERS + 1) / 4, 93 .expect_result = (NR_ITERS + 1) / 4,
94 false,
95 }, 94 },
96#endif 95#endif
97 { 96 {
98 LLVM_TESTCASE_BPF_RELOCATION, 97 .prog_id = LLVM_TESTCASE_BPF_RELOCATION,
99 "BPF relocation checker", 98 .desc = "BPF relocation checker",
100 "[bpf_relocation_test]", 99 .name = "[bpf_relocation_test]",
101 "fix 'perf test LLVM' first", 100 .msg_compile_fail = "fix 'perf test LLVM' first",
102 "libbpf error when dealing with relocation", 101 .msg_load_fail = "libbpf error when dealing with relocation",
103 NULL,
104 0,
105 false,
106 }, 102 },
107}; 103};
108 104
@@ -167,7 +163,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
167 goto out_delete_evlist; 163 goto out_delete_evlist;
168 } 164 }
169 165
170 err = perf_evlist__mmap(evlist, opts.mmap_pages, false); 166 err = perf_evlist__mmap(evlist, opts.mmap_pages);
171 if (err < 0) { 167 if (err < 0) {
172 pr_debug("perf_evlist__mmap: %s\n", 168 pr_debug("perf_evlist__mmap: %s\n",
173 str_error_r(errno, sbuf, sizeof(sbuf))); 169 str_error_r(errno, sbuf, sizeof(sbuf)));
@@ -190,7 +186,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
190 } 186 }
191 187
192 if (count != expect) { 188 if (count != expect) {
193 pr_debug("BPF filter result incorrect\n"); 189 pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
194 goto out_delete_evlist; 190 goto out_delete_evlist;
195 } 191 }
196 192
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 766573e236e4..fafa014240cd 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -411,9 +411,9 @@ static const char *shell_test__description(char *description, size_t size,
411 return description ? trim(description + 1) : NULL; 411 return description ? trim(description + 1) : NULL;
412} 412}
413 413
414#define for_each_shell_test(dir, ent) \ 414#define for_each_shell_test(dir, base, ent) \
415 while ((ent = readdir(dir)) != NULL) \ 415 while ((ent = readdir(dir)) != NULL) \
416 if (ent->d_type == DT_REG && ent->d_name[0] != '.') 416 if (!is_directory(base, ent))
417 417
418static const char *shell_tests__dir(char *path, size_t size) 418static const char *shell_tests__dir(char *path, size_t size)
419{ 419{
@@ -452,7 +452,7 @@ static int shell_tests__max_desc_width(void)
452 if (!dir) 452 if (!dir)
453 return -1; 453 return -1;
454 454
455 for_each_shell_test(dir, ent) { 455 for_each_shell_test(dir, path, ent) {
456 char bf[256]; 456 char bf[256];
457 const char *desc = shell_test__description(bf, sizeof(bf), path, ent->d_name); 457 const char *desc = shell_test__description(bf, sizeof(bf), path, ent->d_name);
458 458
@@ -504,7 +504,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width)
504 if (!dir) 504 if (!dir)
505 return -1; 505 return -1;
506 506
507 for_each_shell_test(dir, ent) { 507 for_each_shell_test(dir, st.dir, ent) {
508 int curr = i++; 508 int curr = i++;
509 char desc[256]; 509 char desc[256];
510 struct test test = { 510 struct test test = {
@@ -614,7 +614,7 @@ static int perf_test__list_shell(int argc, const char **argv, int i)
614 if (!dir) 614 if (!dir)
615 return -1; 615 return -1;
616 616
617 for_each_shell_test(dir, ent) { 617 for_each_shell_test(dir, path, ent) {
618 int curr = i++; 618 int curr = i++;
619 char bf[256]; 619 char bf[256];
620 struct test t = { 620 struct test t = {
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index fcc8984bc329..3bf7b145b826 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -639,7 +639,7 @@ static int do_test_code_reading(bool try_kcore)
639 break; 639 break;
640 } 640 }
641 641
642 ret = perf_evlist__mmap(evlist, UINT_MAX, false); 642 ret = perf_evlist__mmap(evlist, UINT_MAX);
643 if (ret < 0) { 643 if (ret < 0) {
644 pr_debug("perf_evlist__mmap failed\n"); 644 pr_debug("perf_evlist__mmap failed\n");
645 goto out_put; 645 goto out_put;
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index ac40e05bcab4..260418969120 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -173,6 +173,7 @@ int test__dwarf_unwind(struct test *test __maybe_unused, int subtest __maybe_unu
173 } 173 }
174 174
175 callchain_param.record_mode = CALLCHAIN_DWARF; 175 callchain_param.record_mode = CALLCHAIN_DWARF;
176 dwarf_callchain_users = true;
176 177
177 if (init_live_machine(machine)) { 178 if (init_live_machine(machine)) {
178 pr_err("Could not init machine\n"); 179 pr_err("Could not init machine\n");
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index 842d33637a18..c46530918938 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -95,7 +95,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
95 goto out_err; 95 goto out_err;
96 } 96 }
97 97
98 CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false)); 98 CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
99 99
100 /* 100 /*
101 * First, test that a 'comm' event can be found when the event is 101 * First, test that a 'comm' event can be found when the event is
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index 5a8bf318f8a7..c0e971da965c 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -94,7 +94,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
94 expected_nr_events[i] = 1 + rand() % 127; 94 expected_nr_events[i] = 1 + rand() % 127;
95 } 95 }
96 96
97 if (perf_evlist__mmap(evlist, 128, true) < 0) { 97 if (perf_evlist__mmap(evlist, 128) < 0) {
98 pr_debug("failed to mmap events: %d (%s)\n", errno, 98 pr_debug("failed to mmap events: %d (%s)\n", errno,
99 str_error_r(errno, sbuf, sizeof(sbuf))); 99 str_error_r(errno, sbuf, sizeof(sbuf)));
100 goto out_delete_evlist; 100 goto out_delete_evlist;
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index d9619d265314..43519267b93b 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -1,5 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <linux/err.h> 2#include <linux/err.h>
3#include <sys/types.h>
4#include <sys/stat.h>
5#include <fcntl.h>
3#include "perf.h" 6#include "perf.h"
4#include "evlist.h" 7#include "evlist.h"
5#include "evsel.h" 8#include "evsel.h"
@@ -64,7 +67,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
64 goto out_delete_evlist; 67 goto out_delete_evlist;
65 } 68 }
66 69
67 err = perf_evlist__mmap(evlist, UINT_MAX, false); 70 err = perf_evlist__mmap(evlist, UINT_MAX);
68 if (err < 0) { 71 if (err < 0) {
69 pr_debug("perf_evlist__mmap: %s\n", 72 pr_debug("perf_evlist__mmap: %s\n",
70 str_error_r(errno, sbuf, sizeof(sbuf))); 73 str_error_r(errno, sbuf, sizeof(sbuf)));
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index f0679613bd18..18b06444f230 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -13,7 +13,6 @@
13#include <unistd.h> 13#include <unistd.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/hw_breakpoint.h> 15#include <linux/hw_breakpoint.h>
16#include <api/fs/fs.h>
17#include <api/fs/tracing_path.h> 16#include <api/fs/tracing_path.h>
18 17
19#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \ 18#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index c34904d37705..0afafab85238 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -141,7 +141,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
141 * fds in the same CPU to be injected in the same mmap ring buffer 141 * fds in the same CPU to be injected in the same mmap ring buffer
142 * (using ioctl(PERF_EVENT_IOC_SET_OUTPUT)). 142 * (using ioctl(PERF_EVENT_IOC_SET_OUTPUT)).
143 */ 143 */
144 err = perf_evlist__mmap(evlist, opts.mmap_pages, false); 144 err = perf_evlist__mmap(evlist, opts.mmap_pages);
145 if (err < 0) { 145 if (err < 0) {
146 pr_debug("perf_evlist__mmap: %s\n", 146 pr_debug("perf_evlist__mmap: %s\n",
147 str_error_r(errno, sbuf, sizeof(sbuf))); 147 str_error_r(errno, sbuf, sizeof(sbuf)));
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 3ec6302b6498..0e2d00d69e6e 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -248,7 +248,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
248 event->header.size = sz; 248 event->header.size = sz;
249 249
250 err = perf_event__synthesize_sample(event, sample_type, read_format, 250 err = perf_event__synthesize_sample(event, sample_type, read_format,
251 &sample, false); 251 &sample);
252 if (err) { 252 if (err) {
253 pr_debug("%s failed for sample_type %#"PRIx64", error %d\n", 253 pr_debug("%s failed for sample_type %#"PRIx64", error %d\n",
254 "perf_event__synthesize_sample", sample_type, err); 254 "perf_event__synthesize_sample", sample_type, err);
diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
index 2a9ef080efd0..55ad9793d544 100755
--- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
@@ -17,10 +17,9 @@ 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 test "$(uname -m)" = s390x && { svc="openat"; txt="dfd: +CWD, +"; } 20 evts=$(echo $(perf list syscalls:sys_enter_open* |& egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')
21 21 perf trace -e $evts touch $file 2>&1 | \
22 perf trace -e ${svc:-open} 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]+$"
23 egrep " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ ${svc:-open}\(${txt}filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$"
24} 23}
25 24
26 25
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index 725a196991a8..f6c72f915d48 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -78,7 +78,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
78 goto out_delete_evlist; 78 goto out_delete_evlist;
79 } 79 }
80 80
81 err = perf_evlist__mmap(evlist, 128, true); 81 err = perf_evlist__mmap(evlist, 128);
82 if (err < 0) { 82 if (err < 0) {
83 pr_debug("failed to mmap event: %d (%s)\n", errno, 83 pr_debug("failed to mmap event: %d (%s)\n", errno,
84 str_error_r(errno, sbuf, sizeof(sbuf))); 84 str_error_r(errno, sbuf, sizeof(sbuf)));
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 7d3f4bf9534f..33e00295a972 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -449,7 +449,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
449 goto out; 449 goto out;
450 } 450 }
451 451
452 err = perf_evlist__mmap(evlist, UINT_MAX, false); 452 err = perf_evlist__mmap(evlist, UINT_MAX);
453 if (err) { 453 if (err) {
454 pr_debug("perf_evlist__mmap failed!\n"); 454 pr_debug("perf_evlist__mmap failed!\n");
455 goto out_err; 455 goto out_err;
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index 89c8e1604ca7..01b62b81751b 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -101,7 +101,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
101 goto out_delete_evlist; 101 goto out_delete_evlist;
102 } 102 }
103 103
104 if (perf_evlist__mmap(evlist, 128, true) < 0) { 104 if (perf_evlist__mmap(evlist, 128) < 0) {
105 pr_debug("failed to mmap events: %d (%s)\n", errno, 105 pr_debug("failed to mmap events: %d (%s)\n", errno,
106 str_error_r(errno, sbuf, sizeof(sbuf))); 106 str_error_r(errno, sbuf, sizeof(sbuf)));
107 goto out_delete_evlist; 107 goto out_delete_evlist;
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c
index dbcb6a19b375..4de1939b58ba 100644
--- a/tools/perf/tests/thread-map.c
+++ b/tools/perf/tests/thread-map.c
@@ -105,7 +105,7 @@ int test__thread_map_remove(struct test *test __maybe_unused, int subtest __mayb
105 TEST_ASSERT_VAL("failed to allocate map string", 105 TEST_ASSERT_VAL("failed to allocate map string",
106 asprintf(&str, "%d,%d", getpid(), getppid()) >= 0); 106 asprintf(&str, "%d,%d", getpid(), getppid()) >= 0);
107 107
108 threads = thread_map__new_str(str, NULL, 0); 108 threads = thread_map__new_str(str, NULL, 0, false);
109 109
110 TEST_ASSERT_VAL("failed to allocate thread_map", 110 TEST_ASSERT_VAL("failed to allocate thread_map",
111 threads); 111 threads);
diff --git a/tools/perf/trace/beauty/Build b/tools/perf/trace/beauty/Build
index 066bbf0f4a74..66330d4b739b 100644
--- a/tools/perf/trace/beauty/Build
+++ b/tools/perf/trace/beauty/Build
@@ -1,5 +1,6 @@
1libperf-y += clone.o 1libperf-y += clone.o
2libperf-y += fcntl.o 2libperf-y += fcntl.o
3libperf-y += flock.o
3ifeq ($(SRCARCH),$(filter $(SRCARCH),x86)) 4ifeq ($(SRCARCH),$(filter $(SRCARCH),x86))
4libperf-y += ioctl.o 5libperf-y += ioctl.o
5endif 6endif
diff --git a/tools/perf/trace/beauty/arch_errno_names.c b/tools/perf/trace/beauty/arch_errno_names.c
new file mode 100644
index 000000000000..ede031c3a9e0
--- /dev/null
+++ b/tools/perf/trace/beauty/arch_errno_names.c
@@ -0,0 +1 @@
#include "trace/beauty/generated/arch_errno_name_array.c"
diff --git a/tools/perf/trace/beauty/arch_errno_names.sh b/tools/perf/trace/beauty/arch_errno_names.sh
new file mode 100755
index 000000000000..22c9fc900c84
--- /dev/null
+++ b/tools/perf/trace/beauty/arch_errno_names.sh
@@ -0,0 +1,100 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Generate C file mapping errno codes to errno names.
5#
6# Copyright IBM Corp. 2018
7# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
8
9gcc="$1"
10toolsdir="$2"
11include_path="-I$toolsdir/include/uapi"
12
13arch_string()
14{
15 echo "$1" |sed -e 'y/- /__/' |tr '[[:upper:]]' '[[:lower:]]'
16}
17
18asm_errno_file()
19{
20 local arch="$1"
21 local header
22
23 header="$toolsdir/arch/$arch/include/uapi/asm/errno.h"
24 if test -r "$header"; then
25 echo "$header"
26 else
27 echo "$toolsdir/include/uapi/asm-generic/errno.h"
28 fi
29}
30
31create_errno_lookup_func()
32{
33 local arch=$(arch_string "$1")
34 local nr name
35
36 cat <<EoFuncBegin
37static const char *errno_to_name__$arch(int err)
38{
39 switch (err) {
40EoFuncBegin
41
42 while read name nr; do
43 printf '\tcase %d: return "%s";\n' $nr $name
44 done
45
46 cat <<EoFuncEnd
47 default:
48 return "(unknown)";
49 }
50}
51
52EoFuncEnd
53}
54
55process_arch()
56{
57 local arch="$1"
58 local asm_errno=$(asm_errno_file "$arch")
59
60 $gcc $include_path -E -dM -x c $asm_errno \
61 |grep -hE '^#define[[:blank:]]+(E[^[:blank:]]+)[[:blank:]]+([[:digit:]]+).*' \
62 |awk '{ print $2","$3; }' \
63 |sort -t, -k2 -nu \
64 |IFS=, create_errno_lookup_func "$arch"
65}
66
67create_arch_errno_table_func()
68{
69 local archlist="$1"
70 local default="$2"
71 local arch
72
73 printf 'const char *arch_syscalls__strerrno(const char *arch, int err)\n'
74 printf '{\n'
75 for arch in $archlist; do
76 printf '\tif (!strcmp(arch, "%s"))\n' $(arch_string "$arch")
77 printf '\t\treturn errno_to_name__%s(err);\n' $(arch_string "$arch")
78 done
79 printf '\treturn errno_to_name__%s(err);\n' $(arch_string "$default")
80 printf '}\n'
81}
82
83cat <<EoHEADER
84/* SPDX-License-Identifier: GPL-2.0 */
85
86#include <string.h>
87
88EoHEADER
89
90# Create list of architectures and ignore those that do not appear
91# in tools/perf/arch
92archlist=""
93for arch in $(find $toolsdir/arch -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | grep -v x86 | sort); do
94 test -d arch/$arch && archlist="$archlist $arch"
95done
96
97for arch in x86 $archlist generic; do
98 process_arch "$arch"
99done
100create_arch_errno_table_func "x86 $archlist" "generic"
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h
index a6dfd04beaee..984a504d335c 100644
--- a/tools/perf/trace/beauty/beauty.h
+++ b/tools/perf/trace/beauty/beauty.h
@@ -79,6 +79,9 @@ size_t syscall_arg__scnprintf_fcntl_cmd(char *bf, size_t size, struct syscall_ar
79size_t syscall_arg__scnprintf_fcntl_arg(char *bf, size_t size, struct syscall_arg *arg); 79size_t syscall_arg__scnprintf_fcntl_arg(char *bf, size_t size, struct syscall_arg *arg);
80#define SCA_FCNTL_ARG syscall_arg__scnprintf_fcntl_arg 80#define SCA_FCNTL_ARG syscall_arg__scnprintf_fcntl_arg
81 81
82size_t syscall_arg__scnprintf_flock(char *bf, size_t size, struct syscall_arg *arg);
83#define SCA_FLOCK syscall_arg__scnprintf_flock
84
82size_t syscall_arg__scnprintf_ioctl_cmd(char *bf, size_t size, struct syscall_arg *arg); 85size_t syscall_arg__scnprintf_ioctl_cmd(char *bf, size_t size, struct syscall_arg *arg);
83#define SCA_IOCTL_CMD syscall_arg__scnprintf_ioctl_cmd 86#define SCA_IOCTL_CMD syscall_arg__scnprintf_ioctl_cmd
84 87
@@ -114,4 +117,6 @@ size_t open__scnprintf_flags(unsigned long flags, char *bf, size_t size);
114void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg, 117void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg,
115 size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg)); 118 size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg));
116 119
120const char *arch_syscalls__strerrno(const char *arch, int err);
121
117#endif /* _PERF_TRACE_BEAUTY_H */ 122#endif /* _PERF_TRACE_BEAUTY_H */
diff --git a/tools/perf/trace/beauty/flock.c b/tools/perf/trace/beauty/flock.c
index f9707f57566c..c4ff6ad30b06 100644
--- a/tools/perf/trace/beauty/flock.c
+++ b/tools/perf/trace/beauty/flock.c
@@ -1,5 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <fcntl.h> 2
3#include "trace/beauty/beauty.h"
4#include <linux/kernel.h>
5#include <uapi/linux/fcntl.h>
3 6
4#ifndef LOCK_MAND 7#ifndef LOCK_MAND
5#define LOCK_MAND 32 8#define LOCK_MAND 32
@@ -17,8 +20,7 @@
17#define LOCK_RW 192 20#define LOCK_RW 192
18#endif 21#endif
19 22
20static size_t syscall_arg__scnprintf_flock(char *bf, size_t size, 23size_t syscall_arg__scnprintf_flock(char *bf, size_t size, struct syscall_arg *arg)
21 struct syscall_arg *arg)
22{ 24{
23 int printed = 0, op = arg->val; 25 int printed = 0, op = arg->val;
24 26
@@ -45,5 +47,3 @@ static size_t syscall_arg__scnprintf_flock(char *bf, size_t size,
45 47
46 return printed; 48 return printed;
47} 49}
48
49#define SCA_FLOCK syscall_arg__scnprintf_flock
diff --git a/tools/perf/trace/beauty/futex_val3.c b/tools/perf/trace/beauty/futex_val3.c
new file mode 100644
index 000000000000..26f6b3253511
--- /dev/null
+++ b/tools/perf/trace/beauty/futex_val3.c
@@ -0,0 +1,18 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/futex.h>
3
4#ifndef FUTEX_BITSET_MATCH_ANY
5#define FUTEX_BITSET_MATCH_ANY 0xffffffff
6#endif
7
8static size_t syscall_arg__scnprintf_futex_val3(char *bf, size_t size, struct syscall_arg *arg)
9{
10 unsigned int bitset = arg->val;
11
12 if (bitset == FUTEX_BITSET_MATCH_ANY)
13 return scnprintf(bf, size, "MATCH_ANY");
14
15 return scnprintf(bf, size, "%#xd", bitset);
16}
17
18#define SCA_FUTEX_VAL3 syscall_arg__scnprintf_futex_val3
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 8f7f59d1a2b5..286427975112 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -25,16 +25,10 @@ struct disasm_line_samples {
25#define IPC_WIDTH 6 25#define IPC_WIDTH 6
26#define CYCLES_WIDTH 6 26#define CYCLES_WIDTH 6
27 27
28struct browser_disasm_line { 28struct browser_line {
29 struct rb_node rb_node; 29 u32 idx;
30 u32 idx; 30 int idx_asm;
31 int idx_asm; 31 int jump_sources;
32 int jump_sources;
33 /*
34 * actual length of this array is saved on the nr_events field
35 * of the struct annotate_browser
36 */
37 struct disasm_line_samples samples[1];
38}; 32};
39 33
40static struct annotate_browser_opt { 34static struct annotate_browser_opt {
@@ -53,39 +47,43 @@ static struct annotate_browser_opt {
53struct arch; 47struct arch;
54 48
55struct annotate_browser { 49struct annotate_browser {
56 struct ui_browser b; 50 struct ui_browser b;
57 struct rb_root entries; 51 struct rb_root entries;
58 struct rb_node *curr_hot; 52 struct rb_node *curr_hot;
59 struct disasm_line *selection; 53 struct annotation_line *selection;
60 struct disasm_line **offsets; 54 struct annotation_line **offsets;
61 struct arch *arch; 55 struct arch *arch;
62 int nr_events; 56 int nr_events;
63 u64 start; 57 u64 start;
64 int nr_asm_entries; 58 int nr_asm_entries;
65 int nr_entries; 59 int nr_entries;
66 int max_jump_sources; 60 int max_jump_sources;
67 int nr_jumps; 61 int nr_jumps;
68 bool searching_backwards; 62 bool searching_backwards;
69 bool have_cycles; 63 bool have_cycles;
70 u8 addr_width; 64 u8 addr_width;
71 u8 jumps_width; 65 u8 jumps_width;
72 u8 target_width; 66 u8 target_width;
73 u8 min_addr_width; 67 u8 min_addr_width;
74 u8 max_addr_width; 68 u8 max_addr_width;
75 char search_bf[128]; 69 char search_bf[128];
76}; 70};
77 71
78static inline struct browser_disasm_line *disasm_line__browser(struct disasm_line *dl) 72static inline struct browser_line *browser_line(struct annotation_line *al)
79{ 73{
80 return (struct browser_disasm_line *)(dl + 1); 74 void *ptr = al;
75
76 ptr = container_of(al, struct disasm_line, al);
77 return ptr - sizeof(struct browser_line);
81} 78}
82 79
83static bool disasm_line__filter(struct ui_browser *browser __maybe_unused, 80static bool disasm_line__filter(struct ui_browser *browser __maybe_unused,
84 void *entry) 81 void *entry)
85{ 82{
86 if (annotate_browser__opts.hide_src_code) { 83 if (annotate_browser__opts.hide_src_code) {
87 struct disasm_line *dl = list_entry(entry, struct disasm_line, node); 84 struct annotation_line *al = list_entry(entry, struct annotation_line, node);
88 return dl->offset == -1; 85
86 return al->offset == -1;
89 } 87 }
90 88
91 return false; 89 return false;
@@ -120,11 +118,37 @@ static int annotate_browser__cycles_width(struct annotate_browser *ab)
120 return ab->have_cycles ? IPC_WIDTH + CYCLES_WIDTH : 0; 118 return ab->have_cycles ? IPC_WIDTH + CYCLES_WIDTH : 0;
121} 119}
122 120
121static void disasm_line__write(struct disasm_line *dl, struct ui_browser *browser,
122 char *bf, size_t size)
123{
124 if (dl->ins.ops && dl->ins.ops->scnprintf) {
125 if (ins__is_jump(&dl->ins)) {
126 bool fwd = dl->ops.target.offset > dl->al.offset;
127
128 ui_browser__write_graph(browser, fwd ? SLSMG_DARROW_CHAR :
129 SLSMG_UARROW_CHAR);
130 SLsmg_write_char(' ');
131 } else if (ins__is_call(&dl->ins)) {
132 ui_browser__write_graph(browser, SLSMG_RARROW_CHAR);
133 SLsmg_write_char(' ');
134 } else if (ins__is_ret(&dl->ins)) {
135 ui_browser__write_graph(browser, SLSMG_LARROW_CHAR);
136 SLsmg_write_char(' ');
137 } else {
138 ui_browser__write_nstring(browser, " ", 2);
139 }
140 } else {
141 ui_browser__write_nstring(browser, " ", 2);
142 }
143
144 disasm_line__scnprintf(dl, bf, size, !annotate_browser__opts.use_offset);
145}
146
123static void annotate_browser__write(struct ui_browser *browser, void *entry, int row) 147static void annotate_browser__write(struct ui_browser *browser, void *entry, int row)
124{ 148{
125 struct annotate_browser *ab = container_of(browser, struct annotate_browser, b); 149 struct annotate_browser *ab = container_of(browser, struct annotate_browser, b);
126 struct disasm_line *dl = list_entry(entry, struct disasm_line, node); 150 struct annotation_line *al = list_entry(entry, struct annotation_line, node);
127 struct browser_disasm_line *bdl = disasm_line__browser(dl); 151 struct browser_line *bl = browser_line(al);
128 bool current_entry = ui_browser__is_current_entry(browser, row); 152 bool current_entry = ui_browser__is_current_entry(browser, row);
129 bool change_color = (!annotate_browser__opts.hide_src_code && 153 bool change_color = (!annotate_browser__opts.hide_src_code &&
130 (!current_entry || (browser->use_navkeypressed && 154 (!current_entry || (browser->use_navkeypressed &&
@@ -137,32 +161,32 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
137 bool show_title = false; 161 bool show_title = false;
138 162
139 for (i = 0; i < ab->nr_events; i++) { 163 for (i = 0; i < ab->nr_events; i++) {
140 if (bdl->samples[i].percent > percent_max) 164 if (al->samples[i].percent > percent_max)
141 percent_max = bdl->samples[i].percent; 165 percent_max = al->samples[i].percent;
142 } 166 }
143 167
144 if ((row == 0) && (dl->offset == -1 || percent_max == 0.0)) { 168 if ((row == 0) && (al->offset == -1 || percent_max == 0.0)) {
145 if (ab->have_cycles) { 169 if (ab->have_cycles) {
146 if (dl->ipc == 0.0 && dl->cycles == 0) 170 if (al->ipc == 0.0 && al->cycles == 0)
147 show_title = true; 171 show_title = true;
148 } else 172 } else
149 show_title = true; 173 show_title = true;
150 } 174 }
151 175
152 if (dl->offset != -1 && percent_max != 0.0) { 176 if (al->offset != -1 && percent_max != 0.0) {
153 for (i = 0; i < ab->nr_events; i++) { 177 for (i = 0; i < ab->nr_events; i++) {
154 ui_browser__set_percent_color(browser, 178 ui_browser__set_percent_color(browser,
155 bdl->samples[i].percent, 179 al->samples[i].percent,
156 current_entry); 180 current_entry);
157 if (annotate_browser__opts.show_total_period) { 181 if (annotate_browser__opts.show_total_period) {
158 ui_browser__printf(browser, "%11" PRIu64 " ", 182 ui_browser__printf(browser, "%11" PRIu64 " ",
159 bdl->samples[i].he.period); 183 al->samples[i].he.period);
160 } else if (annotate_browser__opts.show_nr_samples) { 184 } else if (annotate_browser__opts.show_nr_samples) {
161 ui_browser__printf(browser, "%6" PRIu64 " ", 185 ui_browser__printf(browser, "%6" PRIu64 " ",
162 bdl->samples[i].he.nr_samples); 186 al->samples[i].he.nr_samples);
163 } else { 187 } else {
164 ui_browser__printf(browser, "%6.2f ", 188 ui_browser__printf(browser, "%6.2f ",
165 bdl->samples[i].percent); 189 al->samples[i].percent);
166 } 190 }
167 } 191 }
168 } else { 192 } else {
@@ -177,16 +201,16 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
177 } 201 }
178 } 202 }
179 if (ab->have_cycles) { 203 if (ab->have_cycles) {
180 if (dl->ipc) 204 if (al->ipc)
181 ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->ipc); 205 ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, al->ipc);
182 else if (!show_title) 206 else if (!show_title)
183 ui_browser__write_nstring(browser, " ", IPC_WIDTH); 207 ui_browser__write_nstring(browser, " ", IPC_WIDTH);
184 else 208 else
185 ui_browser__printf(browser, "%*s ", IPC_WIDTH - 1, "IPC"); 209 ui_browser__printf(browser, "%*s ", IPC_WIDTH - 1, "IPC");
186 210
187 if (dl->cycles) 211 if (al->cycles)
188 ui_browser__printf(browser, "%*" PRIu64 " ", 212 ui_browser__printf(browser, "%*" PRIu64 " ",
189 CYCLES_WIDTH - 1, dl->cycles); 213 CYCLES_WIDTH - 1, al->cycles);
190 else if (!show_title) 214 else if (!show_title)
191 ui_browser__write_nstring(browser, " ", CYCLES_WIDTH); 215 ui_browser__write_nstring(browser, " ", CYCLES_WIDTH);
192 else 216 else
@@ -199,19 +223,19 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
199 if (!browser->navkeypressed) 223 if (!browser->navkeypressed)
200 width += 1; 224 width += 1;
201 225
202 if (!*dl->line) 226 if (!*al->line)
203 ui_browser__write_nstring(browser, " ", width - pcnt_width - cycles_width); 227 ui_browser__write_nstring(browser, " ", width - pcnt_width - cycles_width);
204 else if (dl->offset == -1) { 228 else if (al->offset == -1) {
205 if (dl->line_nr && annotate_browser__opts.show_linenr) 229 if (al->line_nr && annotate_browser__opts.show_linenr)
206 printed = scnprintf(bf, sizeof(bf), "%-*d ", 230 printed = scnprintf(bf, sizeof(bf), "%-*d ",
207 ab->addr_width + 1, dl->line_nr); 231 ab->addr_width + 1, al->line_nr);
208 else 232 else
209 printed = scnprintf(bf, sizeof(bf), "%*s ", 233 printed = scnprintf(bf, sizeof(bf), "%*s ",
210 ab->addr_width, " "); 234 ab->addr_width, " ");
211 ui_browser__write_nstring(browser, bf, printed); 235 ui_browser__write_nstring(browser, bf, printed);
212 ui_browser__write_nstring(browser, dl->line, width - printed - pcnt_width - cycles_width + 1); 236 ui_browser__write_nstring(browser, al->line, width - printed - pcnt_width - cycles_width + 1);
213 } else { 237 } else {
214 u64 addr = dl->offset; 238 u64 addr = al->offset;
215 int color = -1; 239 int color = -1;
216 240
217 if (!annotate_browser__opts.use_offset) 241 if (!annotate_browser__opts.use_offset)
@@ -220,13 +244,13 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
220 if (!annotate_browser__opts.use_offset) { 244 if (!annotate_browser__opts.use_offset) {
221 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr); 245 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
222 } else { 246 } else {
223 if (bdl->jump_sources) { 247 if (bl->jump_sources) {
224 if (annotate_browser__opts.show_nr_jumps) { 248 if (annotate_browser__opts.show_nr_jumps) {
225 int prev; 249 int prev;
226 printed = scnprintf(bf, sizeof(bf), "%*d ", 250 printed = scnprintf(bf, sizeof(bf), "%*d ",
227 ab->jumps_width, 251 ab->jumps_width,
228 bdl->jump_sources); 252 bl->jump_sources);
229 prev = annotate_browser__set_jumps_percent_color(ab, bdl->jump_sources, 253 prev = annotate_browser__set_jumps_percent_color(ab, bl->jump_sources,
230 current_entry); 254 current_entry);
231 ui_browser__write_nstring(browser, bf, printed); 255 ui_browser__write_nstring(browser, bf, printed);
232 ui_browser__set_color(browser, prev); 256 ui_browser__set_color(browser, prev);
@@ -245,32 +269,14 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
245 ui_browser__write_nstring(browser, bf, printed); 269 ui_browser__write_nstring(browser, bf, printed);
246 if (change_color) 270 if (change_color)
247 ui_browser__set_color(browser, color); 271 ui_browser__set_color(browser, color);
248 if (dl->ins.ops && dl->ins.ops->scnprintf) {
249 if (ins__is_jump(&dl->ins)) {
250 bool fwd = dl->ops.target.offset > dl->offset;
251
252 ui_browser__write_graph(browser, fwd ? SLSMG_DARROW_CHAR :
253 SLSMG_UARROW_CHAR);
254 SLsmg_write_char(' ');
255 } else if (ins__is_call(&dl->ins)) {
256 ui_browser__write_graph(browser, SLSMG_RARROW_CHAR);
257 SLsmg_write_char(' ');
258 } else if (ins__is_ret(&dl->ins)) {
259 ui_browser__write_graph(browser, SLSMG_LARROW_CHAR);
260 SLsmg_write_char(' ');
261 } else {
262 ui_browser__write_nstring(browser, " ", 2);
263 }
264 } else {
265 ui_browser__write_nstring(browser, " ", 2);
266 }
267 272
268 disasm_line__scnprintf(dl, bf, sizeof(bf), !annotate_browser__opts.use_offset); 273 disasm_line__write(disasm_line(al), browser, bf, sizeof(bf));
274
269 ui_browser__write_nstring(browser, bf, width - pcnt_width - cycles_width - 3 - printed); 275 ui_browser__write_nstring(browser, bf, width - pcnt_width - cycles_width - 3 - printed);
270 } 276 }
271 277
272 if (current_entry) 278 if (current_entry)
273 ab->selection = dl; 279 ab->selection = al;
274} 280}
275 281
276static bool disasm_line__is_valid_jump(struct disasm_line *dl, struct symbol *sym) 282static bool disasm_line__is_valid_jump(struct disasm_line *dl, struct symbol *sym)
@@ -286,7 +292,7 @@ static bool disasm_line__is_valid_jump(struct disasm_line *dl, struct symbol *sy
286 292
287static bool is_fused(struct annotate_browser *ab, struct disasm_line *cursor) 293static bool is_fused(struct annotate_browser *ab, struct disasm_line *cursor)
288{ 294{
289 struct disasm_line *pos = list_prev_entry(cursor, node); 295 struct disasm_line *pos = list_prev_entry(cursor, al.node);
290 const char *name; 296 const char *name;
291 297
292 if (!pos) 298 if (!pos)
@@ -306,8 +312,9 @@ static bool is_fused(struct annotate_browser *ab, struct disasm_line *cursor)
306static void annotate_browser__draw_current_jump(struct ui_browser *browser) 312static void annotate_browser__draw_current_jump(struct ui_browser *browser)
307{ 313{
308 struct annotate_browser *ab = container_of(browser, struct annotate_browser, b); 314 struct annotate_browser *ab = container_of(browser, struct annotate_browser, b);
309 struct disasm_line *cursor = ab->selection, *target; 315 struct disasm_line *cursor = disasm_line(ab->selection);
310 struct browser_disasm_line *btarget, *bcursor; 316 struct annotation_line *target;
317 struct browser_line *btarget, *bcursor;
311 unsigned int from, to; 318 unsigned int from, to;
312 struct map_symbol *ms = ab->b.priv; 319 struct map_symbol *ms = ab->b.priv;
313 struct symbol *sym = ms->sym; 320 struct symbol *sym = ms->sym;
@@ -321,11 +328,9 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
321 return; 328 return;
322 329
323 target = ab->offsets[cursor->ops.target.offset]; 330 target = ab->offsets[cursor->ops.target.offset];
324 if (!target)
325 return;
326 331
327 bcursor = disasm_line__browser(cursor); 332 bcursor = browser_line(&cursor->al);
328 btarget = disasm_line__browser(target); 333 btarget = browser_line(target);
329 334
330 if (annotate_browser__opts.hide_src_code) { 335 if (annotate_browser__opts.hide_src_code) {
331 from = bcursor->idx_asm; 336 from = bcursor->idx_asm;
@@ -361,12 +366,11 @@ static unsigned int annotate_browser__refresh(struct ui_browser *browser)
361 return ret; 366 return ret;
362} 367}
363 368
364static int disasm__cmp(struct browser_disasm_line *a, 369static int disasm__cmp(struct annotation_line *a, struct annotation_line *b)
365 struct browser_disasm_line *b, int nr_pcnt)
366{ 370{
367 int i; 371 int i;
368 372
369 for (i = 0; i < nr_pcnt; i++) { 373 for (i = 0; i < a->samples_nr; i++) {
370 if (a->samples[i].percent == b->samples[i].percent) 374 if (a->samples[i].percent == b->samples[i].percent)
371 continue; 375 continue;
372 return a->samples[i].percent < b->samples[i].percent; 376 return a->samples[i].percent < b->samples[i].percent;
@@ -374,28 +378,27 @@ static int disasm__cmp(struct browser_disasm_line *a,
374 return 0; 378 return 0;
375} 379}
376 380
377static void disasm_rb_tree__insert(struct rb_root *root, struct browser_disasm_line *bdl, 381static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line *al)
378 int nr_events)
379{ 382{
380 struct rb_node **p = &root->rb_node; 383 struct rb_node **p = &root->rb_node;
381 struct rb_node *parent = NULL; 384 struct rb_node *parent = NULL;
382 struct browser_disasm_line *l; 385 struct annotation_line *l;
383 386
384 while (*p != NULL) { 387 while (*p != NULL) {
385 parent = *p; 388 parent = *p;
386 l = rb_entry(parent, struct browser_disasm_line, rb_node); 389 l = rb_entry(parent, struct annotation_line, rb_node);
387 390
388 if (disasm__cmp(bdl, l, nr_events)) 391 if (disasm__cmp(al, l))
389 p = &(*p)->rb_left; 392 p = &(*p)->rb_left;
390 else 393 else
391 p = &(*p)->rb_right; 394 p = &(*p)->rb_right;
392 } 395 }
393 rb_link_node(&bdl->rb_node, parent, p); 396 rb_link_node(&al->rb_node, parent, p);
394 rb_insert_color(&bdl->rb_node, root); 397 rb_insert_color(&al->rb_node, root);
395} 398}
396 399
397static void annotate_browser__set_top(struct annotate_browser *browser, 400static void annotate_browser__set_top(struct annotate_browser *browser,
398 struct disasm_line *pos, u32 idx) 401 struct annotation_line *pos, u32 idx)
399{ 402{
400 unsigned back; 403 unsigned back;
401 404
@@ -404,7 +407,7 @@ static void annotate_browser__set_top(struct annotate_browser *browser,
404 browser->b.top_idx = browser->b.index = idx; 407 browser->b.top_idx = browser->b.index = idx;
405 408
406 while (browser->b.top_idx != 0 && back != 0) { 409 while (browser->b.top_idx != 0 && back != 0) {
407 pos = list_entry(pos->node.prev, struct disasm_line, node); 410 pos = list_entry(pos->node.prev, struct annotation_line, node);
408 411
409 if (disasm_line__filter(&browser->b, &pos->node)) 412 if (disasm_line__filter(&browser->b, &pos->node))
410 continue; 413 continue;
@@ -420,12 +423,13 @@ static void annotate_browser__set_top(struct annotate_browser *browser,
420static void annotate_browser__set_rb_top(struct annotate_browser *browser, 423static void annotate_browser__set_rb_top(struct annotate_browser *browser,
421 struct rb_node *nd) 424 struct rb_node *nd)
422{ 425{
423 struct browser_disasm_line *bpos; 426 struct browser_line *bpos;
424 struct disasm_line *pos; 427 struct annotation_line *pos;
425 u32 idx; 428 u32 idx;
426 429
427 bpos = rb_entry(nd, struct browser_disasm_line, rb_node); 430 pos = rb_entry(nd, struct annotation_line, rb_node);
428 pos = ((struct disasm_line *)bpos) - 1; 431 bpos = browser_line(pos);
432
429 idx = bpos->idx; 433 idx = bpos->idx;
430 if (annotate_browser__opts.hide_src_code) 434 if (annotate_browser__opts.hide_src_code)
431 idx = bpos->idx_asm; 435 idx = bpos->idx_asm;
@@ -439,46 +443,35 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
439 struct map_symbol *ms = browser->b.priv; 443 struct map_symbol *ms = browser->b.priv;
440 struct symbol *sym = ms->sym; 444 struct symbol *sym = ms->sym;
441 struct annotation *notes = symbol__annotation(sym); 445 struct annotation *notes = symbol__annotation(sym);
442 struct disasm_line *pos, *next; 446 struct disasm_line *pos;
443 s64 len = symbol__size(sym);
444 447
445 browser->entries = RB_ROOT; 448 browser->entries = RB_ROOT;
446 449
447 pthread_mutex_lock(&notes->lock); 450 pthread_mutex_lock(&notes->lock);
448 451
449 list_for_each_entry(pos, &notes->src->source, node) { 452 symbol__calc_percent(sym, evsel);
450 struct browser_disasm_line *bpos = disasm_line__browser(pos); 453
451 const char *path = NULL; 454 list_for_each_entry(pos, &notes->src->source, al.node) {
452 double max_percent = 0.0; 455 double max_percent = 0.0;
453 int i; 456 int i;
454 457
455 if (pos->offset == -1) { 458 if (pos->al.offset == -1) {
456 RB_CLEAR_NODE(&bpos->rb_node); 459 RB_CLEAR_NODE(&pos->al.rb_node);
457 continue; 460 continue;
458 } 461 }
459 462
460 next = disasm__get_next_ip_line(&notes->src->source, pos); 463 for (i = 0; i < pos->al.samples_nr; i++) {
461 464 struct annotation_data *sample = &pos->al.samples[i];
462 for (i = 0; i < browser->nr_events; i++) {
463 struct sym_hist_entry sample;
464
465 bpos->samples[i].percent = disasm__calc_percent(notes,
466 evsel->idx + i,
467 pos->offset,
468 next ? next->offset : len,
469 &path, &sample);
470 bpos->samples[i].he = sample;
471 465
472 if (max_percent < bpos->samples[i].percent) 466 if (max_percent < sample->percent)
473 max_percent = bpos->samples[i].percent; 467 max_percent = sample->percent;
474 } 468 }
475 469
476 if (max_percent < 0.01 && pos->ipc == 0) { 470 if (max_percent < 0.01 && pos->al.ipc == 0) {
477 RB_CLEAR_NODE(&bpos->rb_node); 471 RB_CLEAR_NODE(&pos->al.rb_node);
478 continue; 472 continue;
479 } 473 }
480 disasm_rb_tree__insert(&browser->entries, bpos, 474 disasm_rb_tree__insert(&browser->entries, &pos->al);
481 browser->nr_events);
482 } 475 }
483 pthread_mutex_unlock(&notes->lock); 476 pthread_mutex_unlock(&notes->lock);
484 477
@@ -487,38 +480,38 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
487 480
488static bool annotate_browser__toggle_source(struct annotate_browser *browser) 481static bool annotate_browser__toggle_source(struct annotate_browser *browser)
489{ 482{
490 struct disasm_line *dl; 483 struct annotation_line *al;
491 struct browser_disasm_line *bdl; 484 struct browser_line *bl;
492 off_t offset = browser->b.index - browser->b.top_idx; 485 off_t offset = browser->b.index - browser->b.top_idx;
493 486
494 browser->b.seek(&browser->b, offset, SEEK_CUR); 487 browser->b.seek(&browser->b, offset, SEEK_CUR);
495 dl = list_entry(browser->b.top, struct disasm_line, node); 488 al = list_entry(browser->b.top, struct annotation_line, node);
496 bdl = disasm_line__browser(dl); 489 bl = browser_line(al);
497 490
498 if (annotate_browser__opts.hide_src_code) { 491 if (annotate_browser__opts.hide_src_code) {
499 if (bdl->idx_asm < offset) 492 if (bl->idx_asm < offset)
500 offset = bdl->idx; 493 offset = bl->idx;
501 494
502 browser->b.nr_entries = browser->nr_entries; 495 browser->b.nr_entries = browser->nr_entries;
503 annotate_browser__opts.hide_src_code = false; 496 annotate_browser__opts.hide_src_code = false;
504 browser->b.seek(&browser->b, -offset, SEEK_CUR); 497 browser->b.seek(&browser->b, -offset, SEEK_CUR);
505 browser->b.top_idx = bdl->idx - offset; 498 browser->b.top_idx = bl->idx - offset;
506 browser->b.index = bdl->idx; 499 browser->b.index = bl->idx;
507 } else { 500 } else {
508 if (bdl->idx_asm < 0) { 501 if (bl->idx_asm < 0) {
509 ui_helpline__puts("Only available for assembly lines."); 502 ui_helpline__puts("Only available for assembly lines.");
510 browser->b.seek(&browser->b, -offset, SEEK_CUR); 503 browser->b.seek(&browser->b, -offset, SEEK_CUR);
511 return false; 504 return false;
512 } 505 }
513 506
514 if (bdl->idx_asm < offset) 507 if (bl->idx_asm < offset)
515 offset = bdl->idx_asm; 508 offset = bl->idx_asm;
516 509
517 browser->b.nr_entries = browser->nr_asm_entries; 510 browser->b.nr_entries = browser->nr_asm_entries;
518 annotate_browser__opts.hide_src_code = true; 511 annotate_browser__opts.hide_src_code = true;
519 browser->b.seek(&browser->b, -offset, SEEK_CUR); 512 browser->b.seek(&browser->b, -offset, SEEK_CUR);
520 browser->b.top_idx = bdl->idx_asm - offset; 513 browser->b.top_idx = bl->idx_asm - offset;
521 browser->b.index = bdl->idx_asm; 514 browser->b.index = bl->idx_asm;
522 } 515 }
523 516
524 return true; 517 return true;
@@ -543,7 +536,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
543 struct hist_browser_timer *hbt) 536 struct hist_browser_timer *hbt)
544{ 537{
545 struct map_symbol *ms = browser->b.priv; 538 struct map_symbol *ms = browser->b.priv;
546 struct disasm_line *dl = browser->selection; 539 struct disasm_line *dl = disasm_line(browser->selection);
547 struct annotation *notes; 540 struct annotation *notes;
548 struct addr_map_symbol target = { 541 struct addr_map_symbol target = {
549 .map = ms->map, 542 .map = ms->map,
@@ -589,10 +582,10 @@ struct disasm_line *annotate_browser__find_offset(struct annotate_browser *brows
589 struct disasm_line *pos; 582 struct disasm_line *pos;
590 583
591 *idx = 0; 584 *idx = 0;
592 list_for_each_entry(pos, &notes->src->source, node) { 585 list_for_each_entry(pos, &notes->src->source, al.node) {
593 if (pos->offset == offset) 586 if (pos->al.offset == offset)
594 return pos; 587 return pos;
595 if (!disasm_line__filter(&browser->b, &pos->node)) 588 if (!disasm_line__filter(&browser->b, &pos->al.node))
596 ++*idx; 589 ++*idx;
597 } 590 }
598 591
@@ -601,7 +594,7 @@ struct disasm_line *annotate_browser__find_offset(struct annotate_browser *brows
601 594
602static bool annotate_browser__jump(struct annotate_browser *browser) 595static bool annotate_browser__jump(struct annotate_browser *browser)
603{ 596{
604 struct disasm_line *dl = browser->selection; 597 struct disasm_line *dl = disasm_line(browser->selection);
605 u64 offset; 598 u64 offset;
606 s64 idx; 599 s64 idx;
607 600
@@ -615,29 +608,29 @@ static bool annotate_browser__jump(struct annotate_browser *browser)
615 return true; 608 return true;
616 } 609 }
617 610
618 annotate_browser__set_top(browser, dl, idx); 611 annotate_browser__set_top(browser, &dl->al, idx);
619 612
620 return true; 613 return true;
621} 614}
622 615
623static 616static
624struct disasm_line *annotate_browser__find_string(struct annotate_browser *browser, 617struct annotation_line *annotate_browser__find_string(struct annotate_browser *browser,
625 char *s, s64 *idx) 618 char *s, s64 *idx)
626{ 619{
627 struct map_symbol *ms = browser->b.priv; 620 struct map_symbol *ms = browser->b.priv;
628 struct symbol *sym = ms->sym; 621 struct symbol *sym = ms->sym;
629 struct annotation *notes = symbol__annotation(sym); 622 struct annotation *notes = symbol__annotation(sym);
630 struct disasm_line *pos = browser->selection; 623 struct annotation_line *al = browser->selection;
631 624
632 *idx = browser->b.index; 625 *idx = browser->b.index;
633 list_for_each_entry_continue(pos, &notes->src->source, node) { 626 list_for_each_entry_continue(al, &notes->src->source, node) {
634 if (disasm_line__filter(&browser->b, &pos->node)) 627 if (disasm_line__filter(&browser->b, &al->node))
635 continue; 628 continue;
636 629
637 ++*idx; 630 ++*idx;
638 631
639 if (pos->line && strstr(pos->line, s) != NULL) 632 if (al->line && strstr(al->line, s) != NULL)
640 return pos; 633 return al;
641 } 634 }
642 635
643 return NULL; 636 return NULL;
@@ -645,38 +638,38 @@ struct disasm_line *annotate_browser__find_string(struct annotate_browser *brows
645 638
646static bool __annotate_browser__search(struct annotate_browser *browser) 639static bool __annotate_browser__search(struct annotate_browser *browser)
647{ 640{
648 struct disasm_line *dl; 641 struct annotation_line *al;
649 s64 idx; 642 s64 idx;
650 643
651 dl = annotate_browser__find_string(browser, browser->search_bf, &idx); 644 al = annotate_browser__find_string(browser, browser->search_bf, &idx);
652 if (dl == NULL) { 645 if (al == NULL) {
653 ui_helpline__puts("String not found!"); 646 ui_helpline__puts("String not found!");
654 return false; 647 return false;
655 } 648 }
656 649
657 annotate_browser__set_top(browser, dl, idx); 650 annotate_browser__set_top(browser, al, idx);
658 browser->searching_backwards = false; 651 browser->searching_backwards = false;
659 return true; 652 return true;
660} 653}
661 654
662static 655static
663struct disasm_line *annotate_browser__find_string_reverse(struct annotate_browser *browser, 656struct annotation_line *annotate_browser__find_string_reverse(struct annotate_browser *browser,
664 char *s, s64 *idx) 657 char *s, s64 *idx)
665{ 658{
666 struct map_symbol *ms = browser->b.priv; 659 struct map_symbol *ms = browser->b.priv;
667 struct symbol *sym = ms->sym; 660 struct symbol *sym = ms->sym;
668 struct annotation *notes = symbol__annotation(sym); 661 struct annotation *notes = symbol__annotation(sym);
669 struct disasm_line *pos = browser->selection; 662 struct annotation_line *al = browser->selection;
670 663
671 *idx = browser->b.index; 664 *idx = browser->b.index;
672 list_for_each_entry_continue_reverse(pos, &notes->src->source, node) { 665 list_for_each_entry_continue_reverse(al, &notes->src->source, node) {
673 if (disasm_line__filter(&browser->b, &pos->node)) 666 if (disasm_line__filter(&browser->b, &al->node))
674 continue; 667 continue;
675 668
676 --*idx; 669 --*idx;
677 670
678 if (pos->line && strstr(pos->line, s) != NULL) 671 if (al->line && strstr(al->line, s) != NULL)
679 return pos; 672 return al;
680 } 673 }
681 674
682 return NULL; 675 return NULL;
@@ -684,16 +677,16 @@ struct disasm_line *annotate_browser__find_string_reverse(struct annotate_browse
684 677
685static bool __annotate_browser__search_reverse(struct annotate_browser *browser) 678static bool __annotate_browser__search_reverse(struct annotate_browser *browser)
686{ 679{
687 struct disasm_line *dl; 680 struct annotation_line *al;
688 s64 idx; 681 s64 idx;
689 682
690 dl = annotate_browser__find_string_reverse(browser, browser->search_bf, &idx); 683 al = annotate_browser__find_string_reverse(browser, browser->search_bf, &idx);
691 if (dl == NULL) { 684 if (al == NULL) {
692 ui_helpline__puts("String not found!"); 685 ui_helpline__puts("String not found!");
693 return false; 686 return false;
694 } 687 }
695 688
696 annotate_browser__set_top(browser, dl, idx); 689 annotate_browser__set_top(browser, al, idx);
697 browser->searching_backwards = true; 690 browser->searching_backwards = true;
698 return true; 691 return true;
699} 692}
@@ -899,13 +892,16 @@ show_help:
899 continue; 892 continue;
900 case K_ENTER: 893 case K_ENTER:
901 case K_RIGHT: 894 case K_RIGHT:
895 {
896 struct disasm_line *dl = disasm_line(browser->selection);
897
902 if (browser->selection == NULL) 898 if (browser->selection == NULL)
903 ui_helpline__puts("Huh? No selection. Report to linux-kernel@vger.kernel.org"); 899 ui_helpline__puts("Huh? No selection. Report to linux-kernel@vger.kernel.org");
904 else if (browser->selection->offset == -1) 900 else if (browser->selection->offset == -1)
905 ui_helpline__puts("Actions are only available for assembly lines."); 901 ui_helpline__puts("Actions are only available for assembly lines.");
906 else if (!browser->selection->ins.ops) 902 else if (!dl->ins.ops)
907 goto show_sup_ins; 903 goto show_sup_ins;
908 else if (ins__is_ret(&browser->selection->ins)) 904 else if (ins__is_ret(&dl->ins))
909 goto out; 905 goto out;
910 else if (!(annotate_browser__jump(browser) || 906 else if (!(annotate_browser__jump(browser) ||
911 annotate_browser__callq(browser, evsel, hbt))) { 907 annotate_browser__callq(browser, evsel, hbt))) {
@@ -913,6 +909,7 @@ show_sup_ins:
913 ui_helpline__puts("Actions are only available for function call/return & jump/branch instructions."); 909 ui_helpline__puts("Actions are only available for function call/return & jump/branch instructions.");
914 } 910 }
915 continue; 911 continue;
912 }
916 case 't': 913 case 't':
917 if (annotate_browser__opts.show_total_period) { 914 if (annotate_browser__opts.show_total_period) {
918 annotate_browser__opts.show_total_period = false; 915 annotate_browser__opts.show_total_period = false;
@@ -990,10 +987,10 @@ static void count_and_fill(struct annotate_browser *browser, u64 start, u64 end,
990 return; 987 return;
991 988
992 for (offset = start; offset <= end; offset++) { 989 for (offset = start; offset <= end; offset++) {
993 struct disasm_line *dl = browser->offsets[offset]; 990 struct annotation_line *al = browser->offsets[offset];
994 991
995 if (dl) 992 if (al)
996 dl->ipc = ipc; 993 al->ipc = ipc;
997 } 994 }
998 } 995 }
999} 996}
@@ -1018,13 +1015,13 @@ static void annotate__compute_ipc(struct annotate_browser *browser, size_t size,
1018 1015
1019 ch = &notes->src->cycles_hist[offset]; 1016 ch = &notes->src->cycles_hist[offset];
1020 if (ch && ch->cycles) { 1017 if (ch && ch->cycles) {
1021 struct disasm_line *dl; 1018 struct annotation_line *al;
1022 1019
1023 if (ch->have_start) 1020 if (ch->have_start)
1024 count_and_fill(browser, ch->start, offset, ch); 1021 count_and_fill(browser, ch->start, offset, ch);
1025 dl = browser->offsets[offset]; 1022 al = browser->offsets[offset];
1026 if (dl && ch->num_aggr) 1023 if (al && ch->num_aggr)
1027 dl->cycles = ch->cycles_aggr / ch->num_aggr; 1024 al->cycles = ch->cycles_aggr / ch->num_aggr;
1028 browser->have_cycles = true; 1025 browser->have_cycles = true;
1029 } 1026 }
1030 } 1027 }
@@ -1043,23 +1040,27 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
1043 return; 1040 return;
1044 1041
1045 for (offset = 0; offset < size; ++offset) { 1042 for (offset = 0; offset < size; ++offset) {
1046 struct disasm_line *dl = browser->offsets[offset], *dlt; 1043 struct annotation_line *al = browser->offsets[offset];
1047 struct browser_disasm_line *bdlt; 1044 struct disasm_line *dl;
1045 struct browser_line *blt;
1046
1047 dl = disasm_line(al);
1048 1048
1049 if (!disasm_line__is_valid_jump(dl, sym)) 1049 if (!disasm_line__is_valid_jump(dl, sym))
1050 continue; 1050 continue;
1051 1051
1052 dlt = browser->offsets[dl->ops.target.offset]; 1052 al = browser->offsets[dl->ops.target.offset];
1053
1053 /* 1054 /*
1054 * FIXME: Oops, no jump target? Buggy disassembler? Or do we 1055 * FIXME: Oops, no jump target? Buggy disassembler? Or do we
1055 * have to adjust to the previous offset? 1056 * have to adjust to the previous offset?
1056 */ 1057 */
1057 if (dlt == NULL) 1058 if (al == NULL)
1058 continue; 1059 continue;
1059 1060
1060 bdlt = disasm_line__browser(dlt); 1061 blt = browser_line(al);
1061 if (++bdlt->jump_sources > browser->max_jump_sources) 1062 if (++blt->jump_sources > browser->max_jump_sources)
1062 browser->max_jump_sources = bdlt->jump_sources; 1063 browser->max_jump_sources = blt->jump_sources;
1063 1064
1064 ++browser->nr_jumps; 1065 ++browser->nr_jumps;
1065 } 1066 }
@@ -1078,7 +1079,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
1078 struct perf_evsel *evsel, 1079 struct perf_evsel *evsel,
1079 struct hist_browser_timer *hbt) 1080 struct hist_browser_timer *hbt)
1080{ 1081{
1081 struct disasm_line *pos, *n; 1082 struct annotation_line *al;
1082 struct annotation *notes; 1083 struct annotation *notes;
1083 size_t size; 1084 size_t size;
1084 struct map_symbol ms = { 1085 struct map_symbol ms = {
@@ -1097,7 +1098,6 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
1097 }; 1098 };
1098 int ret = -1, err; 1099 int ret = -1, err;
1099 int nr_pcnt = 1; 1100 int nr_pcnt = 1;
1100 size_t sizeof_bdl = sizeof(struct browser_disasm_line);
1101 1101
1102 if (sym == NULL) 1102 if (sym == NULL)
1103 return -1; 1103 return -1;
@@ -1107,21 +1107,16 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
1107 if (map->dso->annotate_warned) 1107 if (map->dso->annotate_warned)
1108 return -1; 1108 return -1;
1109 1109
1110 browser.offsets = zalloc(size * sizeof(struct disasm_line *)); 1110 browser.offsets = zalloc(size * sizeof(struct annotation_line *));
1111 if (browser.offsets == NULL) { 1111 if (browser.offsets == NULL) {
1112 ui__error("Not enough memory!"); 1112 ui__error("Not enough memory!");
1113 return -1; 1113 return -1;
1114 } 1114 }
1115 1115
1116 if (perf_evsel__is_group_event(evsel)) { 1116 if (perf_evsel__is_group_event(evsel))
1117 nr_pcnt = evsel->nr_members; 1117 nr_pcnt = evsel->nr_members;
1118 sizeof_bdl += sizeof(struct disasm_line_samples) *
1119 (nr_pcnt - 1);
1120 }
1121 1118
1122 err = symbol__disassemble(sym, map, perf_evsel__env_arch(evsel), 1119 err = symbol__annotate(sym, map, evsel, sizeof(struct browser_line), &browser.arch);
1123 sizeof_bdl, &browser.arch,
1124 perf_evsel__env_cpuid(evsel));
1125 if (err) { 1120 if (err) {
1126 char msg[BUFSIZ]; 1121 char msg[BUFSIZ];
1127 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg)); 1122 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg));
@@ -1129,20 +1124,22 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
1129 goto out_free_offsets; 1124 goto out_free_offsets;
1130 } 1125 }
1131 1126
1127 symbol__calc_percent(sym, evsel);
1128
1132 ui_helpline__push("Press ESC to exit"); 1129 ui_helpline__push("Press ESC to exit");
1133 1130
1134 notes = symbol__annotation(sym); 1131 notes = symbol__annotation(sym);
1135 browser.start = map__rip_2objdump(map, sym->start); 1132 browser.start = map__rip_2objdump(map, sym->start);
1136 1133
1137 list_for_each_entry(pos, &notes->src->source, node) { 1134 list_for_each_entry(al, &notes->src->source, node) {
1138 struct browser_disasm_line *bpos; 1135 struct browser_line *bpos;
1139 size_t line_len = strlen(pos->line); 1136 size_t line_len = strlen(al->line);
1140 1137
1141 if (browser.b.width < line_len) 1138 if (browser.b.width < line_len)
1142 browser.b.width = line_len; 1139 browser.b.width = line_len;
1143 bpos = disasm_line__browser(pos); 1140 bpos = browser_line(al);
1144 bpos->idx = browser.nr_entries++; 1141 bpos->idx = browser.nr_entries++;
1145 if (pos->offset != -1) { 1142 if (al->offset != -1) {
1146 bpos->idx_asm = browser.nr_asm_entries++; 1143 bpos->idx_asm = browser.nr_asm_entries++;
1147 /* 1144 /*
1148 * FIXME: short term bandaid to cope with assembly 1145 * FIXME: short term bandaid to cope with assembly
@@ -1151,8 +1148,8 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
1151 * 1148 *
1152 * E.g. copy_user_generic_unrolled 1149 * E.g. copy_user_generic_unrolled
1153 */ 1150 */
1154 if (pos->offset < (s64)size) 1151 if (al->offset < (s64)size)
1155 browser.offsets[pos->offset] = pos; 1152 browser.offsets[al->offset] = al;
1156 } else 1153 } else
1157 bpos->idx_asm = -1; 1154 bpos->idx_asm = -1;
1158 } 1155 }
@@ -1174,10 +1171,8 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
1174 annotate_browser__update_addr_width(&browser); 1171 annotate_browser__update_addr_width(&browser);
1175 1172
1176 ret = annotate_browser__run(&browser, evsel, hbt); 1173 ret = annotate_browser__run(&browser, evsel, hbt);
1177 list_for_each_entry_safe(pos, n, &notes->src->source, node) { 1174
1178 list_del(&pos->node); 1175 annotated_source__purge(notes->src);
1179 disasm_line__free(pos);
1180 }
1181 1176
1182out_free_offsets: 1177out_free_offsets:
1183 free(browser.offsets); 1178 free(browser.offsets);
diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c
index fc7a2e105bfd..aeeaf15029f0 100644
--- a/tools/perf/ui/gtk/annotate.c
+++ b/tools/perf/ui/gtk/annotate.c
@@ -31,14 +31,14 @@ static int perf_gtk__get_percent(char *buf, size_t size, struct symbol *sym,
31 31
32 strcpy(buf, ""); 32 strcpy(buf, "");
33 33
34 if (dl->offset == (s64) -1) 34 if (dl->al.offset == (s64) -1)
35 return 0; 35 return 0;
36 36
37 symhist = annotation__histogram(symbol__annotation(sym), evidx); 37 symhist = annotation__histogram(symbol__annotation(sym), evidx);
38 if (!symbol_conf.event_group && !symhist->addr[dl->offset].nr_samples) 38 if (!symbol_conf.event_group && !symhist->addr[dl->al.offset].nr_samples)
39 return 0; 39 return 0;
40 40
41 percent = 100.0 * symhist->addr[dl->offset].nr_samples / symhist->nr_samples; 41 percent = 100.0 * symhist->addr[dl->al.offset].nr_samples / symhist->nr_samples;
42 42
43 markup = perf_gtk__get_percent_color(percent); 43 markup = perf_gtk__get_percent_color(percent);
44 if (markup) 44 if (markup)
@@ -57,16 +57,16 @@ static int perf_gtk__get_offset(char *buf, size_t size, struct symbol *sym,
57 57
58 strcpy(buf, ""); 58 strcpy(buf, "");
59 59
60 if (dl->offset == (s64) -1) 60 if (dl->al.offset == (s64) -1)
61 return 0; 61 return 0;
62 62
63 return scnprintf(buf, size, "%"PRIx64, start + dl->offset); 63 return scnprintf(buf, size, "%"PRIx64, start + dl->al.offset);
64} 64}
65 65
66static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl) 66static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl)
67{ 67{
68 int ret = 0; 68 int ret = 0;
69 char *line = g_markup_escape_text(dl->line, -1); 69 char *line = g_markup_escape_text(dl->al.line, -1);
70 const char *markup = "<span fgcolor='gray'>"; 70 const char *markup = "<span fgcolor='gray'>";
71 71
72 strcpy(buf, ""); 72 strcpy(buf, "");
@@ -74,7 +74,7 @@ static int perf_gtk__get_line(char *buf, size_t size, struct disasm_line *dl)
74 if (!line) 74 if (!line)
75 return 0; 75 return 0;
76 76
77 if (dl->offset != (s64) -1) 77 if (dl->al.offset != (s64) -1)
78 markup = NULL; 78 markup = NULL;
79 79
80 if (markup) 80 if (markup)
@@ -119,7 +119,7 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym,
119 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store)); 119 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
120 g_object_unref(GTK_TREE_MODEL(store)); 120 g_object_unref(GTK_TREE_MODEL(store));
121 121
122 list_for_each_entry(pos, &notes->src->source, node) { 122 list_for_each_entry(pos, &notes->src->source, al.node) {
123 GtkTreeIter iter; 123 GtkTreeIter iter;
124 int ret = 0; 124 int ret = 0;
125 125
@@ -148,8 +148,8 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym,
148 148
149 gtk_container_add(GTK_CONTAINER(window), view); 149 gtk_container_add(GTK_CONTAINER(window), view);
150 150
151 list_for_each_entry_safe(pos, n, &notes->src->source, node) { 151 list_for_each_entry_safe(pos, n, &notes->src->source, al.node) {
152 list_del(&pos->node); 152 list_del(&pos->al.node);
153 disasm_line__free(pos); 153 disasm_line__free(pos);
154 } 154 }
155 155
@@ -169,8 +169,7 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map,
169 if (map->dso->annotate_warned) 169 if (map->dso->annotate_warned)
170 return -1; 170 return -1;
171 171
172 err = symbol__disassemble(sym, map, perf_evsel__env_arch(evsel), 172 err = symbol__annotate(sym, map, evsel, 0, NULL);
173 0, NULL, NULL);
174 if (err) { 173 if (err) {
175 char msg[BUFSIZ]; 174 char msg[BUFSIZ];
176 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg)); 175 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg));
@@ -178,6 +177,8 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map,
178 return -1; 177 return -1;
179 } 178 }
180 179
180 symbol__calc_percent(sym, evsel);
181
181 if (perf_gtk__is_active_context(pgctx)) { 182 if (perf_gtk__is_active_context(pgctx)) {
182 window = pgctx->main_window; 183 window = pgctx->main_window;
183 notebook = pgctx->notebook; 184 notebook = pgctx->notebook;
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index a3de7916fe63..ea0a452550b0 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -44,7 +44,7 @@ libperf-y += machine.o
44libperf-y += map.o 44libperf-y += map.o
45libperf-y += pstack.o 45libperf-y += pstack.o
46libperf-y += session.o 46libperf-y += session.o
47libperf-$(CONFIG_AUDIT) += syscalltbl.o 47libperf-$(CONFIG_TRACE) += syscalltbl.o
48libperf-y += ordered-events.o 48libperf-y += ordered-events.o
49libperf-y += namespaces.o 49libperf-y += namespaces.o
50libperf-y += comm.o 50libperf-y += comm.o
@@ -86,6 +86,14 @@ libperf-$(CONFIG_AUXTRACE) += auxtrace.o
86libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/ 86libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
87libperf-$(CONFIG_AUXTRACE) += intel-pt.o 87libperf-$(CONFIG_AUXTRACE) += intel-pt.o
88libperf-$(CONFIG_AUXTRACE) += intel-bts.o 88libperf-$(CONFIG_AUXTRACE) += intel-bts.o
89libperf-$(CONFIG_AUXTRACE) += arm-spe.o
90libperf-$(CONFIG_AUXTRACE) += arm-spe-pkt-decoder.o
91
92ifdef CONFIG_LIBOPENCSD
93libperf-$(CONFIG_AUXTRACE) += cs-etm.o
94libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder/
95endif
96
89libperf-y += parse-branch-options.o 97libperf-y += parse-branch-options.o
90libperf-y += dump-insn.o 98libperf-y += dump-insn.o
91libperf-y += parse-regs-options.o 99libperf-y += parse-regs-options.o
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 3369c7830260..28b233c3dcbe 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -26,7 +26,6 @@
26#include <pthread.h> 26#include <pthread.h>
27#include <linux/bitops.h> 27#include <linux/bitops.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <sys/utsname.h>
30 29
31#include "sane_ctype.h" 30#include "sane_ctype.h"
32 31
@@ -322,6 +321,8 @@ static int comment__symbol(char *raw, char *comment, u64 *addrp, char **namep)
322 return 0; 321 return 0;
323 322
324 *addrp = strtoull(comment, &endptr, 16); 323 *addrp = strtoull(comment, &endptr, 16);
324 if (endptr == comment)
325 return 0;
325 name = strchr(endptr, '<'); 326 name = strchr(endptr, '<');
326 if (name == NULL) 327 if (name == NULL)
327 return -1; 328 return -1;
@@ -435,8 +436,8 @@ static int mov__parse(struct arch *arch, struct ins_operands *ops, struct map *m
435 return 0; 436 return 0;
436 437
437 comment = ltrim(comment); 438 comment = ltrim(comment);
438 comment__symbol(ops->source.raw, comment, &ops->source.addr, &ops->source.name); 439 comment__symbol(ops->source.raw, comment + 1, &ops->source.addr, &ops->source.name);
439 comment__symbol(ops->target.raw, comment, &ops->target.addr, &ops->target.name); 440 comment__symbol(ops->target.raw, comment + 1, &ops->target.addr, &ops->target.name);
440 441
441 return 0; 442 return 0;
442 443
@@ -480,7 +481,7 @@ static int dec__parse(struct arch *arch __maybe_unused, struct ins_operands *ops
480 return 0; 481 return 0;
481 482
482 comment = ltrim(comment); 483 comment = ltrim(comment);
483 comment__symbol(ops->target.raw, comment, &ops->target.addr, &ops->target.name); 484 comment__symbol(ops->target.raw, comment + 1, &ops->target.addr, &ops->target.name);
484 485
485 return 0; 486 return 0;
486} 487}
@@ -878,32 +879,99 @@ out_free_name:
878 return -1; 879 return -1;
879} 880}
880 881
881static struct disasm_line *disasm_line__new(s64 offset, char *line, 882struct annotate_args {
882 size_t privsize, int line_nr, 883 size_t privsize;
883 struct arch *arch, 884 struct arch *arch;
884 struct map *map) 885 struct map *map;
886 struct perf_evsel *evsel;
887 s64 offset;
888 char *line;
889 int line_nr;
890};
891
892static void annotation_line__delete(struct annotation_line *al)
885{ 893{
886 struct disasm_line *dl = zalloc(sizeof(*dl) + privsize); 894 void *ptr = (void *) al - al->privsize;
895
896 free_srcline(al->path);
897 zfree(&al->line);
898 free(ptr);
899}
900
901/*
902 * Allocating the annotation line data with following
903 * structure:
904 *
905 * --------------------------------------
906 * private space | struct annotation_line
907 * --------------------------------------
908 *
909 * Size of the private space is stored in 'struct annotation_line'.
910 *
911 */
912static struct annotation_line *
913annotation_line__new(struct annotate_args *args, size_t privsize)
914{
915 struct annotation_line *al;
916 struct perf_evsel *evsel = args->evsel;
917 size_t size = privsize + sizeof(*al);
918 int nr = 1;
919
920 if (perf_evsel__is_group_event(evsel))
921 nr = evsel->nr_members;
922
923 size += sizeof(al->samples[0]) * nr;
924
925 al = zalloc(size);
926 if (al) {
927 al = (void *) al + privsize;
928 al->privsize = privsize;
929 al->offset = args->offset;
930 al->line = strdup(args->line);
931 al->line_nr = args->line_nr;
932 al->samples_nr = nr;
933 }
934
935 return al;
936}
937
938/*
939 * Allocating the disasm annotation line data with
940 * following structure:
941 *
942 * ------------------------------------------------------------
943 * privsize space | struct disasm_line | struct annotation_line
944 * ------------------------------------------------------------
945 *
946 * We have 'struct annotation_line' member as last member
947 * of 'struct disasm_line' to have an easy access.
948 *
949 */
950static struct disasm_line *disasm_line__new(struct annotate_args *args)
951{
952 struct disasm_line *dl = NULL;
953 struct annotation_line *al;
954 size_t privsize = args->privsize + offsetof(struct disasm_line, al);
955
956 al = annotation_line__new(args, privsize);
957 if (al != NULL) {
958 dl = disasm_line(al);
887 959
888 if (dl != NULL) { 960 if (dl->al.line == NULL)
889 dl->offset = offset;
890 dl->line = strdup(line);
891 dl->line_nr = line_nr;
892 if (dl->line == NULL)
893 goto out_delete; 961 goto out_delete;
894 962
895 if (offset != -1) { 963 if (args->offset != -1) {
896 if (disasm_line__parse(dl->line, &dl->ins.name, &dl->ops.raw) < 0) 964 if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0)
897 goto out_free_line; 965 goto out_free_line;
898 966
899 disasm_line__init_ins(dl, arch, map); 967 disasm_line__init_ins(dl, args->arch, args->map);
900 } 968 }
901 } 969 }
902 970
903 return dl; 971 return dl;
904 972
905out_free_line: 973out_free_line:
906 zfree(&dl->line); 974 zfree(&dl->al.line);
907out_delete: 975out_delete:
908 free(dl); 976 free(dl);
909 return NULL; 977 return NULL;
@@ -911,14 +979,13 @@ out_delete:
911 979
912void disasm_line__free(struct disasm_line *dl) 980void disasm_line__free(struct disasm_line *dl)
913{ 981{
914 zfree(&dl->line);
915 if (dl->ins.ops && dl->ins.ops->free) 982 if (dl->ins.ops && dl->ins.ops->free)
916 dl->ins.ops->free(&dl->ops); 983 dl->ins.ops->free(&dl->ops);
917 else 984 else
918 ins__delete(&dl->ops); 985 ins__delete(&dl->ops);
919 free((void *)dl->ins.name); 986 free((void *)dl->ins.name);
920 dl->ins.name = NULL; 987 dl->ins.name = NULL;
921 free(dl); 988 annotation_line__delete(&dl->al);
922} 989}
923 990
924int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw) 991int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw)
@@ -929,12 +996,13 @@ int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool r
929 return ins__scnprintf(&dl->ins, bf, size, &dl->ops); 996 return ins__scnprintf(&dl->ins, bf, size, &dl->ops);
930} 997}
931 998
932static void disasm__add(struct list_head *head, struct disasm_line *line) 999static void annotation_line__add(struct annotation_line *al, struct list_head *head)
933{ 1000{
934 list_add_tail(&line->node, head); 1001 list_add_tail(&al->node, head);
935} 1002}
936 1003
937struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos) 1004struct annotation_line *
1005annotation_line__next(struct annotation_line *pos, struct list_head *head)
938{ 1006{
939 list_for_each_entry_continue(pos, head, node) 1007 list_for_each_entry_continue(pos, head, node)
940 if (pos->offset >= 0) 1008 if (pos->offset >= 0)
@@ -943,50 +1011,6 @@ struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disa
943 return NULL; 1011 return NULL;
944} 1012}
945 1013
946double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset,
947 s64 end, const char **path, struct sym_hist_entry *sample)
948{
949 struct source_line *src_line = notes->src->lines;
950 double percent = 0.0;
951
952 sample->nr_samples = sample->period = 0;
953
954 if (src_line) {
955 size_t sizeof_src_line = sizeof(*src_line) +
956 sizeof(src_line->samples) * (src_line->nr_pcnt - 1);
957
958 while (offset < end) {
959 src_line = (void *)notes->src->lines +
960 (sizeof_src_line * offset);
961
962 if (*path == NULL)
963 *path = src_line->path;
964
965 percent += src_line->samples[evidx].percent;
966 sample->nr_samples += src_line->samples[evidx].nr;
967 offset++;
968 }
969 } else {
970 struct sym_hist *h = annotation__histogram(notes, evidx);
971 unsigned int hits = 0;
972 u64 period = 0;
973
974 while (offset < end) {
975 hits += h->addr[offset].nr_samples;
976 period += h->addr[offset].period;
977 ++offset;
978 }
979
980 if (h->nr_samples) {
981 sample->period = period;
982 sample->nr_samples = hits;
983 percent = 100.0 * hits / h->nr_samples;
984 }
985 }
986
987 return percent;
988}
989
990static const char *annotate__address_color(struct block_range *br) 1014static const char *annotate__address_color(struct block_range *br)
991{ 1015{
992 double cov = block_range__coverage(br); 1016 double cov = block_range__coverage(br);
@@ -1069,50 +1093,39 @@ static void annotate__branch_printf(struct block_range *br, u64 addr)
1069 } 1093 }
1070} 1094}
1071 1095
1096static int disasm_line__print(struct disasm_line *dl, u64 start, int addr_fmt_width)
1097{
1098 s64 offset = dl->al.offset;
1099 const u64 addr = start + offset;
1100 struct block_range *br;
1101
1102 br = block_range__find(addr);
1103 color_fprintf(stdout, annotate__address_color(br), " %*" PRIx64 ":", addr_fmt_width, addr);
1104 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line);
1105 annotate__branch_printf(br, addr);
1106 return 0;
1107}
1072 1108
1073static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 start, 1109static int
1074 struct perf_evsel *evsel, u64 len, int min_pcnt, int printed, 1110annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start,
1075 int max_lines, struct disasm_line *queue) 1111 struct perf_evsel *evsel, u64 len, int min_pcnt, int printed,
1112 int max_lines, struct annotation_line *queue, int addr_fmt_width)
1076{ 1113{
1114 struct disasm_line *dl = container_of(al, struct disasm_line, al);
1077 static const char *prev_line; 1115 static const char *prev_line;
1078 static const char *prev_color; 1116 static const char *prev_color;
1079 1117
1080 if (dl->offset != -1) { 1118 if (al->offset != -1) {
1081 const char *path = NULL; 1119 double max_percent = 0.0;
1082 double percent, max_percent = 0.0;
1083 double *ppercents = &percent;
1084 struct sym_hist_entry sample;
1085 struct sym_hist_entry *psamples = &sample;
1086 int i, nr_percent = 1; 1120 int i, nr_percent = 1;
1087 const char *color; 1121 const char *color;
1088 struct annotation *notes = symbol__annotation(sym); 1122 struct annotation *notes = symbol__annotation(sym);
1089 s64 offset = dl->offset;
1090 const u64 addr = start + offset;
1091 struct disasm_line *next;
1092 struct block_range *br;
1093
1094 next = disasm__get_next_ip_line(&notes->src->source, dl);
1095
1096 if (perf_evsel__is_group_event(evsel)) {
1097 nr_percent = evsel->nr_members;
1098 ppercents = calloc(nr_percent, sizeof(double));
1099 psamples = calloc(nr_percent, sizeof(struct sym_hist_entry));
1100 if (ppercents == NULL || psamples == NULL) {
1101 return -1;
1102 }
1103 }
1104 1123
1105 for (i = 0; i < nr_percent; i++) { 1124 for (i = 0; i < al->samples_nr; i++) {
1106 percent = disasm__calc_percent(notes, 1125 struct annotation_data *sample = &al->samples[i];
1107 notes->src->lines ? i : evsel->idx + i, 1126
1108 offset, 1127 if (sample->percent > max_percent)
1109 next ? next->offset : (s64) len, 1128 max_percent = sample->percent;
1110 &path, &sample);
1111
1112 ppercents[i] = percent;
1113 psamples[i] = sample;
1114 if (percent > max_percent)
1115 max_percent = percent;
1116 } 1129 }
1117 1130
1118 if (max_percent < min_pcnt) 1131 if (max_percent < min_pcnt)
@@ -1123,10 +1136,10 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
1123 1136
1124 if (queue != NULL) { 1137 if (queue != NULL) {
1125 list_for_each_entry_from(queue, &notes->src->source, node) { 1138 list_for_each_entry_from(queue, &notes->src->source, node) {
1126 if (queue == dl) 1139 if (queue == al)
1127 break; 1140 break;
1128 disasm_line__print(queue, sym, start, evsel, len, 1141 annotation_line__print(queue, sym, start, evsel, len,
1129 0, 0, 1, NULL); 1142 0, 0, 1, NULL, addr_fmt_width);
1130 } 1143 }
1131 } 1144 }
1132 1145
@@ -1137,44 +1150,34 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
1137 * the same color than the percentage. Don't print it 1150 * the same color than the percentage. Don't print it
1138 * twice for close colored addr with the same filename:line 1151 * twice for close colored addr with the same filename:line
1139 */ 1152 */
1140 if (path) { 1153 if (al->path) {
1141 if (!prev_line || strcmp(prev_line, path) 1154 if (!prev_line || strcmp(prev_line, al->path)
1142 || color != prev_color) { 1155 || color != prev_color) {
1143 color_fprintf(stdout, color, " %s", path); 1156 color_fprintf(stdout, color, " %s", al->path);
1144 prev_line = path; 1157 prev_line = al->path;
1145 prev_color = color; 1158 prev_color = color;
1146 } 1159 }
1147 } 1160 }
1148 1161
1149 for (i = 0; i < nr_percent; i++) { 1162 for (i = 0; i < nr_percent; i++) {
1150 percent = ppercents[i]; 1163 struct annotation_data *sample = &al->samples[i];
1151 sample = psamples[i]; 1164
1152 color = get_percent_color(percent); 1165 color = get_percent_color(sample->percent);
1153 1166
1154 if (symbol_conf.show_total_period) 1167 if (symbol_conf.show_total_period)
1155 color_fprintf(stdout, color, " %11" PRIu64, 1168 color_fprintf(stdout, color, " %11" PRIu64,
1156 sample.period); 1169 sample->he.period);
1157 else if (symbol_conf.show_nr_samples) 1170 else if (symbol_conf.show_nr_samples)
1158 color_fprintf(stdout, color, " %7" PRIu64, 1171 color_fprintf(stdout, color, " %7" PRIu64,
1159 sample.nr_samples); 1172 sample->he.nr_samples);
1160 else 1173 else
1161 color_fprintf(stdout, color, " %7.2f", percent); 1174 color_fprintf(stdout, color, " %7.2f", sample->percent);
1162 } 1175 }
1163 1176
1164 printf(" : "); 1177 printf(" : ");
1165 1178
1166 br = block_range__find(addr); 1179 disasm_line__print(dl, start, addr_fmt_width);
1167 color_fprintf(stdout, annotate__address_color(br), " %" PRIx64 ":", addr);
1168 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->line);
1169 annotate__branch_printf(br, addr);
1170 printf("\n"); 1180 printf("\n");
1171
1172 if (ppercents != &percent)
1173 free(ppercents);
1174
1175 if (psamples != &sample)
1176 free(psamples);
1177
1178 } else if (max_lines && printed >= max_lines) 1181 } else if (max_lines && printed >= max_lines)
1179 return 1; 1182 return 1;
1180 else { 1183 else {
@@ -1186,10 +1189,10 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
1186 if (perf_evsel__is_group_event(evsel)) 1189 if (perf_evsel__is_group_event(evsel))
1187 width *= evsel->nr_members; 1190 width *= evsel->nr_members;
1188 1191
1189 if (!*dl->line) 1192 if (!*al->line)
1190 printf(" %*s:\n", width, " "); 1193 printf(" %*s:\n", width, " ");
1191 else 1194 else
1192 printf(" %*s: %s\n", width, " ", dl->line); 1195 printf(" %*s: %*s %s\n", width, " ", addr_fmt_width, " ", al->line);
1193 } 1196 }
1194 1197
1195 return 0; 1198 return 0;
@@ -1215,11 +1218,11 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
1215 * means that it's not a disassembly line so should be treated differently. 1218 * means that it's not a disassembly line so should be treated differently.
1216 * The ops.raw part will be parsed further according to type of the instruction. 1219 * The ops.raw part will be parsed further according to type of the instruction.
1217 */ 1220 */
1218static int symbol__parse_objdump_line(struct symbol *sym, struct map *map, 1221static int symbol__parse_objdump_line(struct symbol *sym, FILE *file,
1219 struct arch *arch, 1222 struct annotate_args *args,
1220 FILE *file, size_t privsize,
1221 int *line_nr) 1223 int *line_nr)
1222{ 1224{
1225 struct map *map = args->map;
1223 struct annotation *notes = symbol__annotation(sym); 1226 struct annotation *notes = symbol__annotation(sym);
1224 struct disasm_line *dl; 1227 struct disasm_line *dl;
1225 char *line = NULL, *parsed_line, *tmp, *tmp2; 1228 char *line = NULL, *parsed_line, *tmp, *tmp2;
@@ -1263,7 +1266,11 @@ static int symbol__parse_objdump_line(struct symbol *sym, struct map *map,
1263 parsed_line = tmp2 + 1; 1266 parsed_line = tmp2 + 1;
1264 } 1267 }
1265 1268
1266 dl = disasm_line__new(offset, parsed_line, privsize, *line_nr, arch, map); 1269 args->offset = offset;
1270 args->line = parsed_line;
1271 args->line_nr = *line_nr;
1272
1273 dl = disasm_line__new(args);
1267 free(line); 1274 free(line);
1268 (*line_nr)++; 1275 (*line_nr)++;
1269 1276
@@ -1288,7 +1295,7 @@ static int symbol__parse_objdump_line(struct symbol *sym, struct map *map,
1288 dl->ops.target.name = strdup(target.sym->name); 1295 dl->ops.target.name = strdup(target.sym->name);
1289 } 1296 }
1290 1297
1291 disasm__add(&notes->src->source, dl); 1298 annotation_line__add(&dl->al, &notes->src->source);
1292 1299
1293 return 0; 1300 return 0;
1294} 1301}
@@ -1305,19 +1312,19 @@ static void delete_last_nop(struct symbol *sym)
1305 struct disasm_line *dl; 1312 struct disasm_line *dl;
1306 1313
1307 while (!list_empty(list)) { 1314 while (!list_empty(list)) {
1308 dl = list_entry(list->prev, struct disasm_line, node); 1315 dl = list_entry(list->prev, struct disasm_line, al.node);
1309 1316
1310 if (dl->ins.ops) { 1317 if (dl->ins.ops) {
1311 if (dl->ins.ops != &nop_ops) 1318 if (dl->ins.ops != &nop_ops)
1312 return; 1319 return;
1313 } else { 1320 } else {
1314 if (!strstr(dl->line, " nop ") && 1321 if (!strstr(dl->al.line, " nop ") &&
1315 !strstr(dl->line, " nopl ") && 1322 !strstr(dl->al.line, " nopl ") &&
1316 !strstr(dl->line, " nopw ")) 1323 !strstr(dl->al.line, " nopw "))
1317 return; 1324 return;
1318 } 1325 }
1319 1326
1320 list_del(&dl->node); 1327 list_del(&dl->al.node);
1321 disasm_line__free(dl); 1328 disasm_line__free(dl);
1322 } 1329 }
1323} 1330}
@@ -1412,25 +1419,11 @@ fallback:
1412 return 0; 1419 return 0;
1413} 1420}
1414 1421
1415static const char *annotate__norm_arch(const char *arch_name) 1422static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
1416{
1417 struct utsname uts;
1418
1419 if (!arch_name) { /* Assume we are annotating locally. */
1420 if (uname(&uts) < 0)
1421 return NULL;
1422 arch_name = uts.machine;
1423 }
1424 return normalize_arch((char *)arch_name);
1425}
1426
1427int symbol__disassemble(struct symbol *sym, struct map *map,
1428 const char *arch_name, size_t privsize,
1429 struct arch **parch, char *cpuid)
1430{ 1423{
1424 struct map *map = args->map;
1431 struct dso *dso = map->dso; 1425 struct dso *dso = map->dso;
1432 char command[PATH_MAX * 2]; 1426 char command[PATH_MAX * 2];
1433 struct arch *arch = NULL;
1434 FILE *file; 1427 FILE *file;
1435 char symfs_filename[PATH_MAX]; 1428 char symfs_filename[PATH_MAX];
1436 struct kcore_extract kce; 1429 struct kcore_extract kce;
@@ -1444,25 +1437,6 @@ int symbol__disassemble(struct symbol *sym, struct map *map,
1444 if (err) 1437 if (err)
1445 return err; 1438 return err;
1446 1439
1447 arch_name = annotate__norm_arch(arch_name);
1448 if (!arch_name)
1449 return -1;
1450
1451 arch = arch__find(arch_name);
1452 if (arch == NULL)
1453 return -ENOTSUP;
1454
1455 if (parch)
1456 *parch = arch;
1457
1458 if (arch->init) {
1459 err = arch->init(arch, cpuid);
1460 if (err) {
1461 pr_err("%s: failed to initialize %s arch priv area\n", __func__, arch->name);
1462 return err;
1463 }
1464 }
1465
1466 pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__, 1440 pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__,
1467 symfs_filename, sym->name, map->unmap_ip(map, sym->start), 1441 symfs_filename, sym->name, map->unmap_ip(map, sym->start),
1468 map->unmap_ip(map, sym->end)); 1442 map->unmap_ip(map, sym->end));
@@ -1546,8 +1520,7 @@ int symbol__disassemble(struct symbol *sym, struct map *map,
1546 * can associate it with the instructions till the next one. 1520 * can associate it with the instructions till the next one.
1547 * See disasm_line__new() and struct disasm_line::line_nr. 1521 * See disasm_line__new() and struct disasm_line::line_nr.
1548 */ 1522 */
1549 if (symbol__parse_objdump_line(sym, map, arch, file, privsize, 1523 if (symbol__parse_objdump_line(sym, file, args, &lineno) < 0)
1550 &lineno) < 0)
1551 break; 1524 break;
1552 nline++; 1525 nline++;
1553 } 1526 }
@@ -1580,21 +1553,110 @@ out_close_stdout:
1580 goto out_remove_tmp; 1553 goto out_remove_tmp;
1581} 1554}
1582 1555
1583static void insert_source_line(struct rb_root *root, struct source_line *src_line) 1556static void calc_percent(struct sym_hist *hist,
1557 struct annotation_data *sample,
1558 s64 offset, s64 end)
1559{
1560 unsigned int hits = 0;
1561 u64 period = 0;
1562
1563 while (offset < end) {
1564 hits += hist->addr[offset].nr_samples;
1565 period += hist->addr[offset].period;
1566 ++offset;
1567 }
1568
1569 if (hist->nr_samples) {
1570 sample->he.period = period;
1571 sample->he.nr_samples = hits;
1572 sample->percent = 100.0 * hits / hist->nr_samples;
1573 }
1574}
1575
1576static void annotation__calc_percent(struct annotation *notes,
1577 struct perf_evsel *evsel, s64 len)
1578{
1579 struct annotation_line *al, *next;
1580
1581 list_for_each_entry(al, &notes->src->source, node) {
1582 s64 end;
1583 int i;
1584
1585 if (al->offset == -1)
1586 continue;
1587
1588 next = annotation_line__next(al, &notes->src->source);
1589 end = next ? next->offset : len;
1590
1591 for (i = 0; i < al->samples_nr; i++) {
1592 struct annotation_data *sample;
1593 struct sym_hist *hist;
1594
1595 hist = annotation__histogram(notes, evsel->idx + i);
1596 sample = &al->samples[i];
1597
1598 calc_percent(hist, sample, al->offset, end);
1599 }
1600 }
1601}
1602
1603void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
1604{
1605 struct annotation *notes = symbol__annotation(sym);
1606
1607 annotation__calc_percent(notes, evsel, symbol__size(sym));
1608}
1609
1610int symbol__annotate(struct symbol *sym, struct map *map,
1611 struct perf_evsel *evsel, size_t privsize,
1612 struct arch **parch)
1584{ 1613{
1585 struct source_line *iter; 1614 struct annotate_args args = {
1615 .privsize = privsize,
1616 .map = map,
1617 .evsel = evsel,
1618 };
1619 struct perf_env *env = perf_evsel__env(evsel);
1620 const char *arch_name = perf_env__arch(env);
1621 struct arch *arch;
1622 int err;
1623
1624 if (!arch_name)
1625 return -1;
1626
1627 args.arch = arch = arch__find(arch_name);
1628 if (arch == NULL)
1629 return -ENOTSUP;
1630
1631 if (parch)
1632 *parch = arch;
1633
1634 if (arch->init) {
1635 err = arch->init(arch, env ? env->cpuid : NULL);
1636 if (err) {
1637 pr_err("%s: failed to initialize %s arch priv area\n", __func__, arch->name);
1638 return err;
1639 }
1640 }
1641
1642 return symbol__disassemble(sym, &args);
1643}
1644
1645static void insert_source_line(struct rb_root *root, struct annotation_line *al)
1646{
1647 struct annotation_line *iter;
1586 struct rb_node **p = &root->rb_node; 1648 struct rb_node **p = &root->rb_node;
1587 struct rb_node *parent = NULL; 1649 struct rb_node *parent = NULL;
1588 int i, ret; 1650 int i, ret;
1589 1651
1590 while (*p != NULL) { 1652 while (*p != NULL) {
1591 parent = *p; 1653 parent = *p;
1592 iter = rb_entry(parent, struct source_line, node); 1654 iter = rb_entry(parent, struct annotation_line, rb_node);
1593 1655
1594 ret = strcmp(iter->path, src_line->path); 1656 ret = strcmp(iter->path, al->path);
1595 if (ret == 0) { 1657 if (ret == 0) {
1596 for (i = 0; i < src_line->nr_pcnt; i++) 1658 for (i = 0; i < al->samples_nr; i++)
1597 iter->samples[i].percent_sum += src_line->samples[i].percent; 1659 iter->samples[i].percent_sum += al->samples[i].percent;
1598 return; 1660 return;
1599 } 1661 }
1600 1662
@@ -1604,18 +1666,18 @@ static void insert_source_line(struct rb_root *root, struct source_line *src_lin
1604 p = &(*p)->rb_right; 1666 p = &(*p)->rb_right;
1605 } 1667 }
1606 1668
1607 for (i = 0; i < src_line->nr_pcnt; i++) 1669 for (i = 0; i < al->samples_nr; i++)
1608 src_line->samples[i].percent_sum = src_line->samples[i].percent; 1670 al->samples[i].percent_sum = al->samples[i].percent;
1609 1671
1610 rb_link_node(&src_line->node, parent, p); 1672 rb_link_node(&al->rb_node, parent, p);
1611 rb_insert_color(&src_line->node, root); 1673 rb_insert_color(&al->rb_node, root);
1612} 1674}
1613 1675
1614static int cmp_source_line(struct source_line *a, struct source_line *b) 1676static int cmp_source_line(struct annotation_line *a, struct annotation_line *b)
1615{ 1677{
1616 int i; 1678 int i;
1617 1679
1618 for (i = 0; i < a->nr_pcnt; i++) { 1680 for (i = 0; i < a->samples_nr; i++) {
1619 if (a->samples[i].percent_sum == b->samples[i].percent_sum) 1681 if (a->samples[i].percent_sum == b->samples[i].percent_sum)
1620 continue; 1682 continue;
1621 return a->samples[i].percent_sum > b->samples[i].percent_sum; 1683 return a->samples[i].percent_sum > b->samples[i].percent_sum;
@@ -1624,135 +1686,47 @@ static int cmp_source_line(struct source_line *a, struct source_line *b)
1624 return 0; 1686 return 0;
1625} 1687}
1626 1688
1627static void __resort_source_line(struct rb_root *root, struct source_line *src_line) 1689static void __resort_source_line(struct rb_root *root, struct annotation_line *al)
1628{ 1690{
1629 struct source_line *iter; 1691 struct annotation_line *iter;
1630 struct rb_node **p = &root->rb_node; 1692 struct rb_node **p = &root->rb_node;
1631 struct rb_node *parent = NULL; 1693 struct rb_node *parent = NULL;
1632 1694
1633 while (*p != NULL) { 1695 while (*p != NULL) {
1634 parent = *p; 1696 parent = *p;
1635 iter = rb_entry(parent, struct source_line, node); 1697 iter = rb_entry(parent, struct annotation_line, rb_node);
1636 1698
1637 if (cmp_source_line(src_line, iter)) 1699 if (cmp_source_line(al, iter))
1638 p = &(*p)->rb_left; 1700 p = &(*p)->rb_left;
1639 else 1701 else
1640 p = &(*p)->rb_right; 1702 p = &(*p)->rb_right;
1641 } 1703 }
1642 1704
1643 rb_link_node(&src_line->node, parent, p); 1705 rb_link_node(&al->rb_node, parent, p);
1644 rb_insert_color(&src_line->node, root); 1706 rb_insert_color(&al->rb_node, root);
1645} 1707}
1646 1708
1647static void resort_source_line(struct rb_root *dest_root, struct rb_root *src_root) 1709static void resort_source_line(struct rb_root *dest_root, struct rb_root *src_root)
1648{ 1710{
1649 struct source_line *src_line; 1711 struct annotation_line *al;
1650 struct rb_node *node; 1712 struct rb_node *node;
1651 1713
1652 node = rb_first(src_root); 1714 node = rb_first(src_root);
1653 while (node) { 1715 while (node) {
1654 struct rb_node *next; 1716 struct rb_node *next;
1655 1717
1656 src_line = rb_entry(node, struct source_line, node); 1718 al = rb_entry(node, struct annotation_line, rb_node);
1657 next = rb_next(node); 1719 next = rb_next(node);
1658 rb_erase(node, src_root); 1720 rb_erase(node, src_root);
1659 1721
1660 __resort_source_line(dest_root, src_line); 1722 __resort_source_line(dest_root, al);
1661 node = next; 1723 node = next;
1662 } 1724 }
1663} 1725}
1664 1726
1665static void symbol__free_source_line(struct symbol *sym, int len)
1666{
1667 struct annotation *notes = symbol__annotation(sym);
1668 struct source_line *src_line = notes->src->lines;
1669 size_t sizeof_src_line;
1670 int i;
1671
1672 sizeof_src_line = sizeof(*src_line) +
1673 (sizeof(src_line->samples) * (src_line->nr_pcnt - 1));
1674
1675 for (i = 0; i < len; i++) {
1676 free_srcline(src_line->path);
1677 src_line = (void *)src_line + sizeof_src_line;
1678 }
1679
1680 zfree(&notes->src->lines);
1681}
1682
1683/* Get the filename:line for the colored entries */
1684static int symbol__get_source_line(struct symbol *sym, struct map *map,
1685 struct perf_evsel *evsel,
1686 struct rb_root *root, int len)
1687{
1688 u64 start;
1689 int i, k;
1690 int evidx = evsel->idx;
1691 struct source_line *src_line;
1692 struct annotation *notes = symbol__annotation(sym);
1693 struct sym_hist *h = annotation__histogram(notes, evidx);
1694 struct rb_root tmp_root = RB_ROOT;
1695 int nr_pcnt = 1;
1696 u64 nr_samples = h->nr_samples;
1697 size_t sizeof_src_line = sizeof(struct source_line);
1698
1699 if (perf_evsel__is_group_event(evsel)) {
1700 for (i = 1; i < evsel->nr_members; i++) {
1701 h = annotation__histogram(notes, evidx + i);
1702 nr_samples += h->nr_samples;
1703 }
1704 nr_pcnt = evsel->nr_members;
1705 sizeof_src_line += (nr_pcnt - 1) * sizeof(src_line->samples);
1706 }
1707
1708 if (!nr_samples)
1709 return 0;
1710
1711 src_line = notes->src->lines = calloc(len, sizeof_src_line);
1712 if (!notes->src->lines)
1713 return -1;
1714
1715 start = map__rip_2objdump(map, sym->start);
1716
1717 for (i = 0; i < len; i++) {
1718 u64 offset;
1719 double percent_max = 0.0;
1720
1721 src_line->nr_pcnt = nr_pcnt;
1722
1723 for (k = 0; k < nr_pcnt; k++) {
1724 double percent = 0.0;
1725
1726 h = annotation__histogram(notes, evidx + k);
1727 nr_samples = h->addr[i].nr_samples;
1728 if (h->nr_samples)
1729 percent = 100.0 * nr_samples / h->nr_samples;
1730
1731 if (percent > percent_max)
1732 percent_max = percent;
1733 src_line->samples[k].percent = percent;
1734 src_line->samples[k].nr = nr_samples;
1735 }
1736
1737 if (percent_max <= 0.5)
1738 goto next;
1739
1740 offset = start + i;
1741 src_line->path = get_srcline(map->dso, offset, NULL,
1742 false, true);
1743 insert_source_line(&tmp_root, src_line);
1744
1745 next:
1746 src_line = (void *)src_line + sizeof_src_line;
1747 }
1748
1749 resort_source_line(root, &tmp_root);
1750 return 0;
1751}
1752
1753static void print_summary(struct rb_root *root, const char *filename) 1727static void print_summary(struct rb_root *root, const char *filename)
1754{ 1728{
1755 struct source_line *src_line; 1729 struct annotation_line *al;
1756 struct rb_node *node; 1730 struct rb_node *node;
1757 1731
1758 printf("\nSorted summary for file %s\n", filename); 1732 printf("\nSorted summary for file %s\n", filename);
@@ -1770,9 +1744,9 @@ static void print_summary(struct rb_root *root, const char *filename)
1770 char *path; 1744 char *path;
1771 int i; 1745 int i;
1772 1746
1773 src_line = rb_entry(node, struct source_line, node); 1747 al = rb_entry(node, struct annotation_line, rb_node);
1774 for (i = 0; i < src_line->nr_pcnt; i++) { 1748 for (i = 0; i < al->samples_nr; i++) {
1775 percent = src_line->samples[i].percent_sum; 1749 percent = al->samples[i].percent_sum;
1776 color = get_percent_color(percent); 1750 color = get_percent_color(percent);
1777 color_fprintf(stdout, color, " %7.2f", percent); 1751 color_fprintf(stdout, color, " %7.2f", percent);
1778 1752
@@ -1780,7 +1754,7 @@ static void print_summary(struct rb_root *root, const char *filename)
1780 percent_max = percent; 1754 percent_max = percent;
1781 } 1755 }
1782 1756
1783 path = src_line->path; 1757 path = al->path;
1784 color = get_percent_color(percent_max); 1758 color = get_percent_color(percent_max);
1785 color_fprintf(stdout, color, " %s\n", path); 1759 color_fprintf(stdout, color, " %s\n", path);
1786 1760
@@ -1801,6 +1775,19 @@ static void symbol__annotate_hits(struct symbol *sym, struct perf_evsel *evsel)
1801 printf("%*s: %" PRIu64 "\n", BITS_PER_LONG / 2, "h->nr_samples", h->nr_samples); 1775 printf("%*s: %" PRIu64 "\n", BITS_PER_LONG / 2, "h->nr_samples", h->nr_samples);
1802} 1776}
1803 1777
1778static int annotated_source__addr_fmt_width(struct list_head *lines, u64 start)
1779{
1780 char bf[32];
1781 struct annotation_line *line;
1782
1783 list_for_each_entry_reverse(line, lines, node) {
1784 if (line->offset != -1)
1785 return scnprintf(bf, sizeof(bf), "%" PRIx64, start + line->offset);
1786 }
1787
1788 return 0;
1789}
1790
1804int symbol__annotate_printf(struct symbol *sym, struct map *map, 1791int symbol__annotate_printf(struct symbol *sym, struct map *map,
1805 struct perf_evsel *evsel, bool full_paths, 1792 struct perf_evsel *evsel, bool full_paths,
1806 int min_pcnt, int max_lines, int context) 1793 int min_pcnt, int max_lines, int context)
@@ -1811,9 +1798,9 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
1811 const char *evsel_name = perf_evsel__name(evsel); 1798 const char *evsel_name = perf_evsel__name(evsel);
1812 struct annotation *notes = symbol__annotation(sym); 1799 struct annotation *notes = symbol__annotation(sym);
1813 struct sym_hist *h = annotation__histogram(notes, evsel->idx); 1800 struct sym_hist *h = annotation__histogram(notes, evsel->idx);
1814 struct disasm_line *pos, *queue = NULL; 1801 struct annotation_line *pos, *queue = NULL;
1815 u64 start = map__rip_2objdump(map, sym->start); 1802 u64 start = map__rip_2objdump(map, sym->start);
1816 int printed = 2, queue_len = 0; 1803 int printed = 2, queue_len = 0, addr_fmt_width;
1817 int more = 0; 1804 int more = 0;
1818 u64 len; 1805 u64 len;
1819 int width = symbol_conf.show_total_period ? 12 : 8; 1806 int width = symbol_conf.show_total_period ? 12 : 8;
@@ -1844,15 +1831,21 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
1844 if (verbose > 0) 1831 if (verbose > 0)
1845 symbol__annotate_hits(sym, evsel); 1832 symbol__annotate_hits(sym, evsel);
1846 1833
1834 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start);
1835
1847 list_for_each_entry(pos, &notes->src->source, node) { 1836 list_for_each_entry(pos, &notes->src->source, node) {
1837 int err;
1838
1848 if (context && queue == NULL) { 1839 if (context && queue == NULL) {
1849 queue = pos; 1840 queue = pos;
1850 queue_len = 0; 1841 queue_len = 0;
1851 } 1842 }
1852 1843
1853 switch (disasm_line__print(pos, sym, start, evsel, len, 1844 err = annotation_line__print(pos, sym, start, evsel, len,
1854 min_pcnt, printed, max_lines, 1845 min_pcnt, printed, max_lines,
1855 queue)) { 1846 queue, addr_fmt_width);
1847
1848 switch (err) {
1856 case 0: 1849 case 0:
1857 ++printed; 1850 ++printed;
1858 if (context) { 1851 if (context) {
@@ -1907,13 +1900,13 @@ void symbol__annotate_decay_histogram(struct symbol *sym, int evidx)
1907 } 1900 }
1908} 1901}
1909 1902
1910void disasm__purge(struct list_head *head) 1903void annotated_source__purge(struct annotated_source *as)
1911{ 1904{
1912 struct disasm_line *pos, *n; 1905 struct annotation_line *al, *n;
1913 1906
1914 list_for_each_entry_safe(pos, n, head, node) { 1907 list_for_each_entry_safe(al, n, &as->source, node) {
1915 list_del(&pos->node); 1908 list_del(&al->node);
1916 disasm_line__free(pos); 1909 disasm_line__free(disasm_line(al));
1917 } 1910 }
1918} 1911}
1919 1912
@@ -1921,10 +1914,10 @@ static size_t disasm_line__fprintf(struct disasm_line *dl, FILE *fp)
1921{ 1914{
1922 size_t printed; 1915 size_t printed;
1923 1916
1924 if (dl->offset == -1) 1917 if (dl->al.offset == -1)
1925 return fprintf(fp, "%s\n", dl->line); 1918 return fprintf(fp, "%s\n", dl->al.line);
1926 1919
1927 printed = fprintf(fp, "%#" PRIx64 " %s", dl->offset, dl->ins.name); 1920 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name);
1928 1921
1929 if (dl->ops.raw[0] != '\0') { 1922 if (dl->ops.raw[0] != '\0') {
1930 printed += fprintf(fp, "%.*s %s\n", 6 - (int)printed, " ", 1923 printed += fprintf(fp, "%.*s %s\n", 6 - (int)printed, " ",
@@ -1939,38 +1932,73 @@ size_t disasm__fprintf(struct list_head *head, FILE *fp)
1939 struct disasm_line *pos; 1932 struct disasm_line *pos;
1940 size_t printed = 0; 1933 size_t printed = 0;
1941 1934
1942 list_for_each_entry(pos, head, node) 1935 list_for_each_entry(pos, head, al.node)
1943 printed += disasm_line__fprintf(pos, fp); 1936 printed += disasm_line__fprintf(pos, fp);
1944 1937
1945 return printed; 1938 return printed;
1946} 1939}
1947 1940
1941static void annotation__calc_lines(struct annotation *notes, struct map *map,
1942 struct rb_root *root, u64 start)
1943{
1944 struct annotation_line *al;
1945 struct rb_root tmp_root = RB_ROOT;
1946
1947 list_for_each_entry(al, &notes->src->source, node) {
1948 double percent_max = 0.0;
1949 int i;
1950
1951 for (i = 0; i < al->samples_nr; i++) {
1952 struct annotation_data *sample;
1953
1954 sample = &al->samples[i];
1955
1956 if (sample->percent > percent_max)
1957 percent_max = sample->percent;
1958 }
1959
1960 if (percent_max <= 0.5)
1961 continue;
1962
1963 al->path = get_srcline(map->dso, start + al->offset, NULL,
1964 false, true, start + al->offset);
1965 insert_source_line(&tmp_root, al);
1966 }
1967
1968 resort_source_line(root, &tmp_root);
1969}
1970
1971static void symbol__calc_lines(struct symbol *sym, struct map *map,
1972 struct rb_root *root)
1973{
1974 struct annotation *notes = symbol__annotation(sym);
1975 u64 start = map__rip_2objdump(map, sym->start);
1976
1977 annotation__calc_lines(notes, map, root, start);
1978}
1979
1948int symbol__tty_annotate(struct symbol *sym, struct map *map, 1980int symbol__tty_annotate(struct symbol *sym, struct map *map,
1949 struct perf_evsel *evsel, bool print_lines, 1981 struct perf_evsel *evsel, bool print_lines,
1950 bool full_paths, int min_pcnt, int max_lines) 1982 bool full_paths, int min_pcnt, int max_lines)
1951{ 1983{
1952 struct dso *dso = map->dso; 1984 struct dso *dso = map->dso;
1953 struct rb_root source_line = RB_ROOT; 1985 struct rb_root source_line = RB_ROOT;
1954 u64 len;
1955 1986
1956 if (symbol__disassemble(sym, map, perf_evsel__env_arch(evsel), 1987 if (symbol__annotate(sym, map, evsel, 0, NULL) < 0)
1957 0, NULL, NULL) < 0)
1958 return -1; 1988 return -1;
1959 1989
1960 len = symbol__size(sym); 1990 symbol__calc_percent(sym, evsel);
1961 1991
1962 if (print_lines) { 1992 if (print_lines) {
1963 srcline_full_filename = full_paths; 1993 srcline_full_filename = full_paths;
1964 symbol__get_source_line(sym, map, evsel, &source_line, len); 1994 symbol__calc_lines(sym, map, &source_line);
1965 print_summary(&source_line, dso->long_name); 1995 print_summary(&source_line, dso->long_name);
1966 } 1996 }
1967 1997
1968 symbol__annotate_printf(sym, map, evsel, full_paths, 1998 symbol__annotate_printf(sym, map, evsel, full_paths,
1969 min_pcnt, max_lines, 0); 1999 min_pcnt, max_lines, 0);
1970 if (print_lines)
1971 symbol__free_source_line(sym, len);
1972 2000
1973 disasm__purge(&symbol__annotation(sym)->src->source); 2001 annotated_source__purge(symbol__annotation(sym)->src);
1974 2002
1975 return 0; 2003 return 0;
1976} 2004}
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index f6ba3560de5e..ce427445671f 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -59,33 +59,55 @@ bool ins__is_fused(struct arch *arch, const char *ins1, const char *ins2);
59 59
60struct annotation; 60struct annotation;
61 61
62struct sym_hist_entry {
63 u64 nr_samples;
64 u64 period;
65};
66
67struct annotation_data {
68 double percent;
69 double percent_sum;
70 struct sym_hist_entry he;
71};
72
73struct annotation_line {
74 struct list_head node;
75 struct rb_node rb_node;
76 s64 offset;
77 char *line;
78 int line_nr;
79 float ipc;
80 u64 cycles;
81 size_t privsize;
82 char *path;
83 int samples_nr;
84 struct annotation_data samples[0];
85};
86
62struct disasm_line { 87struct disasm_line {
63 struct list_head node; 88 struct ins ins;
64 s64 offset; 89 struct ins_operands ops;
65 char *line; 90
66 struct ins ins; 91 /* This needs to be at the end. */
67 int line_nr; 92 struct annotation_line al;
68 float ipc;
69 u64 cycles;
70 struct ins_operands ops;
71}; 93};
72 94
95static inline struct disasm_line *disasm_line(struct annotation_line *al)
96{
97 return al ? container_of(al, struct disasm_line, al) : NULL;
98}
99
73static inline bool disasm_line__has_offset(const struct disasm_line *dl) 100static inline bool disasm_line__has_offset(const struct disasm_line *dl)
74{ 101{
75 return dl->ops.target.offset_avail; 102 return dl->ops.target.offset_avail;
76} 103}
77 104
78struct sym_hist_entry {
79 u64 nr_samples;
80 u64 period;
81};
82
83void disasm_line__free(struct disasm_line *dl); 105void disasm_line__free(struct disasm_line *dl);
84struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); 106struct annotation_line *
107annotation_line__next(struct annotation_line *pos, struct list_head *head);
85int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); 108int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw);
86size_t disasm__fprintf(struct list_head *head, FILE *fp); 109size_t disasm__fprintf(struct list_head *head, FILE *fp);
87double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, 110void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel);
88 s64 end, const char **path, struct sym_hist_entry *sample);
89 111
90struct sym_hist { 112struct sym_hist {
91 u64 nr_samples; 113 u64 nr_samples;
@@ -104,19 +126,6 @@ struct cyc_hist {
104 u16 reset; 126 u16 reset;
105}; 127};
106 128
107struct source_line_samples {
108 double percent;
109 double percent_sum;
110 u64 nr;
111};
112
113struct source_line {
114 struct rb_node node;
115 char *path;
116 int nr_pcnt;
117 struct source_line_samples samples[1];
118};
119
120/** struct annotated_source - symbols with hits have this attached as in sannotation 129/** struct annotated_source - symbols with hits have this attached as in sannotation
121 * 130 *
122 * @histogram: Array of addr hit histograms per event being monitored 131 * @histogram: Array of addr hit histograms per event being monitored
@@ -132,7 +141,6 @@ struct source_line {
132 */ 141 */
133struct annotated_source { 142struct annotated_source {
134 struct list_head source; 143 struct list_head source;
135 struct source_line *lines;
136 int nr_histograms; 144 int nr_histograms;
137 size_t sizeof_sym_hist; 145 size_t sizeof_sym_hist;
138 struct cyc_hist *cycles_hist; 146 struct cyc_hist *cycles_hist;
@@ -169,9 +177,9 @@ int hist_entry__inc_addr_samples(struct hist_entry *he, struct perf_sample *samp
169int symbol__alloc_hist(struct symbol *sym); 177int symbol__alloc_hist(struct symbol *sym);
170void symbol__annotate_zero_histograms(struct symbol *sym); 178void symbol__annotate_zero_histograms(struct symbol *sym);
171 179
172int symbol__disassemble(struct symbol *sym, struct map *map, 180int symbol__annotate(struct symbol *sym, struct map *map,
173 const char *arch_name, size_t privsize, 181 struct perf_evsel *evsel, size_t privsize,
174 struct arch **parch, char *cpuid); 182 struct arch **parch);
175 183
176enum symbol_disassemble_errno { 184enum symbol_disassemble_errno {
177 SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0, 185 SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0,
@@ -198,7 +206,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
198 int min_pcnt, int max_lines, int context); 206 int min_pcnt, int max_lines, int context);
199void symbol__annotate_zero_histogram(struct symbol *sym, int evidx); 207void symbol__annotate_zero_histogram(struct symbol *sym, int evidx);
200void symbol__annotate_decay_histogram(struct symbol *sym, int evidx); 208void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
201void disasm__purge(struct list_head *head); 209void annotated_source__purge(struct annotated_source *as);
202 210
203bool ui__has_annotation(void); 211bool ui__has_annotation(void);
204 212
diff --git a/tools/perf/util/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-pkt-decoder.c
new file mode 100644
index 000000000000..b94001b756c7
--- /dev/null
+++ b/tools/perf/util/arm-spe-pkt-decoder.c
@@ -0,0 +1,462 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Arm Statistical Profiling Extensions (SPE) support
4 * Copyright (c) 2017-2018, Arm Ltd.
5 */
6
7#include <stdio.h>
8#include <string.h>
9#include <endian.h>
10#include <byteswap.h>
11
12#include "arm-spe-pkt-decoder.h"
13
14#define BIT(n) (1ULL << (n))
15
16#define NS_FLAG BIT(63)
17#define EL_FLAG (BIT(62) | BIT(61))
18
19#define SPE_HEADER0_PAD 0x0
20#define SPE_HEADER0_END 0x1
21#define SPE_HEADER0_ADDRESS 0x30 /* address packet (short) */
22#define SPE_HEADER0_ADDRESS_MASK 0x38
23#define SPE_HEADER0_COUNTER 0x18 /* counter packet (short) */
24#define SPE_HEADER0_COUNTER_MASK 0x38
25#define SPE_HEADER0_TIMESTAMP 0x71
26#define SPE_HEADER0_TIMESTAMP 0x71
27#define SPE_HEADER0_EVENTS 0x2
28#define SPE_HEADER0_EVENTS_MASK 0xf
29#define SPE_HEADER0_SOURCE 0x3
30#define SPE_HEADER0_SOURCE_MASK 0xf
31#define SPE_HEADER0_CONTEXT 0x24
32#define SPE_HEADER0_CONTEXT_MASK 0x3c
33#define SPE_HEADER0_OP_TYPE 0x8
34#define SPE_HEADER0_OP_TYPE_MASK 0x3c
35#define SPE_HEADER1_ALIGNMENT 0x0
36#define SPE_HEADER1_ADDRESS 0xb0 /* address packet (extended) */
37#define SPE_HEADER1_ADDRESS_MASK 0xf8
38#define SPE_HEADER1_COUNTER 0x98 /* counter packet (extended) */
39#define SPE_HEADER1_COUNTER_MASK 0xf8
40
41#if __BYTE_ORDER == __BIG_ENDIAN
42#define le16_to_cpu bswap_16
43#define le32_to_cpu bswap_32
44#define le64_to_cpu bswap_64
45#define memcpy_le64(d, s, n) do { \
46 memcpy((d), (s), (n)); \
47 *(d) = le64_to_cpu(*(d)); \
48} while (0)
49#else
50#define le16_to_cpu
51#define le32_to_cpu
52#define le64_to_cpu
53#define memcpy_le64 memcpy
54#endif
55
56static const char * const arm_spe_packet_name[] = {
57 [ARM_SPE_PAD] = "PAD",
58 [ARM_SPE_END] = "END",
59 [ARM_SPE_TIMESTAMP] = "TS",
60 [ARM_SPE_ADDRESS] = "ADDR",
61 [ARM_SPE_COUNTER] = "LAT",
62 [ARM_SPE_CONTEXT] = "CONTEXT",
63 [ARM_SPE_OP_TYPE] = "OP-TYPE",
64 [ARM_SPE_EVENTS] = "EVENTS",
65 [ARM_SPE_DATA_SOURCE] = "DATA-SOURCE",
66};
67
68const char *arm_spe_pkt_name(enum arm_spe_pkt_type type)
69{
70 return arm_spe_packet_name[type];
71}
72
73/* return ARM SPE payload size from its encoding,
74 * which is in bits 5:4 of the byte.
75 * 00 : byte
76 * 01 : halfword (2)
77 * 10 : word (4)
78 * 11 : doubleword (8)
79 */
80static int payloadlen(unsigned char byte)
81{
82 return 1 << ((byte & 0x30) >> 4);
83}
84
85static int arm_spe_get_payload(const unsigned char *buf, size_t len,
86 struct arm_spe_pkt *packet)
87{
88 size_t payload_len = payloadlen(buf[0]);
89
90 if (len < 1 + payload_len)
91 return ARM_SPE_NEED_MORE_BYTES;
92
93 buf++;
94
95 switch (payload_len) {
96 case 1: packet->payload = *(uint8_t *)buf; break;
97 case 2: packet->payload = le16_to_cpu(*(uint16_t *)buf); break;
98 case 4: packet->payload = le32_to_cpu(*(uint32_t *)buf); break;
99 case 8: packet->payload = le64_to_cpu(*(uint64_t *)buf); break;
100 default: return ARM_SPE_BAD_PACKET;
101 }
102
103 return 1 + payload_len;
104}
105
106static int arm_spe_get_pad(struct arm_spe_pkt *packet)
107{
108 packet->type = ARM_SPE_PAD;
109 return 1;
110}
111
112static int arm_spe_get_alignment(const unsigned char *buf, size_t len,
113 struct arm_spe_pkt *packet)
114{
115 unsigned int alignment = 1 << ((buf[0] & 0xf) + 1);
116
117 if (len < alignment)
118 return ARM_SPE_NEED_MORE_BYTES;
119
120 packet->type = ARM_SPE_PAD;
121 return alignment - (((uintptr_t)buf) & (alignment - 1));
122}
123
124static int arm_spe_get_end(struct arm_spe_pkt *packet)
125{
126 packet->type = ARM_SPE_END;
127 return 1;
128}
129
130static int arm_spe_get_timestamp(const unsigned char *buf, size_t len,
131 struct arm_spe_pkt *packet)
132{
133 packet->type = ARM_SPE_TIMESTAMP;
134 return arm_spe_get_payload(buf, len, packet);
135}
136
137static int arm_spe_get_events(const unsigned char *buf, size_t len,
138 struct arm_spe_pkt *packet)
139{
140 int ret = arm_spe_get_payload(buf, len, packet);
141
142 packet->type = ARM_SPE_EVENTS;
143
144 /* we use index to identify Events with a less number of
145 * comparisons in arm_spe_pkt_desc(): E.g., the LLC-ACCESS,
146 * LLC-REFILL, and REMOTE-ACCESS events are identified iff
147 * index > 1.
148 */
149 packet->index = ret - 1;
150
151 return ret;
152}
153
154static int arm_spe_get_data_source(const unsigned char *buf, size_t len,
155 struct arm_spe_pkt *packet)
156{
157 packet->type = ARM_SPE_DATA_SOURCE;
158 return arm_spe_get_payload(buf, len, packet);
159}
160
161static int arm_spe_get_context(const unsigned char *buf, size_t len,
162 struct arm_spe_pkt *packet)
163{
164 packet->type = ARM_SPE_CONTEXT;
165 packet->index = buf[0] & 0x3;
166
167 return arm_spe_get_payload(buf, len, packet);
168}
169
170static int arm_spe_get_op_type(const unsigned char *buf, size_t len,
171 struct arm_spe_pkt *packet)
172{
173 packet->type = ARM_SPE_OP_TYPE;
174 packet->index = buf[0] & 0x3;
175 return arm_spe_get_payload(buf, len, packet);
176}
177
178static int arm_spe_get_counter(const unsigned char *buf, size_t len,
179 const unsigned char ext_hdr, struct arm_spe_pkt *packet)
180{
181 if (len < 2)
182 return ARM_SPE_NEED_MORE_BYTES;
183
184 packet->type = ARM_SPE_COUNTER;
185 if (ext_hdr)
186 packet->index = ((buf[0] & 0x3) << 3) | (buf[1] & 0x7);
187 else
188 packet->index = buf[0] & 0x7;
189
190 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 1));
191
192 return 1 + ext_hdr + 2;
193}
194
195static int arm_spe_get_addr(const unsigned char *buf, size_t len,
196 const unsigned char ext_hdr, struct arm_spe_pkt *packet)
197{
198 if (len < 8)
199 return ARM_SPE_NEED_MORE_BYTES;
200
201 packet->type = ARM_SPE_ADDRESS;
202 if (ext_hdr)
203 packet->index = ((buf[0] & 0x3) << 3) | (buf[1] & 0x7);
204 else
205 packet->index = buf[0] & 0x7;
206
207 memcpy_le64(&packet->payload, buf + 1, 8);
208
209 return 1 + ext_hdr + 8;
210}
211
212static int arm_spe_do_get_packet(const unsigned char *buf, size_t len,
213 struct arm_spe_pkt *packet)
214{
215 unsigned int byte;
216
217 memset(packet, 0, sizeof(struct arm_spe_pkt));
218
219 if (!len)
220 return ARM_SPE_NEED_MORE_BYTES;
221
222 byte = buf[0];
223 if (byte == SPE_HEADER0_PAD)
224 return arm_spe_get_pad(packet);
225 else if (byte == SPE_HEADER0_END) /* no timestamp at end of record */
226 return arm_spe_get_end(packet);
227 else if (byte & 0xc0 /* 0y11xxxxxx */) {
228 if (byte & 0x80) {
229 if ((byte & SPE_HEADER0_ADDRESS_MASK) == SPE_HEADER0_ADDRESS)
230 return arm_spe_get_addr(buf, len, 0, packet);
231 if ((byte & SPE_HEADER0_COUNTER_MASK) == SPE_HEADER0_COUNTER)
232 return arm_spe_get_counter(buf, len, 0, packet);
233 } else
234 if (byte == SPE_HEADER0_TIMESTAMP)
235 return arm_spe_get_timestamp(buf, len, packet);
236 else if ((byte & SPE_HEADER0_EVENTS_MASK) == SPE_HEADER0_EVENTS)
237 return arm_spe_get_events(buf, len, packet);
238 else if ((byte & SPE_HEADER0_SOURCE_MASK) == SPE_HEADER0_SOURCE)
239 return arm_spe_get_data_source(buf, len, packet);
240 else if ((byte & SPE_HEADER0_CONTEXT_MASK) == SPE_HEADER0_CONTEXT)
241 return arm_spe_get_context(buf, len, packet);
242 else if ((byte & SPE_HEADER0_OP_TYPE_MASK) == SPE_HEADER0_OP_TYPE)
243 return arm_spe_get_op_type(buf, len, packet);
244 } else if ((byte & 0xe0) == 0x20 /* 0y001xxxxx */) {
245 /* 16-bit header */
246 byte = buf[1];
247 if (byte == SPE_HEADER1_ALIGNMENT)
248 return arm_spe_get_alignment(buf, len, packet);
249 else if ((byte & SPE_HEADER1_ADDRESS_MASK) == SPE_HEADER1_ADDRESS)
250 return arm_spe_get_addr(buf, len, 1, packet);
251 else if ((byte & SPE_HEADER1_COUNTER_MASK) == SPE_HEADER1_COUNTER)
252 return arm_spe_get_counter(buf, len, 1, packet);
253 }
254
255 return ARM_SPE_BAD_PACKET;
256}
257
258int arm_spe_get_packet(const unsigned char *buf, size_t len,
259 struct arm_spe_pkt *packet)
260{
261 int ret;
262
263 ret = arm_spe_do_get_packet(buf, len, packet);
264 /* put multiple consecutive PADs on the same line, up to
265 * the fixed-width output format of 16 bytes per line.
266 */
267 if (ret > 0 && packet->type == ARM_SPE_PAD) {
268 while (ret < 16 && len > (size_t)ret && !buf[ret])
269 ret += 1;
270 }
271 return ret;
272}
273
274int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
275 size_t buf_len)
276{
277 int ret, ns, el, idx = packet->index;
278 unsigned long long payload = packet->payload;
279 const char *name = arm_spe_pkt_name(packet->type);
280
281 switch (packet->type) {
282 case ARM_SPE_BAD:
283 case ARM_SPE_PAD:
284 case ARM_SPE_END:
285 return snprintf(buf, buf_len, "%s", name);
286 case ARM_SPE_EVENTS: {
287 size_t blen = buf_len;
288
289 ret = 0;
290 ret = snprintf(buf, buf_len, "EV");
291 buf += ret;
292 blen -= ret;
293 if (payload & 0x1) {
294 ret = snprintf(buf, buf_len, " EXCEPTION-GEN");
295 buf += ret;
296 blen -= ret;
297 }
298 if (payload & 0x2) {
299 ret = snprintf(buf, buf_len, " RETIRED");
300 buf += ret;
301 blen -= ret;
302 }
303 if (payload & 0x4) {
304 ret = snprintf(buf, buf_len, " L1D-ACCESS");
305 buf += ret;
306 blen -= ret;
307 }
308 if (payload & 0x8) {
309 ret = snprintf(buf, buf_len, " L1D-REFILL");
310 buf += ret;
311 blen -= ret;
312 }
313 if (payload & 0x10) {
314 ret = snprintf(buf, buf_len, " TLB-ACCESS");
315 buf += ret;
316 blen -= ret;
317 }
318 if (payload & 0x20) {
319 ret = snprintf(buf, buf_len, " TLB-REFILL");
320 buf += ret;
321 blen -= ret;
322 }
323 if (payload & 0x40) {
324 ret = snprintf(buf, buf_len, " NOT-TAKEN");
325 buf += ret;
326 blen -= ret;
327 }
328 if (payload & 0x80) {
329 ret = snprintf(buf, buf_len, " MISPRED");
330 buf += ret;
331 blen -= ret;
332 }
333 if (idx > 1) {
334 if (payload & 0x100) {
335 ret = snprintf(buf, buf_len, " LLC-ACCESS");
336 buf += ret;
337 blen -= ret;
338 }
339 if (payload & 0x200) {
340 ret = snprintf(buf, buf_len, " LLC-REFILL");
341 buf += ret;
342 blen -= ret;
343 }
344 if (payload & 0x400) {
345 ret = snprintf(buf, buf_len, " REMOTE-ACCESS");
346 buf += ret;
347 blen -= ret;
348 }
349 }
350 if (ret < 0)
351 return ret;
352 blen -= ret;
353 return buf_len - blen;
354 }
355 case ARM_SPE_OP_TYPE:
356 switch (idx) {
357 case 0: return snprintf(buf, buf_len, "%s", payload & 0x1 ?
358 "COND-SELECT" : "INSN-OTHER");
359 case 1: {
360 size_t blen = buf_len;
361
362 if (payload & 0x1)
363 ret = snprintf(buf, buf_len, "ST");
364 else
365 ret = snprintf(buf, buf_len, "LD");
366 buf += ret;
367 blen -= ret;
368 if (payload & 0x2) {
369 if (payload & 0x4) {
370 ret = snprintf(buf, buf_len, " AT");
371 buf += ret;
372 blen -= ret;
373 }
374 if (payload & 0x8) {
375 ret = snprintf(buf, buf_len, " EXCL");
376 buf += ret;
377 blen -= ret;
378 }
379 if (payload & 0x10) {
380 ret = snprintf(buf, buf_len, " AR");
381 buf += ret;
382 blen -= ret;
383 }
384 } else if (payload & 0x4) {
385 ret = snprintf(buf, buf_len, " SIMD-FP");
386 buf += ret;
387 blen -= ret;
388 }
389 if (ret < 0)
390 return ret;
391 blen -= ret;
392 return buf_len - blen;
393 }
394 case 2: {
395 size_t blen = buf_len;
396
397 ret = snprintf(buf, buf_len, "B");
398 buf += ret;
399 blen -= ret;
400 if (payload & 0x1) {
401 ret = snprintf(buf, buf_len, " COND");
402 buf += ret;
403 blen -= ret;
404 }
405 if (payload & 0x2) {
406 ret = snprintf(buf, buf_len, " IND");
407 buf += ret;
408 blen -= ret;
409 }
410 if (ret < 0)
411 return ret;
412 blen -= ret;
413 return buf_len - blen;
414 }
415 default: return 0;
416 }
417 case ARM_SPE_DATA_SOURCE:
418 case ARM_SPE_TIMESTAMP:
419 return snprintf(buf, buf_len, "%s %lld", name, payload);
420 case ARM_SPE_ADDRESS:
421 switch (idx) {
422 case 0:
423 case 1: ns = !!(packet->payload & NS_FLAG);
424 el = (packet->payload & EL_FLAG) >> 61;
425 payload &= ~(0xffULL << 56);
426 return snprintf(buf, buf_len, "%s 0x%llx el%d ns=%d",
427 (idx == 1) ? "TGT" : "PC", payload, el, ns);
428 case 2: return snprintf(buf, buf_len, "VA 0x%llx", payload);
429 case 3: ns = !!(packet->payload & NS_FLAG);
430 payload &= ~(0xffULL << 56);
431 return snprintf(buf, buf_len, "PA 0x%llx ns=%d",
432 payload, ns);
433 default: return 0;
434 }
435 case ARM_SPE_CONTEXT:
436 return snprintf(buf, buf_len, "%s 0x%lx el%d", name,
437 (unsigned long)payload, idx + 1);
438 case ARM_SPE_COUNTER: {
439 size_t blen = buf_len;
440
441 ret = snprintf(buf, buf_len, "%s %d ", name,
442 (unsigned short)payload);
443 buf += ret;
444 blen -= ret;
445 switch (idx) {
446 case 0: ret = snprintf(buf, buf_len, "TOT"); break;
447 case 1: ret = snprintf(buf, buf_len, "ISSUE"); break;
448 case 2: ret = snprintf(buf, buf_len, "XLAT"); break;
449 default: ret = 0;
450 }
451 if (ret < 0)
452 return ret;
453 blen -= ret;
454 return buf_len - blen;
455 }
456 default:
457 break;
458 }
459
460 return snprintf(buf, buf_len, "%s 0x%llx (%d)",
461 name, payload, packet->index);
462}
diff --git a/tools/perf/util/arm-spe-pkt-decoder.h b/tools/perf/util/arm-spe-pkt-decoder.h
new file mode 100644
index 000000000000..d786ef65113f
--- /dev/null
+++ b/tools/perf/util/arm-spe-pkt-decoder.h
@@ -0,0 +1,43 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Arm Statistical Profiling Extensions (SPE) support
4 * Copyright (c) 2017-2018, Arm Ltd.
5 */
6
7#ifndef INCLUDE__ARM_SPE_PKT_DECODER_H__
8#define INCLUDE__ARM_SPE_PKT_DECODER_H__
9
10#include <stddef.h>
11#include <stdint.h>
12
13#define ARM_SPE_PKT_DESC_MAX 256
14
15#define ARM_SPE_NEED_MORE_BYTES -1
16#define ARM_SPE_BAD_PACKET -2
17
18enum arm_spe_pkt_type {
19 ARM_SPE_BAD,
20 ARM_SPE_PAD,
21 ARM_SPE_END,
22 ARM_SPE_TIMESTAMP,
23 ARM_SPE_ADDRESS,
24 ARM_SPE_COUNTER,
25 ARM_SPE_CONTEXT,
26 ARM_SPE_OP_TYPE,
27 ARM_SPE_EVENTS,
28 ARM_SPE_DATA_SOURCE,
29};
30
31struct arm_spe_pkt {
32 enum arm_spe_pkt_type type;
33 unsigned char index;
34 uint64_t payload;
35};
36
37const char *arm_spe_pkt_name(enum arm_spe_pkt_type);
38
39int arm_spe_get_packet(const unsigned char *buf, size_t len,
40 struct arm_spe_pkt *packet);
41
42int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, size_t len);
43#endif
diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
new file mode 100644
index 000000000000..6067267cc76c
--- /dev/null
+++ b/tools/perf/util/arm-spe.c
@@ -0,0 +1,231 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Arm Statistical Profiling Extensions (SPE) support
4 * Copyright (c) 2017-2018, Arm Ltd.
5 */
6
7#include <endian.h>
8#include <errno.h>
9#include <byteswap.h>
10#include <inttypes.h>
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/bitops.h>
14#include <linux/log2.h>
15
16#include "cpumap.h"
17#include "color.h"
18#include "evsel.h"
19#include "evlist.h"
20#include "machine.h"
21#include "session.h"
22#include "util.h"
23#include "thread.h"
24#include "debug.h"
25#include "auxtrace.h"
26#include "arm-spe.h"
27#include "arm-spe-pkt-decoder.h"
28
29struct arm_spe {
30 struct auxtrace auxtrace;
31 struct auxtrace_queues queues;
32 struct auxtrace_heap heap;
33 u32 auxtrace_type;
34 struct perf_session *session;
35 struct machine *machine;
36 u32 pmu_type;
37};
38
39struct arm_spe_queue {
40 struct arm_spe *spe;
41 unsigned int queue_nr;
42 struct auxtrace_buffer *buffer;
43 bool on_heap;
44 bool done;
45 pid_t pid;
46 pid_t tid;
47 int cpu;
48};
49
50static void arm_spe_dump(struct arm_spe *spe __maybe_unused,
51 unsigned char *buf, size_t len)
52{
53 struct arm_spe_pkt packet;
54 size_t pos = 0;
55 int ret, pkt_len, i;
56 char desc[ARM_SPE_PKT_DESC_MAX];
57 const char *color = PERF_COLOR_BLUE;
58
59 color_fprintf(stdout, color,
60 ". ... ARM SPE data: size %zu bytes\n",
61 len);
62
63 while (len) {
64 ret = arm_spe_get_packet(buf, len, &packet);
65 if (ret > 0)
66 pkt_len = ret;
67 else
68 pkt_len = 1;
69 printf(".");
70 color_fprintf(stdout, color, " %08x: ", pos);
71 for (i = 0; i < pkt_len; i++)
72 color_fprintf(stdout, color, " %02x", buf[i]);
73 for (; i < 16; i++)
74 color_fprintf(stdout, color, " ");
75 if (ret > 0) {
76 ret = arm_spe_pkt_desc(&packet, desc,
77 ARM_SPE_PKT_DESC_MAX);
78 if (ret > 0)
79 color_fprintf(stdout, color, " %s\n", desc);
80 } else {
81 color_fprintf(stdout, color, " Bad packet!\n");
82 }
83 pos += pkt_len;
84 buf += pkt_len;
85 len -= pkt_len;
86 }
87}
88
89static void arm_spe_dump_event(struct arm_spe *spe, unsigned char *buf,
90 size_t len)
91{
92 printf(".\n");
93 arm_spe_dump(spe, buf, len);
94}
95
96static int arm_spe_process_event(struct perf_session *session __maybe_unused,
97 union perf_event *event __maybe_unused,
98 struct perf_sample *sample __maybe_unused,
99 struct perf_tool *tool __maybe_unused)
100{
101 return 0;
102}
103
104static int arm_spe_process_auxtrace_event(struct perf_session *session,
105 union perf_event *event,
106 struct perf_tool *tool __maybe_unused)
107{
108 struct arm_spe *spe = container_of(session->auxtrace, struct arm_spe,
109 auxtrace);
110 struct auxtrace_buffer *buffer;
111 off_t data_offset;
112 int fd = perf_data__fd(session->data);
113 int err;
114
115 if (perf_data__is_pipe(session->data)) {
116 data_offset = 0;
117 } else {
118 data_offset = lseek(fd, 0, SEEK_CUR);
119 if (data_offset == -1)
120 return -errno;
121 }
122
123 err = auxtrace_queues__add_event(&spe->queues, session, event,
124 data_offset, &buffer);
125 if (err)
126 return err;
127
128 /* Dump here now we have copied a piped trace out of the pipe */
129 if (dump_trace) {
130 if (auxtrace_buffer__get_data(buffer, fd)) {
131 arm_spe_dump_event(spe, buffer->data,
132 buffer->size);
133 auxtrace_buffer__put_data(buffer);
134 }
135 }
136
137 return 0;
138}
139
140static int arm_spe_flush(struct perf_session *session __maybe_unused,
141 struct perf_tool *tool __maybe_unused)
142{
143 return 0;
144}
145
146static void arm_spe_free_queue(void *priv)
147{
148 struct arm_spe_queue *speq = priv;
149
150 if (!speq)
151 return;
152 free(speq);
153}
154
155static void arm_spe_free_events(struct perf_session *session)
156{
157 struct arm_spe *spe = container_of(session->auxtrace, struct arm_spe,
158 auxtrace);
159 struct auxtrace_queues *queues = &spe->queues;
160 unsigned int i;
161
162 for (i = 0; i < queues->nr_queues; i++) {
163 arm_spe_free_queue(queues->queue_array[i].priv);
164 queues->queue_array[i].priv = NULL;
165 }
166 auxtrace_queues__free(queues);
167}
168
169static void arm_spe_free(struct perf_session *session)
170{
171 struct arm_spe *spe = container_of(session->auxtrace, struct arm_spe,
172 auxtrace);
173
174 auxtrace_heap__free(&spe->heap);
175 arm_spe_free_events(session);
176 session->auxtrace = NULL;
177 free(spe);
178}
179
180static const char * const arm_spe_info_fmts[] = {
181 [ARM_SPE_PMU_TYPE] = " PMU Type %"PRId64"\n",
182};
183
184static void arm_spe_print_info(u64 *arr)
185{
186 if (!dump_trace)
187 return;
188
189 fprintf(stdout, arm_spe_info_fmts[ARM_SPE_PMU_TYPE], arr[ARM_SPE_PMU_TYPE]);
190}
191
192int arm_spe_process_auxtrace_info(union perf_event *event,
193 struct perf_session *session)
194{
195 struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
196 size_t min_sz = sizeof(u64) * ARM_SPE_PMU_TYPE;
197 struct arm_spe *spe;
198 int err;
199
200 if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
201 min_sz)
202 return -EINVAL;
203
204 spe = zalloc(sizeof(struct arm_spe));
205 if (!spe)
206 return -ENOMEM;
207
208 err = auxtrace_queues__init(&spe->queues);
209 if (err)
210 goto err_free;
211
212 spe->session = session;
213 spe->machine = &session->machines.host; /* No kvm support */
214 spe->auxtrace_type = auxtrace_info->type;
215 spe->pmu_type = auxtrace_info->priv[ARM_SPE_PMU_TYPE];
216
217 spe->auxtrace.process_event = arm_spe_process_event;
218 spe->auxtrace.process_auxtrace_event = arm_spe_process_auxtrace_event;
219 spe->auxtrace.flush_events = arm_spe_flush;
220 spe->auxtrace.free_events = arm_spe_free_events;
221 spe->auxtrace.free = arm_spe_free;
222 session->auxtrace = &spe->auxtrace;
223
224 arm_spe_print_info(&auxtrace_info->priv[0]);
225
226 return 0;
227
228err_free:
229 free(spe);
230 return err;
231}
diff --git a/tools/perf/util/arm-spe.h b/tools/perf/util/arm-spe.h
new file mode 100644
index 000000000000..98d3235781c3
--- /dev/null
+++ b/tools/perf/util/arm-spe.h
@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Arm Statistical Profiling Extensions (SPE) support
4 * Copyright (c) 2017-2018, Arm Ltd.
5 */
6
7#ifndef INCLUDE__PERF_ARM_SPE_H__
8#define INCLUDE__PERF_ARM_SPE_H__
9
10#define ARM_SPE_PMU_NAME "arm_spe_"
11
12enum {
13 ARM_SPE_PMU_TYPE,
14 ARM_SPE_PER_CPU_MMAPS,
15 ARM_SPE_AUXTRACE_PRIV_MAX,
16};
17
18#define ARM_SPE_AUXTRACE_PRIV_SIZE (ARM_SPE_AUXTRACE_PRIV_MAX * sizeof(u64))
19
20union perf_event;
21struct perf_session;
22struct perf_pmu;
23
24struct auxtrace_record *arm_spe_recording_init(int *err,
25 struct perf_pmu *arm_spe_pmu);
26
27int arm_spe_process_auxtrace_info(union perf_event *event,
28 struct perf_session *session);
29
30struct perf_event_attr *arm_spe_pmu_default_config(struct perf_pmu *arm_spe_pmu);
31#endif
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index a33491416400..9faf3b5367db 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -31,9 +31,6 @@
31#include <sys/param.h> 31#include <sys/param.h>
32#include <stdlib.h> 32#include <stdlib.h>
33#include <stdio.h> 33#include <stdio.h>
34#include <string.h>
35#include <limits.h>
36#include <errno.h>
37#include <linux/list.h> 34#include <linux/list.h>
38 35
39#include "../perf.h" 36#include "../perf.h"
@@ -55,8 +52,10 @@
55#include "debug.h" 52#include "debug.h"
56#include <subcmd/parse-options.h> 53#include <subcmd/parse-options.h>
57 54
55#include "cs-etm.h"
58#include "intel-pt.h" 56#include "intel-pt.h"
59#include "intel-bts.h" 57#include "intel-bts.h"
58#include "arm-spe.h"
60 59
61#include "sane_ctype.h" 60#include "sane_ctype.h"
62#include "symbol/kallsyms.h" 61#include "symbol/kallsyms.h"
@@ -913,7 +912,10 @@ int perf_event__process_auxtrace_info(struct perf_tool *tool __maybe_unused,
913 return intel_pt_process_auxtrace_info(event, session); 912 return intel_pt_process_auxtrace_info(event, session);
914 case PERF_AUXTRACE_INTEL_BTS: 913 case PERF_AUXTRACE_INTEL_BTS:
915 return intel_bts_process_auxtrace_info(event, session); 914 return intel_bts_process_auxtrace_info(event, session);
915 case PERF_AUXTRACE_ARM_SPE:
916 return arm_spe_process_auxtrace_info(event, session);
916 case PERF_AUXTRACE_CS_ETM: 917 case PERF_AUXTRACE_CS_ETM:
918 return cs_etm__process_auxtrace_info(event, session);
917 case PERF_AUXTRACE_UNKNOWN: 919 case PERF_AUXTRACE_UNKNOWN:
918 default: 920 default:
919 return -EINVAL; 921 return -EINVAL;
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index d19e11b68de7..453c148d2158 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -43,6 +43,7 @@ enum auxtrace_type {
43 PERF_AUXTRACE_INTEL_PT, 43 PERF_AUXTRACE_INTEL_PT,
44 PERF_AUXTRACE_INTEL_BTS, 44 PERF_AUXTRACE_INTEL_BTS,
45 PERF_AUXTRACE_CS_ETM, 45 PERF_AUXTRACE_CS_ETM,
46 PERF_AUXTRACE_ARM_SPE,
46}; 47};
47 48
48enum itrace_period_type { 49enum itrace_period_type {
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 72c107fcbc5a..af7ad814b2c3 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -94,7 +94,7 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source)
94 err = perf_clang__compile_bpf(filename, &obj_buf, &obj_buf_sz); 94 err = perf_clang__compile_bpf(filename, &obj_buf, &obj_buf_sz);
95 perf_clang__cleanup(); 95 perf_clang__cleanup();
96 if (err) { 96 if (err) {
97 pr_warning("bpf: builtin compilation failed: %d, try external compiler\n", err); 97 pr_debug("bpf: builtin compilation failed: %d, try external compiler\n", err);
98 err = llvm__compile_bpf(filename, &obj_buf, &obj_buf_sz); 98 err = llvm__compile_bpf(filename, &obj_buf, &obj_buf_sz);
99 if (err) 99 if (err)
100 return ERR_PTR(-BPF_LOADER_ERRNO__COMPILE); 100 return ERR_PTR(-BPF_LOADER_ERRNO__COMPILE);
@@ -1533,7 +1533,7 @@ int bpf__apply_obj_config(void)
1533 (strcmp("__bpf_stdout__", \ 1533 (strcmp("__bpf_stdout__", \
1534 bpf_map__name(pos)) == 0)) 1534 bpf_map__name(pos)) == 0))
1535 1535
1536int bpf__setup_stdout(struct perf_evlist *evlist __maybe_unused) 1536int bpf__setup_stdout(struct perf_evlist *evlist)
1537{ 1537{
1538 struct bpf_map_priv *tmpl_priv = NULL; 1538 struct bpf_map_priv *tmpl_priv = NULL;
1539 struct bpf_object *obj, *tmp; 1539 struct bpf_object *obj, *tmp;
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 082505d08d72..32ef7bdca1cf 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -37,6 +37,15 @@ struct callchain_param callchain_param = {
37 CALLCHAIN_PARAM_DEFAULT 37 CALLCHAIN_PARAM_DEFAULT
38}; 38};
39 39
40/*
41 * Are there any events usind DWARF callchains?
42 *
43 * I.e.
44 *
45 * -e cycles/call-graph=dwarf/
46 */
47bool dwarf_callchain_users;
48
40struct callchain_param callchain_param_default = { 49struct callchain_param callchain_param_default = {
41 CALLCHAIN_PARAM_DEFAULT 50 CALLCHAIN_PARAM_DEFAULT
42}; 51};
@@ -265,6 +274,7 @@ int parse_callchain_record(const char *arg, struct callchain_param *param)
265 ret = 0; 274 ret = 0;
266 param->record_mode = CALLCHAIN_DWARF; 275 param->record_mode = CALLCHAIN_DWARF;
267 param->dump_size = default_stack_dump_size; 276 param->dump_size = default_stack_dump_size;
277 dwarf_callchain_users = true;
268 278
269 tok = strtok_r(NULL, ",", &saveptr); 279 tok = strtok_r(NULL, ",", &saveptr);
270 if (tok) { 280 if (tok) {
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index b79ef2478a57..154560b1eb65 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -89,6 +89,8 @@ enum chain_value {
89 CCVAL_COUNT, 89 CCVAL_COUNT,
90}; 90};
91 91
92extern bool dwarf_callchain_users;
93
92struct callchain_param { 94struct callchain_param {
93 bool enabled; 95 bool enabled;
94 enum perf_call_graph_mode record_mode; 96 enum perf_call_graph_mode record_mode;
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index d9ffc1e6eb39..984f69144f87 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -6,6 +6,9 @@
6#include "cgroup.h" 6#include "cgroup.h"
7#include "evlist.h" 7#include "evlist.h"
8#include <linux/stringify.h> 8#include <linux/stringify.h>
9#include <sys/types.h>
10#include <sys/stat.h>
11#include <fcntl.h>
9 12
10int nr_cgroups; 13int nr_cgroups;
11 14
diff --git a/tools/perf/util/cs-etm-decoder/Build b/tools/perf/util/cs-etm-decoder/Build
new file mode 100644
index 000000000000..bc22c39c727f
--- /dev/null
+++ b/tools/perf/util/cs-etm-decoder/Build
@@ -0,0 +1 @@
libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
new file mode 100644
index 000000000000..1fb01849f1c7
--- /dev/null
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -0,0 +1,513 @@
1/*
2 * SPDX-License-Identifier: GPL-2.0
3 *
4 * Copyright(C) 2015-2018 Linaro Limited.
5 *
6 * Author: Tor Jeremiassen <tor@ti.com>
7 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
8 */
9
10#include <linux/err.h>
11#include <linux/list.h>
12#include <stdlib.h>
13#include <opencsd/c_api/opencsd_c_api.h>
14#include <opencsd/etmv4/trc_pkt_types_etmv4.h>
15#include <opencsd/ocsd_if_types.h>
16
17#include "cs-etm.h"
18#include "cs-etm-decoder.h"
19#include "intlist.h"
20#include "util.h"
21
22#define MAX_BUFFER 1024
23
24/* use raw logging */
25#ifdef CS_DEBUG_RAW
26#define CS_LOG_RAW_FRAMES
27#ifdef CS_RAW_PACKED
28#define CS_RAW_DEBUG_FLAGS (OCSD_DFRMTR_UNPACKED_RAW_OUT | \
29 OCSD_DFRMTR_PACKED_RAW_OUT)
30#else
31#define CS_RAW_DEBUG_FLAGS (OCSD_DFRMTR_UNPACKED_RAW_OUT)
32#endif
33#endif
34
35struct cs_etm_decoder {
36 void *data;
37 void (*packet_printer)(const char *msg);
38 bool trace_on;
39 dcd_tree_handle_t dcd_tree;
40 cs_etm_mem_cb_type mem_access;
41 ocsd_datapath_resp_t prev_return;
42 u32 packet_count;
43 u32 head;
44 u32 tail;
45 struct cs_etm_packet packet_buffer[MAX_BUFFER];
46};
47
48static u32
49cs_etm_decoder__mem_access(const void *context,
50 const ocsd_vaddr_t address,
51 const ocsd_mem_space_acc_t mem_space __maybe_unused,
52 const u32 req_size,
53 u8 *buffer)
54{
55 struct cs_etm_decoder *decoder = (struct cs_etm_decoder *) context;
56
57 return decoder->mem_access(decoder->data,
58 address,
59 req_size,
60 buffer);
61}
62
63int cs_etm_decoder__add_mem_access_cb(struct cs_etm_decoder *decoder,
64 u64 start, u64 end,
65 cs_etm_mem_cb_type cb_func)
66{
67 decoder->mem_access = cb_func;
68
69 if (ocsd_dt_add_callback_mem_acc(decoder->dcd_tree, start, end,
70 OCSD_MEM_SPACE_ANY,
71 cs_etm_decoder__mem_access, decoder))
72 return -1;
73
74 return 0;
75}
76
77int cs_etm_decoder__reset(struct cs_etm_decoder *decoder)
78{
79 ocsd_datapath_resp_t dp_ret;
80
81 dp_ret = ocsd_dt_process_data(decoder->dcd_tree, OCSD_OP_RESET,
82 0, 0, NULL, NULL);
83 if (OCSD_DATA_RESP_IS_FATAL(dp_ret))
84 return -1;
85
86 return 0;
87}
88
89int cs_etm_decoder__get_packet(struct cs_etm_decoder *decoder,
90 struct cs_etm_packet *packet)
91{
92 if (!decoder || !packet)
93 return -EINVAL;
94
95 /* Nothing to do, might as well just return */
96 if (decoder->packet_count == 0)
97 return 0;
98
99 *packet = decoder->packet_buffer[decoder->head];
100
101 decoder->head = (decoder->head + 1) & (MAX_BUFFER - 1);
102
103 decoder->packet_count--;
104
105 return 1;
106}
107
108static void cs_etm_decoder__gen_etmv4_config(struct cs_etm_trace_params *params,
109 ocsd_etmv4_cfg *config)
110{
111 config->reg_configr = params->etmv4.reg_configr;
112 config->reg_traceidr = params->etmv4.reg_traceidr;
113 config->reg_idr0 = params->etmv4.reg_idr0;
114 config->reg_idr1 = params->etmv4.reg_idr1;
115 config->reg_idr2 = params->etmv4.reg_idr2;
116 config->reg_idr8 = params->etmv4.reg_idr8;
117 config->reg_idr9 = 0;
118 config->reg_idr10 = 0;
119 config->reg_idr11 = 0;
120 config->reg_idr12 = 0;
121 config->reg_idr13 = 0;
122 config->arch_ver = ARCH_V8;
123 config->core_prof = profile_CortexA;
124}
125
126static void cs_etm_decoder__print_str_cb(const void *p_context,
127 const char *msg,
128 const int str_len)
129{
130 if (p_context && str_len)
131 ((struct cs_etm_decoder *)p_context)->packet_printer(msg);
132}
133
134static int
135cs_etm_decoder__init_def_logger_printing(struct cs_etm_decoder_params *d_params,
136 struct cs_etm_decoder *decoder)
137{
138 int ret = 0;
139
140 if (d_params->packet_printer == NULL)
141 return -1;
142
143 decoder->packet_printer = d_params->packet_printer;
144
145 /*
146 * Set up a library default logger to process any printers
147 * (packet/raw frame) we add later.
148 */
149 ret = ocsd_def_errlog_init(OCSD_ERR_SEV_ERROR, 1);
150 if (ret != 0)
151 return -1;
152
153 /* no stdout / err / file output */
154 ret = ocsd_def_errlog_config_output(C_API_MSGLOGOUT_FLG_NONE, NULL);
155 if (ret != 0)
156 return -1;
157
158 /*
159 * Set the string CB for the default logger, passes strings to
160 * perf print logger.
161 */
162 ret = ocsd_def_errlog_set_strprint_cb(decoder->dcd_tree,
163 (void *)decoder,
164 cs_etm_decoder__print_str_cb);
165 if (ret != 0)
166 ret = -1;
167
168 return 0;
169}
170
171#ifdef CS_LOG_RAW_FRAMES
172static void
173cs_etm_decoder__init_raw_frame_logging(struct cs_etm_decoder_params *d_params,
174 struct cs_etm_decoder *decoder)
175{
176 /* Only log these during a --dump operation */
177 if (d_params->operation == CS_ETM_OPERATION_PRINT) {
178 /* set up a library default logger to process the
179 * raw frame printer we add later
180 */
181 ocsd_def_errlog_init(OCSD_ERR_SEV_ERROR, 1);
182
183 /* no stdout / err / file output */
184 ocsd_def_errlog_config_output(C_API_MSGLOGOUT_FLG_NONE, NULL);
185
186 /* set the string CB for the default logger,
187 * passes strings to perf print logger.
188 */
189 ocsd_def_errlog_set_strprint_cb(decoder->dcd_tree,
190 (void *)decoder,
191 cs_etm_decoder__print_str_cb);
192
193 /* use the built in library printer for the raw frames */
194 ocsd_dt_set_raw_frame_printer(decoder->dcd_tree,
195 CS_RAW_DEBUG_FLAGS);
196 }
197}
198#else
199static void
200cs_etm_decoder__init_raw_frame_logging(
201 struct cs_etm_decoder_params *d_params __maybe_unused,
202 struct cs_etm_decoder *decoder __maybe_unused)
203{
204}
205#endif
206
207static int cs_etm_decoder__create_packet_printer(struct cs_etm_decoder *decoder,
208 const char *decoder_name,
209 void *trace_config)
210{
211 u8 csid;
212
213 if (ocsd_dt_create_decoder(decoder->dcd_tree, decoder_name,
214 OCSD_CREATE_FLG_PACKET_PROC,
215 trace_config, &csid))
216 return -1;
217
218 if (ocsd_dt_set_pkt_protocol_printer(decoder->dcd_tree, csid, 0))
219 return -1;
220
221 return 0;
222}
223
224static int
225cs_etm_decoder__create_etm_packet_printer(struct cs_etm_trace_params *t_params,
226 struct cs_etm_decoder *decoder)
227{
228 const char *decoder_name;
229 ocsd_etmv4_cfg trace_config_etmv4;
230 void *trace_config;
231
232 switch (t_params->protocol) {
233 case CS_ETM_PROTO_ETMV4i:
234 cs_etm_decoder__gen_etmv4_config(t_params, &trace_config_etmv4);
235 decoder_name = OCSD_BUILTIN_DCD_ETMV4I;
236 trace_config = &trace_config_etmv4;
237 break;
238 default:
239 return -1;
240 }
241
242 return cs_etm_decoder__create_packet_printer(decoder,
243 decoder_name,
244 trace_config);
245}
246
247static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder)
248{
249 int i;
250
251 decoder->head = 0;
252 decoder->tail = 0;
253 decoder->packet_count = 0;
254 for (i = 0; i < MAX_BUFFER; i++) {
255 decoder->packet_buffer[i].start_addr = 0xdeadbeefdeadbeefUL;
256 decoder->packet_buffer[i].end_addr = 0xdeadbeefdeadbeefUL;
257 decoder->packet_buffer[i].exc = false;
258 decoder->packet_buffer[i].exc_ret = false;
259 decoder->packet_buffer[i].cpu = INT_MIN;
260 }
261}
262
263static ocsd_datapath_resp_t
264cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder,
265 const ocsd_generic_trace_elem *elem,
266 const u8 trace_chan_id,
267 enum cs_etm_sample_type sample_type)
268{
269 u32 et = 0;
270 struct int_node *inode = NULL;
271
272 if (decoder->packet_count >= MAX_BUFFER - 1)
273 return OCSD_RESP_FATAL_SYS_ERR;
274
275 /* Search the RB tree for the cpu associated with this traceID */
276 inode = intlist__find(traceid_list, trace_chan_id);
277 if (!inode)
278 return OCSD_RESP_FATAL_SYS_ERR;
279
280 et = decoder->tail;
281 decoder->packet_buffer[et].sample_type = sample_type;
282 decoder->packet_buffer[et].start_addr = elem->st_addr;
283 decoder->packet_buffer[et].end_addr = elem->en_addr;
284 decoder->packet_buffer[et].exc = false;
285 decoder->packet_buffer[et].exc_ret = false;
286 decoder->packet_buffer[et].cpu = *((int *)inode->priv);
287
288 /* Wrap around if need be */
289 et = (et + 1) & (MAX_BUFFER - 1);
290
291 decoder->tail = et;
292 decoder->packet_count++;
293
294 if (decoder->packet_count == MAX_BUFFER - 1)
295 return OCSD_RESP_WAIT;
296
297 return OCSD_RESP_CONT;
298}
299
300static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
301 const void *context,
302 const ocsd_trc_index_t indx __maybe_unused,
303 const u8 trace_chan_id __maybe_unused,
304 const ocsd_generic_trace_elem *elem)
305{
306 ocsd_datapath_resp_t resp = OCSD_RESP_CONT;
307 struct cs_etm_decoder *decoder = (struct cs_etm_decoder *) context;
308
309 switch (elem->elem_type) {
310 case OCSD_GEN_TRC_ELEM_UNKNOWN:
311 break;
312 case OCSD_GEN_TRC_ELEM_NO_SYNC:
313 decoder->trace_on = false;
314 break;
315 case OCSD_GEN_TRC_ELEM_TRACE_ON:
316 decoder->trace_on = true;
317 break;
318 case OCSD_GEN_TRC_ELEM_INSTR_RANGE:
319 resp = cs_etm_decoder__buffer_packet(decoder, elem,
320 trace_chan_id,
321 CS_ETM_RANGE);
322 break;
323 case OCSD_GEN_TRC_ELEM_EXCEPTION:
324 decoder->packet_buffer[decoder->tail].exc = true;
325 break;
326 case OCSD_GEN_TRC_ELEM_EXCEPTION_RET:
327 decoder->packet_buffer[decoder->tail].exc_ret = true;
328 break;
329 case OCSD_GEN_TRC_ELEM_PE_CONTEXT:
330 case OCSD_GEN_TRC_ELEM_EO_TRACE:
331 case OCSD_GEN_TRC_ELEM_ADDR_NACC:
332 case OCSD_GEN_TRC_ELEM_TIMESTAMP:
333 case OCSD_GEN_TRC_ELEM_CYCLE_COUNT:
334 case OCSD_GEN_TRC_ELEM_ADDR_UNKNOWN:
335 case OCSD_GEN_TRC_ELEM_EVENT:
336 case OCSD_GEN_TRC_ELEM_SWTRACE:
337 case OCSD_GEN_TRC_ELEM_CUSTOM:
338 default:
339 break;
340 }
341
342 return resp;
343}
344
345static int cs_etm_decoder__create_etm_packet_decoder(
346 struct cs_etm_trace_params *t_params,
347 struct cs_etm_decoder *decoder)
348{
349 const char *decoder_name;
350 ocsd_etmv4_cfg trace_config_etmv4;
351 void *trace_config;
352 u8 csid;
353
354 switch (t_params->protocol) {
355 case CS_ETM_PROTO_ETMV4i:
356 cs_etm_decoder__gen_etmv4_config(t_params, &trace_config_etmv4);
357 decoder_name = OCSD_BUILTIN_DCD_ETMV4I;
358 trace_config = &trace_config_etmv4;
359 break;
360 default:
361 return -1;
362 }
363
364 if (ocsd_dt_create_decoder(decoder->dcd_tree,
365 decoder_name,
366 OCSD_CREATE_FLG_FULL_DECODER,
367 trace_config, &csid))
368 return -1;
369
370 if (ocsd_dt_set_gen_elem_outfn(decoder->dcd_tree,
371 cs_etm_decoder__gen_trace_elem_printer,
372 decoder))
373 return -1;
374
375 return 0;
376}
377
378static int
379cs_etm_decoder__create_etm_decoder(struct cs_etm_decoder_params *d_params,
380 struct cs_etm_trace_params *t_params,
381 struct cs_etm_decoder *decoder)
382{
383 if (d_params->operation == CS_ETM_OPERATION_PRINT)
384 return cs_etm_decoder__create_etm_packet_printer(t_params,
385 decoder);
386 else if (d_params->operation == CS_ETM_OPERATION_DECODE)
387 return cs_etm_decoder__create_etm_packet_decoder(t_params,
388 decoder);
389
390 return -1;
391}
392
393struct cs_etm_decoder *
394cs_etm_decoder__new(int num_cpu, struct cs_etm_decoder_params *d_params,
395 struct cs_etm_trace_params t_params[])
396{
397 struct cs_etm_decoder *decoder;
398 ocsd_dcd_tree_src_t format;
399 u32 flags;
400 int i, ret;
401
402 if ((!t_params) || (!d_params))
403 return NULL;
404
405 decoder = zalloc(sizeof(*decoder));
406
407 if (!decoder)
408 return NULL;
409
410 decoder->data = d_params->data;
411 decoder->prev_return = OCSD_RESP_CONT;
412 cs_etm_decoder__clear_buffer(decoder);
413 format = (d_params->formatted ? OCSD_TRC_SRC_FRAME_FORMATTED :
414 OCSD_TRC_SRC_SINGLE);
415 flags = 0;
416 flags |= (d_params->fsyncs ? OCSD_DFRMTR_HAS_FSYNCS : 0);
417 flags |= (d_params->hsyncs ? OCSD_DFRMTR_HAS_HSYNCS : 0);
418 flags |= (d_params->frame_aligned ? OCSD_DFRMTR_FRAME_MEM_ALIGN : 0);
419
420 /*
421 * Drivers may add barrier frames when used with perf, set up to
422 * handle this. Barriers const of FSYNC packet repeated 4 times.
423 */
424 flags |= OCSD_DFRMTR_RESET_ON_4X_FSYNC;
425
426 /* Create decode tree for the data source */
427 decoder->dcd_tree = ocsd_create_dcd_tree(format, flags);
428
429 if (decoder->dcd_tree == 0)
430 goto err_free_decoder;
431
432 /* init library print logging support */
433 ret = cs_etm_decoder__init_def_logger_printing(d_params, decoder);
434 if (ret != 0)
435 goto err_free_decoder_tree;
436
437 /* init raw frame logging if required */
438 cs_etm_decoder__init_raw_frame_logging(d_params, decoder);
439
440 for (i = 0; i < num_cpu; i++) {
441 ret = cs_etm_decoder__create_etm_decoder(d_params,
442 &t_params[i],
443 decoder);
444 if (ret != 0)
445 goto err_free_decoder_tree;
446 }
447
448 return decoder;
449
450err_free_decoder_tree:
451 ocsd_destroy_dcd_tree(decoder->dcd_tree);
452err_free_decoder:
453 free(decoder);
454 return NULL;
455}
456
457int cs_etm_decoder__process_data_block(struct cs_etm_decoder *decoder,
458 u64 indx, const u8 *buf,
459 size_t len, size_t *consumed)
460{
461 int ret = 0;
462 ocsd_datapath_resp_t cur = OCSD_RESP_CONT;
463 ocsd_datapath_resp_t prev_return = decoder->prev_return;
464 size_t processed = 0;
465 u32 count;
466
467 while (processed < len) {
468 if (OCSD_DATA_RESP_IS_WAIT(prev_return)) {
469 cur = ocsd_dt_process_data(decoder->dcd_tree,
470 OCSD_OP_FLUSH,
471 0,
472 0,
473 NULL,
474 NULL);
475 } else if (OCSD_DATA_RESP_IS_CONT(prev_return)) {
476 cur = ocsd_dt_process_data(decoder->dcd_tree,
477 OCSD_OP_DATA,
478 indx + processed,
479 len - processed,
480 &buf[processed],
481 &count);
482 processed += count;
483 } else {
484 ret = -EINVAL;
485 break;
486 }
487
488 /*
489 * Return to the input code if the packet buffer is full.
490 * Flushing will get done once the packet buffer has been
491 * processed.
492 */
493 if (OCSD_DATA_RESP_IS_WAIT(cur))
494 break;
495
496 prev_return = cur;
497 }
498
499 decoder->prev_return = cur;
500 *consumed = processed;
501
502 return ret;
503}
504
505void cs_etm_decoder__free(struct cs_etm_decoder *decoder)
506{
507 if (!decoder)
508 return;
509
510 ocsd_destroy_dcd_tree(decoder->dcd_tree);
511 decoder->dcd_tree = NULL;
512 free(decoder);
513}
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
new file mode 100644
index 000000000000..3d2e6205d186
--- /dev/null
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
@@ -0,0 +1,105 @@
1/*
2 * SPDX-License-Identifier: GPL-2.0
3 *
4 * Copyright(C) 2015-2018 Linaro Limited.
5 *
6 * Author: Tor Jeremiassen <tor@ti.com>
7 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
8 */
9
10#ifndef INCLUDE__CS_ETM_DECODER_H__
11#define INCLUDE__CS_ETM_DECODER_H__
12
13#include <linux/types.h>
14#include <stdio.h>
15
16struct cs_etm_decoder;
17
18struct cs_etm_buffer {
19 const unsigned char *buf;
20 size_t len;
21 u64 offset;
22 u64 ref_timestamp;
23};
24
25enum cs_etm_sample_type {
26 CS_ETM_RANGE = 1 << 0,
27};
28
29struct cs_etm_packet {
30 enum cs_etm_sample_type sample_type;
31 u64 start_addr;
32 u64 end_addr;
33 u8 exc;
34 u8 exc_ret;
35 int cpu;
36};
37
38struct cs_etm_queue;
39
40typedef u32 (*cs_etm_mem_cb_type)(struct cs_etm_queue *, u64,
41 size_t, u8 *);
42
43struct cs_etmv4_trace_params {
44 u32 reg_idr0;
45 u32 reg_idr1;
46 u32 reg_idr2;
47 u32 reg_idr8;
48 u32 reg_configr;
49 u32 reg_traceidr;
50};
51
52struct cs_etm_trace_params {
53 int protocol;
54 union {
55 struct cs_etmv4_trace_params etmv4;
56 };
57};
58
59struct cs_etm_decoder_params {
60 int operation;
61 void (*packet_printer)(const char *msg);
62 cs_etm_mem_cb_type mem_acc_cb;
63 u8 formatted;
64 u8 fsyncs;
65 u8 hsyncs;
66 u8 frame_aligned;
67 void *data;
68};
69
70/*
71 * The following enums are indexed starting with 1 to align with the
72 * open source coresight trace decoder library.
73 */
74enum {
75 CS_ETM_PROTO_ETMV3 = 1,
76 CS_ETM_PROTO_ETMV4i,
77 CS_ETM_PROTO_ETMV4d,
78};
79
80enum {
81 CS_ETM_OPERATION_PRINT = 1,
82 CS_ETM_OPERATION_DECODE,
83};
84
85int cs_etm_decoder__process_data_block(struct cs_etm_decoder *decoder,
86 u64 indx, const u8 *buf,
87 size_t len, size_t *consumed);
88
89struct cs_etm_decoder *
90cs_etm_decoder__new(int num_cpu,
91 struct cs_etm_decoder_params *d_params,
92 struct cs_etm_trace_params t_params[]);
93
94void cs_etm_decoder__free(struct cs_etm_decoder *decoder);
95
96int cs_etm_decoder__add_mem_access_cb(struct cs_etm_decoder *decoder,
97 u64 start, u64 end,
98 cs_etm_mem_cb_type cb_func);
99
100int cs_etm_decoder__get_packet(struct cs_etm_decoder *decoder,
101 struct cs_etm_packet *packet);
102
103int cs_etm_decoder__reset(struct cs_etm_decoder *decoder);
104
105#endif /* INCLUDE__CS_ETM_DECODER_H__ */
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
new file mode 100644
index 000000000000..b9f0a53dfa65
--- /dev/null
+++ b/tools/perf/util/cs-etm.c
@@ -0,0 +1,1023 @@
1/*
2 * SPDX-License-Identifier: GPL-2.0
3 *
4 * Copyright(C) 2015-2018 Linaro Limited.
5 *
6 * Author: Tor Jeremiassen <tor@ti.com>
7 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
8 */
9
10#include <linux/bitops.h>
11#include <linux/err.h>
12#include <linux/kernel.h>
13#include <linux/log2.h>
14#include <linux/types.h>
15
16#include <stdlib.h>
17
18#include "auxtrace.h"
19#include "color.h"
20#include "cs-etm.h"
21#include "cs-etm-decoder/cs-etm-decoder.h"
22#include "debug.h"
23#include "evlist.h"
24#include "intlist.h"
25#include "machine.h"
26#include "map.h"
27#include "perf.h"
28#include "thread.h"
29#include "thread_map.h"
30#include "thread-stack.h"
31#include "util.h"
32
33#define MAX_TIMESTAMP (~0ULL)
34
35struct cs_etm_auxtrace {
36 struct auxtrace auxtrace;
37 struct auxtrace_queues queues;
38 struct auxtrace_heap heap;
39 struct itrace_synth_opts synth_opts;
40 struct perf_session *session;
41 struct machine *machine;
42 struct thread *unknown_thread;
43
44 u8 timeless_decoding;
45 u8 snapshot_mode;
46 u8 data_queued;
47 u8 sample_branches;
48
49 int num_cpu;
50 u32 auxtrace_type;
51 u64 branches_sample_type;
52 u64 branches_id;
53 u64 **metadata;
54 u64 kernel_start;
55 unsigned int pmu_type;
56};
57
58struct cs_etm_queue {
59 struct cs_etm_auxtrace *etm;
60 struct thread *thread;
61 struct cs_etm_decoder *decoder;
62 struct auxtrace_buffer *buffer;
63 const struct cs_etm_state *state;
64 union perf_event *event_buf;
65 unsigned int queue_nr;
66 pid_t pid, tid;
67 int cpu;
68 u64 time;
69 u64 timestamp;
70 u64 offset;
71};
72
73static int cs_etm__update_queues(struct cs_etm_auxtrace *etm);
74static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
75 pid_t tid, u64 time_);
76
77static void cs_etm__packet_dump(const char *pkt_string)
78{
79 const char *color = PERF_COLOR_BLUE;
80 int len = strlen(pkt_string);
81
82 if (len && (pkt_string[len-1] == '\n'))
83 color_fprintf(stdout, color, " %s", pkt_string);
84 else
85 color_fprintf(stdout, color, " %s\n", pkt_string);
86
87 fflush(stdout);
88}
89
90static void cs_etm__dump_event(struct cs_etm_auxtrace *etm,
91 struct auxtrace_buffer *buffer)
92{
93 int i, ret;
94 const char *color = PERF_COLOR_BLUE;
95 struct cs_etm_decoder_params d_params;
96 struct cs_etm_trace_params *t_params;
97 struct cs_etm_decoder *decoder;
98 size_t buffer_used = 0;
99
100 fprintf(stdout, "\n");
101 color_fprintf(stdout, color,
102 ". ... CoreSight ETM Trace data: size %zu bytes\n",
103 buffer->size);
104
105 /* Use metadata to fill in trace parameters for trace decoder */
106 t_params = zalloc(sizeof(*t_params) * etm->num_cpu);
107 for (i = 0; i < etm->num_cpu; i++) {
108 t_params[i].protocol = CS_ETM_PROTO_ETMV4i;
109 t_params[i].etmv4.reg_idr0 = etm->metadata[i][CS_ETMV4_TRCIDR0];
110 t_params[i].etmv4.reg_idr1 = etm->metadata[i][CS_ETMV4_TRCIDR1];
111 t_params[i].etmv4.reg_idr2 = etm->metadata[i][CS_ETMV4_TRCIDR2];
112 t_params[i].etmv4.reg_idr8 = etm->metadata[i][CS_ETMV4_TRCIDR8];
113 t_params[i].etmv4.reg_configr =
114 etm->metadata[i][CS_ETMV4_TRCCONFIGR];
115 t_params[i].etmv4.reg_traceidr =
116 etm->metadata[i][CS_ETMV4_TRCTRACEIDR];
117 }
118
119 /* Set decoder parameters to simply print the trace packets */
120 d_params.packet_printer = cs_etm__packet_dump;
121 d_params.operation = CS_ETM_OPERATION_PRINT;
122 d_params.formatted = true;
123 d_params.fsyncs = false;
124 d_params.hsyncs = false;
125 d_params.frame_aligned = true;
126
127 decoder = cs_etm_decoder__new(etm->num_cpu, &d_params, t_params);
128
129 zfree(&t_params);
130
131 if (!decoder)
132 return;
133 do {
134 size_t consumed;
135
136 ret = cs_etm_decoder__process_data_block(
137 decoder, buffer->offset,
138 &((u8 *)buffer->data)[buffer_used],
139 buffer->size - buffer_used, &consumed);
140 if (ret)
141 break;
142
143 buffer_used += consumed;
144 } while (buffer_used < buffer->size);
145
146 cs_etm_decoder__free(decoder);
147}
148
149static int cs_etm__flush_events(struct perf_session *session,
150 struct perf_tool *tool)
151{
152 int ret;
153 struct cs_etm_auxtrace *etm = container_of(session->auxtrace,
154 struct cs_etm_auxtrace,
155 auxtrace);
156 if (dump_trace)
157 return 0;
158
159 if (!tool->ordered_events)
160 return -EINVAL;
161
162 if (!etm->timeless_decoding)
163 return -EINVAL;
164
165 ret = cs_etm__update_queues(etm);
166
167 if (ret < 0)
168 return ret;
169
170 return cs_etm__process_timeless_queues(etm, -1, MAX_TIMESTAMP - 1);
171}
172
173static void cs_etm__free_queue(void *priv)
174{
175 struct cs_etm_queue *etmq = priv;
176
177 free(etmq);
178}
179
180static void cs_etm__free_events(struct perf_session *session)
181{
182 unsigned int i;
183 struct cs_etm_auxtrace *aux = container_of(session->auxtrace,
184 struct cs_etm_auxtrace,
185 auxtrace);
186 struct auxtrace_queues *queues = &aux->queues;
187
188 for (i = 0; i < queues->nr_queues; i++) {
189 cs_etm__free_queue(queues->queue_array[i].priv);
190 queues->queue_array[i].priv = NULL;
191 }
192
193 auxtrace_queues__free(queues);
194}
195
196static void cs_etm__free(struct perf_session *session)
197{
198 int i;
199 struct int_node *inode, *tmp;
200 struct cs_etm_auxtrace *aux = container_of(session->auxtrace,
201 struct cs_etm_auxtrace,
202 auxtrace);
203 cs_etm__free_events(session);
204 session->auxtrace = NULL;
205
206 /* First remove all traceID/CPU# nodes for the RB tree */
207 intlist__for_each_entry_safe(inode, tmp, traceid_list)
208 intlist__remove(traceid_list, inode);
209 /* Then the RB tree itself */
210 intlist__delete(traceid_list);
211
212 for (i = 0; i < aux->num_cpu; i++)
213 zfree(&aux->metadata[i]);
214
215 zfree(&aux->metadata);
216 zfree(&aux);
217}
218
219static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u64 address,
220 size_t size, u8 *buffer)
221{
222 u8 cpumode;
223 u64 offset;
224 int len;
225 struct thread *thread;
226 struct machine *machine;
227 struct addr_location al;
228
229 if (!etmq)
230 return -1;
231
232 machine = etmq->etm->machine;
233 if (address >= etmq->etm->kernel_start)
234 cpumode = PERF_RECORD_MISC_KERNEL;
235 else
236 cpumode = PERF_RECORD_MISC_USER;
237
238 thread = etmq->thread;
239 if (!thread) {
240 if (cpumode != PERF_RECORD_MISC_KERNEL)
241 return -EINVAL;
242 thread = etmq->etm->unknown_thread;
243 }
244
245 thread__find_addr_map(thread, cpumode, MAP__FUNCTION, address, &al);
246
247 if (!al.map || !al.map->dso)
248 return 0;
249
250 if (al.map->dso->data.status == DSO_DATA_STATUS_ERROR &&
251 dso__data_status_seen(al.map->dso, DSO_DATA_STATUS_SEEN_ITRACE))
252 return 0;
253
254 offset = al.map->map_ip(al.map, address);
255
256 map__load(al.map);
257
258 len = dso__data_read_offset(al.map->dso, machine, offset, buffer, size);
259
260 if (len <= 0)
261 return 0;
262
263 return len;
264}
265
266static struct cs_etm_queue *cs_etm__alloc_queue(struct cs_etm_auxtrace *etm,
267 unsigned int queue_nr)
268{
269 int i;
270 struct cs_etm_decoder_params d_params;
271 struct cs_etm_trace_params *t_params;
272 struct cs_etm_queue *etmq;
273
274 etmq = zalloc(sizeof(*etmq));
275 if (!etmq)
276 return NULL;
277
278 etmq->event_buf = malloc(PERF_SAMPLE_MAX_SIZE);
279 if (!etmq->event_buf)
280 goto out_free;
281
282 etmq->etm = etm;
283 etmq->queue_nr = queue_nr;
284 etmq->pid = -1;
285 etmq->tid = -1;
286 etmq->cpu = -1;
287
288 /* Use metadata to fill in trace parameters for trace decoder */
289 t_params = zalloc(sizeof(*t_params) * etm->num_cpu);
290
291 if (!t_params)
292 goto out_free;
293
294 for (i = 0; i < etm->num_cpu; i++) {
295 t_params[i].protocol = CS_ETM_PROTO_ETMV4i;
296 t_params[i].etmv4.reg_idr0 = etm->metadata[i][CS_ETMV4_TRCIDR0];
297 t_params[i].etmv4.reg_idr1 = etm->metadata[i][CS_ETMV4_TRCIDR1];
298 t_params[i].etmv4.reg_idr2 = etm->metadata[i][CS_ETMV4_TRCIDR2];
299 t_params[i].etmv4.reg_idr8 = etm->metadata[i][CS_ETMV4_TRCIDR8];
300 t_params[i].etmv4.reg_configr =
301 etm->metadata[i][CS_ETMV4_TRCCONFIGR];
302 t_params[i].etmv4.reg_traceidr =
303 etm->metadata[i][CS_ETMV4_TRCTRACEIDR];
304 }
305
306 /* Set decoder parameters to simply print the trace packets */
307 d_params.packet_printer = cs_etm__packet_dump;
308 d_params.operation = CS_ETM_OPERATION_DECODE;
309 d_params.formatted = true;
310 d_params.fsyncs = false;
311 d_params.hsyncs = false;
312 d_params.frame_aligned = true;
313 d_params.data = etmq;
314
315 etmq->decoder = cs_etm_decoder__new(etm->num_cpu, &d_params, t_params);
316
317 zfree(&t_params);
318
319 if (!etmq->decoder)
320 goto out_free;
321
322 /*
323 * Register a function to handle all memory accesses required by
324 * the trace decoder library.
325 */
326 if (cs_etm_decoder__add_mem_access_cb(etmq->decoder,
327 0x0L, ((u64) -1L),
328 cs_etm__mem_access))
329 goto out_free_decoder;
330
331 etmq->offset = 0;
332
333 return etmq;
334
335out_free_decoder:
336 cs_etm_decoder__free(etmq->decoder);
337out_free:
338 zfree(&etmq->event_buf);
339 free(etmq);
340
341 return NULL;
342}
343
344static int cs_etm__setup_queue(struct cs_etm_auxtrace *etm,
345 struct auxtrace_queue *queue,
346 unsigned int queue_nr)
347{
348 struct cs_etm_queue *etmq = queue->priv;
349
350 if (list_empty(&queue->head) || etmq)
351 return 0;
352
353 etmq = cs_etm__alloc_queue(etm, queue_nr);
354
355 if (!etmq)
356 return -ENOMEM;
357
358 queue->priv = etmq;
359
360 if (queue->cpu != -1)
361 etmq->cpu = queue->cpu;
362
363 etmq->tid = queue->tid;
364
365 return 0;
366}
367
368static int cs_etm__setup_queues(struct cs_etm_auxtrace *etm)
369{
370 unsigned int i;
371 int ret;
372
373 for (i = 0; i < etm->queues.nr_queues; i++) {
374 ret = cs_etm__setup_queue(etm, &etm->queues.queue_array[i], i);
375 if (ret)
376 return ret;
377 }
378
379 return 0;
380}
381
382static int cs_etm__update_queues(struct cs_etm_auxtrace *etm)
383{
384 if (etm->queues.new_data) {
385 etm->queues.new_data = false;
386 return cs_etm__setup_queues(etm);
387 }
388
389 return 0;
390}
391
392static int
393cs_etm__get_trace(struct cs_etm_buffer *buff, struct cs_etm_queue *etmq)
394{
395 struct auxtrace_buffer *aux_buffer = etmq->buffer;
396 struct auxtrace_buffer *old_buffer = aux_buffer;
397 struct auxtrace_queue *queue;
398
399 queue = &etmq->etm->queues.queue_array[etmq->queue_nr];
400
401 aux_buffer = auxtrace_buffer__next(queue, aux_buffer);
402
403 /* If no more data, drop the previous auxtrace_buffer and return */
404 if (!aux_buffer) {
405 if (old_buffer)
406 auxtrace_buffer__drop_data(old_buffer);
407 buff->len = 0;
408 return 0;
409 }
410
411 etmq->buffer = aux_buffer;
412
413 /* If the aux_buffer doesn't have data associated, try to load it */
414 if (!aux_buffer->data) {
415 /* get the file desc associated with the perf data file */
416 int fd = perf_data__fd(etmq->etm->session->data);
417
418 aux_buffer->data = auxtrace_buffer__get_data(aux_buffer, fd);
419 if (!aux_buffer->data)
420 return -ENOMEM;
421 }
422
423 /* If valid, drop the previous buffer */
424 if (old_buffer)
425 auxtrace_buffer__drop_data(old_buffer);
426
427 buff->offset = aux_buffer->offset;
428 buff->len = aux_buffer->size;
429 buff->buf = aux_buffer->data;
430
431 buff->ref_timestamp = aux_buffer->reference;
432
433 return buff->len;
434}
435
436static void cs_etm__set_pid_tid_cpu(struct cs_etm_auxtrace *etm,
437 struct auxtrace_queue *queue)
438{
439 struct cs_etm_queue *etmq = queue->priv;
440
441 /* CPU-wide tracing isn't supported yet */
442 if (queue->tid == -1)
443 return;
444
445 if ((!etmq->thread) && (etmq->tid != -1))
446 etmq->thread = machine__find_thread(etm->machine, -1,
447 etmq->tid);
448
449 if (etmq->thread) {
450 etmq->pid = etmq->thread->pid_;
451 if (queue->cpu == -1)
452 etmq->cpu = etmq->thread->cpu;
453 }
454}
455
456/*
457 * The cs etm packet encodes an instruction range between a branch target
458 * and the next taken branch. Generate sample accordingly.
459 */
460static int cs_etm__synth_branch_sample(struct cs_etm_queue *etmq,
461 struct cs_etm_packet *packet)
462{
463 int ret = 0;
464 struct cs_etm_auxtrace *etm = etmq->etm;
465 struct perf_sample sample = {.ip = 0,};
466 union perf_event *event = etmq->event_buf;
467 u64 start_addr = packet->start_addr;
468 u64 end_addr = packet->end_addr;
469
470 event->sample.header.type = PERF_RECORD_SAMPLE;
471 event->sample.header.misc = PERF_RECORD_MISC_USER;
472 event->sample.header.size = sizeof(struct perf_event_header);
473
474 sample.ip = start_addr;
475 sample.pid = etmq->pid;
476 sample.tid = etmq->tid;
477 sample.addr = end_addr;
478 sample.id = etmq->etm->branches_id;
479 sample.stream_id = etmq->etm->branches_id;
480 sample.period = 1;
481 sample.cpu = packet->cpu;
482 sample.flags = 0;
483 sample.cpumode = PERF_RECORD_MISC_USER;
484
485 ret = perf_session__deliver_synth_event(etm->session, event, &sample);
486
487 if (ret)
488 pr_err(
489 "CS ETM Trace: failed to deliver instruction event, error %d\n",
490 ret);
491
492 return ret;
493}
494
495struct cs_etm_synth {
496 struct perf_tool dummy_tool;
497 struct perf_session *session;
498};
499
500static int cs_etm__event_synth(struct perf_tool *tool,
501 union perf_event *event,
502 struct perf_sample *sample __maybe_unused,
503 struct machine *machine __maybe_unused)
504{
505 struct cs_etm_synth *cs_etm_synth =
506 container_of(tool, struct cs_etm_synth, dummy_tool);
507
508 return perf_session__deliver_synth_event(cs_etm_synth->session,
509 event, NULL);
510}
511
512static int cs_etm__synth_event(struct perf_session *session,
513 struct perf_event_attr *attr, u64 id)
514{
515 struct cs_etm_synth cs_etm_synth;
516
517 memset(&cs_etm_synth, 0, sizeof(struct cs_etm_synth));
518 cs_etm_synth.session = session;
519
520 return perf_event__synthesize_attr(&cs_etm_synth.dummy_tool, attr, 1,
521 &id, cs_etm__event_synth);
522}
523
524static int cs_etm__synth_events(struct cs_etm_auxtrace *etm,
525 struct perf_session *session)
526{
527 struct perf_evlist *evlist = session->evlist;
528 struct perf_evsel *evsel;
529 struct perf_event_attr attr;
530 bool found = false;
531 u64 id;
532 int err;
533
534 evlist__for_each_entry(evlist, evsel) {
535 if (evsel->attr.type == etm->pmu_type) {
536 found = true;
537 break;
538 }
539 }
540
541 if (!found) {
542 pr_debug("No selected events with CoreSight Trace data\n");
543 return 0;
544 }
545
546 memset(&attr, 0, sizeof(struct perf_event_attr));
547 attr.size = sizeof(struct perf_event_attr);
548 attr.type = PERF_TYPE_HARDWARE;
549 attr.sample_type = evsel->attr.sample_type & PERF_SAMPLE_MASK;
550 attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
551 PERF_SAMPLE_PERIOD;
552 if (etm->timeless_decoding)
553 attr.sample_type &= ~(u64)PERF_SAMPLE_TIME;
554 else
555 attr.sample_type |= PERF_SAMPLE_TIME;
556
557 attr.exclude_user = evsel->attr.exclude_user;
558 attr.exclude_kernel = evsel->attr.exclude_kernel;
559 attr.exclude_hv = evsel->attr.exclude_hv;
560 attr.exclude_host = evsel->attr.exclude_host;
561 attr.exclude_guest = evsel->attr.exclude_guest;
562 attr.sample_id_all = evsel->attr.sample_id_all;
563 attr.read_format = evsel->attr.read_format;
564
565 /* create new id val to be a fixed offset from evsel id */
566 id = evsel->id[0] + 1000000000;
567
568 if (!id)
569 id = 1;
570
571 if (etm->synth_opts.branches) {
572 attr.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
573 attr.sample_period = 1;
574 attr.sample_type |= PERF_SAMPLE_ADDR;
575 err = cs_etm__synth_event(session, &attr, id);
576 if (err)
577 return err;
578 etm->sample_branches = true;
579 etm->branches_sample_type = attr.sample_type;
580 etm->branches_id = id;
581 }
582
583 return 0;
584}
585
586static int cs_etm__sample(struct cs_etm_queue *etmq)
587{
588 int ret;
589 struct cs_etm_packet packet;
590
591 while (1) {
592 ret = cs_etm_decoder__get_packet(etmq->decoder, &packet);
593 if (ret <= 0)
594 return ret;
595
596 /*
597 * If the packet contains an instruction range, generate an
598 * instruction sequence event.
599 */
600 if (packet.sample_type & CS_ETM_RANGE)
601 cs_etm__synth_branch_sample(etmq, &packet);
602 }
603
604 return 0;
605}
606
607static int cs_etm__run_decoder(struct cs_etm_queue *etmq)
608{
609 struct cs_etm_auxtrace *etm = etmq->etm;
610 struct cs_etm_buffer buffer;
611 size_t buffer_used, processed;
612 int err = 0;
613
614 if (!etm->kernel_start)
615 etm->kernel_start = machine__kernel_start(etm->machine);
616
617 /* Go through each buffer in the queue and decode them one by one */
618more:
619 buffer_used = 0;
620 memset(&buffer, 0, sizeof(buffer));
621 err = cs_etm__get_trace(&buffer, etmq);
622 if (err <= 0)
623 return err;
624 /*
625 * We cannot assume consecutive blocks in the data file are contiguous,
626 * reset the decoder to force re-sync.
627 */
628 err = cs_etm_decoder__reset(etmq->decoder);
629 if (err != 0)
630 return err;
631
632 /* Run trace decoder until buffer consumed or end of trace */
633 do {
634 processed = 0;
635
636 err = cs_etm_decoder__process_data_block(
637 etmq->decoder,
638 etmq->offset,
639 &buffer.buf[buffer_used],
640 buffer.len - buffer_used,
641 &processed);
642
643 if (err)
644 return err;
645
646 etmq->offset += processed;
647 buffer_used += processed;
648
649 /*
650 * Nothing to do with an error condition, let's hope the next
651 * chunk will be better.
652 */
653 err = cs_etm__sample(etmq);
654 } while (buffer.len > buffer_used);
655
656goto more;
657
658 return err;
659}
660
661static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
662 pid_t tid, u64 time_)
663{
664 unsigned int i;
665 struct auxtrace_queues *queues = &etm->queues;
666
667 for (i = 0; i < queues->nr_queues; i++) {
668 struct auxtrace_queue *queue = &etm->queues.queue_array[i];
669 struct cs_etm_queue *etmq = queue->priv;
670
671 if (etmq && ((tid == -1) || (etmq->tid == tid))) {
672 etmq->time = time_;
673 cs_etm__set_pid_tid_cpu(etm, queue);
674 cs_etm__run_decoder(etmq);
675 }
676 }
677
678 return 0;
679}
680
681static int cs_etm__process_event(struct perf_session *session,
682 union perf_event *event,
683 struct perf_sample *sample,
684 struct perf_tool *tool)
685{
686 int err = 0;
687 u64 timestamp;
688 struct cs_etm_auxtrace *etm = container_of(session->auxtrace,
689 struct cs_etm_auxtrace,
690 auxtrace);
691
692 if (dump_trace)
693 return 0;
694
695 if (!tool->ordered_events) {
696 pr_err("CoreSight ETM Trace requires ordered events\n");
697 return -EINVAL;
698 }
699
700 if (!etm->timeless_decoding)
701 return -EINVAL;
702
703 if (sample->time && (sample->time != (u64) -1))
704 timestamp = sample->time;
705 else
706 timestamp = 0;
707
708 if (timestamp || etm->timeless_decoding) {
709 err = cs_etm__update_queues(etm);
710 if (err)
711 return err;
712 }
713
714 if (event->header.type == PERF_RECORD_EXIT)
715 return cs_etm__process_timeless_queues(etm,
716 event->fork.tid,
717 sample->time);
718
719 return 0;
720}
721
722static int cs_etm__process_auxtrace_event(struct perf_session *session,
723 union perf_event *event,
724 struct perf_tool *tool __maybe_unused)
725{
726 struct cs_etm_auxtrace *etm = container_of(session->auxtrace,
727 struct cs_etm_auxtrace,
728 auxtrace);
729 if (!etm->data_queued) {
730 struct auxtrace_buffer *buffer;
731 off_t data_offset;
732 int fd = perf_data__fd(session->data);
733 bool is_pipe = perf_data__is_pipe(session->data);
734 int err;
735
736 if (is_pipe)
737 data_offset = 0;
738 else {
739 data_offset = lseek(fd, 0, SEEK_CUR);
740 if (data_offset == -1)
741 return -errno;
742 }
743
744 err = auxtrace_queues__add_event(&etm->queues, session,
745 event, data_offset, &buffer);
746 if (err)
747 return err;
748
749 if (dump_trace)
750 if (auxtrace_buffer__get_data(buffer, fd)) {
751 cs_etm__dump_event(etm, buffer);
752 auxtrace_buffer__put_data(buffer);
753 }
754 }
755
756 return 0;
757}
758
759static bool cs_etm__is_timeless_decoding(struct cs_etm_auxtrace *etm)
760{
761 struct perf_evsel *evsel;
762 struct perf_evlist *evlist = etm->session->evlist;
763 bool timeless_decoding = true;
764
765 /*
766 * Circle through the list of event and complain if we find one
767 * with the time bit set.
768 */
769 evlist__for_each_entry(evlist, evsel) {
770 if ((evsel->attr.sample_type & PERF_SAMPLE_TIME))
771 timeless_decoding = false;
772 }
773
774 return timeless_decoding;
775}
776
777static const char * const cs_etm_global_header_fmts[] = {
778 [CS_HEADER_VERSION_0] = " Header version %llx\n",
779 [CS_PMU_TYPE_CPUS] = " PMU type/num cpus %llx\n",
780 [CS_ETM_SNAPSHOT] = " Snapshot %llx\n",
781};
782
783static const char * const cs_etm_priv_fmts[] = {
784 [CS_ETM_MAGIC] = " Magic number %llx\n",
785 [CS_ETM_CPU] = " CPU %lld\n",
786 [CS_ETM_ETMCR] = " ETMCR %llx\n",
787 [CS_ETM_ETMTRACEIDR] = " ETMTRACEIDR %llx\n",
788 [CS_ETM_ETMCCER] = " ETMCCER %llx\n",
789 [CS_ETM_ETMIDR] = " ETMIDR %llx\n",
790};
791
792static const char * const cs_etmv4_priv_fmts[] = {
793 [CS_ETM_MAGIC] = " Magic number %llx\n",
794 [CS_ETM_CPU] = " CPU %lld\n",
795 [CS_ETMV4_TRCCONFIGR] = " TRCCONFIGR %llx\n",
796 [CS_ETMV4_TRCTRACEIDR] = " TRCTRACEIDR %llx\n",
797 [CS_ETMV4_TRCIDR0] = " TRCIDR0 %llx\n",
798 [CS_ETMV4_TRCIDR1] = " TRCIDR1 %llx\n",
799 [CS_ETMV4_TRCIDR2] = " TRCIDR2 %llx\n",
800 [CS_ETMV4_TRCIDR8] = " TRCIDR8 %llx\n",
801 [CS_ETMV4_TRCAUTHSTATUS] = " TRCAUTHSTATUS %llx\n",
802};
803
804static void cs_etm__print_auxtrace_info(u64 *val, int num)
805{
806 int i, j, cpu = 0;
807
808 for (i = 0; i < CS_HEADER_VERSION_0_MAX; i++)
809 fprintf(stdout, cs_etm_global_header_fmts[i], val[i]);
810
811 for (i = CS_HEADER_VERSION_0_MAX; cpu < num; cpu++) {
812 if (val[i] == __perf_cs_etmv3_magic)
813 for (j = 0; j < CS_ETM_PRIV_MAX; j++, i++)
814 fprintf(stdout, cs_etm_priv_fmts[j], val[i]);
815 else if (val[i] == __perf_cs_etmv4_magic)
816 for (j = 0; j < CS_ETMV4_PRIV_MAX; j++, i++)
817 fprintf(stdout, cs_etmv4_priv_fmts[j], val[i]);
818 else
819 /* failure.. return */
820 return;
821 }
822}
823
824int cs_etm__process_auxtrace_info(union perf_event *event,
825 struct perf_session *session)
826{
827 struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
828 struct cs_etm_auxtrace *etm = NULL;
829 struct int_node *inode;
830 unsigned int pmu_type;
831 int event_header_size = sizeof(struct perf_event_header);
832 int info_header_size;
833 int total_size = auxtrace_info->header.size;
834 int priv_size = 0;
835 int num_cpu;
836 int err = 0, idx = -1;
837 int i, j, k;
838 u64 *ptr, *hdr = NULL;
839 u64 **metadata = NULL;
840
841 /*
842 * sizeof(auxtrace_info_event::type) +
843 * sizeof(auxtrace_info_event::reserved) == 8
844 */
845 info_header_size = 8;
846
847 if (total_size < (event_header_size + info_header_size))
848 return -EINVAL;
849
850 priv_size = total_size - event_header_size - info_header_size;
851
852 /* First the global part */
853 ptr = (u64 *) auxtrace_info->priv;
854
855 /* Look for version '0' of the header */
856 if (ptr[0] != 0)
857 return -EINVAL;
858
859 hdr = zalloc(sizeof(*hdr) * CS_HEADER_VERSION_0_MAX);
860 if (!hdr)
861 return -ENOMEM;
862
863 /* Extract header information - see cs-etm.h for format */
864 for (i = 0; i < CS_HEADER_VERSION_0_MAX; i++)
865 hdr[i] = ptr[i];
866 num_cpu = hdr[CS_PMU_TYPE_CPUS] & 0xffffffff;
867 pmu_type = (unsigned int) ((hdr[CS_PMU_TYPE_CPUS] >> 32) &
868 0xffffffff);
869
870 /*
871 * Create an RB tree for traceID-CPU# tuple. Since the conversion has
872 * to be made for each packet that gets decoded, optimizing access in
873 * anything other than a sequential array is worth doing.
874 */
875 traceid_list = intlist__new(NULL);
876 if (!traceid_list) {
877 err = -ENOMEM;
878 goto err_free_hdr;
879 }
880
881 metadata = zalloc(sizeof(*metadata) * num_cpu);
882 if (!metadata) {
883 err = -ENOMEM;
884 goto err_free_traceid_list;
885 }
886
887 /*
888 * The metadata is stored in the auxtrace_info section and encodes
889 * the configuration of the ARM embedded trace macrocell which is
890 * required by the trace decoder to properly decode the trace due
891 * to its highly compressed nature.
892 */
893 for (j = 0; j < num_cpu; j++) {
894 if (ptr[i] == __perf_cs_etmv3_magic) {
895 metadata[j] = zalloc(sizeof(*metadata[j]) *
896 CS_ETM_PRIV_MAX);
897 if (!metadata[j]) {
898 err = -ENOMEM;
899 goto err_free_metadata;
900 }
901 for (k = 0; k < CS_ETM_PRIV_MAX; k++)
902 metadata[j][k] = ptr[i + k];
903
904 /* The traceID is our handle */
905 idx = metadata[j][CS_ETM_ETMTRACEIDR];
906 i += CS_ETM_PRIV_MAX;
907 } else if (ptr[i] == __perf_cs_etmv4_magic) {
908 metadata[j] = zalloc(sizeof(*metadata[j]) *
909 CS_ETMV4_PRIV_MAX);
910 if (!metadata[j]) {
911 err = -ENOMEM;
912 goto err_free_metadata;
913 }
914 for (k = 0; k < CS_ETMV4_PRIV_MAX; k++)
915 metadata[j][k] = ptr[i + k];
916
917 /* The traceID is our handle */
918 idx = metadata[j][CS_ETMV4_TRCTRACEIDR];
919 i += CS_ETMV4_PRIV_MAX;
920 }
921
922 /* Get an RB node for this CPU */
923 inode = intlist__findnew(traceid_list, idx);
924
925 /* Something went wrong, no need to continue */
926 if (!inode) {
927 err = PTR_ERR(inode);
928 goto err_free_metadata;
929 }
930
931 /*
932 * The node for that CPU should not be taken.
933 * Back out if that's the case.
934 */
935 if (inode->priv) {
936 err = -EINVAL;
937 goto err_free_metadata;
938 }
939 /* All good, associate the traceID with the CPU# */
940 inode->priv = &metadata[j][CS_ETM_CPU];
941 }
942
943 /*
944 * Each of CS_HEADER_VERSION_0_MAX, CS_ETM_PRIV_MAX and
945 * CS_ETMV4_PRIV_MAX mark how many double words are in the
946 * global metadata, and each cpu's metadata respectively.
947 * The following tests if the correct number of double words was
948 * present in the auxtrace info section.
949 */
950 if (i * 8 != priv_size) {
951 err = -EINVAL;
952 goto err_free_metadata;
953 }
954
955 etm = zalloc(sizeof(*etm));
956
957 if (!etm) {
958 err = -ENOMEM;
959 goto err_free_metadata;
960 }
961
962 err = auxtrace_queues__init(&etm->queues);
963 if (err)
964 goto err_free_etm;
965
966 etm->session = session;
967 etm->machine = &session->machines.host;
968
969 etm->num_cpu = num_cpu;
970 etm->pmu_type = pmu_type;
971 etm->snapshot_mode = (hdr[CS_ETM_SNAPSHOT] != 0);
972 etm->metadata = metadata;
973 etm->auxtrace_type = auxtrace_info->type;
974 etm->timeless_decoding = cs_etm__is_timeless_decoding(etm);
975
976 etm->auxtrace.process_event = cs_etm__process_event;
977 etm->auxtrace.process_auxtrace_event = cs_etm__process_auxtrace_event;
978 etm->auxtrace.flush_events = cs_etm__flush_events;
979 etm->auxtrace.free_events = cs_etm__free_events;
980 etm->auxtrace.free = cs_etm__free;
981 session->auxtrace = &etm->auxtrace;
982
983 if (dump_trace) {
984 cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu);
985 return 0;
986 }
987
988 if (session->itrace_synth_opts && session->itrace_synth_opts->set) {
989 etm->synth_opts = *session->itrace_synth_opts;
990 } else {
991 itrace_synth_opts__set_default(&etm->synth_opts);
992 etm->synth_opts.callchain = false;
993 }
994
995 err = cs_etm__synth_events(etm, session);
996 if (err)
997 goto err_free_queues;
998
999 err = auxtrace_queues__process_index(&etm->queues, session);
1000 if (err)
1001 goto err_free_queues;
1002
1003 etm->data_queued = etm->queues.populated;
1004
1005 return 0;
1006
1007err_free_queues:
1008 auxtrace_queues__free(&etm->queues);
1009 session->auxtrace = NULL;
1010err_free_etm:
1011 zfree(&etm);
1012err_free_metadata:
1013 /* No need to check @metadata[j], free(NULL) is supported */
1014 for (j = 0; j < num_cpu; j++)
1015 free(metadata[j]);
1016 zfree(&metadata);
1017err_free_traceid_list:
1018 intlist__delete(traceid_list);
1019err_free_hdr:
1020 zfree(&hdr);
1021
1022 return -EINVAL;
1023}
diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h
index 3cc6bc3263fe..5864d5dca616 100644
--- a/tools/perf/util/cs-etm.h
+++ b/tools/perf/util/cs-etm.h
@@ -18,6 +18,9 @@
18#ifndef INCLUDE__UTIL_PERF_CS_ETM_H__ 18#ifndef INCLUDE__UTIL_PERF_CS_ETM_H__
19#define INCLUDE__UTIL_PERF_CS_ETM_H__ 19#define INCLUDE__UTIL_PERF_CS_ETM_H__
20 20
21#include "util/event.h"
22#include "util/session.h"
23
21/* Versionning header in case things need tro change in the future. That way 24/* Versionning header in case things need tro change in the future. That way
22 * decoding of old snapshot is still possible. 25 * decoding of old snapshot is still possible.
23 */ 26 */
@@ -61,6 +64,9 @@ enum {
61 CS_ETMV4_PRIV_MAX, 64 CS_ETMV4_PRIV_MAX,
62}; 65};
63 66
67/* RB tree for quick conversion between traceID and CPUs */
68struct intlist *traceid_list;
69
64#define KiB(x) ((x) * 1024) 70#define KiB(x) ((x) * 1024)
65#define MiB(x) ((x) * 1024 * 1024) 71#define MiB(x) ((x) * 1024 * 1024)
66 72
@@ -71,4 +77,16 @@ static const u64 __perf_cs_etmv4_magic = 0x4040404040404040ULL;
71#define CS_ETMV3_PRIV_SIZE (CS_ETM_PRIV_MAX * sizeof(u64)) 77#define CS_ETMV3_PRIV_SIZE (CS_ETM_PRIV_MAX * sizeof(u64))
72#define CS_ETMV4_PRIV_SIZE (CS_ETMV4_PRIV_MAX * sizeof(u64)) 78#define CS_ETMV4_PRIV_SIZE (CS_ETMV4_PRIV_MAX * sizeof(u64))
73 79
80#ifdef HAVE_CSTRACE_SUPPORT
81int cs_etm__process_auxtrace_info(union perf_event *event,
82 struct perf_session *session);
83#else
84static inline int
85cs_etm__process_auxtrace_info(union perf_event *event __maybe_unused,
86 struct perf_session *session __maybe_unused)
87{
88 return -1;
89}
90#endif
91
74#endif 92#endif
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
index 48094fde0a68..d8cfc19ddb10 100644
--- a/tools/perf/util/data.c
+++ b/tools/perf/util/data.c
@@ -12,16 +12,6 @@
12#include "util.h" 12#include "util.h"
13#include "debug.h" 13#include "debug.h"
14 14
15#ifndef O_CLOEXEC
16#ifdef __sparc__
17#define O_CLOEXEC 0x400000
18#elif defined(__alpha__) || defined(__hppa__)
19#define O_CLOEXEC 010000000
20#else
21#define O_CLOEXEC 02000000
22#endif
23#endif
24
25static bool check_pipe(struct perf_data *data) 15static bool check_pipe(struct perf_data *data)
26{ 16{
27 struct stat st; 17 struct stat st;
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index d5b6f7f5baff..36ef45b2e89d 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -446,7 +446,7 @@ static int do_open(char *name)
446 char sbuf[STRERR_BUFSIZE]; 446 char sbuf[STRERR_BUFSIZE];
447 447
448 do { 448 do {
449 fd = open(name, O_RDONLY); 449 fd = open(name, O_RDONLY|O_CLOEXEC);
450 if (fd >= 0) 450 if (fd >= 0)
451 return fd; 451 return fd;
452 452
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 6276b340f893..6d311868d850 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -1,8 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include "cpumap.h" 2#include "cpumap.h"
3#include "env.h" 3#include "env.h"
4#include "sane_ctype.h"
4#include "util.h" 5#include "util.h"
5#include <errno.h> 6#include <errno.h>
7#include <sys/utsname.h>
6 8
7struct perf_env perf_env; 9struct perf_env perf_env;
8 10
@@ -93,3 +95,48 @@ void cpu_cache_level__free(struct cpu_cache_level *cache)
93 free(cache->map); 95 free(cache->map);
94 free(cache->size); 96 free(cache->size);
95} 97}
98
99/*
100 * Return architecture name in a normalized form.
101 * The conversion logic comes from the Makefile.
102 */
103static const char *normalize_arch(char *arch)
104{
105 if (!strcmp(arch, "x86_64"))
106 return "x86";
107 if (arch[0] == 'i' && arch[2] == '8' && arch[3] == '6')
108 return "x86";
109 if (!strcmp(arch, "sun4u") || !strncmp(arch, "sparc", 5))
110 return "sparc";
111 if (!strcmp(arch, "aarch64") || !strcmp(arch, "arm64"))
112 return "arm64";
113 if (!strncmp(arch, "arm", 3) || !strcmp(arch, "sa110"))
114 return "arm";
115 if (!strncmp(arch, "s390", 4))
116 return "s390";
117 if (!strncmp(arch, "parisc", 6))
118 return "parisc";
119 if (!strncmp(arch, "powerpc", 7) || !strncmp(arch, "ppc", 3))
120 return "powerpc";
121 if (!strncmp(arch, "mips", 4))
122 return "mips";
123 if (!strncmp(arch, "sh", 2) && isdigit(arch[2]))
124 return "sh";
125
126 return arch;
127}
128
129const char *perf_env__arch(struct perf_env *env)
130{
131 struct utsname uts;
132 char *arch_name;
133
134 if (!env) { /* Assume local operation */
135 if (uname(&uts) < 0)
136 return NULL;
137 arch_name = uts.machine;
138 } else
139 arch_name = env->arch;
140
141 return normalize_arch(arch_name);
142}
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index 1eb35b190b34..bf970f57dce0 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -65,4 +65,6 @@ int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]);
65int perf_env__read_cpu_topology_map(struct perf_env *env); 65int perf_env__read_cpu_topology_map(struct perf_env *env);
66 66
67void cpu_cache_level__free(struct cpu_cache_level *cache); 67void cpu_cache_level__free(struct cpu_cache_level *cache);
68
69const char *perf_env__arch(struct perf_env *env);
68#endif /* __PERF_ENV_H */ 70#endif /* __PERF_ENV_H */
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 97a8ef9980db..44e603c27944 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1435,6 +1435,11 @@ size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp)
1435 event->context_switch.next_prev_tid); 1435 event->context_switch.next_prev_tid);
1436} 1436}
1437 1437
1438static size_t perf_event__fprintf_lost(union perf_event *event, FILE *fp)
1439{
1440 return fprintf(fp, " lost %" PRIu64 "\n", event->lost.lost);
1441}
1442
1438size_t perf_event__fprintf(union perf_event *event, FILE *fp) 1443size_t perf_event__fprintf(union perf_event *event, FILE *fp)
1439{ 1444{
1440 size_t ret = fprintf(fp, "PERF_RECORD_%s", 1445 size_t ret = fprintf(fp, "PERF_RECORD_%s",
@@ -1467,6 +1472,9 @@ size_t perf_event__fprintf(union perf_event *event, FILE *fp)
1467 case PERF_RECORD_SWITCH_CPU_WIDE: 1472 case PERF_RECORD_SWITCH_CPU_WIDE:
1468 ret += perf_event__fprintf_switch(event, fp); 1473 ret += perf_event__fprintf_switch(event, fp);
1469 break; 1474 break;
1475 case PERF_RECORD_LOST:
1476 ret += perf_event__fprintf_lost(event, fp);
1477 break;
1470 default: 1478 default:
1471 ret += fprintf(fp, "\n"); 1479 ret += fprintf(fp, "\n");
1472 } 1480 }
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 1ae95efbfb95..0f794744919c 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -205,6 +205,7 @@ struct perf_sample {
205 u32 flags; 205 u32 flags;
206 u16 insn_len; 206 u16 insn_len;
207 u8 cpumode; 207 u8 cpumode;
208 u16 misc;
208 char insn[MAX_INSN]; 209 char insn[MAX_INSN];
209 void *raw_data; 210 void *raw_data;
210 struct ip_callchain *callchain; 211 struct ip_callchain *callchain;
@@ -774,8 +775,7 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
774 u64 read_format); 775 u64 read_format);
775int perf_event__synthesize_sample(union perf_event *event, u64 type, 776int perf_event__synthesize_sample(union perf_event *event, u64 type,
776 u64 read_format, 777 u64 read_format,
777 const struct perf_sample *sample, 778 const struct perf_sample *sample);
778 bool swapped);
779 779
780pid_t perf_event__synthesize_comm(struct perf_tool *tool, 780pid_t perf_event__synthesize_comm(struct perf_tool *tool,
781 union perf_event *event, pid_t pid, 781 union perf_event *event, pid_t pid,
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index b62e523a7035..ac35cd214feb 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -25,6 +25,7 @@
25#include "parse-events.h" 25#include "parse-events.h"
26#include <subcmd/parse-options.h> 26#include <subcmd/parse-options.h>
27 27
28#include <fcntl.h>
28#include <sys/ioctl.h> 29#include <sys/ioctl.h>
29#include <sys/mman.h> 30#include <sys/mman.h>
30 31
@@ -125,7 +126,7 @@ static void perf_evlist__purge(struct perf_evlist *evlist)
125void perf_evlist__exit(struct perf_evlist *evlist) 126void perf_evlist__exit(struct perf_evlist *evlist)
126{ 127{
127 zfree(&evlist->mmap); 128 zfree(&evlist->mmap);
128 zfree(&evlist->backward_mmap); 129 zfree(&evlist->overwrite_mmap);
129 fdarray__exit(&evlist->pollfd); 130 fdarray__exit(&evlist->pollfd);
130} 131}
131 132
@@ -675,11 +676,11 @@ static int perf_evlist__set_paused(struct perf_evlist *evlist, bool value)
675{ 676{
676 int i; 677 int i;
677 678
678 if (!evlist->backward_mmap) 679 if (!evlist->overwrite_mmap)
679 return 0; 680 return 0;
680 681
681 for (i = 0; i < evlist->nr_mmaps; i++) { 682 for (i = 0; i < evlist->nr_mmaps; i++) {
682 int fd = evlist->backward_mmap[i].fd; 683 int fd = evlist->overwrite_mmap[i].fd;
683 int err; 684 int err;
684 685
685 if (fd < 0) 686 if (fd < 0)
@@ -711,7 +712,7 @@ union perf_event *perf_evlist__mmap_read_forward(struct perf_evlist *evlist, int
711 * No need for read-write ring buffer: kernel stop outputting when 712 * No need for read-write ring buffer: kernel stop outputting when
712 * it hit md->prev (perf_mmap__consume()). 713 * it hit md->prev (perf_mmap__consume()).
713 */ 714 */
714 return perf_mmap__read_forward(md, evlist->overwrite); 715 return perf_mmap__read_forward(md);
715} 716}
716 717
717union perf_event *perf_evlist__mmap_read_backward(struct perf_evlist *evlist, int idx) 718union perf_event *perf_evlist__mmap_read_backward(struct perf_evlist *evlist, int idx)
@@ -738,7 +739,7 @@ void perf_evlist__mmap_read_catchup(struct perf_evlist *evlist, int idx)
738 739
739void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx) 740void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx)
740{ 741{
741 perf_mmap__consume(&evlist->mmap[idx], evlist->overwrite); 742 perf_mmap__consume(&evlist->mmap[idx], false);
742} 743}
743 744
744static void perf_evlist__munmap_nofree(struct perf_evlist *evlist) 745static void perf_evlist__munmap_nofree(struct perf_evlist *evlist)
@@ -749,16 +750,16 @@ static void perf_evlist__munmap_nofree(struct perf_evlist *evlist)
749 for (i = 0; i < evlist->nr_mmaps; i++) 750 for (i = 0; i < evlist->nr_mmaps; i++)
750 perf_mmap__munmap(&evlist->mmap[i]); 751 perf_mmap__munmap(&evlist->mmap[i]);
751 752
752 if (evlist->backward_mmap) 753 if (evlist->overwrite_mmap)
753 for (i = 0; i < evlist->nr_mmaps; i++) 754 for (i = 0; i < evlist->nr_mmaps; i++)
754 perf_mmap__munmap(&evlist->backward_mmap[i]); 755 perf_mmap__munmap(&evlist->overwrite_mmap[i]);
755} 756}
756 757
757void perf_evlist__munmap(struct perf_evlist *evlist) 758void perf_evlist__munmap(struct perf_evlist *evlist)
758{ 759{
759 perf_evlist__munmap_nofree(evlist); 760 perf_evlist__munmap_nofree(evlist);
760 zfree(&evlist->mmap); 761 zfree(&evlist->mmap);
761 zfree(&evlist->backward_mmap); 762 zfree(&evlist->overwrite_mmap);
762} 763}
763 764
764static struct perf_mmap *perf_evlist__alloc_mmap(struct perf_evlist *evlist) 765static struct perf_mmap *perf_evlist__alloc_mmap(struct perf_evlist *evlist)
@@ -800,7 +801,7 @@ perf_evlist__should_poll(struct perf_evlist *evlist __maybe_unused,
800 801
801static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx, 802static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
802 struct mmap_params *mp, int cpu_idx, 803 struct mmap_params *mp, int cpu_idx,
803 int thread, int *_output, int *_output_backward) 804 int thread, int *_output, int *_output_overwrite)
804{ 805{
805 struct perf_evsel *evsel; 806 struct perf_evsel *evsel;
806 int revent; 807 int revent;
@@ -812,18 +813,20 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
812 int fd; 813 int fd;
813 int cpu; 814 int cpu;
814 815
816 mp->prot = PROT_READ | PROT_WRITE;
815 if (evsel->attr.write_backward) { 817 if (evsel->attr.write_backward) {
816 output = _output_backward; 818 output = _output_overwrite;
817 maps = evlist->backward_mmap; 819 maps = evlist->overwrite_mmap;
818 820
819 if (!maps) { 821 if (!maps) {
820 maps = perf_evlist__alloc_mmap(evlist); 822 maps = perf_evlist__alloc_mmap(evlist);
821 if (!maps) 823 if (!maps)
822 return -1; 824 return -1;
823 evlist->backward_mmap = maps; 825 evlist->overwrite_mmap = maps;
824 if (evlist->bkw_mmap_state == BKW_MMAP_NOTREADY) 826 if (evlist->bkw_mmap_state == BKW_MMAP_NOTREADY)
825 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING); 827 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING);
826 } 828 }
829 mp->prot &= ~PROT_WRITE;
827 } 830 }
828 831
829 if (evsel->system_wide && thread) 832 if (evsel->system_wide && thread)
@@ -884,14 +887,14 @@ static int perf_evlist__mmap_per_cpu(struct perf_evlist *evlist,
884 pr_debug2("perf event ring buffer mmapped per cpu\n"); 887 pr_debug2("perf event ring buffer mmapped per cpu\n");
885 for (cpu = 0; cpu < nr_cpus; cpu++) { 888 for (cpu = 0; cpu < nr_cpus; cpu++) {
886 int output = -1; 889 int output = -1;
887 int output_backward = -1; 890 int output_overwrite = -1;
888 891
889 auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, cpu, 892 auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, cpu,
890 true); 893 true);
891 894
892 for (thread = 0; thread < nr_threads; thread++) { 895 for (thread = 0; thread < nr_threads; thread++) {
893 if (perf_evlist__mmap_per_evsel(evlist, cpu, mp, cpu, 896 if (perf_evlist__mmap_per_evsel(evlist, cpu, mp, cpu,
894 thread, &output, &output_backward)) 897 thread, &output, &output_overwrite))
895 goto out_unmap; 898 goto out_unmap;
896 } 899 }
897 } 900 }
@@ -912,13 +915,13 @@ static int perf_evlist__mmap_per_thread(struct perf_evlist *evlist,
912 pr_debug2("perf event ring buffer mmapped per thread\n"); 915 pr_debug2("perf event ring buffer mmapped per thread\n");
913 for (thread = 0; thread < nr_threads; thread++) { 916 for (thread = 0; thread < nr_threads; thread++) {
914 int output = -1; 917 int output = -1;
915 int output_backward = -1; 918 int output_overwrite = -1;
916 919
917 auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, thread, 920 auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, thread,
918 false); 921 false);
919 922
920 if (perf_evlist__mmap_per_evsel(evlist, thread, mp, 0, thread, 923 if (perf_evlist__mmap_per_evsel(evlist, thread, mp, 0, thread,
921 &output, &output_backward)) 924 &output, &output_overwrite))
922 goto out_unmap; 925 goto out_unmap;
923 } 926 }
924 927
@@ -1052,15 +1055,18 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
1052 * Return: %0 on success, negative error code otherwise. 1055 * Return: %0 on success, negative error code otherwise.
1053 */ 1056 */
1054int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, 1057int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
1055 bool overwrite, unsigned int auxtrace_pages, 1058 unsigned int auxtrace_pages,
1056 bool auxtrace_overwrite) 1059 bool auxtrace_overwrite)
1057{ 1060{
1058 struct perf_evsel *evsel; 1061 struct perf_evsel *evsel;
1059 const struct cpu_map *cpus = evlist->cpus; 1062 const struct cpu_map *cpus = evlist->cpus;
1060 const struct thread_map *threads = evlist->threads; 1063 const struct thread_map *threads = evlist->threads;
1061 struct mmap_params mp = { 1064 /*
1062 .prot = PROT_READ | (overwrite ? 0 : PROT_WRITE), 1065 * Delay setting mp.prot: set it before calling perf_mmap__mmap.
1063 }; 1066 * Its value is decided by evsel's write_backward.
1067 * So &mp should not be passed through const pointer.
1068 */
1069 struct mmap_params mp;
1064 1070
1065 if (!evlist->mmap) 1071 if (!evlist->mmap)
1066 evlist->mmap = perf_evlist__alloc_mmap(evlist); 1072 evlist->mmap = perf_evlist__alloc_mmap(evlist);
@@ -1070,7 +1076,6 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
1070 if (evlist->pollfd.entries == NULL && perf_evlist__alloc_pollfd(evlist) < 0) 1076 if (evlist->pollfd.entries == NULL && perf_evlist__alloc_pollfd(evlist) < 0)
1071 return -ENOMEM; 1077 return -ENOMEM;
1072 1078
1073 evlist->overwrite = overwrite;
1074 evlist->mmap_len = perf_evlist__mmap_size(pages); 1079 evlist->mmap_len = perf_evlist__mmap_size(pages);
1075 pr_debug("mmap size %zuB\n", evlist->mmap_len); 1080 pr_debug("mmap size %zuB\n", evlist->mmap_len);
1076 mp.mask = evlist->mmap_len - page_size - 1; 1081 mp.mask = evlist->mmap_len - page_size - 1;
@@ -1091,10 +1096,9 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
1091 return perf_evlist__mmap_per_cpu(evlist, &mp); 1096 return perf_evlist__mmap_per_cpu(evlist, &mp);
1092} 1097}
1093 1098
1094int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, 1099int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
1095 bool overwrite)
1096{ 1100{
1097 return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false); 1101 return perf_evlist__mmap_ex(evlist, pages, 0, false);
1098} 1102}
1099 1103
1100int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) 1104int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
@@ -1102,7 +1106,8 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
1102 struct cpu_map *cpus; 1106 struct cpu_map *cpus;
1103 struct thread_map *threads; 1107 struct thread_map *threads;
1104 1108
1105 threads = thread_map__new_str(target->pid, target->tid, target->uid); 1109 threads = thread_map__new_str(target->pid, target->tid, target->uid,
1110 target->per_thread);
1106 1111
1107 if (!threads) 1112 if (!threads)
1108 return -1; 1113 return -1;
@@ -1582,6 +1587,17 @@ int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *even
1582 return perf_evsel__parse_sample(evsel, event, sample); 1587 return perf_evsel__parse_sample(evsel, event, sample);
1583} 1588}
1584 1589
1590int perf_evlist__parse_sample_timestamp(struct perf_evlist *evlist,
1591 union perf_event *event,
1592 u64 *timestamp)
1593{
1594 struct perf_evsel *evsel = perf_evlist__event2evsel(evlist, event);
1595
1596 if (!evsel)
1597 return -EFAULT;
1598 return perf_evsel__parse_sample_timestamp(evsel, event, timestamp);
1599}
1600
1585size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp) 1601size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp)
1586{ 1602{
1587 struct perf_evsel *evsel; 1603 struct perf_evsel *evsel;
@@ -1739,13 +1755,13 @@ void perf_evlist__toggle_bkw_mmap(struct perf_evlist *evlist,
1739 RESUME, 1755 RESUME,
1740 } action = NONE; 1756 } action = NONE;
1741 1757
1742 if (!evlist->backward_mmap) 1758 if (!evlist->overwrite_mmap)
1743 return; 1759 return;
1744 1760
1745 switch (old_state) { 1761 switch (old_state) {
1746 case BKW_MMAP_NOTREADY: { 1762 case BKW_MMAP_NOTREADY: {
1747 if (state != BKW_MMAP_RUNNING) 1763 if (state != BKW_MMAP_RUNNING)
1748 goto state_err;; 1764 goto state_err;
1749 break; 1765 break;
1750 } 1766 }
1751 case BKW_MMAP_RUNNING: { 1767 case BKW_MMAP_RUNNING: {
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 491f69542920..75f8e0ad5d76 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -7,7 +7,6 @@
7#include <linux/refcount.h> 7#include <linux/refcount.h>
8#include <linux/list.h> 8#include <linux/list.h>
9#include <api/fd/array.h> 9#include <api/fd/array.h>
10#include <fcntl.h>
11#include <stdio.h> 10#include <stdio.h>
12#include "../perf.h" 11#include "../perf.h"
13#include "event.h" 12#include "event.h"
@@ -31,7 +30,6 @@ struct perf_evlist {
31 int nr_entries; 30 int nr_entries;
32 int nr_groups; 31 int nr_groups;
33 int nr_mmaps; 32 int nr_mmaps;
34 bool overwrite;
35 bool enabled; 33 bool enabled;
36 bool has_user_cpus; 34 bool has_user_cpus;
37 size_t mmap_len; 35 size_t mmap_len;
@@ -45,12 +43,14 @@ struct perf_evlist {
45 } workload; 43 } workload;
46 struct fdarray pollfd; 44 struct fdarray pollfd;
47 struct perf_mmap *mmap; 45 struct perf_mmap *mmap;
48 struct perf_mmap *backward_mmap; 46 struct perf_mmap *overwrite_mmap;
49 struct thread_map *threads; 47 struct thread_map *threads;
50 struct cpu_map *cpus; 48 struct cpu_map *cpus;
51 struct perf_evsel *selected; 49 struct perf_evsel *selected;
52 struct events_stats stats; 50 struct events_stats stats;
53 struct perf_env *env; 51 struct perf_env *env;
52 u64 first_sample_time;
53 u64 last_sample_time;
54}; 54};
55 55
56struct perf_evsel_str_handler { 56struct perf_evsel_str_handler {
@@ -169,10 +169,9 @@ int perf_evlist__parse_mmap_pages(const struct option *opt,
169unsigned long perf_event_mlock_kb_in_pages(void); 169unsigned long perf_event_mlock_kb_in_pages(void);
170 170
171int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, 171int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
172 bool overwrite, unsigned int auxtrace_pages, 172 unsigned int auxtrace_pages,
173 bool auxtrace_overwrite); 173 bool auxtrace_overwrite);
174int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, 174int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages);
175 bool overwrite);
176void perf_evlist__munmap(struct perf_evlist *evlist); 175void perf_evlist__munmap(struct perf_evlist *evlist);
177 176
178size_t perf_evlist__mmap_size(unsigned long pages); 177size_t perf_evlist__mmap_size(unsigned long pages);
@@ -205,6 +204,10 @@ u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist);
205int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event, 204int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event,
206 struct perf_sample *sample); 205 struct perf_sample *sample);
207 206
207int perf_evlist__parse_sample_timestamp(struct perf_evlist *evlist,
208 union perf_event *event,
209 u64 *timestamp);
210
208bool perf_evlist__valid_sample_type(struct perf_evlist *evlist); 211bool perf_evlist__valid_sample_type(struct perf_evlist *evlist);
209bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist); 212bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist);
210bool perf_evlist__valid_read_format(struct perf_evlist *evlist); 213bool perf_evlist__valid_read_format(struct perf_evlist *evlist);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d5fbcf8c7aa7..ff359c9ece2e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -36,6 +36,7 @@
36#include "debug.h" 36#include "debug.h"
37#include "trace-event.h" 37#include "trace-event.h"
38#include "stat.h" 38#include "stat.h"
39#include "memswap.h"
39#include "util/parse-branch-options.h" 40#include "util/parse-branch-options.h"
40 41
41#include "sane_ctype.h" 42#include "sane_ctype.h"
@@ -650,9 +651,9 @@ int perf_evsel__group_desc(struct perf_evsel *evsel, char *buf, size_t size)
650 return ret; 651 return ret;
651} 652}
652 653
653void perf_evsel__config_callchain(struct perf_evsel *evsel, 654static void __perf_evsel__config_callchain(struct perf_evsel *evsel,
654 struct record_opts *opts, 655 struct record_opts *opts,
655 struct callchain_param *param) 656 struct callchain_param *param)
656{ 657{
657 bool function = perf_evsel__is_function_event(evsel); 658 bool function = perf_evsel__is_function_event(evsel);
658 struct perf_event_attr *attr = &evsel->attr; 659 struct perf_event_attr *attr = &evsel->attr;
@@ -698,6 +699,14 @@ void perf_evsel__config_callchain(struct perf_evsel *evsel,
698 } 699 }
699} 700}
700 701
702void perf_evsel__config_callchain(struct perf_evsel *evsel,
703 struct record_opts *opts,
704 struct callchain_param *param)
705{
706 if (param->enabled)
707 return __perf_evsel__config_callchain(evsel, opts, param);
708}
709
701static void 710static void
702perf_evsel__reset_callgraph(struct perf_evsel *evsel, 711perf_evsel__reset_callgraph(struct perf_evsel *evsel,
703 struct callchain_param *param) 712 struct callchain_param *param)
@@ -717,31 +726,33 @@ perf_evsel__reset_callgraph(struct perf_evsel *evsel,
717} 726}
718 727
719static void apply_config_terms(struct perf_evsel *evsel, 728static void apply_config_terms(struct perf_evsel *evsel,
720 struct record_opts *opts) 729 struct record_opts *opts, bool track)
721{ 730{
722 struct perf_evsel_config_term *term; 731 struct perf_evsel_config_term *term;
723 struct list_head *config_terms = &evsel->config_terms; 732 struct list_head *config_terms = &evsel->config_terms;
724 struct perf_event_attr *attr = &evsel->attr; 733 struct perf_event_attr *attr = &evsel->attr;
725 struct callchain_param param; 734 /* callgraph default */
735 struct callchain_param param = {
736 .record_mode = callchain_param.record_mode,
737 };
726 u32 dump_size = 0; 738 u32 dump_size = 0;
727 int max_stack = 0; 739 int max_stack = 0;
728 const char *callgraph_buf = NULL; 740 const char *callgraph_buf = NULL;
729 741
730 /* callgraph default */
731 param.record_mode = callchain_param.record_mode;
732
733 list_for_each_entry(term, config_terms, list) { 742 list_for_each_entry(term, config_terms, list) {
734 switch (term->type) { 743 switch (term->type) {
735 case PERF_EVSEL__CONFIG_TERM_PERIOD: 744 case PERF_EVSEL__CONFIG_TERM_PERIOD:
736 if (!(term->weak && opts->user_interval != ULLONG_MAX)) { 745 if (!(term->weak && opts->user_interval != ULLONG_MAX)) {
737 attr->sample_period = term->val.period; 746 attr->sample_period = term->val.period;
738 attr->freq = 0; 747 attr->freq = 0;
748 perf_evsel__reset_sample_bit(evsel, PERIOD);
739 } 749 }
740 break; 750 break;
741 case PERF_EVSEL__CONFIG_TERM_FREQ: 751 case PERF_EVSEL__CONFIG_TERM_FREQ:
742 if (!(term->weak && opts->user_freq != UINT_MAX)) { 752 if (!(term->weak && opts->user_freq != UINT_MAX)) {
743 attr->sample_freq = term->val.freq; 753 attr->sample_freq = term->val.freq;
744 attr->freq = 1; 754 attr->freq = 1;
755 perf_evsel__set_sample_bit(evsel, PERIOD);
745 } 756 }
746 break; 757 break;
747 case PERF_EVSEL__CONFIG_TERM_TIME: 758 case PERF_EVSEL__CONFIG_TERM_TIME:
@@ -779,6 +790,8 @@ static void apply_config_terms(struct perf_evsel *evsel,
779 case PERF_EVSEL__CONFIG_TERM_OVERWRITE: 790 case PERF_EVSEL__CONFIG_TERM_OVERWRITE:
780 attr->write_backward = term->val.overwrite ? 1 : 0; 791 attr->write_backward = term->val.overwrite ? 1 : 0;
781 break; 792 break;
793 case PERF_EVSEL__CONFIG_TERM_DRV_CFG:
794 break;
782 default: 795 default:
783 break; 796 break;
784 } 797 }
@@ -786,6 +799,8 @@ static void apply_config_terms(struct perf_evsel *evsel,
786 799
787 /* User explicitly set per-event callgraph, clear the old setting and reset. */ 800 /* User explicitly set per-event callgraph, clear the old setting and reset. */
788 if ((callgraph_buf != NULL) || (dump_size > 0) || max_stack) { 801 if ((callgraph_buf != NULL) || (dump_size > 0) || max_stack) {
802 bool sample_address = false;
803
789 if (max_stack) { 804 if (max_stack) {
790 param.max_stack = max_stack; 805 param.max_stack = max_stack;
791 if (callgraph_buf == NULL) 806 if (callgraph_buf == NULL)
@@ -805,6 +820,8 @@ static void apply_config_terms(struct perf_evsel *evsel,
805 evsel->name); 820 evsel->name);
806 return; 821 return;
807 } 822 }
823 if (param.record_mode == CALLCHAIN_DWARF)
824 sample_address = true;
808 } 825 }
809 } 826 }
810 if (dump_size > 0) { 827 if (dump_size > 0) {
@@ -817,8 +834,14 @@ static void apply_config_terms(struct perf_evsel *evsel,
817 perf_evsel__reset_callgraph(evsel, &callchain_param); 834 perf_evsel__reset_callgraph(evsel, &callchain_param);
818 835
819 /* set perf-event callgraph */ 836 /* set perf-event callgraph */
820 if (param.enabled) 837 if (param.enabled) {
838 if (sample_address) {
839 perf_evsel__set_sample_bit(evsel, ADDR);
840 perf_evsel__set_sample_bit(evsel, DATA_SRC);
841 evsel->attr.mmap_data = track;
842 }
821 perf_evsel__config_callchain(evsel, opts, &param); 843 perf_evsel__config_callchain(evsel, opts, &param);
844 }
822 } 845 }
823} 846}
824 847
@@ -948,9 +971,6 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
948 if (target__has_cpu(&opts->target) || opts->sample_cpu) 971 if (target__has_cpu(&opts->target) || opts->sample_cpu)
949 perf_evsel__set_sample_bit(evsel, CPU); 972 perf_evsel__set_sample_bit(evsel, CPU);
950 973
951 if (opts->period)
952 perf_evsel__set_sample_bit(evsel, PERIOD);
953
954 /* 974 /*
955 * When the user explicitly disabled time don't force it here. 975 * When the user explicitly disabled time don't force it here.
956 */ 976 */
@@ -1049,9 +1069,17 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
1049 * Apply event specific term settings, 1069 * Apply event specific term settings,
1050 * it overloads any global configuration. 1070 * it overloads any global configuration.
1051 */ 1071 */
1052 apply_config_terms(evsel, opts); 1072 apply_config_terms(evsel, opts, track);
1053 1073
1054 evsel->ignore_missing_thread = opts->ignore_missing_thread; 1074 evsel->ignore_missing_thread = opts->ignore_missing_thread;
1075
1076 /* The --period option takes the precedence. */
1077 if (opts->period_set) {
1078 if (opts->period)
1079 perf_evsel__set_sample_bit(evsel, PERIOD);
1080 else
1081 perf_evsel__reset_sample_bit(evsel, PERIOD);
1082 }
1055} 1083}
1056 1084
1057static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads) 1085static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
@@ -1574,6 +1602,7 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
1574 PRINT_ATTRf(use_clockid, p_unsigned); 1602 PRINT_ATTRf(use_clockid, p_unsigned);
1575 PRINT_ATTRf(context_switch, p_unsigned); 1603 PRINT_ATTRf(context_switch, p_unsigned);
1576 PRINT_ATTRf(write_backward, p_unsigned); 1604 PRINT_ATTRf(write_backward, p_unsigned);
1605 PRINT_ATTRf(namespaces, p_unsigned);
1577 1606
1578 PRINT_ATTRn("{ wakeup_events, wakeup_watermark }", wakeup_events, p_unsigned); 1607 PRINT_ATTRn("{ wakeup_events, wakeup_watermark }", wakeup_events, p_unsigned);
1579 PRINT_ATTRf(bp_type, p_unsigned); 1608 PRINT_ATTRf(bp_type, p_unsigned);
@@ -1596,10 +1625,46 @@ static int __open_attr__fprintf(FILE *fp, const char *name, const char *val,
1596 return fprintf(fp, " %-32s %s\n", name, val); 1625 return fprintf(fp, " %-32s %s\n", name, val);
1597} 1626}
1598 1627
1628static void perf_evsel__remove_fd(struct perf_evsel *pos,
1629 int nr_cpus, int nr_threads,
1630 int thread_idx)
1631{
1632 for (int cpu = 0; cpu < nr_cpus; cpu++)
1633 for (int thread = thread_idx; thread < nr_threads - 1; thread++)
1634 FD(pos, cpu, thread) = FD(pos, cpu, thread + 1);
1635}
1636
1637static int update_fds(struct perf_evsel *evsel,
1638 int nr_cpus, int cpu_idx,
1639 int nr_threads, int thread_idx)
1640{
1641 struct perf_evsel *pos;
1642
1643 if (cpu_idx >= nr_cpus || thread_idx >= nr_threads)
1644 return -EINVAL;
1645
1646 evlist__for_each_entry(evsel->evlist, pos) {
1647 nr_cpus = pos != evsel ? nr_cpus : cpu_idx;
1648
1649 perf_evsel__remove_fd(pos, nr_cpus, nr_threads, thread_idx);
1650
1651 /*
1652 * Since fds for next evsel has not been created,
1653 * there is no need to iterate whole event list.
1654 */
1655 if (pos == evsel)
1656 break;
1657 }
1658 return 0;
1659}
1660
1599static bool ignore_missing_thread(struct perf_evsel *evsel, 1661static bool ignore_missing_thread(struct perf_evsel *evsel,
1662 int nr_cpus, int cpu,
1600 struct thread_map *threads, 1663 struct thread_map *threads,
1601 int thread, int err) 1664 int thread, int err)
1602{ 1665{
1666 pid_t ignore_pid = thread_map__pid(threads, thread);
1667
1603 if (!evsel->ignore_missing_thread) 1668 if (!evsel->ignore_missing_thread)
1604 return false; 1669 return false;
1605 1670
@@ -1615,11 +1680,18 @@ static bool ignore_missing_thread(struct perf_evsel *evsel,
1615 if (threads->nr == 1) 1680 if (threads->nr == 1)
1616 return false; 1681 return false;
1617 1682
1683 /*
1684 * We should remove fd for missing_thread first
1685 * because thread_map__remove() will decrease threads->nr.
1686 */
1687 if (update_fds(evsel, nr_cpus, cpu, threads->nr, thread))
1688 return false;
1689
1618 if (thread_map__remove(threads, thread)) 1690 if (thread_map__remove(threads, thread))
1619 return false; 1691 return false;
1620 1692
1621 pr_warning("WARNING: Ignored open failure for pid %d\n", 1693 pr_warning("WARNING: Ignored open failure for pid %d\n",
1622 thread_map__pid(threads, thread)); 1694 ignore_pid);
1623 return true; 1695 return true;
1624} 1696}
1625 1697
@@ -1724,7 +1796,7 @@ retry_open:
1724 if (fd < 0) { 1796 if (fd < 0) {
1725 err = -errno; 1797 err = -errno;
1726 1798
1727 if (ignore_missing_thread(evsel, threads, thread, err)) { 1799 if (ignore_missing_thread(evsel, cpus->nr, cpu, threads, thread, err)) {
1728 /* 1800 /*
1729 * We just removed 1 thread, so take a step 1801 * We just removed 1 thread, so take a step
1730 * back on thread index and lower the upper 1802 * back on thread index and lower the upper
@@ -1960,6 +2032,20 @@ static inline bool overflow(const void *endp, u16 max_size, const void *offset,
1960#define OVERFLOW_CHECK_u64(offset) \ 2032#define OVERFLOW_CHECK_u64(offset) \
1961 OVERFLOW_CHECK(offset, sizeof(u64), sizeof(u64)) 2033 OVERFLOW_CHECK(offset, sizeof(u64), sizeof(u64))
1962 2034
2035static int
2036perf_event__check_size(union perf_event *event, unsigned int sample_size)
2037{
2038 /*
2039 * The evsel's sample_size is based on PERF_SAMPLE_MASK which includes
2040 * up to PERF_SAMPLE_PERIOD. After that overflow() must be used to
2041 * check the format does not go past the end of the event.
2042 */
2043 if (sample_size + sizeof(event->header) > event->header.size)
2044 return -EFAULT;
2045
2046 return 0;
2047}
2048
1963int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, 2049int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
1964 struct perf_sample *data) 2050 struct perf_sample *data)
1965{ 2051{
@@ -1981,6 +2067,9 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
1981 data->stream_id = data->id = data->time = -1ULL; 2067 data->stream_id = data->id = data->time = -1ULL;
1982 data->period = evsel->attr.sample_period; 2068 data->period = evsel->attr.sample_period;
1983 data->cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 2069 data->cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
2070 data->misc = event->header.misc;
2071 data->id = -1ULL;
2072 data->data_src = PERF_MEM_DATA_SRC_NONE;
1984 2073
1985 if (event->header.type != PERF_RECORD_SAMPLE) { 2074 if (event->header.type != PERF_RECORD_SAMPLE) {
1986 if (!evsel->attr.sample_id_all) 2075 if (!evsel->attr.sample_id_all)
@@ -1990,15 +2079,9 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
1990 2079
1991 array = event->sample.array; 2080 array = event->sample.array;
1992 2081
1993 /* 2082 if (perf_event__check_size(event, evsel->sample_size))
1994 * The evsel's sample_size is based on PERF_SAMPLE_MASK which includes
1995 * up to PERF_SAMPLE_PERIOD. After that overflow() must be used to
1996 * check the format does not go past the end of the event.
1997 */
1998 if (evsel->sample_size + sizeof(event->header) > event->header.size)
1999 return -EFAULT; 2083 return -EFAULT;
2000 2084
2001 data->id = -1ULL;
2002 if (type & PERF_SAMPLE_IDENTIFIER) { 2085 if (type & PERF_SAMPLE_IDENTIFIER) {
2003 data->id = *array; 2086 data->id = *array;
2004 array++; 2087 array++;
@@ -2028,7 +2111,6 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
2028 array++; 2111 array++;
2029 } 2112 }
2030 2113
2031 data->addr = 0;
2032 if (type & PERF_SAMPLE_ADDR) { 2114 if (type & PERF_SAMPLE_ADDR) {
2033 data->addr = *array; 2115 data->addr = *array;
2034 array++; 2116 array++;
@@ -2120,14 +2202,27 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
2120 if (type & PERF_SAMPLE_RAW) { 2202 if (type & PERF_SAMPLE_RAW) {
2121 OVERFLOW_CHECK_u64(array); 2203 OVERFLOW_CHECK_u64(array);
2122 u.val64 = *array; 2204 u.val64 = *array;
2123 if (WARN_ONCE(swapped, 2205
2124 "Endianness of raw data not corrected!\n")) { 2206 /*
2125 /* undo swap of u64, then swap on individual u32s */ 2207 * Undo swap of u64, then swap on individual u32s,
2208 * get the size of the raw area and undo all of the
2209 * swap. The pevent interface handles endianity by
2210 * itself.
2211 */
2212 if (swapped) {
2126 u.val64 = bswap_64(u.val64); 2213 u.val64 = bswap_64(u.val64);
2127 u.val32[0] = bswap_32(u.val32[0]); 2214 u.val32[0] = bswap_32(u.val32[0]);
2128 u.val32[1] = bswap_32(u.val32[1]); 2215 u.val32[1] = bswap_32(u.val32[1]);
2129 } 2216 }
2130 data->raw_size = u.val32[0]; 2217 data->raw_size = u.val32[0];
2218
2219 /*
2220 * The raw data is aligned on 64bits including the
2221 * u32 size, so it's safe to use mem_bswap_64.
2222 */
2223 if (swapped)
2224 mem_bswap_64((void *) array, data->raw_size);
2225
2131 array = (void *)array + sizeof(u32); 2226 array = (void *)array + sizeof(u32);
2132 2227
2133 OVERFLOW_CHECK(array, data->raw_size, max_size); 2228 OVERFLOW_CHECK(array, data->raw_size, max_size);
@@ -2192,14 +2287,12 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
2192 array++; 2287 array++;
2193 } 2288 }
2194 2289
2195 data->data_src = PERF_MEM_DATA_SRC_NONE;
2196 if (type & PERF_SAMPLE_DATA_SRC) { 2290 if (type & PERF_SAMPLE_DATA_SRC) {
2197 OVERFLOW_CHECK_u64(array); 2291 OVERFLOW_CHECK_u64(array);
2198 data->data_src = *array; 2292 data->data_src = *array;
2199 array++; 2293 array++;
2200 } 2294 }
2201 2295
2202 data->transaction = 0;
2203 if (type & PERF_SAMPLE_TRANSACTION) { 2296 if (type & PERF_SAMPLE_TRANSACTION) {
2204 OVERFLOW_CHECK_u64(array); 2297 OVERFLOW_CHECK_u64(array);
2205 data->transaction = *array; 2298 data->transaction = *array;
@@ -2232,6 +2325,50 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
2232 return 0; 2325 return 0;
2233} 2326}
2234 2327
2328int perf_evsel__parse_sample_timestamp(struct perf_evsel *evsel,
2329 union perf_event *event,
2330 u64 *timestamp)
2331{
2332 u64 type = evsel->attr.sample_type;
2333 const u64 *array;
2334
2335 if (!(type & PERF_SAMPLE_TIME))
2336 return -1;
2337
2338 if (event->header.type != PERF_RECORD_SAMPLE) {
2339 struct perf_sample data = {
2340 .time = -1ULL,
2341 };
2342
2343 if (!evsel->attr.sample_id_all)
2344 return -1;
2345 if (perf_evsel__parse_id_sample(evsel, event, &data))
2346 return -1;
2347
2348 *timestamp = data.time;
2349 return 0;
2350 }
2351
2352 array = event->sample.array;
2353
2354 if (perf_event__check_size(event, evsel->sample_size))
2355 return -EFAULT;
2356
2357 if (type & PERF_SAMPLE_IDENTIFIER)
2358 array++;
2359
2360 if (type & PERF_SAMPLE_IP)
2361 array++;
2362
2363 if (type & PERF_SAMPLE_TID)
2364 array++;
2365
2366 if (type & PERF_SAMPLE_TIME)
2367 *timestamp = *array;
2368
2369 return 0;
2370}
2371
2235size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, 2372size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
2236 u64 read_format) 2373 u64 read_format)
2237{ 2374{
@@ -2342,8 +2479,7 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
2342 2479
2343int perf_event__synthesize_sample(union perf_event *event, u64 type, 2480int perf_event__synthesize_sample(union perf_event *event, u64 type,
2344 u64 read_format, 2481 u64 read_format,
2345 const struct perf_sample *sample, 2482 const struct perf_sample *sample)
2346 bool swapped)
2347{ 2483{
2348 u64 *array; 2484 u64 *array;
2349 size_t sz; 2485 size_t sz;
@@ -2368,15 +2504,6 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
2368 if (type & PERF_SAMPLE_TID) { 2504 if (type & PERF_SAMPLE_TID) {
2369 u.val32[0] = sample->pid; 2505 u.val32[0] = sample->pid;
2370 u.val32[1] = sample->tid; 2506 u.val32[1] = sample->tid;
2371 if (swapped) {
2372 /*
2373 * Inverse of what is done in perf_evsel__parse_sample
2374 */
2375 u.val32[0] = bswap_32(u.val32[0]);
2376 u.val32[1] = bswap_32(u.val32[1]);
2377 u.val64 = bswap_64(u.val64);
2378 }
2379
2380 *array = u.val64; 2507 *array = u.val64;
2381 array++; 2508 array++;
2382 } 2509 }
@@ -2403,13 +2530,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
2403 2530
2404 if (type & PERF_SAMPLE_CPU) { 2531 if (type & PERF_SAMPLE_CPU) {
2405 u.val32[0] = sample->cpu; 2532 u.val32[0] = sample->cpu;
2406 if (swapped) { 2533 u.val32[1] = 0;
2407 /*
2408 * Inverse of what is done in perf_evsel__parse_sample
2409 */
2410 u.val32[0] = bswap_32(u.val32[0]);
2411 u.val64 = bswap_64(u.val64);
2412 }
2413 *array = u.val64; 2534 *array = u.val64;
2414 array++; 2535 array++;
2415 } 2536 }
@@ -2456,15 +2577,6 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
2456 2577
2457 if (type & PERF_SAMPLE_RAW) { 2578 if (type & PERF_SAMPLE_RAW) {
2458 u.val32[0] = sample->raw_size; 2579 u.val32[0] = sample->raw_size;
2459 if (WARN_ONCE(swapped,
2460 "Endianness of raw data not corrected!\n")) {
2461 /*
2462 * Inverse of what is done in perf_evsel__parse_sample
2463 */
2464 u.val32[0] = bswap_32(u.val32[0]);
2465 u.val32[1] = bswap_32(u.val32[1]);
2466 u.val64 = bswap_64(u.val64);
2467 }
2468 *array = u.val64; 2580 *array = u.val64;
2469 array = (void *)array + sizeof(u32); 2581 array = (void *)array + sizeof(u32);
2470 2582
@@ -2743,8 +2855,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
2743 break; 2855 break;
2744 case EOPNOTSUPP: 2856 case EOPNOTSUPP:
2745 if (evsel->attr.sample_period != 0) 2857 if (evsel->attr.sample_period != 0)
2746 return scnprintf(msg, size, "%s", 2858 return scnprintf(msg, size,
2747 "PMU Hardware doesn't support sampling/overflow-interrupts."); 2859 "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'",
2860 perf_evsel__name(evsel));
2748 if (evsel->attr.precise_ip) 2861 if (evsel->attr.precise_ip)
2749 return scnprintf(msg, size, "%s", 2862 return scnprintf(msg, size, "%s",
2750 "\'precise\' request may not be supported. Try removing 'p' modifier."); 2863 "\'precise\' request may not be supported. Try removing 'p' modifier.");
@@ -2781,16 +2894,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
2781 perf_evsel__name(evsel)); 2894 perf_evsel__name(evsel));
2782} 2895}
2783 2896
2784char *perf_evsel__env_arch(struct perf_evsel *evsel) 2897struct perf_env *perf_evsel__env(struct perf_evsel *evsel)
2785{
2786 if (evsel && evsel->evlist && evsel->evlist->env)
2787 return evsel->evlist->env->arch;
2788 return NULL;
2789}
2790
2791char *perf_evsel__env_cpuid(struct perf_evsel *evsel)
2792{ 2898{
2793 if (evsel && evsel->evlist && evsel->evlist->env) 2899 if (evsel && evsel->evlist)
2794 return evsel->evlist->env->cpuid; 2900 return evsel->evlist->env;
2795 return NULL; 2901 return NULL;
2796} 2902}
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 157f49e8a772..846e41644525 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -38,7 +38,7 @@ struct cgroup_sel;
38 * It is allocated within event parsing and attached to 38 * It is allocated within event parsing and attached to
39 * perf_evsel::config_terms list head. 39 * perf_evsel::config_terms list head.
40*/ 40*/
41enum { 41enum term_type {
42 PERF_EVSEL__CONFIG_TERM_PERIOD, 42 PERF_EVSEL__CONFIG_TERM_PERIOD,
43 PERF_EVSEL__CONFIG_TERM_FREQ, 43 PERF_EVSEL__CONFIG_TERM_FREQ,
44 PERF_EVSEL__CONFIG_TERM_TIME, 44 PERF_EVSEL__CONFIG_TERM_TIME,
@@ -49,12 +49,11 @@ enum {
49 PERF_EVSEL__CONFIG_TERM_OVERWRITE, 49 PERF_EVSEL__CONFIG_TERM_OVERWRITE,
50 PERF_EVSEL__CONFIG_TERM_DRV_CFG, 50 PERF_EVSEL__CONFIG_TERM_DRV_CFG,
51 PERF_EVSEL__CONFIG_TERM_BRANCH, 51 PERF_EVSEL__CONFIG_TERM_BRANCH,
52 PERF_EVSEL__CONFIG_TERM_MAX,
53}; 52};
54 53
55struct perf_evsel_config_term { 54struct perf_evsel_config_term {
56 struct list_head list; 55 struct list_head list;
57 int type; 56 enum term_type type;
58 union { 57 union {
59 u64 period; 58 u64 period;
60 u64 freq; 59 u64 freq;
@@ -339,6 +338,10 @@ static inline int perf_evsel__read_on_cpu_scaled(struct perf_evsel *evsel,
339int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, 338int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
340 struct perf_sample *sample); 339 struct perf_sample *sample);
341 340
341int perf_evsel__parse_sample_timestamp(struct perf_evsel *evsel,
342 union perf_event *event,
343 u64 *timestamp);
344
342static inline struct perf_evsel *perf_evsel__next(struct perf_evsel *evsel) 345static inline struct perf_evsel *perf_evsel__next(struct perf_evsel *evsel)
343{ 346{
344 return list_entry(evsel->node.next, struct perf_evsel, node); 347 return list_entry(evsel->node.next, struct perf_evsel, node);
@@ -443,7 +446,6 @@ typedef int (*attr__fprintf_f)(FILE *, const char *, const char *, void *);
443int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, 446int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
444 attr__fprintf_f attr__fprintf, void *priv); 447 attr__fprintf_f attr__fprintf, void *priv);
445 448
446char *perf_evsel__env_arch(struct perf_evsel *evsel); 449struct perf_env *perf_evsel__env(struct perf_evsel *evsel);
447char *perf_evsel__env_cpuid(struct perf_evsel *evsel);
448 450
449#endif /* __PERF_EVSEL_H */ 451#endif /* __PERF_EVSEL_H */
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 9bbcec4e3365..ff17920a5ebc 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -38,7 +38,7 @@ do
38done 38done
39echo "#endif /* HAVE_LIBELF_SUPPORT */" 39echo "#endif /* HAVE_LIBELF_SUPPORT */"
40 40
41echo "#ifdef HAVE_LIBAUDIT_SUPPORT" 41echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)"
42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | 42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
43sort | 43sort |
44while read cmd 44while read cmd
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 7c0e9d587bfa..a326e0d8b5b6 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -15,9 +15,8 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/stringify.h> 16#include <linux/stringify.h>
17#include <sys/stat.h> 17#include <sys/stat.h>
18#include <sys/types.h>
19#include <sys/utsname.h> 18#include <sys/utsname.h>
20#include <unistd.h> 19#include <linux/time64.h>
21 20
22#include "evlist.h" 21#include "evlist.h"
23#include "evsel.h" 22#include "evsel.h"
@@ -37,6 +36,7 @@
37#include <api/fs/fs.h> 36#include <api/fs/fs.h>
38#include "asm/bug.h" 37#include "asm/bug.h"
39#include "tool.h" 38#include "tool.h"
39#include "time-utils.h"
40 40
41#include "sane_ctype.h" 41#include "sane_ctype.h"
42 42
@@ -1182,6 +1182,20 @@ static int write_stat(struct feat_fd *ff __maybe_unused,
1182 return 0; 1182 return 0;
1183} 1183}
1184 1184
1185static int write_sample_time(struct feat_fd *ff,
1186 struct perf_evlist *evlist)
1187{
1188 int ret;
1189
1190 ret = do_write(ff, &evlist->first_sample_time,
1191 sizeof(evlist->first_sample_time));
1192 if (ret < 0)
1193 return ret;
1194
1195 return do_write(ff, &evlist->last_sample_time,
1196 sizeof(evlist->last_sample_time));
1197}
1198
1185static void print_hostname(struct feat_fd *ff, FILE *fp) 1199static void print_hostname(struct feat_fd *ff, FILE *fp)
1186{ 1200{
1187 fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); 1201 fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname);
@@ -1507,6 +1521,28 @@ static void print_group_desc(struct feat_fd *ff, FILE *fp)
1507 } 1521 }
1508} 1522}
1509 1523
1524static void print_sample_time(struct feat_fd *ff, FILE *fp)
1525{
1526 struct perf_session *session;
1527 char time_buf[32];
1528 double d;
1529
1530 session = container_of(ff->ph, struct perf_session, header);
1531
1532 timestamp__scnprintf_usec(session->evlist->first_sample_time,
1533 time_buf, sizeof(time_buf));
1534 fprintf(fp, "# time of first sample : %s\n", time_buf);
1535
1536 timestamp__scnprintf_usec(session->evlist->last_sample_time,
1537 time_buf, sizeof(time_buf));
1538 fprintf(fp, "# time of last sample : %s\n", time_buf);
1539
1540 d = (double)(session->evlist->last_sample_time -
1541 session->evlist->first_sample_time) / NSEC_PER_MSEC;
1542
1543 fprintf(fp, "# sample duration : %10.3f ms\n", d);
1544}
1545
1510static int __event_process_build_id(struct build_id_event *bev, 1546static int __event_process_build_id(struct build_id_event *bev,
1511 char *filename, 1547 char *filename,
1512 struct perf_session *session) 1548 struct perf_session *session)
@@ -2148,6 +2184,27 @@ out_free_caches:
2148 return -1; 2184 return -1;
2149} 2185}
2150 2186
2187static int process_sample_time(struct feat_fd *ff, void *data __maybe_unused)
2188{
2189 struct perf_session *session;
2190 u64 first_sample_time, last_sample_time;
2191 int ret;
2192
2193 session = container_of(ff->ph, struct perf_session, header);
2194
2195 ret = do_read_u64(ff, &first_sample_time);
2196 if (ret)
2197 return -1;
2198
2199 ret = do_read_u64(ff, &last_sample_time);
2200 if (ret)
2201 return -1;
2202
2203 session->evlist->first_sample_time = first_sample_time;
2204 session->evlist->last_sample_time = last_sample_time;
2205 return 0;
2206}
2207
2151struct feature_ops { 2208struct feature_ops {
2152 int (*write)(struct feat_fd *ff, struct perf_evlist *evlist); 2209 int (*write)(struct feat_fd *ff, struct perf_evlist *evlist);
2153 void (*print)(struct feat_fd *ff, FILE *fp); 2210 void (*print)(struct feat_fd *ff, FILE *fp);
@@ -2205,6 +2262,7 @@ static const struct feature_ops feat_ops[HEADER_LAST_FEATURE] = {
2205 FEAT_OPN(AUXTRACE, auxtrace, false), 2262 FEAT_OPN(AUXTRACE, auxtrace, false),
2206 FEAT_OPN(STAT, stat, false), 2263 FEAT_OPN(STAT, stat, false),
2207 FEAT_OPN(CACHE, cache, true), 2264 FEAT_OPN(CACHE, cache, true),
2265 FEAT_OPR(SAMPLE_TIME, sample_time, false),
2208}; 2266};
2209 2267
2210struct header_print_data { 2268struct header_print_data {
@@ -3258,6 +3316,74 @@ int perf_event__synthesize_attrs(struct perf_tool *tool,
3258 return err; 3316 return err;
3259} 3317}
3260 3318
3319static bool has_unit(struct perf_evsel *counter)
3320{
3321 return counter->unit && *counter->unit;
3322}
3323
3324static bool has_scale(struct perf_evsel *counter)
3325{
3326 return counter->scale != 1;
3327}
3328
3329int perf_event__synthesize_extra_attr(struct perf_tool *tool,
3330 struct perf_evlist *evsel_list,
3331 perf_event__handler_t process,
3332 bool is_pipe)
3333{
3334 struct perf_evsel *counter;
3335 int err;
3336
3337 /*
3338 * Synthesize other events stuff not carried within
3339 * attr event - unit, scale, name
3340 */
3341 evlist__for_each_entry(evsel_list, counter) {
3342 if (!counter->supported)
3343 continue;
3344
3345 /*
3346 * Synthesize unit and scale only if it's defined.
3347 */
3348 if (has_unit(counter)) {
3349 err = perf_event__synthesize_event_update_unit(tool, counter, process);
3350 if (err < 0) {
3351 pr_err("Couldn't synthesize evsel unit.\n");
3352 return err;
3353 }
3354 }
3355
3356 if (has_scale(counter)) {
3357 err = perf_event__synthesize_event_update_scale(tool, counter, process);
3358 if (err < 0) {
3359 pr_err("Couldn't synthesize evsel counter.\n");
3360 return err;
3361 }
3362 }
3363
3364 if (counter->own_cpus) {
3365 err = perf_event__synthesize_event_update_cpus(tool, counter, process);
3366 if (err < 0) {
3367 pr_err("Couldn't synthesize evsel cpus.\n");
3368 return err;
3369 }
3370 }
3371
3372 /*
3373 * Name is needed only for pipe output,
3374 * perf.data carries event names.
3375 */
3376 if (is_pipe) {
3377 err = perf_event__synthesize_event_update_name(tool, counter, process);
3378 if (err < 0) {
3379 pr_err("Couldn't synthesize evsel name.\n");
3380 return err;
3381 }
3382 }
3383 }
3384 return 0;
3385}
3386
3261int perf_event__process_attr(struct perf_tool *tool __maybe_unused, 3387int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
3262 union perf_event *event, 3388 union perf_event *event,
3263 struct perf_evlist **pevlist) 3389 struct perf_evlist **pevlist)
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 29ccbfdf8724..f28aaaa3a440 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -9,6 +9,7 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include "event.h" 10#include "event.h"
11#include "env.h" 11#include "env.h"
12#include "pmu.h"
12 13
13enum { 14enum {
14 HEADER_RESERVED = 0, /* always cleared */ 15 HEADER_RESERVED = 0, /* always cleared */
@@ -34,6 +35,7 @@ enum {
34 HEADER_AUXTRACE, 35 HEADER_AUXTRACE,
35 HEADER_STAT, 36 HEADER_STAT,
36 HEADER_CACHE, 37 HEADER_CACHE,
38 HEADER_SAMPLE_TIME,
37 HEADER_LAST_FEATURE, 39 HEADER_LAST_FEATURE,
38 HEADER_FEAT_BITS = 256, 40 HEADER_FEAT_BITS = 256,
39}; 41};
@@ -107,6 +109,11 @@ int perf_event__synthesize_features(struct perf_tool *tool,
107 struct perf_evlist *evlist, 109 struct perf_evlist *evlist,
108 perf_event__handler_t process); 110 perf_event__handler_t process);
109 111
112int perf_event__synthesize_extra_attr(struct perf_tool *tool,
113 struct perf_evlist *evsel_list,
114 perf_event__handler_t process,
115 bool is_pipe);
116
110int perf_event__process_feature(struct perf_tool *tool, 117int perf_event__process_feature(struct perf_tool *tool,
111 union perf_event *event, 118 union perf_event *event,
112 struct perf_session *session); 119 struct perf_session *session);
@@ -166,5 +173,5 @@ int write_padded(struct feat_fd *fd, const void *bf,
166 */ 173 */
167int get_cpuid(char *buffer, size_t sz); 174int get_cpuid(char *buffer, size_t sz);
168 175
169char *get_cpuid_str(void); 176char *get_cpuid_str(struct perf_pmu *pmu __maybe_unused);
170#endif /* __PERF_HEADER_H */ 177#endif /* __PERF_HEADER_H */
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c
index 5325e65f9711..72db2744876d 100644
--- a/tools/perf/util/intel-bts.c
+++ b/tools/perf/util/intel-bts.c
@@ -67,7 +67,6 @@ struct intel_bts {
67 u64 branches_sample_type; 67 u64 branches_sample_type;
68 u64 branches_id; 68 u64 branches_id;
69 size_t branches_event_size; 69 size_t branches_event_size;
70 bool synth_needs_swap;
71 unsigned long num_events; 70 unsigned long num_events;
72}; 71};
73 72
@@ -303,8 +302,7 @@ static int intel_bts_synth_branch_sample(struct intel_bts_queue *btsq,
303 event.sample.header.size = bts->branches_event_size; 302 event.sample.header.size = bts->branches_event_size;
304 ret = perf_event__synthesize_sample(&event, 303 ret = perf_event__synthesize_sample(&event,
305 bts->branches_sample_type, 304 bts->branches_sample_type,
306 0, &sample, 305 0, &sample);
307 bts->synth_needs_swap);
308 if (ret) 306 if (ret)
309 return ret; 307 return ret;
310 } 308 }
@@ -841,8 +839,6 @@ static int intel_bts_synth_events(struct intel_bts *bts,
841 __perf_evsel__sample_size(attr.sample_type); 839 __perf_evsel__sample_size(attr.sample_type);
842 } 840 }
843 841
844 bts->synth_needs_swap = evsel->needs_swap;
845
846 return 0; 842 return 0;
847} 843}
848 844
diff --git a/tools/perf/util/intel-pt-decoder/Build b/tools/perf/util/intel-pt-decoder/Build
index 10e0814bb8d2..1b704fbea9de 100644
--- a/tools/perf/util/intel-pt-decoder/Build
+++ b/tools/perf/util/intel-pt-decoder/Build
@@ -11,15 +11,21 @@ $(OUTPUT)util/intel-pt-decoder/inat-tables.c: $(inat_tables_script) $(inat_table
11 11
12$(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/intel-pt-insn-decoder.c util/intel-pt-decoder/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c 12$(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/intel-pt-insn-decoder.c util/intel-pt-decoder/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c
13 @(diff -I 2>&1 | grep -q 'option requires an argument' && \ 13 @(diff -I 2>&1 | grep -q 'option requires an argument' && \
14 test -d ../../kernel -a -d ../../tools -a -d ../perf && (( \ 14 test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \
15 diff -B -I'^#include' util/intel-pt-decoder/insn.c ../../arch/x86/lib/insn.c >/dev/null && \ 15 ((diff -B -I'^#include' util/intel-pt-decoder/insn.c ../../arch/x86/lib/insn.c >/dev/null) || \
16 diff -B -I'^#include' util/intel-pt-decoder/inat.c ../../arch/x86/lib/inat.c >/dev/null && \ 16 (echo "Warning: Intel PT: x86 instruction decoder C file at 'tools/perf/util/intel-pt-decoder/insn.c' differs from latest version at 'arch/x86/lib/insn.c'" >&2)) && \
17 diff -B util/intel-pt-decoder/x86-opcode-map.txt ../../arch/x86/lib/x86-opcode-map.txt >/dev/null && \ 17 ((diff -B -I'^#include' util/intel-pt-decoder/inat.c ../../arch/x86/lib/inat.c >/dev/null) || \
18 diff -B util/intel-pt-decoder/gen-insn-attr-x86.awk ../../arch/x86/tools/gen-insn-attr-x86.awk >/dev/null && \ 18 (echo "Warning: Intel PT: x86 instruction decoder C file at 'tools/perf/util/intel-pt-decoder/inat.c' differs from latest version at 'arch/x86/lib/inat.c'" >&2)) && \
19 diff -B -I'^#include' util/intel-pt-decoder/insn.h ../../arch/x86/include/asm/insn.h >/dev/null && \ 19 ((diff -B util/intel-pt-decoder/x86-opcode-map.txt ../../arch/x86/lib/x86-opcode-map.txt >/dev/null) || \
20 diff -B -I'^#include' util/intel-pt-decoder/inat.h ../../arch/x86/include/asm/inat.h >/dev/null && \ 20 (echo "Warning: Intel PT: x86 instruction decoder map file at 'tools/perf/util/intel-pt-decoder/x86-opcode-map.txt' differs from latest version at 'arch/x86/lib/x86-opcode-map.txt'" >&2)) && \
21 diff -B -I'^#include' util/intel-pt-decoder/inat_types.h ../../arch/x86/include/asm/inat_types.h >/dev/null) \ 21 ((diff -B util/intel-pt-decoder/gen-insn-attr-x86.awk ../../arch/x86/tools/gen-insn-attr-x86.awk >/dev/null) || \
22 || echo "Warning: Intel PT: x86 instruction decoder differs from kernel" >&2 )) || true 22 (echo "Warning: Intel PT: x86 instruction decoder script at 'tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk' differs from latest version at 'arch/x86/tools/gen-insn-attr-x86.awk'" >&2)) && \
23 ((diff -B -I'^#include' util/intel-pt-decoder/insn.h ../../arch/x86/include/asm/insn.h >/dev/null) || \
24 (echo "Warning: Intel PT: x86 instruction decoder header at 'tools/perf/util/intel-pt-decoder/insn.h' differs from latest version at 'arch/x86/include/asm/insn.h'" >&2)) && \
25 ((diff -B -I'^#include' util/intel-pt-decoder/inat.h ../../arch/x86/include/asm/inat.h >/dev/null) || \
26 (echo "Warning: Intel PT: x86 instruction decoder header at 'tools/perf/util/intel-pt-decoder/inat.h' differs from latest version at 'arch/x86/include/asm/inat.h'" >&2)) && \
27 ((diff -B -I'^#include' util/intel-pt-decoder/inat_types.h ../../arch/x86/include/asm/inat_types.h >/dev/null) || \
28 (echo "Warning: Intel PT: x86 instruction decoder header at 'tools/perf/util/intel-pt-decoder/inat_types.h' differs from latest version at 'arch/x86/include/asm/inat_types.h'" >&2)))) || true
23 $(call rule_mkdir) 29 $(call rule_mkdir)
24 $(call if_changed_dep,cc_o_c) 30 $(call if_changed_dep,cc_o_c)
25 31
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 23f9ba676df0..3773d9c54f45 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -104,8 +104,6 @@ struct intel_pt {
104 u64 pwrx_id; 104 u64 pwrx_id;
105 u64 cbr_id; 105 u64 cbr_id;
106 106
107 bool synth_needs_swap;
108
109 u64 tsc_bit; 107 u64 tsc_bit;
110 u64 mtc_bit; 108 u64 mtc_bit;
111 u64 mtc_freq_bits; 109 u64 mtc_freq_bits;
@@ -1101,11 +1099,10 @@ static void intel_pt_prep_b_sample(struct intel_pt *pt,
1101} 1099}
1102 1100
1103static int intel_pt_inject_event(union perf_event *event, 1101static int intel_pt_inject_event(union perf_event *event,
1104 struct perf_sample *sample, u64 type, 1102 struct perf_sample *sample, u64 type)
1105 bool swapped)
1106{ 1103{
1107 event->header.size = perf_event__sample_event_size(sample, type, 0); 1104 event->header.size = perf_event__sample_event_size(sample, type, 0);
1108 return perf_event__synthesize_sample(event, type, 0, sample, swapped); 1105 return perf_event__synthesize_sample(event, type, 0, sample);
1109} 1106}
1110 1107
1111static inline int intel_pt_opt_inject(struct intel_pt *pt, 1108static inline int intel_pt_opt_inject(struct intel_pt *pt,
@@ -1115,7 +1112,7 @@ static inline int intel_pt_opt_inject(struct intel_pt *pt,
1115 if (!pt->synth_opts.inject) 1112 if (!pt->synth_opts.inject)
1116 return 0; 1113 return 0;
1117 1114
1118 return intel_pt_inject_event(event, sample, type, pt->synth_needs_swap); 1115 return intel_pt_inject_event(event, sample, type);
1119} 1116}
1120 1117
1121static int intel_pt_deliver_synth_b_event(struct intel_pt *pt, 1118static int intel_pt_deliver_synth_b_event(struct intel_pt *pt,
@@ -2329,8 +2326,6 @@ static int intel_pt_synth_events(struct intel_pt *pt,
2329 id += 1; 2326 id += 1;
2330 } 2327 }
2331 2328
2332 pt->synth_needs_swap = evsel->needs_swap;
2333
2334 return 0; 2329 return 0;
2335} 2330}
2336 2331
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 270f3223c6df..b05a67464c03 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1726,7 +1726,7 @@ static char *callchain_srcline(struct map *map, struct symbol *sym, u64 ip)
1726 bool show_addr = callchain_param.key == CCKEY_ADDRESS; 1726 bool show_addr = callchain_param.key == CCKEY_ADDRESS;
1727 1727
1728 srcline = get_srcline(map->dso, map__rip_2objdump(map, ip), 1728 srcline = get_srcline(map->dso, map__rip_2objdump(map, ip),
1729 sym, show_sym, show_addr); 1729 sym, show_sym, show_addr, ip);
1730 srcline__tree_insert(&map->dso->srclines, ip, srcline); 1730 srcline__tree_insert(&map->dso->srclines, ip, srcline);
1731 } 1731 }
1732 1732
@@ -2204,7 +2204,7 @@ int thread__resolve_callchain(struct thread *thread,
2204{ 2204{
2205 int ret = 0; 2205 int ret = 0;
2206 2206
2207 callchain_cursor_reset(&callchain_cursor); 2207 callchain_cursor_reset(cursor);
2208 2208
2209 if (callchain_param.order == ORDER_CALLEE) { 2209 if (callchain_param.order == ORDER_CALLEE) {
2210 ret = thread__resolve_callchain_sample(thread, cursor, 2210 ret = thread__resolve_callchain_sample(thread, cursor,
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 6d40efd74402..8fe57031e1a8 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -419,7 +419,7 @@ int map__fprintf_srcline(struct map *map, u64 addr, const char *prefix,
419 if (map && map->dso) { 419 if (map && map->dso) {
420 srcline = get_srcline(map->dso, 420 srcline = get_srcline(map->dso,
421 map__rip_2objdump(map, addr), NULL, 421 map__rip_2objdump(map, addr), NULL,
422 true, true); 422 true, true, addr);
423 if (srcline != SRCLINE_UNKNOWN) 423 if (srcline != SRCLINE_UNKNOWN)
424 ret = fprintf(fp, "%s%s", prefix, srcline); 424 ret = fprintf(fp, "%s%s", prefix, srcline);
425 free_srcline(srcline); 425 free_srcline(srcline);
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 0ddd9c199227..1ddc3d1d0147 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -20,12 +20,10 @@
20#include "pmu.h" 20#include "pmu.h"
21#include "expr.h" 21#include "expr.h"
22#include "rblist.h" 22#include "rblist.h"
23#include "pmu.h"
24#include <string.h> 23#include <string.h>
25#include <stdbool.h> 24#include <stdbool.h>
26#include <errno.h> 25#include <errno.h>
27#include "pmu-events/pmu-events.h" 26#include "pmu-events/pmu-events.h"
28#include "strbuf.h"
29#include "strlist.h" 27#include "strlist.h"
30#include <assert.h> 28#include <assert.h>
31#include <ctype.h> 29#include <ctype.h>
@@ -38,6 +36,10 @@ struct metric_event *metricgroup__lookup(struct rblist *metric_events,
38 struct metric_event me = { 36 struct metric_event me = {
39 .evsel = evsel 37 .evsel = evsel
40 }; 38 };
39
40 if (!metric_events)
41 return NULL;
42
41 nd = rblist__find(metric_events, &me); 43 nd = rblist__find(metric_events, &me);
42 if (nd) 44 if (nd)
43 return container_of(nd, struct metric_event, nd); 45 return container_of(nd, struct metric_event, nd);
@@ -270,7 +272,7 @@ static void metricgroup__print_strlist(struct strlist *metrics, bool raw)
270void metricgroup__print(bool metrics, bool metricgroups, char *filter, 272void metricgroup__print(bool metrics, bool metricgroups, char *filter,
271 bool raw) 273 bool raw)
272{ 274{
273 struct pmu_events_map *map = perf_pmu__find_map(); 275 struct pmu_events_map *map = perf_pmu__find_map(NULL);
274 struct pmu_event *pe; 276 struct pmu_event *pe;
275 int i; 277 int i;
276 struct rblist groups; 278 struct rblist groups;
@@ -368,7 +370,7 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,
368static int metricgroup__add_metric(const char *metric, struct strbuf *events, 370static int metricgroup__add_metric(const char *metric, struct strbuf *events,
369 struct list_head *group_list) 371 struct list_head *group_list)
370{ 372{
371 struct pmu_events_map *map = perf_pmu__find_map(); 373 struct pmu_events_map *map = perf_pmu__find_map(NULL);
372 struct pmu_event *pe; 374 struct pmu_event *pe;
373 int ret = -EINVAL; 375 int ret = -EINVAL;
374 int i, j; 376 int i, j;
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 9fe5f9c7d577..05076e683938 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -21,33 +21,13 @@ size_t perf_mmap__mmap_len(struct perf_mmap *map)
21} 21}
22 22
23/* When check_messup is true, 'end' must points to a good entry */ 23/* When check_messup is true, 'end' must points to a good entry */
24static union perf_event *perf_mmap__read(struct perf_mmap *map, bool check_messup, 24static union perf_event *perf_mmap__read(struct perf_mmap *map,
25 u64 start, u64 end, u64 *prev) 25 u64 start, u64 end, u64 *prev)
26{ 26{
27 unsigned char *data = map->base + page_size; 27 unsigned char *data = map->base + page_size;
28 union perf_event *event = NULL; 28 union perf_event *event = NULL;
29 int diff = end - start; 29 int diff = end - start;
30 30
31 if (check_messup) {
32 /*
33 * If we're further behind than half the buffer, there's a chance
34 * the writer will bite our tail and mess up the samples under us.
35 *
36 * If we somehow ended up ahead of the 'end', we got messed up.
37 *
38 * In either case, truncate and restart at 'end'.
39 */
40 if (diff > map->mask / 2 || diff < 0) {
41 fprintf(stderr, "WARNING: failed to keep up with mmap data.\n");
42
43 /*
44 * 'end' points to a known good entry, start there.
45 */
46 start = end;
47 diff = 0;
48 }
49 }
50
51 if (diff >= (int)sizeof(event->header)) { 31 if (diff >= (int)sizeof(event->header)) {
52 size_t size; 32 size_t size;
53 33
@@ -89,7 +69,7 @@ broken_event:
89 return event; 69 return event;
90} 70}
91 71
92union perf_event *perf_mmap__read_forward(struct perf_mmap *map, bool check_messup) 72union perf_event *perf_mmap__read_forward(struct perf_mmap *map)
93{ 73{
94 u64 head; 74 u64 head;
95 u64 old = map->prev; 75 u64 old = map->prev;
@@ -102,7 +82,7 @@ union perf_event *perf_mmap__read_forward(struct perf_mmap *map, bool check_mess
102 82
103 head = perf_mmap__read_head(map); 83 head = perf_mmap__read_head(map);
104 84
105 return perf_mmap__read(map, check_messup, old, head, &map->prev); 85 return perf_mmap__read(map, old, head, &map->prev);
106} 86}
107 87
108union perf_event *perf_mmap__read_backward(struct perf_mmap *map) 88union perf_event *perf_mmap__read_backward(struct perf_mmap *map)
@@ -138,7 +118,7 @@ union perf_event *perf_mmap__read_backward(struct perf_mmap *map)
138 else 118 else
139 end = head + map->mask + 1; 119 end = head + map->mask + 1;
140 120
141 return perf_mmap__read(map, false, start, end, &map->prev); 121 return perf_mmap__read(map, start, end, &map->prev);
142} 122}
143 123
144void perf_mmap__read_catchup(struct perf_mmap *map) 124void perf_mmap__read_catchup(struct perf_mmap *map)
@@ -254,18 +234,18 @@ int perf_mmap__mmap(struct perf_mmap *map, struct mmap_params *mp, int fd)
254 return 0; 234 return 0;
255} 235}
256 236
257static int backward_rb_find_range(void *buf, int mask, u64 head, u64 *start, u64 *end) 237static int overwrite_rb_find_range(void *buf, int mask, u64 head, u64 *start, u64 *end)
258{ 238{
259 struct perf_event_header *pheader; 239 struct perf_event_header *pheader;
260 u64 evt_head = head; 240 u64 evt_head = head;
261 int size = mask + 1; 241 int size = mask + 1;
262 242
263 pr_debug2("backward_rb_find_range: buf=%p, head=%"PRIx64"\n", buf, head); 243 pr_debug2("overwrite_rb_find_range: buf=%p, head=%"PRIx64"\n", buf, head);
264 pheader = (struct perf_event_header *)(buf + (head & mask)); 244 pheader = (struct perf_event_header *)(buf + (head & mask));
265 *start = head; 245 *start = head;
266 while (true) { 246 while (true) {
267 if (evt_head - head >= (unsigned int)size) { 247 if (evt_head - head >= (unsigned int)size) {
268 pr_debug("Finished reading backward ring buffer: rewind\n"); 248 pr_debug("Finished reading overwrite ring buffer: rewind\n");
269 if (evt_head - head > (unsigned int)size) 249 if (evt_head - head > (unsigned int)size)
270 evt_head -= pheader->size; 250 evt_head -= pheader->size;
271 *end = evt_head; 251 *end = evt_head;
@@ -275,7 +255,7 @@ static int backward_rb_find_range(void *buf, int mask, u64 head, u64 *start, u64
275 pheader = (struct perf_event_header *)(buf + (evt_head & mask)); 255 pheader = (struct perf_event_header *)(buf + (evt_head & mask));
276 256
277 if (pheader->size == 0) { 257 if (pheader->size == 0) {
278 pr_debug("Finished reading backward ring buffer: get start\n"); 258 pr_debug("Finished reading overwrite ring buffer: get start\n");
279 *end = evt_head; 259 *end = evt_head;
280 return 0; 260 return 0;
281 } 261 }
@@ -287,19 +267,7 @@ static int backward_rb_find_range(void *buf, int mask, u64 head, u64 *start, u64
287 return -1; 267 return -1;
288} 268}
289 269
290static int rb_find_range(void *data, int mask, u64 head, u64 old, 270int perf_mmap__push(struct perf_mmap *md, bool overwrite,
291 u64 *start, u64 *end, bool backward)
292{
293 if (!backward) {
294 *start = old;
295 *end = head;
296 return 0;
297 }
298
299 return backward_rb_find_range(data, mask, head, start, end);
300}
301
302int perf_mmap__push(struct perf_mmap *md, bool overwrite, bool backward,
303 void *to, int push(void *to, void *buf, size_t size)) 271 void *to, int push(void *to, void *buf, size_t size))
304{ 272{
305 u64 head = perf_mmap__read_head(md); 273 u64 head = perf_mmap__read_head(md);
@@ -310,19 +278,28 @@ int perf_mmap__push(struct perf_mmap *md, bool overwrite, bool backward,
310 void *buf; 278 void *buf;
311 int rc = 0; 279 int rc = 0;
312 280
313 if (rb_find_range(data, md->mask, head, old, &start, &end, backward)) 281 start = overwrite ? head : old;
314 return -1; 282 end = overwrite ? old : head;
315 283
316 if (start == end) 284 if (start == end)
317 return 0; 285 return 0;
318 286
319 size = end - start; 287 size = end - start;
320 if (size > (unsigned long)(md->mask) + 1) { 288 if (size > (unsigned long)(md->mask) + 1) {
321 WARN_ONCE(1, "failed to keep up with mmap data. (warn only once)\n"); 289 if (!overwrite) {
290 WARN_ONCE(1, "failed to keep up with mmap data. (warn only once)\n");
322 291
323 md->prev = head; 292 md->prev = head;
324 perf_mmap__consume(md, overwrite || backward); 293 perf_mmap__consume(md, overwrite);
325 return 0; 294 return 0;
295 }
296
297 /*
298 * Backward ring buffer is full. We still have a chance to read
299 * most of data from it.
300 */
301 if (overwrite_rb_find_range(data, md->mask, head, &start, &end))
302 return -1;
326 } 303 }
327 304
328 if ((start & md->mask) + size != (end & md->mask)) { 305 if ((start & md->mask) + size != (end & md->mask)) {
@@ -346,7 +323,7 @@ int perf_mmap__push(struct perf_mmap *md, bool overwrite, bool backward,
346 } 323 }
347 324
348 md->prev = head; 325 md->prev = head;
349 perf_mmap__consume(md, overwrite || backward); 326 perf_mmap__consume(md, overwrite);
350out: 327out:
351 return rc; 328 return rc;
352} 329}
diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h
index 3a5cb5a6e94a..e43d7b55a55f 100644
--- a/tools/perf/util/mmap.h
+++ b/tools/perf/util/mmap.h
@@ -86,10 +86,10 @@ static inline void perf_mmap__write_tail(struct perf_mmap *md, u64 tail)
86 pc->data_tail = tail; 86 pc->data_tail = tail;
87} 87}
88 88
89union perf_event *perf_mmap__read_forward(struct perf_mmap *map, bool check_messup); 89union perf_event *perf_mmap__read_forward(struct perf_mmap *map);
90union perf_event *perf_mmap__read_backward(struct perf_mmap *map); 90union perf_event *perf_mmap__read_backward(struct perf_mmap *map);
91 91
92int perf_mmap__push(struct perf_mmap *md, bool overwrite, bool backward, 92int perf_mmap__push(struct perf_mmap *md, bool backward,
93 void *to, int push(void *to, void *buf, size_t size)); 93 void *to, int push(void *to, void *buf, size_t size));
94 94
95size_t perf_mmap__mmap_len(struct perf_mmap *map); 95size_t perf_mmap__mmap_len(struct perf_mmap *map);
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 8e09fd2d842f..bad9e0296e9a 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -157,9 +157,8 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve
157} 157}
158 158
159int ordered_events__queue(struct ordered_events *oe, union perf_event *event, 159int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
160 struct perf_sample *sample, u64 file_offset) 160 u64 timestamp, u64 file_offset)
161{ 161{
162 u64 timestamp = sample->time;
163 struct ordered_event *oevent; 162 struct ordered_event *oevent;
164 163
165 if (!timestamp || timestamp == ~0ULL) 164 if (!timestamp || timestamp == ~0ULL)
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index 96e5292d88e2..8c7a2948593e 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -45,7 +45,7 @@ struct ordered_events {
45}; 45};
46 46
47int ordered_events__queue(struct ordered_events *oe, union perf_event *event, 47int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
48 struct perf_sample *sample, u64 file_offset); 48 u64 timestamp, u64 file_offset);
49void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event); 49void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
50int ordered_events__flush(struct ordered_events *oe, enum oe_flush how); 50int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
51void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver); 51void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 170316795a18..34589c427e52 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -4,6 +4,9 @@
4#include <dirent.h> 4#include <dirent.h>
5#include <errno.h> 5#include <errno.h>
6#include <sys/ioctl.h> 6#include <sys/ioctl.h>
7#include <sys/types.h>
8#include <sys/stat.h>
9#include <fcntl.h>
7#include <sys/param.h> 10#include <sys/param.h>
8#include "term.h" 11#include "term.h"
9#include "../perf.h" 12#include "../perf.h"
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index 933f5c6bffb4..ca56ba2dd3da 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -18,6 +18,7 @@
18#include <stdio.h> 18#include <stdio.h>
19#include <sys/types.h> 19#include <sys/types.h>
20#include <sys/stat.h> 20#include <sys/stat.h>
21#include <dirent.h>
21#include <unistd.h> 22#include <unistd.h>
22 23
23static char bad_path[] = "/bad-path/"; 24static char bad_path[] = "/bad-path/";
@@ -77,3 +78,16 @@ bool is_regular_file(const char *file)
77 78
78 return S_ISREG(st.st_mode); 79 return S_ISREG(st.st_mode);
79} 80}
81
82/* Helper function for filesystems that return a dent->d_type DT_UNKNOWN */
83bool is_directory(const char *base_path, const struct dirent *dent)
84{
85 char path[PATH_MAX];
86 struct stat st;
87
88 sprintf(path, "%s/%s", base_path, dent->d_name);
89 if (stat(path, &st))
90 return false;
91
92 return S_ISDIR(st.st_mode);
93}
diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h
index 14a254ada7eb..f014f905df50 100644
--- a/tools/perf/util/path.h
+++ b/tools/perf/util/path.h
@@ -2,9 +2,12 @@
2#ifndef _PERF_PATH_H 2#ifndef _PERF_PATH_H
3#define _PERF_PATH_H 3#define _PERF_PATH_H
4 4
5struct dirent;
6
5int path__join(char *bf, size_t size, const char *path1, const char *path2); 7int path__join(char *bf, size_t size, const char *path1, const char *path2);
6int path__join3(char *bf, size_t size, const char *path1, const char *path2, const char *path3); 8int path__join3(char *bf, size_t size, const char *path1, const char *path2, const char *path3);
7 9
8bool is_regular_file(const char *file); 10bool is_regular_file(const char *file);
11bool is_directory(const char *base_path, const struct dirent *dent);
9 12
10#endif /* _PERF_PATH_H */ 13#endif /* _PERF_PATH_H */
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 80fb1593913a..57e38fdf0b34 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -12,6 +12,7 @@
12#include <dirent.h> 12#include <dirent.h>
13#include <api/fs/fs.h> 13#include <api/fs/fs.h>
14#include <locale.h> 14#include <locale.h>
15#include <regex.h>
15#include "util.h" 16#include "util.h"
16#include "pmu.h" 17#include "pmu.h"
17#include "parse-events.h" 18#include "parse-events.h"
@@ -537,17 +538,45 @@ static bool pmu_is_uncore(const char *name)
537} 538}
538 539
539/* 540/*
541 * PMU CORE devices have different name other than cpu in sysfs on some
542 * platforms. looking for possible sysfs files to identify as core device.
543 */
544static int is_pmu_core(const char *name)
545{
546 struct stat st;
547 char path[PATH_MAX];
548 const char *sysfs = sysfs__mountpoint();
549
550 if (!sysfs)
551 return 0;
552
553 /* Look for cpu sysfs (x86 and others) */
554 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu", sysfs);
555 if ((stat(path, &st) == 0) &&
556 (strncmp(name, "cpu", strlen("cpu")) == 0))
557 return 1;
558
559 /* Look for cpu sysfs (specific to arm) */
560 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s/cpus",
561 sysfs, name);
562 if (stat(path, &st) == 0)
563 return 1;
564
565 return 0;
566}
567
568/*
540 * Return the CPU id as a raw string. 569 * Return the CPU id as a raw string.
541 * 570 *
542 * Each architecture should provide a more precise id string that 571 * Each architecture should provide a more precise id string that
543 * can be use to match the architecture's "mapfile". 572 * can be use to match the architecture's "mapfile".
544 */ 573 */
545char * __weak get_cpuid_str(void) 574char * __weak get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
546{ 575{
547 return NULL; 576 return NULL;
548} 577}
549 578
550static char *perf_pmu__getcpuid(void) 579static char *perf_pmu__getcpuid(struct perf_pmu *pmu)
551{ 580{
552 char *cpuid; 581 char *cpuid;
553 static bool printed; 582 static bool printed;
@@ -556,7 +585,7 @@ static char *perf_pmu__getcpuid(void)
556 if (cpuid) 585 if (cpuid)
557 cpuid = strdup(cpuid); 586 cpuid = strdup(cpuid);
558 if (!cpuid) 587 if (!cpuid)
559 cpuid = get_cpuid_str(); 588 cpuid = get_cpuid_str(pmu);
560 if (!cpuid) 589 if (!cpuid)
561 return NULL; 590 return NULL;
562 591
@@ -567,22 +596,45 @@ static char *perf_pmu__getcpuid(void)
567 return cpuid; 596 return cpuid;
568} 597}
569 598
570struct pmu_events_map *perf_pmu__find_map(void) 599struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu)
571{ 600{
572 struct pmu_events_map *map; 601 struct pmu_events_map *map;
573 char *cpuid = perf_pmu__getcpuid(); 602 char *cpuid = perf_pmu__getcpuid(pmu);
574 int i; 603 int i;
575 604
605 /* on some platforms which uses cpus map, cpuid can be NULL for
606 * PMUs other than CORE PMUs.
607 */
608 if (!cpuid)
609 return NULL;
610
576 i = 0; 611 i = 0;
577 for (;;) { 612 for (;;) {
613 regex_t re;
614 regmatch_t pmatch[1];
615 int match;
616
578 map = &pmu_events_map[i++]; 617 map = &pmu_events_map[i++];
579 if (!map->table) { 618 if (!map->table) {
580 map = NULL; 619 map = NULL;
581 break; 620 break;
582 } 621 }
583 622
584 if (!strcmp(map->cpuid, cpuid)) 623 if (regcomp(&re, map->cpuid, REG_EXTENDED) != 0) {
624 /* Warn unable to generate match particular string. */
625 pr_info("Invalid regular expression %s\n", map->cpuid);
585 break; 626 break;
627 }
628
629 match = !regexec(&re, cpuid, 1, pmatch, 0);
630 regfree(&re);
631 if (match) {
632 size_t match_len = (pmatch[0].rm_eo - pmatch[0].rm_so);
633
634 /* Verify the entire string matched. */
635 if (match_len == strlen(cpuid))
636 break;
637 }
586 } 638 }
587 free(cpuid); 639 free(cpuid);
588 return map; 640 return map;
@@ -593,13 +645,14 @@ struct pmu_events_map *perf_pmu__find_map(void)
593 * to the current running CPU. Then, add all PMU events from that table 645 * to the current running CPU. Then, add all PMU events from that table
594 * as aliases. 646 * as aliases.
595 */ 647 */
596static void pmu_add_cpu_aliases(struct list_head *head, const char *name) 648static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu)
597{ 649{
598 int i; 650 int i;
599 struct pmu_events_map *map; 651 struct pmu_events_map *map;
600 struct pmu_event *pe; 652 struct pmu_event *pe;
653 const char *name = pmu->name;
601 654
602 map = perf_pmu__find_map(); 655 map = perf_pmu__find_map(pmu);
603 if (!map) 656 if (!map)
604 return; 657 return;
605 658
@@ -608,7 +661,6 @@ static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
608 */ 661 */
609 i = 0; 662 i = 0;
610 while (1) { 663 while (1) {
611 const char *pname;
612 664
613 pe = &map->table[i++]; 665 pe = &map->table[i++];
614 if (!pe->name) { 666 if (!pe->name) {
@@ -617,9 +669,13 @@ static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
617 break; 669 break;
618 } 670 }
619 671
620 pname = pe->pmu ? pe->pmu : "cpu"; 672 if (!is_pmu_core(name)) {
621 if (strncmp(pname, name, strlen(pname))) 673 /* check for uncore devices */
622 continue; 674 if (pe->pmu == NULL)
675 continue;
676 if (strncmp(pe->pmu, name, strlen(pe->pmu)))
677 continue;
678 }
623 679
624 /* need type casts to override 'const' */ 680 /* need type casts to override 'const' */
625 __perf_pmu__new_alias(head, NULL, (char *)pe->name, 681 __perf_pmu__new_alias(head, NULL, (char *)pe->name,
@@ -661,21 +717,20 @@ static struct perf_pmu *pmu_lookup(const char *name)
661 if (pmu_aliases(name, &aliases)) 717 if (pmu_aliases(name, &aliases))
662 return NULL; 718 return NULL;
663 719
664 pmu_add_cpu_aliases(&aliases, name);
665 pmu = zalloc(sizeof(*pmu)); 720 pmu = zalloc(sizeof(*pmu));
666 if (!pmu) 721 if (!pmu)
667 return NULL; 722 return NULL;
668 723
669 pmu->cpus = pmu_cpumask(name); 724 pmu->cpus = pmu_cpumask(name);
670 725 pmu->name = strdup(name);
726 pmu->type = type;
671 pmu->is_uncore = pmu_is_uncore(name); 727 pmu->is_uncore = pmu_is_uncore(name);
728 pmu_add_cpu_aliases(&aliases, pmu);
672 729
673 INIT_LIST_HEAD(&pmu->format); 730 INIT_LIST_HEAD(&pmu->format);
674 INIT_LIST_HEAD(&pmu->aliases); 731 INIT_LIST_HEAD(&pmu->aliases);
675 list_splice(&format, &pmu->format); 732 list_splice(&format, &pmu->format);
676 list_splice(&aliases, &pmu->aliases); 733 list_splice(&aliases, &pmu->aliases);
677 pmu->name = strdup(name);
678 pmu->type = type;
679 list_add_tail(&pmu->list, &pmus); 734 list_add_tail(&pmu->list, &pmus);
680 735
681 pmu->default_config = perf_pmu__get_default_config(pmu); 736 pmu->default_config = perf_pmu__get_default_config(pmu);
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 27c75e635866..76fecec7b3f9 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -92,6 +92,6 @@ int perf_pmu__test(void);
92 92
93struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu); 93struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu);
94 94
95struct pmu_events_map *perf_pmu__find_map(void); 95struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu);
96 96
97#endif /* __PMU_H */ 97#endif /* __PMU_H */
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index b7aaf9b2294d..e1dbc9821617 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1325,27 +1325,30 @@ static int parse_perf_probe_event_name(char **arg, struct perf_probe_event *pev)
1325{ 1325{
1326 char *ptr; 1326 char *ptr;
1327 1327
1328 ptr = strchr(*arg, ':'); 1328 ptr = strpbrk_esc(*arg, ":");
1329 if (ptr) { 1329 if (ptr) {
1330 *ptr = '\0'; 1330 *ptr = '\0';
1331 if (!pev->sdt && !is_c_func_name(*arg)) 1331 if (!pev->sdt && !is_c_func_name(*arg))
1332 goto ng_name; 1332 goto ng_name;
1333 pev->group = strdup(*arg); 1333 pev->group = strdup_esc(*arg);
1334 if (!pev->group) 1334 if (!pev->group)
1335 return -ENOMEM; 1335 return -ENOMEM;
1336 *arg = ptr + 1; 1336 *arg = ptr + 1;
1337 } else 1337 } else
1338 pev->group = NULL; 1338 pev->group = NULL;
1339 if (!pev->sdt && !is_c_func_name(*arg)) { 1339
1340 pev->event = strdup_esc(*arg);
1341 if (pev->event == NULL)
1342 return -ENOMEM;
1343
1344 if (!pev->sdt && !is_c_func_name(pev->event)) {
1345 zfree(&pev->event);
1340ng_name: 1346ng_name:
1347 zfree(&pev->group);
1341 semantic_error("%s is bad for event name -it must " 1348 semantic_error("%s is bad for event name -it must "
1342 "follow C symbol-naming rule.\n", *arg); 1349 "follow C symbol-naming rule.\n", *arg);
1343 return -EINVAL; 1350 return -EINVAL;
1344 } 1351 }
1345 pev->event = strdup(*arg);
1346 if (pev->event == NULL)
1347 return -ENOMEM;
1348
1349 return 0; 1352 return 0;
1350} 1353}
1351 1354
@@ -1373,7 +1376,7 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1373 arg++; 1376 arg++;
1374 } 1377 }
1375 1378
1376 ptr = strpbrk(arg, ";=@+%"); 1379 ptr = strpbrk_esc(arg, ";=@+%");
1377 if (pev->sdt) { 1380 if (pev->sdt) {
1378 if (ptr) { 1381 if (ptr) {
1379 if (*ptr != '@') { 1382 if (*ptr != '@') {
@@ -1387,7 +1390,7 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1387 pev->target = build_id_cache__origname(tmp); 1390 pev->target = build_id_cache__origname(tmp);
1388 free(tmp); 1391 free(tmp);
1389 } else 1392 } else
1390 pev->target = strdup(ptr + 1); 1393 pev->target = strdup_esc(ptr + 1);
1391 if (!pev->target) 1394 if (!pev->target)
1392 return -ENOMEM; 1395 return -ENOMEM;
1393 *ptr = '\0'; 1396 *ptr = '\0';
@@ -1421,13 +1424,14 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1421 * 1424 *
1422 * Otherwise, we consider arg to be a function specification. 1425 * Otherwise, we consider arg to be a function specification.
1423 */ 1426 */
1424 if (!strpbrk(arg, "+@%") && (ptr = strpbrk(arg, ";:")) != NULL) { 1427 if (!strpbrk_esc(arg, "+@%")) {
1428 ptr = strpbrk_esc(arg, ";:");
1425 /* This is a file spec if it includes a '.' before ; or : */ 1429 /* This is a file spec if it includes a '.' before ; or : */
1426 if (memchr(arg, '.', ptr - arg)) 1430 if (ptr && memchr(arg, '.', ptr - arg))
1427 file_spec = true; 1431 file_spec = true;
1428 } 1432 }
1429 1433
1430 ptr = strpbrk(arg, ";:+@%"); 1434 ptr = strpbrk_esc(arg, ";:+@%");
1431 if (ptr) { 1435 if (ptr) {
1432 nc = *ptr; 1436 nc = *ptr;
1433 *ptr++ = '\0'; 1437 *ptr++ = '\0';
@@ -1436,7 +1440,7 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1436 if (arg[0] == '\0') 1440 if (arg[0] == '\0')
1437 tmp = NULL; 1441 tmp = NULL;
1438 else { 1442 else {
1439 tmp = strdup(arg); 1443 tmp = strdup_esc(arg);
1440 if (tmp == NULL) 1444 if (tmp == NULL)
1441 return -ENOMEM; 1445 return -ENOMEM;
1442 } 1446 }
@@ -1469,12 +1473,12 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1469 arg = ptr; 1473 arg = ptr;
1470 c = nc; 1474 c = nc;
1471 if (c == ';') { /* Lazy pattern must be the last part */ 1475 if (c == ';') { /* Lazy pattern must be the last part */
1472 pp->lazy_line = strdup(arg); 1476 pp->lazy_line = strdup(arg); /* let leave escapes */
1473 if (pp->lazy_line == NULL) 1477 if (pp->lazy_line == NULL)
1474 return -ENOMEM; 1478 return -ENOMEM;
1475 break; 1479 break;
1476 } 1480 }
1477 ptr = strpbrk(arg, ";:+@%"); 1481 ptr = strpbrk_esc(arg, ";:+@%");
1478 if (ptr) { 1482 if (ptr) {
1479 nc = *ptr; 1483 nc = *ptr;
1480 *ptr++ = '\0'; 1484 *ptr++ = '\0';
@@ -1501,7 +1505,7 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1501 semantic_error("SRC@SRC is not allowed.\n"); 1505 semantic_error("SRC@SRC is not allowed.\n");
1502 return -EINVAL; 1506 return -EINVAL;
1503 } 1507 }
1504 pp->file = strdup(arg); 1508 pp->file = strdup_esc(arg);
1505 if (pp->file == NULL) 1509 if (pp->file == NULL)
1506 return -ENOMEM; 1510 return -ENOMEM;
1507 break; 1511 break;
@@ -2573,7 +2577,8 @@ int show_perf_probe_events(struct strfilter *filter)
2573} 2577}
2574 2578
2575static int get_new_event_name(char *buf, size_t len, const char *base, 2579static int get_new_event_name(char *buf, size_t len, const char *base,
2576 struct strlist *namelist, bool allow_suffix) 2580 struct strlist *namelist, bool ret_event,
2581 bool allow_suffix)
2577{ 2582{
2578 int i, ret; 2583 int i, ret;
2579 char *p, *nbase; 2584 char *p, *nbase;
@@ -2584,13 +2589,13 @@ static int get_new_event_name(char *buf, size_t len, const char *base,
2584 if (!nbase) 2589 if (!nbase)
2585 return -ENOMEM; 2590 return -ENOMEM;
2586 2591
2587 /* Cut off the dot suffixes (e.g. .const, .isra)*/ 2592 /* Cut off the dot suffixes (e.g. .const, .isra) and version suffixes */
2588 p = strchr(nbase, '.'); 2593 p = strpbrk(nbase, ".@");
2589 if (p && p != nbase) 2594 if (p && p != nbase)
2590 *p = '\0'; 2595 *p = '\0';
2591 2596
2592 /* Try no suffix number */ 2597 /* Try no suffix number */
2593 ret = e_snprintf(buf, len, "%s", nbase); 2598 ret = e_snprintf(buf, len, "%s%s", nbase, ret_event ? "__return" : "");
2594 if (ret < 0) { 2599 if (ret < 0) {
2595 pr_debug("snprintf() failed: %d\n", ret); 2600 pr_debug("snprintf() failed: %d\n", ret);
2596 goto out; 2601 goto out;
@@ -2625,6 +2630,14 @@ static int get_new_event_name(char *buf, size_t len, const char *base,
2625 2630
2626out: 2631out:
2627 free(nbase); 2632 free(nbase);
2633
2634 /* Final validation */
2635 if (ret >= 0 && !is_c_func_name(buf)) {
2636 pr_warning("Internal error: \"%s\" is an invalid event name.\n",
2637 buf);
2638 ret = -EINVAL;
2639 }
2640
2628 return ret; 2641 return ret;
2629} 2642}
2630 2643
@@ -2681,8 +2694,8 @@ static int probe_trace_event__set_name(struct probe_trace_event *tev,
2681 group = PERFPROBE_GROUP; 2694 group = PERFPROBE_GROUP;
2682 2695
2683 /* Get an unused new event name */ 2696 /* Get an unused new event name */
2684 ret = get_new_event_name(buf, 64, event, 2697 ret = get_new_event_name(buf, 64, event, namelist,
2685 namelist, allow_suffix); 2698 tev->point.retprobe, allow_suffix);
2686 if (ret < 0) 2699 if (ret < 0)
2687 return ret; 2700 return ret;
2688 2701
@@ -2792,16 +2805,40 @@ static int find_probe_functions(struct map *map, char *name,
2792 int found = 0; 2805 int found = 0;
2793 struct symbol *sym; 2806 struct symbol *sym;
2794 struct rb_node *tmp; 2807 struct rb_node *tmp;
2808 const char *norm, *ver;
2809 char *buf = NULL;
2810 bool cut_version = true;
2795 2811
2796 if (map__load(map) < 0) 2812 if (map__load(map) < 0)
2797 return 0; 2813 return 0;
2798 2814
2815 /* If user gives a version, don't cut off the version from symbols */
2816 if (strchr(name, '@'))
2817 cut_version = false;
2818
2799 map__for_each_symbol(map, sym, tmp) { 2819 map__for_each_symbol(map, sym, tmp) {
2800 if (strglobmatch(sym->name, name)) { 2820 norm = arch__normalize_symbol_name(sym->name);
2821 if (!norm)
2822 continue;
2823
2824 if (cut_version) {
2825 /* We don't care about default symbol or not */
2826 ver = strchr(norm, '@');
2827 if (ver) {
2828 buf = strndup(norm, ver - norm);
2829 if (!buf)
2830 return -ENOMEM;
2831 norm = buf;
2832 }
2833 }
2834
2835 if (strglobmatch(norm, name)) {
2801 found++; 2836 found++;
2802 if (syms && found < probe_conf.max_probes) 2837 if (syms && found < probe_conf.max_probes)
2803 syms[found - 1] = sym; 2838 syms[found - 1] = sym;
2804 } 2839 }
2840 if (buf)
2841 zfree(&buf);
2805 } 2842 }
2806 2843
2807 return found; 2844 return found;
@@ -2847,7 +2884,7 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
2847 * same name but different addresses, this lists all the symbols. 2884 * same name but different addresses, this lists all the symbols.
2848 */ 2885 */
2849 num_matched_functions = find_probe_functions(map, pp->function, syms); 2886 num_matched_functions = find_probe_functions(map, pp->function, syms);
2850 if (num_matched_functions == 0) { 2887 if (num_matched_functions <= 0) {
2851 pr_err("Failed to find symbol %s in %s\n", pp->function, 2888 pr_err("Failed to find symbol %s in %s\n", pp->function,
2852 pev->target ? : "kernel"); 2889 pev->target ? : "kernel");
2853 ret = -ENOENT; 2890 ret = -ENOENT;
diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources
index b4f2f06722a7..7aa0ea64544e 100644
--- a/tools/perf/util/python-ext-sources
+++ b/tools/perf/util/python-ext-sources
@@ -10,6 +10,7 @@ util/ctype.c
10util/evlist.c 10util/evlist.c
11util/evsel.c 11util/evsel.c
12util/cpumap.c 12util/cpumap.c
13util/memswap.c
13util/mmap.c 14util/mmap.c
14util/namespaces.c 15util/namespaces.c
15../lib/bitmap.c 16../lib/bitmap.c
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 8e49d9cafcfc..b1e999bd21ef 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -864,7 +864,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
864 &pages, &overwrite)) 864 &pages, &overwrite))
865 return NULL; 865 return NULL;
866 866
867 if (perf_evlist__mmap(evlist, pages, overwrite) < 0) { 867 if (perf_evlist__mmap(evlist, pages) < 0) {
868 PyErr_SetFromErrno(PyExc_OSError); 868 PyErr_SetFromErrno(PyExc_OSError);
869 return NULL; 869 return NULL;
870 } 870 }
diff --git a/tools/perf/util/rblist.c b/tools/perf/util/rblist.c
index 0dfe27d99458..0efc3258c648 100644
--- a/tools/perf/util/rblist.c
+++ b/tools/perf/util/rblist.c
@@ -101,16 +101,21 @@ void rblist__init(struct rblist *rblist)
101 return; 101 return;
102} 102}
103 103
104void rblist__exit(struct rblist *rblist)
105{
106 struct rb_node *pos, *next = rb_first(&rblist->entries);
107
108 while (next) {
109 pos = next;
110 next = rb_next(pos);
111 rblist__remove_node(rblist, pos);
112 }
113}
114
104void rblist__delete(struct rblist *rblist) 115void rblist__delete(struct rblist *rblist)
105{ 116{
106 if (rblist != NULL) { 117 if (rblist != NULL) {
107 struct rb_node *pos, *next = rb_first(&rblist->entries); 118 rblist__exit(rblist);
108
109 while (next) {
110 pos = next;
111 next = rb_next(pos);
112 rblist__remove_node(rblist, pos);
113 }
114 free(rblist); 119 free(rblist);
115 } 120 }
116} 121}
diff --git a/tools/perf/util/rblist.h b/tools/perf/util/rblist.h
index 4c8638a22571..76df15c27f5f 100644
--- a/tools/perf/util/rblist.h
+++ b/tools/perf/util/rblist.h
@@ -29,6 +29,7 @@ struct rblist {
29}; 29};
30 30
31void rblist__init(struct rblist *rblist); 31void rblist__init(struct rblist *rblist);
32void rblist__exit(struct rblist *rblist);
32void rblist__delete(struct rblist *rblist); 33void rblist__delete(struct rblist *rblist);
33int rblist__add_node(struct rblist *rblist, const void *new_entry); 34int rblist__add_node(struct rblist *rblist, const void *new_entry);
34void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node); 35void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node);
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index c7187f067d31..ea070883c593 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -43,7 +43,6 @@
43#include "../db-export.h" 43#include "../db-export.h"
44#include "../thread-stack.h" 44#include "../thread-stack.h"
45#include "../trace-event.h" 45#include "../trace-event.h"
46#include "../machine.h"
47#include "../call-path.h" 46#include "../call-path.h"
48#include "thread_map.h" 47#include "thread_map.h"
49#include "cpumap.h" 48#include "cpumap.h"
@@ -500,6 +499,8 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample,
500 PyLong_FromUnsignedLongLong(sample->time)); 499 PyLong_FromUnsignedLongLong(sample->time));
501 pydict_set_item_string_decref(dict_sample, "period", 500 pydict_set_item_string_decref(dict_sample, "period",
502 PyLong_FromUnsignedLongLong(sample->period)); 501 PyLong_FromUnsignedLongLong(sample->period));
502 pydict_set_item_string_decref(dict_sample, "phys_addr",
503 PyLong_FromUnsignedLongLong(sample->phys_addr));
503 set_sample_read_in_dict(dict_sample, sample, evsel); 504 set_sample_read_in_dict(dict_sample, sample, evsel);
504 pydict_set_item_string_decref(dict, "sample", dict_sample); 505 pydict_set_item_string_decref(dict, "sample", dict_sample);
505 506
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 5c412310f266..c71ced7db152 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -27,7 +27,6 @@
27 27
28static int perf_session__deliver_event(struct perf_session *session, 28static int perf_session__deliver_event(struct perf_session *session,
29 union perf_event *event, 29 union perf_event *event,
30 struct perf_sample *sample,
31 struct perf_tool *tool, 30 struct perf_tool *tool,
32 u64 file_offset); 31 u64 file_offset);
33 32
@@ -107,17 +106,10 @@ static void perf_session__set_comm_exec(struct perf_session *session)
107static int ordered_events__deliver_event(struct ordered_events *oe, 106static int ordered_events__deliver_event(struct ordered_events *oe,
108 struct ordered_event *event) 107 struct ordered_event *event)
109{ 108{
110 struct perf_sample sample;
111 struct perf_session *session = container_of(oe, struct perf_session, 109 struct perf_session *session = container_of(oe, struct perf_session,
112 ordered_events); 110 ordered_events);
113 int ret = perf_evlist__parse_sample(session->evlist, event->event, &sample);
114
115 if (ret) {
116 pr_err("Can't parse sample, err = %d\n", ret);
117 return ret;
118 }
119 111
120 return perf_session__deliver_event(session, event->event, &sample, 112 return perf_session__deliver_event(session, event->event,
121 session->tool, event->file_offset); 113 session->tool, event->file_offset);
122} 114}
123 115
@@ -873,9 +865,9 @@ static int process_finished_round(struct perf_tool *tool __maybe_unused,
873} 865}
874 866
875int perf_session__queue_event(struct perf_session *s, union perf_event *event, 867int perf_session__queue_event(struct perf_session *s, union perf_event *event,
876 struct perf_sample *sample, u64 file_offset) 868 u64 timestamp, u64 file_offset)
877{ 869{
878 return ordered_events__queue(&s->ordered_events, event, sample, file_offset); 870 return ordered_events__queue(&s->ordered_events, event, timestamp, file_offset);
879} 871}
880 872
881static void callchain__lbr_callstack_printf(struct perf_sample *sample) 873static void callchain__lbr_callstack_printf(struct perf_sample *sample)
@@ -1328,20 +1320,26 @@ static int machines__deliver_event(struct machines *machines,
1328 1320
1329static int perf_session__deliver_event(struct perf_session *session, 1321static int perf_session__deliver_event(struct perf_session *session,
1330 union perf_event *event, 1322 union perf_event *event,
1331 struct perf_sample *sample,
1332 struct perf_tool *tool, 1323 struct perf_tool *tool,
1333 u64 file_offset) 1324 u64 file_offset)
1334{ 1325{
1326 struct perf_sample sample;
1335 int ret; 1327 int ret;
1336 1328
1337 ret = auxtrace__process_event(session, event, sample, tool); 1329 ret = perf_evlist__parse_sample(session->evlist, event, &sample);
1330 if (ret) {
1331 pr_err("Can't parse sample, err = %d\n", ret);
1332 return ret;
1333 }
1334
1335 ret = auxtrace__process_event(session, event, &sample, tool);
1338 if (ret < 0) 1336 if (ret < 0)
1339 return ret; 1337 return ret;
1340 if (ret > 0) 1338 if (ret > 0)
1341 return 0; 1339 return 0;
1342 1340
1343 return machines__deliver_event(&session->machines, session->evlist, 1341 return machines__deliver_event(&session->machines, session->evlist,
1344 event, sample, tool, file_offset); 1342 event, &sample, tool, file_offset);
1345} 1343}
1346 1344
1347static s64 perf_session__process_user_event(struct perf_session *session, 1345static s64 perf_session__process_user_event(struct perf_session *session,
@@ -1350,10 +1348,11 @@ static s64 perf_session__process_user_event(struct perf_session *session,
1350{ 1348{
1351 struct ordered_events *oe = &session->ordered_events; 1349 struct ordered_events *oe = &session->ordered_events;
1352 struct perf_tool *tool = session->tool; 1350 struct perf_tool *tool = session->tool;
1351 struct perf_sample sample = { .time = 0, };
1353 int fd = perf_data__fd(session->data); 1352 int fd = perf_data__fd(session->data);
1354 int err; 1353 int err;
1355 1354
1356 dump_event(session->evlist, event, file_offset, NULL); 1355 dump_event(session->evlist, event, file_offset, &sample);
1357 1356
1358 /* These events are processed right away */ 1357 /* These events are processed right away */
1359 switch (event->header.type) { 1358 switch (event->header.type) {
@@ -1495,7 +1494,6 @@ static s64 perf_session__process_event(struct perf_session *session,
1495{ 1494{
1496 struct perf_evlist *evlist = session->evlist; 1495 struct perf_evlist *evlist = session->evlist;
1497 struct perf_tool *tool = session->tool; 1496 struct perf_tool *tool = session->tool;
1498 struct perf_sample sample;
1499 int ret; 1497 int ret;
1500 1498
1501 if (session->header.needs_swap) 1499 if (session->header.needs_swap)
@@ -1509,21 +1507,19 @@ static s64 perf_session__process_event(struct perf_session *session,
1509 if (event->header.type >= PERF_RECORD_USER_TYPE_START) 1507 if (event->header.type >= PERF_RECORD_USER_TYPE_START)
1510 return perf_session__process_user_event(session, event, file_offset); 1508 return perf_session__process_user_event(session, event, file_offset);
1511 1509
1512 /*
1513 * For all kernel events we get the sample data
1514 */
1515 ret = perf_evlist__parse_sample(evlist, event, &sample);
1516 if (ret)
1517 return ret;
1518
1519 if (tool->ordered_events) { 1510 if (tool->ordered_events) {
1520 ret = perf_session__queue_event(session, event, &sample, file_offset); 1511 u64 timestamp = -1ULL;
1512
1513 ret = perf_evlist__parse_sample_timestamp(evlist, event, &timestamp);
1514 if (ret && ret != -1)
1515 return ret;
1516
1517 ret = perf_session__queue_event(session, event, timestamp, file_offset);
1521 if (ret != -ETIME) 1518 if (ret != -ETIME)
1522 return ret; 1519 return ret;
1523 } 1520 }
1524 1521
1525 return perf_session__deliver_event(session, event, &sample, tool, 1522 return perf_session__deliver_event(session, event, tool, file_offset);
1526 file_offset);
1527} 1523}
1528 1524
1529void perf_event_header__bswap(struct perf_event_header *hdr) 1525void perf_event_header__bswap(struct perf_event_header *hdr)
@@ -1777,7 +1773,8 @@ done:
1777 err = perf_session__flush_thread_stacks(session); 1773 err = perf_session__flush_thread_stacks(session);
1778out_err: 1774out_err:
1779 free(buf); 1775 free(buf);
1780 perf_session__warn_about_errors(session); 1776 if (!tool->no_warn)
1777 perf_session__warn_about_errors(session);
1781 ordered_events__free(&session->ordered_events); 1778 ordered_events__free(&session->ordered_events);
1782 auxtrace__free_events(session); 1779 auxtrace__free_events(session);
1783 return err; 1780 return err;
@@ -1933,7 +1930,8 @@ out:
1933 err = perf_session__flush_thread_stacks(session); 1930 err = perf_session__flush_thread_stacks(session);
1934out_err: 1931out_err:
1935 ui_progress__finish(); 1932 ui_progress__finish();
1936 perf_session__warn_about_errors(session); 1933 if (!tool->no_warn)
1934 perf_session__warn_about_errors(session);
1937 /* 1935 /*
1938 * We may switching perf.data output, make ordered_events 1936 * We may switching perf.data output, make ordered_events
1939 * reusable. 1937 * reusable.
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index da1434a7c120..da40b4b380ca 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -53,7 +53,7 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset,
53int perf_session__process_events(struct perf_session *session); 53int perf_session__process_events(struct perf_session *session);
54 54
55int perf_session__queue_event(struct perf_session *s, union perf_event *event, 55int perf_session__queue_event(struct perf_session *s, union perf_event *event,
56 struct perf_sample *sample, u64 file_offset); 56 u64 timestamp, u64 file_offset);
57 57
58void perf_tool__fill_defaults(struct perf_tool *tool); 58void perf_tool__fill_defaults(struct perf_tool *tool);
59 59
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index a00eacdf02ed..2da4d0456a03 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -336,7 +336,7 @@ char *hist_entry__get_srcline(struct hist_entry *he)
336 return SRCLINE_UNKNOWN; 336 return SRCLINE_UNKNOWN;
337 337
338 return get_srcline(map->dso, map__rip_2objdump(map, he->ip), 338 return get_srcline(map->dso, map__rip_2objdump(map, he->ip),
339 he->ms.sym, true, true); 339 he->ms.sym, true, true, he->ip);
340} 340}
341 341
342static int64_t 342static int64_t
@@ -380,7 +380,8 @@ sort__srcline_from_cmp(struct hist_entry *left, struct hist_entry *right)
380 map__rip_2objdump(map, 380 map__rip_2objdump(map,
381 left->branch_info->from.al_addr), 381 left->branch_info->from.al_addr),
382 left->branch_info->from.sym, 382 left->branch_info->from.sym,
383 true, true); 383 true, true,
384 left->branch_info->from.al_addr);
384 } 385 }
385 if (!right->branch_info->srcline_from) { 386 if (!right->branch_info->srcline_from) {
386 struct map *map = right->branch_info->from.map; 387 struct map *map = right->branch_info->from.map;
@@ -391,7 +392,8 @@ sort__srcline_from_cmp(struct hist_entry *left, struct hist_entry *right)
391 map__rip_2objdump(map, 392 map__rip_2objdump(map,
392 right->branch_info->from.al_addr), 393 right->branch_info->from.al_addr),
393 right->branch_info->from.sym, 394 right->branch_info->from.sym,
394 true, true); 395 true, true,
396 right->branch_info->from.al_addr);
395 } 397 }
396 return strcmp(right->branch_info->srcline_from, left->branch_info->srcline_from); 398 return strcmp(right->branch_info->srcline_from, left->branch_info->srcline_from);
397} 399}
@@ -423,7 +425,8 @@ sort__srcline_to_cmp(struct hist_entry *left, struct hist_entry *right)
423 map__rip_2objdump(map, 425 map__rip_2objdump(map,
424 left->branch_info->to.al_addr), 426 left->branch_info->to.al_addr),
425 left->branch_info->from.sym, 427 left->branch_info->from.sym,
426 true, true); 428 true, true,
429 left->branch_info->to.al_addr);
427 } 430 }
428 if (!right->branch_info->srcline_to) { 431 if (!right->branch_info->srcline_to) {
429 struct map *map = right->branch_info->to.map; 432 struct map *map = right->branch_info->to.map;
@@ -434,7 +437,8 @@ sort__srcline_to_cmp(struct hist_entry *left, struct hist_entry *right)
434 map__rip_2objdump(map, 437 map__rip_2objdump(map,
435 right->branch_info->to.al_addr), 438 right->branch_info->to.al_addr),
436 right->branch_info->to.sym, 439 right->branch_info->to.sym,
437 true, true); 440 true, true,
441 right->branch_info->to.al_addr);
438 } 442 }
439 return strcmp(right->branch_info->srcline_to, left->branch_info->srcline_to); 443 return strcmp(right->branch_info->srcline_to, left->branch_info->srcline_to);
440} 444}
@@ -465,7 +469,7 @@ static char *hist_entry__get_srcfile(struct hist_entry *e)
465 return no_srcfile; 469 return no_srcfile;
466 470
467 sf = __get_srcline(map->dso, map__rip_2objdump(map, e->ip), 471 sf = __get_srcline(map->dso, map__rip_2objdump(map, e->ip),
468 e->ms.sym, false, true, true); 472 e->ms.sym, false, true, true, e->ip);
469 if (!strcmp(sf, SRCLINE_UNKNOWN)) 473 if (!strcmp(sf, SRCLINE_UNKNOWN))
470 return no_srcfile; 474 return no_srcfile;
471 p = strchr(sf, ':'); 475 p = strchr(sf, ':');
@@ -2883,10 +2887,10 @@ static int setup_output_list(struct perf_hpp_list *list, char *str)
2883 tok; tok = strtok_r(NULL, ", ", &tmp)) { 2887 tok; tok = strtok_r(NULL, ", ", &tmp)) {
2884 ret = output_field_add(list, tok); 2888 ret = output_field_add(list, tok);
2885 if (ret == -EINVAL) { 2889 if (ret == -EINVAL) {
2886 pr_err("Invalid --fields key: `%s'", tok); 2890 ui__error("Invalid --fields key: `%s'", tok);
2887 break; 2891 break;
2888 } else if (ret == -ESRCH) { 2892 } else if (ret == -ESRCH) {
2889 pr_err("Unknown --fields key: `%s'", tok); 2893 ui__error("Unknown --fields key: `%s'", tok);
2890 break; 2894 break;
2891 } 2895 }
2892 } 2896 }
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index d19f05c56de6..3c21fd059b64 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -496,7 +496,8 @@ out:
496#define A2L_FAIL_LIMIT 123 496#define A2L_FAIL_LIMIT 123
497 497
498char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 498char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
499 bool show_sym, bool show_addr, bool unwind_inlines) 499 bool show_sym, bool show_addr, bool unwind_inlines,
500 u64 ip)
500{ 501{
501 char *file = NULL; 502 char *file = NULL;
502 unsigned line = 0; 503 unsigned line = 0;
@@ -536,7 +537,7 @@ out:
536 537
537 if (sym) { 538 if (sym) {
538 if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "", 539 if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "",
539 addr - sym->start) < 0) 540 ip - sym->start) < 0)
540 return SRCLINE_UNKNOWN; 541 return SRCLINE_UNKNOWN;
541 } else if (asprintf(&srcline, "%s[%" PRIx64 "]", dso->short_name, addr) < 0) 542 } else if (asprintf(&srcline, "%s[%" PRIx64 "]", dso->short_name, addr) < 0)
542 return SRCLINE_UNKNOWN; 543 return SRCLINE_UNKNOWN;
@@ -550,9 +551,9 @@ void free_srcline(char *srcline)
550} 551}
551 552
552char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 553char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
553 bool show_sym, bool show_addr) 554 bool show_sym, bool show_addr, u64 ip)
554{ 555{
555 return __get_srcline(dso, addr, sym, show_sym, show_addr, false); 556 return __get_srcline(dso, addr, sym, show_sym, show_addr, false, ip);
556} 557}
557 558
558struct srcline_node { 559struct srcline_node {
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h
index 847b7086182c..b2bb5502fd62 100644
--- a/tools/perf/util/srcline.h
+++ b/tools/perf/util/srcline.h
@@ -11,9 +11,10 @@ struct symbol;
11 11
12extern bool srcline_full_filename; 12extern bool srcline_full_filename;
13char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 13char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
14 bool show_sym, bool show_addr); 14 bool show_sym, bool show_addr, u64 ip);
15char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 15char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
16 bool show_sym, bool show_addr, bool unwind_inlines); 16 bool show_sym, bool show_addr, bool unwind_inlines,
17 u64 ip);
17void free_srcline(char *srcline); 18void free_srcline(char *srcline);
18 19
19/* insert the srcline into the DSO, which will take ownership */ 20/* insert the srcline into the DSO, which will take ownership */
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 855e35cbb1dc..594d14a02b67 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -9,17 +9,6 @@
9#include "expr.h" 9#include "expr.h"
10#include "metricgroup.h" 10#include "metricgroup.h"
11 11
12enum {
13 CTX_BIT_USER = 1 << 0,
14 CTX_BIT_KERNEL = 1 << 1,
15 CTX_BIT_HV = 1 << 2,
16 CTX_BIT_HOST = 1 << 3,
17 CTX_BIT_IDLE = 1 << 4,
18 CTX_BIT_MAX = 1 << 5,
19};
20
21#define NUM_CTX CTX_BIT_MAX
22
23/* 12/*
24 * AGGR_GLOBAL: Use CPU 0 13 * AGGR_GLOBAL: Use CPU 0
25 * AGGR_SOCKET: Use first CPU of socket 14 * AGGR_SOCKET: Use first CPU of socket
@@ -27,36 +16,18 @@ enum {
27 * AGGR_NONE: Use matching CPU 16 * AGGR_NONE: Use matching CPU
28 * AGGR_THREAD: Not supported? 17 * AGGR_THREAD: Not supported?
29 */ 18 */
30static struct stats runtime_nsecs_stats[MAX_NR_CPUS];
31static struct stats runtime_cycles_stats[NUM_CTX][MAX_NR_CPUS];
32static struct stats runtime_stalled_cycles_front_stats[NUM_CTX][MAX_NR_CPUS];
33static struct stats runtime_stalled_cycles_back_stats[NUM_CTX][MAX_NR_CPUS];
34static struct stats runtime_branches_stats[NUM_CTX][MAX_NR_CPUS];
35static struct stats runtime_cacherefs_stats[NUM_CTX][MAX_NR_CPUS];
36static struct stats runtime_l1_dcache_stats[NUM_CTX][MAX_NR_CPUS];
37static struct stats runtime_l1_icache_stats[NUM_CTX][MAX_NR_CPUS];
38static struct stats runtime_ll_cache_stats[NUM_CTX][MAX_NR_CPUS];
39static struct stats runtime_itlb_cache_stats[NUM_CTX][MAX_NR_CPUS];
40static struct stats runtime_dtlb_cache_stats[NUM_CTX][MAX_NR_CPUS];
41static struct stats runtime_cycles_in_tx_stats[NUM_CTX][MAX_NR_CPUS];
42static struct stats runtime_transaction_stats[NUM_CTX][MAX_NR_CPUS];
43static struct stats runtime_elision_stats[NUM_CTX][MAX_NR_CPUS];
44static struct stats runtime_topdown_total_slots[NUM_CTX][MAX_NR_CPUS];
45static struct stats runtime_topdown_slots_issued[NUM_CTX][MAX_NR_CPUS];
46static struct stats runtime_topdown_slots_retired[NUM_CTX][MAX_NR_CPUS];
47static struct stats runtime_topdown_fetch_bubbles[NUM_CTX][MAX_NR_CPUS];
48static struct stats runtime_topdown_recovery_bubbles[NUM_CTX][MAX_NR_CPUS];
49static struct stats runtime_smi_num_stats[NUM_CTX][MAX_NR_CPUS];
50static struct stats runtime_aperf_stats[NUM_CTX][MAX_NR_CPUS];
51static struct rblist runtime_saved_values;
52static bool have_frontend_stalled; 19static bool have_frontend_stalled;
53 20
21struct runtime_stat rt_stat;
54struct stats walltime_nsecs_stats; 22struct stats walltime_nsecs_stats;
55 23
56struct saved_value { 24struct saved_value {
57 struct rb_node rb_node; 25 struct rb_node rb_node;
58 struct perf_evsel *evsel; 26 struct perf_evsel *evsel;
27 enum stat_type type;
28 int ctx;
59 int cpu; 29 int cpu;
30 struct runtime_stat *stat;
60 struct stats stats; 31 struct stats stats;
61}; 32};
62 33
@@ -69,6 +40,30 @@ static int saved_value_cmp(struct rb_node *rb_node, const void *entry)
69 40
70 if (a->cpu != b->cpu) 41 if (a->cpu != b->cpu)
71 return a->cpu - b->cpu; 42 return a->cpu - b->cpu;
43
44 /*
45 * Previously the rbtree was used to link generic metrics.
46 * The keys were evsel/cpu. Now the rbtree is extended to support
47 * per-thread shadow stats. For shadow stats case, the keys
48 * are cpu/type/ctx/stat (evsel is NULL). For generic metrics
49 * case, the keys are still evsel/cpu (type/ctx/stat are 0 or NULL).
50 */
51 if (a->type != b->type)
52 return a->type - b->type;
53
54 if (a->ctx != b->ctx)
55 return a->ctx - b->ctx;
56
57 if (a->evsel == NULL && b->evsel == NULL) {
58 if (a->stat == b->stat)
59 return 0;
60
61 if ((char *)a->stat < (char *)b->stat)
62 return -1;
63
64 return 1;
65 }
66
72 if (a->evsel == b->evsel) 67 if (a->evsel == b->evsel)
73 return 0; 68 return 0;
74 if ((char *)a->evsel < (char *)b->evsel) 69 if ((char *)a->evsel < (char *)b->evsel)
@@ -87,34 +82,66 @@ static struct rb_node *saved_value_new(struct rblist *rblist __maybe_unused,
87 return &nd->rb_node; 82 return &nd->rb_node;
88} 83}
89 84
85static void saved_value_delete(struct rblist *rblist __maybe_unused,
86 struct rb_node *rb_node)
87{
88 struct saved_value *v;
89
90 BUG_ON(!rb_node);
91 v = container_of(rb_node, struct saved_value, rb_node);
92 free(v);
93}
94
90static struct saved_value *saved_value_lookup(struct perf_evsel *evsel, 95static struct saved_value *saved_value_lookup(struct perf_evsel *evsel,
91 int cpu, 96 int cpu,
92 bool create) 97 bool create,
98 enum stat_type type,
99 int ctx,
100 struct runtime_stat *st)
93{ 101{
102 struct rblist *rblist;
94 struct rb_node *nd; 103 struct rb_node *nd;
95 struct saved_value dm = { 104 struct saved_value dm = {
96 .cpu = cpu, 105 .cpu = cpu,
97 .evsel = evsel, 106 .evsel = evsel,
107 .type = type,
108 .ctx = ctx,
109 .stat = st,
98 }; 110 };
99 nd = rblist__find(&runtime_saved_values, &dm); 111
112 rblist = &st->value_list;
113
114 nd = rblist__find(rblist, &dm);
100 if (nd) 115 if (nd)
101 return container_of(nd, struct saved_value, rb_node); 116 return container_of(nd, struct saved_value, rb_node);
102 if (create) { 117 if (create) {
103 rblist__add_node(&runtime_saved_values, &dm); 118 rblist__add_node(rblist, &dm);
104 nd = rblist__find(&runtime_saved_values, &dm); 119 nd = rblist__find(rblist, &dm);
105 if (nd) 120 if (nd)
106 return container_of(nd, struct saved_value, rb_node); 121 return container_of(nd, struct saved_value, rb_node);
107 } 122 }
108 return NULL; 123 return NULL;
109} 124}
110 125
126void runtime_stat__init(struct runtime_stat *st)
127{
128 struct rblist *rblist = &st->value_list;
129
130 rblist__init(rblist);
131 rblist->node_cmp = saved_value_cmp;
132 rblist->node_new = saved_value_new;
133 rblist->node_delete = saved_value_delete;
134}
135
136void runtime_stat__exit(struct runtime_stat *st)
137{
138 rblist__exit(&st->value_list);
139}
140
111void perf_stat__init_shadow_stats(void) 141void perf_stat__init_shadow_stats(void)
112{ 142{
113 have_frontend_stalled = pmu_have_event("cpu", "stalled-cycles-frontend"); 143 have_frontend_stalled = pmu_have_event("cpu", "stalled-cycles-frontend");
114 rblist__init(&runtime_saved_values); 144 runtime_stat__init(&rt_stat);
115 runtime_saved_values.node_cmp = saved_value_cmp;
116 runtime_saved_values.node_new = saved_value_new;
117 /* No delete for now */
118} 145}
119 146
120static int evsel_context(struct perf_evsel *evsel) 147static int evsel_context(struct perf_evsel *evsel)
@@ -135,36 +162,13 @@ static int evsel_context(struct perf_evsel *evsel)
135 return ctx; 162 return ctx;
136} 163}
137 164
138void perf_stat__reset_shadow_stats(void) 165static void reset_stat(struct runtime_stat *st)
139{ 166{
167 struct rblist *rblist;
140 struct rb_node *pos, *next; 168 struct rb_node *pos, *next;
141 169
142 memset(runtime_nsecs_stats, 0, sizeof(runtime_nsecs_stats)); 170 rblist = &st->value_list;
143 memset(runtime_cycles_stats, 0, sizeof(runtime_cycles_stats)); 171 next = rb_first(&rblist->entries);
144 memset(runtime_stalled_cycles_front_stats, 0, sizeof(runtime_stalled_cycles_front_stats));
145 memset(runtime_stalled_cycles_back_stats, 0, sizeof(runtime_stalled_cycles_back_stats));
146 memset(runtime_branches_stats, 0, sizeof(runtime_branches_stats));
147 memset(runtime_cacherefs_stats, 0, sizeof(runtime_cacherefs_stats));
148 memset(runtime_l1_dcache_stats, 0, sizeof(runtime_l1_dcache_stats));
149 memset(runtime_l1_icache_stats, 0, sizeof(runtime_l1_icache_stats));
150 memset(runtime_ll_cache_stats, 0, sizeof(runtime_ll_cache_stats));
151 memset(runtime_itlb_cache_stats, 0, sizeof(runtime_itlb_cache_stats));
152 memset(runtime_dtlb_cache_stats, 0, sizeof(runtime_dtlb_cache_stats));
153 memset(runtime_cycles_in_tx_stats, 0,
154 sizeof(runtime_cycles_in_tx_stats));
155 memset(runtime_transaction_stats, 0,
156 sizeof(runtime_transaction_stats));
157 memset(runtime_elision_stats, 0, sizeof(runtime_elision_stats));
158 memset(&walltime_nsecs_stats, 0, sizeof(walltime_nsecs_stats));
159 memset(runtime_topdown_total_slots, 0, sizeof(runtime_topdown_total_slots));
160 memset(runtime_topdown_slots_retired, 0, sizeof(runtime_topdown_slots_retired));
161 memset(runtime_topdown_slots_issued, 0, sizeof(runtime_topdown_slots_issued));
162 memset(runtime_topdown_fetch_bubbles, 0, sizeof(runtime_topdown_fetch_bubbles));
163 memset(runtime_topdown_recovery_bubbles, 0, sizeof(runtime_topdown_recovery_bubbles));
164 memset(runtime_smi_num_stats, 0, sizeof(runtime_smi_num_stats));
165 memset(runtime_aperf_stats, 0, sizeof(runtime_aperf_stats));
166
167 next = rb_first(&runtime_saved_values.entries);
168 while (next) { 172 while (next) {
169 pos = next; 173 pos = next;
170 next = rb_next(pos); 174 next = rb_next(pos);
@@ -174,13 +178,35 @@ void perf_stat__reset_shadow_stats(void)
174 } 178 }
175} 179}
176 180
181void perf_stat__reset_shadow_stats(void)
182{
183 reset_stat(&rt_stat);
184 memset(&walltime_nsecs_stats, 0, sizeof(walltime_nsecs_stats));
185}
186
187void perf_stat__reset_shadow_per_stat(struct runtime_stat *st)
188{
189 reset_stat(st);
190}
191
192static void update_runtime_stat(struct runtime_stat *st,
193 enum stat_type type,
194 int ctx, int cpu, u64 count)
195{
196 struct saved_value *v = saved_value_lookup(NULL, cpu, true,
197 type, ctx, st);
198
199 if (v)
200 update_stats(&v->stats, count);
201}
202
177/* 203/*
178 * Update various tracking values we maintain to print 204 * Update various tracking values we maintain to print
179 * more semantic information such as miss/hit ratios, 205 * more semantic information such as miss/hit ratios,
180 * instruction rates, etc: 206 * instruction rates, etc:
181 */ 207 */
182void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count, 208void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count,
183 int cpu) 209 int cpu, struct runtime_stat *st)
184{ 210{
185 int ctx = evsel_context(counter); 211 int ctx = evsel_context(counter);
186 212
@@ -188,50 +214,58 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count,
188 214
189 if (perf_evsel__match(counter, SOFTWARE, SW_TASK_CLOCK) || 215 if (perf_evsel__match(counter, SOFTWARE, SW_TASK_CLOCK) ||
190 perf_evsel__match(counter, SOFTWARE, SW_CPU_CLOCK)) 216 perf_evsel__match(counter, SOFTWARE, SW_CPU_CLOCK))
191 update_stats(&runtime_nsecs_stats[cpu], count); 217 update_runtime_stat(st, STAT_NSECS, 0, cpu, count);
192 else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) 218 else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES))
193 update_stats(&runtime_cycles_stats[ctx][cpu], count); 219 update_runtime_stat(st, STAT_CYCLES, ctx, cpu, count);
194 else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) 220 else if (perf_stat_evsel__is(counter, CYCLES_IN_TX))
195 update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count); 221 update_runtime_stat(st, STAT_CYCLES_IN_TX, ctx, cpu, count);
196 else if (perf_stat_evsel__is(counter, TRANSACTION_START)) 222 else if (perf_stat_evsel__is(counter, TRANSACTION_START))
197 update_stats(&runtime_transaction_stats[ctx][cpu], count); 223 update_runtime_stat(st, STAT_TRANSACTION, ctx, cpu, count);
198 else if (perf_stat_evsel__is(counter, ELISION_START)) 224 else if (perf_stat_evsel__is(counter, ELISION_START))
199 update_stats(&runtime_elision_stats[ctx][cpu], count); 225 update_runtime_stat(st, STAT_ELISION, ctx, cpu, count);
200 else if (perf_stat_evsel__is(counter, TOPDOWN_TOTAL_SLOTS)) 226 else if (perf_stat_evsel__is(counter, TOPDOWN_TOTAL_SLOTS))
201 update_stats(&runtime_topdown_total_slots[ctx][cpu], count); 227 update_runtime_stat(st, STAT_TOPDOWN_TOTAL_SLOTS,
228 ctx, cpu, count);
202 else if (perf_stat_evsel__is(counter, TOPDOWN_SLOTS_ISSUED)) 229 else if (perf_stat_evsel__is(counter, TOPDOWN_SLOTS_ISSUED))
203 update_stats(&runtime_topdown_slots_issued[ctx][cpu], count); 230 update_runtime_stat(st, STAT_TOPDOWN_SLOTS_ISSUED,
231 ctx, cpu, count);
204 else if (perf_stat_evsel__is(counter, TOPDOWN_SLOTS_RETIRED)) 232 else if (perf_stat_evsel__is(counter, TOPDOWN_SLOTS_RETIRED))
205 update_stats(&runtime_topdown_slots_retired[ctx][cpu], count); 233 update_runtime_stat(st, STAT_TOPDOWN_SLOTS_RETIRED,
234 ctx, cpu, count);
206 else if (perf_stat_evsel__is(counter, TOPDOWN_FETCH_BUBBLES)) 235 else if (perf_stat_evsel__is(counter, TOPDOWN_FETCH_BUBBLES))
207 update_stats(&runtime_topdown_fetch_bubbles[ctx][cpu], count); 236 update_runtime_stat(st, STAT_TOPDOWN_FETCH_BUBBLES,
237 ctx, cpu, count);
208 else if (perf_stat_evsel__is(counter, TOPDOWN_RECOVERY_BUBBLES)) 238 else if (perf_stat_evsel__is(counter, TOPDOWN_RECOVERY_BUBBLES))
209 update_stats(&runtime_topdown_recovery_bubbles[ctx][cpu], count); 239 update_runtime_stat(st, STAT_TOPDOWN_RECOVERY_BUBBLES,
240 ctx, cpu, count);
210 else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) 241 else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_FRONTEND))
211 update_stats(&runtime_stalled_cycles_front_stats[ctx][cpu], count); 242 update_runtime_stat(st, STAT_STALLED_CYCLES_FRONT,
243 ctx, cpu, count);
212 else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_BACKEND)) 244 else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_BACKEND))
213 update_stats(&runtime_stalled_cycles_back_stats[ctx][cpu], count); 245 update_runtime_stat(st, STAT_STALLED_CYCLES_BACK,
246 ctx, cpu, count);
214 else if (perf_evsel__match(counter, HARDWARE, HW_BRANCH_INSTRUCTIONS)) 247 else if (perf_evsel__match(counter, HARDWARE, HW_BRANCH_INSTRUCTIONS))
215 update_stats(&runtime_branches_stats[ctx][cpu], count); 248 update_runtime_stat(st, STAT_BRANCHES, ctx, cpu, count);
216 else if (perf_evsel__match(counter, HARDWARE, HW_CACHE_REFERENCES)) 249 else if (perf_evsel__match(counter, HARDWARE, HW_CACHE_REFERENCES))
217 update_stats(&runtime_cacherefs_stats[ctx][cpu], count); 250 update_runtime_stat(st, STAT_CACHEREFS, ctx, cpu, count);
218 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1D)) 251 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1D))
219 update_stats(&runtime_l1_dcache_stats[ctx][cpu], count); 252 update_runtime_stat(st, STAT_L1_DCACHE, ctx, cpu, count);
220 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1I)) 253 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1I))
221 update_stats(&runtime_ll_cache_stats[ctx][cpu], count); 254 update_runtime_stat(st, STAT_L1_ICACHE, ctx, cpu, count);
222 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_LL)) 255 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_LL))
223 update_stats(&runtime_ll_cache_stats[ctx][cpu], count); 256 update_runtime_stat(st, STAT_LL_CACHE, ctx, cpu, count);
224 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_DTLB)) 257 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_DTLB))
225 update_stats(&runtime_dtlb_cache_stats[ctx][cpu], count); 258 update_runtime_stat(st, STAT_DTLB_CACHE, ctx, cpu, count);
226 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB)) 259 else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB))
227 update_stats(&runtime_itlb_cache_stats[ctx][cpu], count); 260 update_runtime_stat(st, STAT_ITLB_CACHE, ctx, cpu, count);
228 else if (perf_stat_evsel__is(counter, SMI_NUM)) 261 else if (perf_stat_evsel__is(counter, SMI_NUM))
229 update_stats(&runtime_smi_num_stats[ctx][cpu], count); 262 update_runtime_stat(st, STAT_SMI_NUM, ctx, cpu, count);
230 else if (perf_stat_evsel__is(counter, APERF)) 263 else if (perf_stat_evsel__is(counter, APERF))
231 update_stats(&runtime_aperf_stats[ctx][cpu], count); 264 update_runtime_stat(st, STAT_APERF, ctx, cpu, count);
232 265
233 if (counter->collect_stat) { 266 if (counter->collect_stat) {
234 struct saved_value *v = saved_value_lookup(counter, cpu, true); 267 struct saved_value *v = saved_value_lookup(counter, cpu, true,
268 STAT_NONE, 0, st);
235 update_stats(&v->stats, count); 269 update_stats(&v->stats, count);
236 } 270 }
237} 271}
@@ -352,15 +386,40 @@ void perf_stat__collect_metric_expr(struct perf_evlist *evsel_list)
352 } 386 }
353} 387}
354 388
389static double runtime_stat_avg(struct runtime_stat *st,
390 enum stat_type type, int ctx, int cpu)
391{
392 struct saved_value *v;
393
394 v = saved_value_lookup(NULL, cpu, false, type, ctx, st);
395 if (!v)
396 return 0.0;
397
398 return avg_stats(&v->stats);
399}
400
401static double runtime_stat_n(struct runtime_stat *st,
402 enum stat_type type, int ctx, int cpu)
403{
404 struct saved_value *v;
405
406 v = saved_value_lookup(NULL, cpu, false, type, ctx, st);
407 if (!v)
408 return 0.0;
409
410 return v->stats.n;
411}
412
355static void print_stalled_cycles_frontend(int cpu, 413static void print_stalled_cycles_frontend(int cpu,
356 struct perf_evsel *evsel, double avg, 414 struct perf_evsel *evsel, double avg,
357 struct perf_stat_output_ctx *out) 415 struct perf_stat_output_ctx *out,
416 struct runtime_stat *st)
358{ 417{
359 double total, ratio = 0.0; 418 double total, ratio = 0.0;
360 const char *color; 419 const char *color;
361 int ctx = evsel_context(evsel); 420 int ctx = evsel_context(evsel);
362 421
363 total = avg_stats(&runtime_cycles_stats[ctx][cpu]); 422 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu);
364 423
365 if (total) 424 if (total)
366 ratio = avg / total * 100.0; 425 ratio = avg / total * 100.0;
@@ -376,13 +435,14 @@ static void print_stalled_cycles_frontend(int cpu,
376 435
377static void print_stalled_cycles_backend(int cpu, 436static void print_stalled_cycles_backend(int cpu,
378 struct perf_evsel *evsel, double avg, 437 struct perf_evsel *evsel, double avg,
379 struct perf_stat_output_ctx *out) 438 struct perf_stat_output_ctx *out,
439 struct runtime_stat *st)
380{ 440{
381 double total, ratio = 0.0; 441 double total, ratio = 0.0;
382 const char *color; 442 const char *color;
383 int ctx = evsel_context(evsel); 443 int ctx = evsel_context(evsel);
384 444
385 total = avg_stats(&runtime_cycles_stats[ctx][cpu]); 445 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu);
386 446
387 if (total) 447 if (total)
388 ratio = avg / total * 100.0; 448 ratio = avg / total * 100.0;
@@ -395,13 +455,14 @@ static void print_stalled_cycles_backend(int cpu,
395static void print_branch_misses(int cpu, 455static void print_branch_misses(int cpu,
396 struct perf_evsel *evsel, 456 struct perf_evsel *evsel,
397 double avg, 457 double avg,
398 struct perf_stat_output_ctx *out) 458 struct perf_stat_output_ctx *out,
459 struct runtime_stat *st)
399{ 460{
400 double total, ratio = 0.0; 461 double total, ratio = 0.0;
401 const char *color; 462 const char *color;
402 int ctx = evsel_context(evsel); 463 int ctx = evsel_context(evsel);
403 464
404 total = avg_stats(&runtime_branches_stats[ctx][cpu]); 465 total = runtime_stat_avg(st, STAT_BRANCHES, ctx, cpu);
405 466
406 if (total) 467 if (total)
407 ratio = avg / total * 100.0; 468 ratio = avg / total * 100.0;
@@ -414,13 +475,15 @@ static void print_branch_misses(int cpu,
414static void print_l1_dcache_misses(int cpu, 475static void print_l1_dcache_misses(int cpu,
415 struct perf_evsel *evsel, 476 struct perf_evsel *evsel,
416 double avg, 477 double avg,
417 struct perf_stat_output_ctx *out) 478 struct perf_stat_output_ctx *out,
479 struct runtime_stat *st)
480
418{ 481{
419 double total, ratio = 0.0; 482 double total, ratio = 0.0;
420 const char *color; 483 const char *color;
421 int ctx = evsel_context(evsel); 484 int ctx = evsel_context(evsel);
422 485
423 total = avg_stats(&runtime_l1_dcache_stats[ctx][cpu]); 486 total = runtime_stat_avg(st, STAT_L1_DCACHE, ctx, cpu);
424 487
425 if (total) 488 if (total)
426 ratio = avg / total * 100.0; 489 ratio = avg / total * 100.0;
@@ -433,13 +496,15 @@ static void print_l1_dcache_misses(int cpu,
433static void print_l1_icache_misses(int cpu, 496static void print_l1_icache_misses(int cpu,
434 struct perf_evsel *evsel, 497 struct perf_evsel *evsel,
435 double avg, 498 double avg,
436 struct perf_stat_output_ctx *out) 499 struct perf_stat_output_ctx *out,
500 struct runtime_stat *st)
501
437{ 502{
438 double total, ratio = 0.0; 503 double total, ratio = 0.0;
439 const char *color; 504 const char *color;
440 int ctx = evsel_context(evsel); 505 int ctx = evsel_context(evsel);
441 506
442 total = avg_stats(&runtime_l1_icache_stats[ctx][cpu]); 507 total = runtime_stat_avg(st, STAT_L1_ICACHE, ctx, cpu);
443 508
444 if (total) 509 if (total)
445 ratio = avg / total * 100.0; 510 ratio = avg / total * 100.0;
@@ -451,13 +516,14 @@ static void print_l1_icache_misses(int cpu,
451static void print_dtlb_cache_misses(int cpu, 516static void print_dtlb_cache_misses(int cpu,
452 struct perf_evsel *evsel, 517 struct perf_evsel *evsel,
453 double avg, 518 double avg,
454 struct perf_stat_output_ctx *out) 519 struct perf_stat_output_ctx *out,
520 struct runtime_stat *st)
455{ 521{
456 double total, ratio = 0.0; 522 double total, ratio = 0.0;
457 const char *color; 523 const char *color;
458 int ctx = evsel_context(evsel); 524 int ctx = evsel_context(evsel);
459 525
460 total = avg_stats(&runtime_dtlb_cache_stats[ctx][cpu]); 526 total = runtime_stat_avg(st, STAT_DTLB_CACHE, ctx, cpu);
461 527
462 if (total) 528 if (total)
463 ratio = avg / total * 100.0; 529 ratio = avg / total * 100.0;
@@ -469,13 +535,14 @@ static void print_dtlb_cache_misses(int cpu,
469static void print_itlb_cache_misses(int cpu, 535static void print_itlb_cache_misses(int cpu,
470 struct perf_evsel *evsel, 536 struct perf_evsel *evsel,
471 double avg, 537 double avg,
472 struct perf_stat_output_ctx *out) 538 struct perf_stat_output_ctx *out,
539 struct runtime_stat *st)
473{ 540{
474 double total, ratio = 0.0; 541 double total, ratio = 0.0;
475 const char *color; 542 const char *color;
476 int ctx = evsel_context(evsel); 543 int ctx = evsel_context(evsel);
477 544
478 total = avg_stats(&runtime_itlb_cache_stats[ctx][cpu]); 545 total = runtime_stat_avg(st, STAT_ITLB_CACHE, ctx, cpu);
479 546
480 if (total) 547 if (total)
481 ratio = avg / total * 100.0; 548 ratio = avg / total * 100.0;
@@ -487,13 +554,14 @@ static void print_itlb_cache_misses(int cpu,
487static void print_ll_cache_misses(int cpu, 554static void print_ll_cache_misses(int cpu,
488 struct perf_evsel *evsel, 555 struct perf_evsel *evsel,
489 double avg, 556 double avg,
490 struct perf_stat_output_ctx *out) 557 struct perf_stat_output_ctx *out,
558 struct runtime_stat *st)
491{ 559{
492 double total, ratio = 0.0; 560 double total, ratio = 0.0;
493 const char *color; 561 const char *color;
494 int ctx = evsel_context(evsel); 562 int ctx = evsel_context(evsel);
495 563
496 total = avg_stats(&runtime_ll_cache_stats[ctx][cpu]); 564 total = runtime_stat_avg(st, STAT_LL_CACHE, ctx, cpu);
497 565
498 if (total) 566 if (total)
499 ratio = avg / total * 100.0; 567 ratio = avg / total * 100.0;
@@ -551,68 +619,72 @@ static double sanitize_val(double x)
551 return x; 619 return x;
552} 620}
553 621
554static double td_total_slots(int ctx, int cpu) 622static double td_total_slots(int ctx, int cpu, struct runtime_stat *st)
555{ 623{
556 return avg_stats(&runtime_topdown_total_slots[ctx][cpu]); 624 return runtime_stat_avg(st, STAT_TOPDOWN_TOTAL_SLOTS, ctx, cpu);
557} 625}
558 626
559static double td_bad_spec(int ctx, int cpu) 627static double td_bad_spec(int ctx, int cpu, struct runtime_stat *st)
560{ 628{
561 double bad_spec = 0; 629 double bad_spec = 0;
562 double total_slots; 630 double total_slots;
563 double total; 631 double total;
564 632
565 total = avg_stats(&runtime_topdown_slots_issued[ctx][cpu]) - 633 total = runtime_stat_avg(st, STAT_TOPDOWN_SLOTS_ISSUED, ctx, cpu) -
566 avg_stats(&runtime_topdown_slots_retired[ctx][cpu]) + 634 runtime_stat_avg(st, STAT_TOPDOWN_SLOTS_RETIRED, ctx, cpu) +
567 avg_stats(&runtime_topdown_recovery_bubbles[ctx][cpu]); 635 runtime_stat_avg(st, STAT_TOPDOWN_RECOVERY_BUBBLES, ctx, cpu);
568 total_slots = td_total_slots(ctx, cpu); 636
637 total_slots = td_total_slots(ctx, cpu, st);
569 if (total_slots) 638 if (total_slots)
570 bad_spec = total / total_slots; 639 bad_spec = total / total_slots;
571 return sanitize_val(bad_spec); 640 return sanitize_val(bad_spec);
572} 641}
573 642
574static double td_retiring(int ctx, int cpu) 643static double td_retiring(int ctx, int cpu, struct runtime_stat *st)
575{ 644{
576 double retiring = 0; 645 double retiring = 0;
577 double total_slots = td_total_slots(ctx, cpu); 646 double total_slots = td_total_slots(ctx, cpu, st);
578 double ret_slots = avg_stats(&runtime_topdown_slots_retired[ctx][cpu]); 647 double ret_slots = runtime_stat_avg(st, STAT_TOPDOWN_SLOTS_RETIRED,
648 ctx, cpu);
579 649
580 if (total_slots) 650 if (total_slots)
581 retiring = ret_slots / total_slots; 651 retiring = ret_slots / total_slots;
582 return retiring; 652 return retiring;
583} 653}
584 654
585static double td_fe_bound(int ctx, int cpu) 655static double td_fe_bound(int ctx, int cpu, struct runtime_stat *st)
586{ 656{
587 double fe_bound = 0; 657 double fe_bound = 0;
588 double total_slots = td_total_slots(ctx, cpu); 658 double total_slots = td_total_slots(ctx, cpu, st);
589 double fetch_bub = avg_stats(&runtime_topdown_fetch_bubbles[ctx][cpu]); 659 double fetch_bub = runtime_stat_avg(st, STAT_TOPDOWN_FETCH_BUBBLES,
660 ctx, cpu);
590 661
591 if (total_slots) 662 if (total_slots)
592 fe_bound = fetch_bub / total_slots; 663 fe_bound = fetch_bub / total_slots;
593 return fe_bound; 664 return fe_bound;
594} 665}
595 666
596static double td_be_bound(int ctx, int cpu) 667static double td_be_bound(int ctx, int cpu, struct runtime_stat *st)
597{ 668{
598 double sum = (td_fe_bound(ctx, cpu) + 669 double sum = (td_fe_bound(ctx, cpu, st) +
599 td_bad_spec(ctx, cpu) + 670 td_bad_spec(ctx, cpu, st) +
600 td_retiring(ctx, cpu)); 671 td_retiring(ctx, cpu, st));
601 if (sum == 0) 672 if (sum == 0)
602 return 0; 673 return 0;
603 return sanitize_val(1.0 - sum); 674 return sanitize_val(1.0 - sum);
604} 675}
605 676
606static void print_smi_cost(int cpu, struct perf_evsel *evsel, 677static void print_smi_cost(int cpu, struct perf_evsel *evsel,
607 struct perf_stat_output_ctx *out) 678 struct perf_stat_output_ctx *out,
679 struct runtime_stat *st)
608{ 680{
609 double smi_num, aperf, cycles, cost = 0.0; 681 double smi_num, aperf, cycles, cost = 0.0;
610 int ctx = evsel_context(evsel); 682 int ctx = evsel_context(evsel);
611 const char *color = NULL; 683 const char *color = NULL;
612 684
613 smi_num = avg_stats(&runtime_smi_num_stats[ctx][cpu]); 685 smi_num = runtime_stat_avg(st, STAT_SMI_NUM, ctx, cpu);
614 aperf = avg_stats(&runtime_aperf_stats[ctx][cpu]); 686 aperf = runtime_stat_avg(st, STAT_APERF, ctx, cpu);
615 cycles = avg_stats(&runtime_cycles_stats[ctx][cpu]); 687 cycles = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu);
616 688
617 if ((cycles == 0) || (aperf == 0)) 689 if ((cycles == 0) || (aperf == 0))
618 return; 690 return;
@@ -632,7 +704,8 @@ static void generic_metric(const char *metric_expr,
632 const char *metric_name, 704 const char *metric_name,
633 double avg, 705 double avg,
634 int cpu, 706 int cpu,
635 struct perf_stat_output_ctx *out) 707 struct perf_stat_output_ctx *out,
708 struct runtime_stat *st)
636{ 709{
637 print_metric_t print_metric = out->print_metric; 710 print_metric_t print_metric = out->print_metric;
638 struct parse_ctx pctx; 711 struct parse_ctx pctx;
@@ -651,7 +724,8 @@ static void generic_metric(const char *metric_expr,
651 stats = &walltime_nsecs_stats; 724 stats = &walltime_nsecs_stats;
652 scale = 1e-9; 725 scale = 1e-9;
653 } else { 726 } else {
654 v = saved_value_lookup(metric_events[i], cpu, false); 727 v = saved_value_lookup(metric_events[i], cpu, false,
728 STAT_NONE, 0, st);
655 if (!v) 729 if (!v)
656 break; 730 break;
657 stats = &v->stats; 731 stats = &v->stats;
@@ -679,7 +753,8 @@ static void generic_metric(const char *metric_expr,
679void perf_stat__print_shadow_stats(struct perf_evsel *evsel, 753void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
680 double avg, int cpu, 754 double avg, int cpu,
681 struct perf_stat_output_ctx *out, 755 struct perf_stat_output_ctx *out,
682 struct rblist *metric_events) 756 struct rblist *metric_events,
757 struct runtime_stat *st)
683{ 758{
684 void *ctxp = out->ctx; 759 void *ctxp = out->ctx;
685 print_metric_t print_metric = out->print_metric; 760 print_metric_t print_metric = out->print_metric;
@@ -690,7 +765,8 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
690 int num = 1; 765 int num = 1;
691 766
692 if (perf_evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS)) { 767 if (perf_evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS)) {
693 total = avg_stats(&runtime_cycles_stats[ctx][cpu]); 768 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu);
769
694 if (total) { 770 if (total) {
695 ratio = avg / total; 771 ratio = avg / total;
696 print_metric(ctxp, NULL, "%7.2f ", 772 print_metric(ctxp, NULL, "%7.2f ",
@@ -698,8 +774,13 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
698 } else { 774 } else {
699 print_metric(ctxp, NULL, NULL, "insn per cycle", 0); 775 print_metric(ctxp, NULL, NULL, "insn per cycle", 0);
700 } 776 }
701 total = avg_stats(&runtime_stalled_cycles_front_stats[ctx][cpu]); 777
702 total = max(total, avg_stats(&runtime_stalled_cycles_back_stats[ctx][cpu])); 778 total = runtime_stat_avg(st, STAT_STALLED_CYCLES_FRONT,
779 ctx, cpu);
780
781 total = max(total, runtime_stat_avg(st,
782 STAT_STALLED_CYCLES_BACK,
783 ctx, cpu));
703 784
704 if (total && avg) { 785 if (total && avg) {
705 out->new_line(ctxp); 786 out->new_line(ctxp);
@@ -712,8 +793,8 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
712 "stalled cycles per insn", 0); 793 "stalled cycles per insn", 0);
713 } 794 }
714 } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES)) { 795 } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES)) {
715 if (runtime_branches_stats[ctx][cpu].n != 0) 796 if (runtime_stat_n(st, STAT_BRANCHES, ctx, cpu) != 0)
716 print_branch_misses(cpu, evsel, avg, out); 797 print_branch_misses(cpu, evsel, avg, out, st);
717 else 798 else
718 print_metric(ctxp, NULL, NULL, "of all branches", 0); 799 print_metric(ctxp, NULL, NULL, "of all branches", 0);
719 } else if ( 800 } else if (
@@ -721,8 +802,9 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
721 evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1D | 802 evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1D |
722 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | 803 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) |
723 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { 804 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) {
724 if (runtime_l1_dcache_stats[ctx][cpu].n != 0) 805
725 print_l1_dcache_misses(cpu, evsel, avg, out); 806 if (runtime_stat_n(st, STAT_L1_DCACHE, ctx, cpu) != 0)
807 print_l1_dcache_misses(cpu, evsel, avg, out, st);
726 else 808 else
727 print_metric(ctxp, NULL, NULL, "of all L1-dcache hits", 0); 809 print_metric(ctxp, NULL, NULL, "of all L1-dcache hits", 0);
728 } else if ( 810 } else if (
@@ -730,8 +812,9 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
730 evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1I | 812 evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1I |
731 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | 813 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) |
732 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { 814 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) {
733 if (runtime_l1_icache_stats[ctx][cpu].n != 0) 815
734 print_l1_icache_misses(cpu, evsel, avg, out); 816 if (runtime_stat_n(st, STAT_L1_ICACHE, ctx, cpu) != 0)
817 print_l1_icache_misses(cpu, evsel, avg, out, st);
735 else 818 else
736 print_metric(ctxp, NULL, NULL, "of all L1-icache hits", 0); 819 print_metric(ctxp, NULL, NULL, "of all L1-icache hits", 0);
737 } else if ( 820 } else if (
@@ -739,8 +822,9 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
739 evsel->attr.config == ( PERF_COUNT_HW_CACHE_DTLB | 822 evsel->attr.config == ( PERF_COUNT_HW_CACHE_DTLB |
740 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | 823 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) |
741 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { 824 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) {
742 if (runtime_dtlb_cache_stats[ctx][cpu].n != 0) 825
743 print_dtlb_cache_misses(cpu, evsel, avg, out); 826 if (runtime_stat_n(st, STAT_DTLB_CACHE, ctx, cpu) != 0)
827 print_dtlb_cache_misses(cpu, evsel, avg, out, st);
744 else 828 else
745 print_metric(ctxp, NULL, NULL, "of all dTLB cache hits", 0); 829 print_metric(ctxp, NULL, NULL, "of all dTLB cache hits", 0);
746 } else if ( 830 } else if (
@@ -748,8 +832,9 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
748 evsel->attr.config == ( PERF_COUNT_HW_CACHE_ITLB | 832 evsel->attr.config == ( PERF_COUNT_HW_CACHE_ITLB |
749 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | 833 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) |
750 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { 834 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) {
751 if (runtime_itlb_cache_stats[ctx][cpu].n != 0) 835
752 print_itlb_cache_misses(cpu, evsel, avg, out); 836 if (runtime_stat_n(st, STAT_ITLB_CACHE, ctx, cpu) != 0)
837 print_itlb_cache_misses(cpu, evsel, avg, out, st);
753 else 838 else
754 print_metric(ctxp, NULL, NULL, "of all iTLB cache hits", 0); 839 print_metric(ctxp, NULL, NULL, "of all iTLB cache hits", 0);
755 } else if ( 840 } else if (
@@ -757,27 +842,28 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
757 evsel->attr.config == ( PERF_COUNT_HW_CACHE_LL | 842 evsel->attr.config == ( PERF_COUNT_HW_CACHE_LL |
758 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | 843 ((PERF_COUNT_HW_CACHE_OP_READ) << 8) |
759 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { 844 ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) {
760 if (runtime_ll_cache_stats[ctx][cpu].n != 0) 845
761 print_ll_cache_misses(cpu, evsel, avg, out); 846 if (runtime_stat_n(st, STAT_LL_CACHE, ctx, cpu) != 0)
847 print_ll_cache_misses(cpu, evsel, avg, out, st);
762 else 848 else
763 print_metric(ctxp, NULL, NULL, "of all LL-cache hits", 0); 849 print_metric(ctxp, NULL, NULL, "of all LL-cache hits", 0);
764 } else if (perf_evsel__match(evsel, HARDWARE, HW_CACHE_MISSES)) { 850 } else if (perf_evsel__match(evsel, HARDWARE, HW_CACHE_MISSES)) {
765 total = avg_stats(&runtime_cacherefs_stats[ctx][cpu]); 851 total = runtime_stat_avg(st, STAT_CACHEREFS, ctx, cpu);
766 852
767 if (total) 853 if (total)
768 ratio = avg * 100 / total; 854 ratio = avg * 100 / total;
769 855
770 if (runtime_cacherefs_stats[ctx][cpu].n != 0) 856 if (runtime_stat_n(st, STAT_CACHEREFS, ctx, cpu) != 0)
771 print_metric(ctxp, NULL, "%8.3f %%", 857 print_metric(ctxp, NULL, "%8.3f %%",
772 "of all cache refs", ratio); 858 "of all cache refs", ratio);
773 else 859 else
774 print_metric(ctxp, NULL, NULL, "of all cache refs", 0); 860 print_metric(ctxp, NULL, NULL, "of all cache refs", 0);
775 } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) { 861 } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) {
776 print_stalled_cycles_frontend(cpu, evsel, avg, out); 862 print_stalled_cycles_frontend(cpu, evsel, avg, out, st);
777 } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_BACKEND)) { 863 } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_BACKEND)) {
778 print_stalled_cycles_backend(cpu, evsel, avg, out); 864 print_stalled_cycles_backend(cpu, evsel, avg, out, st);
779 } else if (perf_evsel__match(evsel, HARDWARE, HW_CPU_CYCLES)) { 865 } else if (perf_evsel__match(evsel, HARDWARE, HW_CPU_CYCLES)) {
780 total = avg_stats(&runtime_nsecs_stats[cpu]); 866 total = runtime_stat_avg(st, STAT_NSECS, 0, cpu);
781 867
782 if (total) { 868 if (total) {
783 ratio = avg / total; 869 ratio = avg / total;
@@ -786,7 +872,8 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
786 print_metric(ctxp, NULL, NULL, "Ghz", 0); 872 print_metric(ctxp, NULL, NULL, "Ghz", 0);
787 } 873 }
788 } else if (perf_stat_evsel__is(evsel, CYCLES_IN_TX)) { 874 } else if (perf_stat_evsel__is(evsel, CYCLES_IN_TX)) {
789 total = avg_stats(&runtime_cycles_stats[ctx][cpu]); 875 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu);
876
790 if (total) 877 if (total)
791 print_metric(ctxp, NULL, 878 print_metric(ctxp, NULL,
792 "%7.2f%%", "transactional cycles", 879 "%7.2f%%", "transactional cycles",
@@ -795,8 +882,9 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
795 print_metric(ctxp, NULL, NULL, "transactional cycles", 882 print_metric(ctxp, NULL, NULL, "transactional cycles",
796 0); 883 0);
797 } else if (perf_stat_evsel__is(evsel, CYCLES_IN_TX_CP)) { 884 } else if (perf_stat_evsel__is(evsel, CYCLES_IN_TX_CP)) {
798 total = avg_stats(&runtime_cycles_stats[ctx][cpu]); 885 total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu);
799 total2 = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); 886 total2 = runtime_stat_avg(st, STAT_CYCLES_IN_TX, ctx, cpu);
887
800 if (total2 < avg) 888 if (total2 < avg)
801 total2 = avg; 889 total2 = avg;
802 if (total) 890 if (total)
@@ -805,19 +893,21 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
805 else 893 else
806 print_metric(ctxp, NULL, NULL, "aborted cycles", 0); 894 print_metric(ctxp, NULL, NULL, "aborted cycles", 0);
807 } else if (perf_stat_evsel__is(evsel, TRANSACTION_START)) { 895 } else if (perf_stat_evsel__is(evsel, TRANSACTION_START)) {
808 total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); 896 total = runtime_stat_avg(st, STAT_CYCLES_IN_TX,
897 ctx, cpu);
809 898
810 if (avg) 899 if (avg)
811 ratio = total / avg; 900 ratio = total / avg;
812 901
813 if (runtime_cycles_in_tx_stats[ctx][cpu].n != 0) 902 if (runtime_stat_n(st, STAT_CYCLES_IN_TX, ctx, cpu) != 0)
814 print_metric(ctxp, NULL, "%8.0f", 903 print_metric(ctxp, NULL, "%8.0f",
815 "cycles / transaction", ratio); 904 "cycles / transaction", ratio);
816 else 905 else
817 print_metric(ctxp, NULL, NULL, "cycles / transaction", 906 print_metric(ctxp, NULL, NULL, "cycles / transaction",
818 0); 907 0);
819 } else if (perf_stat_evsel__is(evsel, ELISION_START)) { 908 } else if (perf_stat_evsel__is(evsel, ELISION_START)) {
820 total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); 909 total = runtime_stat_avg(st, STAT_CYCLES_IN_TX,
910 ctx, cpu);
821 911
822 if (avg) 912 if (avg)
823 ratio = total / avg; 913 ratio = total / avg;
@@ -831,28 +921,28 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
831 else 921 else
832 print_metric(ctxp, NULL, NULL, "CPUs utilized", 0); 922 print_metric(ctxp, NULL, NULL, "CPUs utilized", 0);
833 } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) { 923 } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) {
834 double fe_bound = td_fe_bound(ctx, cpu); 924 double fe_bound = td_fe_bound(ctx, cpu, st);
835 925
836 if (fe_bound > 0.2) 926 if (fe_bound > 0.2)
837 color = PERF_COLOR_RED; 927 color = PERF_COLOR_RED;
838 print_metric(ctxp, color, "%8.1f%%", "frontend bound", 928 print_metric(ctxp, color, "%8.1f%%", "frontend bound",
839 fe_bound * 100.); 929 fe_bound * 100.);
840 } else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_RETIRED)) { 930 } else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_RETIRED)) {
841 double retiring = td_retiring(ctx, cpu); 931 double retiring = td_retiring(ctx, cpu, st);
842 932
843 if (retiring > 0.7) 933 if (retiring > 0.7)
844 color = PERF_COLOR_GREEN; 934 color = PERF_COLOR_GREEN;
845 print_metric(ctxp, color, "%8.1f%%", "retiring", 935 print_metric(ctxp, color, "%8.1f%%", "retiring",
846 retiring * 100.); 936 retiring * 100.);
847 } else if (perf_stat_evsel__is(evsel, TOPDOWN_RECOVERY_BUBBLES)) { 937 } else if (perf_stat_evsel__is(evsel, TOPDOWN_RECOVERY_BUBBLES)) {
848 double bad_spec = td_bad_spec(ctx, cpu); 938 double bad_spec = td_bad_spec(ctx, cpu, st);
849 939
850 if (bad_spec > 0.1) 940 if (bad_spec > 0.1)
851 color = PERF_COLOR_RED; 941 color = PERF_COLOR_RED;
852 print_metric(ctxp, color, "%8.1f%%", "bad speculation", 942 print_metric(ctxp, color, "%8.1f%%", "bad speculation",
853 bad_spec * 100.); 943 bad_spec * 100.);
854 } else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_ISSUED)) { 944 } else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_ISSUED)) {
855 double be_bound = td_be_bound(ctx, cpu); 945 double be_bound = td_be_bound(ctx, cpu, st);
856 const char *name = "backend bound"; 946 const char *name = "backend bound";
857 static int have_recovery_bubbles = -1; 947 static int have_recovery_bubbles = -1;
858 948
@@ -865,19 +955,19 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
865 955
866 if (be_bound > 0.2) 956 if (be_bound > 0.2)
867 color = PERF_COLOR_RED; 957 color = PERF_COLOR_RED;
868 if (td_total_slots(ctx, cpu) > 0) 958 if (td_total_slots(ctx, cpu, st) > 0)
869 print_metric(ctxp, color, "%8.1f%%", name, 959 print_metric(ctxp, color, "%8.1f%%", name,
870 be_bound * 100.); 960 be_bound * 100.);
871 else 961 else
872 print_metric(ctxp, NULL, NULL, name, 0); 962 print_metric(ctxp, NULL, NULL, name, 0);
873 } else if (evsel->metric_expr) { 963 } else if (evsel->metric_expr) {
874 generic_metric(evsel->metric_expr, evsel->metric_events, evsel->name, 964 generic_metric(evsel->metric_expr, evsel->metric_events, evsel->name,
875 evsel->metric_name, avg, cpu, out); 965 evsel->metric_name, avg, cpu, out, st);
876 } else if (runtime_nsecs_stats[cpu].n != 0) { 966 } else if (runtime_stat_n(st, STAT_NSECS, 0, cpu) != 0) {
877 char unit = 'M'; 967 char unit = 'M';
878 char unit_buf[10]; 968 char unit_buf[10];
879 969
880 total = avg_stats(&runtime_nsecs_stats[cpu]); 970 total = runtime_stat_avg(st, STAT_NSECS, 0, cpu);
881 971
882 if (total) 972 if (total)
883 ratio = 1000.0 * avg / total; 973 ratio = 1000.0 * avg / total;
@@ -888,7 +978,7 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
888 snprintf(unit_buf, sizeof(unit_buf), "%c/sec", unit); 978 snprintf(unit_buf, sizeof(unit_buf), "%c/sec", unit);
889 print_metric(ctxp, NULL, "%8.3f", unit_buf, ratio); 979 print_metric(ctxp, NULL, "%8.3f", unit_buf, ratio);
890 } else if (perf_stat_evsel__is(evsel, SMI_NUM)) { 980 } else if (perf_stat_evsel__is(evsel, SMI_NUM)) {
891 print_smi_cost(cpu, evsel, out); 981 print_smi_cost(cpu, evsel, out, st);
892 } else { 982 } else {
893 num = 0; 983 num = 0;
894 } 984 }
@@ -901,7 +991,7 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
901 out->new_line(ctxp); 991 out->new_line(ctxp);
902 generic_metric(mexp->metric_expr, mexp->metric_events, 992 generic_metric(mexp->metric_expr, mexp->metric_events,
903 evsel->name, mexp->metric_name, 993 evsel->name, mexp->metric_name,
904 avg, cpu, out); 994 avg, cpu, out, st);
905 } 995 }
906 } 996 }
907 if (num == 0) 997 if (num == 0)
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 151e9efd7286..32235657c1ac 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -278,9 +278,16 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel
278 perf_evsel__compute_deltas(evsel, cpu, thread, count); 278 perf_evsel__compute_deltas(evsel, cpu, thread, count);
279 perf_counts_values__scale(count, config->scale, NULL); 279 perf_counts_values__scale(count, config->scale, NULL);
280 if (config->aggr_mode == AGGR_NONE) 280 if (config->aggr_mode == AGGR_NONE)
281 perf_stat__update_shadow_stats(evsel, count->val, cpu); 281 perf_stat__update_shadow_stats(evsel, count->val, cpu,
282 if (config->aggr_mode == AGGR_THREAD) 282 &rt_stat);
283 perf_stat__update_shadow_stats(evsel, count->val, 0); 283 if (config->aggr_mode == AGGR_THREAD) {
284 if (config->stats)
285 perf_stat__update_shadow_stats(evsel,
286 count->val, 0, &config->stats[thread]);
287 else
288 perf_stat__update_shadow_stats(evsel,
289 count->val, 0, &rt_stat);
290 }
284 break; 291 break;
285 case AGGR_GLOBAL: 292 case AGGR_GLOBAL:
286 aggr->val += count->val; 293 aggr->val += count->val;
@@ -362,7 +369,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
362 /* 369 /*
363 * Save the full runtime - to allow normalization during printout: 370 * Save the full runtime - to allow normalization during printout:
364 */ 371 */
365 perf_stat__update_shadow_stats(counter, *count, 0); 372 perf_stat__update_shadow_stats(counter, *count, 0, &rt_stat);
366 373
367 return 0; 374 return 0;
368} 375}
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index eefca5c981fd..dbc6f7134f61 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -5,6 +5,7 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <stdio.h> 6#include <stdio.h>
7#include "xyarray.h" 7#include "xyarray.h"
8#include "rblist.h"
8 9
9struct stats 10struct stats
10{ 11{
@@ -43,11 +44,54 @@ enum aggr_mode {
43 AGGR_UNSET, 44 AGGR_UNSET,
44}; 45};
45 46
47enum {
48 CTX_BIT_USER = 1 << 0,
49 CTX_BIT_KERNEL = 1 << 1,
50 CTX_BIT_HV = 1 << 2,
51 CTX_BIT_HOST = 1 << 3,
52 CTX_BIT_IDLE = 1 << 4,
53 CTX_BIT_MAX = 1 << 5,
54};
55
56#define NUM_CTX CTX_BIT_MAX
57
58enum stat_type {
59 STAT_NONE = 0,
60 STAT_NSECS,
61 STAT_CYCLES,
62 STAT_STALLED_CYCLES_FRONT,
63 STAT_STALLED_CYCLES_BACK,
64 STAT_BRANCHES,
65 STAT_CACHEREFS,
66 STAT_L1_DCACHE,
67 STAT_L1_ICACHE,
68 STAT_LL_CACHE,
69 STAT_ITLB_CACHE,
70 STAT_DTLB_CACHE,
71 STAT_CYCLES_IN_TX,
72 STAT_TRANSACTION,
73 STAT_ELISION,
74 STAT_TOPDOWN_TOTAL_SLOTS,
75 STAT_TOPDOWN_SLOTS_ISSUED,
76 STAT_TOPDOWN_SLOTS_RETIRED,
77 STAT_TOPDOWN_FETCH_BUBBLES,
78 STAT_TOPDOWN_RECOVERY_BUBBLES,
79 STAT_SMI_NUM,
80 STAT_APERF,
81 STAT_MAX
82};
83
84struct runtime_stat {
85 struct rblist value_list;
86};
87
46struct perf_stat_config { 88struct perf_stat_config {
47 enum aggr_mode aggr_mode; 89 enum aggr_mode aggr_mode;
48 bool scale; 90 bool scale;
49 FILE *output; 91 FILE *output;
50 unsigned int interval; 92 unsigned int interval;
93 struct runtime_stat *stats;
94 int stats_num;
51}; 95};
52 96
53void update_stats(struct stats *stats, u64 val); 97void update_stats(struct stats *stats, u64 val);
@@ -67,6 +111,15 @@ static inline void init_stats(struct stats *stats)
67struct perf_evsel; 111struct perf_evsel;
68struct perf_evlist; 112struct perf_evlist;
69 113
114struct perf_aggr_thread_value {
115 struct perf_evsel *counter;
116 int id;
117 double uval;
118 u64 val;
119 u64 run;
120 u64 ena;
121};
122
70bool __perf_evsel_stat__is(struct perf_evsel *evsel, 123bool __perf_evsel_stat__is(struct perf_evsel *evsel,
71 enum perf_stat_evsel_id id); 124 enum perf_stat_evsel_id id);
72 125
@@ -75,16 +128,20 @@ bool __perf_evsel_stat__is(struct perf_evsel *evsel,
75 128
76void perf_stat_evsel_id_init(struct perf_evsel *evsel); 129void perf_stat_evsel_id_init(struct perf_evsel *evsel);
77 130
131extern struct runtime_stat rt_stat;
78extern struct stats walltime_nsecs_stats; 132extern struct stats walltime_nsecs_stats;
79 133
80typedef void (*print_metric_t)(void *ctx, const char *color, const char *unit, 134typedef void (*print_metric_t)(void *ctx, const char *color, const char *unit,
81 const char *fmt, double val); 135 const char *fmt, double val);
82typedef void (*new_line_t )(void *ctx); 136typedef void (*new_line_t )(void *ctx);
83 137
138void runtime_stat__init(struct runtime_stat *st);
139void runtime_stat__exit(struct runtime_stat *st);
84void perf_stat__init_shadow_stats(void); 140void perf_stat__init_shadow_stats(void);
85void perf_stat__reset_shadow_stats(void); 141void perf_stat__reset_shadow_stats(void);
142void perf_stat__reset_shadow_per_stat(struct runtime_stat *st);
86void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count, 143void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count,
87 int cpu); 144 int cpu, struct runtime_stat *st);
88struct perf_stat_output_ctx { 145struct perf_stat_output_ctx {
89 void *ctx; 146 void *ctx;
90 print_metric_t print_metric; 147 print_metric_t print_metric;
@@ -92,11 +149,11 @@ struct perf_stat_output_ctx {
92 bool force_header; 149 bool force_header;
93}; 150};
94 151
95struct rblist;
96void perf_stat__print_shadow_stats(struct perf_evsel *evsel, 152void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
97 double avg, int cpu, 153 double avg, int cpu,
98 struct perf_stat_output_ctx *out, 154 struct perf_stat_output_ctx *out,
99 struct rblist *metric_events); 155 struct rblist *metric_events,
156 struct runtime_stat *st);
100void perf_stat__collect_metric_expr(struct perf_evlist *); 157void perf_stat__collect_metric_expr(struct perf_evlist *);
101 158
102int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw); 159int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw);
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index aaa08ee8c717..d8bfd0c4d2cb 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -396,3 +396,49 @@ out_err_overflow:
396 free(expr); 396 free(expr);
397 return NULL; 397 return NULL;
398} 398}
399
400/* Like strpbrk(), but not break if it is right after a backslash (escaped) */
401char *strpbrk_esc(char *str, const char *stopset)
402{
403 char *ptr;
404
405 do {
406 ptr = strpbrk(str, stopset);
407 if (ptr == str ||
408 (ptr == str + 1 && *(ptr - 1) != '\\'))
409 break;
410 str = ptr + 1;
411 } while (ptr && *(ptr - 1) == '\\' && *(ptr - 2) != '\\');
412
413 return ptr;
414}
415
416/* Like strdup, but do not copy a single backslash */
417char *strdup_esc(const char *str)
418{
419 char *s, *d, *p, *ret = strdup(str);
420
421 if (!ret)
422 return NULL;
423
424 d = strchr(ret, '\\');
425 if (!d)
426 return ret;
427
428 s = d + 1;
429 do {
430 if (*s == '\0') {
431 *d = '\0';
432 break;
433 }
434 p = strchr(s + 1, '\\');
435 if (p) {
436 memmove(d, s, p - s);
437 d += p - s;
438 s = p + 1;
439 } else
440 memmove(d, s, strlen(s) + 1);
441 } while (p);
442
443 return ret;
444}
diff --git a/tools/perf/util/string2.h b/tools/perf/util/string2.h
index ee14ca5451ab..4c68a09b97e8 100644
--- a/tools/perf/util/string2.h
+++ b/tools/perf/util/string2.h
@@ -39,5 +39,7 @@ static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int
39 return asprintf_expr_inout_ints(var, false, nints, ints); 39 return asprintf_expr_inout_ints(var, false, nints, ints);
40} 40}
41 41
42char *strpbrk_esc(char *str, const char *stopset);
43char *strdup_esc(const char *str);
42 44
43#endif /* PERF_STRING_H */ 45#endif /* PERF_STRING_H */
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 1b67a8639dfe..cc065d4bfafc 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -94,6 +94,11 @@ static int prefix_underscores_count(const char *str)
94 return tail - str; 94 return tail - str;
95} 95}
96 96
97const char * __weak arch__normalize_symbol_name(const char *name)
98{
99 return name;
100}
101
97int __weak arch__compare_symbol_names(const char *namea, const char *nameb) 102int __weak arch__compare_symbol_names(const char *namea, const char *nameb)
98{ 103{
99 return strcmp(namea, nameb); 104 return strcmp(namea, nameb);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index a4f0075b4e5c..0563f33c1eb3 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -349,6 +349,7 @@ bool elf__needs_adjust_symbols(GElf_Ehdr ehdr);
349void arch__sym_update(struct symbol *s, GElf_Sym *sym); 349void arch__sym_update(struct symbol *s, GElf_Sym *sym);
350#endif 350#endif
351 351
352const char *arch__normalize_symbol_name(const char *name);
352#define SYMBOL_A 0 353#define SYMBOL_A 0
353#define SYMBOL_B 1 354#define SYMBOL_B 1
354 355
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 6eea7cff3d4e..303bdb84ab5a 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -26,6 +26,10 @@
26#include <asm/syscalls_64.c> 26#include <asm/syscalls_64.c>
27const int syscalltbl_native_max_id = SYSCALLTBL_x86_64_MAX_ID; 27const int syscalltbl_native_max_id = SYSCALLTBL_x86_64_MAX_ID;
28static const char **syscalltbl_native = syscalltbl_x86_64; 28static const char **syscalltbl_native = syscalltbl_x86_64;
29#elif defined(__s390x__)
30#include <asm/syscalls_64.c>
31const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID;
32static const char **syscalltbl_native = syscalltbl_s390_64;
29#endif 33#endif
30 34
31struct syscall { 35struct syscall {
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h
index 446aa7a56f25..6ef01a83b24e 100644
--- a/tools/perf/util/target.h
+++ b/tools/perf/util/target.h
@@ -64,6 +64,11 @@ static inline bool target__none(struct target *target)
64 return !target__has_task(target) && !target__has_cpu(target); 64 return !target__has_task(target) && !target__has_cpu(target);
65} 65}
66 66
67static inline bool target__has_per_thread(struct target *target)
68{
69 return target->system_wide && target->per_thread;
70}
71
67static inline bool target__uses_dummy_map(struct target *target) 72static inline bool target__uses_dummy_map(struct target *target)
68{ 73{
69 bool use_dummy = false; 74 bool use_dummy = false;
@@ -73,6 +78,8 @@ static inline bool target__uses_dummy_map(struct target *target)
73 else if (target__has_task(target) || 78 else if (target__has_task(target) ||
74 (!target__has_cpu(target) && !target->uses_mmap)) 79 (!target__has_cpu(target) && !target->uses_mmap))
75 use_dummy = true; 80 use_dummy = true;
81 else if (target__has_per_thread(target))
82 use_dummy = true;
76 83
77 return use_dummy; 84 return use_dummy;
78} 85}
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index be0d5a736dea..3e1038f6491c 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -92,7 +92,7 @@ struct thread_map *thread_map__new_by_tid(pid_t tid)
92 return threads; 92 return threads;
93} 93}
94 94
95struct thread_map *thread_map__new_by_uid(uid_t uid) 95static struct thread_map *__thread_map__new_all_cpus(uid_t uid)
96{ 96{
97 DIR *proc; 97 DIR *proc;
98 int max_threads = 32, items, i; 98 int max_threads = 32, items, i;
@@ -113,7 +113,6 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
113 while ((dirent = readdir(proc)) != NULL) { 113 while ((dirent = readdir(proc)) != NULL) {
114 char *end; 114 char *end;
115 bool grow = false; 115 bool grow = false;
116 struct stat st;
117 pid_t pid = strtol(dirent->d_name, &end, 10); 116 pid_t pid = strtol(dirent->d_name, &end, 10);
118 117
119 if (*end) /* only interested in proper numerical dirents */ 118 if (*end) /* only interested in proper numerical dirents */
@@ -121,11 +120,12 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
121 120
122 snprintf(path, sizeof(path), "/proc/%s", dirent->d_name); 121 snprintf(path, sizeof(path), "/proc/%s", dirent->d_name);
123 122
124 if (stat(path, &st) != 0) 123 if (uid != UINT_MAX) {
125 continue; 124 struct stat st;
126 125
127 if (st.st_uid != uid) 126 if (stat(path, &st) != 0 || st.st_uid != uid)
128 continue; 127 continue;
128 }
129 129
130 snprintf(path, sizeof(path), "/proc/%d/task", pid); 130 snprintf(path, sizeof(path), "/proc/%d/task", pid);
131 items = scandir(path, &namelist, filter, NULL); 131 items = scandir(path, &namelist, filter, NULL);
@@ -178,6 +178,16 @@ out_free_closedir:
178 goto out_closedir; 178 goto out_closedir;
179} 179}
180 180
181struct thread_map *thread_map__new_all_cpus(void)
182{
183 return __thread_map__new_all_cpus(UINT_MAX);
184}
185
186struct thread_map *thread_map__new_by_uid(uid_t uid)
187{
188 return __thread_map__new_all_cpus(uid);
189}
190
181struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid) 191struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid)
182{ 192{
183 if (pid != -1) 193 if (pid != -1)
@@ -313,7 +323,7 @@ out_free_threads:
313} 323}
314 324
315struct thread_map *thread_map__new_str(const char *pid, const char *tid, 325struct thread_map *thread_map__new_str(const char *pid, const char *tid,
316 uid_t uid) 326 uid_t uid, bool per_thread)
317{ 327{
318 if (pid) 328 if (pid)
319 return thread_map__new_by_pid_str(pid); 329 return thread_map__new_by_pid_str(pid);
@@ -321,6 +331,9 @@ struct thread_map *thread_map__new_str(const char *pid, const char *tid,
321 if (!tid && uid != UINT_MAX) 331 if (!tid && uid != UINT_MAX)
322 return thread_map__new_by_uid(uid); 332 return thread_map__new_by_uid(uid);
323 333
334 if (per_thread)
335 return thread_map__new_all_cpus();
336
324 return thread_map__new_by_tid_str(tid); 337 return thread_map__new_by_tid_str(tid);
325} 338}
326 339
diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h
index f15803985435..0a806b99e73c 100644
--- a/tools/perf/util/thread_map.h
+++ b/tools/perf/util/thread_map.h
@@ -23,6 +23,7 @@ struct thread_map *thread_map__new_dummy(void);
23struct thread_map *thread_map__new_by_pid(pid_t pid); 23struct thread_map *thread_map__new_by_pid(pid_t pid);
24struct thread_map *thread_map__new_by_tid(pid_t tid); 24struct thread_map *thread_map__new_by_tid(pid_t tid);
25struct thread_map *thread_map__new_by_uid(uid_t uid); 25struct thread_map *thread_map__new_by_uid(uid_t uid);
26struct thread_map *thread_map__new_all_cpus(void);
26struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid); 27struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
27struct thread_map *thread_map__new_event(struct thread_map_event *event); 28struct thread_map *thread_map__new_event(struct thread_map_event *event);
28 29
@@ -30,7 +31,7 @@ struct thread_map *thread_map__get(struct thread_map *map);
30void thread_map__put(struct thread_map *map); 31void thread_map__put(struct thread_map *map);
31 32
32struct thread_map *thread_map__new_str(const char *pid, 33struct thread_map *thread_map__new_str(const char *pid,
33 const char *tid, uid_t uid); 34 const char *tid, uid_t uid, bool per_thread);
34 35
35struct thread_map *thread_map__new_by_tid_str(const char *tid_str); 36struct thread_map *thread_map__new_by_tid_str(const char *tid_str);
36 37
diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
index 81927d027417..6193b46050a5 100644
--- a/tools/perf/util/time-utils.c
+++ b/tools/perf/util/time-utils.c
@@ -6,6 +6,7 @@
6#include <time.h> 6#include <time.h>
7#include <errno.h> 7#include <errno.h>
8#include <inttypes.h> 8#include <inttypes.h>
9#include <math.h>
9 10
10#include "perf.h" 11#include "perf.h"
11#include "debug.h" 12#include "debug.h"
@@ -60,11 +61,10 @@ static int parse_timestr_sec_nsec(struct perf_time_interval *ptime,
60 return 0; 61 return 0;
61} 62}
62 63
63int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr) 64static int split_start_end(char **start, char **end, const char *ostr, char ch)
64{ 65{
65 char *start_str, *end_str; 66 char *start_str, *end_str;
66 char *d, *str; 67 char *d, *str;
67 int rc = 0;
68 68
69 if (ostr == NULL || *ostr == '\0') 69 if (ostr == NULL || *ostr == '\0')
70 return 0; 70 return 0;
@@ -74,25 +74,35 @@ int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr)
74 if (str == NULL) 74 if (str == NULL)
75 return -ENOMEM; 75 return -ENOMEM;
76 76
77 ptime->start = 0;
78 ptime->end = 0;
79
80 /* str has the format: <start>,<stop>
81 * variations: <start>,
82 * ,<stop>
83 * ,
84 */
85 start_str = str; 77 start_str = str;
86 d = strchr(start_str, ','); 78 d = strchr(start_str, ch);
87 if (d) { 79 if (d) {
88 *d = '\0'; 80 *d = '\0';
89 ++d; 81 ++d;
90 } 82 }
91 end_str = d; 83 end_str = d;
92 84
85 *start = start_str;
86 *end = end_str;
87
88 return 0;
89}
90
91int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr)
92{
93 char *start_str = NULL, *end_str;
94 int rc;
95
96 rc = split_start_end(&start_str, &end_str, ostr, ',');
97 if (rc || !start_str)
98 return rc;
99
100 ptime->start = 0;
101 ptime->end = 0;
102
93 rc = parse_timestr_sec_nsec(ptime, start_str, end_str); 103 rc = parse_timestr_sec_nsec(ptime, start_str, end_str);
94 104
95 free(str); 105 free(start_str);
96 106
97 /* make sure end time is after start time if it was given */ 107 /* make sure end time is after start time if it was given */
98 if (rc == 0 && ptime->end && ptime->end < ptime->start) 108 if (rc == 0 && ptime->end && ptime->end < ptime->start)
@@ -104,6 +114,245 @@ int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr)
104 return rc; 114 return rc;
105} 115}
106 116
117static int parse_percent(double *pcnt, char *str)
118{
119 char *c, *endptr;
120 double d;
121
122 c = strchr(str, '%');
123 if (c)
124 *c = '\0';
125 else
126 return -1;
127
128 d = strtod(str, &endptr);
129 if (endptr != str + strlen(str))
130 return -1;
131
132 *pcnt = d / 100.0;
133 return 0;
134}
135
136static int percent_slash_split(char *str, struct perf_time_interval *ptime,
137 u64 start, u64 end)
138{
139 char *p, *end_str;
140 double pcnt, start_pcnt, end_pcnt;
141 u64 total = end - start;
142 int i;
143
144 /*
145 * Example:
146 * 10%/2: select the second 10% slice and the third 10% slice
147 */
148
149 /* We can modify this string since the original one is copied */
150 p = strchr(str, '/');
151 if (!p)
152 return -1;
153
154 *p = '\0';
155 if (parse_percent(&pcnt, str) < 0)
156 return -1;
157
158 p++;
159 i = (int)strtol(p, &end_str, 10);
160 if (*end_str)
161 return -1;
162
163 if (pcnt <= 0.0)
164 return -1;
165
166 start_pcnt = pcnt * (i - 1);
167 end_pcnt = pcnt * i;
168
169 if (start_pcnt < 0.0 || start_pcnt > 1.0 ||
170 end_pcnt < 0.0 || end_pcnt > 1.0) {
171 return -1;
172 }
173
174 ptime->start = start + round(start_pcnt * total);
175 ptime->end = start + round(end_pcnt * total);
176
177 return 0;
178}
179
180static int percent_dash_split(char *str, struct perf_time_interval *ptime,
181 u64 start, u64 end)
182{
183 char *start_str = NULL, *end_str;
184 double start_pcnt, end_pcnt;
185 u64 total = end - start;
186 int ret;
187
188 /*
189 * Example: 0%-10%
190 */
191
192 ret = split_start_end(&start_str, &end_str, str, '-');
193 if (ret || !start_str)
194 return ret;
195
196 if ((parse_percent(&start_pcnt, start_str) != 0) ||
197 (parse_percent(&end_pcnt, end_str) != 0)) {
198 free(start_str);
199 return -1;
200 }
201
202 free(start_str);
203
204 if (start_pcnt < 0.0 || start_pcnt > 1.0 ||
205 end_pcnt < 0.0 || end_pcnt > 1.0 ||
206 start_pcnt > end_pcnt) {
207 return -1;
208 }
209
210 ptime->start = start + round(start_pcnt * total);
211 ptime->end = start + round(end_pcnt * total);
212
213 return 0;
214}
215
216typedef int (*time_pecent_split)(char *, struct perf_time_interval *,
217 u64 start, u64 end);
218
219static int percent_comma_split(struct perf_time_interval *ptime_buf, int num,
220 const char *ostr, u64 start, u64 end,
221 time_pecent_split func)
222{
223 char *str, *p1, *p2;
224 int len, ret, i = 0;
225
226 str = strdup(ostr);
227 if (str == NULL)
228 return -ENOMEM;
229
230 len = strlen(str);
231 p1 = str;
232
233 while (p1 < str + len) {
234 if (i >= num) {
235 free(str);
236 return -1;
237 }
238
239 p2 = strchr(p1, ',');
240 if (p2)
241 *p2 = '\0';
242
243 ret = (func)(p1, &ptime_buf[i], start, end);
244 if (ret < 0) {
245 free(str);
246 return -1;
247 }
248
249 pr_debug("start time %d: %" PRIu64 ", ", i, ptime_buf[i].start);
250 pr_debug("end time %d: %" PRIu64 "\n", i, ptime_buf[i].end);
251
252 i++;
253
254 if (p2)
255 p1 = p2 + 1;
256 else
257 break;
258 }
259
260 free(str);
261 return i;
262}
263
264static int one_percent_convert(struct perf_time_interval *ptime_buf,
265 const char *ostr, u64 start, u64 end, char *c)
266{
267 char *str;
268 int len = strlen(ostr), ret;
269
270 /*
271 * c points to '%'.
272 * '%' should be the last character
273 */
274 if (ostr + len - 1 != c)
275 return -1;
276
277 /*
278 * Construct a string like "xx%/1"
279 */
280 str = malloc(len + 3);
281 if (str == NULL)
282 return -ENOMEM;
283
284 memcpy(str, ostr, len);
285 strcpy(str + len, "/1");
286
287 ret = percent_slash_split(str, ptime_buf, start, end);
288 if (ret == 0)
289 ret = 1;
290
291 free(str);
292 return ret;
293}
294
295int perf_time__percent_parse_str(struct perf_time_interval *ptime_buf, int num,
296 const char *ostr, u64 start, u64 end)
297{
298 char *c;
299
300 /*
301 * ostr example:
302 * 10%/2,10%/3: select the second 10% slice and the third 10% slice
303 * 0%-10%,30%-40%: multiple time range
304 * 50%: just one percent
305 */
306
307 memset(ptime_buf, 0, sizeof(*ptime_buf) * num);
308
309 c = strchr(ostr, '/');
310 if (c) {
311 return percent_comma_split(ptime_buf, num, ostr, start,
312 end, percent_slash_split);
313 }
314
315 c = strchr(ostr, '-');
316 if (c) {
317 return percent_comma_split(ptime_buf, num, ostr, start,
318 end, percent_dash_split);
319 }
320
321 c = strchr(ostr, '%');
322 if (c)
323 return one_percent_convert(ptime_buf, ostr, start, end, c);
324
325 return -1;
326}
327
328struct perf_time_interval *perf_time__range_alloc(const char *ostr, int *size)
329{
330 const char *p1, *p2;
331 int i = 1;
332 struct perf_time_interval *ptime;
333
334 /*
335 * At least allocate one time range.
336 */
337 if (!ostr)
338 goto alloc;
339
340 p1 = ostr;
341 while (p1 < ostr + strlen(ostr)) {
342 p2 = strchr(p1, ',');
343 if (!p2)
344 break;
345
346 p1 = p2 + 1;
347 i++;
348 }
349
350alloc:
351 *size = i;
352 ptime = calloc(i, sizeof(*ptime));
353 return ptime;
354}
355
107bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp) 356bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp)
108{ 357{
109 /* if time is not set don't drop sample */ 358 /* if time is not set don't drop sample */
@@ -119,6 +368,34 @@ bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp)
119 return false; 368 return false;
120} 369}
121 370
371bool perf_time__ranges_skip_sample(struct perf_time_interval *ptime_buf,
372 int num, u64 timestamp)
373{
374 struct perf_time_interval *ptime;
375 int i;
376
377 if ((timestamp == 0) || (num == 0))
378 return false;
379
380 if (num == 1)
381 return perf_time__skip_sample(&ptime_buf[0], timestamp);
382
383 /*
384 * start/end of multiple time ranges must be valid.
385 */
386 for (i = 0; i < num; i++) {
387 ptime = &ptime_buf[i];
388
389 if (timestamp >= ptime->start &&
390 ((timestamp < ptime->end && i < num - 1) ||
391 (timestamp <= ptime->end && i == num - 1))) {
392 break;
393 }
394 }
395
396 return (i == num) ? true : false;
397}
398
122int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz) 399int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz)
123{ 400{
124 u64 sec = timestamp / NSEC_PER_SEC; 401 u64 sec = timestamp / NSEC_PER_SEC;
diff --git a/tools/perf/util/time-utils.h b/tools/perf/util/time-utils.h
index 15b475c50ccf..70b177d2b98c 100644
--- a/tools/perf/util/time-utils.h
+++ b/tools/perf/util/time-utils.h
@@ -13,8 +13,16 @@ int parse_nsec_time(const char *str, u64 *ptime);
13 13
14int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr); 14int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr);
15 15
16int perf_time__percent_parse_str(struct perf_time_interval *ptime_buf, int num,
17 const char *ostr, u64 start, u64 end);
18
19struct perf_time_interval *perf_time__range_alloc(const char *ostr, int *size);
20
16bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp); 21bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp);
17 22
23bool perf_time__ranges_skip_sample(struct perf_time_interval *ptime_buf,
24 int num, u64 timestamp);
25
18int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz); 26int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz);
19 27
20int fetch_current_timestamp(char *buf, size_t sz); 28int fetch_current_timestamp(char *buf, size_t sz);
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h
index 2532b558099b..183c91453522 100644
--- a/tools/perf/util/tool.h
+++ b/tools/perf/util/tool.h
@@ -76,6 +76,7 @@ struct perf_tool {
76 bool ordered_events; 76 bool ordered_events;
77 bool ordering_requires_timestamps; 77 bool ordering_requires_timestamps;
78 bool namespace_events; 78 bool namespace_events;
79 bool no_warn;
79 enum show_feature_header show_feat_hdr; 80 enum show_feature_header show_feat_hdr;
80}; 81};
81 82
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 7a42f703e858..af873044d33a 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -631,9 +631,8 @@ static unw_accessors_t accessors = {
631 631
632static int _unwind__prepare_access(struct thread *thread) 632static int _unwind__prepare_access(struct thread *thread)
633{ 633{
634 if (callchain_param.record_mode != CALLCHAIN_DWARF) 634 if (!dwarf_callchain_users)
635 return 0; 635 return 0;
636
637 thread->addr_space = unw_create_addr_space(&accessors, 0); 636 thread->addr_space = unw_create_addr_space(&accessors, 0);
638 if (!thread->addr_space) { 637 if (!thread->addr_space) {
639 pr_err("unwind: Can't create unwind address space.\n"); 638 pr_err("unwind: Can't create unwind address space.\n");
@@ -646,17 +645,15 @@ static int _unwind__prepare_access(struct thread *thread)
646 645
647static void _unwind__flush_access(struct thread *thread) 646static void _unwind__flush_access(struct thread *thread)
648{ 647{
649 if (callchain_param.record_mode != CALLCHAIN_DWARF) 648 if (!dwarf_callchain_users)
650 return; 649 return;
651
652 unw_flush_cache(thread->addr_space, 0, 0); 650 unw_flush_cache(thread->addr_space, 0, 0);
653} 651}
654 652
655static void _unwind__finish_access(struct thread *thread) 653static void _unwind__finish_access(struct thread *thread)
656{ 654{
657 if (callchain_param.record_mode != CALLCHAIN_DWARF) 655 if (!dwarf_callchain_users)
658 return; 656 return;
659
660 unw_destroy_addr_space(thread->addr_space); 657 unw_destroy_addr_space(thread->addr_space);
661} 658}
662 659
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 647a1e6b4c7b..b029a5e9ae49 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -3,7 +3,7 @@
3#include "thread.h" 3#include "thread.h"
4#include "session.h" 4#include "session.h"
5#include "debug.h" 5#include "debug.h"
6#include "arch/common.h" 6#include "env.h"
7 7
8struct unwind_libunwind_ops __weak *local_unwind_libunwind_ops; 8struct unwind_libunwind_ops __weak *local_unwind_libunwind_ops;
9struct unwind_libunwind_ops __weak *x86_32_unwind_libunwind_ops; 9struct unwind_libunwind_ops __weak *x86_32_unwind_libunwind_ops;
@@ -39,7 +39,7 @@ int unwind__prepare_access(struct thread *thread, struct map *map,
39 if (dso_type == DSO__TYPE_UNKNOWN) 39 if (dso_type == DSO__TYPE_UNKNOWN)
40 return 0; 40 return 0;
41 41
42 arch = normalize_arch(thread->mg->machine->env->arch); 42 arch = perf_env__arch(thread->mg->machine->env);
43 43
44 if (!strcmp(arch, "x86")) { 44 if (!strcmp(arch, "x86")) {
45 if (dso_type != DSO__TYPE_64BIT) 45 if (dso_type != DSO__TYPE_64BIT)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index a789f952b3e9..443892dabedb 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64
210 210
211 size -= ret; 211 size -= ret;
212 off_in += ret; 212 off_in += ret;
213 off_out -= ret; 213 off_out += ret;
214 } 214 }
215 munmap(ptr, off_in + size); 215 munmap(ptr, off_in + size);
216 216
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 01434509c2e9..9496365da3d7 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -68,4 +68,14 @@ extern bool perf_singlethreaded;
68void perf_set_singlethreaded(void); 68void perf_set_singlethreaded(void);
69void perf_set_multithreaded(void); 69void perf_set_multithreaded(void);
70 70
71#ifndef O_CLOEXEC
72#ifdef __sparc__
73#define O_CLOEXEC 0x400000
74#elif defined(__alpha__) || defined(__hppa__)
75#define O_CLOEXEC 010000000
76#else
77#define O_CLOEXEC 02000000
78#endif
79#endif
80
71#endif /* GIT_COMPAT_UTIL_H */ 81#endif /* GIT_COMPAT_UTIL_H */
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 3fab179b1aba..fcb3ed0be5f8 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -99,5 +99,6 @@ ifneq ($(silent),1)
99 99
100 QUIET_CLEAN = @printf ' CLEAN %s\n' $1; 100 QUIET_CLEAN = @printf ' CLEAN %s\n' $1;
101 QUIET_INSTALL = @printf ' INSTALL %s\n' $1; 101 QUIET_INSTALL = @printf ' INSTALL %s\n' $1;
102 QUIET_UNINST = @printf ' UNINST %s\n' $1;
102 endif 103 endif
103endif 104endif
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index db33b28c5ef3..0392153a0009 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -37,10 +37,12 @@ obj-$(CONFIG_DEV_DAX_PMEM) += dax_pmem.o
37 37
38nfit-y := $(ACPI_SRC)/core.o 38nfit-y := $(ACPI_SRC)/core.o
39nfit-$(CONFIG_X86_MCE) += $(ACPI_SRC)/mce.o 39nfit-$(CONFIG_X86_MCE) += $(ACPI_SRC)/mce.o
40nfit-y += acpi_nfit_test.o
40nfit-y += config_check.o 41nfit-y += config_check.o
41 42
42nd_pmem-y := $(NVDIMM_SRC)/pmem.o 43nd_pmem-y := $(NVDIMM_SRC)/pmem.o
43nd_pmem-y += pmem-dax.o 44nd_pmem-y += pmem-dax.o
45nd_pmem-y += pmem_test.o
44nd_pmem-y += config_check.o 46nd_pmem-y += config_check.o
45 47
46nd_btt-y := $(NVDIMM_SRC)/btt.o 48nd_btt-y := $(NVDIMM_SRC)/btt.o
@@ -57,6 +59,7 @@ dax-y += config_check.o
57 59
58device_dax-y := $(DAX_SRC)/device.o 60device_dax-y := $(DAX_SRC)/device.o
59device_dax-y += dax-dev.o 61device_dax-y += dax-dev.o
62device_dax-y += device_dax_test.o
60device_dax-y += config_check.o 63device_dax-y += config_check.o
61 64
62dax_pmem-y := $(DAX_SRC)/pmem.o 65dax_pmem-y := $(DAX_SRC)/pmem.o
@@ -75,6 +78,7 @@ libnvdimm-$(CONFIG_ND_CLAIM) += $(NVDIMM_SRC)/claim.o
75libnvdimm-$(CONFIG_BTT) += $(NVDIMM_SRC)/btt_devs.o 78libnvdimm-$(CONFIG_BTT) += $(NVDIMM_SRC)/btt_devs.o
76libnvdimm-$(CONFIG_NVDIMM_PFN) += $(NVDIMM_SRC)/pfn_devs.o 79libnvdimm-$(CONFIG_NVDIMM_PFN) += $(NVDIMM_SRC)/pfn_devs.o
77libnvdimm-$(CONFIG_NVDIMM_DAX) += $(NVDIMM_SRC)/dax_devs.o 80libnvdimm-$(CONFIG_NVDIMM_DAX) += $(NVDIMM_SRC)/dax_devs.o
81libnvdimm-y += libnvdimm_test.o
78libnvdimm-y += config_check.o 82libnvdimm-y += config_check.o
79 83
80obj-m += test/ 84obj-m += test/
diff --git a/tools/testing/nvdimm/acpi_nfit_test.c b/tools/testing/nvdimm/acpi_nfit_test.c
new file mode 100644
index 000000000000..43521512e577
--- /dev/null
+++ b/tools/testing/nvdimm/acpi_nfit_test.c
@@ -0,0 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright(c) 2018 Intel Corporation. All rights reserved.
3
4#include <linux/module.h>
5#include <linux/printk.h>
6#include "watermark.h"
7
8nfit_test_watermark(acpi_nfit);
diff --git a/tools/testing/nvdimm/device_dax_test.c b/tools/testing/nvdimm/device_dax_test.c
new file mode 100644
index 000000000000..24b17bf42429
--- /dev/null
+++ b/tools/testing/nvdimm/device_dax_test.c
@@ -0,0 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright(c) 2018 Intel Corporation. All rights reserved.
3
4#include <linux/module.h>
5#include <linux/printk.h>
6#include "watermark.h"
7
8nfit_test_watermark(device_dax);
diff --git a/tools/testing/nvdimm/libnvdimm_test.c b/tools/testing/nvdimm/libnvdimm_test.c
new file mode 100644
index 000000000000..00ca30b23932
--- /dev/null
+++ b/tools/testing/nvdimm/libnvdimm_test.c
@@ -0,0 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright(c) 2018 Intel Corporation. All rights reserved.
3
4#include <linux/module.h>
5#include <linux/printk.h>
6#include "watermark.h"
7
8nfit_test_watermark(libnvdimm);
diff --git a/tools/testing/nvdimm/pmem_test.c b/tools/testing/nvdimm/pmem_test.c
new file mode 100644
index 000000000000..fd38f92275cf
--- /dev/null
+++ b/tools/testing/nvdimm/pmem_test.c
@@ -0,0 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright(c) 2018 Intel Corporation. All rights reserved.
3
4#include <linux/module.h>
5#include <linux/printk.h>
6#include "watermark.h"
7
8nfit_test_watermark(pmem);
diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c
index e1f75a1914a1..ff9d3a5825e1 100644
--- a/tools/testing/nvdimm/test/iomap.c
+++ b/tools/testing/nvdimm/test/iomap.c
@@ -104,15 +104,14 @@ void *__wrap_devm_memremap(struct device *dev, resource_size_t offset,
104} 104}
105EXPORT_SYMBOL(__wrap_devm_memremap); 105EXPORT_SYMBOL(__wrap_devm_memremap);
106 106
107void *__wrap_devm_memremap_pages(struct device *dev, struct resource *res, 107void *__wrap_devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
108 struct percpu_ref *ref, struct vmem_altmap *altmap)
109{ 108{
110 resource_size_t offset = res->start; 109 resource_size_t offset = pgmap->res.start;
111 struct nfit_test_resource *nfit_res = get_nfit_res(offset); 110 struct nfit_test_resource *nfit_res = get_nfit_res(offset);
112 111
113 if (nfit_res) 112 if (nfit_res)
114 return nfit_res->buf + offset - nfit_res->res.start; 113 return nfit_res->buf + offset - nfit_res->res.start;
115 return devm_memremap_pages(dev, res, ref, altmap); 114 return devm_memremap_pages(dev, pgmap);
116} 115}
117EXPORT_SYMBOL(__wrap_devm_memremap_pages); 116EXPORT_SYMBOL(__wrap_devm_memremap_pages);
118 117
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 7217b2b953b5..620fa78b3b1b 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -27,6 +27,7 @@
27#include <nfit.h> 27#include <nfit.h>
28#include <nd.h> 28#include <nd.h>
29#include "nfit_test.h" 29#include "nfit_test.h"
30#include "../watermark.h"
30 31
31/* 32/*
32 * Generate an NFIT table to describe the following topology: 33 * Generate an NFIT table to describe the following topology:
@@ -137,6 +138,14 @@ static u32 handle[] = {
137 138
138static unsigned long dimm_fail_cmd_flags[NUM_DCR]; 139static unsigned long dimm_fail_cmd_flags[NUM_DCR];
139 140
141struct nfit_test_fw {
142 enum intel_fw_update_state state;
143 u32 context;
144 u64 version;
145 u32 size_received;
146 u64 end_time;
147};
148
140struct nfit_test { 149struct nfit_test {
141 struct acpi_nfit_desc acpi_desc; 150 struct acpi_nfit_desc acpi_desc;
142 struct platform_device pdev; 151 struct platform_device pdev;
@@ -168,8 +177,11 @@ struct nfit_test {
168 spinlock_t lock; 177 spinlock_t lock;
169 } ars_state; 178 } ars_state;
170 struct device *dimm_dev[NUM_DCR]; 179 struct device *dimm_dev[NUM_DCR];
180 struct nd_intel_smart *smart;
181 struct nd_intel_smart_threshold *smart_threshold;
171 struct badrange badrange; 182 struct badrange badrange;
172 struct work_struct work; 183 struct work_struct work;
184 struct nfit_test_fw *fw;
173}; 185};
174 186
175static struct workqueue_struct *nfit_wq; 187static struct workqueue_struct *nfit_wq;
@@ -181,6 +193,226 @@ static struct nfit_test *to_nfit_test(struct device *dev)
181 return container_of(pdev, struct nfit_test, pdev); 193 return container_of(pdev, struct nfit_test, pdev);
182} 194}
183 195
196static int nd_intel_test_get_fw_info(struct nfit_test *t,
197 struct nd_intel_fw_info *nd_cmd, unsigned int buf_len,
198 int idx)
199{
200 struct device *dev = &t->pdev.dev;
201 struct nfit_test_fw *fw = &t->fw[idx];
202
203 dev_dbg(dev, "%s(nfit_test: %p nd_cmd: %p, buf_len: %u, idx: %d\n",
204 __func__, t, nd_cmd, buf_len, idx);
205
206 if (buf_len < sizeof(*nd_cmd))
207 return -EINVAL;
208
209 nd_cmd->status = 0;
210 nd_cmd->storage_size = INTEL_FW_STORAGE_SIZE;
211 nd_cmd->max_send_len = INTEL_FW_MAX_SEND_LEN;
212 nd_cmd->query_interval = INTEL_FW_QUERY_INTERVAL;
213 nd_cmd->max_query_time = INTEL_FW_QUERY_MAX_TIME;
214 nd_cmd->update_cap = 0;
215 nd_cmd->fis_version = INTEL_FW_FIS_VERSION;
216 nd_cmd->run_version = 0;
217 nd_cmd->updated_version = fw->version;
218
219 return 0;
220}
221
222static int nd_intel_test_start_update(struct nfit_test *t,
223 struct nd_intel_fw_start *nd_cmd, unsigned int buf_len,
224 int idx)
225{
226 struct device *dev = &t->pdev.dev;
227 struct nfit_test_fw *fw = &t->fw[idx];
228
229 dev_dbg(dev, "%s(nfit_test: %p nd_cmd: %p buf_len: %u idx: %d)\n",
230 __func__, t, nd_cmd, buf_len, idx);
231
232 if (buf_len < sizeof(*nd_cmd))
233 return -EINVAL;
234
235 if (fw->state != FW_STATE_NEW) {
236 /* extended status, FW update in progress */
237 nd_cmd->status = 0x10007;
238 return 0;
239 }
240
241 fw->state = FW_STATE_IN_PROGRESS;
242 fw->context++;
243 fw->size_received = 0;
244 nd_cmd->status = 0;
245 nd_cmd->context = fw->context;
246
247 dev_dbg(dev, "%s: context issued: %#x\n", __func__, nd_cmd->context);
248
249 return 0;
250}
251
252static int nd_intel_test_send_data(struct nfit_test *t,
253 struct nd_intel_fw_send_data *nd_cmd, unsigned int buf_len,
254 int idx)
255{
256 struct device *dev = &t->pdev.dev;
257 struct nfit_test_fw *fw = &t->fw[idx];
258 u32 *status = (u32 *)&nd_cmd->data[nd_cmd->length];
259
260 dev_dbg(dev, "%s(nfit_test: %p nd_cmd: %p buf_len: %u idx: %d)\n",
261 __func__, t, nd_cmd, buf_len, idx);
262
263 if (buf_len < sizeof(*nd_cmd))
264 return -EINVAL;
265
266
267 dev_dbg(dev, "%s: cmd->status: %#x\n", __func__, *status);
268 dev_dbg(dev, "%s: cmd->data[0]: %#x\n", __func__, nd_cmd->data[0]);
269 dev_dbg(dev, "%s: cmd->data[%u]: %#x\n", __func__, nd_cmd->length-1,
270 nd_cmd->data[nd_cmd->length-1]);
271
272 if (fw->state != FW_STATE_IN_PROGRESS) {
273 dev_dbg(dev, "%s: not in IN_PROGRESS state\n", __func__);
274 *status = 0x5;
275 return 0;
276 }
277
278 if (nd_cmd->context != fw->context) {
279 dev_dbg(dev, "%s: incorrect context: in: %#x correct: %#x\n",
280 __func__, nd_cmd->context, fw->context);
281 *status = 0x10007;
282 return 0;
283 }
284
285 /*
286 * check offset + len > size of fw storage
287 * check length is > max send length
288 */
289 if (nd_cmd->offset + nd_cmd->length > INTEL_FW_STORAGE_SIZE ||
290 nd_cmd->length > INTEL_FW_MAX_SEND_LEN) {
291 *status = 0x3;
292 dev_dbg(dev, "%s: buffer boundary violation\n", __func__);
293 return 0;
294 }
295
296 fw->size_received += nd_cmd->length;
297 dev_dbg(dev, "%s: copying %u bytes, %u bytes so far\n",
298 __func__, nd_cmd->length, fw->size_received);
299 *status = 0;
300 return 0;
301}
302
303static int nd_intel_test_finish_fw(struct nfit_test *t,
304 struct nd_intel_fw_finish_update *nd_cmd,
305 unsigned int buf_len, int idx)
306{
307 struct device *dev = &t->pdev.dev;
308 struct nfit_test_fw *fw = &t->fw[idx];
309
310 dev_dbg(dev, "%s(nfit_test: %p nd_cmd: %p buf_len: %u idx: %d)\n",
311 __func__, t, nd_cmd, buf_len, idx);
312
313 if (fw->state == FW_STATE_UPDATED) {
314 /* update already done, need cold boot */
315 nd_cmd->status = 0x20007;
316 return 0;
317 }
318
319 dev_dbg(dev, "%s: context: %#x ctrl_flags: %#x\n",
320 __func__, nd_cmd->context, nd_cmd->ctrl_flags);
321
322 switch (nd_cmd->ctrl_flags) {
323 case 0: /* finish */
324 if (nd_cmd->context != fw->context) {
325 dev_dbg(dev, "%s: incorrect context: in: %#x correct: %#x\n",
326 __func__, nd_cmd->context,
327 fw->context);
328 nd_cmd->status = 0x10007;
329 return 0;
330 }
331 nd_cmd->status = 0;
332 fw->state = FW_STATE_VERIFY;
333 /* set 1 second of time for firmware "update" */
334 fw->end_time = jiffies + HZ;
335 break;
336
337 case 1: /* abort */
338 fw->size_received = 0;
339 /* successfully aborted status */
340 nd_cmd->status = 0x40007;
341 fw->state = FW_STATE_NEW;
342 dev_dbg(dev, "%s: abort successful\n", __func__);
343 break;
344
345 default: /* bad control flag */
346 dev_warn(dev, "%s: unknown control flag: %#x\n",
347 __func__, nd_cmd->ctrl_flags);
348 return -EINVAL;
349 }
350
351 return 0;
352}
353
354static int nd_intel_test_finish_query(struct nfit_test *t,
355 struct nd_intel_fw_finish_query *nd_cmd,
356 unsigned int buf_len, int idx)
357{
358 struct device *dev = &t->pdev.dev;
359 struct nfit_test_fw *fw = &t->fw[idx];
360
361 dev_dbg(dev, "%s(nfit_test: %p nd_cmd: %p buf_len: %u idx: %d)\n",
362 __func__, t, nd_cmd, buf_len, idx);
363
364 if (buf_len < sizeof(*nd_cmd))
365 return -EINVAL;
366
367 if (nd_cmd->context != fw->context) {
368 dev_dbg(dev, "%s: incorrect context: in: %#x correct: %#x\n",
369 __func__, nd_cmd->context, fw->context);
370 nd_cmd->status = 0x10007;
371 return 0;
372 }
373
374 dev_dbg(dev, "%s context: %#x\n", __func__, nd_cmd->context);
375
376 switch (fw->state) {
377 case FW_STATE_NEW:
378 nd_cmd->updated_fw_rev = 0;
379 nd_cmd->status = 0;
380 dev_dbg(dev, "%s: new state\n", __func__);
381 break;
382
383 case FW_STATE_IN_PROGRESS:
384 /* sequencing error */
385 nd_cmd->status = 0x40007;
386 nd_cmd->updated_fw_rev = 0;
387 dev_dbg(dev, "%s: sequence error\n", __func__);
388 break;
389
390 case FW_STATE_VERIFY:
391 if (time_is_after_jiffies64(fw->end_time)) {
392 nd_cmd->updated_fw_rev = 0;
393 nd_cmd->status = 0x20007;
394 dev_dbg(dev, "%s: still verifying\n", __func__);
395 break;
396 }
397
398 dev_dbg(dev, "%s: transition out verify\n", __func__);
399 fw->state = FW_STATE_UPDATED;
400 /* we are going to fall through if it's "done" */
401 case FW_STATE_UPDATED:
402 nd_cmd->status = 0;
403 /* bogus test version */
404 fw->version = nd_cmd->updated_fw_rev =
405 INTEL_FW_FAKE_VERSION;
406 dev_dbg(dev, "%s: updated\n", __func__);
407 break;
408
409 default: /* we should never get here */
410 return -EINVAL;
411 }
412
413 return 0;
414}
415
184static int nfit_test_cmd_get_config_size(struct nd_cmd_get_config_size *nd_cmd, 416static int nfit_test_cmd_get_config_size(struct nd_cmd_get_config_size *nd_cmd,
185 unsigned int buf_len) 417 unsigned int buf_len)
186{ 418{
@@ -440,39 +672,66 @@ static int nfit_test_cmd_translate_spa(struct nvdimm_bus *bus,
440 return 0; 672 return 0;
441} 673}
442 674
443static int nfit_test_cmd_smart(struct nd_cmd_smart *smart, unsigned int buf_len) 675static int nfit_test_cmd_smart(struct nd_intel_smart *smart, unsigned int buf_len,
676 struct nd_intel_smart *smart_data)
444{ 677{
445 static const struct nd_smart_payload smart_data = {
446 .flags = ND_SMART_HEALTH_VALID | ND_SMART_TEMP_VALID
447 | ND_SMART_SPARES_VALID | ND_SMART_ALARM_VALID
448 | ND_SMART_USED_VALID | ND_SMART_SHUTDOWN_VALID,
449 .health = ND_SMART_NON_CRITICAL_HEALTH,
450 .temperature = 23 * 16,
451 .spares = 75,
452 .alarm_flags = ND_SMART_SPARE_TRIP | ND_SMART_TEMP_TRIP,
453 .life_used = 5,
454 .shutdown_state = 0,
455 .vendor_size = 0,
456 };
457
458 if (buf_len < sizeof(*smart)) 678 if (buf_len < sizeof(*smart))
459 return -EINVAL; 679 return -EINVAL;
460 memcpy(smart->data, &smart_data, sizeof(smart_data)); 680 memcpy(smart, smart_data, sizeof(*smart));
461 return 0; 681 return 0;
462} 682}
463 683
464static int nfit_test_cmd_smart_threshold(struct nd_cmd_smart_threshold *smart_t, 684static int nfit_test_cmd_smart_threshold(
465 unsigned int buf_len) 685 struct nd_intel_smart_threshold *out,
686 unsigned int buf_len,
687 struct nd_intel_smart_threshold *smart_t)
466{ 688{
467 static const struct nd_smart_threshold_payload smart_t_data = {
468 .alarm_control = ND_SMART_SPARE_TRIP | ND_SMART_TEMP_TRIP,
469 .temperature = 40 * 16,
470 .spares = 5,
471 };
472
473 if (buf_len < sizeof(*smart_t)) 689 if (buf_len < sizeof(*smart_t))
474 return -EINVAL; 690 return -EINVAL;
475 memcpy(smart_t->data, &smart_t_data, sizeof(smart_t_data)); 691 memcpy(out, smart_t, sizeof(*smart_t));
692 return 0;
693}
694
695static void smart_notify(struct device *bus_dev,
696 struct device *dimm_dev, struct nd_intel_smart *smart,
697 struct nd_intel_smart_threshold *thresh)
698{
699 dev_dbg(dimm_dev, "%s: alarm: %#x spares: %d (%d) mtemp: %d (%d) ctemp: %d (%d)\n",
700 __func__, thresh->alarm_control, thresh->spares,
701 smart->spares, thresh->media_temperature,
702 smart->media_temperature, thresh->ctrl_temperature,
703 smart->ctrl_temperature);
704 if (((thresh->alarm_control & ND_INTEL_SMART_SPARE_TRIP)
705 && smart->spares
706 <= thresh->spares)
707 || ((thresh->alarm_control & ND_INTEL_SMART_TEMP_TRIP)
708 && smart->media_temperature
709 >= thresh->media_temperature)
710 || ((thresh->alarm_control & ND_INTEL_SMART_CTEMP_TRIP)
711 && smart->ctrl_temperature
712 >= thresh->ctrl_temperature)) {
713 device_lock(bus_dev);
714 __acpi_nvdimm_notify(dimm_dev, 0x81);
715 device_unlock(bus_dev);
716 }
717}
718
719static int nfit_test_cmd_smart_set_threshold(
720 struct nd_intel_smart_set_threshold *in,
721 unsigned int buf_len,
722 struct nd_intel_smart_threshold *thresh,
723 struct nd_intel_smart *smart,
724 struct device *bus_dev, struct device *dimm_dev)
725{
726 unsigned int size;
727
728 size = sizeof(*in) - 4;
729 if (buf_len < size)
730 return -EINVAL;
731 memcpy(thresh->data, in, size);
732 in->status = 0;
733 smart_notify(bus_dev, dimm_dev, smart, thresh);
734
476 return 0; 735 return 0;
477} 736}
478 737
@@ -563,6 +822,52 @@ static int nfit_test_cmd_ars_inject_status(struct nfit_test *t,
563 return 0; 822 return 0;
564} 823}
565 824
825static int nd_intel_test_cmd_set_lss_status(struct nfit_test *t,
826 struct nd_intel_lss *nd_cmd, unsigned int buf_len)
827{
828 struct device *dev = &t->pdev.dev;
829
830 if (buf_len < sizeof(*nd_cmd))
831 return -EINVAL;
832
833 switch (nd_cmd->enable) {
834 case 0:
835 nd_cmd->status = 0;
836 dev_dbg(dev, "%s: Latch System Shutdown Status disabled\n",
837 __func__);
838 break;
839 case 1:
840 nd_cmd->status = 0;
841 dev_dbg(dev, "%s: Latch System Shutdown Status enabled\n",
842 __func__);
843 break;
844 default:
845 dev_warn(dev, "Unknown enable value: %#x\n", nd_cmd->enable);
846 nd_cmd->status = 0x3;
847 break;
848 }
849
850
851 return 0;
852}
853
854static int get_dimm(struct nfit_mem *nfit_mem, unsigned int func)
855{
856 int i;
857
858 /* lookup per-dimm data */
859 for (i = 0; i < ARRAY_SIZE(handle); i++)
860 if (__to_nfit_memdev(nfit_mem)->device_handle == handle[i])
861 break;
862 if (i >= ARRAY_SIZE(handle))
863 return -ENXIO;
864
865 if ((1 << func) & dimm_fail_cmd_flags[i])
866 return -EIO;
867
868 return i;
869}
870
566static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, 871static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
567 struct nvdimm *nvdimm, unsigned int cmd, void *buf, 872 struct nvdimm *nvdimm, unsigned int cmd, void *buf,
568 unsigned int buf_len, int *cmd_rc) 873 unsigned int buf_len, int *cmd_rc)
@@ -591,22 +896,57 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
591 func = call_pkg->nd_command; 896 func = call_pkg->nd_command;
592 if (call_pkg->nd_family != nfit_mem->family) 897 if (call_pkg->nd_family != nfit_mem->family)
593 return -ENOTTY; 898 return -ENOTTY;
899
900 i = get_dimm(nfit_mem, func);
901 if (i < 0)
902 return i;
903
904 switch (func) {
905 case ND_INTEL_ENABLE_LSS_STATUS:
906 return nd_intel_test_cmd_set_lss_status(t,
907 buf, buf_len);
908 case ND_INTEL_FW_GET_INFO:
909 return nd_intel_test_get_fw_info(t, buf,
910 buf_len, i - t->dcr_idx);
911 case ND_INTEL_FW_START_UPDATE:
912 return nd_intel_test_start_update(t, buf,
913 buf_len, i - t->dcr_idx);
914 case ND_INTEL_FW_SEND_DATA:
915 return nd_intel_test_send_data(t, buf,
916 buf_len, i - t->dcr_idx);
917 case ND_INTEL_FW_FINISH_UPDATE:
918 return nd_intel_test_finish_fw(t, buf,
919 buf_len, i - t->dcr_idx);
920 case ND_INTEL_FW_FINISH_QUERY:
921 return nd_intel_test_finish_query(t, buf,
922 buf_len, i - t->dcr_idx);
923 case ND_INTEL_SMART:
924 return nfit_test_cmd_smart(buf, buf_len,
925 &t->smart[i - t->dcr_idx]);
926 case ND_INTEL_SMART_THRESHOLD:
927 return nfit_test_cmd_smart_threshold(buf,
928 buf_len,
929 &t->smart_threshold[i -
930 t->dcr_idx]);
931 case ND_INTEL_SMART_SET_THRESHOLD:
932 return nfit_test_cmd_smart_set_threshold(buf,
933 buf_len,
934 &t->smart_threshold[i -
935 t->dcr_idx],
936 &t->smart[i - t->dcr_idx],
937 &t->pdev.dev, t->dimm_dev[i]);
938 default:
939 return -ENOTTY;
940 }
594 } 941 }
595 942
596 if (!test_bit(cmd, &cmd_mask) 943 if (!test_bit(cmd, &cmd_mask)
597 || !test_bit(func, &nfit_mem->dsm_mask)) 944 || !test_bit(func, &nfit_mem->dsm_mask))
598 return -ENOTTY; 945 return -ENOTTY;
599 946
600 /* lookup label space for the given dimm */ 947 i = get_dimm(nfit_mem, func);
601 for (i = 0; i < ARRAY_SIZE(handle); i++) 948 if (i < 0)
602 if (__to_nfit_memdev(nfit_mem)->device_handle == 949 return i;
603 handle[i])
604 break;
605 if (i >= ARRAY_SIZE(handle))
606 return -ENXIO;
607
608 if ((1 << func) & dimm_fail_cmd_flags[i])
609 return -EIO;
610 950
611 switch (func) { 951 switch (func) {
612 case ND_CMD_GET_CONFIG_SIZE: 952 case ND_CMD_GET_CONFIG_SIZE:
@@ -620,15 +960,6 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
620 rc = nfit_test_cmd_set_config_data(buf, buf_len, 960 rc = nfit_test_cmd_set_config_data(buf, buf_len,
621 t->label[i - t->dcr_idx]); 961 t->label[i - t->dcr_idx]);
622 break; 962 break;
623 case ND_CMD_SMART:
624 rc = nfit_test_cmd_smart(buf, buf_len);
625 break;
626 case ND_CMD_SMART_THRESHOLD:
627 rc = nfit_test_cmd_smart_threshold(buf, buf_len);
628 device_lock(&t->pdev.dev);
629 __acpi_nvdimm_notify(t->dimm_dev[i], 0x81);
630 device_unlock(&t->pdev.dev);
631 break;
632 default: 963 default:
633 return -ENOTTY; 964 return -ENOTTY;
634 } 965 }
@@ -872,6 +1203,44 @@ static const struct attribute_group *nfit_test_dimm_attribute_groups[] = {
872 NULL, 1203 NULL,
873}; 1204};
874 1205
1206static void smart_init(struct nfit_test *t)
1207{
1208 int i;
1209 const struct nd_intel_smart_threshold smart_t_data = {
1210 .alarm_control = ND_INTEL_SMART_SPARE_TRIP
1211 | ND_INTEL_SMART_TEMP_TRIP,
1212 .media_temperature = 40 * 16,
1213 .ctrl_temperature = 30 * 16,
1214 .spares = 5,
1215 };
1216 const struct nd_intel_smart smart_data = {
1217 .flags = ND_INTEL_SMART_HEALTH_VALID
1218 | ND_INTEL_SMART_SPARES_VALID
1219 | ND_INTEL_SMART_ALARM_VALID
1220 | ND_INTEL_SMART_USED_VALID
1221 | ND_INTEL_SMART_SHUTDOWN_VALID
1222 | ND_INTEL_SMART_MTEMP_VALID,
1223 .health = ND_INTEL_SMART_NON_CRITICAL_HEALTH,
1224 .media_temperature = 23 * 16,
1225 .ctrl_temperature = 30 * 16,
1226 .pmic_temperature = 40 * 16,
1227 .spares = 75,
1228 .alarm_flags = ND_INTEL_SMART_SPARE_TRIP
1229 | ND_INTEL_SMART_TEMP_TRIP,
1230 .ait_status = 1,
1231 .life_used = 5,
1232 .shutdown_state = 0,
1233 .vendor_size = 0,
1234 .shutdown_count = 100,
1235 };
1236
1237 for (i = 0; i < t->num_dcr; i++) {
1238 memcpy(&t->smart[i], &smart_data, sizeof(smart_data));
1239 memcpy(&t->smart_threshold[i], &smart_t_data,
1240 sizeof(smart_t_data));
1241 }
1242}
1243
875static int nfit_test0_alloc(struct nfit_test *t) 1244static int nfit_test0_alloc(struct nfit_test *t)
876{ 1245{
877 size_t nfit_size = sizeof(struct acpi_nfit_system_address) * NUM_SPA 1246 size_t nfit_size = sizeof(struct acpi_nfit_system_address) * NUM_SPA
@@ -881,7 +1250,8 @@ static int nfit_test0_alloc(struct nfit_test *t)
881 window_size) * NUM_DCR 1250 window_size) * NUM_DCR
882 + sizeof(struct acpi_nfit_data_region) * NUM_BDW 1251 + sizeof(struct acpi_nfit_data_region) * NUM_BDW
883 + (sizeof(struct acpi_nfit_flush_address) 1252 + (sizeof(struct acpi_nfit_flush_address)
884 + sizeof(u64) * NUM_HINTS) * NUM_DCR; 1253 + sizeof(u64) * NUM_HINTS) * NUM_DCR
1254 + sizeof(struct acpi_nfit_capabilities);
885 int i; 1255 int i;
886 1256
887 t->nfit_buf = test_alloc(t, nfit_size, &t->nfit_dma); 1257 t->nfit_buf = test_alloc(t, nfit_size, &t->nfit_dma);
@@ -939,6 +1309,7 @@ static int nfit_test0_alloc(struct nfit_test *t)
939 return -ENOMEM; 1309 return -ENOMEM;
940 } 1310 }
941 1311
1312 smart_init(t);
942 return ars_state_init(&t->pdev.dev, &t->ars_state); 1313 return ars_state_init(&t->pdev.dev, &t->ars_state);
943} 1314}
944 1315
@@ -969,6 +1340,7 @@ static int nfit_test1_alloc(struct nfit_test *t)
969 if (!t->spa_set[1]) 1340 if (!t->spa_set[1])
970 return -ENOMEM; 1341 return -ENOMEM;
971 1342
1343 smart_init(t);
972 return ars_state_init(&t->pdev.dev, &t->ars_state); 1344 return ars_state_init(&t->pdev.dev, &t->ars_state);
973} 1345}
974 1346
@@ -993,6 +1365,7 @@ static void nfit_test0_setup(struct nfit_test *t)
993 struct acpi_nfit_control_region *dcr; 1365 struct acpi_nfit_control_region *dcr;
994 struct acpi_nfit_data_region *bdw; 1366 struct acpi_nfit_data_region *bdw;
995 struct acpi_nfit_flush_address *flush; 1367 struct acpi_nfit_flush_address *flush;
1368 struct acpi_nfit_capabilities *pcap;
996 unsigned int offset, i; 1369 unsigned int offset, i;
997 1370
998 /* 1371 /*
@@ -1500,8 +1873,16 @@ static void nfit_test0_setup(struct nfit_test *t)
1500 for (i = 0; i < NUM_HINTS; i++) 1873 for (i = 0; i < NUM_HINTS; i++)
1501 flush->hint_address[i] = t->flush_dma[3] + i * sizeof(u64); 1874 flush->hint_address[i] = t->flush_dma[3] + i * sizeof(u64);
1502 1875
1876 /* platform capabilities */
1877 pcap = nfit_buf + offset + flush_hint_size * 4;
1878 pcap->header.type = ACPI_NFIT_TYPE_CAPABILITIES;
1879 pcap->header.length = sizeof(*pcap);
1880 pcap->highest_capability = 1;
1881 pcap->capabilities = ACPI_NFIT_CAPABILITY_CACHE_FLUSH |
1882 ACPI_NFIT_CAPABILITY_MEM_FLUSH;
1883
1503 if (t->setup_hotplug) { 1884 if (t->setup_hotplug) {
1504 offset = offset + flush_hint_size * 4; 1885 offset = offset + flush_hint_size * 4 + sizeof(*pcap);
1505 /* dcr-descriptor4: blk */ 1886 /* dcr-descriptor4: blk */
1506 dcr = nfit_buf + offset; 1887 dcr = nfit_buf + offset;
1507 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; 1888 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
@@ -1642,17 +2023,24 @@ static void nfit_test0_setup(struct nfit_test *t)
1642 set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_cmd_force_en); 2023 set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_cmd_force_en);
1643 set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); 2024 set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en);
1644 set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); 2025 set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en);
1645 set_bit(ND_CMD_SMART, &acpi_desc->dimm_cmd_force_en); 2026 set_bit(ND_INTEL_SMART, &acpi_desc->dimm_cmd_force_en);
2027 set_bit(ND_INTEL_SMART_THRESHOLD, &acpi_desc->dimm_cmd_force_en);
2028 set_bit(ND_INTEL_SMART_SET_THRESHOLD, &acpi_desc->dimm_cmd_force_en);
1646 set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_cmd_force_en); 2029 set_bit(ND_CMD_ARS_CAP, &acpi_desc->bus_cmd_force_en);
1647 set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); 2030 set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en);
1648 set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); 2031 set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en);
1649 set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); 2032 set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en);
1650 set_bit(ND_CMD_CALL, &acpi_desc->bus_cmd_force_en); 2033 set_bit(ND_CMD_CALL, &acpi_desc->bus_cmd_force_en);
1651 set_bit(ND_CMD_SMART_THRESHOLD, &acpi_desc->dimm_cmd_force_en);
1652 set_bit(NFIT_CMD_TRANSLATE_SPA, &acpi_desc->bus_nfit_cmd_force_en); 2034 set_bit(NFIT_CMD_TRANSLATE_SPA, &acpi_desc->bus_nfit_cmd_force_en);
1653 set_bit(NFIT_CMD_ARS_INJECT_SET, &acpi_desc->bus_nfit_cmd_force_en); 2035 set_bit(NFIT_CMD_ARS_INJECT_SET, &acpi_desc->bus_nfit_cmd_force_en);
1654 set_bit(NFIT_CMD_ARS_INJECT_CLEAR, &acpi_desc->bus_nfit_cmd_force_en); 2036 set_bit(NFIT_CMD_ARS_INJECT_CLEAR, &acpi_desc->bus_nfit_cmd_force_en);
1655 set_bit(NFIT_CMD_ARS_INJECT_GET, &acpi_desc->bus_nfit_cmd_force_en); 2037 set_bit(NFIT_CMD_ARS_INJECT_GET, &acpi_desc->bus_nfit_cmd_force_en);
2038 set_bit(ND_INTEL_FW_GET_INFO, &acpi_desc->dimm_cmd_force_en);
2039 set_bit(ND_INTEL_FW_START_UPDATE, &acpi_desc->dimm_cmd_force_en);
2040 set_bit(ND_INTEL_FW_SEND_DATA, &acpi_desc->dimm_cmd_force_en);
2041 set_bit(ND_INTEL_FW_FINISH_UPDATE, &acpi_desc->dimm_cmd_force_en);
2042 set_bit(ND_INTEL_FW_FINISH_QUERY, &acpi_desc->dimm_cmd_force_en);
2043 set_bit(ND_INTEL_ENABLE_LSS_STATUS, &acpi_desc->dimm_cmd_force_en);
1656} 2044}
1657 2045
1658static void nfit_test1_setup(struct nfit_test *t) 2046static void nfit_test1_setup(struct nfit_test *t)
@@ -1750,6 +2138,7 @@ static void nfit_test1_setup(struct nfit_test *t)
1750 set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); 2138 set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en);
1751 set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); 2139 set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en);
1752 set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); 2140 set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en);
2141 set_bit(ND_INTEL_ENABLE_LSS_STATUS, &acpi_desc->dimm_cmd_force_en);
1753} 2142}
1754 2143
1755static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa, 2144static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa,
@@ -2054,10 +2443,18 @@ static int nfit_test_probe(struct platform_device *pdev)
2054 sizeof(struct nfit_test_dcr *), GFP_KERNEL); 2443 sizeof(struct nfit_test_dcr *), GFP_KERNEL);
2055 nfit_test->dcr_dma = devm_kcalloc(dev, num, 2444 nfit_test->dcr_dma = devm_kcalloc(dev, num,
2056 sizeof(dma_addr_t), GFP_KERNEL); 2445 sizeof(dma_addr_t), GFP_KERNEL);
2446 nfit_test->smart = devm_kcalloc(dev, num,
2447 sizeof(struct nd_intel_smart), GFP_KERNEL);
2448 nfit_test->smart_threshold = devm_kcalloc(dev, num,
2449 sizeof(struct nd_intel_smart_threshold),
2450 GFP_KERNEL);
2451 nfit_test->fw = devm_kcalloc(dev, num,
2452 sizeof(struct nfit_test_fw), GFP_KERNEL);
2057 if (nfit_test->dimm && nfit_test->dimm_dma && nfit_test->label 2453 if (nfit_test->dimm && nfit_test->dimm_dma && nfit_test->label
2058 && nfit_test->label_dma && nfit_test->dcr 2454 && nfit_test->label_dma && nfit_test->dcr
2059 && nfit_test->dcr_dma && nfit_test->flush 2455 && nfit_test->dcr_dma && nfit_test->flush
2060 && nfit_test->flush_dma) 2456 && nfit_test->flush_dma
2457 && nfit_test->fw)
2061 /* pass */; 2458 /* pass */;
2062 else 2459 else
2063 return -ENOMEM; 2460 return -ENOMEM;
@@ -2159,6 +2556,11 @@ static __init int nfit_test_init(void)
2159{ 2556{
2160 int rc, i; 2557 int rc, i;
2161 2558
2559 pmem_test();
2560 libnvdimm_test();
2561 acpi_nfit_test();
2562 device_dax_test();
2563
2162 nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm); 2564 nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm);
2163 2565
2164 nfit_wq = create_singlethread_workqueue("nfit"); 2566 nfit_wq = create_singlethread_workqueue("nfit");
diff --git a/tools/testing/nvdimm/test/nfit_test.h b/tools/testing/nvdimm/test/nfit_test.h
index 113b44675a71..428344519cdf 100644
--- a/tools/testing/nvdimm/test/nfit_test.h
+++ b/tools/testing/nvdimm/test/nfit_test.h
@@ -84,6 +84,140 @@ struct nd_cmd_ars_err_inj_stat {
84 } __packed record[0]; 84 } __packed record[0];
85} __packed; 85} __packed;
86 86
87#define ND_INTEL_SMART 1
88#define ND_INTEL_SMART_THRESHOLD 2
89#define ND_INTEL_ENABLE_LSS_STATUS 10
90#define ND_INTEL_FW_GET_INFO 12
91#define ND_INTEL_FW_START_UPDATE 13
92#define ND_INTEL_FW_SEND_DATA 14
93#define ND_INTEL_FW_FINISH_UPDATE 15
94#define ND_INTEL_FW_FINISH_QUERY 16
95#define ND_INTEL_SMART_SET_THRESHOLD 17
96
97#define ND_INTEL_SMART_HEALTH_VALID (1 << 0)
98#define ND_INTEL_SMART_SPARES_VALID (1 << 1)
99#define ND_INTEL_SMART_USED_VALID (1 << 2)
100#define ND_INTEL_SMART_MTEMP_VALID (1 << 3)
101#define ND_INTEL_SMART_CTEMP_VALID (1 << 4)
102#define ND_INTEL_SMART_SHUTDOWN_COUNT_VALID (1 << 5)
103#define ND_INTEL_SMART_AIT_STATUS_VALID (1 << 6)
104#define ND_INTEL_SMART_PTEMP_VALID (1 << 7)
105#define ND_INTEL_SMART_ALARM_VALID (1 << 9)
106#define ND_INTEL_SMART_SHUTDOWN_VALID (1 << 10)
107#define ND_INTEL_SMART_VENDOR_VALID (1 << 11)
108#define ND_INTEL_SMART_SPARE_TRIP (1 << 0)
109#define ND_INTEL_SMART_TEMP_TRIP (1 << 1)
110#define ND_INTEL_SMART_CTEMP_TRIP (1 << 2)
111#define ND_INTEL_SMART_NON_CRITICAL_HEALTH (1 << 0)
112#define ND_INTEL_SMART_CRITICAL_HEALTH (1 << 1)
113#define ND_INTEL_SMART_FATAL_HEALTH (1 << 2)
114
115struct nd_intel_smart {
116 __u32 status;
117 union {
118 struct {
119 __u32 flags;
120 __u8 reserved0[4];
121 __u8 health;
122 __u8 spares;
123 __u8 life_used;
124 __u8 alarm_flags;
125 __u16 media_temperature;
126 __u16 ctrl_temperature;
127 __u32 shutdown_count;
128 __u8 ait_status;
129 __u16 pmic_temperature;
130 __u8 reserved1[8];
131 __u8 shutdown_state;
132 __u32 vendor_size;
133 __u8 vendor_data[92];
134 } __packed;
135 __u8 data[128];
136 };
137} __packed;
138
139struct nd_intel_smart_threshold {
140 __u32 status;
141 union {
142 struct {
143 __u16 alarm_control;
144 __u8 spares;
145 __u16 media_temperature;
146 __u16 ctrl_temperature;
147 __u8 reserved[1];
148 } __packed;
149 __u8 data[8];
150 };
151} __packed;
152
153struct nd_intel_smart_set_threshold {
154 __u16 alarm_control;
155 __u8 spares;
156 __u16 media_temperature;
157 __u16 ctrl_temperature;
158 __u32 status;
159} __packed;
160
161#define INTEL_FW_STORAGE_SIZE 0x100000
162#define INTEL_FW_MAX_SEND_LEN 0xFFEC
163#define INTEL_FW_QUERY_INTERVAL 250000
164#define INTEL_FW_QUERY_MAX_TIME 3000000
165#define INTEL_FW_FIS_VERSION 0x0105
166#define INTEL_FW_FAKE_VERSION 0xffffffffabcd
167
168enum intel_fw_update_state {
169 FW_STATE_NEW = 0,
170 FW_STATE_IN_PROGRESS,
171 FW_STATE_VERIFY,
172 FW_STATE_UPDATED,
173};
174
175struct nd_intel_fw_info {
176 __u32 status;
177 __u32 storage_size;
178 __u32 max_send_len;
179 __u32 query_interval;
180 __u32 max_query_time;
181 __u8 update_cap;
182 __u8 reserved[3];
183 __u32 fis_version;
184 __u64 run_version;
185 __u64 updated_version;
186} __packed;
187
188struct nd_intel_fw_start {
189 __u32 status;
190 __u32 context;
191} __packed;
192
193/* this one has the output first because the variable input data size */
194struct nd_intel_fw_send_data {
195 __u32 context;
196 __u32 offset;
197 __u32 length;
198 __u8 data[0];
199/* this field is not declared due ot variable data from input */
200/* __u32 status; */
201} __packed;
202
203struct nd_intel_fw_finish_update {
204 __u8 ctrl_flags;
205 __u8 reserved[3];
206 __u32 context;
207 __u32 status;
208} __packed;
209
210struct nd_intel_fw_finish_query {
211 __u32 context;
212 __u32 status;
213 __u64 updated_fw_rev;
214} __packed;
215
216struct nd_intel_lss {
217 __u8 enable;
218 __u32 status;
219} __packed;
220
87union acpi_object; 221union acpi_object;
88typedef void *acpi_handle; 222typedef void *acpi_handle;
89 223
diff --git a/tools/testing/nvdimm/watermark.h b/tools/testing/nvdimm/watermark.h
new file mode 100644
index 000000000000..ed0528757bd4
--- /dev/null
+++ b/tools/testing/nvdimm/watermark.h
@@ -0,0 +1,21 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright(c) 2018 Intel Corporation. All rights reserved.
3#ifndef _TEST_NVDIMM_WATERMARK_H_
4#define _TEST_NVDIMM_WATERMARK_H_
5int pmem_test(void);
6int libnvdimm_test(void);
7int acpi_nfit_test(void);
8int device_dax_test(void);
9
10/*
11 * dummy routine for nfit_test to validate it is linking to the properly
12 * mocked module and not the standard one from the base tree.
13 */
14#define nfit_test_watermark(x) \
15int x##_test(void) \
16{ \
17 pr_debug("%s for nfit_test\n", KBUILD_MODNAME); \
18 return 0; \
19} \
20EXPORT_SYMBOL(x##_test)
21#endif /* _TEST_NVDIMM_WATERMARK_H_ */
diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c
index 30cd0b296f1a..44ef9eba5a7a 100644
--- a/tools/testing/radix-tree/idr-test.c
+++ b/tools/testing/radix-tree/idr-test.c
@@ -153,11 +153,12 @@ void idr_nowait_test(void)
153 idr_destroy(&idr); 153 idr_destroy(&idr);
154} 154}
155 155
156void idr_get_next_test(void) 156void idr_get_next_test(int base)
157{ 157{
158 unsigned long i; 158 unsigned long i;
159 int nextid; 159 int nextid;
160 DEFINE_IDR(idr); 160 DEFINE_IDR(idr);
161 idr_init_base(&idr, base);
161 162
162 int indices[] = {4, 7, 9, 15, 65, 128, 1000, 99999, 0}; 163 int indices[] = {4, 7, 9, 15, 65, 128, 1000, 99999, 0};
163 164
@@ -207,6 +208,7 @@ void idr_checks(void)
207 assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i); 208 assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i);
208 } 209 }
209 assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC); 210 assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC);
211 assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i + 10, GFP_KERNEL) == -ENOSPC);
210 212
211 idr_for_each(&idr, item_idr_free, &idr); 213 idr_for_each(&idr, item_idr_free, &idr);
212 idr_destroy(&idr); 214 idr_destroy(&idr);
@@ -214,6 +216,23 @@ void idr_checks(void)
214 216
215 assert(idr_is_empty(&idr)); 217 assert(idr_is_empty(&idr));
216 218
219 idr_set_cursor(&idr, INT_MAX - 3UL);
220 for (i = INT_MAX - 3UL; i < INT_MAX + 3UL; i++) {
221 struct item *item;
222 unsigned int id;
223 if (i <= INT_MAX)
224 item = item_create(i, 0);
225 else
226 item = item_create(i - INT_MAX - 1, 0);
227
228 id = idr_alloc_cyclic(&idr, item, 0, 0, GFP_KERNEL);
229 assert(id == item->index);
230 }
231
232 idr_for_each(&idr, item_idr_free, &idr);
233 idr_destroy(&idr);
234 assert(idr_is_empty(&idr));
235
217 for (i = 1; i < 10000; i++) { 236 for (i = 1; i < 10000; i++) {
218 struct item *item = item_create(i, 0); 237 struct item *item = item_create(i, 0);
219 assert(idr_alloc(&idr, item, 1, 20000, GFP_KERNEL) == i); 238 assert(idr_alloc(&idr, item, 1, 20000, GFP_KERNEL) == i);
@@ -226,7 +245,9 @@ void idr_checks(void)
226 idr_alloc_test(); 245 idr_alloc_test();
227 idr_null_test(); 246 idr_null_test();
228 idr_nowait_test(); 247 idr_nowait_test();
229 idr_get_next_test(); 248 idr_get_next_test(0);
249 idr_get_next_test(1);
250 idr_get_next_test(4);
230} 251}
231 252
232/* 253/*
@@ -380,7 +401,7 @@ void ida_check_random(void)
380 do { 401 do {
381 ida_pre_get(&ida, GFP_KERNEL); 402 ida_pre_get(&ida, GFP_KERNEL);
382 err = ida_get_new_above(&ida, bit, &id); 403 err = ida_get_new_above(&ida, bit, &id);
383 } while (err == -ENOMEM); 404 } while (err == -EAGAIN);
384 assert(!err); 405 assert(!err);
385 assert(id == bit); 406 assert(id == bit);
386 } 407 }
@@ -489,7 +510,7 @@ static void *ida_random_fn(void *arg)
489 510
490void ida_thread_tests(void) 511void ida_thread_tests(void)
491{ 512{
492 pthread_t threads[10]; 513 pthread_t threads[20];
493 int i; 514 int i;
494 515
495 for (i = 0; i < ARRAY_SIZE(threads); i++) 516 for (i = 0; i < ARRAY_SIZE(threads); i++)
diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h
index c3bc3f364f68..426f32f28547 100644
--- a/tools/testing/radix-tree/linux/kernel.h
+++ b/tools/testing/radix-tree/linux/kernel.h
@@ -17,6 +17,4 @@
17#define pr_debug printk 17#define pr_debug printk
18#define pr_cont printk 18#define pr_cont printk
19 19
20#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
21
22#endif /* _KERNEL_H */ 20#endif /* _KERNEL_H */
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index eaf599dc2137..7442dfb73b7f 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -116,8 +116,15 @@ ifdef INSTALL_PATH
116 116
117 @# Ask all targets to emit their test scripts 117 @# Ask all targets to emit their test scripts
118 echo "#!/bin/sh" > $(ALL_SCRIPT) 118 echo "#!/bin/sh" > $(ALL_SCRIPT)
119 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT) 119 echo "BASE_DIR=\$$(realpath \$$(dirname \$$0))" >> $(ALL_SCRIPT)
120 echo "cd \$$BASE_DIR" >> $(ALL_SCRIPT)
120 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT) 121 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
122 echo "if [ \"\$$1\" = \"--summary\" ]; then" >> $(ALL_SCRIPT)
123 echo " OUTPUT=\$$BASE_DIR/output.log" >> $(ALL_SCRIPT)
124 echo " cat /dev/null > \$$OUTPUT" >> $(ALL_SCRIPT)
125 echo "else" >> $(ALL_SCRIPT)
126 echo " OUTPUT=/dev/stdout" >> $(ALL_SCRIPT)
127 echo "fi" >> $(ALL_SCRIPT)
121 128
122 for TARGET in $(TARGETS); do \ 129 for TARGET in $(TARGETS); do \
123 BUILD_TARGET=$$BUILD/$$TARGET; \ 130 BUILD_TARGET=$$BUILD/$$TARGET; \
diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index 541d9d7fad5a..cc15af2e54fe 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -3,3 +3,11 @@ test_maps
3test_lru_map 3test_lru_map
4test_lpm_map 4test_lpm_map
5test_tag 5test_tag
6FEATURE-DUMP.libbpf
7fixdep
8test_align
9test_dev_cgroup
10test_progs
11test_tcpbpf_user
12test_verifier_log
13feature
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 9316e648a880..566d6adc172a 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -11,20 +11,23 @@ ifneq ($(wildcard $(GENHDR)),)
11endif 11endif
12 12
13CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include 13CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
14LDLIBS += -lcap -lelf -lrt 14LDLIBS += -lcap -lelf -lrt -lpthread
15 15
16TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \ 16TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \
17 test_align test_verifier_log test_dev_cgroup 17 test_align test_verifier_log test_dev_cgroup test_tcpbpf_user
18 18
19TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o test_obj_id.o \ 19TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o test_obj_id.o \
20 test_pkt_md_access.o test_xdp_redirect.o test_xdp_meta.o sockmap_parse_prog.o \ 20 test_pkt_md_access.o test_xdp_redirect.o test_xdp_meta.o sockmap_parse_prog.o \
21 sockmap_verdict_prog.o dev_cgroup.o 21 sockmap_verdict_prog.o dev_cgroup.o sample_ret0.o test_tracepoint.o \
22 test_l4lb_noinline.o test_xdp_noinline.o test_stacktrace_map.o \
23 sample_map_ret0.o test_tcpbpf_kern.o
22 24
23TEST_PROGS := test_kmod.sh test_xdp_redirect.sh test_xdp_meta.sh 25TEST_PROGS := test_kmod.sh test_xdp_redirect.sh test_xdp_meta.sh \
26 test_offload.py
24 27
25include ../lib.mk 28include ../lib.mk
26 29
27BPFOBJ := $(OUTPUT)/libbpf.a $(OUTPUT)/cgroup_helpers.c 30BPFOBJ := $(OUTPUT)/libbpf.a cgroup_helpers.c
28 31
29$(TEST_GEN_PROGS): $(BPFOBJ) 32$(TEST_GEN_PROGS): $(BPFOBJ)
30 33
@@ -49,8 +52,13 @@ else
49 CPU ?= generic 52 CPU ?= generic
50endif 53endif
51 54
52%.o: %.c 55CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \
53 $(CLANG) -I. -I./include/uapi -I../../../include/uapi \ 56 -Wno-compare-distinct-pointer-types
54 -Wno-compare-distinct-pointer-types \ 57
58$(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline
59$(OUTPUT)/test_xdp_noinline.o: CLANG_FLAGS += -fno-inline
60
61$(OUTPUT)/%.o: %.c
62 $(CLANG) $(CLANG_FLAGS) \
55 -O2 -target bpf -emit-llvm -c $< -o - | \ 63 -O2 -target bpf -emit-llvm -c $< -o - | \
56 $(LLC) -march=bpf -mcpu=$(CPU) -filetype=obj -o $@ 64 $(LLC) -march=bpf -mcpu=$(CPU) -filetype=obj -o $@
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index fd9a17fa8a8b..dde2c11d7771 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -71,6 +71,8 @@ static int (*bpf_setsockopt)(void *ctx, int level, int optname, void *optval,
71static int (*bpf_getsockopt)(void *ctx, int level, int optname, void *optval, 71static int (*bpf_getsockopt)(void *ctx, int level, int optname, void *optval,
72 int optlen) = 72 int optlen) =
73 (void *) BPF_FUNC_getsockopt; 73 (void *) BPF_FUNC_getsockopt;
74static int (*bpf_sock_ops_cb_flags_set)(void *ctx, int flags) =
75 (void *) BPF_FUNC_sock_ops_cb_flags_set;
74static int (*bpf_sk_redirect_map)(void *ctx, void *map, int key, int flags) = 76static int (*bpf_sk_redirect_map)(void *ctx, void *map, int key, int flags) =
75 (void *) BPF_FUNC_sk_redirect_map; 77 (void *) BPF_FUNC_sk_redirect_map;
76static int (*bpf_sock_map_update)(void *map, void *key, void *value, 78static int (*bpf_sock_map_update)(void *map, void *key, void *value,
@@ -82,7 +84,8 @@ static int (*bpf_perf_event_read_value)(void *map, unsigned long long flags,
82static int (*bpf_perf_prog_read_value)(void *ctx, void *buf, 84static int (*bpf_perf_prog_read_value)(void *ctx, void *buf,
83 unsigned int buf_size) = 85 unsigned int buf_size) =
84 (void *) BPF_FUNC_perf_prog_read_value; 86 (void *) BPF_FUNC_perf_prog_read_value;
85 87static int (*bpf_override_return)(void *ctx, unsigned long rc) =
88 (void *) BPF_FUNC_override_return;
86 89
87/* llvm builtin functions that eBPF C program may use to 90/* llvm builtin functions that eBPF C program may use to
88 * emit BPF_LD_ABS and BPF_LD_IND instructions 91 * emit BPF_LD_ABS and BPF_LD_IND instructions
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index 52d53ed08769..983dd25d49f4 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -3,3 +3,5 @@ CONFIG_BPF_SYSCALL=y
3CONFIG_NET_CLS_BPF=m 3CONFIG_NET_CLS_BPF=m
4CONFIG_BPF_EVENTS=y 4CONFIG_BPF_EVENTS=y
5CONFIG_TEST_BPF=m 5CONFIG_TEST_BPF=m
6CONFIG_CGROUP_BPF=y
7CONFIG_NETDEVSIM=m
diff --git a/tools/testing/selftests/bpf/sample_map_ret0.c b/tools/testing/selftests/bpf/sample_map_ret0.c
new file mode 100644
index 000000000000..0756303676ac
--- /dev/null
+++ b/tools/testing/selftests/bpf/sample_map_ret0.c
@@ -0,0 +1,34 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
2#include <linux/bpf.h>
3#include "bpf_helpers.h"
4
5struct bpf_map_def SEC("maps") htab = {
6 .type = BPF_MAP_TYPE_HASH,
7 .key_size = sizeof(__u32),
8 .value_size = sizeof(long),
9 .max_entries = 2,
10};
11
12struct bpf_map_def SEC("maps") array = {
13 .type = BPF_MAP_TYPE_ARRAY,
14 .key_size = sizeof(__u32),
15 .value_size = sizeof(long),
16 .max_entries = 2,
17};
18
19/* Sample program which should always load for testing control paths. */
20SEC(".text") int func()
21{
22 __u64 key64 = 0;
23 __u32 key = 0;
24 long *value;
25
26 value = bpf_map_lookup_elem(&htab, &key);
27 if (!value)
28 return 1;
29 value = bpf_map_lookup_elem(&array, &key64);
30 if (!value)
31 return 1;
32
33 return 0;
34}
diff --git a/tools/testing/selftests/bpf/sample_ret0.c b/tools/testing/selftests/bpf/sample_ret0.c
new file mode 100644
index 000000000000..fec99750d6ea
--- /dev/null
+++ b/tools/testing/selftests/bpf/sample_ret0.c
@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
2
3/* Sample program which should always load for testing control paths. */
4int func()
5{
6 return 0;
7}
diff --git a/tools/testing/selftests/bpf/tcp_client.py b/tools/testing/selftests/bpf/tcp_client.py
new file mode 100755
index 000000000000..481dccdf140c
--- /dev/null
+++ b/tools/testing/selftests/bpf/tcp_client.py
@@ -0,0 +1,51 @@
1#!/usr/bin/env python2
2#
3# SPDX-License-Identifier: GPL-2.0
4#
5
6import sys, os, os.path, getopt
7import socket, time
8import subprocess
9import select
10
11def read(sock, n):
12 buf = ''
13 while len(buf) < n:
14 rem = n - len(buf)
15 try: s = sock.recv(rem)
16 except (socket.error), e: return ''
17 buf += s
18 return buf
19
20def send(sock, s):
21 total = len(s)
22 count = 0
23 while count < total:
24 try: n = sock.send(s)
25 except (socket.error), e: n = 0
26 if n == 0:
27 return count;
28 count += n
29 return count
30
31
32serverPort = int(sys.argv[1])
33HostName = socket.gethostname()
34
35# create active socket
36sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
37try:
38 sock.connect((HostName, serverPort))
39except socket.error as e:
40 sys.exit(1)
41
42buf = ''
43n = 0
44while n < 1000:
45 buf += '+'
46 n += 1
47
48sock.settimeout(1);
49n = send(sock, buf)
50n = read(sock, 500)
51sys.exit(0)
diff --git a/tools/testing/selftests/bpf/tcp_server.py b/tools/testing/selftests/bpf/tcp_server.py
new file mode 100755
index 000000000000..bc454d7d0be2
--- /dev/null
+++ b/tools/testing/selftests/bpf/tcp_server.py
@@ -0,0 +1,83 @@
1#!/usr/bin/env python2
2#
3# SPDX-License-Identifier: GPL-2.0
4#
5
6import sys, os, os.path, getopt
7import socket, time
8import subprocess
9import select
10
11def read(sock, n):
12 buf = ''
13 while len(buf) < n:
14 rem = n - len(buf)
15 try: s = sock.recv(rem)
16 except (socket.error), e: return ''
17 buf += s
18 return buf
19
20def send(sock, s):
21 total = len(s)
22 count = 0
23 while count < total:
24 try: n = sock.send(s)
25 except (socket.error), e: n = 0
26 if n == 0:
27 return count;
28 count += n
29 return count
30
31
32SERVER_PORT = 12877
33MAX_PORTS = 2
34
35serverPort = SERVER_PORT
36serverSocket = None
37
38HostName = socket.gethostname()
39
40# create passive socket
41serverSocket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
42host = socket.gethostname()
43
44try: serverSocket.bind((host, 0))
45except socket.error as msg:
46 print 'bind fails: ', msg
47
48sn = serverSocket.getsockname()
49serverPort = sn[1]
50
51cmdStr = ("./tcp_client.py %d &") % (serverPort)
52os.system(cmdStr)
53
54buf = ''
55n = 0
56while n < 500:
57 buf += '.'
58 n += 1
59
60serverSocket.listen(MAX_PORTS)
61readList = [serverSocket]
62
63while True:
64 readyRead, readyWrite, inError = \
65 select.select(readList, [], [], 2)
66
67 if len(readyRead) > 0:
68 waitCount = 0
69 for sock in readyRead:
70 if sock == serverSocket:
71 (clientSocket, address) = serverSocket.accept()
72 address = str(address[0])
73 readList.append(clientSocket)
74 else:
75 sock.settimeout(1);
76 s = read(sock, 1000)
77 n = send(sock, buf)
78 sock.close()
79 serverSocket.close()
80 sys.exit(0)
81 else:
82 print 'Select timeout!'
83 sys.exit(1)
diff --git a/tools/testing/selftests/bpf/test_align.c b/tools/testing/selftests/bpf/test_align.c
index 471bbbdb94db..ff8bd7e3e50c 100644
--- a/tools/testing/selftests/bpf/test_align.c
+++ b/tools/testing/selftests/bpf/test_align.c
@@ -64,11 +64,11 @@ static struct bpf_align_test tests[] = {
64 .matches = { 64 .matches = {
65 {1, "R1=ctx(id=0,off=0,imm=0)"}, 65 {1, "R1=ctx(id=0,off=0,imm=0)"},
66 {1, "R10=fp0"}, 66 {1, "R10=fp0"},
67 {1, "R3=inv2"}, 67 {1, "R3_w=inv2"},
68 {2, "R3=inv4"}, 68 {2, "R3_w=inv4"},
69 {3, "R3=inv8"}, 69 {3, "R3_w=inv8"},
70 {4, "R3=inv16"}, 70 {4, "R3_w=inv16"},
71 {5, "R3=inv32"}, 71 {5, "R3_w=inv32"},
72 }, 72 },
73 }, 73 },
74 { 74 {
@@ -92,17 +92,17 @@ static struct bpf_align_test tests[] = {
92 .matches = { 92 .matches = {
93 {1, "R1=ctx(id=0,off=0,imm=0)"}, 93 {1, "R1=ctx(id=0,off=0,imm=0)"},
94 {1, "R10=fp0"}, 94 {1, "R10=fp0"},
95 {1, "R3=inv1"}, 95 {1, "R3_w=inv1"},
96 {2, "R3=inv2"}, 96 {2, "R3_w=inv2"},
97 {3, "R3=inv4"}, 97 {3, "R3_w=inv4"},
98 {4, "R3=inv8"}, 98 {4, "R3_w=inv8"},
99 {5, "R3=inv16"}, 99 {5, "R3_w=inv16"},
100 {6, "R3=inv1"}, 100 {6, "R3_w=inv1"},
101 {7, "R4=inv32"}, 101 {7, "R4_w=inv32"},
102 {8, "R4=inv16"}, 102 {8, "R4_w=inv16"},
103 {9, "R4=inv8"}, 103 {9, "R4_w=inv8"},
104 {10, "R4=inv4"}, 104 {10, "R4_w=inv4"},
105 {11, "R4=inv2"}, 105 {11, "R4_w=inv2"},
106 }, 106 },
107 }, 107 },
108 { 108 {
@@ -121,12 +121,12 @@ static struct bpf_align_test tests[] = {
121 .matches = { 121 .matches = {
122 {1, "R1=ctx(id=0,off=0,imm=0)"}, 122 {1, "R1=ctx(id=0,off=0,imm=0)"},
123 {1, "R10=fp0"}, 123 {1, "R10=fp0"},
124 {1, "R3=inv4"}, 124 {1, "R3_w=inv4"},
125 {2, "R3=inv8"}, 125 {2, "R3_w=inv8"},
126 {3, "R3=inv10"}, 126 {3, "R3_w=inv10"},
127 {4, "R4=inv8"}, 127 {4, "R4_w=inv8"},
128 {5, "R4=inv12"}, 128 {5, "R4_w=inv12"},
129 {6, "R4=inv14"}, 129 {6, "R4_w=inv14"},
130 }, 130 },
131 }, 131 },
132 { 132 {
@@ -143,10 +143,10 @@ static struct bpf_align_test tests[] = {
143 .matches = { 143 .matches = {
144 {1, "R1=ctx(id=0,off=0,imm=0)"}, 144 {1, "R1=ctx(id=0,off=0,imm=0)"},
145 {1, "R10=fp0"}, 145 {1, "R10=fp0"},
146 {1, "R3=inv7"}, 146 {1, "R3_w=inv7"},
147 {2, "R3=inv7"}, 147 {2, "R3_w=inv7"},
148 {3, "R3=inv14"}, 148 {3, "R3_w=inv14"},
149 {4, "R3=inv56"}, 149 {4, "R3_w=inv56"},
150 }, 150 },
151 }, 151 },
152 152
@@ -185,18 +185,18 @@ static struct bpf_align_test tests[] = {
185 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 185 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
186 .matches = { 186 .matches = {
187 {7, "R0=pkt(id=0,off=8,r=8,imm=0)"}, 187 {7, "R0=pkt(id=0,off=8,r=8,imm=0)"},
188 {7, "R3=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 188 {7, "R3_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
189 {8, "R3=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, 189 {8, "R3_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"},
190 {9, "R3=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 190 {9, "R3_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
191 {10, "R3=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, 191 {10, "R3_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"},
192 {11, "R3=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, 192 {11, "R3_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"},
193 {18, "R3=pkt_end(id=0,off=0,imm=0)"}, 193 {18, "R3=pkt_end(id=0,off=0,imm=0)"},
194 {18, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 194 {18, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
195 {19, "R4=inv(id=0,umax_value=8160,var_off=(0x0; 0x1fe0))"}, 195 {19, "R4_w=inv(id=0,umax_value=8160,var_off=(0x0; 0x1fe0))"},
196 {20, "R4=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, 196 {20, "R4_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"},
197 {21, "R4=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, 197 {21, "R4_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"},
198 {22, "R4=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 198 {22, "R4_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
199 {23, "R4=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, 199 {23, "R4_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"},
200 }, 200 },
201 }, 201 },
202 { 202 {
@@ -217,16 +217,16 @@ static struct bpf_align_test tests[] = {
217 }, 217 },
218 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 218 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
219 .matches = { 219 .matches = {
220 {7, "R3=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 220 {7, "R3_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
221 {8, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 221 {8, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
222 {9, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 222 {9, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
223 {10, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 223 {10, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
224 {11, "R4=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, 224 {11, "R4_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"},
225 {12, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 225 {12, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
226 {13, "R4=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 226 {13, "R4_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
227 {14, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 227 {14, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
228 {15, "R4=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, 228 {15, "R4_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"},
229 {16, "R4=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, 229 {16, "R4_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"},
230 }, 230 },
231 }, 231 },
232 { 232 {
@@ -257,14 +257,14 @@ static struct bpf_align_test tests[] = {
257 }, 257 },
258 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 258 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
259 .matches = { 259 .matches = {
260 {4, "R5=pkt(id=0,off=0,r=0,imm=0)"}, 260 {4, "R5_w=pkt(id=0,off=0,r=0,imm=0)"},
261 {5, "R5=pkt(id=0,off=14,r=0,imm=0)"}, 261 {5, "R5_w=pkt(id=0,off=14,r=0,imm=0)"},
262 {6, "R4=pkt(id=0,off=14,r=0,imm=0)"}, 262 {6, "R4_w=pkt(id=0,off=14,r=0,imm=0)"},
263 {10, "R2=pkt(id=0,off=0,r=18,imm=0)"}, 263 {10, "R2=pkt(id=0,off=0,r=18,imm=0)"},
264 {10, "R5=pkt(id=0,off=14,r=18,imm=0)"}, 264 {10, "R5=pkt(id=0,off=14,r=18,imm=0)"},
265 {10, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, 265 {10, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
266 {14, "R4=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"}, 266 {14, "R4_w=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"},
267 {15, "R4=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"}, 267 {15, "R4_w=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"},
268 }, 268 },
269 }, 269 },
270 { 270 {
@@ -320,11 +320,11 @@ static struct bpf_align_test tests[] = {
320 * alignment of 4. 320 * alignment of 4.
321 */ 321 */
322 {8, "R2=pkt(id=0,off=0,r=8,imm=0)"}, 322 {8, "R2=pkt(id=0,off=0,r=8,imm=0)"},
323 {8, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 323 {8, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
324 /* Offset is added to packet pointer R5, resulting in 324 /* Offset is added to packet pointer R5, resulting in
325 * known fixed offset, and variable offset from R6. 325 * known fixed offset, and variable offset from R6.
326 */ 326 */
327 {11, "R5=pkt(id=1,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 327 {11, "R5_w=pkt(id=1,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
328 /* At the time the word size load is performed from R5, 328 /* At the time the word size load is performed from R5,
329 * it's total offset is NET_IP_ALIGN + reg->off (0) + 329 * it's total offset is NET_IP_ALIGN + reg->off (0) +
330 * reg->aux_off (14) which is 16. Then the variable 330 * reg->aux_off (14) which is 16. Then the variable
@@ -336,11 +336,11 @@ static struct bpf_align_test tests[] = {
336 /* Variable offset is added to R5 packet pointer, 336 /* Variable offset is added to R5 packet pointer,
337 * resulting in auxiliary alignment of 4. 337 * resulting in auxiliary alignment of 4.
338 */ 338 */
339 {18, "R5=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 339 {18, "R5_w=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
340 /* Constant offset is added to R5, resulting in 340 /* Constant offset is added to R5, resulting in
341 * reg->off of 14. 341 * reg->off of 14.
342 */ 342 */
343 {19, "R5=pkt(id=2,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 343 {19, "R5_w=pkt(id=2,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
344 /* At the time the word size load is performed from R5, 344 /* At the time the word size load is performed from R5,
345 * its total fixed offset is NET_IP_ALIGN + reg->off 345 * its total fixed offset is NET_IP_ALIGN + reg->off
346 * (14) which is 16. Then the variable offset is 4-byte 346 * (14) which is 16. Then the variable offset is 4-byte
@@ -352,18 +352,18 @@ static struct bpf_align_test tests[] = {
352 /* Constant offset is added to R5 packet pointer, 352 /* Constant offset is added to R5 packet pointer,
353 * resulting in reg->off value of 14. 353 * resulting in reg->off value of 14.
354 */ 354 */
355 {26, "R5=pkt(id=0,off=14,r=8"}, 355 {26, "R5_w=pkt(id=0,off=14,r=8"},
356 /* Variable offset is added to R5, resulting in a 356 /* Variable offset is added to R5, resulting in a
357 * variable offset of (4n). 357 * variable offset of (4n).
358 */ 358 */
359 {27, "R5=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 359 {27, "R5_w=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
360 /* Constant is added to R5 again, setting reg->off to 18. */ 360 /* Constant is added to R5 again, setting reg->off to 18. */
361 {28, "R5=pkt(id=3,off=18,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 361 {28, "R5_w=pkt(id=3,off=18,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
362 /* And once more we add a variable; resulting var_off 362 /* And once more we add a variable; resulting var_off
363 * is still (4n), fixed offset is not changed. 363 * is still (4n), fixed offset is not changed.
364 * Also, we create a new reg->id. 364 * Also, we create a new reg->id.
365 */ 365 */
366 {29, "R5=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc))"}, 366 {29, "R5_w=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc))"},
367 /* At the time the word size load is performed from R5, 367 /* At the time the word size load is performed from R5,
368 * its total fixed offset is NET_IP_ALIGN + reg->off (18) 368 * its total fixed offset is NET_IP_ALIGN + reg->off (18)
369 * which is 20. Then the variable offset is (4n), so 369 * which is 20. Then the variable offset is (4n), so
@@ -410,11 +410,11 @@ static struct bpf_align_test tests[] = {
410 * alignment of 4. 410 * alignment of 4.
411 */ 411 */
412 {8, "R2=pkt(id=0,off=0,r=8,imm=0)"}, 412 {8, "R2=pkt(id=0,off=0,r=8,imm=0)"},
413 {8, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 413 {8, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
414 /* Adding 14 makes R6 be (4n+2) */ 414 /* Adding 14 makes R6 be (4n+2) */
415 {9, "R6=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, 415 {9, "R6_w=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"},
416 /* Packet pointer has (4n+2) offset */ 416 /* Packet pointer has (4n+2) offset */
417 {11, "R5=pkt(id=1,off=0,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, 417 {11, "R5_w=pkt(id=1,off=0,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"},
418 {13, "R4=pkt(id=1,off=4,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, 418 {13, "R4=pkt(id=1,off=4,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"},
419 /* At the time the word size load is performed from R5, 419 /* At the time the word size load is performed from R5,
420 * its total fixed offset is NET_IP_ALIGN + reg->off (0) 420 * its total fixed offset is NET_IP_ALIGN + reg->off (0)
@@ -426,11 +426,11 @@ static struct bpf_align_test tests[] = {
426 /* Newly read value in R6 was shifted left by 2, so has 426 /* Newly read value in R6 was shifted left by 2, so has
427 * known alignment of 4. 427 * known alignment of 4.
428 */ 428 */
429 {18, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 429 {18, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
430 /* Added (4n) to packet pointer's (4n+2) var_off, giving 430 /* Added (4n) to packet pointer's (4n+2) var_off, giving
431 * another (4n+2). 431 * another (4n+2).
432 */ 432 */
433 {19, "R5=pkt(id=2,off=0,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"}, 433 {19, "R5_w=pkt(id=2,off=0,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"},
434 {21, "R4=pkt(id=2,off=4,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"}, 434 {21, "R4=pkt(id=2,off=4,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"},
435 /* At the time the word size load is performed from R5, 435 /* At the time the word size load is performed from R5,
436 * its total fixed offset is NET_IP_ALIGN + reg->off (0) 436 * its total fixed offset is NET_IP_ALIGN + reg->off (0)
@@ -446,11 +446,9 @@ static struct bpf_align_test tests[] = {
446 .insns = { 446 .insns = {
447 PREP_PKT_POINTERS, 447 PREP_PKT_POINTERS,
448 BPF_MOV64_IMM(BPF_REG_0, 0), 448 BPF_MOV64_IMM(BPF_REG_0, 0),
449 /* ptr & const => unknown & const */ 449 /* (ptr - ptr) << 2 */
450 BPF_MOV64_REG(BPF_REG_5, BPF_REG_2), 450 BPF_MOV64_REG(BPF_REG_5, BPF_REG_3),
451 BPF_ALU64_IMM(BPF_AND, BPF_REG_5, 0x40), 451 BPF_ALU64_REG(BPF_SUB, BPF_REG_5, BPF_REG_2),
452 /* ptr << const => unknown << const */
453 BPF_MOV64_REG(BPF_REG_5, BPF_REG_2),
454 BPF_ALU64_IMM(BPF_LSH, BPF_REG_5, 2), 452 BPF_ALU64_IMM(BPF_LSH, BPF_REG_5, 2),
455 /* We have a (4n) value. Let's make a packet offset 453 /* We have a (4n) value. Let's make a packet offset
456 * out of it. First add 14, to make it a (4n+2) 454 * out of it. First add 14, to make it a (4n+2)
@@ -473,8 +471,26 @@ static struct bpf_align_test tests[] = {
473 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 471 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
474 .result = REJECT, 472 .result = REJECT,
475 .matches = { 473 .matches = {
476 {4, "R5=pkt(id=0,off=0,r=0,imm=0)"}, 474 {4, "R5_w=pkt_end(id=0,off=0,imm=0)"},
477 /* R5 bitwise operator &= on pointer prohibited */ 475 /* (ptr - ptr) << 2 == unknown, (4n) */
476 {6, "R5_w=inv(id=0,smax_value=9223372036854775804,umax_value=18446744073709551612,var_off=(0x0; 0xfffffffffffffffc))"},
477 /* (4n) + 14 == (4n+2). We blow our bounds, because
478 * the add could overflow.
479 */
480 {7, "R5=inv(id=0,var_off=(0x2; 0xfffffffffffffffc))"},
481 /* Checked s>=0 */
482 {9, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
483 /* packet pointer + nonnegative (4n+2) */
484 {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
485 {13, "R4=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
486 /* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine.
487 * We checked the bounds, but it might have been able
488 * to overflow if the packet pointer started in the
489 * upper half of the address space.
490 * So we did not get a 'range' on R6, and the access
491 * attempt will fail.
492 */
493 {15, "R6=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"},
478 } 494 }
479 }, 495 },
480 { 496 {
@@ -510,11 +526,11 @@ static struct bpf_align_test tests[] = {
510 * alignment of 4. 526 * alignment of 4.
511 */ 527 */
512 {7, "R2=pkt(id=0,off=0,r=8,imm=0)"}, 528 {7, "R2=pkt(id=0,off=0,r=8,imm=0)"},
513 {9, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 529 {9, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
514 /* Adding 14 makes R6 be (4n+2) */ 530 /* Adding 14 makes R6 be (4n+2) */
515 {10, "R6=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, 531 {10, "R6_w=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"},
516 /* New unknown value in R7 is (4n) */ 532 /* New unknown value in R7 is (4n) */
517 {11, "R7=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, 533 {11, "R7_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
518 /* Subtracting it from R6 blows our unsigned bounds */ 534 /* Subtracting it from R6 blows our unsigned bounds */
519 {12, "R6=inv(id=0,smin_value=-1006,smax_value=1034,var_off=(0x2; 0xfffffffffffffffc))"}, 535 {12, "R6=inv(id=0,smin_value=-1006,smax_value=1034,var_off=(0x2; 0xfffffffffffffffc))"},
520 /* Checked s>= 0 */ 536 /* Checked s>= 0 */
@@ -563,15 +579,15 @@ static struct bpf_align_test tests[] = {
563 * alignment of 4. 579 * alignment of 4.
564 */ 580 */
565 {7, "R2=pkt(id=0,off=0,r=8,imm=0)"}, 581 {7, "R2=pkt(id=0,off=0,r=8,imm=0)"},
566 {10, "R6=inv(id=0,umax_value=60,var_off=(0x0; 0x3c))"}, 582 {10, "R6_w=inv(id=0,umax_value=60,var_off=(0x0; 0x3c))"},
567 /* Adding 14 makes R6 be (4n+2) */ 583 /* Adding 14 makes R6 be (4n+2) */
568 {11, "R6=inv(id=0,umin_value=14,umax_value=74,var_off=(0x2; 0x7c))"}, 584 {11, "R6_w=inv(id=0,umin_value=14,umax_value=74,var_off=(0x2; 0x7c))"},
569 /* Subtracting from packet pointer overflows ubounds */ 585 /* Subtracting from packet pointer overflows ubounds */
570 {13, "R5=pkt(id=1,off=0,r=8,umin_value=18446744073709551542,umax_value=18446744073709551602,var_off=(0xffffffffffffff82; 0x7c))"}, 586 {13, "R5_w=pkt(id=1,off=0,r=8,umin_value=18446744073709551542,umax_value=18446744073709551602,var_off=(0xffffffffffffff82; 0x7c))"},
571 /* New unknown value in R7 is (4n), >= 76 */ 587 /* New unknown value in R7 is (4n), >= 76 */
572 {15, "R7=inv(id=0,umin_value=76,umax_value=1096,var_off=(0x0; 0x7fc))"}, 588 {15, "R7_w=inv(id=0,umin_value=76,umax_value=1096,var_off=(0x0; 0x7fc))"},
573 /* Adding it to packet pointer gives nice bounds again */ 589 /* Adding it to packet pointer gives nice bounds again */
574 {16, "R5=pkt(id=2,off=0,r=0,umin_value=2,umax_value=1082,var_off=(0x2; 0x7fc))"}, 590 {16, "R5_w=pkt(id=2,off=0,r=0,umin_value=2,umax_value=1082,var_off=(0x2; 0x7fc))"},
575 /* At the time the word size load is performed from R5, 591 /* At the time the word size load is performed from R5,
576 * its total fixed offset is NET_IP_ALIGN + reg->off (0) 592 * its total fixed offset is NET_IP_ALIGN + reg->off (0)
577 * which is 2. Then the variable offset is (4n+2), so 593 * which is 2. Then the variable offset is (4n+2), so
diff --git a/tools/testing/selftests/bpf/test_dev_cgroup.c b/tools/testing/selftests/bpf/test_dev_cgroup.c
index 02c85d6c89b0..3489cc283433 100644
--- a/tools/testing/selftests/bpf/test_dev_cgroup.c
+++ b/tools/testing/selftests/bpf/test_dev_cgroup.c
@@ -10,6 +10,8 @@
10#include <string.h> 10#include <string.h>
11#include <errno.h> 11#include <errno.h>
12#include <assert.h> 12#include <assert.h>
13#include <sys/time.h>
14#include <sys/resource.h>
13 15
14#include <linux/bpf.h> 16#include <linux/bpf.h>
15#include <bpf/bpf.h> 17#include <bpf/bpf.h>
@@ -19,19 +21,23 @@
19 21
20#define DEV_CGROUP_PROG "./dev_cgroup.o" 22#define DEV_CGROUP_PROG "./dev_cgroup.o"
21 23
22#define TEST_CGROUP "test-bpf-based-device-cgroup/" 24#define TEST_CGROUP "/test-bpf-based-device-cgroup/"
23 25
24int main(int argc, char **argv) 26int main(int argc, char **argv)
25{ 27{
28 struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY };
26 struct bpf_object *obj; 29 struct bpf_object *obj;
27 int error = EXIT_FAILURE; 30 int error = EXIT_FAILURE;
28 int prog_fd, cgroup_fd; 31 int prog_fd, cgroup_fd;
29 __u32 prog_cnt; 32 __u32 prog_cnt;
30 33
34 if (setrlimit(RLIMIT_MEMLOCK, &limit) < 0)
35 perror("Unable to lift memlock rlimit");
36
31 if (bpf_prog_load(DEV_CGROUP_PROG, BPF_PROG_TYPE_CGROUP_DEVICE, 37 if (bpf_prog_load(DEV_CGROUP_PROG, BPF_PROG_TYPE_CGROUP_DEVICE,
32 &obj, &prog_fd)) { 38 &obj, &prog_fd)) {
33 printf("Failed to load DEV_CGROUP program\n"); 39 printf("Failed to load DEV_CGROUP program\n");
34 goto err; 40 goto out;
35 } 41 }
36 42
37 if (setup_cgroup_environment()) { 43 if (setup_cgroup_environment()) {
@@ -89,5 +95,6 @@ int main(int argc, char **argv)
89err: 95err:
90 cleanup_cgroup_environment(); 96 cleanup_cgroup_environment();
91 97
98out:
92 return error; 99 return error;
93} 100}
diff --git a/tools/testing/selftests/bpf/test_l4lb_noinline.c b/tools/testing/selftests/bpf/test_l4lb_noinline.c
new file mode 100644
index 000000000000..ba44a14e6dc4
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_l4lb_noinline.c
@@ -0,0 +1,473 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2017 Facebook
3#include <stddef.h>
4#include <stdbool.h>
5#include <string.h>
6#include <linux/pkt_cls.h>
7#include <linux/bpf.h>
8#include <linux/in.h>
9#include <linux/if_ether.h>
10#include <linux/ip.h>
11#include <linux/ipv6.h>
12#include <linux/icmp.h>
13#include <linux/icmpv6.h>
14#include <linux/tcp.h>
15#include <linux/udp.h>
16#include "bpf_helpers.h"
17#include "test_iptunnel_common.h"
18#include "bpf_endian.h"
19
20int _version SEC("version") = 1;
21
22static __u32 rol32(__u32 word, unsigned int shift)
23{
24 return (word << shift) | (word >> ((-shift) & 31));
25}
26
27/* copy paste of jhash from kernel sources to make sure llvm
28 * can compile it into valid sequence of bpf instructions
29 */
30#define __jhash_mix(a, b, c) \
31{ \
32 a -= c; a ^= rol32(c, 4); c += b; \
33 b -= a; b ^= rol32(a, 6); a += c; \
34 c -= b; c ^= rol32(b, 8); b += a; \
35 a -= c; a ^= rol32(c, 16); c += b; \
36 b -= a; b ^= rol32(a, 19); a += c; \
37 c -= b; c ^= rol32(b, 4); b += a; \
38}
39
40#define __jhash_final(a, b, c) \
41{ \
42 c ^= b; c -= rol32(b, 14); \
43 a ^= c; a -= rol32(c, 11); \
44 b ^= a; b -= rol32(a, 25); \
45 c ^= b; c -= rol32(b, 16); \
46 a ^= c; a -= rol32(c, 4); \
47 b ^= a; b -= rol32(a, 14); \
48 c ^= b; c -= rol32(b, 24); \
49}
50
51#define JHASH_INITVAL 0xdeadbeef
52
53typedef unsigned int u32;
54
55static u32 jhash(const void *key, u32 length, u32 initval)
56{
57 u32 a, b, c;
58 const unsigned char *k = key;
59
60 a = b = c = JHASH_INITVAL + length + initval;
61
62 while (length > 12) {
63 a += *(u32 *)(k);
64 b += *(u32 *)(k + 4);
65 c += *(u32 *)(k + 8);
66 __jhash_mix(a, b, c);
67 length -= 12;
68 k += 12;
69 }
70 switch (length) {
71 case 12: c += (u32)k[11]<<24;
72 case 11: c += (u32)k[10]<<16;
73 case 10: c += (u32)k[9]<<8;
74 case 9: c += k[8];
75 case 8: b += (u32)k[7]<<24;
76 case 7: b += (u32)k[6]<<16;
77 case 6: b += (u32)k[5]<<8;
78 case 5: b += k[4];
79 case 4: a += (u32)k[3]<<24;
80 case 3: a += (u32)k[2]<<16;
81 case 2: a += (u32)k[1]<<8;
82 case 1: a += k[0];
83 __jhash_final(a, b, c);
84 case 0: /* Nothing left to add */
85 break;
86 }
87
88 return c;
89}
90
91static u32 __jhash_nwords(u32 a, u32 b, u32 c, u32 initval)
92{
93 a += initval;
94 b += initval;
95 c += initval;
96 __jhash_final(a, b, c);
97 return c;
98}
99
100static u32 jhash_2words(u32 a, u32 b, u32 initval)
101{
102 return __jhash_nwords(a, b, 0, initval + JHASH_INITVAL + (2 << 2));
103}
104
105#define PCKT_FRAGMENTED 65343
106#define IPV4_HDR_LEN_NO_OPT 20
107#define IPV4_PLUS_ICMP_HDR 28
108#define IPV6_PLUS_ICMP_HDR 48
109#define RING_SIZE 2
110#define MAX_VIPS 12
111#define MAX_REALS 5
112#define CTL_MAP_SIZE 16
113#define CH_RINGS_SIZE (MAX_VIPS * RING_SIZE)
114#define F_IPV6 (1 << 0)
115#define F_HASH_NO_SRC_PORT (1 << 0)
116#define F_ICMP (1 << 0)
117#define F_SYN_SET (1 << 1)
118
119struct packet_description {
120 union {
121 __be32 src;
122 __be32 srcv6[4];
123 };
124 union {
125 __be32 dst;
126 __be32 dstv6[4];
127 };
128 union {
129 __u32 ports;
130 __u16 port16[2];
131 };
132 __u8 proto;
133 __u8 flags;
134};
135
136struct ctl_value {
137 union {
138 __u64 value;
139 __u32 ifindex;
140 __u8 mac[6];
141 };
142};
143
144struct vip_meta {
145 __u32 flags;
146 __u32 vip_num;
147};
148
149struct real_definition {
150 union {
151 __be32 dst;
152 __be32 dstv6[4];
153 };
154 __u8 flags;
155};
156
157struct vip_stats {
158 __u64 bytes;
159 __u64 pkts;
160};
161
162struct eth_hdr {
163 unsigned char eth_dest[ETH_ALEN];
164 unsigned char eth_source[ETH_ALEN];
165 unsigned short eth_proto;
166};
167
168struct bpf_map_def SEC("maps") vip_map = {
169 .type = BPF_MAP_TYPE_HASH,
170 .key_size = sizeof(struct vip),
171 .value_size = sizeof(struct vip_meta),
172 .max_entries = MAX_VIPS,
173};
174
175struct bpf_map_def SEC("maps") ch_rings = {
176 .type = BPF_MAP_TYPE_ARRAY,
177 .key_size = sizeof(__u32),
178 .value_size = sizeof(__u32),
179 .max_entries = CH_RINGS_SIZE,
180};
181
182struct bpf_map_def SEC("maps") reals = {
183 .type = BPF_MAP_TYPE_ARRAY,
184 .key_size = sizeof(__u32),
185 .value_size = sizeof(struct real_definition),
186 .max_entries = MAX_REALS,
187};
188
189struct bpf_map_def SEC("maps") stats = {
190 .type = BPF_MAP_TYPE_PERCPU_ARRAY,
191 .key_size = sizeof(__u32),
192 .value_size = sizeof(struct vip_stats),
193 .max_entries = MAX_VIPS,
194};
195
196struct bpf_map_def SEC("maps") ctl_array = {
197 .type = BPF_MAP_TYPE_ARRAY,
198 .key_size = sizeof(__u32),
199 .value_size = sizeof(struct ctl_value),
200 .max_entries = CTL_MAP_SIZE,
201};
202
203static __u32 get_packet_hash(struct packet_description *pckt,
204 bool ipv6)
205{
206 if (ipv6)
207 return jhash_2words(jhash(pckt->srcv6, 16, MAX_VIPS),
208 pckt->ports, CH_RINGS_SIZE);
209 else
210 return jhash_2words(pckt->src, pckt->ports, CH_RINGS_SIZE);
211}
212
213static bool get_packet_dst(struct real_definition **real,
214 struct packet_description *pckt,
215 struct vip_meta *vip_info,
216 bool is_ipv6)
217{
218 __u32 hash = get_packet_hash(pckt, is_ipv6);
219 __u32 key = RING_SIZE * vip_info->vip_num + hash % RING_SIZE;
220 __u32 *real_pos;
221
222 if (hash != 0x358459b7 /* jhash of ipv4 packet */ &&
223 hash != 0x2f4bc6bb /* jhash of ipv6 packet */)
224 return 0;
225
226 real_pos = bpf_map_lookup_elem(&ch_rings, &key);
227 if (!real_pos)
228 return false;
229 key = *real_pos;
230 *real = bpf_map_lookup_elem(&reals, &key);
231 if (!(*real))
232 return false;
233 return true;
234}
235
236static int parse_icmpv6(void *data, void *data_end, __u64 off,
237 struct packet_description *pckt)
238{
239 struct icmp6hdr *icmp_hdr;
240 struct ipv6hdr *ip6h;
241
242 icmp_hdr = data + off;
243 if (icmp_hdr + 1 > data_end)
244 return TC_ACT_SHOT;
245 if (icmp_hdr->icmp6_type != ICMPV6_PKT_TOOBIG)
246 return TC_ACT_OK;
247 off += sizeof(struct icmp6hdr);
248 ip6h = data + off;
249 if (ip6h + 1 > data_end)
250 return TC_ACT_SHOT;
251 pckt->proto = ip6h->nexthdr;
252 pckt->flags |= F_ICMP;
253 memcpy(pckt->srcv6, ip6h->daddr.s6_addr32, 16);
254 memcpy(pckt->dstv6, ip6h->saddr.s6_addr32, 16);
255 return TC_ACT_UNSPEC;
256}
257
258static int parse_icmp(void *data, void *data_end, __u64 off,
259 struct packet_description *pckt)
260{
261 struct icmphdr *icmp_hdr;
262 struct iphdr *iph;
263
264 icmp_hdr = data + off;
265 if (icmp_hdr + 1 > data_end)
266 return TC_ACT_SHOT;
267 if (icmp_hdr->type != ICMP_DEST_UNREACH ||
268 icmp_hdr->code != ICMP_FRAG_NEEDED)
269 return TC_ACT_OK;
270 off += sizeof(struct icmphdr);
271 iph = data + off;
272 if (iph + 1 > data_end)
273 return TC_ACT_SHOT;
274 if (iph->ihl != 5)
275 return TC_ACT_SHOT;
276 pckt->proto = iph->protocol;
277 pckt->flags |= F_ICMP;
278 pckt->src = iph->daddr;
279 pckt->dst = iph->saddr;
280 return TC_ACT_UNSPEC;
281}
282
283static bool parse_udp(void *data, __u64 off, void *data_end,
284 struct packet_description *pckt)
285{
286 struct udphdr *udp;
287 udp = data + off;
288
289 if (udp + 1 > data_end)
290 return false;
291
292 if (!(pckt->flags & F_ICMP)) {
293 pckt->port16[0] = udp->source;
294 pckt->port16[1] = udp->dest;
295 } else {
296 pckt->port16[0] = udp->dest;
297 pckt->port16[1] = udp->source;
298 }
299 return true;
300}
301
302static bool parse_tcp(void *data, __u64 off, void *data_end,
303 struct packet_description *pckt)
304{
305 struct tcphdr *tcp;
306
307 tcp = data + off;
308 if (tcp + 1 > data_end)
309 return false;
310
311 if (tcp->syn)
312 pckt->flags |= F_SYN_SET;
313
314 if (!(pckt->flags & F_ICMP)) {
315 pckt->port16[0] = tcp->source;
316 pckt->port16[1] = tcp->dest;
317 } else {
318 pckt->port16[0] = tcp->dest;
319 pckt->port16[1] = tcp->source;
320 }
321 return true;
322}
323
324static int process_packet(void *data, __u64 off, void *data_end,
325 bool is_ipv6, struct __sk_buff *skb)
326{
327 void *pkt_start = (void *)(long)skb->data;
328 struct packet_description pckt = {};
329 struct eth_hdr *eth = pkt_start;
330 struct bpf_tunnel_key tkey = {};
331 struct vip_stats *data_stats;
332 struct real_definition *dst;
333 struct vip_meta *vip_info;
334 struct ctl_value *cval;
335 __u32 v4_intf_pos = 1;
336 __u32 v6_intf_pos = 2;
337 struct ipv6hdr *ip6h;
338 struct vip vip = {};
339 struct iphdr *iph;
340 int tun_flag = 0;
341 __u16 pkt_bytes;
342 __u64 iph_len;
343 __u32 ifindex;
344 __u8 protocol;
345 __u32 vip_num;
346 int action;
347
348 tkey.tunnel_ttl = 64;
349 if (is_ipv6) {
350 ip6h = data + off;
351 if (ip6h + 1 > data_end)
352 return TC_ACT_SHOT;
353
354 iph_len = sizeof(struct ipv6hdr);
355 protocol = ip6h->nexthdr;
356 pckt.proto = protocol;
357 pkt_bytes = bpf_ntohs(ip6h->payload_len);
358 off += iph_len;
359 if (protocol == IPPROTO_FRAGMENT) {
360 return TC_ACT_SHOT;
361 } else if (protocol == IPPROTO_ICMPV6) {
362 action = parse_icmpv6(data, data_end, off, &pckt);
363 if (action >= 0)
364 return action;
365 off += IPV6_PLUS_ICMP_HDR;
366 } else {
367 memcpy(pckt.srcv6, ip6h->saddr.s6_addr32, 16);
368 memcpy(pckt.dstv6, ip6h->daddr.s6_addr32, 16);
369 }
370 } else {
371 iph = data + off;
372 if (iph + 1 > data_end)
373 return TC_ACT_SHOT;
374 if (iph->ihl != 5)
375 return TC_ACT_SHOT;
376
377 protocol = iph->protocol;
378 pckt.proto = protocol;
379 pkt_bytes = bpf_ntohs(iph->tot_len);
380 off += IPV4_HDR_LEN_NO_OPT;
381
382 if (iph->frag_off & PCKT_FRAGMENTED)
383 return TC_ACT_SHOT;
384 if (protocol == IPPROTO_ICMP) {
385 action = parse_icmp(data, data_end, off, &pckt);
386 if (action >= 0)
387 return action;
388 off += IPV4_PLUS_ICMP_HDR;
389 } else {
390 pckt.src = iph->saddr;
391 pckt.dst = iph->daddr;
392 }
393 }
394 protocol = pckt.proto;
395
396 if (protocol == IPPROTO_TCP) {
397 if (!parse_tcp(data, off, data_end, &pckt))
398 return TC_ACT_SHOT;
399 } else if (protocol == IPPROTO_UDP) {
400 if (!parse_udp(data, off, data_end, &pckt))
401 return TC_ACT_SHOT;
402 } else {
403 return TC_ACT_SHOT;
404 }
405
406 if (is_ipv6)
407 memcpy(vip.daddr.v6, pckt.dstv6, 16);
408 else
409 vip.daddr.v4 = pckt.dst;
410
411 vip.dport = pckt.port16[1];
412 vip.protocol = pckt.proto;
413 vip_info = bpf_map_lookup_elem(&vip_map, &vip);
414 if (!vip_info) {
415 vip.dport = 0;
416 vip_info = bpf_map_lookup_elem(&vip_map, &vip);
417 if (!vip_info)
418 return TC_ACT_SHOT;
419 pckt.port16[1] = 0;
420 }
421
422 if (vip_info->flags & F_HASH_NO_SRC_PORT)
423 pckt.port16[0] = 0;
424
425 if (!get_packet_dst(&dst, &pckt, vip_info, is_ipv6))
426 return TC_ACT_SHOT;
427
428 if (dst->flags & F_IPV6) {
429 cval = bpf_map_lookup_elem(&ctl_array, &v6_intf_pos);
430 if (!cval)
431 return TC_ACT_SHOT;
432 ifindex = cval->ifindex;
433 memcpy(tkey.remote_ipv6, dst->dstv6, 16);
434 tun_flag = BPF_F_TUNINFO_IPV6;
435 } else {
436 cval = bpf_map_lookup_elem(&ctl_array, &v4_intf_pos);
437 if (!cval)
438 return TC_ACT_SHOT;
439 ifindex = cval->ifindex;
440 tkey.remote_ipv4 = dst->dst;
441 }
442 vip_num = vip_info->vip_num;
443 data_stats = bpf_map_lookup_elem(&stats, &vip_num);
444 if (!data_stats)
445 return TC_ACT_SHOT;
446 data_stats->pkts++;
447 data_stats->bytes += pkt_bytes;
448 bpf_skb_set_tunnel_key(skb, &tkey, sizeof(tkey), tun_flag);
449 *(u32 *)eth->eth_dest = tkey.remote_ipv4;
450 return bpf_redirect(ifindex, 0);
451}
452
453SEC("l4lb-demo")
454int balancer_ingress(struct __sk_buff *ctx)
455{
456 void *data_end = (void *)(long)ctx->data_end;
457 void *data = (void *)(long)ctx->data;
458 struct eth_hdr *eth = data;
459 __u32 eth_proto;
460 __u32 nh_off;
461
462 nh_off = sizeof(struct eth_hdr);
463 if (data + nh_off > data_end)
464 return TC_ACT_SHOT;
465 eth_proto = eth->eth_proto;
466 if (eth_proto == bpf_htons(ETH_P_IP))
467 return process_packet(data, nh_off, data_end, false, ctx);
468 else if (eth_proto == bpf_htons(ETH_P_IPV6))
469 return process_packet(data, nh_off, data_end, true, ctx);
470 else
471 return TC_ACT_SHOT;
472}
473char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/test_lpm_map.c b/tools/testing/selftests/bpf/test_lpm_map.c
index f61480641b6e..2be87e9ee28d 100644
--- a/tools/testing/selftests/bpf/test_lpm_map.c
+++ b/tools/testing/selftests/bpf/test_lpm_map.c
@@ -14,6 +14,7 @@
14#include <errno.h> 14#include <errno.h>
15#include <inttypes.h> 15#include <inttypes.h>
16#include <linux/bpf.h> 16#include <linux/bpf.h>
17#include <pthread.h>
17#include <stdio.h> 18#include <stdio.h>
18#include <stdlib.h> 19#include <stdlib.h>
19#include <string.h> 20#include <string.h>
@@ -521,6 +522,218 @@ static void test_lpm_delete(void)
521 close(map_fd); 522 close(map_fd);
522} 523}
523 524
525static void test_lpm_get_next_key(void)
526{
527 struct bpf_lpm_trie_key *key_p, *next_key_p;
528 size_t key_size;
529 __u32 value = 0;
530 int map_fd;
531
532 key_size = sizeof(*key_p) + sizeof(__u32);
533 key_p = alloca(key_size);
534 next_key_p = alloca(key_size);
535
536 map_fd = bpf_create_map(BPF_MAP_TYPE_LPM_TRIE, key_size, sizeof(value),
537 100, BPF_F_NO_PREALLOC);
538 assert(map_fd >= 0);
539
540 /* empty tree. get_next_key should return ENOENT */
541 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == -1 &&
542 errno == ENOENT);
543
544 /* get and verify the first key, get the second one should fail. */
545 key_p->prefixlen = 16;
546 inet_pton(AF_INET, "192.168.0.0", key_p->data);
547 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0);
548
549 memset(key_p, 0, key_size);
550 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0);
551 assert(key_p->prefixlen == 16 && key_p->data[0] == 192 &&
552 key_p->data[1] == 168);
553
554 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
555 errno == ENOENT);
556
557 /* no exact matching key should get the first one in post order. */
558 key_p->prefixlen = 8;
559 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0);
560 assert(key_p->prefixlen == 16 && key_p->data[0] == 192 &&
561 key_p->data[1] == 168);
562
563 /* add one more element (total two) */
564 key_p->prefixlen = 24;
565 inet_pton(AF_INET, "192.168.0.0", key_p->data);
566 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0);
567
568 memset(key_p, 0, key_size);
569 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0);
570 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 &&
571 key_p->data[1] == 168 && key_p->data[2] == 0);
572
573 memset(next_key_p, 0, key_size);
574 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
575 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 &&
576 next_key_p->data[1] == 168);
577
578 memcpy(key_p, next_key_p, key_size);
579 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
580 errno == ENOENT);
581
582 /* Add one more element (total three) */
583 key_p->prefixlen = 24;
584 inet_pton(AF_INET, "192.168.128.0", key_p->data);
585 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0);
586
587 memset(key_p, 0, key_size);
588 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0);
589 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 &&
590 key_p->data[1] == 168 && key_p->data[2] == 0);
591
592 memset(next_key_p, 0, key_size);
593 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
594 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 &&
595 next_key_p->data[1] == 168 && next_key_p->data[2] == 128);
596
597 memcpy(key_p, next_key_p, key_size);
598 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
599 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 &&
600 next_key_p->data[1] == 168);
601
602 memcpy(key_p, next_key_p, key_size);
603 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
604 errno == ENOENT);
605
606 /* Add one more element (total four) */
607 key_p->prefixlen = 24;
608 inet_pton(AF_INET, "192.168.1.0", key_p->data);
609 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0);
610
611 memset(key_p, 0, key_size);
612 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0);
613 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 &&
614 key_p->data[1] == 168 && key_p->data[2] == 0);
615
616 memset(next_key_p, 0, key_size);
617 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
618 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 &&
619 next_key_p->data[1] == 168 && next_key_p->data[2] == 1);
620
621 memcpy(key_p, next_key_p, key_size);
622 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
623 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 &&
624 next_key_p->data[1] == 168 && next_key_p->data[2] == 128);
625
626 memcpy(key_p, next_key_p, key_size);
627 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
628 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 &&
629 next_key_p->data[1] == 168);
630
631 memcpy(key_p, next_key_p, key_size);
632 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
633 errno == ENOENT);
634
635 /* no exact matching key should return the first one in post order */
636 key_p->prefixlen = 22;
637 inet_pton(AF_INET, "192.168.1.0", key_p->data);
638 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0);
639 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 &&
640 next_key_p->data[1] == 168 && next_key_p->data[2] == 0);
641
642 close(map_fd);
643}
644
645#define MAX_TEST_KEYS 4
646struct lpm_mt_test_info {
647 int cmd; /* 0: update, 1: delete, 2: lookup, 3: get_next_key */
648 int iter;
649 int map_fd;
650 struct {
651 __u32 prefixlen;
652 __u32 data;
653 } key[MAX_TEST_KEYS];
654};
655
656static void *lpm_test_command(void *arg)
657{
658 int i, j, ret, iter, key_size;
659 struct lpm_mt_test_info *info = arg;
660 struct bpf_lpm_trie_key *key_p;
661
662 key_size = sizeof(struct bpf_lpm_trie_key) + sizeof(__u32);
663 key_p = alloca(key_size);
664 for (iter = 0; iter < info->iter; iter++)
665 for (i = 0; i < MAX_TEST_KEYS; i++) {
666 /* first half of iterations in forward order,
667 * and second half in backward order.
668 */
669 j = (iter < (info->iter / 2)) ? i : MAX_TEST_KEYS - i - 1;
670 key_p->prefixlen = info->key[j].prefixlen;
671 memcpy(key_p->data, &info->key[j].data, sizeof(__u32));
672 if (info->cmd == 0) {
673 __u32 value = j;
674 /* update must succeed */
675 assert(bpf_map_update_elem(info->map_fd, key_p, &value, 0) == 0);
676 } else if (info->cmd == 1) {
677 ret = bpf_map_delete_elem(info->map_fd, key_p);
678 assert(ret == 0 || errno == ENOENT);
679 } else if (info->cmd == 2) {
680 __u32 value;
681 ret = bpf_map_lookup_elem(info->map_fd, key_p, &value);
682 assert(ret == 0 || errno == ENOENT);
683 } else {
684 struct bpf_lpm_trie_key *next_key_p = alloca(key_size);
685 ret = bpf_map_get_next_key(info->map_fd, key_p, next_key_p);
686 assert(ret == 0 || errno == ENOENT || errno == ENOMEM);
687 }
688 }
689
690 // Pass successful exit info back to the main thread
691 pthread_exit((void *)info);
692}
693
694static void setup_lpm_mt_test_info(struct lpm_mt_test_info *info, int map_fd)
695{
696 info->iter = 2000;
697 info->map_fd = map_fd;
698 info->key[0].prefixlen = 16;
699 inet_pton(AF_INET, "192.168.0.0", &info->key[0].data);
700 info->key[1].prefixlen = 24;
701 inet_pton(AF_INET, "192.168.0.0", &info->key[1].data);
702 info->key[2].prefixlen = 24;
703 inet_pton(AF_INET, "192.168.128.0", &info->key[2].data);
704 info->key[3].prefixlen = 24;
705 inet_pton(AF_INET, "192.168.1.0", &info->key[3].data);
706}
707
708static void test_lpm_multi_thread(void)
709{
710 struct lpm_mt_test_info info[4];
711 size_t key_size, value_size;
712 pthread_t thread_id[4];
713 int i, map_fd;
714 void *ret;
715
716 /* create a trie */
717 value_size = sizeof(__u32);
718 key_size = sizeof(struct bpf_lpm_trie_key) + value_size;
719 map_fd = bpf_create_map(BPF_MAP_TYPE_LPM_TRIE, key_size, value_size,
720 100, BPF_F_NO_PREALLOC);
721
722 /* create 4 threads to test update, delete, lookup and get_next_key */
723 setup_lpm_mt_test_info(&info[0], map_fd);
724 for (i = 0; i < 4; i++) {
725 if (i != 0)
726 memcpy(&info[i], &info[0], sizeof(info[i]));
727 info[i].cmd = i;
728 assert(pthread_create(&thread_id[i], NULL, &lpm_test_command, &info[i]) == 0);
729 }
730
731 for (i = 0; i < 4; i++)
732 assert(pthread_join(thread_id[i], &ret) == 0 && ret == (void *)&info[i]);
733
734 close(map_fd);
735}
736
524int main(void) 737int main(void)
525{ 738{
526 struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY }; 739 struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY };
@@ -545,6 +758,10 @@ int main(void)
545 758
546 test_lpm_delete(); 759 test_lpm_delete();
547 760
761 test_lpm_get_next_key();
762
763 test_lpm_multi_thread();
764
548 printf("test_lpm: OK\n"); 765 printf("test_lpm: OK\n");
549 return 0; 766 return 0;
550} 767}
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index 040356ecc862..436c4c72414f 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -242,7 +242,7 @@ static void test_hashmap_percpu(int task, void *data)
242 242
243static void test_hashmap_walk(int task, void *data) 243static void test_hashmap_walk(int task, void *data)
244{ 244{
245 int fd, i, max_entries = 100000; 245 int fd, i, max_entries = 1000;
246 long long key, value, next_key; 246 long long key, value, next_key;
247 bool next_key_valid = true; 247 bool next_key_valid = true;
248 248
@@ -463,7 +463,7 @@ static void test_devmap(int task, void *data)
463#define SOCKMAP_VERDICT_PROG "./sockmap_verdict_prog.o" 463#define SOCKMAP_VERDICT_PROG "./sockmap_verdict_prog.o"
464static void test_sockmap(int tasks, void *data) 464static void test_sockmap(int tasks, void *data)
465{ 465{
466 int one = 1, map_fd_rx, map_fd_tx, map_fd_break, s, sc, rc; 466 int one = 1, map_fd_rx = 0, map_fd_tx = 0, map_fd_break, s, sc, rc;
467 struct bpf_map *bpf_map_rx, *bpf_map_tx, *bpf_map_break; 467 struct bpf_map *bpf_map_rx, *bpf_map_tx, *bpf_map_break;
468 int ports[] = {50200, 50201, 50202, 50204}; 468 int ports[] = {50200, 50201, 50202, 50204};
469 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; 469 int err, i, fd, udp, sfd[6] = {0xdeadbeef};
@@ -868,9 +868,12 @@ static void test_sockmap(int tasks, void *data)
868 goto out_sockmap; 868 goto out_sockmap;
869 } 869 }
870 870
871 /* Test map close sockets */ 871 /* Test map close sockets and empty maps */
872 for (i = 0; i < 6; i++) 872 for (i = 0; i < 6; i++) {
873 bpf_map_delete_elem(map_fd_tx, &i);
874 bpf_map_delete_elem(map_fd_rx, &i);
873 close(sfd[i]); 875 close(sfd[i]);
876 }
874 close(fd); 877 close(fd);
875 close(map_fd_rx); 878 close(map_fd_rx);
876 bpf_object__close(obj); 879 bpf_object__close(obj);
@@ -881,8 +884,13 @@ out:
881 printf("Failed to create sockmap '%i:%s'!\n", i, strerror(errno)); 884 printf("Failed to create sockmap '%i:%s'!\n", i, strerror(errno));
882 exit(1); 885 exit(1);
883out_sockmap: 886out_sockmap:
884 for (i = 0; i < 6; i++) 887 for (i = 0; i < 6; i++) {
888 if (map_fd_tx)
889 bpf_map_delete_elem(map_fd_tx, &i);
890 if (map_fd_rx)
891 bpf_map_delete_elem(map_fd_rx, &i);
885 close(sfd[i]); 892 close(sfd[i]);
893 }
886 close(fd); 894 close(fd);
887 exit(1); 895 exit(1);
888} 896}
@@ -931,8 +939,12 @@ static void test_map_large(void)
931 close(fd); 939 close(fd);
932} 940}
933 941
934static void run_parallel(int tasks, void (*fn)(int task, void *data), 942#define run_parallel(N, FN, DATA) \
935 void *data) 943 printf("Fork %d tasks to '" #FN "'\n", N); \
944 __run_parallel(N, FN, DATA)
945
946static void __run_parallel(int tasks, void (*fn)(int task, void *data),
947 void *data)
936{ 948{
937 pid_t pid[tasks]; 949 pid_t pid[tasks];
938 int i; 950 int i;
@@ -972,7 +984,7 @@ static void test_map_stress(void)
972#define DO_UPDATE 1 984#define DO_UPDATE 1
973#define DO_DELETE 0 985#define DO_DELETE 0
974 986
975static void do_work(int fn, void *data) 987static void test_update_delete(int fn, void *data)
976{ 988{
977 int do_update = ((int *)data)[1]; 989 int do_update = ((int *)data)[1];
978 int fd = ((int *)data)[0]; 990 int fd = ((int *)data)[0];
@@ -1012,7 +1024,7 @@ static void test_map_parallel(void)
1012 */ 1024 */
1013 data[0] = fd; 1025 data[0] = fd;
1014 data[1] = DO_UPDATE; 1026 data[1] = DO_UPDATE;
1015 run_parallel(TASKS, do_work, data); 1027 run_parallel(TASKS, test_update_delete, data);
1016 1028
1017 /* Check that key=0 is already there. */ 1029 /* Check that key=0 is already there. */
1018 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 && 1030 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 &&
@@ -1035,7 +1047,7 @@ static void test_map_parallel(void)
1035 1047
1036 /* Now let's delete all elemenets in parallel. */ 1048 /* Now let's delete all elemenets in parallel. */
1037 data[1] = DO_DELETE; 1049 data[1] = DO_DELETE;
1038 run_parallel(TASKS, do_work, data); 1050 run_parallel(TASKS, test_update_delete, data);
1039 1051
1040 /* Nothing should be left. */ 1052 /* Nothing should be left. */
1041 key = -1; 1053 key = -1;
diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py
new file mode 100755
index 000000000000..e78aad0a68bb
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_offload.py
@@ -0,0 +1,1085 @@
1#!/usr/bin/python3
2
3# Copyright (C) 2017 Netronome Systems, Inc.
4#
5# This software is licensed under the GNU General License Version 2,
6# June 1991 as shown in the file COPYING in the top-level directory of this
7# source tree.
8#
9# THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
10# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
12# FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
13# OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
14# THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
15
16from datetime import datetime
17import argparse
18import json
19import os
20import pprint
21import random
22import string
23import struct
24import subprocess
25import time
26
27logfile = None
28log_level = 1
29skip_extack = False
30bpf_test_dir = os.path.dirname(os.path.realpath(__file__))
31pp = pprint.PrettyPrinter()
32devs = [] # devices we created for clean up
33files = [] # files to be removed
34netns = [] # net namespaces to be removed
35
36def log_get_sec(level=0):
37 return "*" * (log_level + level)
38
39def log_level_inc(add=1):
40 global log_level
41 log_level += add
42
43def log_level_dec(sub=1):
44 global log_level
45 log_level -= sub
46
47def log_level_set(level):
48 global log_level
49 log_level = level
50
51def log(header, data, level=None):
52 """
53 Output to an optional log.
54 """
55 if logfile is None:
56 return
57 if level is not None:
58 log_level_set(level)
59
60 if not isinstance(data, str):
61 data = pp.pformat(data)
62
63 if len(header):
64 logfile.write("\n" + log_get_sec() + " ")
65 logfile.write(header)
66 if len(header) and len(data.strip()):
67 logfile.write("\n")
68 logfile.write(data)
69
70def skip(cond, msg):
71 if not cond:
72 return
73 print("SKIP: " + msg)
74 log("SKIP: " + msg, "", level=1)
75 os.sys.exit(0)
76
77def fail(cond, msg):
78 if not cond:
79 return
80 print("FAIL: " + msg)
81 log("FAIL: " + msg, "", level=1)
82 os.sys.exit(1)
83
84def start_test(msg):
85 log(msg, "", level=1)
86 log_level_inc()
87 print(msg)
88
89def cmd(cmd, shell=True, include_stderr=False, background=False, fail=True):
90 """
91 Run a command in subprocess and return tuple of (retval, stdout);
92 optionally return stderr as well as third value.
93 """
94 proc = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE,
95 stderr=subprocess.PIPE)
96 if background:
97 msg = "%s START: %s" % (log_get_sec(1),
98 datetime.now().strftime("%H:%M:%S.%f"))
99 log("BKG " + proc.args, msg)
100 return proc
101
102 return cmd_result(proc, include_stderr=include_stderr, fail=fail)
103
104def cmd_result(proc, include_stderr=False, fail=False):
105 stdout, stderr = proc.communicate()
106 stdout = stdout.decode("utf-8")
107 stderr = stderr.decode("utf-8")
108 proc.stdout.close()
109 proc.stderr.close()
110
111 stderr = "\n" + stderr
112 if stderr[-1] == "\n":
113 stderr = stderr[:-1]
114
115 sec = log_get_sec(1)
116 log("CMD " + proc.args,
117 "RETCODE: %d\n%s STDOUT:\n%s%s STDERR:%s\n%s END: %s" %
118 (proc.returncode, sec, stdout, sec, stderr,
119 sec, datetime.now().strftime("%H:%M:%S.%f")))
120
121 if proc.returncode != 0 and fail:
122 if len(stderr) > 0 and stderr[-1] == "\n":
123 stderr = stderr[:-1]
124 raise Exception("Command failed: %s\n%s" % (proc.args, stderr))
125
126 if include_stderr:
127 return proc.returncode, stdout, stderr
128 else:
129 return proc.returncode, stdout
130
131def rm(f):
132 cmd("rm -f %s" % (f))
133 if f in files:
134 files.remove(f)
135
136def tool(name, args, flags, JSON=True, ns="", fail=True, include_stderr=False):
137 params = ""
138 if JSON:
139 params += "%s " % (flags["json"])
140
141 if ns != "":
142 ns = "ip netns exec %s " % (ns)
143
144 if include_stderr:
145 ret, stdout, stderr = cmd(ns + name + " " + params + args,
146 fail=fail, include_stderr=True)
147 else:
148 ret, stdout = cmd(ns + name + " " + params + args,
149 fail=fail, include_stderr=False)
150
151 if JSON and len(stdout.strip()) != 0:
152 out = json.loads(stdout)
153 else:
154 out = stdout
155
156 if include_stderr:
157 return ret, out, stderr
158 else:
159 return ret, out
160
161def bpftool(args, JSON=True, ns="", fail=True):
162 return tool("bpftool", args, {"json":"-p"}, JSON=JSON, ns=ns, fail=fail)
163
164def bpftool_prog_list(expected=None, ns=""):
165 _, progs = bpftool("prog show", JSON=True, ns=ns, fail=True)
166 if expected is not None:
167 if len(progs) != expected:
168 fail(True, "%d BPF programs loaded, expected %d" %
169 (len(progs), expected))
170 return progs
171
172def bpftool_map_list(expected=None, ns=""):
173 _, maps = bpftool("map show", JSON=True, ns=ns, fail=True)
174 if expected is not None:
175 if len(maps) != expected:
176 fail(True, "%d BPF maps loaded, expected %d" %
177 (len(maps), expected))
178 return maps
179
180def bpftool_prog_list_wait(expected=0, n_retry=20):
181 for i in range(n_retry):
182 nprogs = len(bpftool_prog_list())
183 if nprogs == expected:
184 return
185 time.sleep(0.05)
186 raise Exception("Time out waiting for program counts to stabilize want %d, have %d" % (expected, nprogs))
187
188def bpftool_map_list_wait(expected=0, n_retry=20):
189 for i in range(n_retry):
190 nmaps = len(bpftool_map_list())
191 if nmaps == expected:
192 return
193 time.sleep(0.05)
194 raise Exception("Time out waiting for map counts to stabilize want %d, have %d" % (expected, nmaps))
195
196def ip(args, force=False, JSON=True, ns="", fail=True, include_stderr=False):
197 if force:
198 args = "-force " + args
199 return tool("ip", args, {"json":"-j"}, JSON=JSON, ns=ns,
200 fail=fail, include_stderr=include_stderr)
201
202def tc(args, JSON=True, ns="", fail=True, include_stderr=False):
203 return tool("tc", args, {"json":"-p"}, JSON=JSON, ns=ns,
204 fail=fail, include_stderr=include_stderr)
205
206def ethtool(dev, opt, args, fail=True):
207 return cmd("ethtool %s %s %s" % (opt, dev["ifname"], args), fail=fail)
208
209def bpf_obj(name, sec=".text", path=bpf_test_dir,):
210 return "obj %s sec %s" % (os.path.join(path, name), sec)
211
212def bpf_pinned(name):
213 return "pinned %s" % (name)
214
215def bpf_bytecode(bytecode):
216 return "bytecode \"%s\"" % (bytecode)
217
218def mknetns(n_retry=10):
219 for i in range(n_retry):
220 name = ''.join([random.choice(string.ascii_letters) for i in range(8)])
221 ret, _ = ip("netns add %s" % (name), fail=False)
222 if ret == 0:
223 netns.append(name)
224 return name
225 return None
226
227def int2str(fmt, val):
228 ret = []
229 for b in struct.pack(fmt, val):
230 ret.append(int(b))
231 return " ".join(map(lambda x: str(x), ret))
232
233def str2int(strtab):
234 inttab = []
235 for i in strtab:
236 inttab.append(int(i, 16))
237 ba = bytearray(inttab)
238 if len(strtab) == 4:
239 fmt = "I"
240 elif len(strtab) == 8:
241 fmt = "Q"
242 else:
243 raise Exception("String array of len %d can't be unpacked to an int" %
244 (len(strtab)))
245 return struct.unpack(fmt, ba)[0]
246
247class DebugfsDir:
248 """
249 Class for accessing DebugFS directories as a dictionary.
250 """
251
252 def __init__(self, path):
253 self.path = path
254 self._dict = self._debugfs_dir_read(path)
255
256 def __len__(self):
257 return len(self._dict.keys())
258
259 def __getitem__(self, key):
260 if type(key) is int:
261 key = list(self._dict.keys())[key]
262 return self._dict[key]
263
264 def __setitem__(self, key, value):
265 log("DebugFS set %s = %s" % (key, value), "")
266 log_level_inc()
267
268 cmd("echo '%s' > %s/%s" % (value, self.path, key))
269 log_level_dec()
270
271 _, out = cmd('cat %s/%s' % (self.path, key))
272 self._dict[key] = out.strip()
273
274 def _debugfs_dir_read(self, path):
275 dfs = {}
276
277 log("DebugFS state for %s" % (path), "")
278 log_level_inc(add=2)
279
280 _, out = cmd('ls ' + path)
281 for f in out.split():
282 p = os.path.join(path, f)
283 if os.path.isfile(p):
284 _, out = cmd('cat %s/%s' % (path, f))
285 dfs[f] = out.strip()
286 elif os.path.isdir(p):
287 dfs[f] = DebugfsDir(p)
288 else:
289 raise Exception("%s is neither file nor directory" % (p))
290
291 log_level_dec()
292 log("DebugFS state", dfs)
293 log_level_dec()
294
295 return dfs
296
297class NetdevSim:
298 """
299 Class for netdevsim netdevice and its attributes.
300 """
301
302 def __init__(self):
303 self.dev = self._netdevsim_create()
304 devs.append(self)
305
306 self.ns = ""
307
308 self.dfs_dir = '/sys/kernel/debug/netdevsim/%s' % (self.dev['ifname'])
309 self.dfs_refresh()
310
311 def __getitem__(self, key):
312 return self.dev[key]
313
314 def _netdevsim_create(self):
315 _, old = ip("link show")
316 ip("link add sim%d type netdevsim")
317 _, new = ip("link show")
318
319 for dev in new:
320 f = filter(lambda x: x["ifname"] == dev["ifname"], old)
321 if len(list(f)) == 0:
322 return dev
323
324 raise Exception("failed to create netdevsim device")
325
326 def remove(self):
327 devs.remove(self)
328 ip("link del dev %s" % (self.dev["ifname"]), ns=self.ns)
329
330 def dfs_refresh(self):
331 self.dfs = DebugfsDir(self.dfs_dir)
332 return self.dfs
333
334 def dfs_num_bound_progs(self):
335 path = os.path.join(self.dfs_dir, "bpf_bound_progs")
336 _, progs = cmd('ls %s' % (path))
337 return len(progs.split())
338
339 def dfs_get_bound_progs(self, expected):
340 progs = DebugfsDir(os.path.join(self.dfs_dir, "bpf_bound_progs"))
341 if expected is not None:
342 if len(progs) != expected:
343 fail(True, "%d BPF programs bound, expected %d" %
344 (len(progs), expected))
345 return progs
346
347 def wait_for_flush(self, bound=0, total=0, n_retry=20):
348 for i in range(n_retry):
349 nbound = self.dfs_num_bound_progs()
350 nprogs = len(bpftool_prog_list())
351 if nbound == bound and nprogs == total:
352 return
353 time.sleep(0.05)
354 raise Exception("Time out waiting for program counts to stabilize want %d/%d, have %d bound, %d loaded" % (bound, total, nbound, nprogs))
355
356 def set_ns(self, ns):
357 name = "1" if ns == "" else ns
358 ip("link set dev %s netns %s" % (self.dev["ifname"], name), ns=self.ns)
359 self.ns = ns
360
361 def set_mtu(self, mtu, fail=True):
362 return ip("link set dev %s mtu %d" % (self.dev["ifname"], mtu),
363 fail=fail)
364
365 def set_xdp(self, bpf, mode, force=False, JSON=True, verbose=False,
366 fail=True, include_stderr=False):
367 if verbose:
368 bpf += " verbose"
369 return ip("link set dev %s xdp%s %s" % (self.dev["ifname"], mode, bpf),
370 force=force, JSON=JSON,
371 fail=fail, include_stderr=include_stderr)
372
373 def unset_xdp(self, mode, force=False, JSON=True,
374 fail=True, include_stderr=False):
375 return ip("link set dev %s xdp%s off" % (self.dev["ifname"], mode),
376 force=force, JSON=JSON,
377 fail=fail, include_stderr=include_stderr)
378
379 def ip_link_show(self, xdp):
380 _, link = ip("link show dev %s" % (self['ifname']))
381 if len(link) > 1:
382 raise Exception("Multiple objects on ip link show")
383 if len(link) < 1:
384 return {}
385 fail(xdp != "xdp" in link,
386 "XDP program not reporting in iplink (reported %s, expected %s)" %
387 ("xdp" in link, xdp))
388 return link[0]
389
390 def tc_add_ingress(self):
391 tc("qdisc add dev %s ingress" % (self['ifname']))
392
393 def tc_del_ingress(self):
394 tc("qdisc del dev %s ingress" % (self['ifname']))
395
396 def tc_flush_filters(self, bound=0, total=0):
397 self.tc_del_ingress()
398 self.tc_add_ingress()
399 self.wait_for_flush(bound=bound, total=total)
400
401 def tc_show_ingress(self, expected=None):
402 # No JSON support, oh well...
403 flags = ["skip_sw", "skip_hw", "in_hw"]
404 named = ["protocol", "pref", "chain", "handle", "id", "tag"]
405
406 args = "-s filter show dev %s ingress" % (self['ifname'])
407 _, out = tc(args, JSON=False)
408
409 filters = []
410 lines = out.split('\n')
411 for line in lines:
412 words = line.split()
413 if "handle" not in words:
414 continue
415 fltr = {}
416 for flag in flags:
417 fltr[flag] = flag in words
418 for name in named:
419 try:
420 idx = words.index(name)
421 fltr[name] = words[idx + 1]
422 except ValueError:
423 pass
424 filters.append(fltr)
425
426 if expected is not None:
427 fail(len(filters) != expected,
428 "%d ingress filters loaded, expected %d" %
429 (len(filters), expected))
430 return filters
431
432 def cls_filter_op(self, op, qdisc="ingress", prio=None, handle=None,
433 chain=None, cls="", params="",
434 fail=True, include_stderr=False):
435 spec = ""
436 if prio is not None:
437 spec += " prio %d" % (prio)
438 if handle:
439 spec += " handle %s" % (handle)
440 if chain is not None:
441 spec += " chain %d" % (chain)
442
443 return tc("filter {op} dev {dev} {qdisc} {spec} {cls} {params}"\
444 .format(op=op, dev=self['ifname'], qdisc=qdisc, spec=spec,
445 cls=cls, params=params),
446 fail=fail, include_stderr=include_stderr)
447
448 def cls_bpf_add_filter(self, bpf, op="add", prio=None, handle=None,
449 chain=None, da=False, verbose=False,
450 skip_sw=False, skip_hw=False,
451 fail=True, include_stderr=False):
452 cls = "bpf " + bpf
453
454 params = ""
455 if da:
456 params += " da"
457 if verbose:
458 params += " verbose"
459 if skip_sw:
460 params += " skip_sw"
461 if skip_hw:
462 params += " skip_hw"
463
464 return self.cls_filter_op(op=op, prio=prio, handle=handle, cls=cls,
465 chain=chain, params=params,
466 fail=fail, include_stderr=include_stderr)
467
468 def set_ethtool_tc_offloads(self, enable, fail=True):
469 args = "hw-tc-offload %s" % ("on" if enable else "off")
470 return ethtool(self, "-K", args, fail=fail)
471
472################################################################################
473def clean_up():
474 global files, netns, devs
475
476 for dev in devs:
477 dev.remove()
478 for f in files:
479 cmd("rm -f %s" % (f))
480 for ns in netns:
481 cmd("ip netns delete %s" % (ns))
482 files = []
483 netns = []
484
485def pin_prog(file_name, idx=0):
486 progs = bpftool_prog_list(expected=(idx + 1))
487 prog = progs[idx]
488 bpftool("prog pin id %d %s" % (prog["id"], file_name))
489 files.append(file_name)
490
491 return file_name, bpf_pinned(file_name)
492
493def pin_map(file_name, idx=0, expected=1):
494 maps = bpftool_map_list(expected=expected)
495 m = maps[idx]
496 bpftool("map pin id %d %s" % (m["id"], file_name))
497 files.append(file_name)
498
499 return file_name, bpf_pinned(file_name)
500
501def check_dev_info_removed(prog_file=None, map_file=None):
502 bpftool_prog_list(expected=0)
503 ret, err = bpftool("prog show pin %s" % (prog_file), fail=False)
504 fail(ret == 0, "Showing prog with removed device did not fail")
505 fail(err["error"].find("No such device") == -1,
506 "Showing prog with removed device expected ENODEV, error is %s" %
507 (err["error"]))
508
509 bpftool_map_list(expected=0)
510 ret, err = bpftool("map show pin %s" % (map_file), fail=False)
511 fail(ret == 0, "Showing map with removed device did not fail")
512 fail(err["error"].find("No such device") == -1,
513 "Showing map with removed device expected ENODEV, error is %s" %
514 (err["error"]))
515
516def check_dev_info(other_ns, ns, prog_file=None, map_file=None, removed=False):
517 progs = bpftool_prog_list(expected=1, ns=ns)
518 prog = progs[0]
519
520 fail("dev" not in prog.keys(), "Device parameters not reported")
521 dev = prog["dev"]
522 fail("ifindex" not in dev.keys(), "Device parameters not reported")
523 fail("ns_dev" not in dev.keys(), "Device parameters not reported")
524 fail("ns_inode" not in dev.keys(), "Device parameters not reported")
525
526 if not other_ns:
527 fail("ifname" not in dev.keys(), "Ifname not reported")
528 fail(dev["ifname"] != sim["ifname"],
529 "Ifname incorrect %s vs %s" % (dev["ifname"], sim["ifname"]))
530 else:
531 fail("ifname" in dev.keys(), "Ifname is reported for other ns")
532
533 maps = bpftool_map_list(expected=2, ns=ns)
534 for m in maps:
535 fail("dev" not in m.keys(), "Device parameters not reported")
536 fail(dev != m["dev"], "Map's device different than program's")
537
538def check_extack(output, reference, args):
539 if skip_extack:
540 return
541 lines = output.split("\n")
542 comp = len(lines) >= 2 and lines[1] == reference
543 fail(not comp, "Missing or incorrect netlink extack message")
544
545def check_extack_nsim(output, reference, args):
546 check_extack(output, "Error: netdevsim: " + reference, args)
547
548def check_no_extack(res, needle):
549 fail((res[1] + res[2]).count(needle) or (res[1] + res[2]).count("Warning:"),
550 "Found '%s' in command output, leaky extack?" % (needle))
551
552def check_verifier_log(output, reference):
553 lines = output.split("\n")
554 for l in reversed(lines):
555 if l == reference:
556 return
557 fail(True, "Missing or incorrect message from netdevsim in verifier log")
558
559def test_spurios_extack(sim, obj, skip_hw, needle):
560 res = sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=skip_hw,
561 include_stderr=True)
562 check_no_extack(res, needle)
563 res = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
564 skip_hw=skip_hw, include_stderr=True)
565 check_no_extack(res, needle)
566 res = sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf",
567 include_stderr=True)
568 check_no_extack(res, needle)
569
570
571# Parse command line
572parser = argparse.ArgumentParser()
573parser.add_argument("--log", help="output verbose log to given file")
574args = parser.parse_args()
575if args.log:
576 logfile = open(args.log, 'w+')
577 logfile.write("# -*-Org-*-")
578
579log("Prepare...", "", level=1)
580log_level_inc()
581
582# Check permissions
583skip(os.getuid() != 0, "test must be run as root")
584
585# Check tools
586ret, progs = bpftool("prog", fail=False)
587skip(ret != 0, "bpftool not installed")
588# Check no BPF programs are loaded
589skip(len(progs) != 0, "BPF programs already loaded on the system")
590
591# Check netdevsim
592ret, out = cmd("modprobe netdevsim", fail=False)
593skip(ret != 0, "netdevsim module could not be loaded")
594
595# Check debugfs
596_, out = cmd("mount")
597if out.find("/sys/kernel/debug type debugfs") == -1:
598 cmd("mount -t debugfs none /sys/kernel/debug")
599
600# Check samples are compiled
601samples = ["sample_ret0.o", "sample_map_ret0.o"]
602for s in samples:
603 ret, out = cmd("ls %s/%s" % (bpf_test_dir, s), fail=False)
604 skip(ret != 0, "sample %s/%s not found, please compile it" %
605 (bpf_test_dir, s))
606
607# Check if iproute2 is built with libmnl (needed by extack support)
608_, _, err = cmd("tc qdisc delete dev lo handle 0",
609 fail=False, include_stderr=True)
610if err.find("Error: Failed to find qdisc with specified handle.") == -1:
611 print("Warning: no extack message in iproute2 output, libmnl missing?")
612 log("Warning: no extack message in iproute2 output, libmnl missing?", "")
613 skip_extack = True
614
615# Check if net namespaces seem to work
616ns = mknetns()
617skip(ns is None, "Could not create a net namespace")
618cmd("ip netns delete %s" % (ns))
619netns = []
620
621try:
622 obj = bpf_obj("sample_ret0.o")
623 bytecode = bpf_bytecode("1,6 0 0 4294967295,")
624
625 start_test("Test destruction of generic XDP...")
626 sim = NetdevSim()
627 sim.set_xdp(obj, "generic")
628 sim.remove()
629 bpftool_prog_list_wait(expected=0)
630
631 sim = NetdevSim()
632 sim.tc_add_ingress()
633
634 start_test("Test TC non-offloaded...")
635 ret, _ = sim.cls_bpf_add_filter(obj, skip_hw=True, fail=False)
636 fail(ret != 0, "Software TC filter did not load")
637
638 start_test("Test TC non-offloaded isn't getting bound...")
639 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
640 fail(ret != 0, "Software TC filter did not load")
641 sim.dfs_get_bound_progs(expected=0)
642
643 sim.tc_flush_filters()
644
645 start_test("Test TC offloads are off by default...")
646 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
647 fail=False, include_stderr=True)
648 fail(ret == 0, "TC filter loaded without enabling TC offloads")
649 check_extack(err, "Error: TC offload is disabled on net device.", args)
650 sim.wait_for_flush()
651
652 sim.set_ethtool_tc_offloads(True)
653 sim.dfs["bpf_tc_non_bound_accept"] = "Y"
654
655 start_test("Test TC offload by default...")
656 ret, _ = sim.cls_bpf_add_filter(obj, fail=False)
657 fail(ret != 0, "Software TC filter did not load")
658 sim.dfs_get_bound_progs(expected=0)
659 ingress = sim.tc_show_ingress(expected=1)
660 fltr = ingress[0]
661 fail(not fltr["in_hw"], "Filter not offloaded by default")
662
663 sim.tc_flush_filters()
664
665 start_test("Test TC cBPF bytcode tries offload by default...")
666 ret, _ = sim.cls_bpf_add_filter(bytecode, fail=False)
667 fail(ret != 0, "Software TC filter did not load")
668 sim.dfs_get_bound_progs(expected=0)
669 ingress = sim.tc_show_ingress(expected=1)
670 fltr = ingress[0]
671 fail(not fltr["in_hw"], "Bytecode not offloaded by default")
672
673 sim.tc_flush_filters()
674 sim.dfs["bpf_tc_non_bound_accept"] = "N"
675
676 start_test("Test TC cBPF unbound bytecode doesn't offload...")
677 ret, _, err = sim.cls_bpf_add_filter(bytecode, skip_sw=True,
678 fail=False, include_stderr=True)
679 fail(ret == 0, "TC bytecode loaded for offload")
680 check_extack_nsim(err, "netdevsim configured to reject unbound programs.",
681 args)
682 sim.wait_for_flush()
683
684 start_test("Test non-0 chain offload...")
685 ret, _, err = sim.cls_bpf_add_filter(obj, chain=1, prio=1, handle=1,
686 skip_sw=True,
687 fail=False, include_stderr=True)
688 fail(ret == 0, "Offloaded a filter to chain other than 0")
689 check_extack(err, "Error: Driver supports only offload of chain 0.", args)
690 sim.tc_flush_filters()
691
692 start_test("Test TC replace...")
693 sim.cls_bpf_add_filter(obj, prio=1, handle=1)
694 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1)
695 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
696
697 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_sw=True)
698 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_sw=True)
699 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
700
701 sim.cls_bpf_add_filter(obj, prio=1, handle=1, skip_hw=True)
702 sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1, skip_hw=True)
703 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
704
705 start_test("Test TC replace bad flags...")
706 for i in range(3):
707 for j in range(3):
708 ret, _ = sim.cls_bpf_add_filter(obj, op="replace", prio=1, handle=1,
709 skip_sw=(j == 1), skip_hw=(j == 2),
710 fail=False)
711 fail(bool(ret) != bool(j),
712 "Software TC incorrect load in replace test, iteration %d" %
713 (j))
714 sim.cls_filter_op(op="delete", prio=1, handle=1, cls="bpf")
715
716 start_test("Test spurious extack from the driver...")
717 test_spurios_extack(sim, obj, False, "netdevsim")
718 test_spurios_extack(sim, obj, True, "netdevsim")
719
720 sim.set_ethtool_tc_offloads(False)
721
722 test_spurios_extack(sim, obj, False, "TC offload is disabled")
723 test_spurios_extack(sim, obj, True, "TC offload is disabled")
724
725 sim.set_ethtool_tc_offloads(True)
726
727 sim.tc_flush_filters()
728
729 start_test("Test TC offloads work...")
730 ret, _, err = sim.cls_bpf_add_filter(obj, verbose=True, skip_sw=True,
731 fail=False, include_stderr=True)
732 fail(ret != 0, "TC filter did not load with TC offloads enabled")
733 check_verifier_log(err, "[netdevsim] Hello from netdevsim!")
734
735 start_test("Test TC offload basics...")
736 dfs = sim.dfs_get_bound_progs(expected=1)
737 progs = bpftool_prog_list(expected=1)
738 ingress = sim.tc_show_ingress(expected=1)
739
740 dprog = dfs[0]
741 prog = progs[0]
742 fltr = ingress[0]
743 fail(fltr["skip_hw"], "TC does reports 'skip_hw' on offloaded filter")
744 fail(not fltr["in_hw"], "TC does not report 'in_hw' for offloaded filter")
745 fail(not fltr["skip_sw"], "TC does not report 'skip_sw' back")
746
747 start_test("Test TC offload is device-bound...")
748 fail(str(prog["id"]) != fltr["id"], "Program IDs don't match")
749 fail(prog["tag"] != fltr["tag"], "Program tags don't match")
750 fail(fltr["id"] != dprog["id"], "Program IDs don't match")
751 fail(dprog["state"] != "xlated", "Offloaded program state not translated")
752 fail(dprog["loaded"] != "Y", "Offloaded program is not loaded")
753
754 start_test("Test disabling TC offloads is rejected while filters installed...")
755 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
756 fail(ret == 0, "Driver should refuse to disable TC offloads with filters installed...")
757
758 start_test("Test qdisc removal frees things...")
759 sim.tc_flush_filters()
760 sim.tc_show_ingress(expected=0)
761
762 start_test("Test disabling TC offloads is OK without filters...")
763 ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
764 fail(ret != 0,
765 "Driver refused to disable TC offloads without filters installed...")
766
767 sim.set_ethtool_tc_offloads(True)
768
769 start_test("Test destroying device gets rid of TC filters...")
770 sim.cls_bpf_add_filter(obj, skip_sw=True)
771 sim.remove()
772 bpftool_prog_list_wait(expected=0)
773
774 sim = NetdevSim()
775 sim.set_ethtool_tc_offloads(True)
776
777 start_test("Test destroying device gets rid of XDP...")
778 sim.set_xdp(obj, "offload")
779 sim.remove()
780 bpftool_prog_list_wait(expected=0)
781
782 sim = NetdevSim()
783 sim.set_ethtool_tc_offloads(True)
784
785 start_test("Test XDP prog reporting...")
786 sim.set_xdp(obj, "drv")
787 ipl = sim.ip_link_show(xdp=True)
788 progs = bpftool_prog_list(expected=1)
789 fail(ipl["xdp"]["prog"]["id"] != progs[0]["id"],
790 "Loaded program has wrong ID")
791
792 start_test("Test XDP prog replace without force...")
793 ret, _ = sim.set_xdp(obj, "drv", fail=False)
794 fail(ret == 0, "Replaced XDP program without -force")
795 sim.wait_for_flush(total=1)
796
797 start_test("Test XDP prog replace with force...")
798 ret, _ = sim.set_xdp(obj, "drv", force=True, fail=False)
799 fail(ret != 0, "Could not replace XDP program with -force")
800 bpftool_prog_list_wait(expected=1)
801 ipl = sim.ip_link_show(xdp=True)
802 progs = bpftool_prog_list(expected=1)
803 fail(ipl["xdp"]["prog"]["id"] != progs[0]["id"],
804 "Loaded program has wrong ID")
805 fail("dev" in progs[0].keys(),
806 "Device parameters reported for non-offloaded program")
807
808 start_test("Test XDP prog replace with bad flags...")
809 ret, _, err = sim.set_xdp(obj, "offload", force=True,
810 fail=False, include_stderr=True)
811 fail(ret == 0, "Replaced XDP program with a program in different mode")
812 check_extack_nsim(err, "program loaded with different flags.", args)
813 ret, _, err = sim.set_xdp(obj, "", force=True,
814 fail=False, include_stderr=True)
815 fail(ret == 0, "Replaced XDP program with a program in different mode")
816 check_extack_nsim(err, "program loaded with different flags.", args)
817
818 start_test("Test XDP prog remove with bad flags...")
819 ret, _, err = sim.unset_xdp("offload", force=True,
820 fail=False, include_stderr=True)
821 fail(ret == 0, "Removed program with a bad mode mode")
822 check_extack_nsim(err, "program loaded with different flags.", args)
823 ret, _, err = sim.unset_xdp("", force=True,
824 fail=False, include_stderr=True)
825 fail(ret == 0, "Removed program with a bad mode mode")
826 check_extack_nsim(err, "program loaded with different flags.", args)
827
828 start_test("Test MTU restrictions...")
829 ret, _ = sim.set_mtu(9000, fail=False)
830 fail(ret == 0,
831 "Driver should refuse to increase MTU to 9000 with XDP loaded...")
832 sim.unset_xdp("drv")
833 bpftool_prog_list_wait(expected=0)
834 sim.set_mtu(9000)
835 ret, _, err = sim.set_xdp(obj, "drv", fail=False, include_stderr=True)
836 fail(ret == 0, "Driver should refuse to load program with MTU of 9000...")
837 check_extack_nsim(err, "MTU too large w/ XDP enabled.", args)
838 sim.set_mtu(1500)
839
840 sim.wait_for_flush()
841 start_test("Test XDP offload...")
842 _, _, err = sim.set_xdp(obj, "offload", verbose=True, include_stderr=True)
843 ipl = sim.ip_link_show(xdp=True)
844 link_xdp = ipl["xdp"]["prog"]
845 progs = bpftool_prog_list(expected=1)
846 prog = progs[0]
847 fail(link_xdp["id"] != prog["id"], "Loaded program has wrong ID")
848 check_verifier_log(err, "[netdevsim] Hello from netdevsim!")
849
850 start_test("Test XDP offload is device bound...")
851 dfs = sim.dfs_get_bound_progs(expected=1)
852 dprog = dfs[0]
853
854 fail(prog["id"] != link_xdp["id"], "Program IDs don't match")
855 fail(prog["tag"] != link_xdp["tag"], "Program tags don't match")
856 fail(str(link_xdp["id"]) != dprog["id"], "Program IDs don't match")
857 fail(dprog["state"] != "xlated", "Offloaded program state not translated")
858 fail(dprog["loaded"] != "Y", "Offloaded program is not loaded")
859
860 start_test("Test removing XDP program many times...")
861 sim.unset_xdp("offload")
862 sim.unset_xdp("offload")
863 sim.unset_xdp("drv")
864 sim.unset_xdp("drv")
865 sim.unset_xdp("")
866 sim.unset_xdp("")
867 bpftool_prog_list_wait(expected=0)
868
869 start_test("Test attempt to use a program for a wrong device...")
870 sim2 = NetdevSim()
871 sim2.set_xdp(obj, "offload")
872 pin_file, pinned = pin_prog("/sys/fs/bpf/tmp")
873
874 ret, _, err = sim.set_xdp(pinned, "offload",
875 fail=False, include_stderr=True)
876 fail(ret == 0, "Pinned program loaded for a different device accepted")
877 check_extack_nsim(err, "program bound to different dev.", args)
878 sim2.remove()
879 ret, _, err = sim.set_xdp(pinned, "offload",
880 fail=False, include_stderr=True)
881 fail(ret == 0, "Pinned program loaded for a removed device accepted")
882 check_extack_nsim(err, "xdpoffload of non-bound program.", args)
883 rm(pin_file)
884 bpftool_prog_list_wait(expected=0)
885
886 start_test("Test mixing of TC and XDP...")
887 sim.tc_add_ingress()
888 sim.set_xdp(obj, "offload")
889 ret, _, err = sim.cls_bpf_add_filter(obj, skip_sw=True,
890 fail=False, include_stderr=True)
891 fail(ret == 0, "Loading TC when XDP active should fail")
892 check_extack_nsim(err, "driver and netdev offload states mismatch.", args)
893 sim.unset_xdp("offload")
894 sim.wait_for_flush()
895
896 sim.cls_bpf_add_filter(obj, skip_sw=True)
897 ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
898 fail(ret == 0, "Loading XDP when TC active should fail")
899 check_extack_nsim(err, "TC program is already loaded.", args)
900
901 start_test("Test binding TC from pinned...")
902 pin_file, pinned = pin_prog("/sys/fs/bpf/tmp")
903 sim.tc_flush_filters(bound=1, total=1)
904 sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True)
905 sim.tc_flush_filters(bound=1, total=1)
906
907 start_test("Test binding XDP from pinned...")
908 sim.set_xdp(obj, "offload")
909 pin_file, pinned = pin_prog("/sys/fs/bpf/tmp2", idx=1)
910
911 sim.set_xdp(pinned, "offload", force=True)
912 sim.unset_xdp("offload")
913 sim.set_xdp(pinned, "offload", force=True)
914 sim.unset_xdp("offload")
915
916 start_test("Test offload of wrong type fails...")
917 ret, _ = sim.cls_bpf_add_filter(pinned, da=True, skip_sw=True, fail=False)
918 fail(ret == 0, "Managed to attach XDP program to TC")
919
920 start_test("Test asking for TC offload of two filters...")
921 sim.cls_bpf_add_filter(obj, da=True, skip_sw=True)
922 ret, _, err = sim.cls_bpf_add_filter(obj, da=True, skip_sw=True,
923 fail=False, include_stderr=True)
924 fail(ret == 0, "Managed to offload two TC filters at the same time")
925 check_extack_nsim(err, "driver and netdev offload states mismatch.", args)
926
927 sim.tc_flush_filters(bound=2, total=2)
928
929 start_test("Test if netdev removal waits for translation...")
930 delay_msec = 500
931 sim.dfs["bpf_bind_verifier_delay"] = delay_msec
932 start = time.time()
933 cmd_line = "tc filter add dev %s ingress bpf %s da skip_sw" % \
934 (sim['ifname'], obj)
935 tc_proc = cmd(cmd_line, background=True, fail=False)
936 # Wait for the verifier to start
937 while sim.dfs_num_bound_progs() <= 2:
938 pass
939 sim.remove()
940 end = time.time()
941 ret, _ = cmd_result(tc_proc, fail=False)
942 time_diff = end - start
943 log("Time", "start:\t%s\nend:\t%s\ndiff:\t%s" % (start, end, time_diff))
944
945 fail(ret == 0, "Managed to load TC filter on a unregistering device")
946 delay_sec = delay_msec * 0.001
947 fail(time_diff < delay_sec, "Removal process took %s, expected %s" %
948 (time_diff, delay_sec))
949
950 # Remove all pinned files and reinstantiate the netdev
951 clean_up()
952 bpftool_prog_list_wait(expected=0)
953
954 sim = NetdevSim()
955 map_obj = bpf_obj("sample_map_ret0.o")
956 start_test("Test loading program with maps...")
957 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
958
959 start_test("Test bpftool bound info reporting (own ns)...")
960 check_dev_info(False, "")
961
962 start_test("Test bpftool bound info reporting (other ns)...")
963 ns = mknetns()
964 sim.set_ns(ns)
965 check_dev_info(True, "")
966
967 start_test("Test bpftool bound info reporting (remote ns)...")
968 check_dev_info(False, ns)
969
970 start_test("Test bpftool bound info reporting (back to own ns)...")
971 sim.set_ns("")
972 check_dev_info(False, "")
973
974 prog_file, _ = pin_prog("/sys/fs/bpf/tmp_prog")
975 map_file, _ = pin_map("/sys/fs/bpf/tmp_map", idx=1, expected=2)
976 sim.remove()
977
978 start_test("Test bpftool bound info reporting (removed dev)...")
979 check_dev_info_removed(prog_file=prog_file, map_file=map_file)
980
981 # Remove all pinned files and reinstantiate the netdev
982 clean_up()
983 bpftool_prog_list_wait(expected=0)
984
985 sim = NetdevSim()
986
987 start_test("Test map update (no flags)...")
988 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
989 maps = bpftool_map_list(expected=2)
990 array = maps[0] if maps[0]["type"] == "array" else maps[1]
991 htab = maps[0] if maps[0]["type"] == "hash" else maps[1]
992 for m in maps:
993 for i in range(2):
994 bpftool("map update id %d key %s value %s" %
995 (m["id"], int2str("I", i), int2str("Q", i * 3)))
996
997 for m in maps:
998 ret, _ = bpftool("map update id %d key %s value %s" %
999 (m["id"], int2str("I", 3), int2str("Q", 3 * 3)),
1000 fail=False)
1001 fail(ret == 0, "added too many entries")
1002
1003 start_test("Test map update (exists)...")
1004 for m in maps:
1005 for i in range(2):
1006 bpftool("map update id %d key %s value %s exist" %
1007 (m["id"], int2str("I", i), int2str("Q", i * 3)))
1008
1009 for m in maps:
1010 ret, err = bpftool("map update id %d key %s value %s exist" %
1011 (m["id"], int2str("I", 3), int2str("Q", 3 * 3)),
1012 fail=False)
1013 fail(ret == 0, "updated non-existing key")
1014 fail(err["error"].find("No such file or directory") == -1,
1015 "expected ENOENT, error is '%s'" % (err["error"]))
1016
1017 start_test("Test map update (noexist)...")
1018 for m in maps:
1019 for i in range(2):
1020 ret, err = bpftool("map update id %d key %s value %s noexist" %
1021 (m["id"], int2str("I", i), int2str("Q", i * 3)),
1022 fail=False)
1023 fail(ret == 0, "updated existing key")
1024 fail(err["error"].find("File exists") == -1,
1025 "expected EEXIST, error is '%s'" % (err["error"]))
1026
1027 start_test("Test map dump...")
1028 for m in maps:
1029 _, entries = bpftool("map dump id %d" % (m["id"]))
1030 for i in range(2):
1031 key = str2int(entries[i]["key"])
1032 fail(key != i, "expected key %d, got %d" % (key, i))
1033 val = str2int(entries[i]["value"])
1034 fail(val != i * 3, "expected value %d, got %d" % (val, i * 3))
1035
1036 start_test("Test map getnext...")
1037 for m in maps:
1038 _, entry = bpftool("map getnext id %d" % (m["id"]))
1039 key = str2int(entry["next_key"])
1040 fail(key != 0, "next key %d, expected %d" % (key, 0))
1041 _, entry = bpftool("map getnext id %d key %s" %
1042 (m["id"], int2str("I", 0)))
1043 key = str2int(entry["next_key"])
1044 fail(key != 1, "next key %d, expected %d" % (key, 1))
1045 ret, err = bpftool("map getnext id %d key %s" %
1046 (m["id"], int2str("I", 1)), fail=False)
1047 fail(ret == 0, "got next key past the end of map")
1048 fail(err["error"].find("No such file or directory") == -1,
1049 "expected ENOENT, error is '%s'" % (err["error"]))
1050
1051 start_test("Test map delete (htab)...")
1052 for i in range(2):
1053 bpftool("map delete id %d key %s" % (htab["id"], int2str("I", i)))
1054
1055 start_test("Test map delete (array)...")
1056 for i in range(2):
1057 ret, err = bpftool("map delete id %d key %s" %
1058 (htab["id"], int2str("I", i)), fail=False)
1059 fail(ret == 0, "removed entry from an array")
1060 fail(err["error"].find("No such file or directory") == -1,
1061 "expected ENOENT, error is '%s'" % (err["error"]))
1062
1063 start_test("Test map remove...")
1064 sim.unset_xdp("offload")
1065 bpftool_map_list_wait(expected=0)
1066 sim.remove()
1067
1068 sim = NetdevSim()
1069 sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
1070 sim.remove()
1071 bpftool_map_list_wait(expected=0)
1072
1073 start_test("Test map creation fail path...")
1074 sim = NetdevSim()
1075 sim.dfs["bpf_map_accept"] = "N"
1076 ret, _ = sim.set_xdp(map_obj, "offload", JSON=False, fail=False)
1077 fail(ret == 0,
1078 "netdevsim didn't refuse to create a map with offload disabled")
1079
1080 print("%s: OK" % (os.path.basename(__file__)))
1081
1082finally:
1083 log("Clean up...", "", level=1)
1084 log_level_inc()
1085 clean_up()
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 6761be18a91f..b549308abd19 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -21,8 +21,10 @@ typedef __u16 __sum16;
21#include <linux/ipv6.h> 21#include <linux/ipv6.h>
22#include <linux/tcp.h> 22#include <linux/tcp.h>
23#include <linux/filter.h> 23#include <linux/filter.h>
24#include <linux/perf_event.h>
24#include <linux/unistd.h> 25#include <linux/unistd.h>
25 26
27#include <sys/ioctl.h>
26#include <sys/wait.h> 28#include <sys/wait.h>
27#include <sys/resource.h> 29#include <sys/resource.h>
28#include <sys/types.h> 30#include <sys/types.h>
@@ -167,10 +169,9 @@ out:
167#define NUM_ITER 100000 169#define NUM_ITER 100000
168#define VIP_NUM 5 170#define VIP_NUM 5
169 171
170static void test_l4lb(void) 172static void test_l4lb(const char *file)
171{ 173{
172 unsigned int nr_cpus = bpf_num_possible_cpus(); 174 unsigned int nr_cpus = bpf_num_possible_cpus();
173 const char *file = "./test_l4lb.o";
174 struct vip key = {.protocol = 6}; 175 struct vip key = {.protocol = 6};
175 struct vip_meta { 176 struct vip_meta {
176 __u32 flags; 177 __u32 flags;
@@ -247,6 +248,95 @@ out:
247 bpf_object__close(obj); 248 bpf_object__close(obj);
248} 249}
249 250
251static void test_l4lb_all(void)
252{
253 const char *file1 = "./test_l4lb.o";
254 const char *file2 = "./test_l4lb_noinline.o";
255
256 test_l4lb(file1);
257 test_l4lb(file2);
258}
259
260static void test_xdp_noinline(void)
261{
262 const char *file = "./test_xdp_noinline.o";
263 unsigned int nr_cpus = bpf_num_possible_cpus();
264 struct vip key = {.protocol = 6};
265 struct vip_meta {
266 __u32 flags;
267 __u32 vip_num;
268 } value = {.vip_num = VIP_NUM};
269 __u32 stats_key = VIP_NUM;
270 struct vip_stats {
271 __u64 bytes;
272 __u64 pkts;
273 } stats[nr_cpus];
274 struct real_definition {
275 union {
276 __be32 dst;
277 __be32 dstv6[4];
278 };
279 __u8 flags;
280 } real_def = {.dst = MAGIC_VAL};
281 __u32 ch_key = 11, real_num = 3;
282 __u32 duration, retval, size;
283 int err, i, prog_fd, map_fd;
284 __u64 bytes = 0, pkts = 0;
285 struct bpf_object *obj;
286 char buf[128];
287 u32 *magic = (u32 *)buf;
288
289 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
290 if (err) {
291 error_cnt++;
292 return;
293 }
294
295 map_fd = bpf_find_map(__func__, obj, "vip_map");
296 if (map_fd < 0)
297 goto out;
298 bpf_map_update_elem(map_fd, &key, &value, 0);
299
300 map_fd = bpf_find_map(__func__, obj, "ch_rings");
301 if (map_fd < 0)
302 goto out;
303 bpf_map_update_elem(map_fd, &ch_key, &real_num, 0);
304
305 map_fd = bpf_find_map(__func__, obj, "reals");
306 if (map_fd < 0)
307 goto out;
308 bpf_map_update_elem(map_fd, &real_num, &real_def, 0);
309
310 err = bpf_prog_test_run(prog_fd, NUM_ITER, &pkt_v4, sizeof(pkt_v4),
311 buf, &size, &retval, &duration);
312 CHECK(err || errno || retval != 1 || size != 54 ||
313 *magic != MAGIC_VAL, "ipv4",
314 "err %d errno %d retval %d size %d magic %x\n",
315 err, errno, retval, size, *magic);
316
317 err = bpf_prog_test_run(prog_fd, NUM_ITER, &pkt_v6, sizeof(pkt_v6),
318 buf, &size, &retval, &duration);
319 CHECK(err || errno || retval != 1 || size != 74 ||
320 *magic != MAGIC_VAL, "ipv6",
321 "err %d errno %d retval %d size %d magic %x\n",
322 err, errno, retval, size, *magic);
323
324 map_fd = bpf_find_map(__func__, obj, "stats");
325 if (map_fd < 0)
326 goto out;
327 bpf_map_lookup_elem(map_fd, &stats_key, stats);
328 for (i = 0; i < nr_cpus; i++) {
329 bytes += stats[i].bytes;
330 pkts += stats[i].pkts;
331 }
332 if (bytes != MAGIC_BYTES * NUM_ITER * 2 || pkts != NUM_ITER * 2) {
333 error_cnt++;
334 printf("test_xdp_noinline:FAIL:stats %lld %lld\n", bytes, pkts);
335 }
336out:
337 bpf_object__close(obj);
338}
339
250static void test_tcp_estats(void) 340static void test_tcp_estats(void)
251{ 341{
252 const char *file = "./test_tcp_estats.o"; 342 const char *file = "./test_tcp_estats.o";
@@ -617,6 +707,262 @@ static void test_obj_name(void)
617 } 707 }
618} 708}
619 709
710static void test_tp_attach_query(void)
711{
712 const int num_progs = 3;
713 int i, j, bytes, efd, err, prog_fd[num_progs], pmu_fd[num_progs];
714 __u32 duration = 0, info_len, saved_prog_ids[num_progs];
715 const char *file = "./test_tracepoint.o";
716 struct perf_event_query_bpf *query;
717 struct perf_event_attr attr = {};
718 struct bpf_object *obj[num_progs];
719 struct bpf_prog_info prog_info;
720 char buf[256];
721
722 snprintf(buf, sizeof(buf),
723 "/sys/kernel/debug/tracing/events/sched/sched_switch/id");
724 efd = open(buf, O_RDONLY, 0);
725 if (CHECK(efd < 0, "open", "err %d errno %d\n", efd, errno))
726 return;
727 bytes = read(efd, buf, sizeof(buf));
728 close(efd);
729 if (CHECK(bytes <= 0 || bytes >= sizeof(buf),
730 "read", "bytes %d errno %d\n", bytes, errno))
731 return;
732
733 attr.config = strtol(buf, NULL, 0);
734 attr.type = PERF_TYPE_TRACEPOINT;
735 attr.sample_type = PERF_SAMPLE_RAW | PERF_SAMPLE_CALLCHAIN;
736 attr.sample_period = 1;
737 attr.wakeup_events = 1;
738
739 query = malloc(sizeof(*query) + sizeof(__u32) * num_progs);
740 for (i = 0; i < num_progs; i++) {
741 err = bpf_prog_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj[i],
742 &prog_fd[i]);
743 if (CHECK(err, "prog_load", "err %d errno %d\n", err, errno))
744 goto cleanup1;
745
746 bzero(&prog_info, sizeof(prog_info));
747 prog_info.jited_prog_len = 0;
748 prog_info.xlated_prog_len = 0;
749 prog_info.nr_map_ids = 0;
750 info_len = sizeof(prog_info);
751 err = bpf_obj_get_info_by_fd(prog_fd[i], &prog_info, &info_len);
752 if (CHECK(err, "bpf_obj_get_info_by_fd", "err %d errno %d\n",
753 err, errno))
754 goto cleanup1;
755 saved_prog_ids[i] = prog_info.id;
756
757 pmu_fd[i] = syscall(__NR_perf_event_open, &attr, -1 /* pid */,
758 0 /* cpu 0 */, -1 /* group id */,
759 0 /* flags */);
760 if (CHECK(pmu_fd[i] < 0, "perf_event_open", "err %d errno %d\n",
761 pmu_fd[i], errno))
762 goto cleanup2;
763 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0);
764 if (CHECK(err, "perf_event_ioc_enable", "err %d errno %d\n",
765 err, errno))
766 goto cleanup3;
767
768 if (i == 0) {
769 /* check NULL prog array query */
770 query->ids_len = num_progs;
771 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query);
772 if (CHECK(err || query->prog_cnt != 0,
773 "perf_event_ioc_query_bpf",
774 "err %d errno %d query->prog_cnt %u\n",
775 err, errno, query->prog_cnt))
776 goto cleanup3;
777 }
778
779 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[i]);
780 if (CHECK(err, "perf_event_ioc_set_bpf", "err %d errno %d\n",
781 err, errno))
782 goto cleanup3;
783
784 if (i == 1) {
785 /* try to get # of programs only */
786 query->ids_len = 0;
787 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query);
788 if (CHECK(err || query->prog_cnt != 2,
789 "perf_event_ioc_query_bpf",
790 "err %d errno %d query->prog_cnt %u\n",
791 err, errno, query->prog_cnt))
792 goto cleanup3;
793
794 /* try a few negative tests */
795 /* invalid query pointer */
796 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF,
797 (struct perf_event_query_bpf *)0x1);
798 if (CHECK(!err || errno != EFAULT,
799 "perf_event_ioc_query_bpf",
800 "err %d errno %d\n", err, errno))
801 goto cleanup3;
802
803 /* no enough space */
804 query->ids_len = 1;
805 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query);
806 if (CHECK(!err || errno != ENOSPC || query->prog_cnt != 2,
807 "perf_event_ioc_query_bpf",
808 "err %d errno %d query->prog_cnt %u\n",
809 err, errno, query->prog_cnt))
810 goto cleanup3;
811 }
812
813 query->ids_len = num_progs;
814 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query);
815 if (CHECK(err || query->prog_cnt != (i + 1),
816 "perf_event_ioc_query_bpf",
817 "err %d errno %d query->prog_cnt %u\n",
818 err, errno, query->prog_cnt))
819 goto cleanup3;
820 for (j = 0; j < i + 1; j++)
821 if (CHECK(saved_prog_ids[j] != query->ids[j],
822 "perf_event_ioc_query_bpf",
823 "#%d saved_prog_id %x query prog_id %x\n",
824 j, saved_prog_ids[j], query->ids[j]))
825 goto cleanup3;
826 }
827
828 i = num_progs - 1;
829 for (; i >= 0; i--) {
830 cleanup3:
831 ioctl(pmu_fd[i], PERF_EVENT_IOC_DISABLE);
832 cleanup2:
833 close(pmu_fd[i]);
834 cleanup1:
835 bpf_object__close(obj[i]);
836 }
837 free(query);
838}
839
840static int compare_map_keys(int map1_fd, int map2_fd)
841{
842 __u32 key, next_key;
843 char val_buf[PERF_MAX_STACK_DEPTH * sizeof(__u64)];
844 int err;
845
846 err = bpf_map_get_next_key(map1_fd, NULL, &key);
847 if (err)
848 return err;
849 err = bpf_map_lookup_elem(map2_fd, &key, val_buf);
850 if (err)
851 return err;
852
853 while (bpf_map_get_next_key(map1_fd, &key, &next_key) == 0) {
854 err = bpf_map_lookup_elem(map2_fd, &next_key, val_buf);
855 if (err)
856 return err;
857
858 key = next_key;
859 }
860 if (errno != ENOENT)
861 return -1;
862
863 return 0;
864}
865
866static void test_stacktrace_map()
867{
868 int control_map_fd, stackid_hmap_fd, stackmap_fd;
869 const char *file = "./test_stacktrace_map.o";
870 int bytes, efd, err, pmu_fd, prog_fd;
871 struct perf_event_attr attr = {};
872 __u32 key, val, duration = 0;
873 struct bpf_object *obj;
874 char buf[256];
875
876 err = bpf_prog_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd);
877 if (CHECK(err, "prog_load", "err %d errno %d\n", err, errno))
878 goto out;
879
880 /* Get the ID for the sched/sched_switch tracepoint */
881 snprintf(buf, sizeof(buf),
882 "/sys/kernel/debug/tracing/events/sched/sched_switch/id");
883 efd = open(buf, O_RDONLY, 0);
884 if (CHECK(efd < 0, "open", "err %d errno %d\n", efd, errno))
885 goto close_prog;
886
887 bytes = read(efd, buf, sizeof(buf));
888 close(efd);
889 if (CHECK(bytes <= 0 || bytes >= sizeof(buf),
890 "read", "bytes %d errno %d\n", bytes, errno))
891 goto close_prog;
892
893 /* Open the perf event and attach bpf progrram */
894 attr.config = strtol(buf, NULL, 0);
895 attr.type = PERF_TYPE_TRACEPOINT;
896 attr.sample_type = PERF_SAMPLE_RAW | PERF_SAMPLE_CALLCHAIN;
897 attr.sample_period = 1;
898 attr.wakeup_events = 1;
899 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */,
900 0 /* cpu 0 */, -1 /* group id */,
901 0 /* flags */);
902 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n",
903 pmu_fd, errno))
904 goto close_prog;
905
906 err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0);
907 if (CHECK(err, "perf_event_ioc_enable", "err %d errno %d\n",
908 err, errno))
909 goto close_pmu;
910
911 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);
912 if (CHECK(err, "perf_event_ioc_set_bpf", "err %d errno %d\n",
913 err, errno))
914 goto disable_pmu;
915
916 /* find map fds */
917 control_map_fd = bpf_find_map(__func__, obj, "control_map");
918 if (CHECK(control_map_fd < 0, "bpf_find_map control_map",
919 "err %d errno %d\n", err, errno))
920 goto disable_pmu;
921
922 stackid_hmap_fd = bpf_find_map(__func__, obj, "stackid_hmap");
923 if (CHECK(stackid_hmap_fd < 0, "bpf_find_map stackid_hmap",
924 "err %d errno %d\n", err, errno))
925 goto disable_pmu;
926
927 stackmap_fd = bpf_find_map(__func__, obj, "stackmap");
928 if (CHECK(stackmap_fd < 0, "bpf_find_map stackmap", "err %d errno %d\n",
929 err, errno))
930 goto disable_pmu;
931
932 /* give some time for bpf program run */
933 sleep(1);
934
935 /* disable stack trace collection */
936 key = 0;
937 val = 1;
938 bpf_map_update_elem(control_map_fd, &key, &val, 0);
939
940 /* for every element in stackid_hmap, we can find a corresponding one
941 * in stackmap, and vise versa.
942 */
943 err = compare_map_keys(stackid_hmap_fd, stackmap_fd);
944 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap",
945 "err %d errno %d\n", err, errno))
946 goto disable_pmu;
947
948 err = compare_map_keys(stackmap_fd, stackid_hmap_fd);
949 if (CHECK(err, "compare_map_keys stackmap vs. stackid_hmap",
950 "err %d errno %d\n", err, errno))
951 ; /* fall through */
952
953disable_pmu:
954 ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE);
955
956close_pmu:
957 close(pmu_fd);
958
959close_prog:
960 bpf_object__close(obj);
961
962out:
963 return;
964}
965
620int main(void) 966int main(void)
621{ 967{
622 struct rlimit rinf = { RLIM_INFINITY, RLIM_INFINITY }; 968 struct rlimit rinf = { RLIM_INFINITY, RLIM_INFINITY };
@@ -625,11 +971,14 @@ int main(void)
625 971
626 test_pkt_access(); 972 test_pkt_access();
627 test_xdp(); 973 test_xdp();
628 test_l4lb(); 974 test_l4lb_all();
975 test_xdp_noinline();
629 test_tcp_estats(); 976 test_tcp_estats();
630 test_bpf_obj_id(); 977 test_bpf_obj_id();
631 test_pkt_md_access(); 978 test_pkt_md_access();
632 test_obj_name(); 979 test_obj_name();
980 test_tp_attach_query();
981 test_stacktrace_map();
633 982
634 printf("Summary: %d PASSED, %d FAILED\n", pass_cnt, error_cnt); 983 printf("Summary: %d PASSED, %d FAILED\n", pass_cnt, error_cnt);
635 return error_cnt ? EXIT_FAILURE : EXIT_SUCCESS; 984 return error_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
diff --git a/tools/testing/selftests/bpf/test_stacktrace_map.c b/tools/testing/selftests/bpf/test_stacktrace_map.c
new file mode 100644
index 000000000000..76d85c5d08bd
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_stacktrace_map.c
@@ -0,0 +1,62 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2018 Facebook
3
4#include <linux/bpf.h>
5#include "bpf_helpers.h"
6
7#ifndef PERF_MAX_STACK_DEPTH
8#define PERF_MAX_STACK_DEPTH 127
9#endif
10
11struct bpf_map_def SEC("maps") control_map = {
12 .type = BPF_MAP_TYPE_ARRAY,
13 .key_size = sizeof(__u32),
14 .value_size = sizeof(__u32),
15 .max_entries = 1,
16};
17
18struct bpf_map_def SEC("maps") stackid_hmap = {
19 .type = BPF_MAP_TYPE_HASH,
20 .key_size = sizeof(__u32),
21 .value_size = sizeof(__u32),
22 .max_entries = 10000,
23};
24
25struct bpf_map_def SEC("maps") stackmap = {
26 .type = BPF_MAP_TYPE_STACK_TRACE,
27 .key_size = sizeof(__u32),
28 .value_size = sizeof(__u64) * PERF_MAX_STACK_DEPTH,
29 .max_entries = 10000,
30};
31
32/* taken from /sys/kernel/debug/tracing/events/sched/sched_switch/format */
33struct sched_switch_args {
34 unsigned long long pad;
35 char prev_comm[16];
36 int prev_pid;
37 int prev_prio;
38 long long prev_state;
39 char next_comm[16];
40 int next_pid;
41 int next_prio;
42};
43
44SEC("tracepoint/sched/sched_switch")
45int oncpu(struct sched_switch_args *ctx)
46{
47 __u32 key = 0, val = 0, *value_p;
48
49 value_p = bpf_map_lookup_elem(&control_map, &key);
50 if (value_p && *value_p)
51 return 0; /* skip if non-zero *value_p */
52
53 /* The size of stackmap and stackid_hmap should be the same */
54 key = bpf_get_stackid(ctx, &stackmap, 0);
55 if ((int)key >= 0)
56 bpf_map_update_elem(&stackid_hmap, &key, &val, 0);
57
58 return 0;
59}
60
61char _license[] SEC("license") = "GPL";
62__u32 _version SEC("version") = 1; /* ignored by tracepoints, required by libbpf.a */
diff --git a/tools/testing/selftests/bpf/test_tcpbpf.h b/tools/testing/selftests/bpf/test_tcpbpf.h
new file mode 100644
index 000000000000..2fe43289943c
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_tcpbpf.h
@@ -0,0 +1,16 @@
1// SPDX-License-Identifier: GPL-2.0
2
3#ifndef _TEST_TCPBPF_H
4#define _TEST_TCPBPF_H
5
6struct tcpbpf_globals {
7 __u32 event_map;
8 __u32 total_retrans;
9 __u32 data_segs_in;
10 __u32 data_segs_out;
11 __u32 bad_cb_test_rv;
12 __u32 good_cb_test_rv;
13 __u64 bytes_received;
14 __u64 bytes_acked;
15};
16#endif
diff --git a/tools/testing/selftests/bpf/test_tcpbpf_kern.c b/tools/testing/selftests/bpf/test_tcpbpf_kern.c
new file mode 100644
index 000000000000..57119ad57a3f
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_tcpbpf_kern.c
@@ -0,0 +1,115 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <stddef.h>
3#include <string.h>
4#include <linux/bpf.h>
5#include <linux/if_ether.h>
6#include <linux/if_packet.h>
7#include <linux/ip.h>
8#include <linux/in6.h>
9#include <linux/types.h>
10#include <linux/socket.h>
11#include <linux/tcp.h>
12#include <netinet/in.h>
13#include "bpf_helpers.h"
14#include "bpf_endian.h"
15#include "test_tcpbpf.h"
16
17struct bpf_map_def SEC("maps") global_map = {
18 .type = BPF_MAP_TYPE_ARRAY,
19 .key_size = sizeof(__u32),
20 .value_size = sizeof(struct tcpbpf_globals),
21 .max_entries = 2,
22};
23
24static inline void update_event_map(int event)
25{
26 __u32 key = 0;
27 struct tcpbpf_globals g, *gp;
28
29 gp = bpf_map_lookup_elem(&global_map, &key);
30 if (gp == NULL) {
31 struct tcpbpf_globals g = {0};
32
33 g.event_map |= (1 << event);
34 bpf_map_update_elem(&global_map, &key, &g,
35 BPF_ANY);
36 } else {
37 g = *gp;
38 g.event_map |= (1 << event);
39 bpf_map_update_elem(&global_map, &key, &g,
40 BPF_ANY);
41 }
42}
43
44int _version SEC("version") = 1;
45
46SEC("sockops")
47int bpf_testcb(struct bpf_sock_ops *skops)
48{
49 int rv = -1;
50 int bad_call_rv = 0;
51 int good_call_rv = 0;
52 int op;
53 int v = 0;
54
55 op = (int) skops->op;
56
57 update_event_map(op);
58
59 switch (op) {
60 case BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB:
61 /* Test failure to set largest cb flag (assumes not defined) */
62 bad_call_rv = bpf_sock_ops_cb_flags_set(skops, 0x80);
63 /* Set callback */
64 good_call_rv = bpf_sock_ops_cb_flags_set(skops,
65 BPF_SOCK_OPS_STATE_CB_FLAG);
66 /* Update results */
67 {
68 __u32 key = 0;
69 struct tcpbpf_globals g, *gp;
70
71 gp = bpf_map_lookup_elem(&global_map, &key);
72 if (!gp)
73 break;
74 g = *gp;
75 g.bad_cb_test_rv = bad_call_rv;
76 g.good_cb_test_rv = good_call_rv;
77 bpf_map_update_elem(&global_map, &key, &g,
78 BPF_ANY);
79 }
80 break;
81 case BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB:
82 skops->sk_txhash = 0x12345f;
83 v = 0xff;
84 rv = bpf_setsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v,
85 sizeof(v));
86 break;
87 case BPF_SOCK_OPS_RTO_CB:
88 break;
89 case BPF_SOCK_OPS_RETRANS_CB:
90 break;
91 case BPF_SOCK_OPS_STATE_CB:
92 if (skops->args[1] == BPF_TCP_CLOSE) {
93 __u32 key = 0;
94 struct tcpbpf_globals g, *gp;
95
96 gp = bpf_map_lookup_elem(&global_map, &key);
97 if (!gp)
98 break;
99 g = *gp;
100 g.total_retrans = skops->total_retrans;
101 g.data_segs_in = skops->data_segs_in;
102 g.data_segs_out = skops->data_segs_out;
103 g.bytes_received = skops->bytes_received;
104 g.bytes_acked = skops->bytes_acked;
105 bpf_map_update_elem(&global_map, &key, &g,
106 BPF_ANY);
107 }
108 break;
109 default:
110 rv = -1;
111 }
112 skops->reply = rv;
113 return 1;
114}
115char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/test_tcpbpf_user.c b/tools/testing/selftests/bpf/test_tcpbpf_user.c
new file mode 100644
index 000000000000..95a370f3d378
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_tcpbpf_user.c
@@ -0,0 +1,126 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <stdio.h>
3#include <stdlib.h>
4#include <stdio.h>
5#include <unistd.h>
6#include <errno.h>
7#include <signal.h>
8#include <string.h>
9#include <assert.h>
10#include <linux/perf_event.h>
11#include <linux/ptrace.h>
12#include <linux/bpf.h>
13#include <sys/ioctl.h>
14#include <sys/types.h>
15#include <sys/stat.h>
16#include <fcntl.h>
17#include <bpf/bpf.h>
18#include <bpf/libbpf.h>
19#include "bpf_util.h"
20#include <linux/perf_event.h>
21#include "test_tcpbpf.h"
22
23static int bpf_find_map(const char *test, struct bpf_object *obj,
24 const char *name)
25{
26 struct bpf_map *map;
27
28 map = bpf_object__find_map_by_name(obj, name);
29 if (!map) {
30 printf("%s:FAIL:map '%s' not found\n", test, name);
31 return -1;
32 }
33 return bpf_map__fd(map);
34}
35
36#define SYSTEM(CMD) \
37 do { \
38 if (system(CMD)) { \
39 printf("system(%s) FAILS!\n", CMD); \
40 } \
41 } while (0)
42
43int main(int argc, char **argv)
44{
45 const char *file = "test_tcpbpf_kern.o";
46 struct tcpbpf_globals g = {0};
47 int cg_fd, prog_fd, map_fd;
48 bool debug_flag = false;
49 int error = EXIT_FAILURE;
50 struct bpf_object *obj;
51 char cmd[100], *dir;
52 struct stat buffer;
53 __u32 key = 0;
54 int pid;
55 int rv;
56
57 if (argc > 1 && strcmp(argv[1], "-d") == 0)
58 debug_flag = true;
59
60 dir = "/tmp/cgroupv2/foo";
61
62 if (stat(dir, &buffer) != 0) {
63 SYSTEM("mkdir -p /tmp/cgroupv2");
64 SYSTEM("mount -t cgroup2 none /tmp/cgroupv2");
65 SYSTEM("mkdir -p /tmp/cgroupv2/foo");
66 }
67 pid = (int) getpid();
68 sprintf(cmd, "echo %d >> /tmp/cgroupv2/foo/cgroup.procs", pid);
69 SYSTEM(cmd);
70
71 cg_fd = open(dir, O_DIRECTORY, O_RDONLY);
72 if (bpf_prog_load(file, BPF_PROG_TYPE_SOCK_OPS, &obj, &prog_fd)) {
73 printf("FAILED: load_bpf_file failed for: %s\n", file);
74 goto err;
75 }
76
77 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0);
78 if (rv) {
79 printf("FAILED: bpf_prog_attach: %d (%s)\n",
80 error, strerror(errno));
81 goto err;
82 }
83
84 SYSTEM("./tcp_server.py");
85
86 map_fd = bpf_find_map(__func__, obj, "global_map");
87 if (map_fd < 0)
88 goto err;
89
90 rv = bpf_map_lookup_elem(map_fd, &key, &g);
91 if (rv != 0) {
92 printf("FAILED: bpf_map_lookup_elem returns %d\n", rv);
93 goto err;
94 }
95
96 if (g.bytes_received != 501 || g.bytes_acked != 1002 ||
97 g.data_segs_in != 1 || g.data_segs_out != 1 ||
98 (g.event_map ^ 0x47e) != 0 || g.bad_cb_test_rv != 0x80 ||
99 g.good_cb_test_rv != 0) {
100 printf("FAILED: Wrong stats\n");
101 if (debug_flag) {
102 printf("\n");
103 printf("bytes_received: %d (expecting 501)\n",
104 (int)g.bytes_received);
105 printf("bytes_acked: %d (expecting 1002)\n",
106 (int)g.bytes_acked);
107 printf("data_segs_in: %d (expecting 1)\n",
108 g.data_segs_in);
109 printf("data_segs_out: %d (expecting 1)\n",
110 g.data_segs_out);
111 printf("event_map: 0x%x (at least 0x47e)\n",
112 g.event_map);
113 printf("bad_cb_test_rv: 0x%x (expecting 0x80)\n",
114 g.bad_cb_test_rv);
115 printf("good_cb_test_rv:0x%x (expecting 0)\n",
116 g.good_cb_test_rv);
117 }
118 goto err;
119 }
120 printf("PASSED!\n");
121 error = 0;
122err:
123 bpf_prog_detach(cg_fd, BPF_CGROUP_SOCK_OPS);
124 return error;
125
126}
diff --git a/tools/testing/selftests/bpf/test_tracepoint.c b/tools/testing/selftests/bpf/test_tracepoint.c
new file mode 100644
index 000000000000..04bf084517e0
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_tracepoint.c
@@ -0,0 +1,26 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2017 Facebook
3
4#include <linux/bpf.h>
5#include "bpf_helpers.h"
6
7/* taken from /sys/kernel/debug/tracing/events/sched/sched_switch/format */
8struct sched_switch_args {
9 unsigned long long pad;
10 char prev_comm[16];
11 int prev_pid;
12 int prev_prio;
13 long long prev_state;
14 char next_comm[16];
15 int next_pid;
16 int next_prio;
17};
18
19SEC("tracepoint/sched/sched_switch")
20int oncpu(struct sched_switch_args *ctx)
21{
22 return 0;
23}
24
25char _license[] SEC("license") = "GPL";
26__u32 _version SEC("version") = 1; /* ignored by tracepoints, required by libbpf.a */
diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index 5ed4175c4ff8..c0f16e93f9bd 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -2,6 +2,7 @@
2 * Testsuite for eBPF verifier 2 * Testsuite for eBPF verifier
3 * 3 *
4 * Copyright (c) 2014 PLUMgrid, http://plumgrid.com 4 * Copyright (c) 2014 PLUMgrid, http://plumgrid.com
5 * Copyright (c) 2017 Facebook
5 * 6 *
6 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU General Public 8 * modify it under the terms of version 2 of the GNU General Public
@@ -20,6 +21,7 @@
20#include <stddef.h> 21#include <stddef.h>
21#include <stdbool.h> 22#include <stdbool.h>
22#include <sched.h> 23#include <sched.h>
24#include <limits.h>
23 25
24#include <sys/capability.h> 26#include <sys/capability.h>
25#include <sys/resource.h> 27#include <sys/resource.h>
@@ -28,6 +30,7 @@
28#include <linux/filter.h> 30#include <linux/filter.h>
29#include <linux/bpf_perf_event.h> 31#include <linux/bpf_perf_event.h>
30#include <linux/bpf.h> 32#include <linux/bpf.h>
33#include <linux/if_ether.h>
31 34
32#include <bpf/bpf.h> 35#include <bpf/bpf.h>
33 36
@@ -48,6 +51,8 @@
48#define MAX_INSNS 512 51#define MAX_INSNS 512
49#define MAX_FIXUPS 8 52#define MAX_FIXUPS 8
50#define MAX_NR_MAPS 4 53#define MAX_NR_MAPS 4
54#define POINTER_VALUE 0xcafe4all
55#define TEST_DATA_LEN 64
51 56
52#define F_NEEDS_EFFICIENT_UNALIGNED_ACCESS (1 << 0) 57#define F_NEEDS_EFFICIENT_UNALIGNED_ACCESS (1 << 0)
53#define F_LOAD_WITH_STRICT_ALIGNMENT (1 << 1) 58#define F_LOAD_WITH_STRICT_ALIGNMENT (1 << 1)
@@ -61,6 +66,7 @@ struct bpf_test {
61 int fixup_map_in_map[MAX_FIXUPS]; 66 int fixup_map_in_map[MAX_FIXUPS];
62 const char *errstr; 67 const char *errstr;
63 const char *errstr_unpriv; 68 const char *errstr_unpriv;
69 uint32_t retval;
64 enum { 70 enum {
65 UNDEF, 71 UNDEF,
66 ACCEPT, 72 ACCEPT,
@@ -94,6 +100,326 @@ static struct bpf_test tests[] = {
94 BPF_EXIT_INSN(), 100 BPF_EXIT_INSN(),
95 }, 101 },
96 .result = ACCEPT, 102 .result = ACCEPT,
103 .retval = -3,
104 },
105 {
106 "DIV32 by 0, zero check 1",
107 .insns = {
108 BPF_MOV32_IMM(BPF_REG_0, 42),
109 BPF_MOV32_IMM(BPF_REG_1, 0),
110 BPF_MOV32_IMM(BPF_REG_2, 1),
111 BPF_ALU32_REG(BPF_DIV, BPF_REG_2, BPF_REG_1),
112 BPF_EXIT_INSN(),
113 },
114 .result = ACCEPT,
115 .retval = 42,
116 },
117 {
118 "DIV32 by 0, zero check 2",
119 .insns = {
120 BPF_MOV32_IMM(BPF_REG_0, 42),
121 BPF_LD_IMM64(BPF_REG_1, 0xffffffff00000000LL),
122 BPF_MOV32_IMM(BPF_REG_2, 1),
123 BPF_ALU32_REG(BPF_DIV, BPF_REG_2, BPF_REG_1),
124 BPF_EXIT_INSN(),
125 },
126 .result = ACCEPT,
127 .retval = 42,
128 },
129 {
130 "DIV64 by 0, zero check",
131 .insns = {
132 BPF_MOV32_IMM(BPF_REG_0, 42),
133 BPF_MOV32_IMM(BPF_REG_1, 0),
134 BPF_MOV32_IMM(BPF_REG_2, 1),
135 BPF_ALU64_REG(BPF_DIV, BPF_REG_2, BPF_REG_1),
136 BPF_EXIT_INSN(),
137 },
138 .result = ACCEPT,
139 .retval = 42,
140 },
141 {
142 "MOD32 by 0, zero check 1",
143 .insns = {
144 BPF_MOV32_IMM(BPF_REG_0, 42),
145 BPF_MOV32_IMM(BPF_REG_1, 0),
146 BPF_MOV32_IMM(BPF_REG_2, 1),
147 BPF_ALU32_REG(BPF_MOD, BPF_REG_2, BPF_REG_1),
148 BPF_EXIT_INSN(),
149 },
150 .result = ACCEPT,
151 .retval = 42,
152 },
153 {
154 "MOD32 by 0, zero check 2",
155 .insns = {
156 BPF_MOV32_IMM(BPF_REG_0, 42),
157 BPF_LD_IMM64(BPF_REG_1, 0xffffffff00000000LL),
158 BPF_MOV32_IMM(BPF_REG_2, 1),
159 BPF_ALU32_REG(BPF_MOD, BPF_REG_2, BPF_REG_1),
160 BPF_EXIT_INSN(),
161 },
162 .result = ACCEPT,
163 .retval = 42,
164 },
165 {
166 "MOD64 by 0, zero check",
167 .insns = {
168 BPF_MOV32_IMM(BPF_REG_0, 42),
169 BPF_MOV32_IMM(BPF_REG_1, 0),
170 BPF_MOV32_IMM(BPF_REG_2, 1),
171 BPF_ALU64_REG(BPF_MOD, BPF_REG_2, BPF_REG_1),
172 BPF_EXIT_INSN(),
173 },
174 .result = ACCEPT,
175 .retval = 42,
176 },
177 {
178 "DIV32 by 0, zero check ok, cls",
179 .insns = {
180 BPF_MOV32_IMM(BPF_REG_0, 42),
181 BPF_MOV32_IMM(BPF_REG_1, 2),
182 BPF_MOV32_IMM(BPF_REG_2, 16),
183 BPF_ALU32_REG(BPF_DIV, BPF_REG_2, BPF_REG_1),
184 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
185 BPF_EXIT_INSN(),
186 },
187 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
188 .result = ACCEPT,
189 .retval = 8,
190 },
191 {
192 "DIV32 by 0, zero check 1, cls",
193 .insns = {
194 BPF_MOV32_IMM(BPF_REG_1, 0),
195 BPF_MOV32_IMM(BPF_REG_0, 1),
196 BPF_ALU32_REG(BPF_DIV, BPF_REG_0, BPF_REG_1),
197 BPF_EXIT_INSN(),
198 },
199 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
200 .result = ACCEPT,
201 .retval = 0,
202 },
203 {
204 "DIV32 by 0, zero check 2, cls",
205 .insns = {
206 BPF_LD_IMM64(BPF_REG_1, 0xffffffff00000000LL),
207 BPF_MOV32_IMM(BPF_REG_0, 1),
208 BPF_ALU32_REG(BPF_DIV, BPF_REG_0, BPF_REG_1),
209 BPF_EXIT_INSN(),
210 },
211 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
212 .result = ACCEPT,
213 .retval = 0,
214 },
215 {
216 "DIV64 by 0, zero check, cls",
217 .insns = {
218 BPF_MOV32_IMM(BPF_REG_1, 0),
219 BPF_MOV32_IMM(BPF_REG_0, 1),
220 BPF_ALU64_REG(BPF_DIV, BPF_REG_0, BPF_REG_1),
221 BPF_EXIT_INSN(),
222 },
223 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
224 .result = ACCEPT,
225 .retval = 0,
226 },
227 {
228 "MOD32 by 0, zero check ok, cls",
229 .insns = {
230 BPF_MOV32_IMM(BPF_REG_0, 42),
231 BPF_MOV32_IMM(BPF_REG_1, 3),
232 BPF_MOV32_IMM(BPF_REG_2, 5),
233 BPF_ALU32_REG(BPF_MOD, BPF_REG_2, BPF_REG_1),
234 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
235 BPF_EXIT_INSN(),
236 },
237 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
238 .result = ACCEPT,
239 .retval = 2,
240 },
241 {
242 "MOD32 by 0, zero check 1, cls",
243 .insns = {
244 BPF_MOV32_IMM(BPF_REG_1, 0),
245 BPF_MOV32_IMM(BPF_REG_0, 1),
246 BPF_ALU32_REG(BPF_MOD, BPF_REG_0, BPF_REG_1),
247 BPF_EXIT_INSN(),
248 },
249 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
250 .result = ACCEPT,
251 .retval = 1,
252 },
253 {
254 "MOD32 by 0, zero check 2, cls",
255 .insns = {
256 BPF_LD_IMM64(BPF_REG_1, 0xffffffff00000000LL),
257 BPF_MOV32_IMM(BPF_REG_0, 1),
258 BPF_ALU32_REG(BPF_MOD, BPF_REG_0, BPF_REG_1),
259 BPF_EXIT_INSN(),
260 },
261 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
262 .result = ACCEPT,
263 .retval = 1,
264 },
265 {
266 "MOD64 by 0, zero check 1, cls",
267 .insns = {
268 BPF_MOV32_IMM(BPF_REG_1, 0),
269 BPF_MOV32_IMM(BPF_REG_0, 2),
270 BPF_ALU64_REG(BPF_MOD, BPF_REG_0, BPF_REG_1),
271 BPF_EXIT_INSN(),
272 },
273 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
274 .result = ACCEPT,
275 .retval = 2,
276 },
277 {
278 "MOD64 by 0, zero check 2, cls",
279 .insns = {
280 BPF_MOV32_IMM(BPF_REG_1, 0),
281 BPF_MOV32_IMM(BPF_REG_0, -1),
282 BPF_ALU64_REG(BPF_MOD, BPF_REG_0, BPF_REG_1),
283 BPF_EXIT_INSN(),
284 },
285 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
286 .result = ACCEPT,
287 .retval = -1,
288 },
289 /* Just make sure that JITs used udiv/umod as otherwise we get
290 * an exception from INT_MIN/-1 overflow similarly as with div
291 * by zero.
292 */
293 {
294 "DIV32 overflow, check 1",
295 .insns = {
296 BPF_MOV32_IMM(BPF_REG_1, -1),
297 BPF_MOV32_IMM(BPF_REG_0, INT_MIN),
298 BPF_ALU32_REG(BPF_DIV, BPF_REG_0, BPF_REG_1),
299 BPF_EXIT_INSN(),
300 },
301 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
302 .result = ACCEPT,
303 .retval = 0,
304 },
305 {
306 "DIV32 overflow, check 2",
307 .insns = {
308 BPF_MOV32_IMM(BPF_REG_0, INT_MIN),
309 BPF_ALU32_IMM(BPF_DIV, BPF_REG_0, -1),
310 BPF_EXIT_INSN(),
311 },
312 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
313 .result = ACCEPT,
314 .retval = 0,
315 },
316 {
317 "DIV64 overflow, check 1",
318 .insns = {
319 BPF_MOV64_IMM(BPF_REG_1, -1),
320 BPF_LD_IMM64(BPF_REG_0, LLONG_MIN),
321 BPF_ALU64_REG(BPF_DIV, BPF_REG_0, BPF_REG_1),
322 BPF_EXIT_INSN(),
323 },
324 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
325 .result = ACCEPT,
326 .retval = 0,
327 },
328 {
329 "DIV64 overflow, check 2",
330 .insns = {
331 BPF_LD_IMM64(BPF_REG_0, LLONG_MIN),
332 BPF_ALU64_IMM(BPF_DIV, BPF_REG_0, -1),
333 BPF_EXIT_INSN(),
334 },
335 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
336 .result = ACCEPT,
337 .retval = 0,
338 },
339 {
340 "MOD32 overflow, check 1",
341 .insns = {
342 BPF_MOV32_IMM(BPF_REG_1, -1),
343 BPF_MOV32_IMM(BPF_REG_0, INT_MIN),
344 BPF_ALU32_REG(BPF_MOD, BPF_REG_0, BPF_REG_1),
345 BPF_EXIT_INSN(),
346 },
347 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
348 .result = ACCEPT,
349 .retval = INT_MIN,
350 },
351 {
352 "MOD32 overflow, check 2",
353 .insns = {
354 BPF_MOV32_IMM(BPF_REG_0, INT_MIN),
355 BPF_ALU32_IMM(BPF_MOD, BPF_REG_0, -1),
356 BPF_EXIT_INSN(),
357 },
358 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
359 .result = ACCEPT,
360 .retval = INT_MIN,
361 },
362 {
363 "MOD64 overflow, check 1",
364 .insns = {
365 BPF_MOV64_IMM(BPF_REG_1, -1),
366 BPF_LD_IMM64(BPF_REG_2, LLONG_MIN),
367 BPF_MOV64_REG(BPF_REG_3, BPF_REG_2),
368 BPF_ALU64_REG(BPF_MOD, BPF_REG_2, BPF_REG_1),
369 BPF_MOV32_IMM(BPF_REG_0, 0),
370 BPF_JMP_REG(BPF_JNE, BPF_REG_3, BPF_REG_2, 1),
371 BPF_MOV32_IMM(BPF_REG_0, 1),
372 BPF_EXIT_INSN(),
373 },
374 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
375 .result = ACCEPT,
376 .retval = 1,
377 },
378 {
379 "MOD64 overflow, check 2",
380 .insns = {
381 BPF_LD_IMM64(BPF_REG_2, LLONG_MIN),
382 BPF_MOV64_REG(BPF_REG_3, BPF_REG_2),
383 BPF_ALU64_IMM(BPF_MOD, BPF_REG_2, -1),
384 BPF_MOV32_IMM(BPF_REG_0, 0),
385 BPF_JMP_REG(BPF_JNE, BPF_REG_3, BPF_REG_2, 1),
386 BPF_MOV32_IMM(BPF_REG_0, 1),
387 BPF_EXIT_INSN(),
388 },
389 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
390 .result = ACCEPT,
391 .retval = 1,
392 },
393 {
394 "xor32 zero extend check",
395 .insns = {
396 BPF_MOV32_IMM(BPF_REG_2, -1),
397 BPF_ALU64_IMM(BPF_LSH, BPF_REG_2, 32),
398 BPF_ALU64_IMM(BPF_OR, BPF_REG_2, 0xffff),
399 BPF_ALU32_REG(BPF_XOR, BPF_REG_2, BPF_REG_2),
400 BPF_MOV32_IMM(BPF_REG_0, 2),
401 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 0, 1),
402 BPF_MOV32_IMM(BPF_REG_0, 1),
403 BPF_EXIT_INSN(),
404 },
405 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
406 .result = ACCEPT,
407 .retval = 1,
408 },
409 {
410 "empty prog",
411 .insns = {
412 },
413 .errstr = "unknown opcode 00",
414 .result = REJECT,
415 },
416 {
417 "only exit insn",
418 .insns = {
419 BPF_EXIT_INSN(),
420 },
421 .errstr = "R0 !read_ok",
422 .result = REJECT,
97 }, 423 },
98 { 424 {
99 "unreachable", 425 "unreachable",
@@ -209,6 +535,7 @@ static struct bpf_test tests[] = {
209 BPF_EXIT_INSN(), 535 BPF_EXIT_INSN(),
210 }, 536 },
211 .result = ACCEPT, 537 .result = ACCEPT,
538 .retval = 1,
212 }, 539 },
213 { 540 {
214 "test8 ld_imm64", 541 "test8 ld_imm64",
@@ -280,7 +607,7 @@ static struct bpf_test tests[] = {
280 BPF_EXIT_INSN(), 607 BPF_EXIT_INSN(),
281 }, 608 },
282 .result = REJECT, 609 .result = REJECT,
283 .errstr = "BPF_ARSH not supported for 32 bit ALU", 610 .errstr = "unknown opcode c4",
284 }, 611 },
285 { 612 {
286 "arsh32 on reg", 613 "arsh32 on reg",
@@ -291,7 +618,7 @@ static struct bpf_test tests[] = {
291 BPF_EXIT_INSN(), 618 BPF_EXIT_INSN(),
292 }, 619 },
293 .result = REJECT, 620 .result = REJECT,
294 .errstr = "BPF_ARSH not supported for 32 bit ALU", 621 .errstr = "unknown opcode cc",
295 }, 622 },
296 { 623 {
297 "arsh64 on imm", 624 "arsh64 on imm",
@@ -317,7 +644,7 @@ static struct bpf_test tests[] = {
317 .insns = { 644 .insns = {
318 BPF_ALU64_REG(BPF_MOV, BPF_REG_0, BPF_REG_2), 645 BPF_ALU64_REG(BPF_MOV, BPF_REG_0, BPF_REG_2),
319 }, 646 },
320 .errstr = "jump out of range", 647 .errstr = "not an exit",
321 .result = REJECT, 648 .result = REJECT,
322 }, 649 },
323 { 650 {
@@ -407,7 +734,7 @@ static struct bpf_test tests[] = {
407 BPF_RAW_INSN(BPF_JMP | BPF_CALL | BPF_X, 0, 0, 0, 0), 734 BPF_RAW_INSN(BPF_JMP | BPF_CALL | BPF_X, 0, 0, 0, 0),
408 BPF_EXIT_INSN(), 735 BPF_EXIT_INSN(),
409 }, 736 },
410 .errstr = "BPF_CALL uses reserved", 737 .errstr = "unknown opcode 8d",
411 .result = REJECT, 738 .result = REJECT,
412 }, 739 },
413 { 740 {
@@ -516,6 +843,7 @@ static struct bpf_test tests[] = {
516 .errstr_unpriv = "R0 leaks addr", 843 .errstr_unpriv = "R0 leaks addr",
517 .result = ACCEPT, 844 .result = ACCEPT,
518 .result_unpriv = REJECT, 845 .result_unpriv = REJECT,
846 .retval = POINTER_VALUE,
519 }, 847 },
520 { 848 {
521 "check valid spill/fill, skb mark", 849 "check valid spill/fill, skb mark",
@@ -596,7 +924,7 @@ static struct bpf_test tests[] = {
596 BPF_RAW_INSN(0, 0, 0, 0, 0), 924 BPF_RAW_INSN(0, 0, 0, 0, 0),
597 BPF_EXIT_INSN(), 925 BPF_EXIT_INSN(),
598 }, 926 },
599 .errstr = "invalid BPF_LD_IMM", 927 .errstr = "unknown opcode 00",
600 .result = REJECT, 928 .result = REJECT,
601 }, 929 },
602 { 930 {
@@ -614,7 +942,7 @@ static struct bpf_test tests[] = {
614 BPF_RAW_INSN(-1, 0, 0, 0, 0), 942 BPF_RAW_INSN(-1, 0, 0, 0, 0),
615 BPF_EXIT_INSN(), 943 BPF_EXIT_INSN(),
616 }, 944 },
617 .errstr = "invalid BPF_ALU opcode f0", 945 .errstr = "unknown opcode ff",
618 .result = REJECT, 946 .result = REJECT,
619 }, 947 },
620 { 948 {
@@ -623,7 +951,7 @@ static struct bpf_test tests[] = {
623 BPF_RAW_INSN(-1, -1, -1, -1, -1), 951 BPF_RAW_INSN(-1, -1, -1, -1, -1),
624 BPF_EXIT_INSN(), 952 BPF_EXIT_INSN(),
625 }, 953 },
626 .errstr = "invalid BPF_ALU opcode f0", 954 .errstr = "unknown opcode ff",
627 .result = REJECT, 955 .result = REJECT,
628 }, 956 },
629 { 957 {
@@ -802,6 +1130,7 @@ static struct bpf_test tests[] = {
802 .errstr_unpriv = "R1 pointer comparison", 1130 .errstr_unpriv = "R1 pointer comparison",
803 .result_unpriv = REJECT, 1131 .result_unpriv = REJECT,
804 .result = ACCEPT, 1132 .result = ACCEPT,
1133 .retval = -ENOENT,
805 }, 1134 },
806 { 1135 {
807 "jump test 4", 1136 "jump test 4",
@@ -1822,6 +2151,7 @@ static struct bpf_test tests[] = {
1822 BPF_EXIT_INSN(), 2151 BPF_EXIT_INSN(),
1823 }, 2152 },
1824 .result = ACCEPT, 2153 .result = ACCEPT,
2154 .retval = 0xfaceb00c,
1825 }, 2155 },
1826 { 2156 {
1827 "PTR_TO_STACK store/load - bad alignment on off", 2157 "PTR_TO_STACK store/load - bad alignment on off",
@@ -1880,6 +2210,7 @@ static struct bpf_test tests[] = {
1880 .result = ACCEPT, 2210 .result = ACCEPT,
1881 .result_unpriv = REJECT, 2211 .result_unpriv = REJECT,
1882 .errstr_unpriv = "R0 leaks addr", 2212 .errstr_unpriv = "R0 leaks addr",
2213 .retval = POINTER_VALUE,
1883 }, 2214 },
1884 { 2215 {
1885 "unpriv: add const to pointer", 2216 "unpriv: add const to pointer",
@@ -2053,6 +2384,7 @@ static struct bpf_test tests[] = {
2053 BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_6, 0), 2384 BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_6, 0),
2054 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, 2385 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
2055 BPF_FUNC_get_hash_recalc), 2386 BPF_FUNC_get_hash_recalc),
2387 BPF_MOV64_IMM(BPF_REG_0, 0),
2056 BPF_EXIT_INSN(), 2388 BPF_EXIT_INSN(),
2057 }, 2389 },
2058 .result = ACCEPT, 2390 .result = ACCEPT,
@@ -2840,6 +3172,7 @@ static struct bpf_test tests[] = {
2840 }, 3172 },
2841 .result = ACCEPT, 3173 .result = ACCEPT,
2842 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 3174 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
3175 .retval = 1,
2843 }, 3176 },
2844 { 3177 {
2845 "direct packet access: test12 (and, good access)", 3178 "direct packet access: test12 (and, good access)",
@@ -2864,6 +3197,7 @@ static struct bpf_test tests[] = {
2864 }, 3197 },
2865 .result = ACCEPT, 3198 .result = ACCEPT,
2866 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 3199 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
3200 .retval = 1,
2867 }, 3201 },
2868 { 3202 {
2869 "direct packet access: test13 (branches, good access)", 3203 "direct packet access: test13 (branches, good access)",
@@ -2894,6 +3228,7 @@ static struct bpf_test tests[] = {
2894 }, 3228 },
2895 .result = ACCEPT, 3229 .result = ACCEPT,
2896 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 3230 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
3231 .retval = 1,
2897 }, 3232 },
2898 { 3233 {
2899 "direct packet access: test14 (pkt_ptr += 0, CONST_IMM, good access)", 3234 "direct packet access: test14 (pkt_ptr += 0, CONST_IMM, good access)",
@@ -2917,6 +3252,7 @@ static struct bpf_test tests[] = {
2917 }, 3252 },
2918 .result = ACCEPT, 3253 .result = ACCEPT,
2919 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 3254 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
3255 .retval = 1,
2920 }, 3256 },
2921 { 3257 {
2922 "direct packet access: test15 (spill with xadd)", 3258 "direct packet access: test15 (spill with xadd)",
@@ -3203,6 +3539,7 @@ static struct bpf_test tests[] = {
3203 }, 3539 },
3204 .result = ACCEPT, 3540 .result = ACCEPT,
3205 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 3541 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
3542 .retval = 1,
3206 }, 3543 },
3207 { 3544 {
3208 "direct packet access: test28 (marking on <=, bad access)", 3545 "direct packet access: test28 (marking on <=, bad access)",
@@ -5700,7 +6037,7 @@ static struct bpf_test tests[] = {
5700 "helper access to variable memory: size > 0 not allowed on NULL (ARG_PTR_TO_MEM_OR_NULL)", 6037 "helper access to variable memory: size > 0 not allowed on NULL (ARG_PTR_TO_MEM_OR_NULL)",
5701 .insns = { 6038 .insns = {
5702 BPF_MOV64_IMM(BPF_REG_1, 0), 6039 BPF_MOV64_IMM(BPF_REG_1, 0),
5703 BPF_MOV64_IMM(BPF_REG_2, 0), 6040 BPF_MOV64_IMM(BPF_REG_2, 1),
5704 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_2, -128), 6041 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_2, -128),
5705 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -128), 6042 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -128),
5706 BPF_ALU64_IMM(BPF_AND, BPF_REG_2, 64), 6043 BPF_ALU64_IMM(BPF_AND, BPF_REG_2, 64),
@@ -5822,6 +6159,7 @@ static struct bpf_test tests[] = {
5822 }, 6159 },
5823 .result = ACCEPT, 6160 .result = ACCEPT,
5824 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 6161 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
6162 .retval = 0 /* csum_diff of 64-byte packet */,
5825 }, 6163 },
5826 { 6164 {
5827 "helper access to variable memory: size = 0 not allowed on NULL (!ARG_PTR_TO_MEM_OR_NULL)", 6165 "helper access to variable memory: size = 0 not allowed on NULL (!ARG_PTR_TO_MEM_OR_NULL)",
@@ -5935,7 +6273,7 @@ static struct bpf_test tests[] = {
5935 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -24), 6273 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -24),
5936 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -16), 6274 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -16),
5937 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -8), 6275 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -8),
5938 BPF_MOV64_IMM(BPF_REG_2, 0), 6276 BPF_MOV64_IMM(BPF_REG_2, 1),
5939 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_2, -128), 6277 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_2, -128),
5940 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -128), 6278 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -128),
5941 BPF_ALU64_IMM(BPF_AND, BPF_REG_2, 63), 6279 BPF_ALU64_IMM(BPF_AND, BPF_REG_2, 63),
@@ -6190,6 +6528,7 @@ static struct bpf_test tests[] = {
6190 }, 6528 },
6191 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 6529 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
6192 .result = ACCEPT, 6530 .result = ACCEPT,
6531 .retval = 42 /* ultimate return value */,
6193 }, 6532 },
6194 { 6533 {
6195 "ld_ind: check calling conv, r1", 6534 "ld_ind: check calling conv, r1",
@@ -6261,6 +6600,7 @@ static struct bpf_test tests[] = {
6261 BPF_EXIT_INSN(), 6600 BPF_EXIT_INSN(),
6262 }, 6601 },
6263 .result = ACCEPT, 6602 .result = ACCEPT,
6603 .retval = 1,
6264 }, 6604 },
6265 { 6605 {
6266 "check bpf_perf_event_data->sample_period byte load permitted", 6606 "check bpf_perf_event_data->sample_period byte load permitted",
@@ -7248,6 +7588,7 @@ static struct bpf_test tests[] = {
7248 }, 7588 },
7249 .fixup_map1 = { 3 }, 7589 .fixup_map1 = { 3 },
7250 .result = ACCEPT, 7590 .result = ACCEPT,
7591 .retval = POINTER_VALUE,
7251 .result_unpriv = REJECT, 7592 .result_unpriv = REJECT,
7252 .errstr_unpriv = "R0 leaks addr as return value" 7593 .errstr_unpriv = "R0 leaks addr as return value"
7253 }, 7594 },
@@ -7268,6 +7609,7 @@ static struct bpf_test tests[] = {
7268 }, 7609 },
7269 .fixup_map1 = { 3 }, 7610 .fixup_map1 = { 3 },
7270 .result = ACCEPT, 7611 .result = ACCEPT,
7612 .retval = POINTER_VALUE,
7271 .result_unpriv = REJECT, 7613 .result_unpriv = REJECT,
7272 .errstr_unpriv = "R0 leaks addr as return value" 7614 .errstr_unpriv = "R0 leaks addr as return value"
7273 }, 7615 },
@@ -7434,10 +7776,24 @@ static struct bpf_test tests[] = {
7434 }, 7776 },
7435 BPF_EXIT_INSN(), 7777 BPF_EXIT_INSN(),
7436 }, 7778 },
7437 .errstr = "BPF_END uses reserved fields", 7779 .errstr = "unknown opcode d7",
7438 .result = REJECT, 7780 .result = REJECT,
7439 }, 7781 },
7440 { 7782 {
7783 "XDP, using ifindex from netdev",
7784 .insns = {
7785 BPF_MOV64_IMM(BPF_REG_0, 0),
7786 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
7787 offsetof(struct xdp_md, ingress_ifindex)),
7788 BPF_JMP_IMM(BPF_JLT, BPF_REG_2, 1, 1),
7789 BPF_MOV64_IMM(BPF_REG_0, 1),
7790 BPF_EXIT_INSN(),
7791 },
7792 .result = ACCEPT,
7793 .prog_type = BPF_PROG_TYPE_XDP,
7794 .retval = 1,
7795 },
7796 {
7441 "meta access, test1", 7797 "meta access, test1",
7442 .insns = { 7798 .insns = {
7443 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1, 7799 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
@@ -7709,6 +8065,7 @@ static struct bpf_test tests[] = {
7709 BPF_EXIT_INSN(), 8065 BPF_EXIT_INSN(),
7710 }, 8066 },
7711 .result = ACCEPT, 8067 .result = ACCEPT,
8068 .retval = TEST_DATA_LEN,
7712 .prog_type = BPF_PROG_TYPE_SCHED_CLS, 8069 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
7713 }, 8070 },
7714 { 8071 {
@@ -8656,6 +9013,7 @@ static struct bpf_test tests[] = {
8656 BPF_EXIT_INSN(), 9013 BPF_EXIT_INSN(),
8657 }, 9014 },
8658 .result = ACCEPT, 9015 .result = ACCEPT,
9016 .retval = 1,
8659 }, 9017 },
8660 { 9018 {
8661 "check deducing bounds from const, 3", 9019 "check deducing bounds from const, 3",
@@ -8826,6 +9184,1959 @@ static struct bpf_test tests[] = {
8826 .result = REJECT, 9184 .result = REJECT,
8827 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK, 9185 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
8828 }, 9186 },
9187 {
9188 "calls: basic sanity",
9189 .insns = {
9190 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9191 BPF_MOV64_IMM(BPF_REG_0, 1),
9192 BPF_EXIT_INSN(),
9193 BPF_MOV64_IMM(BPF_REG_0, 2),
9194 BPF_EXIT_INSN(),
9195 },
9196 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9197 .result = ACCEPT,
9198 },
9199 {
9200 "calls: not on unpriviledged",
9201 .insns = {
9202 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9203 BPF_MOV64_IMM(BPF_REG_0, 1),
9204 BPF_EXIT_INSN(),
9205 BPF_MOV64_IMM(BPF_REG_0, 2),
9206 BPF_EXIT_INSN(),
9207 },
9208 .errstr_unpriv = "function calls to other bpf functions are allowed for root only",
9209 .result_unpriv = REJECT,
9210 .result = ACCEPT,
9211 .retval = 1,
9212 },
9213 {
9214 "calls: div by 0 in subprog",
9215 .insns = {
9216 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9217 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 8),
9218 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9219 BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1,
9220 offsetof(struct __sk_buff, data_end)),
9221 BPF_MOV64_REG(BPF_REG_2, BPF_REG_0),
9222 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, 8),
9223 BPF_JMP_REG(BPF_JGT, BPF_REG_2, BPF_REG_1, 1),
9224 BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_0, 0),
9225 BPF_MOV64_IMM(BPF_REG_0, 1),
9226 BPF_EXIT_INSN(),
9227 BPF_MOV32_IMM(BPF_REG_2, 0),
9228 BPF_MOV32_IMM(BPF_REG_3, 1),
9229 BPF_ALU32_REG(BPF_DIV, BPF_REG_3, BPF_REG_2),
9230 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9231 offsetof(struct __sk_buff, data)),
9232 BPF_EXIT_INSN(),
9233 },
9234 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9235 .result = ACCEPT,
9236 .retval = 1,
9237 },
9238 {
9239 "calls: multiple ret types in subprog 1",
9240 .insns = {
9241 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9242 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 8),
9243 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9244 BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1,
9245 offsetof(struct __sk_buff, data_end)),
9246 BPF_MOV64_REG(BPF_REG_2, BPF_REG_0),
9247 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, 8),
9248 BPF_JMP_REG(BPF_JGT, BPF_REG_2, BPF_REG_1, 1),
9249 BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_0, 0),
9250 BPF_MOV64_IMM(BPF_REG_0, 1),
9251 BPF_EXIT_INSN(),
9252 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9253 offsetof(struct __sk_buff, data)),
9254 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
9255 BPF_MOV32_IMM(BPF_REG_0, 42),
9256 BPF_EXIT_INSN(),
9257 },
9258 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9259 .result = REJECT,
9260 .errstr = "R0 invalid mem access 'inv'",
9261 },
9262 {
9263 "calls: multiple ret types in subprog 2",
9264 .insns = {
9265 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9266 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 8),
9267 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9268 BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1,
9269 offsetof(struct __sk_buff, data_end)),
9270 BPF_MOV64_REG(BPF_REG_2, BPF_REG_0),
9271 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, 8),
9272 BPF_JMP_REG(BPF_JGT, BPF_REG_2, BPF_REG_1, 1),
9273 BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_0, 0),
9274 BPF_MOV64_IMM(BPF_REG_0, 1),
9275 BPF_EXIT_INSN(),
9276 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9277 offsetof(struct __sk_buff, data)),
9278 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9279 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 9),
9280 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
9281 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
9282 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
9283 BPF_LD_MAP_FD(BPF_REG_1, 0),
9284 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
9285 BPF_FUNC_map_lookup_elem),
9286 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
9287 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_6,
9288 offsetof(struct __sk_buff, data)),
9289 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 64),
9290 BPF_EXIT_INSN(),
9291 },
9292 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9293 .fixup_map1 = { 16 },
9294 .result = REJECT,
9295 .errstr = "R0 min value is outside of the array range",
9296 },
9297 {
9298 "calls: overlapping caller/callee",
9299 .insns = {
9300 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 0),
9301 BPF_MOV64_IMM(BPF_REG_0, 1),
9302 BPF_EXIT_INSN(),
9303 },
9304 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9305 .errstr = "last insn is not an exit or jmp",
9306 .result = REJECT,
9307 },
9308 {
9309 "calls: wrong recursive calls",
9310 .insns = {
9311 BPF_JMP_IMM(BPF_JA, 0, 0, 4),
9312 BPF_JMP_IMM(BPF_JA, 0, 0, 4),
9313 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -2),
9314 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -2),
9315 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -2),
9316 BPF_MOV64_IMM(BPF_REG_0, 1),
9317 BPF_EXIT_INSN(),
9318 },
9319 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9320 .errstr = "jump out of range",
9321 .result = REJECT,
9322 },
9323 {
9324 "calls: wrong src reg",
9325 .insns = {
9326 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 2, 0, 0),
9327 BPF_MOV64_IMM(BPF_REG_0, 1),
9328 BPF_EXIT_INSN(),
9329 },
9330 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9331 .errstr = "BPF_CALL uses reserved fields",
9332 .result = REJECT,
9333 },
9334 {
9335 "calls: wrong off value",
9336 .insns = {
9337 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, -1, 2),
9338 BPF_MOV64_IMM(BPF_REG_0, 1),
9339 BPF_EXIT_INSN(),
9340 BPF_MOV64_IMM(BPF_REG_0, 2),
9341 BPF_EXIT_INSN(),
9342 },
9343 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9344 .errstr = "BPF_CALL uses reserved fields",
9345 .result = REJECT,
9346 },
9347 {
9348 "calls: jump back loop",
9349 .insns = {
9350 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -1),
9351 BPF_MOV64_IMM(BPF_REG_0, 1),
9352 BPF_EXIT_INSN(),
9353 },
9354 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9355 .errstr = "back-edge from insn 0 to 0",
9356 .result = REJECT,
9357 },
9358 {
9359 "calls: conditional call",
9360 .insns = {
9361 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9362 offsetof(struct __sk_buff, mark)),
9363 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3),
9364 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9365 BPF_MOV64_IMM(BPF_REG_0, 1),
9366 BPF_EXIT_INSN(),
9367 BPF_MOV64_IMM(BPF_REG_0, 2),
9368 BPF_EXIT_INSN(),
9369 },
9370 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9371 .errstr = "jump out of range",
9372 .result = REJECT,
9373 },
9374 {
9375 "calls: conditional call 2",
9376 .insns = {
9377 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9378 offsetof(struct __sk_buff, mark)),
9379 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3),
9380 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
9381 BPF_MOV64_IMM(BPF_REG_0, 1),
9382 BPF_EXIT_INSN(),
9383 BPF_MOV64_IMM(BPF_REG_0, 2),
9384 BPF_EXIT_INSN(),
9385 BPF_MOV64_IMM(BPF_REG_0, 3),
9386 BPF_EXIT_INSN(),
9387 },
9388 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9389 .result = ACCEPT,
9390 },
9391 {
9392 "calls: conditional call 3",
9393 .insns = {
9394 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9395 offsetof(struct __sk_buff, mark)),
9396 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3),
9397 BPF_JMP_IMM(BPF_JA, 0, 0, 4),
9398 BPF_MOV64_IMM(BPF_REG_0, 1),
9399 BPF_EXIT_INSN(),
9400 BPF_MOV64_IMM(BPF_REG_0, 1),
9401 BPF_JMP_IMM(BPF_JA, 0, 0, -6),
9402 BPF_MOV64_IMM(BPF_REG_0, 3),
9403 BPF_JMP_IMM(BPF_JA, 0, 0, -6),
9404 },
9405 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9406 .errstr = "back-edge from insn",
9407 .result = REJECT,
9408 },
9409 {
9410 "calls: conditional call 4",
9411 .insns = {
9412 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9413 offsetof(struct __sk_buff, mark)),
9414 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3),
9415 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
9416 BPF_MOV64_IMM(BPF_REG_0, 1),
9417 BPF_EXIT_INSN(),
9418 BPF_MOV64_IMM(BPF_REG_0, 1),
9419 BPF_JMP_IMM(BPF_JA, 0, 0, -5),
9420 BPF_MOV64_IMM(BPF_REG_0, 3),
9421 BPF_EXIT_INSN(),
9422 },
9423 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9424 .result = ACCEPT,
9425 },
9426 {
9427 "calls: conditional call 5",
9428 .insns = {
9429 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9430 offsetof(struct __sk_buff, mark)),
9431 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3),
9432 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
9433 BPF_MOV64_IMM(BPF_REG_0, 1),
9434 BPF_EXIT_INSN(),
9435 BPF_MOV64_IMM(BPF_REG_0, 1),
9436 BPF_JMP_IMM(BPF_JA, 0, 0, -6),
9437 BPF_MOV64_IMM(BPF_REG_0, 3),
9438 BPF_EXIT_INSN(),
9439 },
9440 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9441 .errstr = "back-edge from insn",
9442 .result = REJECT,
9443 },
9444 {
9445 "calls: conditional call 6",
9446 .insns = {
9447 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9448 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, -2),
9449 BPF_EXIT_INSN(),
9450 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9451 offsetof(struct __sk_buff, mark)),
9452 BPF_EXIT_INSN(),
9453 },
9454 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9455 .errstr = "back-edge from insn",
9456 .result = REJECT,
9457 },
9458 {
9459 "calls: using r0 returned by callee",
9460 .insns = {
9461 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9462 BPF_EXIT_INSN(),
9463 BPF_MOV64_IMM(BPF_REG_0, 2),
9464 BPF_EXIT_INSN(),
9465 },
9466 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9467 .result = ACCEPT,
9468 },
9469 {
9470 "calls: using uninit r0 from callee",
9471 .insns = {
9472 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9473 BPF_EXIT_INSN(),
9474 BPF_EXIT_INSN(),
9475 },
9476 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9477 .errstr = "!read_ok",
9478 .result = REJECT,
9479 },
9480 {
9481 "calls: callee is using r1",
9482 .insns = {
9483 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9484 BPF_EXIT_INSN(),
9485 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9486 offsetof(struct __sk_buff, len)),
9487 BPF_EXIT_INSN(),
9488 },
9489 .prog_type = BPF_PROG_TYPE_SCHED_ACT,
9490 .result = ACCEPT,
9491 .retval = TEST_DATA_LEN,
9492 },
9493 {
9494 "calls: callee using args1",
9495 .insns = {
9496 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9497 BPF_EXIT_INSN(),
9498 BPF_MOV64_REG(BPF_REG_0, BPF_REG_1),
9499 BPF_EXIT_INSN(),
9500 },
9501 .errstr_unpriv = "allowed for root only",
9502 .result_unpriv = REJECT,
9503 .result = ACCEPT,
9504 .retval = POINTER_VALUE,
9505 },
9506 {
9507 "calls: callee using wrong args2",
9508 .insns = {
9509 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9510 BPF_EXIT_INSN(),
9511 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
9512 BPF_EXIT_INSN(),
9513 },
9514 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9515 .errstr = "R2 !read_ok",
9516 .result = REJECT,
9517 },
9518 {
9519 "calls: callee using two args",
9520 .insns = {
9521 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9522 BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_6,
9523 offsetof(struct __sk_buff, len)),
9524 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_6,
9525 offsetof(struct __sk_buff, len)),
9526 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9527 BPF_EXIT_INSN(),
9528 BPF_MOV64_REG(BPF_REG_0, BPF_REG_1),
9529 BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_2),
9530 BPF_EXIT_INSN(),
9531 },
9532 .errstr_unpriv = "allowed for root only",
9533 .result_unpriv = REJECT,
9534 .result = ACCEPT,
9535 .retval = TEST_DATA_LEN + TEST_DATA_LEN - ETH_HLEN - ETH_HLEN,
9536 },
9537 {
9538 "calls: callee changing pkt pointers",
9539 .insns = {
9540 BPF_LDX_MEM(BPF_W, BPF_REG_6, BPF_REG_1,
9541 offsetof(struct xdp_md, data)),
9542 BPF_LDX_MEM(BPF_W, BPF_REG_7, BPF_REG_1,
9543 offsetof(struct xdp_md, data_end)),
9544 BPF_MOV64_REG(BPF_REG_8, BPF_REG_6),
9545 BPF_ALU64_IMM(BPF_ADD, BPF_REG_8, 8),
9546 BPF_JMP_REG(BPF_JGT, BPF_REG_8, BPF_REG_7, 2),
9547 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9548 /* clear_all_pkt_pointers() has to walk all frames
9549 * to make sure that pkt pointers in the caller
9550 * are cleared when callee is calling a helper that
9551 * adjusts packet size
9552 */
9553 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_6, 0),
9554 BPF_MOV32_IMM(BPF_REG_0, 0),
9555 BPF_EXIT_INSN(),
9556 BPF_MOV64_IMM(BPF_REG_2, 0),
9557 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
9558 BPF_FUNC_xdp_adjust_head),
9559 BPF_EXIT_INSN(),
9560 },
9561 .result = REJECT,
9562 .errstr = "R6 invalid mem access 'inv'",
9563 .prog_type = BPF_PROG_TYPE_XDP,
9564 },
9565 {
9566 "calls: two calls with args",
9567 .insns = {
9568 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9569 BPF_EXIT_INSN(),
9570 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9571 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 6),
9572 BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
9573 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9574 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9575 BPF_ALU64_REG(BPF_ADD, BPF_REG_7, BPF_REG_0),
9576 BPF_MOV64_REG(BPF_REG_0, BPF_REG_7),
9577 BPF_EXIT_INSN(),
9578 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9579 offsetof(struct __sk_buff, len)),
9580 BPF_EXIT_INSN(),
9581 },
9582 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9583 .result = ACCEPT,
9584 .retval = TEST_DATA_LEN + TEST_DATA_LEN,
9585 },
9586 {
9587 "calls: calls with stack arith",
9588 .insns = {
9589 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
9590 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -64),
9591 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9592 BPF_EXIT_INSN(),
9593 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -64),
9594 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9595 BPF_EXIT_INSN(),
9596 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -64),
9597 BPF_MOV64_IMM(BPF_REG_0, 42),
9598 BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_0, 0),
9599 BPF_EXIT_INSN(),
9600 },
9601 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9602 .result = ACCEPT,
9603 .retval = 42,
9604 },
9605 {
9606 "calls: calls with misaligned stack access",
9607 .insns = {
9608 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
9609 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -63),
9610 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9611 BPF_EXIT_INSN(),
9612 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -61),
9613 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9614 BPF_EXIT_INSN(),
9615 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -63),
9616 BPF_MOV64_IMM(BPF_REG_0, 42),
9617 BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_0, 0),
9618 BPF_EXIT_INSN(),
9619 },
9620 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9621 .flags = F_LOAD_WITH_STRICT_ALIGNMENT,
9622 .errstr = "misaligned stack access",
9623 .result = REJECT,
9624 },
9625 {
9626 "calls: calls control flow, jump test",
9627 .insns = {
9628 BPF_MOV64_IMM(BPF_REG_0, 42),
9629 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
9630 BPF_MOV64_IMM(BPF_REG_0, 43),
9631 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
9632 BPF_JMP_IMM(BPF_JA, 0, 0, -3),
9633 BPF_EXIT_INSN(),
9634 },
9635 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9636 .result = ACCEPT,
9637 .retval = 43,
9638 },
9639 {
9640 "calls: calls control flow, jump test 2",
9641 .insns = {
9642 BPF_MOV64_IMM(BPF_REG_0, 42),
9643 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
9644 BPF_MOV64_IMM(BPF_REG_0, 43),
9645 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
9646 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -3),
9647 BPF_EXIT_INSN(),
9648 },
9649 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9650 .errstr = "jump out of range from insn 1 to 4",
9651 .result = REJECT,
9652 },
9653 {
9654 "calls: two calls with bad jump",
9655 .insns = {
9656 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9657 BPF_EXIT_INSN(),
9658 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9659 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 6),
9660 BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
9661 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9662 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9663 BPF_ALU64_REG(BPF_ADD, BPF_REG_7, BPF_REG_0),
9664 BPF_MOV64_REG(BPF_REG_0, BPF_REG_7),
9665 BPF_EXIT_INSN(),
9666 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9667 offsetof(struct __sk_buff, len)),
9668 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, -3),
9669 BPF_EXIT_INSN(),
9670 },
9671 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9672 .errstr = "jump out of range from insn 11 to 9",
9673 .result = REJECT,
9674 },
9675 {
9676 "calls: recursive call. test1",
9677 .insns = {
9678 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9679 BPF_EXIT_INSN(),
9680 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -1),
9681 BPF_EXIT_INSN(),
9682 },
9683 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9684 .errstr = "back-edge",
9685 .result = REJECT,
9686 },
9687 {
9688 "calls: recursive call. test2",
9689 .insns = {
9690 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9691 BPF_EXIT_INSN(),
9692 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -3),
9693 BPF_EXIT_INSN(),
9694 },
9695 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9696 .errstr = "back-edge",
9697 .result = REJECT,
9698 },
9699 {
9700 "calls: unreachable code",
9701 .insns = {
9702 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9703 BPF_EXIT_INSN(),
9704 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9705 BPF_EXIT_INSN(),
9706 BPF_MOV64_IMM(BPF_REG_0, 0),
9707 BPF_EXIT_INSN(),
9708 BPF_MOV64_IMM(BPF_REG_0, 0),
9709 BPF_EXIT_INSN(),
9710 },
9711 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9712 .errstr = "unreachable insn 6",
9713 .result = REJECT,
9714 },
9715 {
9716 "calls: invalid call",
9717 .insns = {
9718 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9719 BPF_EXIT_INSN(),
9720 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, -4),
9721 BPF_EXIT_INSN(),
9722 },
9723 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9724 .errstr = "invalid destination",
9725 .result = REJECT,
9726 },
9727 {
9728 "calls: invalid call 2",
9729 .insns = {
9730 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9731 BPF_EXIT_INSN(),
9732 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 0x7fffffff),
9733 BPF_EXIT_INSN(),
9734 },
9735 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9736 .errstr = "invalid destination",
9737 .result = REJECT,
9738 },
9739 {
9740 "calls: jumping across function bodies. test1",
9741 .insns = {
9742 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9743 BPF_MOV64_IMM(BPF_REG_0, 0),
9744 BPF_EXIT_INSN(),
9745 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, -3),
9746 BPF_EXIT_INSN(),
9747 },
9748 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9749 .errstr = "jump out of range",
9750 .result = REJECT,
9751 },
9752 {
9753 "calls: jumping across function bodies. test2",
9754 .insns = {
9755 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 3),
9756 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9757 BPF_MOV64_IMM(BPF_REG_0, 0),
9758 BPF_EXIT_INSN(),
9759 BPF_EXIT_INSN(),
9760 },
9761 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9762 .errstr = "jump out of range",
9763 .result = REJECT,
9764 },
9765 {
9766 "calls: call without exit",
9767 .insns = {
9768 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9769 BPF_EXIT_INSN(),
9770 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9771 BPF_EXIT_INSN(),
9772 BPF_MOV64_IMM(BPF_REG_0, 0),
9773 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, -2),
9774 },
9775 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9776 .errstr = "not an exit",
9777 .result = REJECT,
9778 },
9779 {
9780 "calls: call into middle of ld_imm64",
9781 .insns = {
9782 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9783 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9784 BPF_MOV64_IMM(BPF_REG_0, 0),
9785 BPF_EXIT_INSN(),
9786 BPF_LD_IMM64(BPF_REG_0, 0),
9787 BPF_EXIT_INSN(),
9788 },
9789 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9790 .errstr = "last insn",
9791 .result = REJECT,
9792 },
9793 {
9794 "calls: call into middle of other call",
9795 .insns = {
9796 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9797 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9798 BPF_MOV64_IMM(BPF_REG_0, 0),
9799 BPF_EXIT_INSN(),
9800 BPF_MOV64_IMM(BPF_REG_0, 0),
9801 BPF_MOV64_IMM(BPF_REG_0, 0),
9802 BPF_EXIT_INSN(),
9803 },
9804 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9805 .errstr = "last insn",
9806 .result = REJECT,
9807 },
9808 {
9809 "calls: ld_abs with changing ctx data in callee",
9810 .insns = {
9811 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9812 BPF_LD_ABS(BPF_B, 0),
9813 BPF_LD_ABS(BPF_H, 0),
9814 BPF_LD_ABS(BPF_W, 0),
9815 BPF_MOV64_REG(BPF_REG_7, BPF_REG_6),
9816 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 5),
9817 BPF_MOV64_REG(BPF_REG_6, BPF_REG_7),
9818 BPF_LD_ABS(BPF_B, 0),
9819 BPF_LD_ABS(BPF_H, 0),
9820 BPF_LD_ABS(BPF_W, 0),
9821 BPF_EXIT_INSN(),
9822 BPF_MOV64_IMM(BPF_REG_2, 1),
9823 BPF_MOV64_IMM(BPF_REG_3, 2),
9824 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
9825 BPF_FUNC_skb_vlan_push),
9826 BPF_EXIT_INSN(),
9827 },
9828 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
9829 .errstr = "BPF_LD_[ABS|IND] instructions cannot be mixed",
9830 .result = REJECT,
9831 },
9832 {
9833 "calls: two calls with bad fallthrough",
9834 .insns = {
9835 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9836 BPF_EXIT_INSN(),
9837 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9838 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 6),
9839 BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
9840 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9841 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9842 BPF_ALU64_REG(BPF_ADD, BPF_REG_7, BPF_REG_0),
9843 BPF_MOV64_REG(BPF_REG_0, BPF_REG_7),
9844 BPF_MOV64_REG(BPF_REG_0, BPF_REG_0),
9845 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1,
9846 offsetof(struct __sk_buff, len)),
9847 BPF_EXIT_INSN(),
9848 },
9849 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
9850 .errstr = "not an exit",
9851 .result = REJECT,
9852 },
9853 {
9854 "calls: two calls with stack read",
9855 .insns = {
9856 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
9857 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
9858 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
9859 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
9860 BPF_EXIT_INSN(),
9861 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9862 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 6),
9863 BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
9864 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9865 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
9866 BPF_ALU64_REG(BPF_ADD, BPF_REG_7, BPF_REG_0),
9867 BPF_MOV64_REG(BPF_REG_0, BPF_REG_7),
9868 BPF_EXIT_INSN(),
9869 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, 0),
9870 BPF_EXIT_INSN(),
9871 },
9872 .prog_type = BPF_PROG_TYPE_XDP,
9873 .result = ACCEPT,
9874 },
9875 {
9876 "calls: two calls with stack write",
9877 .insns = {
9878 /* main prog */
9879 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
9880 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
9881 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
9882 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
9883 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
9884 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
9885 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -16),
9886 BPF_EXIT_INSN(),
9887
9888 /* subprog 1 */
9889 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9890 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
9891 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 7),
9892 BPF_MOV64_REG(BPF_REG_8, BPF_REG_0),
9893 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9894 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
9895 BPF_ALU64_REG(BPF_ADD, BPF_REG_8, BPF_REG_0),
9896 BPF_MOV64_REG(BPF_REG_0, BPF_REG_8),
9897 /* write into stack frame of main prog */
9898 BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_0, 0),
9899 BPF_EXIT_INSN(),
9900
9901 /* subprog 2 */
9902 /* read from stack frame of main prog */
9903 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, 0),
9904 BPF_EXIT_INSN(),
9905 },
9906 .prog_type = BPF_PROG_TYPE_XDP,
9907 .result = ACCEPT,
9908 },
9909 {
9910 "calls: stack overflow using two frames (pre-call access)",
9911 .insns = {
9912 /* prog 1 */
9913 BPF_ST_MEM(BPF_B, BPF_REG_10, -300, 0),
9914 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1),
9915 BPF_EXIT_INSN(),
9916
9917 /* prog 2 */
9918 BPF_ST_MEM(BPF_B, BPF_REG_10, -300, 0),
9919 BPF_MOV64_IMM(BPF_REG_0, 0),
9920 BPF_EXIT_INSN(),
9921 },
9922 .prog_type = BPF_PROG_TYPE_XDP,
9923 .errstr = "combined stack size",
9924 .result = REJECT,
9925 },
9926 {
9927 "calls: stack overflow using two frames (post-call access)",
9928 .insns = {
9929 /* prog 1 */
9930 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 2),
9931 BPF_ST_MEM(BPF_B, BPF_REG_10, -300, 0),
9932 BPF_EXIT_INSN(),
9933
9934 /* prog 2 */
9935 BPF_ST_MEM(BPF_B, BPF_REG_10, -300, 0),
9936 BPF_MOV64_IMM(BPF_REG_0, 0),
9937 BPF_EXIT_INSN(),
9938 },
9939 .prog_type = BPF_PROG_TYPE_XDP,
9940 .errstr = "combined stack size",
9941 .result = REJECT,
9942 },
9943 {
9944 "calls: stack depth check using three frames. test1",
9945 .insns = {
9946 /* main */
9947 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 4), /* call A */
9948 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 5), /* call B */
9949 BPF_ST_MEM(BPF_B, BPF_REG_10, -32, 0),
9950 BPF_MOV64_IMM(BPF_REG_0, 0),
9951 BPF_EXIT_INSN(),
9952 /* A */
9953 BPF_ST_MEM(BPF_B, BPF_REG_10, -256, 0),
9954 BPF_EXIT_INSN(),
9955 /* B */
9956 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, -3), /* call A */
9957 BPF_ST_MEM(BPF_B, BPF_REG_10, -64, 0),
9958 BPF_EXIT_INSN(),
9959 },
9960 .prog_type = BPF_PROG_TYPE_XDP,
9961 /* stack_main=32, stack_A=256, stack_B=64
9962 * and max(main+A, main+A+B) < 512
9963 */
9964 .result = ACCEPT,
9965 },
9966 {
9967 "calls: stack depth check using three frames. test2",
9968 .insns = {
9969 /* main */
9970 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 4), /* call A */
9971 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 5), /* call B */
9972 BPF_ST_MEM(BPF_B, BPF_REG_10, -32, 0),
9973 BPF_MOV64_IMM(BPF_REG_0, 0),
9974 BPF_EXIT_INSN(),
9975 /* A */
9976 BPF_ST_MEM(BPF_B, BPF_REG_10, -64, 0),
9977 BPF_EXIT_INSN(),
9978 /* B */
9979 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, -3), /* call A */
9980 BPF_ST_MEM(BPF_B, BPF_REG_10, -256, 0),
9981 BPF_EXIT_INSN(),
9982 },
9983 .prog_type = BPF_PROG_TYPE_XDP,
9984 /* stack_main=32, stack_A=64, stack_B=256
9985 * and max(main+A, main+A+B) < 512
9986 */
9987 .result = ACCEPT,
9988 },
9989 {
9990 "calls: stack depth check using three frames. test3",
9991 .insns = {
9992 /* main */
9993 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
9994 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 6), /* call A */
9995 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
9996 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 8), /* call B */
9997 BPF_JMP_IMM(BPF_JGE, BPF_REG_6, 0, 1),
9998 BPF_ST_MEM(BPF_B, BPF_REG_10, -64, 0),
9999 BPF_MOV64_IMM(BPF_REG_0, 0),
10000 BPF_EXIT_INSN(),
10001 /* A */
10002 BPF_JMP_IMM(BPF_JLT, BPF_REG_1, 10, 1),
10003 BPF_EXIT_INSN(),
10004 BPF_ST_MEM(BPF_B, BPF_REG_10, -224, 0),
10005 BPF_JMP_IMM(BPF_JA, 0, 0, -3),
10006 /* B */
10007 BPF_JMP_IMM(BPF_JGT, BPF_REG_1, 2, 1),
10008 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, -6), /* call A */
10009 BPF_ST_MEM(BPF_B, BPF_REG_10, -256, 0),
10010 BPF_EXIT_INSN(),
10011 },
10012 .prog_type = BPF_PROG_TYPE_XDP,
10013 /* stack_main=64, stack_A=224, stack_B=256
10014 * and max(main+A, main+A+B) > 512
10015 */
10016 .errstr = "combined stack",
10017 .result = REJECT,
10018 },
10019 {
10020 "calls: stack depth check using three frames. test4",
10021 /* void main(void) {
10022 * func1(0);
10023 * func1(1);
10024 * func2(1);
10025 * }
10026 * void func1(int alloc_or_recurse) {
10027 * if (alloc_or_recurse) {
10028 * frame_pointer[-300] = 1;
10029 * } else {
10030 * func2(alloc_or_recurse);
10031 * }
10032 * }
10033 * void func2(int alloc_or_recurse) {
10034 * if (alloc_or_recurse) {
10035 * frame_pointer[-300] = 1;
10036 * }
10037 * }
10038 */
10039 .insns = {
10040 /* main */
10041 BPF_MOV64_IMM(BPF_REG_1, 0),
10042 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 6), /* call A */
10043 BPF_MOV64_IMM(BPF_REG_1, 1),
10044 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 4), /* call A */
10045 BPF_MOV64_IMM(BPF_REG_1, 1),
10046 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 7), /* call B */
10047 BPF_MOV64_IMM(BPF_REG_0, 0),
10048 BPF_EXIT_INSN(),
10049 /* A */
10050 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 2),
10051 BPF_ST_MEM(BPF_B, BPF_REG_10, -300, 0),
10052 BPF_EXIT_INSN(),
10053 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call B */
10054 BPF_EXIT_INSN(),
10055 /* B */
10056 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 1),
10057 BPF_ST_MEM(BPF_B, BPF_REG_10, -300, 0),
10058 BPF_EXIT_INSN(),
10059 },
10060 .prog_type = BPF_PROG_TYPE_XDP,
10061 .result = REJECT,
10062 .errstr = "combined stack",
10063 },
10064 {
10065 "calls: stack depth check using three frames. test5",
10066 .insns = {
10067 /* main */
10068 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call A */
10069 BPF_EXIT_INSN(),
10070 /* A */
10071 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call B */
10072 BPF_EXIT_INSN(),
10073 /* B */
10074 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call C */
10075 BPF_EXIT_INSN(),
10076 /* C */
10077 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call D */
10078 BPF_EXIT_INSN(),
10079 /* D */
10080 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call E */
10081 BPF_EXIT_INSN(),
10082 /* E */
10083 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call F */
10084 BPF_EXIT_INSN(),
10085 /* F */
10086 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call G */
10087 BPF_EXIT_INSN(),
10088 /* G */
10089 BPF_RAW_INSN(BPF_JMP|BPF_CALL, 0, 1, 0, 1), /* call H */
10090 BPF_EXIT_INSN(),
10091 /* H */
10092 BPF_MOV64_IMM(BPF_REG_0, 0),
10093 BPF_EXIT_INSN(),
10094 },
10095 .prog_type = BPF_PROG_TYPE_XDP,
10096 .errstr = "call stack",
10097 .result = REJECT,
10098 },
10099 {
10100 "calls: spill into caller stack frame",
10101 .insns = {
10102 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10103 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10104 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10105 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
10106 BPF_EXIT_INSN(),
10107 BPF_STX_MEM(BPF_DW, BPF_REG_1, BPF_REG_1, 0),
10108 BPF_MOV64_IMM(BPF_REG_0, 0),
10109 BPF_EXIT_INSN(),
10110 },
10111 .prog_type = BPF_PROG_TYPE_XDP,
10112 .errstr = "cannot spill",
10113 .result = REJECT,
10114 },
10115 {
10116 "calls: write into caller stack frame",
10117 .insns = {
10118 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10119 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10120 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10121 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10122 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_6, 0),
10123 BPF_EXIT_INSN(),
10124 BPF_ST_MEM(BPF_DW, BPF_REG_1, 0, 42),
10125 BPF_MOV64_IMM(BPF_REG_0, 0),
10126 BPF_EXIT_INSN(),
10127 },
10128 .prog_type = BPF_PROG_TYPE_XDP,
10129 .result = ACCEPT,
10130 .retval = 42,
10131 },
10132 {
10133 "calls: write into callee stack frame",
10134 .insns = {
10135 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10136 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 42),
10137 BPF_EXIT_INSN(),
10138 BPF_MOV64_REG(BPF_REG_0, BPF_REG_10),
10139 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, -8),
10140 BPF_EXIT_INSN(),
10141 },
10142 .prog_type = BPF_PROG_TYPE_XDP,
10143 .errstr = "cannot return stack pointer",
10144 .result = REJECT,
10145 },
10146 {
10147 "calls: two calls with stack write and void return",
10148 .insns = {
10149 /* main prog */
10150 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10151 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10152 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10153 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10154 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10155 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10156 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -16),
10157 BPF_EXIT_INSN(),
10158
10159 /* subprog 1 */
10160 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10161 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10162 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10163 BPF_MOV64_REG(BPF_REG_1, BPF_REG_7),
10164 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
10165 BPF_EXIT_INSN(),
10166
10167 /* subprog 2 */
10168 /* write into stack frame of main prog */
10169 BPF_ST_MEM(BPF_DW, BPF_REG_1, 0, 0),
10170 BPF_EXIT_INSN(), /* void return */
10171 },
10172 .prog_type = BPF_PROG_TYPE_XDP,
10173 .result = ACCEPT,
10174 },
10175 {
10176 "calls: ambiguous return value",
10177 .insns = {
10178 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10179 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 5),
10180 BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
10181 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
10182 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10183 BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
10184 BPF_EXIT_INSN(),
10185 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 1),
10186 BPF_MOV64_IMM(BPF_REG_0, 0),
10187 BPF_EXIT_INSN(),
10188 },
10189 .errstr_unpriv = "allowed for root only",
10190 .result_unpriv = REJECT,
10191 .errstr = "R0 !read_ok",
10192 .result = REJECT,
10193 },
10194 {
10195 "calls: two calls that return map_value",
10196 .insns = {
10197 /* main prog */
10198 /* pass fp-16, fp-8 into a function */
10199 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10200 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10201 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10202 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10203 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 8),
10204
10205 /* fetch map_value_ptr from the stack of this function */
10206 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -8),
10207 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1),
10208 /* write into map value */
10209 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10210 /* fetch secound map_value_ptr from the stack */
10211 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -16),
10212 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1),
10213 /* write into map value */
10214 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10215 BPF_MOV64_IMM(BPF_REG_0, 0),
10216 BPF_EXIT_INSN(),
10217
10218 /* subprog 1 */
10219 /* call 3rd function twice */
10220 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10221 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10222 /* first time with fp-8 */
10223 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10224 BPF_MOV64_REG(BPF_REG_1, BPF_REG_7),
10225 /* second time with fp-16 */
10226 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
10227 BPF_EXIT_INSN(),
10228
10229 /* subprog 2 */
10230 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10231 /* lookup from map */
10232 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10233 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10234 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10235 BPF_LD_MAP_FD(BPF_REG_1, 0),
10236 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10237 BPF_FUNC_map_lookup_elem),
10238 /* write map_value_ptr into stack frame of main prog */
10239 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10240 BPF_MOV64_IMM(BPF_REG_0, 0),
10241 BPF_EXIT_INSN(), /* return 0 */
10242 },
10243 .prog_type = BPF_PROG_TYPE_XDP,
10244 .fixup_map1 = { 23 },
10245 .result = ACCEPT,
10246 },
10247 {
10248 "calls: two calls that return map_value with bool condition",
10249 .insns = {
10250 /* main prog */
10251 /* pass fp-16, fp-8 into a function */
10252 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10253 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10254 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10255 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10256 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10257 BPF_MOV64_IMM(BPF_REG_0, 0),
10258 BPF_EXIT_INSN(),
10259
10260 /* subprog 1 */
10261 /* call 3rd function twice */
10262 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10263 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10264 /* first time with fp-8 */
10265 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 9),
10266 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 1, 2),
10267 /* fetch map_value_ptr from the stack of this function */
10268 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_6, 0),
10269 /* write into map value */
10270 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10271 BPF_MOV64_REG(BPF_REG_1, BPF_REG_7),
10272 /* second time with fp-16 */
10273 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
10274 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 1, 2),
10275 /* fetch secound map_value_ptr from the stack */
10276 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_7, 0),
10277 /* write into map value */
10278 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10279 BPF_EXIT_INSN(),
10280
10281 /* subprog 2 */
10282 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10283 /* lookup from map */
10284 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10285 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10286 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10287 BPF_LD_MAP_FD(BPF_REG_1, 0),
10288 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10289 BPF_FUNC_map_lookup_elem),
10290 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10291 BPF_MOV64_IMM(BPF_REG_0, 0),
10292 BPF_EXIT_INSN(), /* return 0 */
10293 /* write map_value_ptr into stack frame of main prog */
10294 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10295 BPF_MOV64_IMM(BPF_REG_0, 1),
10296 BPF_EXIT_INSN(), /* return 1 */
10297 },
10298 .prog_type = BPF_PROG_TYPE_XDP,
10299 .fixup_map1 = { 23 },
10300 .result = ACCEPT,
10301 },
10302 {
10303 "calls: two calls that return map_value with incorrect bool check",
10304 .insns = {
10305 /* main prog */
10306 /* pass fp-16, fp-8 into a function */
10307 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10308 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10309 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10310 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10311 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10312 BPF_MOV64_IMM(BPF_REG_0, 0),
10313 BPF_EXIT_INSN(),
10314
10315 /* subprog 1 */
10316 /* call 3rd function twice */
10317 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10318 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10319 /* first time with fp-8 */
10320 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 9),
10321 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 1, 2),
10322 /* fetch map_value_ptr from the stack of this function */
10323 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_6, 0),
10324 /* write into map value */
10325 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10326 BPF_MOV64_REG(BPF_REG_1, BPF_REG_7),
10327 /* second time with fp-16 */
10328 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
10329 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10330 /* fetch secound map_value_ptr from the stack */
10331 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_7, 0),
10332 /* write into map value */
10333 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10334 BPF_EXIT_INSN(),
10335
10336 /* subprog 2 */
10337 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10338 /* lookup from map */
10339 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10340 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10341 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10342 BPF_LD_MAP_FD(BPF_REG_1, 0),
10343 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10344 BPF_FUNC_map_lookup_elem),
10345 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10346 BPF_MOV64_IMM(BPF_REG_0, 0),
10347 BPF_EXIT_INSN(), /* return 0 */
10348 /* write map_value_ptr into stack frame of main prog */
10349 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10350 BPF_MOV64_IMM(BPF_REG_0, 1),
10351 BPF_EXIT_INSN(), /* return 1 */
10352 },
10353 .prog_type = BPF_PROG_TYPE_XDP,
10354 .fixup_map1 = { 23 },
10355 .result = REJECT,
10356 .errstr = "invalid read from stack off -16+0 size 8",
10357 },
10358 {
10359 "calls: two calls that receive map_value via arg=ptr_stack_of_caller. test1",
10360 .insns = {
10361 /* main prog */
10362 /* pass fp-16, fp-8 into a function */
10363 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10364 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10365 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10366 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10367 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10368 BPF_MOV64_IMM(BPF_REG_0, 0),
10369 BPF_EXIT_INSN(),
10370
10371 /* subprog 1 */
10372 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10373 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10374 /* 1st lookup from map */
10375 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10376 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10377 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10378 BPF_LD_MAP_FD(BPF_REG_1, 0),
10379 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10380 BPF_FUNC_map_lookup_elem),
10381 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10382 BPF_MOV64_IMM(BPF_REG_8, 0),
10383 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
10384 /* write map_value_ptr into stack frame of main prog at fp-8 */
10385 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10386 BPF_MOV64_IMM(BPF_REG_8, 1),
10387
10388 /* 2nd lookup from map */
10389 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), /* 20 */
10390 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10391 BPF_LD_MAP_FD(BPF_REG_1, 0),
10392 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, /* 24 */
10393 BPF_FUNC_map_lookup_elem),
10394 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10395 BPF_MOV64_IMM(BPF_REG_9, 0),
10396 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
10397 /* write map_value_ptr into stack frame of main prog at fp-16 */
10398 BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_0, 0),
10399 BPF_MOV64_IMM(BPF_REG_9, 1),
10400
10401 /* call 3rd func with fp-8, 0|1, fp-16, 0|1 */
10402 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6), /* 30 */
10403 BPF_MOV64_REG(BPF_REG_2, BPF_REG_8),
10404 BPF_MOV64_REG(BPF_REG_3, BPF_REG_7),
10405 BPF_MOV64_REG(BPF_REG_4, BPF_REG_9),
10406 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1), /* 34 */
10407 BPF_EXIT_INSN(),
10408
10409 /* subprog 2 */
10410 /* if arg2 == 1 do *arg1 = 0 */
10411 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 1, 2),
10412 /* fetch map_value_ptr from the stack of this function */
10413 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0),
10414 /* write into map value */
10415 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10416
10417 /* if arg4 == 1 do *arg3 = 0 */
10418 BPF_JMP_IMM(BPF_JNE, BPF_REG_4, 1, 2),
10419 /* fetch map_value_ptr from the stack of this function */
10420 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_3, 0),
10421 /* write into map value */
10422 BPF_ST_MEM(BPF_DW, BPF_REG_0, 2, 0),
10423 BPF_EXIT_INSN(),
10424 },
10425 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10426 .fixup_map1 = { 12, 22 },
10427 .result = REJECT,
10428 .errstr = "invalid access to map value, value_size=8 off=2 size=8",
10429 },
10430 {
10431 "calls: two calls that receive map_value via arg=ptr_stack_of_caller. test2",
10432 .insns = {
10433 /* main prog */
10434 /* pass fp-16, fp-8 into a function */
10435 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10436 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10437 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10438 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10439 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10440 BPF_MOV64_IMM(BPF_REG_0, 0),
10441 BPF_EXIT_INSN(),
10442
10443 /* subprog 1 */
10444 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10445 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10446 /* 1st lookup from map */
10447 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10448 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10449 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10450 BPF_LD_MAP_FD(BPF_REG_1, 0),
10451 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10452 BPF_FUNC_map_lookup_elem),
10453 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10454 BPF_MOV64_IMM(BPF_REG_8, 0),
10455 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
10456 /* write map_value_ptr into stack frame of main prog at fp-8 */
10457 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10458 BPF_MOV64_IMM(BPF_REG_8, 1),
10459
10460 /* 2nd lookup from map */
10461 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), /* 20 */
10462 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10463 BPF_LD_MAP_FD(BPF_REG_1, 0),
10464 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, /* 24 */
10465 BPF_FUNC_map_lookup_elem),
10466 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10467 BPF_MOV64_IMM(BPF_REG_9, 0),
10468 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
10469 /* write map_value_ptr into stack frame of main prog at fp-16 */
10470 BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_0, 0),
10471 BPF_MOV64_IMM(BPF_REG_9, 1),
10472
10473 /* call 3rd func with fp-8, 0|1, fp-16, 0|1 */
10474 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6), /* 30 */
10475 BPF_MOV64_REG(BPF_REG_2, BPF_REG_8),
10476 BPF_MOV64_REG(BPF_REG_3, BPF_REG_7),
10477 BPF_MOV64_REG(BPF_REG_4, BPF_REG_9),
10478 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1), /* 34 */
10479 BPF_EXIT_INSN(),
10480
10481 /* subprog 2 */
10482 /* if arg2 == 1 do *arg1 = 0 */
10483 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 1, 2),
10484 /* fetch map_value_ptr from the stack of this function */
10485 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0),
10486 /* write into map value */
10487 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10488
10489 /* if arg4 == 1 do *arg3 = 0 */
10490 BPF_JMP_IMM(BPF_JNE, BPF_REG_4, 1, 2),
10491 /* fetch map_value_ptr from the stack of this function */
10492 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_3, 0),
10493 /* write into map value */
10494 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10495 BPF_EXIT_INSN(),
10496 },
10497 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10498 .fixup_map1 = { 12, 22 },
10499 .result = ACCEPT,
10500 },
10501 {
10502 "calls: two jumps that receive map_value via arg=ptr_stack_of_jumper. test3",
10503 .insns = {
10504 /* main prog */
10505 /* pass fp-16, fp-8 into a function */
10506 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10507 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10508 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10509 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10510 BPF_JMP_IMM(BPF_JNE, BPF_REG_1, 0, 2),
10511 BPF_MOV64_IMM(BPF_REG_0, 0),
10512 BPF_EXIT_INSN(),
10513
10514 /* subprog 1 */
10515 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10516 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10517 /* 1st lookup from map */
10518 BPF_ST_MEM(BPF_DW, BPF_REG_10, -24, 0),
10519 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10520 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -24),
10521 BPF_LD_MAP_FD(BPF_REG_1, 0),
10522 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10523 BPF_FUNC_map_lookup_elem),
10524 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10525 BPF_MOV64_IMM(BPF_REG_8, 0),
10526 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
10527 /* write map_value_ptr into stack frame of main prog at fp-8 */
10528 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10529 BPF_MOV64_IMM(BPF_REG_8, 1),
10530
10531 /* 2nd lookup from map */
10532 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10533 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -24),
10534 BPF_LD_MAP_FD(BPF_REG_1, 0),
10535 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10536 BPF_FUNC_map_lookup_elem),
10537 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10538 BPF_MOV64_IMM(BPF_REG_9, 0), // 26
10539 BPF_JMP_IMM(BPF_JA, 0, 0, 2),
10540 /* write map_value_ptr into stack frame of main prog at fp-16 */
10541 BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_0, 0),
10542 BPF_MOV64_IMM(BPF_REG_9, 1),
10543
10544 /* call 3rd func with fp-8, 0|1, fp-16, 0|1 */
10545 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6), // 30
10546 BPF_MOV64_REG(BPF_REG_2, BPF_REG_8),
10547 BPF_MOV64_REG(BPF_REG_3, BPF_REG_7),
10548 BPF_MOV64_REG(BPF_REG_4, BPF_REG_9),
10549 BPF_JMP_IMM(BPF_JNE, BPF_REG_1, 0, 1), // 34
10550 BPF_JMP_IMM(BPF_JA, 0, 0, -30),
10551
10552 /* subprog 2 */
10553 /* if arg2 == 1 do *arg1 = 0 */
10554 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 1, 2),
10555 /* fetch map_value_ptr from the stack of this function */
10556 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0),
10557 /* write into map value */
10558 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10559
10560 /* if arg4 == 1 do *arg3 = 0 */
10561 BPF_JMP_IMM(BPF_JNE, BPF_REG_4, 1, 2),
10562 /* fetch map_value_ptr from the stack of this function */
10563 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_3, 0),
10564 /* write into map value */
10565 BPF_ST_MEM(BPF_DW, BPF_REG_0, 2, 0),
10566 BPF_JMP_IMM(BPF_JA, 0, 0, -8),
10567 },
10568 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10569 .fixup_map1 = { 12, 22 },
10570 .result = REJECT,
10571 .errstr = "invalid access to map value, value_size=8 off=2 size=8",
10572 },
10573 {
10574 "calls: two calls that receive map_value_ptr_or_null via arg. test1",
10575 .insns = {
10576 /* main prog */
10577 /* pass fp-16, fp-8 into a function */
10578 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10579 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10580 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10581 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10582 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10583 BPF_MOV64_IMM(BPF_REG_0, 0),
10584 BPF_EXIT_INSN(),
10585
10586 /* subprog 1 */
10587 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10588 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10589 /* 1st lookup from map */
10590 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10591 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10592 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10593 BPF_LD_MAP_FD(BPF_REG_1, 0),
10594 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10595 BPF_FUNC_map_lookup_elem),
10596 /* write map_value_ptr_or_null into stack frame of main prog at fp-8 */
10597 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10598 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10599 BPF_MOV64_IMM(BPF_REG_8, 0),
10600 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
10601 BPF_MOV64_IMM(BPF_REG_8, 1),
10602
10603 /* 2nd lookup from map */
10604 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10605 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10606 BPF_LD_MAP_FD(BPF_REG_1, 0),
10607 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10608 BPF_FUNC_map_lookup_elem),
10609 /* write map_value_ptr_or_null into stack frame of main prog at fp-16 */
10610 BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_0, 0),
10611 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10612 BPF_MOV64_IMM(BPF_REG_9, 0),
10613 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
10614 BPF_MOV64_IMM(BPF_REG_9, 1),
10615
10616 /* call 3rd func with fp-8, 0|1, fp-16, 0|1 */
10617 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
10618 BPF_MOV64_REG(BPF_REG_2, BPF_REG_8),
10619 BPF_MOV64_REG(BPF_REG_3, BPF_REG_7),
10620 BPF_MOV64_REG(BPF_REG_4, BPF_REG_9),
10621 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
10622 BPF_EXIT_INSN(),
10623
10624 /* subprog 2 */
10625 /* if arg2 == 1 do *arg1 = 0 */
10626 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 1, 2),
10627 /* fetch map_value_ptr from the stack of this function */
10628 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0),
10629 /* write into map value */
10630 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10631
10632 /* if arg4 == 1 do *arg3 = 0 */
10633 BPF_JMP_IMM(BPF_JNE, BPF_REG_4, 1, 2),
10634 /* fetch map_value_ptr from the stack of this function */
10635 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_3, 0),
10636 /* write into map value */
10637 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10638 BPF_EXIT_INSN(),
10639 },
10640 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10641 .fixup_map1 = { 12, 22 },
10642 .result = ACCEPT,
10643 },
10644 {
10645 "calls: two calls that receive map_value_ptr_or_null via arg. test2",
10646 .insns = {
10647 /* main prog */
10648 /* pass fp-16, fp-8 into a function */
10649 BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
10650 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8),
10651 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10652 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -16),
10653 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 2),
10654 BPF_MOV64_IMM(BPF_REG_0, 0),
10655 BPF_EXIT_INSN(),
10656
10657 /* subprog 1 */
10658 BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
10659 BPF_MOV64_REG(BPF_REG_7, BPF_REG_2),
10660 /* 1st lookup from map */
10661 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
10662 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10663 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10664 BPF_LD_MAP_FD(BPF_REG_1, 0),
10665 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10666 BPF_FUNC_map_lookup_elem),
10667 /* write map_value_ptr_or_null into stack frame of main prog at fp-8 */
10668 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
10669 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10670 BPF_MOV64_IMM(BPF_REG_8, 0),
10671 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
10672 BPF_MOV64_IMM(BPF_REG_8, 1),
10673
10674 /* 2nd lookup from map */
10675 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
10676 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
10677 BPF_LD_MAP_FD(BPF_REG_1, 0),
10678 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
10679 BPF_FUNC_map_lookup_elem),
10680 /* write map_value_ptr_or_null into stack frame of main prog at fp-16 */
10681 BPF_STX_MEM(BPF_DW, BPF_REG_7, BPF_REG_0, 0),
10682 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2),
10683 BPF_MOV64_IMM(BPF_REG_9, 0),
10684 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
10685 BPF_MOV64_IMM(BPF_REG_9, 1),
10686
10687 /* call 3rd func with fp-8, 0|1, fp-16, 0|1 */
10688 BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
10689 BPF_MOV64_REG(BPF_REG_2, BPF_REG_8),
10690 BPF_MOV64_REG(BPF_REG_3, BPF_REG_7),
10691 BPF_MOV64_REG(BPF_REG_4, BPF_REG_9),
10692 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
10693 BPF_EXIT_INSN(),
10694
10695 /* subprog 2 */
10696 /* if arg2 == 1 do *arg1 = 0 */
10697 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 1, 2),
10698 /* fetch map_value_ptr from the stack of this function */
10699 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0),
10700 /* write into map value */
10701 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10702
10703 /* if arg4 == 0 do *arg3 = 0 */
10704 BPF_JMP_IMM(BPF_JNE, BPF_REG_4, 0, 2),
10705 /* fetch map_value_ptr from the stack of this function */
10706 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_3, 0),
10707 /* write into map value */
10708 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0),
10709 BPF_EXIT_INSN(),
10710 },
10711 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10712 .fixup_map1 = { 12, 22 },
10713 .result = REJECT,
10714 .errstr = "R0 invalid mem access 'inv'",
10715 },
10716 {
10717 "calls: pkt_ptr spill into caller stack",
10718 .insns = {
10719 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10720 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10721 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 1),
10722 BPF_EXIT_INSN(),
10723
10724 /* subprog 1 */
10725 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10726 offsetof(struct __sk_buff, data)),
10727 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10728 offsetof(struct __sk_buff, data_end)),
10729 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10730 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10731 /* spill unchecked pkt_ptr into stack of caller */
10732 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10733 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 2),
10734 /* now the pkt range is verified, read pkt_ptr from stack */
10735 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_4, 0),
10736 /* write 4 bytes into packet */
10737 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10738 BPF_EXIT_INSN(),
10739 },
10740 .result = ACCEPT,
10741 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10742 .retval = POINTER_VALUE,
10743 },
10744 {
10745 "calls: pkt_ptr spill into caller stack 2",
10746 .insns = {
10747 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10748 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10749 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10750 /* Marking is still kept, but not in all cases safe. */
10751 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10752 BPF_ST_MEM(BPF_W, BPF_REG_4, 0, 0),
10753 BPF_EXIT_INSN(),
10754
10755 /* subprog 1 */
10756 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10757 offsetof(struct __sk_buff, data)),
10758 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10759 offsetof(struct __sk_buff, data_end)),
10760 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10761 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10762 /* spill unchecked pkt_ptr into stack of caller */
10763 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10764 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 2),
10765 /* now the pkt range is verified, read pkt_ptr from stack */
10766 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_4, 0),
10767 /* write 4 bytes into packet */
10768 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10769 BPF_EXIT_INSN(),
10770 },
10771 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10772 .errstr = "invalid access to packet",
10773 .result = REJECT,
10774 },
10775 {
10776 "calls: pkt_ptr spill into caller stack 3",
10777 .insns = {
10778 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10779 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10780 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
10781 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2),
10782 /* Marking is still kept and safe here. */
10783 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10784 BPF_ST_MEM(BPF_W, BPF_REG_4, 0, 0),
10785 BPF_EXIT_INSN(),
10786
10787 /* subprog 1 */
10788 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10789 offsetof(struct __sk_buff, data)),
10790 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10791 offsetof(struct __sk_buff, data_end)),
10792 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10793 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10794 /* spill unchecked pkt_ptr into stack of caller */
10795 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10796 BPF_MOV64_IMM(BPF_REG_5, 0),
10797 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 3),
10798 BPF_MOV64_IMM(BPF_REG_5, 1),
10799 /* now the pkt range is verified, read pkt_ptr from stack */
10800 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_4, 0),
10801 /* write 4 bytes into packet */
10802 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10803 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
10804 BPF_EXIT_INSN(),
10805 },
10806 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10807 .result = ACCEPT,
10808 .retval = 1,
10809 },
10810 {
10811 "calls: pkt_ptr spill into caller stack 4",
10812 .insns = {
10813 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10814 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10815 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
10816 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2),
10817 /* Check marking propagated. */
10818 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10819 BPF_ST_MEM(BPF_W, BPF_REG_4, 0, 0),
10820 BPF_EXIT_INSN(),
10821
10822 /* subprog 1 */
10823 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10824 offsetof(struct __sk_buff, data)),
10825 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10826 offsetof(struct __sk_buff, data_end)),
10827 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10828 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10829 /* spill unchecked pkt_ptr into stack of caller */
10830 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10831 BPF_MOV64_IMM(BPF_REG_5, 0),
10832 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 2),
10833 BPF_MOV64_IMM(BPF_REG_5, 1),
10834 /* don't read back pkt_ptr from stack here */
10835 /* write 4 bytes into packet */
10836 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10837 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
10838 BPF_EXIT_INSN(),
10839 },
10840 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10841 .result = ACCEPT,
10842 .retval = 1,
10843 },
10844 {
10845 "calls: pkt_ptr spill into caller stack 5",
10846 .insns = {
10847 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10848 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10849 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_1, 0),
10850 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10851 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10852 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_4, 0),
10853 BPF_EXIT_INSN(),
10854
10855 /* subprog 1 */
10856 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10857 offsetof(struct __sk_buff, data)),
10858 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10859 offsetof(struct __sk_buff, data_end)),
10860 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10861 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10862 BPF_MOV64_IMM(BPF_REG_5, 0),
10863 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 3),
10864 /* spill checked pkt_ptr into stack of caller */
10865 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10866 BPF_MOV64_IMM(BPF_REG_5, 1),
10867 /* don't read back pkt_ptr from stack here */
10868 /* write 4 bytes into packet */
10869 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10870 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
10871 BPF_EXIT_INSN(),
10872 },
10873 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10874 .errstr = "same insn cannot be used with different",
10875 .result = REJECT,
10876 },
10877 {
10878 "calls: pkt_ptr spill into caller stack 6",
10879 .insns = {
10880 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10881 offsetof(struct __sk_buff, data_end)),
10882 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10883 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10884 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10885 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10886 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10887 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_4, 0),
10888 BPF_EXIT_INSN(),
10889
10890 /* subprog 1 */
10891 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10892 offsetof(struct __sk_buff, data)),
10893 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10894 offsetof(struct __sk_buff, data_end)),
10895 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10896 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10897 BPF_MOV64_IMM(BPF_REG_5, 0),
10898 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 3),
10899 /* spill checked pkt_ptr into stack of caller */
10900 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10901 BPF_MOV64_IMM(BPF_REG_5, 1),
10902 /* don't read back pkt_ptr from stack here */
10903 /* write 4 bytes into packet */
10904 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10905 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
10906 BPF_EXIT_INSN(),
10907 },
10908 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10909 .errstr = "R4 invalid mem access",
10910 .result = REJECT,
10911 },
10912 {
10913 "calls: pkt_ptr spill into caller stack 7",
10914 .insns = {
10915 BPF_MOV64_IMM(BPF_REG_2, 0),
10916 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10917 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10918 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10919 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10920 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10921 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_4, 0),
10922 BPF_EXIT_INSN(),
10923
10924 /* subprog 1 */
10925 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10926 offsetof(struct __sk_buff, data)),
10927 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10928 offsetof(struct __sk_buff, data_end)),
10929 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10930 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10931 BPF_MOV64_IMM(BPF_REG_5, 0),
10932 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 3),
10933 /* spill checked pkt_ptr into stack of caller */
10934 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10935 BPF_MOV64_IMM(BPF_REG_5, 1),
10936 /* don't read back pkt_ptr from stack here */
10937 /* write 4 bytes into packet */
10938 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10939 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
10940 BPF_EXIT_INSN(),
10941 },
10942 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10943 .errstr = "R4 invalid mem access",
10944 .result = REJECT,
10945 },
10946 {
10947 "calls: pkt_ptr spill into caller stack 8",
10948 .insns = {
10949 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10950 offsetof(struct __sk_buff, data)),
10951 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10952 offsetof(struct __sk_buff, data_end)),
10953 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10954 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10955 BPF_JMP_REG(BPF_JLE, BPF_REG_0, BPF_REG_3, 1),
10956 BPF_EXIT_INSN(),
10957 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10958 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10959 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10960 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
10961 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
10962 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_4, 0),
10963 BPF_EXIT_INSN(),
10964
10965 /* subprog 1 */
10966 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10967 offsetof(struct __sk_buff, data)),
10968 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10969 offsetof(struct __sk_buff, data_end)),
10970 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10971 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10972 BPF_MOV64_IMM(BPF_REG_5, 0),
10973 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 3),
10974 /* spill checked pkt_ptr into stack of caller */
10975 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
10976 BPF_MOV64_IMM(BPF_REG_5, 1),
10977 /* don't read back pkt_ptr from stack here */
10978 /* write 4 bytes into packet */
10979 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
10980 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
10981 BPF_EXIT_INSN(),
10982 },
10983 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
10984 .result = ACCEPT,
10985 },
10986 {
10987 "calls: pkt_ptr spill into caller stack 9",
10988 .insns = {
10989 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
10990 offsetof(struct __sk_buff, data)),
10991 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
10992 offsetof(struct __sk_buff, data_end)),
10993 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
10994 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
10995 BPF_JMP_REG(BPF_JLE, BPF_REG_0, BPF_REG_3, 1),
10996 BPF_EXIT_INSN(),
10997 BPF_MOV64_REG(BPF_REG_4, BPF_REG_10),
10998 BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, -8),
10999 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
11000 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 3),
11001 BPF_LDX_MEM(BPF_DW, BPF_REG_4, BPF_REG_10, -8),
11002 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_4, 0),
11003 BPF_EXIT_INSN(),
11004
11005 /* subprog 1 */
11006 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
11007 offsetof(struct __sk_buff, data)),
11008 BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1,
11009 offsetof(struct __sk_buff, data_end)),
11010 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
11011 BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, 8),
11012 BPF_MOV64_IMM(BPF_REG_5, 0),
11013 /* spill unchecked pkt_ptr into stack of caller */
11014 BPF_STX_MEM(BPF_DW, BPF_REG_4, BPF_REG_2, 0),
11015 BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_3, 2),
11016 BPF_MOV64_IMM(BPF_REG_5, 1),
11017 /* don't read back pkt_ptr from stack here */
11018 /* write 4 bytes into packet */
11019 BPF_ST_MEM(BPF_W, BPF_REG_2, 0, 0),
11020 BPF_MOV64_REG(BPF_REG_0, BPF_REG_5),
11021 BPF_EXIT_INSN(),
11022 },
11023 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
11024 .errstr = "invalid access to packet",
11025 .result = REJECT,
11026 },
11027 {
11028 "calls: caller stack init to zero or map_value_or_null",
11029 .insns = {
11030 BPF_MOV64_IMM(BPF_REG_0, 0),
11031 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -8),
11032 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
11033 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
11034 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4),
11035 /* fetch map_value_or_null or const_zero from stack */
11036 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -8),
11037 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1),
11038 /* store into map_value */
11039 BPF_ST_MEM(BPF_W, BPF_REG_0, 0, 0),
11040 BPF_EXIT_INSN(),
11041
11042 /* subprog 1 */
11043 /* if (ctx == 0) return; */
11044 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 8),
11045 /* else bpf_map_lookup() and *(fp - 8) = r0 */
11046 BPF_MOV64_REG(BPF_REG_6, BPF_REG_2),
11047 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
11048 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
11049 BPF_LD_MAP_FD(BPF_REG_1, 0),
11050 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
11051 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
11052 BPF_FUNC_map_lookup_elem),
11053 /* write map_value_ptr_or_null into stack frame of main prog at fp-8 */
11054 BPF_STX_MEM(BPF_DW, BPF_REG_6, BPF_REG_0, 0),
11055 BPF_EXIT_INSN(),
11056 },
11057 .fixup_map1 = { 13 },
11058 .result = ACCEPT,
11059 .prog_type = BPF_PROG_TYPE_XDP,
11060 },
11061 {
11062 "calls: stack init to zero and pruning",
11063 .insns = {
11064 /* first make allocated_stack 16 byte */
11065 BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, 0),
11066 /* now fork the execution such that the false branch
11067 * of JGT insn will be verified second and it skisp zero
11068 * init of fp-8 stack slot. If stack liveness marking
11069 * is missing live_read marks from call map_lookup
11070 * processing then pruning will incorrectly assume
11071 * that fp-8 stack slot was unused in the fall-through
11072 * branch and will accept the program incorrectly
11073 */
11074 BPF_JMP_IMM(BPF_JGT, BPF_REG_1, 2, 2),
11075 BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
11076 BPF_JMP_IMM(BPF_JA, 0, 0, 0),
11077 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
11078 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
11079 BPF_LD_MAP_FD(BPF_REG_1, 0),
11080 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
11081 BPF_FUNC_map_lookup_elem),
11082 BPF_EXIT_INSN(),
11083 },
11084 .fixup_map2 = { 6 },
11085 .errstr = "invalid indirect read from stack off -8+0 size 8",
11086 .result = REJECT,
11087 .prog_type = BPF_PROG_TYPE_XDP,
11088 },
11089 {
11090 "search pruning: all branches should be verified (nop operation)",
11091 .insns = {
11092 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
11093 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
11094 BPF_ST_MEM(BPF_DW, BPF_REG_2, 0, 0),
11095 BPF_LD_MAP_FD(BPF_REG_1, 0),
11096 BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem),
11097 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 11),
11098 BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0),
11099 BPF_JMP_IMM(BPF_JEQ, BPF_REG_3, 0xbeef, 2),
11100 BPF_MOV64_IMM(BPF_REG_4, 0),
11101 BPF_JMP_A(1),
11102 BPF_MOV64_IMM(BPF_REG_4, 1),
11103 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_4, -16),
11104 BPF_EMIT_CALL(BPF_FUNC_ktime_get_ns),
11105 BPF_LDX_MEM(BPF_DW, BPF_REG_5, BPF_REG_10, -16),
11106 BPF_JMP_IMM(BPF_JEQ, BPF_REG_5, 0, 2),
11107 BPF_MOV64_IMM(BPF_REG_6, 0),
11108 BPF_ST_MEM(BPF_DW, BPF_REG_6, 0, 0xdead),
11109 BPF_EXIT_INSN(),
11110 },
11111 .fixup_map1 = { 3 },
11112 .errstr = "R6 invalid mem access 'inv'",
11113 .result = REJECT,
11114 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
11115 },
11116 {
11117 "search pruning: all branches should be verified (invalid stack access)",
11118 .insns = {
11119 BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
11120 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
11121 BPF_ST_MEM(BPF_DW, BPF_REG_2, 0, 0),
11122 BPF_LD_MAP_FD(BPF_REG_1, 0),
11123 BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem),
11124 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 8),
11125 BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0),
11126 BPF_MOV64_IMM(BPF_REG_4, 0),
11127 BPF_JMP_IMM(BPF_JEQ, BPF_REG_3, 0xbeef, 2),
11128 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_4, -16),
11129 BPF_JMP_A(1),
11130 BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_4, -24),
11131 BPF_EMIT_CALL(BPF_FUNC_ktime_get_ns),
11132 BPF_LDX_MEM(BPF_DW, BPF_REG_5, BPF_REG_10, -16),
11133 BPF_EXIT_INSN(),
11134 },
11135 .fixup_map1 = { 3 },
11136 .errstr = "invalid read from stack off -16+0 size 8",
11137 .result = REJECT,
11138 .prog_type = BPF_PROG_TYPE_TRACEPOINT,
11139 },
8829}; 11140};
8830 11141
8831static int probe_filter_length(const struct bpf_insn *fp) 11142static int probe_filter_length(const struct bpf_insn *fp)
@@ -8937,10 +11248,12 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
8937 int fd_prog, expected_ret, reject_from_alignment; 11248 int fd_prog, expected_ret, reject_from_alignment;
8938 struct bpf_insn *prog = test->insns; 11249 struct bpf_insn *prog = test->insns;
8939 int prog_len = probe_filter_length(prog); 11250 int prog_len = probe_filter_length(prog);
11251 char data_in[TEST_DATA_LEN] = {};
8940 int prog_type = test->prog_type; 11252 int prog_type = test->prog_type;
8941 int map_fds[MAX_NR_MAPS]; 11253 int map_fds[MAX_NR_MAPS];
8942 const char *expected_err; 11254 const char *expected_err;
8943 int i; 11255 uint32_t retval;
11256 int i, err;
8944 11257
8945 for (i = 0; i < MAX_NR_MAPS; i++) 11258 for (i = 0; i < MAX_NR_MAPS; i++)
8946 map_fds[i] = -1; 11259 map_fds[i] = -1;
@@ -8983,6 +11296,19 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
8983 } 11296 }
8984 } 11297 }
8985 11298
11299 if (fd_prog >= 0) {
11300 err = bpf_prog_test_run(fd_prog, 1, data_in, sizeof(data_in),
11301 NULL, NULL, &retval, NULL);
11302 if (err && errno != 524/*ENOTSUPP*/ && errno != EPERM) {
11303 printf("Unexpected bpf_prog_test_run error\n");
11304 goto fail_log;
11305 }
11306 if (!err && retval != test->retval &&
11307 test->retval != POINTER_VALUE) {
11308 printf("FAIL retval %d != %d\n", retval, test->retval);
11309 goto fail_log;
11310 }
11311 }
8986 (*passes)++; 11312 (*passes)++;
8987 printf("OK%s\n", reject_from_alignment ? 11313 printf("OK%s\n", reject_from_alignment ?
8988 " (NOTE: reject due to unknown alignment)" : ""); 11314 " (NOTE: reject due to unknown alignment)" : "");
diff --git a/tools/testing/selftests/bpf/test_xdp_noinline.c b/tools/testing/selftests/bpf/test_xdp_noinline.c
new file mode 100644
index 000000000000..5e4aac74f9d0
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_xdp_noinline.c
@@ -0,0 +1,833 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2017 Facebook
3#include <stddef.h>
4#include <stdbool.h>
5#include <string.h>
6#include <linux/pkt_cls.h>
7#include <linux/bpf.h>
8#include <linux/in.h>
9#include <linux/if_ether.h>
10#include <linux/ip.h>
11#include <linux/ipv6.h>
12#include <linux/icmp.h>
13#include <linux/icmpv6.h>
14#include <linux/tcp.h>
15#include <linux/udp.h>
16#include "bpf_helpers.h"
17
18#define bpf_printk(fmt, ...) \
19({ \
20 char ____fmt[] = fmt; \
21 bpf_trace_printk(____fmt, sizeof(____fmt), \
22 ##__VA_ARGS__); \
23})
24
25static __u32 rol32(__u32 word, unsigned int shift)
26{
27 return (word << shift) | (word >> ((-shift) & 31));
28}
29
30/* copy paste of jhash from kernel sources to make sure llvm
31 * can compile it into valid sequence of bpf instructions
32 */
33#define __jhash_mix(a, b, c) \
34{ \
35 a -= c; a ^= rol32(c, 4); c += b; \
36 b -= a; b ^= rol32(a, 6); a += c; \
37 c -= b; c ^= rol32(b, 8); b += a; \
38 a -= c; a ^= rol32(c, 16); c += b; \
39 b -= a; b ^= rol32(a, 19); a += c; \
40 c -= b; c ^= rol32(b, 4); b += a; \
41}
42
43#define __jhash_final(a, b, c) \
44{ \
45 c ^= b; c -= rol32(b, 14); \
46 a ^= c; a -= rol32(c, 11); \
47 b ^= a; b -= rol32(a, 25); \
48 c ^= b; c -= rol32(b, 16); \
49 a ^= c; a -= rol32(c, 4); \
50 b ^= a; b -= rol32(a, 14); \
51 c ^= b; c -= rol32(b, 24); \
52}
53
54#define JHASH_INITVAL 0xdeadbeef
55
56typedef unsigned int u32;
57
58static __attribute__ ((noinline))
59u32 jhash(const void *key, u32 length, u32 initval)
60{
61 u32 a, b, c;
62 const unsigned char *k = key;
63
64 a = b = c = JHASH_INITVAL + length + initval;
65
66 while (length > 12) {
67 a += *(u32 *)(k);
68 b += *(u32 *)(k + 4);
69 c += *(u32 *)(k + 8);
70 __jhash_mix(a, b, c);
71 length -= 12;
72 k += 12;
73 }
74 switch (length) {
75 case 12: c += (u32)k[11]<<24;
76 case 11: c += (u32)k[10]<<16;
77 case 10: c += (u32)k[9]<<8;
78 case 9: c += k[8];
79 case 8: b += (u32)k[7]<<24;
80 case 7: b += (u32)k[6]<<16;
81 case 6: b += (u32)k[5]<<8;
82 case 5: b += k[4];
83 case 4: a += (u32)k[3]<<24;
84 case 3: a += (u32)k[2]<<16;
85 case 2: a += (u32)k[1]<<8;
86 case 1: a += k[0];
87 __jhash_final(a, b, c);
88 case 0: /* Nothing left to add */
89 break;
90 }
91
92 return c;
93}
94
95static __attribute__ ((noinline))
96u32 __jhash_nwords(u32 a, u32 b, u32 c, u32 initval)
97{
98 a += initval;
99 b += initval;
100 c += initval;
101 __jhash_final(a, b, c);
102 return c;
103}
104
105static __attribute__ ((noinline))
106u32 jhash_2words(u32 a, u32 b, u32 initval)
107{
108 return __jhash_nwords(a, b, 0, initval + JHASH_INITVAL + (2 << 2));
109}
110
111struct flow_key {
112 union {
113 __be32 src;
114 __be32 srcv6[4];
115 };
116 union {
117 __be32 dst;
118 __be32 dstv6[4];
119 };
120 union {
121 __u32 ports;
122 __u16 port16[2];
123 };
124 __u8 proto;
125};
126
127struct packet_description {
128 struct flow_key flow;
129 __u8 flags;
130};
131
132struct ctl_value {
133 union {
134 __u64 value;
135 __u32 ifindex;
136 __u8 mac[6];
137 };
138};
139
140struct vip_definition {
141 union {
142 __be32 vip;
143 __be32 vipv6[4];
144 };
145 __u16 port;
146 __u16 family;
147 __u8 proto;
148};
149
150struct vip_meta {
151 __u32 flags;
152 __u32 vip_num;
153};
154
155struct real_pos_lru {
156 __u32 pos;
157 __u64 atime;
158};
159
160struct real_definition {
161 union {
162 __be32 dst;
163 __be32 dstv6[4];
164 };
165 __u8 flags;
166};
167
168struct lb_stats {
169 __u64 v2;
170 __u64 v1;
171};
172
173struct bpf_map_def __attribute__ ((section("maps"), used)) vip_map = {
174 .type = BPF_MAP_TYPE_HASH,
175 .key_size = sizeof(struct vip_definition),
176 .value_size = sizeof(struct vip_meta),
177 .max_entries = 512,
178 .map_flags = 0,
179};
180
181struct bpf_map_def __attribute__ ((section("maps"), used)) lru_cache = {
182 .type = BPF_MAP_TYPE_LRU_HASH,
183 .key_size = sizeof(struct flow_key),
184 .value_size = sizeof(struct real_pos_lru),
185 .max_entries = 300,
186 .map_flags = 1U << 1,
187};
188
189struct bpf_map_def __attribute__ ((section("maps"), used)) ch_rings = {
190 .type = BPF_MAP_TYPE_ARRAY,
191 .key_size = sizeof(__u32),
192 .value_size = sizeof(__u32),
193 .max_entries = 12 * 655,
194 .map_flags = 0,
195};
196
197struct bpf_map_def __attribute__ ((section("maps"), used)) reals = {
198 .type = BPF_MAP_TYPE_ARRAY,
199 .key_size = sizeof(__u32),
200 .value_size = sizeof(struct real_definition),
201 .max_entries = 40,
202 .map_flags = 0,
203};
204
205struct bpf_map_def __attribute__ ((section("maps"), used)) stats = {
206 .type = BPF_MAP_TYPE_PERCPU_ARRAY,
207 .key_size = sizeof(__u32),
208 .value_size = sizeof(struct lb_stats),
209 .max_entries = 515,
210 .map_flags = 0,
211};
212
213struct bpf_map_def __attribute__ ((section("maps"), used)) ctl_array = {
214 .type = BPF_MAP_TYPE_ARRAY,
215 .key_size = sizeof(__u32),
216 .value_size = sizeof(struct ctl_value),
217 .max_entries = 16,
218 .map_flags = 0,
219};
220
221struct eth_hdr {
222 unsigned char eth_dest[6];
223 unsigned char eth_source[6];
224 unsigned short eth_proto;
225};
226
227static inline __u64 calc_offset(bool is_ipv6, bool is_icmp)
228{
229 __u64 off = sizeof(struct eth_hdr);
230 if (is_ipv6) {
231 off += sizeof(struct ipv6hdr);
232 if (is_icmp)
233 off += sizeof(struct icmp6hdr) + sizeof(struct ipv6hdr);
234 } else {
235 off += sizeof(struct iphdr);
236 if (is_icmp)
237 off += sizeof(struct icmphdr) + sizeof(struct iphdr);
238 }
239 return off;
240}
241
242static __attribute__ ((noinline))
243bool parse_udp(void *data, void *data_end,
244 bool is_ipv6, struct packet_description *pckt)
245{
246
247 bool is_icmp = !((pckt->flags & (1 << 0)) == 0);
248 __u64 off = calc_offset(is_ipv6, is_icmp);
249 struct udphdr *udp;
250 udp = data + off;
251
252 if (udp + 1 > data_end)
253 return 0;
254 if (!is_icmp) {
255 pckt->flow.port16[0] = udp->source;
256 pckt->flow.port16[1] = udp->dest;
257 } else {
258 pckt->flow.port16[0] = udp->dest;
259 pckt->flow.port16[1] = udp->source;
260 }
261 return 1;
262}
263
264static __attribute__ ((noinline))
265bool parse_tcp(void *data, void *data_end,
266 bool is_ipv6, struct packet_description *pckt)
267{
268
269 bool is_icmp = !((pckt->flags & (1 << 0)) == 0);
270 __u64 off = calc_offset(is_ipv6, is_icmp);
271 struct tcphdr *tcp;
272
273 tcp = data + off;
274 if (tcp + 1 > data_end)
275 return 0;
276 if (tcp->syn)
277 pckt->flags |= (1 << 1);
278 if (!is_icmp) {
279 pckt->flow.port16[0] = tcp->source;
280 pckt->flow.port16[1] = tcp->dest;
281 } else {
282 pckt->flow.port16[0] = tcp->dest;
283 pckt->flow.port16[1] = tcp->source;
284 }
285 return 1;
286}
287
288static __attribute__ ((noinline))
289bool encap_v6(struct xdp_md *xdp, struct ctl_value *cval,
290 struct packet_description *pckt,
291 struct real_definition *dst, __u32 pkt_bytes)
292{
293 struct eth_hdr *new_eth;
294 struct eth_hdr *old_eth;
295 struct ipv6hdr *ip6h;
296 __u32 ip_suffix;
297 void *data_end;
298 void *data;
299
300 if (bpf_xdp_adjust_head(xdp, 0 - (int)sizeof(struct ipv6hdr)))
301 return 0;
302 data = (void *)(long)xdp->data;
303 data_end = (void *)(long)xdp->data_end;
304 new_eth = data;
305 ip6h = data + sizeof(struct eth_hdr);
306 old_eth = data + sizeof(struct ipv6hdr);
307 if (new_eth + 1 > data_end ||
308 old_eth + 1 > data_end || ip6h + 1 > data_end)
309 return 0;
310 memcpy(new_eth->eth_dest, cval->mac, 6);
311 memcpy(new_eth->eth_source, old_eth->eth_dest, 6);
312 new_eth->eth_proto = 56710;
313 ip6h->version = 6;
314 ip6h->priority = 0;
315 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl));
316
317 ip6h->nexthdr = IPPROTO_IPV6;
318 ip_suffix = pckt->flow.srcv6[3] ^ pckt->flow.port16[0];
319 ip6h->payload_len =
320 __builtin_bswap16(pkt_bytes + sizeof(struct ipv6hdr));
321 ip6h->hop_limit = 4;
322
323 ip6h->saddr.in6_u.u6_addr32[0] = 1;
324 ip6h->saddr.in6_u.u6_addr32[1] = 2;
325 ip6h->saddr.in6_u.u6_addr32[2] = 3;
326 ip6h->saddr.in6_u.u6_addr32[3] = ip_suffix;
327 memcpy(ip6h->daddr.in6_u.u6_addr32, dst->dstv6, 16);
328 return 1;
329}
330
331static __attribute__ ((noinline))
332bool encap_v4(struct xdp_md *xdp, struct ctl_value *cval,
333 struct packet_description *pckt,
334 struct real_definition *dst, __u32 pkt_bytes)
335{
336
337 __u32 ip_suffix = __builtin_bswap16(pckt->flow.port16[0]);
338 struct eth_hdr *new_eth;
339 struct eth_hdr *old_eth;
340 __u16 *next_iph_u16;
341 struct iphdr *iph;
342 __u32 csum = 0;
343 void *data_end;
344 void *data;
345
346 ip_suffix <<= 15;
347 ip_suffix ^= pckt->flow.src;
348 if (bpf_xdp_adjust_head(xdp, 0 - (int)sizeof(struct iphdr)))
349 return 0;
350 data = (void *)(long)xdp->data;
351 data_end = (void *)(long)xdp->data_end;
352 new_eth = data;
353 iph = data + sizeof(struct eth_hdr);
354 old_eth = data + sizeof(struct iphdr);
355 if (new_eth + 1 > data_end ||
356 old_eth + 1 > data_end || iph + 1 > data_end)
357 return 0;
358 memcpy(new_eth->eth_dest, cval->mac, 6);
359 memcpy(new_eth->eth_source, old_eth->eth_dest, 6);
360 new_eth->eth_proto = 8;
361 iph->version = 4;
362 iph->ihl = 5;
363 iph->frag_off = 0;
364 iph->protocol = IPPROTO_IPIP;
365 iph->check = 0;
366 iph->tos = 1;
367 iph->tot_len = __builtin_bswap16(pkt_bytes + sizeof(struct iphdr));
368 /* don't update iph->daddr, since it will overwrite old eth_proto
369 * and multiple iterations of bpf_prog_run() will fail
370 */
371
372 iph->saddr = ((0xFFFF0000 & ip_suffix) | 4268) ^ dst->dst;
373 iph->ttl = 4;
374
375 next_iph_u16 = (__u16 *) iph;
376#pragma clang loop unroll(full)
377 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++)
378 csum += *next_iph_u16++;
379 iph->check = ~((csum & 0xffff) + (csum >> 16));
380 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr)))
381 return 0;
382 return 1;
383}
384
385static __attribute__ ((noinline))
386bool decap_v6(struct xdp_md *xdp, void **data, void **data_end, bool inner_v4)
387{
388 struct eth_hdr *new_eth;
389 struct eth_hdr *old_eth;
390
391 old_eth = *data;
392 new_eth = *data + sizeof(struct ipv6hdr);
393 memcpy(new_eth->eth_source, old_eth->eth_source, 6);
394 memcpy(new_eth->eth_dest, old_eth->eth_dest, 6);
395 if (inner_v4)
396 new_eth->eth_proto = 8;
397 else
398 new_eth->eth_proto = 56710;
399 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct ipv6hdr)))
400 return 0;
401 *data = (void *)(long)xdp->data;
402 *data_end = (void *)(long)xdp->data_end;
403 return 1;
404}
405
406static __attribute__ ((noinline))
407bool decap_v4(struct xdp_md *xdp, void **data, void **data_end)
408{
409 struct eth_hdr *new_eth;
410 struct eth_hdr *old_eth;
411
412 old_eth = *data;
413 new_eth = *data + sizeof(struct iphdr);
414 memcpy(new_eth->eth_source, old_eth->eth_source, 6);
415 memcpy(new_eth->eth_dest, old_eth->eth_dest, 6);
416 new_eth->eth_proto = 8;
417 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr)))
418 return 0;
419 *data = (void *)(long)xdp->data;
420 *data_end = (void *)(long)xdp->data_end;
421 return 1;
422}
423
424static __attribute__ ((noinline))
425int swap_mac_and_send(void *data, void *data_end)
426{
427 unsigned char tmp_mac[6];
428 struct eth_hdr *eth;
429
430 eth = data;
431 memcpy(tmp_mac, eth->eth_source, 6);
432 memcpy(eth->eth_source, eth->eth_dest, 6);
433 memcpy(eth->eth_dest, tmp_mac, 6);
434 return XDP_TX;
435}
436
437static __attribute__ ((noinline))
438int send_icmp_reply(void *data, void *data_end)
439{
440 struct icmphdr *icmp_hdr;
441 __u16 *next_iph_u16;
442 __u32 tmp_addr = 0;
443 struct iphdr *iph;
444 __u32 csum1 = 0;
445 __u32 csum = 0;
446 __u64 off = 0;
447
448 if (data + sizeof(struct eth_hdr)
449 + sizeof(struct iphdr) + sizeof(struct icmphdr) > data_end)
450 return XDP_DROP;
451 off += sizeof(struct eth_hdr);
452 iph = data + off;
453 off += sizeof(struct iphdr);
454 icmp_hdr = data + off;
455 icmp_hdr->type = 0;
456 icmp_hdr->checksum += 0x0007;
457 iph->ttl = 4;
458 tmp_addr = iph->daddr;
459 iph->daddr = iph->saddr;
460 iph->saddr = tmp_addr;
461 iph->check = 0;
462 next_iph_u16 = (__u16 *) iph;
463#pragma clang loop unroll(full)
464 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++)
465 csum += *next_iph_u16++;
466 iph->check = ~((csum & 0xffff) + (csum >> 16));
467 return swap_mac_and_send(data, data_end);
468}
469
470static __attribute__ ((noinline))
471int send_icmp6_reply(void *data, void *data_end)
472{
473 struct icmp6hdr *icmp_hdr;
474 struct ipv6hdr *ip6h;
475 __be32 tmp_addr[4];
476 __u64 off = 0;
477
478 if (data + sizeof(struct eth_hdr)
479 + sizeof(struct ipv6hdr) + sizeof(struct icmp6hdr) > data_end)
480 return XDP_DROP;
481 off += sizeof(struct eth_hdr);
482 ip6h = data + off;
483 off += sizeof(struct ipv6hdr);
484 icmp_hdr = data + off;
485 icmp_hdr->icmp6_type = 129;
486 icmp_hdr->icmp6_cksum -= 0x0001;
487 ip6h->hop_limit = 4;
488 memcpy(tmp_addr, ip6h->saddr.in6_u.u6_addr32, 16);
489 memcpy(ip6h->saddr.in6_u.u6_addr32, ip6h->daddr.in6_u.u6_addr32, 16);
490 memcpy(ip6h->daddr.in6_u.u6_addr32, tmp_addr, 16);
491 return swap_mac_and_send(data, data_end);
492}
493
494static __attribute__ ((noinline))
495int parse_icmpv6(void *data, void *data_end, __u64 off,
496 struct packet_description *pckt)
497{
498 struct icmp6hdr *icmp_hdr;
499 struct ipv6hdr *ip6h;
500
501 icmp_hdr = data + off;
502 if (icmp_hdr + 1 > data_end)
503 return XDP_DROP;
504 if (icmp_hdr->icmp6_type == 128)
505 return send_icmp6_reply(data, data_end);
506 if (icmp_hdr->icmp6_type != 3)
507 return XDP_PASS;
508 off += sizeof(struct icmp6hdr);
509 ip6h = data + off;
510 if (ip6h + 1 > data_end)
511 return XDP_DROP;
512 pckt->flow.proto = ip6h->nexthdr;
513 pckt->flags |= (1 << 0);
514 memcpy(pckt->flow.srcv6, ip6h->daddr.in6_u.u6_addr32, 16);
515 memcpy(pckt->flow.dstv6, ip6h->saddr.in6_u.u6_addr32, 16);
516 return -1;
517}
518
519static __attribute__ ((noinline))
520int parse_icmp(void *data, void *data_end, __u64 off,
521 struct packet_description *pckt)
522{
523 struct icmphdr *icmp_hdr;
524 struct iphdr *iph;
525
526 icmp_hdr = data + off;
527 if (icmp_hdr + 1 > data_end)
528 return XDP_DROP;
529 if (icmp_hdr->type == 8)
530 return send_icmp_reply(data, data_end);
531 if ((icmp_hdr->type != 3) || (icmp_hdr->code != 4))
532 return XDP_PASS;
533 off += sizeof(struct icmphdr);
534 iph = data + off;
535 if (iph + 1 > data_end)
536 return XDP_DROP;
537 if (iph->ihl != 5)
538 return XDP_DROP;
539 pckt->flow.proto = iph->protocol;
540 pckt->flags |= (1 << 0);
541 pckt->flow.src = iph->daddr;
542 pckt->flow.dst = iph->saddr;
543 return -1;
544}
545
546static __attribute__ ((noinline))
547__u32 get_packet_hash(struct packet_description *pckt,
548 bool hash_16bytes)
549{
550 if (hash_16bytes)
551 return jhash_2words(jhash(pckt->flow.srcv6, 16, 12),
552 pckt->flow.ports, 24);
553 else
554 return jhash_2words(pckt->flow.src, pckt->flow.ports,
555 24);
556}
557
558__attribute__ ((noinline))
559static bool get_packet_dst(struct real_definition **real,
560 struct packet_description *pckt,
561 struct vip_meta *vip_info,
562 bool is_ipv6, void *lru_map)
563{
564 struct real_pos_lru new_dst_lru = { };
565 bool hash_16bytes = is_ipv6;
566 __u32 *real_pos, hash, key;
567 __u64 cur_time;
568
569 if (vip_info->flags & (1 << 2))
570 hash_16bytes = 1;
571 if (vip_info->flags & (1 << 3)) {
572 pckt->flow.port16[0] = pckt->flow.port16[1];
573 memset(pckt->flow.srcv6, 0, 16);
574 }
575 hash = get_packet_hash(pckt, hash_16bytes);
576 if (hash != 0x358459b7 /* jhash of ipv4 packet */ &&
577 hash != 0x2f4bc6bb /* jhash of ipv6 packet */)
578 return 0;
579 key = 2 * vip_info->vip_num + hash % 2;
580 real_pos = bpf_map_lookup_elem(&ch_rings, &key);
581 if (!real_pos)
582 return 0;
583 key = *real_pos;
584 *real = bpf_map_lookup_elem(&reals, &key);
585 if (!(*real))
586 return 0;
587 if (!(vip_info->flags & (1 << 1))) {
588 __u32 conn_rate_key = 512 + 2;
589 struct lb_stats *conn_rate_stats =
590 bpf_map_lookup_elem(&stats, &conn_rate_key);
591
592 if (!conn_rate_stats)
593 return 1;
594 cur_time = bpf_ktime_get_ns();
595 if ((cur_time - conn_rate_stats->v2) >> 32 > 0xffFFFF) {
596 conn_rate_stats->v1 = 1;
597 conn_rate_stats->v2 = cur_time;
598 } else {
599 conn_rate_stats->v1 += 1;
600 if (conn_rate_stats->v1 >= 1)
601 return 1;
602 }
603 if (pckt->flow.proto == IPPROTO_UDP)
604 new_dst_lru.atime = cur_time;
605 new_dst_lru.pos = key;
606 bpf_map_update_elem(lru_map, &pckt->flow, &new_dst_lru, 0);
607 }
608 return 1;
609}
610
611__attribute__ ((noinline))
612static void connection_table_lookup(struct real_definition **real,
613 struct packet_description *pckt,
614 void *lru_map)
615{
616
617 struct real_pos_lru *dst_lru;
618 __u64 cur_time;
619 __u32 key;
620
621 dst_lru = bpf_map_lookup_elem(lru_map, &pckt->flow);
622 if (!dst_lru)
623 return;
624 if (pckt->flow.proto == IPPROTO_UDP) {
625 cur_time = bpf_ktime_get_ns();
626 if (cur_time - dst_lru->atime > 300000)
627 return;
628 dst_lru->atime = cur_time;
629 }
630 key = dst_lru->pos;
631 *real = bpf_map_lookup_elem(&reals, &key);
632}
633
634/* don't believe your eyes!
635 * below function has 6 arguments whereas bpf and llvm allow maximum of 5
636 * but since it's _static_ llvm can optimize one argument away
637 */
638__attribute__ ((noinline))
639static int process_l3_headers_v6(struct packet_description *pckt,
640 __u8 *protocol, __u64 off,
641 __u16 *pkt_bytes, void *data,
642 void *data_end)
643{
644 struct ipv6hdr *ip6h;
645 __u64 iph_len;
646 int action;
647
648 ip6h = data + off;
649 if (ip6h + 1 > data_end)
650 return XDP_DROP;
651 iph_len = sizeof(struct ipv6hdr);
652 *protocol = ip6h->nexthdr;
653 pckt->flow.proto = *protocol;
654 *pkt_bytes = __builtin_bswap16(ip6h->payload_len);
655 off += iph_len;
656 if (*protocol == 45) {
657 return XDP_DROP;
658 } else if (*protocol == 59) {
659 action = parse_icmpv6(data, data_end, off, pckt);
660 if (action >= 0)
661 return action;
662 } else {
663 memcpy(pckt->flow.srcv6, ip6h->saddr.in6_u.u6_addr32, 16);
664 memcpy(pckt->flow.dstv6, ip6h->daddr.in6_u.u6_addr32, 16);
665 }
666 return -1;
667}
668
669__attribute__ ((noinline))
670static int process_l3_headers_v4(struct packet_description *pckt,
671 __u8 *protocol, __u64 off,
672 __u16 *pkt_bytes, void *data,
673 void *data_end)
674{
675 struct iphdr *iph;
676 __u64 iph_len;
677 int action;
678
679 iph = data + off;
680 if (iph + 1 > data_end)
681 return XDP_DROP;
682 if (iph->ihl != 5)
683 return XDP_DROP;
684 *protocol = iph->protocol;
685 pckt->flow.proto = *protocol;
686 *pkt_bytes = __builtin_bswap16(iph->tot_len);
687 off += 20;
688 if (iph->frag_off & 65343)
689 return XDP_DROP;
690 if (*protocol == IPPROTO_ICMP) {
691 action = parse_icmp(data, data_end, off, pckt);
692 if (action >= 0)
693 return action;
694 } else {
695 pckt->flow.src = iph->saddr;
696 pckt->flow.dst = iph->daddr;
697 }
698 return -1;
699}
700
701__attribute__ ((noinline))
702static int process_packet(void *data, __u64 off, void *data_end,
703 bool is_ipv6, struct xdp_md *xdp)
704{
705
706 struct real_definition *dst = NULL;
707 struct packet_description pckt = { };
708 struct vip_definition vip = { };
709 struct lb_stats *data_stats;
710 struct eth_hdr *eth = data;
711 void *lru_map = &lru_cache;
712 struct vip_meta *vip_info;
713 __u32 lru_stats_key = 513;
714 __u32 mac_addr_pos = 0;
715 __u32 stats_key = 512;
716 struct ctl_value *cval;
717 __u16 pkt_bytes;
718 __u64 iph_len;
719 __u8 protocol;
720 __u32 vip_num;
721 int action;
722
723 if (is_ipv6)
724 action = process_l3_headers_v6(&pckt, &protocol, off,
725 &pkt_bytes, data, data_end);
726 else
727 action = process_l3_headers_v4(&pckt, &protocol, off,
728 &pkt_bytes, data, data_end);
729 if (action >= 0)
730 return action;
731 protocol = pckt.flow.proto;
732 if (protocol == IPPROTO_TCP) {
733 if (!parse_tcp(data, data_end, is_ipv6, &pckt))
734 return XDP_DROP;
735 } else if (protocol == IPPROTO_UDP) {
736 if (!parse_udp(data, data_end, is_ipv6, &pckt))
737 return XDP_DROP;
738 } else {
739 return XDP_TX;
740 }
741
742 if (is_ipv6)
743 memcpy(vip.vipv6, pckt.flow.dstv6, 16);
744 else
745 vip.vip = pckt.flow.dst;
746 vip.port = pckt.flow.port16[1];
747 vip.proto = pckt.flow.proto;
748 vip_info = bpf_map_lookup_elem(&vip_map, &vip);
749 if (!vip_info) {
750 vip.port = 0;
751 vip_info = bpf_map_lookup_elem(&vip_map, &vip);
752 if (!vip_info)
753 return XDP_PASS;
754 if (!(vip_info->flags & (1 << 4)))
755 pckt.flow.port16[1] = 0;
756 }
757 if (data_end - data > 1400)
758 return XDP_DROP;
759 data_stats = bpf_map_lookup_elem(&stats, &stats_key);
760 if (!data_stats)
761 return XDP_DROP;
762 data_stats->v1 += 1;
763 if (!dst) {
764 if (vip_info->flags & (1 << 0))
765 pckt.flow.port16[0] = 0;
766 if (!(pckt.flags & (1 << 1)) && !(vip_info->flags & (1 << 1)))
767 connection_table_lookup(&dst, &pckt, lru_map);
768 if (dst)
769 goto out;
770 if (pckt.flow.proto == IPPROTO_TCP) {
771 struct lb_stats *lru_stats =
772 bpf_map_lookup_elem(&stats, &lru_stats_key);
773
774 if (!lru_stats)
775 return XDP_DROP;
776 if (pckt.flags & (1 << 1))
777 lru_stats->v1 += 1;
778 else
779 lru_stats->v2 += 1;
780 }
781 if (!get_packet_dst(&dst, &pckt, vip_info, is_ipv6, lru_map))
782 return XDP_DROP;
783 data_stats->v2 += 1;
784 }
785out:
786 cval = bpf_map_lookup_elem(&ctl_array, &mac_addr_pos);
787 if (!cval)
788 return XDP_DROP;
789 if (dst->flags & (1 << 0)) {
790 if (!encap_v6(xdp, cval, &pckt, dst, pkt_bytes))
791 return XDP_DROP;
792 } else {
793 if (!encap_v4(xdp, cval, &pckt, dst, pkt_bytes))
794 return XDP_DROP;
795 }
796 vip_num = vip_info->vip_num;
797 data_stats = bpf_map_lookup_elem(&stats, &vip_num);
798 if (!data_stats)
799 return XDP_DROP;
800 data_stats->v1 += 1;
801 data_stats->v2 += pkt_bytes;
802
803 data = (void *)(long)xdp->data;
804 data_end = (void *)(long)xdp->data_end;
805 if (data + 4 > data_end)
806 return XDP_DROP;
807 *(u32 *)data = dst->dst;
808 return XDP_DROP;
809}
810
811__attribute__ ((section("xdp-test"), used))
812int balancer_ingress(struct xdp_md *ctx)
813{
814 void *data = (void *)(long)ctx->data;
815 void *data_end = (void *)(long)ctx->data_end;
816 struct eth_hdr *eth = data;
817 __u32 eth_proto;
818 __u32 nh_off;
819
820 nh_off = sizeof(struct eth_hdr);
821 if (data + nh_off > data_end)
822 return XDP_DROP;
823 eth_proto = eth->eth_proto;
824 if (eth_proto == 8)
825 return process_packet(data, nh_off, data_end, 0, ctx);
826 else if (eth_proto == 56710)
827 return process_packet(data, nh_off, data_end, 1, ctx);
828 else
829 return XDP_DROP;
830}
831
832char _license[] __attribute__ ((section("license"), used)) = "GPL";
833int _version __attribute__ ((section("version"), used)) = 1;
diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh
index 34a42c68ebfb..722cad91df74 100755
--- a/tools/testing/selftests/firmware/fw_fallback.sh
+++ b/tools/testing/selftests/firmware/fw_fallback.sh
@@ -175,96 +175,118 @@ trap "test_finish" EXIT
175echo "ABCD0123" >"$FW" 175echo "ABCD0123" >"$FW"
176NAME=$(basename "$FW") 176NAME=$(basename "$FW")
177 177
178DEVPATH="$DIR"/"nope-$NAME"/loading 178test_syfs_timeout()
179 179{
180# Test failure when doing nothing (timeout works). 180 DEVPATH="$DIR"/"nope-$NAME"/loading
181echo -n 2 >/sys/class/firmware/timeout 181
182echo -n "nope-$NAME" >"$DIR"/trigger_request 2>/dev/null & 182 # Test failure when doing nothing (timeout works).
183 183 echo -n 2 >/sys/class/firmware/timeout
184# Give the kernel some time to load the loading file, must be less 184 echo -n "nope-$NAME" >"$DIR"/trigger_request 2>/dev/null &
185# than the timeout above. 185
186sleep 1 186 # Give the kernel some time to load the loading file, must be less
187if [ ! -f $DEVPATH ]; then 187 # than the timeout above.
188 echo "$0: fallback mechanism immediately cancelled" 188 sleep 1
189 echo "" 189 if [ ! -f $DEVPATH ]; then
190 echo "The file never appeared: $DEVPATH" 190 echo "$0: fallback mechanism immediately cancelled"
191 echo "" 191 echo ""
192 echo "This might be a distribution udev rule setup by your distribution" 192 echo "The file never appeared: $DEVPATH"
193 echo "to immediately cancel all fallback requests, this must be" 193 echo ""
194 echo "removed before running these tests. To confirm look for" 194 echo "This might be a distribution udev rule setup by your distribution"
195 echo "a firmware rule like /lib/udev/rules.d/50-firmware.rules" 195 echo "to immediately cancel all fallback requests, this must be"
196 echo "and see if you have something like this:" 196 echo "removed before running these tests. To confirm look for"
197 echo "" 197 echo "a firmware rule like /lib/udev/rules.d/50-firmware.rules"
198 echo "SUBSYSTEM==\"firmware\", ACTION==\"add\", ATTR{loading}=\"-1\"" 198 echo "and see if you have something like this:"
199 echo "" 199 echo ""
200 echo "If you do remove this file or comment out this line before" 200 echo "SUBSYSTEM==\"firmware\", ACTION==\"add\", ATTR{loading}=\"-1\""
201 echo "proceeding with these tests." 201 echo ""
202 exit 1 202 echo "If you do remove this file or comment out this line before"
203fi 203 echo "proceeding with these tests."
204 204 exit 1
205if diff -q "$FW" /dev/test_firmware >/dev/null ; then 205 fi
206 echo "$0: firmware was not expected to match" >&2
207 exit 1
208else
209 echo "$0: timeout works"
210fi
211
212# Put timeout high enough for us to do work but not so long that failures
213# slow down this test too much.
214echo 4 >/sys/class/firmware/timeout
215 206
216# Load this script instead of the desired firmware. 207 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
217load_fw "$NAME" "$0" 208 echo "$0: firmware was not expected to match" >&2
218if diff -q "$FW" /dev/test_firmware >/dev/null ; then 209 exit 1
219 echo "$0: firmware was not expected to match" >&2 210 else
220 exit 1 211 echo "$0: timeout works"
221else 212 fi
222 echo "$0: firmware comparison works" 213}
223fi
224 214
225# Do a proper load, which should work correctly. 215run_sysfs_main_tests()
226load_fw "$NAME" "$FW" 216{
227if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then 217 test_syfs_timeout
228 echo "$0: firmware was not loaded" >&2 218 # Put timeout high enough for us to do work but not so long that failures
229 exit 1 219 # slow down this test too much.
230else 220 echo 4 >/sys/class/firmware/timeout
231 echo "$0: fallback mechanism works"
232fi
233 221
234load_fw_cancel "nope-$NAME" "$FW" 222 # Load this script instead of the desired firmware.
235if diff -q "$FW" /dev/test_firmware >/dev/null ; then 223 load_fw "$NAME" "$0"
236 echo "$0: firmware was expected to be cancelled" >&2 224 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
237 exit 1 225 echo "$0: firmware was not expected to match" >&2
238else 226 exit 1
239 echo "$0: cancelling fallback mechanism works" 227 else
240fi 228 echo "$0: firmware comparison works"
229 fi
241 230
242if load_fw_custom "$NAME" "$FW" ; then 231 # Do a proper load, which should work correctly.
232 load_fw "$NAME" "$FW"
243 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then 233 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
244 echo "$0: firmware was not loaded" >&2 234 echo "$0: firmware was not loaded" >&2
245 exit 1 235 exit 1
246 else 236 else
247 echo "$0: custom fallback loading mechanism works" 237 echo "$0: fallback mechanism works"
248 fi 238 fi
249fi
250 239
251if load_fw_custom_cancel "nope-$NAME" "$FW" ; then 240 load_fw_cancel "nope-$NAME" "$FW"
252 if diff -q "$FW" /dev/test_firmware >/dev/null ; then 241 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
253 echo "$0: firmware was expected to be cancelled" >&2 242 echo "$0: firmware was expected to be cancelled" >&2
254 exit 1 243 exit 1
255 else 244 else
256 echo "$0: cancelling custom fallback mechanism works" 245 echo "$0: cancelling fallback mechanism works"
257 fi 246 fi
258fi
259 247
260set +e 248 set +e
261load_fw_fallback_with_child "nope-signal-$NAME" "$FW" 249 load_fw_fallback_with_child "nope-signal-$NAME" "$FW"
262if [ "$?" -eq 0 ]; then 250 if [ "$?" -eq 0 ]; then
263 echo "$0: SIGCHLD on sync ignored as expected" >&2 251 echo "$0: SIGCHLD on sync ignored as expected" >&2
264else 252 else
265 echo "$0: error - sync firmware request cancelled due to SIGCHLD" >&2 253 echo "$0: error - sync firmware request cancelled due to SIGCHLD" >&2
266 exit 1 254 exit 1
267fi 255 fi
268set -e 256 set -e
257}
258
259run_sysfs_custom_load_tests()
260{
261 if load_fw_custom "$NAME" "$FW" ; then
262 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
263 echo "$0: firmware was not loaded" >&2
264 exit 1
265 else
266 echo "$0: custom fallback loading mechanism works"
267 fi
268 fi
269
270 if load_fw_custom "$NAME" "$FW" ; then
271 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
272 echo "$0: firmware was not loaded" >&2
273 exit 1
274 else
275 echo "$0: custom fallback loading mechanism works"
276 fi
277 fi
278
279 if load_fw_custom_cancel "nope-$NAME" "$FW" ; then
280 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
281 echo "$0: firmware was expected to be cancelled" >&2
282 exit 1
283 else
284 echo "$0: cancelling custom fallback mechanism works"
285 fi
286 fi
287}
288
289run_sysfs_main_tests
290run_sysfs_custom_load_tests
269 291
270exit 0 292exit 0
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
index b1f20fef36c7..f9508e1a4058 100755
--- a/tools/testing/selftests/firmware/fw_filesystem.sh
+++ b/tools/testing/selftests/firmware/fw_filesystem.sh
@@ -45,7 +45,10 @@ test_finish()
45 if [ "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then 45 if [ "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then
46 echo "$OLD_TIMEOUT" >/sys/class/firmware/timeout 46 echo "$OLD_TIMEOUT" >/sys/class/firmware/timeout
47 fi 47 fi
48 echo -n "$OLD_PATH" >/sys/module/firmware_class/parameters/path 48 if [ "$OLD_FWPATH" = "" ]; then
49 OLD_FWPATH=" "
50 fi
51 echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path
49 rm -f "$FW" 52 rm -f "$FW"
50 rmdir "$FWPATH" 53 rmdir "$FWPATH"
51} 54}
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index bb16cf91f1b5..ce361b9d62cf 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -12,9 +12,24 @@ case `uname -m` in
12 *) OFFS=0;; 12 *) OFFS=0;;
13esac 13esac
14 14
15echo "Setup up to 256 kprobes" 15if [ -d events/kprobes ]; then
16grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \ 16 echo 0 > events/kprobes/enable
17head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||: 17 echo > kprobe_events
18fi
19
20N=0
21echo "Setup up kprobes on first available 256 text symbols"
22grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
23while read i; do
24 echo p ${i}+${OFFS} >> kprobe_events && N=$((N+1)) ||:
25 test $N -eq 256 && break
26done
27
28L=`wc -l kprobe_events`
29if [ $L -ne $N ]; then
30 echo "The number of kprobes events ($L) is not $N"
31 exit_fail
32fi
18 33
19echo 1 > events/kprobes/enable 34echo 1 > events/kprobes/enable
20echo 0 > events/kprobes/enable 35echo 0 > events/kprobes/enable
diff --git a/tools/testing/selftests/gen_kselftest_tar.sh b/tools/testing/selftests/gen_kselftest_tar.sh
index 17d5bd0c0936..a27e2eec3586 100755
--- a/tools/testing/selftests/gen_kselftest_tar.sh
+++ b/tools/testing/selftests/gen_kselftest_tar.sh
@@ -1,13 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2# 2#
3# SPDX-License-Identifier: GPL-2.0
3# gen_kselftest_tar 4# gen_kselftest_tar
4# Generate kselftest tarball 5# Generate kselftest tarball
5# Author: Shuah Khan <shuahkh@osg.samsung.com> 6# Author: Shuah Khan <shuahkh@osg.samsung.com>
6# Copyright (C) 2015 Samsung Electronics Co., Ltd. 7# Copyright (C) 2015 Samsung Electronics Co., Ltd.
7 8
8# This software may be freely redistributed under the terms of the GNU
9# General Public License (GPLv2).
10
11# main 9# main
12main() 10main()
13{ 11{
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 1ae565ed9bf0..1a52b03962a3 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * kselftest.h: kselftest framework return codes to include from 3 * kselftest.h: kselftest framework return codes to include from
3 * selftests. 4 * selftests.
@@ -5,7 +6,6 @@
5 * Copyright (c) 2014 Shuah Khan <shuahkh@osg.samsung.com> 6 * Copyright (c) 2014 Shuah Khan <shuahkh@osg.samsung.com>
6 * Copyright (c) 2014 Samsung Electronics Co., Ltd. 7 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * 8 *
8 * This file is released under the GPLv2.
9 */ 9 */
10#ifndef __KSELFTEST_H 10#ifndef __KSELFTEST_H
11#define __KSELFTEST_H 11#define __KSELFTEST_H
diff --git a/tools/testing/selftests/kselftest_install.sh b/tools/testing/selftests/kselftest_install.sh
index 1555fbdb08da..ec304463883c 100755
--- a/tools/testing/selftests/kselftest_install.sh
+++ b/tools/testing/selftests/kselftest_install.sh
@@ -1,13 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
2# 3#
3# Kselftest Install 4# Kselftest Install
4# Install kselftest tests 5# Install kselftest tests
5# Author: Shuah Khan <shuahkh@osg.samsung.com> 6# Author: Shuah Khan <shuahkh@osg.samsung.com>
6# Copyright (C) 2015 Samsung Electronics Co., Ltd. 7# Copyright (C) 2015 Samsung Electronics Co., Ltd.
7 8
8# This software may be freely redistributed under the terms of the GNU
9# General Public License (GPLv2).
10
11install_loc=`pwd` 9install_loc=`pwd`
12 10
13main() 11main()
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 5bef05d6ba39..7de482a0519d 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -77,7 +77,7 @@ endif
77define EMIT_TESTS 77define EMIT_TESTS
78 @for TEST in $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS); do \ 78 @for TEST in $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS); do \
79 BASENAME_TEST=`basename $$TEST`; \ 79 BASENAME_TEST=`basename $$TEST`; \
80 echo "(./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo \"selftests: $$BASENAME_TEST [PASS]\") || echo \"selftests: $$BASENAME_TEST [FAIL]\""; \ 80 echo "(./$$BASENAME_TEST >> \$$OUTPUT 2>&1 && echo \"selftests: $$BASENAME_TEST [PASS]\") || echo \"selftests: $$BASENAME_TEST [FAIL]\""; \
81 done; 81 done;
82endef 82endef
83 83
diff --git a/tools/testing/selftests/media_tests/Makefile b/tools/testing/selftests/media_tests/Makefile
index be5bd4ffb895..c82cec2497de 100644
--- a/tools/testing/selftests/media_tests/Makefile
+++ b/tools/testing/selftests/media_tests/Makefile
@@ -1,8 +1,5 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2TEST_PROGS := media_device_test media_device_open video_device_test 2TEST_GEN_PROGS := media_device_test media_device_open video_device_test
3all: $(TEST_PROGS) 3all: $(TEST_GEN_PROGS)
4 4
5include ../lib.mk 5include ../lib.mk
6
7clean:
8 rm -fr media_device_test media_device_open video_device_test
diff --git a/tools/testing/selftests/media_tests/media_device_open.c b/tools/testing/selftests/media_tests/media_device_open.c
index 44343c091a20..a5ce5434bafd 100644
--- a/tools/testing/selftests/media_tests/media_device_open.c
+++ b/tools/testing/selftests/media_tests/media_device_open.c
@@ -1,10 +1,11 @@
1// SPDX-License-Identifier: GPL-2.0
2
1/* 3/*
2 * media_device_open.c - Media Controller Device Open Test 4 * media_device_open.c - Media Controller Device Open Test
3 * 5 *
4 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com> 6 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com>
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd. 7 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6 * 8 *
7 * This file is released under the GPLv2.
8 */ 9 */
9 10
10/* 11/*
diff --git a/tools/testing/selftests/media_tests/media_device_test.c b/tools/testing/selftests/media_tests/media_device_test.c
index 5d49943e77d0..421a367e4bb3 100644
--- a/tools/testing/selftests/media_tests/media_device_test.c
+++ b/tools/testing/selftests/media_tests/media_device_test.c
@@ -1,10 +1,11 @@
1// SPDX-License-Identifier: GPL-2.0
2
1/* 3/*
2 * media_device_test.c - Media Controller Device ioctl loop Test 4 * media_device_test.c - Media Controller Device ioctl loop Test
3 * 5 *
4 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com> 6 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com>
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd. 7 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6 * 8 *
7 * This file is released under the GPLv2.
8 */ 9 */
9 10
10/* 11/*
diff --git a/tools/testing/selftests/media_tests/video_device_test.c b/tools/testing/selftests/media_tests/video_device_test.c
index 66d419c28653..0f6aef2e2593 100644
--- a/tools/testing/selftests/media_tests/video_device_test.c
+++ b/tools/testing/selftests/media_tests/video_device_test.c
@@ -1,10 +1,11 @@
1// SPDX-License-Identifier: GPL-2.0
2
1/* 3/*
2 * video_device_test - Video Device Test 4 * video_device_test - Video Device Test
3 * 5 *
4 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com> 6 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com>
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd. 7 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6 * 8 *
7 * This file is released under the GPLv2.
8 */ 9 */
9 10
10/* 11/*
diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c
index 9e674d9514d1..22bffd55a523 100644
--- a/tools/testing/selftests/membarrier/membarrier_test.c
+++ b/tools/testing/selftests/membarrier/membarrier_test.c
@@ -16,49 +16,210 @@ static int sys_membarrier(int cmd, int flags)
16static int test_membarrier_cmd_fail(void) 16static int test_membarrier_cmd_fail(void)
17{ 17{
18 int cmd = -1, flags = 0; 18 int cmd = -1, flags = 0;
19 const char *test_name = "sys membarrier invalid command";
19 20
20 if (sys_membarrier(cmd, flags) != -1) { 21 if (sys_membarrier(cmd, flags) != -1) {
21 ksft_exit_fail_msg( 22 ksft_exit_fail_msg(
22 "sys membarrier invalid command test: command = %d, flags = %d. Should fail, but passed\n", 23 "%s test: command = %d, flags = %d. Should fail, but passed\n",
23 cmd, flags); 24 test_name, cmd, flags);
25 }
26 if (errno != EINVAL) {
27 ksft_exit_fail_msg(
28 "%s test: flags = %d. Should return (%d: \"%s\"), but returned (%d: \"%s\").\n",
29 test_name, flags, EINVAL, strerror(EINVAL),
30 errno, strerror(errno));
24 } 31 }
25 32
26 ksft_test_result_pass( 33 ksft_test_result_pass(
27 "sys membarrier invalid command test: command = %d, flags = %d. Failed as expected\n", 34 "%s test: command = %d, flags = %d, errno = %d. Failed as expected\n",
28 cmd, flags); 35 test_name, cmd, flags, errno);
29 return 0; 36 return 0;
30} 37}
31 38
32static int test_membarrier_flags_fail(void) 39static int test_membarrier_flags_fail(void)
33{ 40{
34 int cmd = MEMBARRIER_CMD_QUERY, flags = 1; 41 int cmd = MEMBARRIER_CMD_QUERY, flags = 1;
42 const char *test_name = "sys membarrier MEMBARRIER_CMD_QUERY invalid flags";
43
44 if (sys_membarrier(cmd, flags) != -1) {
45 ksft_exit_fail_msg(
46 "%s test: flags = %d. Should fail, but passed\n",
47 test_name, flags);
48 }
49 if (errno != EINVAL) {
50 ksft_exit_fail_msg(
51 "%s test: flags = %d. Should return (%d: \"%s\"), but returned (%d: \"%s\").\n",
52 test_name, flags, EINVAL, strerror(EINVAL),
53 errno, strerror(errno));
54 }
55
56 ksft_test_result_pass(
57 "%s test: flags = %d, errno = %d. Failed as expected\n",
58 test_name, flags, errno);
59 return 0;
60}
61
62static int test_membarrier_global_success(void)
63{
64 int cmd = MEMBARRIER_CMD_GLOBAL, flags = 0;
65 const char *test_name = "sys membarrier MEMBARRIER_CMD_GLOBAL";
66
67 if (sys_membarrier(cmd, flags) != 0) {
68 ksft_exit_fail_msg(
69 "%s test: flags = %d, errno = %d\n",
70 test_name, flags, errno);
71 }
72
73 ksft_test_result_pass(
74 "%s test: flags = %d\n", test_name, flags);
75 return 0;
76}
77
78static int test_membarrier_private_expedited_fail(void)
79{
80 int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED, flags = 0;
81 const char *test_name = "sys membarrier MEMBARRIER_CMD_PRIVATE_EXPEDITED not registered failure";
82
83 if (sys_membarrier(cmd, flags) != -1) {
84 ksft_exit_fail_msg(
85 "%s test: flags = %d. Should fail, but passed\n",
86 test_name, flags);
87 }
88 if (errno != EPERM) {
89 ksft_exit_fail_msg(
90 "%s test: flags = %d. Should return (%d: \"%s\"), but returned (%d: \"%s\").\n",
91 test_name, flags, EPERM, strerror(EPERM),
92 errno, strerror(errno));
93 }
94
95 ksft_test_result_pass(
96 "%s test: flags = %d, errno = %d\n",
97 test_name, flags, errno);
98 return 0;
99}
100
101static int test_membarrier_register_private_expedited_success(void)
102{
103 int cmd = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED, flags = 0;
104 const char *test_name = "sys membarrier MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED";
105
106 if (sys_membarrier(cmd, flags) != 0) {
107 ksft_exit_fail_msg(
108 "%s test: flags = %d, errno = %d\n",
109 test_name, flags, errno);
110 }
111
112 ksft_test_result_pass(
113 "%s test: flags = %d\n",
114 test_name, flags);
115 return 0;
116}
117
118static int test_membarrier_private_expedited_success(void)
119{
120 int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED, flags = 0;
121 const char *test_name = "sys membarrier MEMBARRIER_CMD_PRIVATE_EXPEDITED";
122
123 if (sys_membarrier(cmd, flags) != 0) {
124 ksft_exit_fail_msg(
125 "%s test: flags = %d, errno = %d\n",
126 test_name, flags, errno);
127 }
128
129 ksft_test_result_pass(
130 "%s test: flags = %d\n",
131 test_name, flags);
132 return 0;
133}
134
135static int test_membarrier_private_expedited_sync_core_fail(void)
136{
137 int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE, flags = 0;
138 const char *test_name = "sys membarrier MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE not registered failure";
35 139
36 if (sys_membarrier(cmd, flags) != -1) { 140 if (sys_membarrier(cmd, flags) != -1) {
37 ksft_exit_fail_msg( 141 ksft_exit_fail_msg(
38 "sys membarrier MEMBARRIER_CMD_QUERY invalid flags test: flags = %d. Should fail, but passed\n", 142 "%s test: flags = %d. Should fail, but passed\n",
39 flags); 143 test_name, flags);
144 }
145 if (errno != EPERM) {
146 ksft_exit_fail_msg(
147 "%s test: flags = %d. Should return (%d: \"%s\"), but returned (%d: \"%s\").\n",
148 test_name, flags, EPERM, strerror(EPERM),
149 errno, strerror(errno));
150 }
151
152 ksft_test_result_pass(
153 "%s test: flags = %d, errno = %d\n",
154 test_name, flags, errno);
155 return 0;
156}
157
158static int test_membarrier_register_private_expedited_sync_core_success(void)
159{
160 int cmd = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE, flags = 0;
161 const char *test_name = "sys membarrier MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE";
162
163 if (sys_membarrier(cmd, flags) != 0) {
164 ksft_exit_fail_msg(
165 "%s test: flags = %d, errno = %d\n",
166 test_name, flags, errno);
167 }
168
169 ksft_test_result_pass(
170 "%s test: flags = %d\n",
171 test_name, flags);
172 return 0;
173}
174
175static int test_membarrier_private_expedited_sync_core_success(void)
176{
177 int cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED, flags = 0;
178 const char *test_name = "sys membarrier MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE";
179
180 if (sys_membarrier(cmd, flags) != 0) {
181 ksft_exit_fail_msg(
182 "%s test: flags = %d, errno = %d\n",
183 test_name, flags, errno);
40 } 184 }
41 185
42 ksft_test_result_pass( 186 ksft_test_result_pass(
43 "sys membarrier MEMBARRIER_CMD_QUERY invalid flags test: flags = %d. Failed as expected\n", 187 "%s test: flags = %d\n",
44 flags); 188 test_name, flags);
45 return 0; 189 return 0;
46} 190}
47 191
48static int test_membarrier_success(void) 192static int test_membarrier_register_global_expedited_success(void)
49{ 193{
50 int cmd = MEMBARRIER_CMD_SHARED, flags = 0; 194 int cmd = MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED, flags = 0;
51 const char *test_name = "sys membarrier MEMBARRIER_CMD_SHARED\n"; 195 const char *test_name = "sys membarrier MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED";
52 196
53 if (sys_membarrier(cmd, flags) != 0) { 197 if (sys_membarrier(cmd, flags) != 0) {
54 ksft_exit_fail_msg( 198 ksft_exit_fail_msg(
55 "sys membarrier MEMBARRIER_CMD_SHARED test: flags = %d\n", 199 "%s test: flags = %d, errno = %d\n",
56 flags); 200 test_name, flags, errno);
57 } 201 }
58 202
59 ksft_test_result_pass( 203 ksft_test_result_pass(
60 "sys membarrier MEMBARRIER_CMD_SHARED test: flags = %d\n", 204 "%s test: flags = %d\n",
61 flags); 205 test_name, flags);
206 return 0;
207}
208
209static int test_membarrier_global_expedited_success(void)
210{
211 int cmd = MEMBARRIER_CMD_GLOBAL_EXPEDITED, flags = 0;
212 const char *test_name = "sys membarrier MEMBARRIER_CMD_GLOBAL_EXPEDITED";
213
214 if (sys_membarrier(cmd, flags) != 0) {
215 ksft_exit_fail_msg(
216 "%s test: flags = %d, errno = %d\n",
217 test_name, flags, errno);
218 }
219
220 ksft_test_result_pass(
221 "%s test: flags = %d\n",
222 test_name, flags);
62 return 0; 223 return 0;
63} 224}
64 225
@@ -72,7 +233,45 @@ static int test_membarrier(void)
72 status = test_membarrier_flags_fail(); 233 status = test_membarrier_flags_fail();
73 if (status) 234 if (status)
74 return status; 235 return status;
75 status = test_membarrier_success(); 236 status = test_membarrier_global_success();
237 if (status)
238 return status;
239 status = test_membarrier_private_expedited_fail();
240 if (status)
241 return status;
242 status = test_membarrier_register_private_expedited_success();
243 if (status)
244 return status;
245 status = test_membarrier_private_expedited_success();
246 if (status)
247 return status;
248 status = sys_membarrier(MEMBARRIER_CMD_QUERY, 0);
249 if (status < 0) {
250 ksft_test_result_fail("sys_membarrier() failed\n");
251 return status;
252 }
253 if (status & MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) {
254 status = test_membarrier_private_expedited_sync_core_fail();
255 if (status)
256 return status;
257 status = test_membarrier_register_private_expedited_sync_core_success();
258 if (status)
259 return status;
260 status = test_membarrier_private_expedited_sync_core_success();
261 if (status)
262 return status;
263 }
264 /*
265 * It is valid to send a global membarrier from a non-registered
266 * process.
267 */
268 status = test_membarrier_global_expedited_success();
269 if (status)
270 return status;
271 status = test_membarrier_register_global_expedited_success();
272 if (status)
273 return status;
274 status = test_membarrier_global_expedited_success();
76 if (status) 275 if (status)
77 return status; 276 return status;
78 return 0; 277 return 0;
@@ -94,8 +293,10 @@ static int test_membarrier_query(void)
94 } 293 }
95 ksft_exit_fail_msg("sys_membarrier() failed\n"); 294 ksft_exit_fail_msg("sys_membarrier() failed\n");
96 } 295 }
97 if (!(ret & MEMBARRIER_CMD_SHARED)) 296 if (!(ret & MEMBARRIER_CMD_GLOBAL)) {
297 ksft_test_result_fail("sys_membarrier() CMD_GLOBAL query failed\n");
98 ksft_exit_fail_msg("sys_membarrier is not supported.\n"); 298 ksft_exit_fail_msg("sys_membarrier is not supported.\n");
299 }
99 300
100 ksft_test_result_pass("sys_membarrier available\n"); 301 ksft_test_result_pass("sys_membarrier available\n");
101 return 0; 302 return 0;
@@ -108,5 +309,5 @@ int main(int argc, char **argv)
108 test_membarrier_query(); 309 test_membarrier_query();
109 test_membarrier(); 310 test_membarrier();
110 311
111 ksft_exit_pass(); 312 return ksft_exit_pass();
112} 313}
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 3926a0409dda..a5276a91dfbf 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -12,3 +12,8 @@ fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
12include ../lib.mk 12include ../lib.mk
13 13
14$(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs) 14$(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs)
15
16$(OUTPUT)/memfd_test: memfd_test.c common.o
17$(OUTPUT)/fuse_test: fuse_test.c common.o
18
19EXTRA_CLEAN = common.o
diff --git a/tools/testing/selftests/memfd/common.c b/tools/testing/selftests/memfd/common.c
new file mode 100644
index 000000000000..8eb3d75f6e60
--- /dev/null
+++ b/tools/testing/selftests/memfd/common.c
@@ -0,0 +1,46 @@
1// SPDX-License-Identifier: GPL-2.0
2#define _GNU_SOURCE
3#define __EXPORTED_HEADERS__
4
5#include <stdio.h>
6#include <stdlib.h>
7#include <linux/fcntl.h>
8#include <linux/memfd.h>
9#include <unistd.h>
10#include <sys/syscall.h>
11
12#include "common.h"
13
14int hugetlbfs_test = 0;
15
16/*
17 * Copied from mlock2-tests.c
18 */
19unsigned long default_huge_page_size(void)
20{
21 unsigned long hps = 0;
22 char *line = NULL;
23 size_t linelen = 0;
24 FILE *f = fopen("/proc/meminfo", "r");
25
26 if (!f)
27 return 0;
28 while (getline(&line, &linelen, f) > 0) {
29 if (sscanf(line, "Hugepagesize: %lu kB", &hps) == 1) {
30 hps <<= 10;
31 break;
32 }
33 }
34
35 free(line);
36 fclose(f);
37 return hps;
38}
39
40int sys_memfd_create(const char *name, unsigned int flags)
41{
42 if (hugetlbfs_test)
43 flags |= MFD_HUGETLB;
44
45 return syscall(__NR_memfd_create, name, flags);
46}
diff --git a/tools/testing/selftests/memfd/common.h b/tools/testing/selftests/memfd/common.h
new file mode 100644
index 000000000000..522d2c630bd8
--- /dev/null
+++ b/tools/testing/selftests/memfd/common.h
@@ -0,0 +1,9 @@
1#ifndef COMMON_H_
2#define COMMON_H_
3
4extern int hugetlbfs_test;
5
6unsigned long default_huge_page_size(void);
7int sys_memfd_create(const char *name, unsigned int flags);
8
9#endif
diff --git a/tools/testing/selftests/memfd/fuse_test.c b/tools/testing/selftests/memfd/fuse_test.c
index 1ccb7a3eb14b..b018e835737d 100644
--- a/tools/testing/selftests/memfd/fuse_test.c
+++ b/tools/testing/selftests/memfd/fuse_test.c
@@ -33,14 +33,12 @@
33#include <sys/wait.h> 33#include <sys/wait.h>
34#include <unistd.h> 34#include <unistd.h>
35 35
36#include "common.h"
37
36#define MFD_DEF_SIZE 8192 38#define MFD_DEF_SIZE 8192
37#define STACK_SIZE 65536 39#define STACK_SIZE 65536
38 40
39static int sys_memfd_create(const char *name, 41static size_t mfd_def_size = MFD_DEF_SIZE;
40 unsigned int flags)
41{
42 return syscall(__NR_memfd_create, name, flags);
43}
44 42
45static int mfd_assert_new(const char *name, loff_t sz, unsigned int flags) 43static int mfd_assert_new(const char *name, loff_t sz, unsigned int flags)
46{ 44{
@@ -127,7 +125,7 @@ static void *mfd_assert_mmap_shared(int fd)
127 void *p; 125 void *p;
128 126
129 p = mmap(NULL, 127 p = mmap(NULL,
130 MFD_DEF_SIZE, 128 mfd_def_size,
131 PROT_READ | PROT_WRITE, 129 PROT_READ | PROT_WRITE,
132 MAP_SHARED, 130 MAP_SHARED,
133 fd, 131 fd,
@@ -145,7 +143,7 @@ static void *mfd_assert_mmap_private(int fd)
145 void *p; 143 void *p;
146 144
147 p = mmap(NULL, 145 p = mmap(NULL,
148 MFD_DEF_SIZE, 146 mfd_def_size,
149 PROT_READ | PROT_WRITE, 147 PROT_READ | PROT_WRITE,
150 MAP_PRIVATE, 148 MAP_PRIVATE,
151 fd, 149 fd,
@@ -178,7 +176,7 @@ static int sealing_thread_fn(void *arg)
178 usleep(200000); 176 usleep(200000);
179 177
180 /* unmount mapping before sealing to avoid i_mmap_writable failures */ 178 /* unmount mapping before sealing to avoid i_mmap_writable failures */
181 munmap(global_p, MFD_DEF_SIZE); 179 munmap(global_p, mfd_def_size);
182 180
183 /* Try sealing the global file; expect EBUSY or success. Current 181 /* Try sealing the global file; expect EBUSY or success. Current
184 * kernels will never succeed, but in the future, kernels might 182 * kernels will never succeed, but in the future, kernels might
@@ -228,7 +226,7 @@ static void join_sealing_thread(pid_t pid)
228 226
229int main(int argc, char **argv) 227int main(int argc, char **argv)
230{ 228{
231 static const char zero[MFD_DEF_SIZE]; 229 char *zero;
232 int fd, mfd, r; 230 int fd, mfd, r;
233 void *p; 231 void *p;
234 int was_sealed; 232 int was_sealed;
@@ -239,6 +237,25 @@ int main(int argc, char **argv)
239 abort(); 237 abort();
240 } 238 }
241 239
240 if (argc >= 3) {
241 if (!strcmp(argv[2], "hugetlbfs")) {
242 unsigned long hpage_size = default_huge_page_size();
243
244 if (!hpage_size) {
245 printf("Unable to determine huge page size\n");
246 abort();
247 }
248
249 hugetlbfs_test = 1;
250 mfd_def_size = hpage_size * 2;
251 } else {
252 printf("Unknown option: %s\n", argv[2]);
253 abort();
254 }
255 }
256
257 zero = calloc(sizeof(*zero), mfd_def_size);
258
242 /* open FUSE memfd file for GUP testing */ 259 /* open FUSE memfd file for GUP testing */
243 printf("opening: %s\n", argv[1]); 260 printf("opening: %s\n", argv[1]);
244 fd = open(argv[1], O_RDONLY | O_CLOEXEC); 261 fd = open(argv[1], O_RDONLY | O_CLOEXEC);
@@ -249,7 +266,7 @@ int main(int argc, char **argv)
249 266
250 /* create new memfd-object */ 267 /* create new memfd-object */
251 mfd = mfd_assert_new("kern_memfd_fuse", 268 mfd = mfd_assert_new("kern_memfd_fuse",
252 MFD_DEF_SIZE, 269 mfd_def_size,
253 MFD_CLOEXEC | MFD_ALLOW_SEALING); 270 MFD_CLOEXEC | MFD_ALLOW_SEALING);
254 271
255 /* mmap memfd-object for writing */ 272 /* mmap memfd-object for writing */
@@ -268,7 +285,7 @@ int main(int argc, char **argv)
268 * This guarantees that the receive-buffer is pinned for 1s until the 285 * This guarantees that the receive-buffer is pinned for 1s until the
269 * data is written into it. The racing ADD_SEALS should thus fail as 286 * data is written into it. The racing ADD_SEALS should thus fail as
270 * the pages are still pinned. */ 287 * the pages are still pinned. */
271 r = read(fd, p, MFD_DEF_SIZE); 288 r = read(fd, p, mfd_def_size);
272 if (r < 0) { 289 if (r < 0) {
273 printf("read() failed: %m\n"); 290 printf("read() failed: %m\n");
274 abort(); 291 abort();
@@ -295,10 +312,10 @@ int main(int argc, char **argv)
295 * enough to avoid any in-flight writes. */ 312 * enough to avoid any in-flight writes. */
296 313
297 p = mfd_assert_mmap_private(mfd); 314 p = mfd_assert_mmap_private(mfd);
298 if (was_sealed && memcmp(p, zero, MFD_DEF_SIZE)) { 315 if (was_sealed && memcmp(p, zero, mfd_def_size)) {
299 printf("memfd sealed during read() but data not discarded\n"); 316 printf("memfd sealed during read() but data not discarded\n");
300 abort(); 317 abort();
301 } else if (!was_sealed && !memcmp(p, zero, MFD_DEF_SIZE)) { 318 } else if (!was_sealed && !memcmp(p, zero, mfd_def_size)) {
302 printf("memfd sealed after read() but data discarded\n"); 319 printf("memfd sealed after read() but data discarded\n");
303 abort(); 320 abort();
304 } 321 }
@@ -307,6 +324,7 @@ int main(int argc, char **argv)
307 close(fd); 324 close(fd);
308 325
309 printf("fuse: DONE\n"); 326 printf("fuse: DONE\n");
327 free(zero);
310 328
311 return 0; 329 return 0;
312} 330}
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index 132a54f74e88..10baa1652fc2 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -19,7 +19,10 @@
19#include <sys/wait.h> 19#include <sys/wait.h>
20#include <unistd.h> 20#include <unistd.h>
21 21
22#include "common.h"
23
22#define MEMFD_STR "memfd:" 24#define MEMFD_STR "memfd:"
25#define MEMFD_HUGE_STR "memfd-hugetlb:"
23#define SHARED_FT_STR "(shared file-table)" 26#define SHARED_FT_STR "(shared file-table)"
24 27
25#define MFD_DEF_SIZE 8192 28#define MFD_DEF_SIZE 8192
@@ -28,41 +31,8 @@
28/* 31/*
29 * Default is not to test hugetlbfs 32 * Default is not to test hugetlbfs
30 */ 33 */
31static int hugetlbfs_test;
32static size_t mfd_def_size = MFD_DEF_SIZE; 34static size_t mfd_def_size = MFD_DEF_SIZE;
33 35static const char *memfd_str = MEMFD_STR;
34/*
35 * Copied from mlock2-tests.c
36 */
37static unsigned long default_huge_page_size(void)
38{
39 unsigned long hps = 0;
40 char *line = NULL;
41 size_t linelen = 0;
42 FILE *f = fopen("/proc/meminfo", "r");
43
44 if (!f)
45 return 0;
46 while (getline(&line, &linelen, f) > 0) {
47 if (sscanf(line, "Hugepagesize: %lu kB", &hps) == 1) {
48 hps <<= 10;
49 break;
50 }
51 }
52
53 free(line);
54 fclose(f);
55 return hps;
56}
57
58static int sys_memfd_create(const char *name,
59 unsigned int flags)
60{
61 if (hugetlbfs_test)
62 flags |= MFD_HUGETLB;
63
64 return syscall(__NR_memfd_create, name, flags);
65}
66 36
67static int mfd_assert_new(const char *name, loff_t sz, unsigned int flags) 37static int mfd_assert_new(const char *name, loff_t sz, unsigned int flags)
68{ 38{
@@ -513,6 +483,10 @@ static void mfd_assert_grow_write(int fd)
513 static char *buf; 483 static char *buf;
514 ssize_t l; 484 ssize_t l;
515 485
486 /* hugetlbfs does not support write */
487 if (hugetlbfs_test)
488 return;
489
516 buf = malloc(mfd_def_size * 8); 490 buf = malloc(mfd_def_size * 8);
517 if (!buf) { 491 if (!buf) {
518 printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); 492 printf("malloc(%zu) failed: %m\n", mfd_def_size * 8);
@@ -533,6 +507,10 @@ static void mfd_fail_grow_write(int fd)
533 static char *buf; 507 static char *buf;
534 ssize_t l; 508 ssize_t l;
535 509
510 /* hugetlbfs does not support write */
511 if (hugetlbfs_test)
512 return;
513
536 buf = malloc(mfd_def_size * 8); 514 buf = malloc(mfd_def_size * 8);
537 if (!buf) { 515 if (!buf) {
538 printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); 516 printf("malloc(%zu) failed: %m\n", mfd_def_size * 8);
@@ -598,7 +576,7 @@ static void test_create(void)
598 char buf[2048]; 576 char buf[2048];
599 int fd; 577 int fd;
600 578
601 printf("%s CREATE\n", MEMFD_STR); 579 printf("%s CREATE\n", memfd_str);
602 580
603 /* test NULL name */ 581 /* test NULL name */
604 mfd_fail_new(NULL, 0); 582 mfd_fail_new(NULL, 0);
@@ -627,18 +605,13 @@ static void test_create(void)
627 fd = mfd_assert_new("", 0, MFD_CLOEXEC); 605 fd = mfd_assert_new("", 0, MFD_CLOEXEC);
628 close(fd); 606 close(fd);
629 607
630 if (!hugetlbfs_test) { 608 /* verify MFD_ALLOW_SEALING is allowed */
631 /* verify MFD_ALLOW_SEALING is allowed */ 609 fd = mfd_assert_new("", 0, MFD_ALLOW_SEALING);
632 fd = mfd_assert_new("", 0, MFD_ALLOW_SEALING); 610 close(fd);
633 close(fd); 611
634 612 /* verify MFD_ALLOW_SEALING | MFD_CLOEXEC is allowed */
635 /* verify MFD_ALLOW_SEALING | MFD_CLOEXEC is allowed */ 613 fd = mfd_assert_new("", 0, MFD_ALLOW_SEALING | MFD_CLOEXEC);
636 fd = mfd_assert_new("", 0, MFD_ALLOW_SEALING | MFD_CLOEXEC); 614 close(fd);
637 close(fd);
638 } else {
639 /* sealing is not supported on hugetlbfs */
640 mfd_fail_new("", MFD_ALLOW_SEALING);
641 }
642} 615}
643 616
644/* 617/*
@@ -649,11 +622,7 @@ static void test_basic(void)
649{ 622{
650 int fd; 623 int fd;
651 624
652 /* hugetlbfs does not contain sealing support */ 625 printf("%s BASIC\n", memfd_str);
653 if (hugetlbfs_test)
654 return;
655
656 printf("%s BASIC\n", MEMFD_STR);
657 626
658 fd = mfd_assert_new("kern_memfd_basic", 627 fd = mfd_assert_new("kern_memfd_basic",
659 mfd_def_size, 628 mfd_def_size,
@@ -698,28 +667,6 @@ static void test_basic(void)
698} 667}
699 668
700/* 669/*
701 * hugetlbfs doesn't support seals or write, so just verify grow and shrink
702 * on a hugetlbfs file created via memfd_create.
703 */
704static void test_hugetlbfs_grow_shrink(void)
705{
706 int fd;
707
708 printf("%s HUGETLBFS-GROW-SHRINK\n", MEMFD_STR);
709
710 fd = mfd_assert_new("kern_memfd_seal_write",
711 mfd_def_size,
712 MFD_CLOEXEC);
713
714 mfd_assert_read(fd);
715 mfd_assert_write(fd);
716 mfd_assert_shrink(fd);
717 mfd_assert_grow(fd);
718
719 close(fd);
720}
721
722/*
723 * Test SEAL_WRITE 670 * Test SEAL_WRITE
724 * Test whether SEAL_WRITE actually prevents modifications. 671 * Test whether SEAL_WRITE actually prevents modifications.
725 */ 672 */
@@ -727,14 +674,7 @@ static void test_seal_write(void)
727{ 674{
728 int fd; 675 int fd;
729 676
730 /* 677 printf("%s SEAL-WRITE\n", memfd_str);
731 * hugetlbfs does not contain sealing or write support. Just test
732 * basic grow and shrink via test_hugetlbfs_grow_shrink.
733 */
734 if (hugetlbfs_test)
735 return test_hugetlbfs_grow_shrink();
736
737 printf("%s SEAL-WRITE\n", MEMFD_STR);
738 678
739 fd = mfd_assert_new("kern_memfd_seal_write", 679 fd = mfd_assert_new("kern_memfd_seal_write",
740 mfd_def_size, 680 mfd_def_size,
@@ -760,11 +700,7 @@ static void test_seal_shrink(void)
760{ 700{
761 int fd; 701 int fd;
762 702
763 /* hugetlbfs does not contain sealing support */ 703 printf("%s SEAL-SHRINK\n", memfd_str);
764 if (hugetlbfs_test)
765 return;
766
767 printf("%s SEAL-SHRINK\n", MEMFD_STR);
768 704
769 fd = mfd_assert_new("kern_memfd_seal_shrink", 705 fd = mfd_assert_new("kern_memfd_seal_shrink",
770 mfd_def_size, 706 mfd_def_size,
@@ -790,11 +726,7 @@ static void test_seal_grow(void)
790{ 726{
791 int fd; 727 int fd;
792 728
793 /* hugetlbfs does not contain sealing support */ 729 printf("%s SEAL-GROW\n", memfd_str);
794 if (hugetlbfs_test)
795 return;
796
797 printf("%s SEAL-GROW\n", MEMFD_STR);
798 730
799 fd = mfd_assert_new("kern_memfd_seal_grow", 731 fd = mfd_assert_new("kern_memfd_seal_grow",
800 mfd_def_size, 732 mfd_def_size,
@@ -820,11 +752,7 @@ static void test_seal_resize(void)
820{ 752{
821 int fd; 753 int fd;
822 754
823 /* hugetlbfs does not contain sealing support */ 755 printf("%s SEAL-RESIZE\n", memfd_str);
824 if (hugetlbfs_test)
825 return;
826
827 printf("%s SEAL-RESIZE\n", MEMFD_STR);
828 756
829 fd = mfd_assert_new("kern_memfd_seal_resize", 757 fd = mfd_assert_new("kern_memfd_seal_resize",
830 mfd_def_size, 758 mfd_def_size,
@@ -843,32 +771,6 @@ static void test_seal_resize(void)
843} 771}
844 772
845/* 773/*
846 * hugetlbfs does not support seals. Basic test to dup the memfd created
847 * fd and perform some basic operations on it.
848 */
849static void hugetlbfs_dup(char *b_suffix)
850{
851 int fd, fd2;
852
853 printf("%s HUGETLBFS-DUP %s\n", MEMFD_STR, b_suffix);
854
855 fd = mfd_assert_new("kern_memfd_share_dup",
856 mfd_def_size,
857 MFD_CLOEXEC);
858
859 fd2 = mfd_assert_dup(fd);
860
861 mfd_assert_read(fd);
862 mfd_assert_write(fd);
863
864 mfd_assert_shrink(fd2);
865 mfd_assert_grow(fd2);
866
867 close(fd2);
868 close(fd);
869}
870
871/*
872 * Test sharing via dup() 774 * Test sharing via dup()
873 * Test that seals are shared between dupped FDs and they're all equal. 775 * Test that seals are shared between dupped FDs and they're all equal.
874 */ 776 */
@@ -876,16 +778,7 @@ static void test_share_dup(char *banner, char *b_suffix)
876{ 778{
877 int fd, fd2; 779 int fd, fd2;
878 780
879 /* 781 printf("%s %s %s\n", memfd_str, banner, b_suffix);
880 * hugetlbfs does not contain sealing support. Perform some
881 * basic testing on dup'ed fd instead via hugetlbfs_dup.
882 */
883 if (hugetlbfs_test) {
884 hugetlbfs_dup(b_suffix);
885 return;
886 }
887
888 printf("%s %s %s\n", MEMFD_STR, banner, b_suffix);
889 782
890 fd = mfd_assert_new("kern_memfd_share_dup", 783 fd = mfd_assert_new("kern_memfd_share_dup",
891 mfd_def_size, 784 mfd_def_size,
@@ -927,11 +820,7 @@ static void test_share_mmap(char *banner, char *b_suffix)
927 int fd; 820 int fd;
928 void *p; 821 void *p;
929 822
930 /* hugetlbfs does not contain sealing support */ 823 printf("%s %s %s\n", memfd_str, banner, b_suffix);
931 if (hugetlbfs_test)
932 return;
933
934 printf("%s %s %s\n", MEMFD_STR, banner, b_suffix);
935 824
936 fd = mfd_assert_new("kern_memfd_share_mmap", 825 fd = mfd_assert_new("kern_memfd_share_mmap",
937 mfd_def_size, 826 mfd_def_size,
@@ -956,32 +845,6 @@ static void test_share_mmap(char *banner, char *b_suffix)
956} 845}
957 846
958/* 847/*
959 * Basic test to make sure we can open the hugetlbfs fd via /proc and
960 * perform some simple operations on it.
961 */
962static void hugetlbfs_proc_open(char *b_suffix)
963{
964 int fd, fd2;
965
966 printf("%s HUGETLBFS-PROC-OPEN %s\n", MEMFD_STR, b_suffix);
967
968 fd = mfd_assert_new("kern_memfd_share_open",
969 mfd_def_size,
970 MFD_CLOEXEC);
971
972 fd2 = mfd_assert_open(fd, O_RDWR, 0);
973
974 mfd_assert_read(fd);
975 mfd_assert_write(fd);
976
977 mfd_assert_shrink(fd2);
978 mfd_assert_grow(fd2);
979
980 close(fd2);
981 close(fd);
982}
983
984/*
985 * Test sealing with open(/proc/self/fd/%d) 848 * Test sealing with open(/proc/self/fd/%d)
986 * Via /proc we can get access to a separate file-context for the same memfd. 849 * Via /proc we can get access to a separate file-context for the same memfd.
987 * This is *not* like dup(), but like a real separate open(). Make sure the 850 * This is *not* like dup(), but like a real separate open(). Make sure the
@@ -991,16 +854,7 @@ static void test_share_open(char *banner, char *b_suffix)
991{ 854{
992 int fd, fd2; 855 int fd, fd2;
993 856
994 /* 857 printf("%s %s %s\n", memfd_str, banner, b_suffix);
995 * hugetlbfs does not contain sealing support. So test basic
996 * functionality of using /proc fd via hugetlbfs_proc_open
997 */
998 if (hugetlbfs_test) {
999 hugetlbfs_proc_open(b_suffix);
1000 return;
1001 }
1002
1003 printf("%s %s %s\n", MEMFD_STR, banner, b_suffix);
1004 858
1005 fd = mfd_assert_new("kern_memfd_share_open", 859 fd = mfd_assert_new("kern_memfd_share_open",
1006 mfd_def_size, 860 mfd_def_size,
@@ -1043,11 +897,7 @@ static void test_share_fork(char *banner, char *b_suffix)
1043 int fd; 897 int fd;
1044 pid_t pid; 898 pid_t pid;
1045 899
1046 /* hugetlbfs does not contain sealing support */ 900 printf("%s %s %s\n", memfd_str, banner, b_suffix);
1047 if (hugetlbfs_test)
1048 return;
1049
1050 printf("%s %s %s\n", MEMFD_STR, banner, b_suffix);
1051 901
1052 fd = mfd_assert_new("kern_memfd_share_fork", 902 fd = mfd_assert_new("kern_memfd_share_fork",
1053 mfd_def_size, 903 mfd_def_size,
@@ -1083,7 +933,11 @@ int main(int argc, char **argv)
1083 } 933 }
1084 934
1085 hugetlbfs_test = 1; 935 hugetlbfs_test = 1;
936 memfd_str = MEMFD_HUGE_STR;
1086 mfd_def_size = hpage_size * 2; 937 mfd_def_size = hpage_size * 2;
938 } else {
939 printf("Unknown option: %s\n", argv[1]);
940 abort();
1087 } 941 }
1088 } 942 }
1089 943
diff --git a/tools/testing/selftests/memfd/run_fuse_test.sh b/tools/testing/selftests/memfd/run_fuse_test.sh
index 407df68dfe27..22e572e2d66a 100755
--- a/tools/testing/selftests/memfd/run_fuse_test.sh
+++ b/tools/testing/selftests/memfd/run_fuse_test.sh
@@ -10,6 +10,6 @@ set -e
10 10
11mkdir mnt 11mkdir mnt
12./fuse_mnt ./mnt 12./fuse_mnt ./mnt
13./fuse_test ./mnt/memfd 13./fuse_test ./mnt/memfd $@
14fusermount -u ./mnt 14fusermount -u ./mnt
15rmdir ./mnt 15rmdir ./mnt
diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_tests.sh
index daabb350697c..c2d41ed81b24 100755
--- a/tools/testing/selftests/memfd/run_tests.sh
+++ b/tools/testing/selftests/memfd/run_tests.sh
@@ -60,6 +60,7 @@ fi
60# Run the hugetlbfs test 60# Run the hugetlbfs test
61# 61#
62./memfd_test hugetlbfs 62./memfd_test hugetlbfs
63./run_fuse_test.sh hugetlbfs
63 64
64# 65#
65# Give back any huge pages allocated for the test 66# Give back any huge pages allocated for the test
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 500c74db746c..d7c30d366935 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -5,6 +5,7 @@ CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
5CFLAGS += -I../../../../usr/include/ 5CFLAGS += -I../../../../usr/include/
6 6
7TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh 7TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh
8TEST_PROGS += fib_tests.sh
8TEST_GEN_FILES = socket 9TEST_GEN_FILES = socket
9TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy 10TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy
10TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa 11TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
new file mode 100755
index 000000000000..a9154eefb2e2
--- /dev/null
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -0,0 +1,429 @@
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4# This test is for checking IPv4 and IPv6 FIB behavior in response to
5# different events.
6
7ret=0
8
9check_err()
10{
11 if [ $ret -eq 0 ]; then
12 ret=$1
13 fi
14}
15
16check_fail()
17{
18 if [ $1 -eq 0 ]; then
19 ret=1
20 fi
21}
22
23netns_create()
24{
25 local testns=$1
26
27 ip netns add $testns
28 ip netns exec $testns ip link set dev lo up
29}
30
31fib_unreg_unicast_test()
32{
33 ret=0
34
35 netns_create "testns"
36
37 ip netns exec testns ip link add dummy0 type dummy
38 ip netns exec testns ip link set dev dummy0 up
39
40 ip netns exec testns ip address add 198.51.100.1/24 dev dummy0
41 ip netns exec testns ip -6 address add 2001:db8:1::1/64 dev dummy0
42
43 ip netns exec testns ip route get fibmatch 198.51.100.2 &> /dev/null
44 check_err $?
45 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 &> /dev/null
46 check_err $?
47
48 ip netns exec testns ip link del dev dummy0
49 check_err $?
50
51 ip netns exec testns ip route get fibmatch 198.51.100.2 &> /dev/null
52 check_fail $?
53 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 &> /dev/null
54 check_fail $?
55
56 ip netns del testns
57
58 if [ $ret -ne 0 ]; then
59 echo "FAIL: unicast route test"
60 return 1
61 fi
62 echo "PASS: unicast route test"
63}
64
65fib_unreg_multipath_test()
66{
67 ret=0
68
69 netns_create "testns"
70
71 ip netns exec testns ip link add dummy0 type dummy
72 ip netns exec testns ip link set dev dummy0 up
73
74 ip netns exec testns ip link add dummy1 type dummy
75 ip netns exec testns ip link set dev dummy1 up
76
77 ip netns exec testns ip address add 198.51.100.1/24 dev dummy0
78 ip netns exec testns ip -6 address add 2001:db8:1::1/64 dev dummy0
79
80 ip netns exec testns ip address add 192.0.2.1/24 dev dummy1
81 ip netns exec testns ip -6 address add 2001:db8:2::1/64 dev dummy1
82
83 ip netns exec testns ip route add 203.0.113.0/24 \
84 nexthop via 198.51.100.2 dev dummy0 \
85 nexthop via 192.0.2.2 dev dummy1
86 ip netns exec testns ip -6 route add 2001:db8:3::/64 \
87 nexthop via 2001:db8:1::2 dev dummy0 \
88 nexthop via 2001:db8:2::2 dev dummy1
89
90 ip netns exec testns ip route get fibmatch 203.0.113.1 &> /dev/null
91 check_err $?
92 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 &> /dev/null
93 check_err $?
94
95 ip netns exec testns ip link del dev dummy0
96 check_err $?
97
98 ip netns exec testns ip route get fibmatch 203.0.113.1 &> /dev/null
99 check_fail $?
100 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 &> /dev/null
101 # In IPv6 we do not flush the entire multipath route.
102 check_err $?
103
104 ip netns exec testns ip link del dev dummy1
105
106 ip netns del testns
107
108 if [ $ret -ne 0 ]; then
109 echo "FAIL: multipath route test"
110 return 1
111 fi
112 echo "PASS: multipath route test"
113}
114
115fib_unreg_test()
116{
117 echo "Running netdev unregister tests"
118
119 fib_unreg_unicast_test
120 fib_unreg_multipath_test
121}
122
123fib_down_unicast_test()
124{
125 ret=0
126
127 netns_create "testns"
128
129 ip netns exec testns ip link add dummy0 type dummy
130 ip netns exec testns ip link set dev dummy0 up
131
132 ip netns exec testns ip address add 198.51.100.1/24 dev dummy0
133 ip netns exec testns ip -6 address add 2001:db8:1::1/64 dev dummy0
134
135 ip netns exec testns ip route get fibmatch 198.51.100.2 &> /dev/null
136 check_err $?
137 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 &> /dev/null
138 check_err $?
139
140 ip netns exec testns ip link set dev dummy0 down
141 check_err $?
142
143 ip netns exec testns ip route get fibmatch 198.51.100.2 &> /dev/null
144 check_fail $?
145 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 &> /dev/null
146 check_fail $?
147
148 ip netns exec testns ip link del dev dummy0
149
150 ip netns del testns
151
152 if [ $ret -ne 0 ]; then
153 echo "FAIL: unicast route test"
154 return 1
155 fi
156 echo "PASS: unicast route test"
157}
158
159fib_down_multipath_test_do()
160{
161 local down_dev=$1
162 local up_dev=$2
163
164 ip netns exec testns ip route get fibmatch 203.0.113.1 \
165 oif $down_dev &> /dev/null
166 check_fail $?
167 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 \
168 oif $down_dev &> /dev/null
169 check_fail $?
170
171 ip netns exec testns ip route get fibmatch 203.0.113.1 \
172 oif $up_dev &> /dev/null
173 check_err $?
174 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 \
175 oif $up_dev &> /dev/null
176 check_err $?
177
178 ip netns exec testns ip route get fibmatch 203.0.113.1 | \
179 grep $down_dev | grep -q "dead linkdown"
180 check_err $?
181 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 | \
182 grep $down_dev | grep -q "dead linkdown"
183 check_err $?
184
185 ip netns exec testns ip route get fibmatch 203.0.113.1 | \
186 grep $up_dev | grep -q "dead linkdown"
187 check_fail $?
188 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 | \
189 grep $up_dev | grep -q "dead linkdown"
190 check_fail $?
191}
192
193fib_down_multipath_test()
194{
195 ret=0
196
197 netns_create "testns"
198
199 ip netns exec testns ip link add dummy0 type dummy
200 ip netns exec testns ip link set dev dummy0 up
201
202 ip netns exec testns ip link add dummy1 type dummy
203 ip netns exec testns ip link set dev dummy1 up
204
205 ip netns exec testns ip address add 198.51.100.1/24 dev dummy0
206 ip netns exec testns ip -6 address add 2001:db8:1::1/64 dev dummy0
207
208 ip netns exec testns ip address add 192.0.2.1/24 dev dummy1
209 ip netns exec testns ip -6 address add 2001:db8:2::1/64 dev dummy1
210
211 ip netns exec testns ip route add 203.0.113.0/24 \
212 nexthop via 198.51.100.2 dev dummy0 \
213 nexthop via 192.0.2.2 dev dummy1
214 ip netns exec testns ip -6 route add 2001:db8:3::/64 \
215 nexthop via 2001:db8:1::2 dev dummy0 \
216 nexthop via 2001:db8:2::2 dev dummy1
217
218 ip netns exec testns ip route get fibmatch 203.0.113.1 &> /dev/null
219 check_err $?
220 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 &> /dev/null
221 check_err $?
222
223 ip netns exec testns ip link set dev dummy0 down
224 check_err $?
225
226 fib_down_multipath_test_do "dummy0" "dummy1"
227
228 ip netns exec testns ip link set dev dummy0 up
229 check_err $?
230 ip netns exec testns ip link set dev dummy1 down
231 check_err $?
232
233 fib_down_multipath_test_do "dummy1" "dummy0"
234
235 ip netns exec testns ip link set dev dummy0 down
236 check_err $?
237
238 ip netns exec testns ip route get fibmatch 203.0.113.1 &> /dev/null
239 check_fail $?
240 ip netns exec testns ip -6 route get fibmatch 2001:db8:3::1 &> /dev/null
241 check_fail $?
242
243 ip netns exec testns ip link del dev dummy1
244 ip netns exec testns ip link del dev dummy0
245
246 ip netns del testns
247
248 if [ $ret -ne 0 ]; then
249 echo "FAIL: multipath route test"
250 return 1
251 fi
252 echo "PASS: multipath route test"
253}
254
255fib_down_test()
256{
257 echo "Running netdev down tests"
258
259 fib_down_unicast_test
260 fib_down_multipath_test
261}
262
263fib_carrier_local_test()
264{
265 ret=0
266
267 # Local routes should not be affected when carrier changes.
268 netns_create "testns"
269
270 ip netns exec testns ip link add dummy0 type dummy
271 ip netns exec testns ip link set dev dummy0 up
272
273 ip netns exec testns ip link set dev dummy0 carrier on
274
275 ip netns exec testns ip address add 198.51.100.1/24 dev dummy0
276 ip netns exec testns ip -6 address add 2001:db8:1::1/64 dev dummy0
277
278 ip netns exec testns ip route get fibmatch 198.51.100.1 &> /dev/null
279 check_err $?
280 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::1 &> /dev/null
281 check_err $?
282
283 ip netns exec testns ip route get fibmatch 198.51.100.1 | \
284 grep -q "linkdown"
285 check_fail $?
286 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::1 | \
287 grep -q "linkdown"
288 check_fail $?
289
290 ip netns exec testns ip link set dev dummy0 carrier off
291
292 ip netns exec testns ip route get fibmatch 198.51.100.1 &> /dev/null
293 check_err $?
294 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::1 &> /dev/null
295 check_err $?
296
297 ip netns exec testns ip route get fibmatch 198.51.100.1 | \
298 grep -q "linkdown"
299 check_fail $?
300 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::1 | \
301 grep -q "linkdown"
302 check_fail $?
303
304 ip netns exec testns ip address add 192.0.2.1/24 dev dummy0
305 ip netns exec testns ip -6 address add 2001:db8:2::1/64 dev dummy0
306
307 ip netns exec testns ip route get fibmatch 192.0.2.1 &> /dev/null
308 check_err $?
309 ip netns exec testns ip -6 route get fibmatch 2001:db8:2::1 &> /dev/null
310 check_err $?
311
312 ip netns exec testns ip route get fibmatch 192.0.2.1 | \
313 grep -q "linkdown"
314 check_fail $?
315 ip netns exec testns ip -6 route get fibmatch 2001:db8:2::1 | \
316 grep -q "linkdown"
317 check_fail $?
318
319 ip netns exec testns ip link del dev dummy0
320
321 ip netns del testns
322
323 if [ $ret -ne 0 ]; then
324 echo "FAIL: local route carrier test"
325 return 1
326 fi
327 echo "PASS: local route carrier test"
328}
329
330fib_carrier_unicast_test()
331{
332 ret=0
333
334 netns_create "testns"
335
336 ip netns exec testns ip link add dummy0 type dummy
337 ip netns exec testns ip link set dev dummy0 up
338
339 ip netns exec testns ip link set dev dummy0 carrier on
340
341 ip netns exec testns ip address add 198.51.100.1/24 dev dummy0
342 ip netns exec testns ip -6 address add 2001:db8:1::1/64 dev dummy0
343
344 ip netns exec testns ip route get fibmatch 198.51.100.2 &> /dev/null
345 check_err $?
346 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 &> /dev/null
347 check_err $?
348
349 ip netns exec testns ip route get fibmatch 198.51.100.2 | \
350 grep -q "linkdown"
351 check_fail $?
352 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 | \
353 grep -q "linkdown"
354 check_fail $?
355
356 ip netns exec testns ip link set dev dummy0 carrier off
357
358 ip netns exec testns ip route get fibmatch 198.51.100.2 &> /dev/null
359 check_err $?
360 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 &> /dev/null
361 check_err $?
362
363 ip netns exec testns ip route get fibmatch 198.51.100.2 | \
364 grep -q "linkdown"
365 check_err $?
366 ip netns exec testns ip -6 route get fibmatch 2001:db8:1::2 | \
367 grep -q "linkdown"
368 check_err $?
369
370 ip netns exec testns ip address add 192.0.2.1/24 dev dummy0
371 ip netns exec testns ip -6 address add 2001:db8:2::1/64 dev dummy0
372
373 ip netns exec testns ip route get fibmatch 192.0.2.2 &> /dev/null
374 check_err $?
375 ip netns exec testns ip -6 route get fibmatch 2001:db8:2::2 &> /dev/null
376 check_err $?
377
378 ip netns exec testns ip route get fibmatch 192.0.2.2 | \
379 grep -q "linkdown"
380 check_err $?
381 ip netns exec testns ip -6 route get fibmatch 2001:db8:2::2 | \
382 grep -q "linkdown"
383 check_err $?
384
385 ip netns exec testns ip link del dev dummy0
386
387 ip netns del testns
388
389 if [ $ret -ne 0 ]; then
390 echo "FAIL: unicast route carrier test"
391 return 1
392 fi
393 echo "PASS: unicast route carrier test"
394}
395
396fib_carrier_test()
397{
398 echo "Running netdev carrier change tests"
399
400 fib_carrier_local_test
401 fib_carrier_unicast_test
402}
403
404fib_test()
405{
406 fib_unreg_test
407 fib_down_test
408 fib_carrier_test
409}
410
411if [ "$(id -u)" -ne 0 ];then
412 echo "SKIP: Need root privileges"
413 exit 0
414fi
415
416if [ ! -x "$(command -v ip)" ]; then
417 echo "SKIP: Could not run test without ip tool"
418 exit 0
419fi
420
421ip route help 2>&1 | grep -q fibmatch
422if [ $? -ne 0 ]; then
423 echo "SKIP: iproute2 too old, missing fibmatch"
424 exit 0
425fi
426
427fib_test
428
429exit $ret
diff --git a/tools/testing/selftests/net/msg_zerocopy.c b/tools/testing/selftests/net/msg_zerocopy.c
index 3ab6ec403905..e11fe84de0fd 100644
--- a/tools/testing/selftests/net/msg_zerocopy.c
+++ b/tools/testing/selftests/net/msg_zerocopy.c
@@ -259,22 +259,28 @@ static int setup_ip6h(struct ipv6hdr *ip6h, uint16_t payload_len)
259 return sizeof(*ip6h); 259 return sizeof(*ip6h);
260} 260}
261 261
262static void setup_sockaddr(int domain, const char *str_addr, void *sockaddr) 262
263static void setup_sockaddr(int domain, const char *str_addr,
264 struct sockaddr_storage *sockaddr)
263{ 265{
264 struct sockaddr_in6 *addr6 = (void *) sockaddr; 266 struct sockaddr_in6 *addr6 = (void *) sockaddr;
265 struct sockaddr_in *addr4 = (void *) sockaddr; 267 struct sockaddr_in *addr4 = (void *) sockaddr;
266 268
267 switch (domain) { 269 switch (domain) {
268 case PF_INET: 270 case PF_INET:
271 memset(addr4, 0, sizeof(*addr4));
269 addr4->sin_family = AF_INET; 272 addr4->sin_family = AF_INET;
270 addr4->sin_port = htons(cfg_port); 273 addr4->sin_port = htons(cfg_port);
271 if (inet_pton(AF_INET, str_addr, &(addr4->sin_addr)) != 1) 274 if (str_addr &&
275 inet_pton(AF_INET, str_addr, &(addr4->sin_addr)) != 1)
272 error(1, 0, "ipv4 parse error: %s", str_addr); 276 error(1, 0, "ipv4 parse error: %s", str_addr);
273 break; 277 break;
274 case PF_INET6: 278 case PF_INET6:
279 memset(addr6, 0, sizeof(*addr6));
275 addr6->sin6_family = AF_INET6; 280 addr6->sin6_family = AF_INET6;
276 addr6->sin6_port = htons(cfg_port); 281 addr6->sin6_port = htons(cfg_port);
277 if (inet_pton(AF_INET6, str_addr, &(addr6->sin6_addr)) != 1) 282 if (str_addr &&
283 inet_pton(AF_INET6, str_addr, &(addr6->sin6_addr)) != 1)
278 error(1, 0, "ipv6 parse error: %s", str_addr); 284 error(1, 0, "ipv6 parse error: %s", str_addr);
279 break; 285 break;
280 default: 286 default:
@@ -603,6 +609,7 @@ static void parse_opts(int argc, char **argv)
603 sizeof(struct tcphdr) - 609 sizeof(struct tcphdr) -
604 40 /* max tcp options */; 610 40 /* max tcp options */;
605 int c; 611 int c;
612 char *daddr = NULL, *saddr = NULL;
606 613
607 cfg_payload_len = max_payload_len; 614 cfg_payload_len = max_payload_len;
608 615
@@ -627,7 +634,7 @@ static void parse_opts(int argc, char **argv)
627 cfg_cpu = strtol(optarg, NULL, 0); 634 cfg_cpu = strtol(optarg, NULL, 0);
628 break; 635 break;
629 case 'D': 636 case 'D':
630 setup_sockaddr(cfg_family, optarg, &cfg_dst_addr); 637 daddr = optarg;
631 break; 638 break;
632 case 'i': 639 case 'i':
633 cfg_ifindex = if_nametoindex(optarg); 640 cfg_ifindex = if_nametoindex(optarg);
@@ -638,7 +645,7 @@ static void parse_opts(int argc, char **argv)
638 cfg_cork_mixed = true; 645 cfg_cork_mixed = true;
639 break; 646 break;
640 case 'p': 647 case 'p':
641 cfg_port = htons(strtoul(optarg, NULL, 0)); 648 cfg_port = strtoul(optarg, NULL, 0);
642 break; 649 break;
643 case 'r': 650 case 'r':
644 cfg_rx = true; 651 cfg_rx = true;
@@ -647,7 +654,7 @@ static void parse_opts(int argc, char **argv)
647 cfg_payload_len = strtoul(optarg, NULL, 0); 654 cfg_payload_len = strtoul(optarg, NULL, 0);
648 break; 655 break;
649 case 'S': 656 case 'S':
650 setup_sockaddr(cfg_family, optarg, &cfg_src_addr); 657 saddr = optarg;
651 break; 658 break;
652 case 't': 659 case 't':
653 cfg_runtime_ms = 200 + strtoul(optarg, NULL, 10) * 1000; 660 cfg_runtime_ms = 200 + strtoul(optarg, NULL, 10) * 1000;
@@ -660,6 +667,8 @@ static void parse_opts(int argc, char **argv)
660 break; 667 break;
661 } 668 }
662 } 669 }
670 setup_sockaddr(cfg_family, daddr, &cfg_dst_addr);
671 setup_sockaddr(cfg_family, saddr, &cfg_src_addr);
663 672
664 if (cfg_payload_len > max_payload_len) 673 if (cfg_payload_len > max_payload_len)
665 error(1, 0, "-s: payload exceeds max (%d)", max_payload_len); 674 error(1, 0, "-s: payload exceeds max (%d)", max_payload_len);
diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
index 5215493166c9..a622eeecc3a6 100755
--- a/tools/testing/selftests/net/rtnetlink.sh
+++ b/tools/testing/selftests/net/rtnetlink.sh
@@ -502,6 +502,231 @@ kci_test_macsec()
502 echo "PASS: macsec" 502 echo "PASS: macsec"
503} 503}
504 504
505kci_test_gretap()
506{
507 testns="testns"
508 DEV_NS=gretap00
509 ret=0
510
511 ip netns add "$testns"
512 if [ $? -ne 0 ]; then
513 echo "SKIP gretap tests: cannot add net namespace $testns"
514 return 1
515 fi
516
517 ip link help gretap 2>&1 | grep -q "^Usage:"
518 if [ $? -ne 0 ];then
519 echo "SKIP: gretap: iproute2 too old"
520 return 1
521 fi
522
523 # test native tunnel
524 ip netns exec "$testns" ip link add dev "$DEV_NS" type gretap seq \
525 key 102 local 172.16.1.100 remote 172.16.1.200
526 check_err $?
527
528 ip netns exec "$testns" ip addr add dev "$DEV_NS" 10.1.1.100/24
529 check_err $?
530
531 ip netns exec "$testns" ip link set dev $DEV_NS up
532 check_err $?
533
534 ip netns exec "$testns" ip link del "$DEV_NS"
535 check_err $?
536
537 # test external mode
538 ip netns exec "$testns" ip link add dev "$DEV_NS" type gretap external
539 check_err $?
540
541 ip netns exec "$testns" ip link del "$DEV_NS"
542 check_err $?
543
544 if [ $ret -ne 0 ]; then
545 echo "FAIL: gretap"
546 return 1
547 fi
548 echo "PASS: gretap"
549
550 ip netns del "$testns"
551}
552
553kci_test_ip6gretap()
554{
555 testns="testns"
556 DEV_NS=ip6gretap00
557 ret=0
558
559 ip netns add "$testns"
560 if [ $? -ne 0 ]; then
561 echo "SKIP ip6gretap tests: cannot add net namespace $testns"
562 return 1
563 fi
564
565 ip link help ip6gretap 2>&1 | grep -q "^Usage:"
566 if [ $? -ne 0 ];then
567 echo "SKIP: ip6gretap: iproute2 too old"
568 return 1
569 fi
570
571 # test native tunnel
572 ip netns exec "$testns" ip link add dev "$DEV_NS" type ip6gretap seq \
573 key 102 local fc00:100::1 remote fc00:100::2
574 check_err $?
575
576 ip netns exec "$testns" ip addr add dev "$DEV_NS" fc00:200::1/96
577 check_err $?
578
579 ip netns exec "$testns" ip link set dev $DEV_NS up
580 check_err $?
581
582 ip netns exec "$testns" ip link del "$DEV_NS"
583 check_err $?
584
585 # test external mode
586 ip netns exec "$testns" ip link add dev "$DEV_NS" type ip6gretap external
587 check_err $?
588
589 ip netns exec "$testns" ip link del "$DEV_NS"
590 check_err $?
591
592 if [ $ret -ne 0 ]; then
593 echo "FAIL: ip6gretap"
594 return 1
595 fi
596 echo "PASS: ip6gretap"
597
598 ip netns del "$testns"
599}
600
601kci_test_erspan()
602{
603 testns="testns"
604 DEV_NS=erspan00
605 ret=0
606
607 ip link help erspan 2>&1 | grep -q "^Usage:"
608 if [ $? -ne 0 ];then
609 echo "SKIP: erspan: iproute2 too old"
610 return 1
611 fi
612
613 ip netns add "$testns"
614 if [ $? -ne 0 ]; then
615 echo "SKIP erspan tests: cannot add net namespace $testns"
616 return 1
617 fi
618
619 # test native tunnel erspan v1
620 ip netns exec "$testns" ip link add dev "$DEV_NS" type erspan seq \
621 key 102 local 172.16.1.100 remote 172.16.1.200 \
622 erspan_ver 1 erspan 488
623 check_err $?
624
625 ip netns exec "$testns" ip addr add dev "$DEV_NS" 10.1.1.100/24
626 check_err $?
627
628 ip netns exec "$testns" ip link set dev $DEV_NS up
629 check_err $?
630
631 ip netns exec "$testns" ip link del "$DEV_NS"
632 check_err $?
633
634 # test native tunnel erspan v2
635 ip netns exec "$testns" ip link add dev "$DEV_NS" type erspan seq \
636 key 102 local 172.16.1.100 remote 172.16.1.200 \
637 erspan_ver 2 erspan_dir ingress erspan_hwid 7
638 check_err $?
639
640 ip netns exec "$testns" ip addr add dev "$DEV_NS" 10.1.1.100/24
641 check_err $?
642
643 ip netns exec "$testns" ip link set dev $DEV_NS up
644 check_err $?
645
646 ip netns exec "$testns" ip link del "$DEV_NS"
647 check_err $?
648
649 # test external mode
650 ip netns exec "$testns" ip link add dev "$DEV_NS" type erspan external
651 check_err $?
652
653 ip netns exec "$testns" ip link del "$DEV_NS"
654 check_err $?
655
656 if [ $ret -ne 0 ]; then
657 echo "FAIL: erspan"
658 return 1
659 fi
660 echo "PASS: erspan"
661
662 ip netns del "$testns"
663}
664
665kci_test_ip6erspan()
666{
667 testns="testns"
668 DEV_NS=ip6erspan00
669 ret=0
670
671 ip link help ip6erspan 2>&1 | grep -q "^Usage:"
672 if [ $? -ne 0 ];then
673 echo "SKIP: ip6erspan: iproute2 too old"
674 return 1
675 fi
676
677 ip netns add "$testns"
678 if [ $? -ne 0 ]; then
679 echo "SKIP ip6erspan tests: cannot add net namespace $testns"
680 return 1
681 fi
682
683 # test native tunnel ip6erspan v1
684 ip netns exec "$testns" ip link add dev "$DEV_NS" type ip6erspan seq \
685 key 102 local fc00:100::1 remote fc00:100::2 \
686 erspan_ver 1 erspan 488
687 check_err $?
688
689 ip netns exec "$testns" ip addr add dev "$DEV_NS" 10.1.1.100/24
690 check_err $?
691
692 ip netns exec "$testns" ip link set dev $DEV_NS up
693 check_err $?
694
695 ip netns exec "$testns" ip link del "$DEV_NS"
696 check_err $?
697
698 # test native tunnel ip6erspan v2
699 ip netns exec "$testns" ip link add dev "$DEV_NS" type ip6erspan seq \
700 key 102 local fc00:100::1 remote fc00:100::2 \
701 erspan_ver 2 erspan_dir ingress erspan_hwid 7
702 check_err $?
703
704 ip netns exec "$testns" ip addr add dev "$DEV_NS" 10.1.1.100/24
705 check_err $?
706
707 ip netns exec "$testns" ip link set dev $DEV_NS up
708 check_err $?
709
710 ip netns exec "$testns" ip link del "$DEV_NS"
711 check_err $?
712
713 # test external mode
714 ip netns exec "$testns" ip link add dev "$DEV_NS" \
715 type ip6erspan external
716 check_err $?
717
718 ip netns exec "$testns" ip link del "$DEV_NS"
719 check_err $?
720
721 if [ $ret -ne 0 ]; then
722 echo "FAIL: ip6erspan"
723 return 1
724 fi
725 echo "PASS: ip6erspan"
726
727 ip netns del "$testns"
728}
729
505kci_test_rtnl() 730kci_test_rtnl()
506{ 731{
507 kci_add_dummy 732 kci_add_dummy
@@ -514,6 +739,10 @@ kci_test_rtnl()
514 kci_test_route_get 739 kci_test_route_get
515 kci_test_tc 740 kci_test_tc
516 kci_test_gre 741 kci_test_gre
742 kci_test_gretap
743 kci_test_ip6gretap
744 kci_test_erspan
745 kci_test_ip6erspan
517 kci_test_bridge 746 kci_test_bridge
518 kci_test_addrlabel 747 kci_test_addrlabel
519 kci_test_ifalias 748 kci_test_ifalias
diff --git a/tools/testing/selftests/nsfs/pidns.c b/tools/testing/selftests/nsfs/pidns.c
index 1182d4e437a2..e0d86e1668c0 100644
--- a/tools/testing/selftests/nsfs/pidns.c
+++ b/tools/testing/selftests/nsfs/pidns.c
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
70 return pr_err("NS_GET_PARENT returned a wrong namespace"); 70 return pr_err("NS_GET_PARENT returned a wrong namespace");
71 71
72 if (ioctl(pns, NS_GET_PARENT) >= 0 || errno != EPERM) 72 if (ioctl(pns, NS_GET_PARENT) >= 0 || errno != EPERM)
73 return pr_err("Don't get EPERM");; 73 return pr_err("Don't get EPERM");
74 } 74 }
75 75
76 kill(pid, SIGKILL); 76 kill(pid, SIGKILL);
diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh
index 5fc7ad359e21..08cbfbbc7029 100755
--- a/tools/testing/selftests/ntb/ntb_test.sh
+++ b/tools/testing/selftests/ntb/ntb_test.sh
@@ -18,7 +18,6 @@ LIST_DEVS=FALSE
18 18
19DEBUGFS=${DEBUGFS-/sys/kernel/debug} 19DEBUGFS=${DEBUGFS-/sys/kernel/debug}
20 20
21DB_BITMASK=0x7FFF
22PERF_RUN_ORDER=32 21PERF_RUN_ORDER=32
23MAX_MW_SIZE=0 22MAX_MW_SIZE=0
24RUN_DMA_TESTS= 23RUN_DMA_TESTS=
@@ -39,15 +38,17 @@ function show_help()
39 echo "be highly recommended." 38 echo "be highly recommended."
40 echo 39 echo
41 echo "Options:" 40 echo "Options:"
42 echo " -b BITMASK doorbell clear bitmask for ntb_tool"
43 echo " -C don't cleanup ntb modules on exit" 41 echo " -C don't cleanup ntb modules on exit"
44 echo " -d run dma tests"
45 echo " -h show this help message" 42 echo " -h show this help message"
46 echo " -l list available local and remote PCI ids" 43 echo " -l list available local and remote PCI ids"
47 echo " -r REMOTE_HOST specify the remote's hostname to connect" 44 echo " -r REMOTE_HOST specify the remote's hostname to connect"
48 echo " to for the test (using ssh)" 45 echo " to for the test (using ssh)"
49 echo " -p NUM ntb_perf run order (default: $PERF_RUN_ORDER)" 46 echo " -m MW_SIZE memory window size for ntb_tool"
50 echo " -w max_mw_size maxmium memory window size" 47 echo " (default: $MW_SIZE)"
48 echo " -d run dma tests for ntb_perf"
49 echo " -p ORDER total data order for ntb_perf"
50 echo " (default: $PERF_RUN_ORDER)"
51 echo " -w MAX_MW_SIZE maxmium memory window size for ntb_perf"
51 echo 52 echo
52} 53}
53 54
@@ -56,7 +57,6 @@ function parse_args()
56 OPTIND=0 57 OPTIND=0
57 while getopts "b:Cdhlm:r:p:w:" opt; do 58 while getopts "b:Cdhlm:r:p:w:" opt; do
58 case "$opt" in 59 case "$opt" in
59 b) DB_BITMASK=${OPTARG} ;;
60 C) DONT_CLEANUP=1 ;; 60 C) DONT_CLEANUP=1 ;;
61 d) RUN_DMA_TESTS=1 ;; 61 d) RUN_DMA_TESTS=1 ;;
62 h) show_help; exit 0 ;; 62 h) show_help; exit 0 ;;
@@ -87,7 +87,7 @@ set -e
87 87
88function _modprobe() 88function _modprobe()
89{ 89{
90 modprobe "$@" 90 modprobe "$@"
91 91
92 if [[ "$REMOTE_HOST" != "" ]]; then 92 if [[ "$REMOTE_HOST" != "" ]]; then
93 ssh "$REMOTE_HOST" modprobe "$@" 93 ssh "$REMOTE_HOST" modprobe "$@"
@@ -127,15 +127,70 @@ function write_file()
127 fi 127 fi
128} 128}
129 129
130function check_file()
131{
132 split_remote $1
133
134 if [[ "$REMOTE" != "" ]]; then
135 ssh "$REMOTE" "[[ -e ${VPATH} ]]"
136 else
137 [[ -e ${VPATH} ]]
138 fi
139}
140
141function subdirname()
142{
143 echo $(basename $(dirname $1)) 2> /dev/null
144}
145
146function find_pidx()
147{
148 PORT=$1
149 PPATH=$2
150
151 for ((i = 0; i < 64; i++)); do
152 PEER_DIR="$PPATH/peer$i"
153
154 check_file ${PEER_DIR} || break
155
156 PEER_PORT=$(read_file "${PEER_DIR}/port")
157 if [[ ${PORT} -eq $PEER_PORT ]]; then
158 echo $i
159 return 0
160 fi
161 done
162
163 return 1
164}
165
166function port_test()
167{
168 LOC=$1
169 REM=$2
170
171 echo "Running port tests on: $(basename $LOC) / $(basename $REM)"
172
173 LOCAL_PORT=$(read_file "$LOC/port")
174 REMOTE_PORT=$(read_file "$REM/port")
175
176 LOCAL_PIDX=$(find_pidx ${REMOTE_PORT} "$LOC")
177 REMOTE_PIDX=$(find_pidx ${LOCAL_PORT} "$REM")
178
179 echo "Local port ${LOCAL_PORT} with index ${REMOTE_PIDX} on remote host"
180 echo "Peer port ${REMOTE_PORT} with index ${LOCAL_PIDX} on local host"
181
182 echo " Passed"
183}
184
130function link_test() 185function link_test()
131{ 186{
132 LOC=$1 187 LOC=$1
133 REM=$2 188 REM=$2
134 EXP=0 189 EXP=0
135 190
136 echo "Running link tests on: $(basename $LOC) / $(basename $REM)" 191 echo "Running link tests on: $(subdirname $LOC) / $(subdirname $REM)"
137 192
138 if ! write_file "N" "$LOC/link" 2> /dev/null; then 193 if ! write_file "N" "$LOC/../link" 2> /dev/null; then
139 echo " Unsupported" 194 echo " Unsupported"
140 return 195 return
141 fi 196 fi
@@ -143,12 +198,11 @@ function link_test()
143 write_file "N" "$LOC/link_event" 198 write_file "N" "$LOC/link_event"
144 199
145 if [[ $(read_file "$REM/link") != "N" ]]; then 200 if [[ $(read_file "$REM/link") != "N" ]]; then
146 echo "Expected remote link to be down in $REM/link" >&2 201 echo "Expected link to be down in $REM/link" >&2
147 exit -1 202 exit -1
148 fi 203 fi
149 204
150 write_file "Y" "$LOC/link" 205 write_file "Y" "$LOC/../link"
151 write_file "Y" "$LOC/link_event"
152 206
153 echo " Passed" 207 echo " Passed"
154} 208}
@@ -161,58 +215,136 @@ function doorbell_test()
161 215
162 echo "Running db tests on: $(basename $LOC) / $(basename $REM)" 216 echo "Running db tests on: $(basename $LOC) / $(basename $REM)"
163 217
164 write_file "c $DB_BITMASK" "$REM/db" 218 DB_VALID_MASK=$(read_file "$LOC/db_valid_mask")
219
220 write_file "c $DB_VALID_MASK" "$REM/db"
165 221
166 for ((i=1; i <= 8; i++)); do 222 for ((i = 0; i < 64; i++)); do
167 let DB=$(read_file "$REM/db") || true 223 DB=$(read_file "$REM/db")
168 if [[ "$DB" != "$EXP" ]]; then 224 if [[ "$DB" -ne "$EXP" ]]; then
169 echo "Doorbell doesn't match expected value $EXP " \ 225 echo "Doorbell doesn't match expected value $EXP " \
170 "in $REM/db" >&2 226 "in $REM/db" >&2
171 exit -1 227 exit -1
172 fi 228 fi
173 229
174 let "MASK=1 << ($i-1)" || true 230 let "MASK = (1 << $i) & $DB_VALID_MASK" || true
175 let "EXP=$EXP | $MASK" || true 231 let "EXP = $EXP | $MASK" || true
232
176 write_file "s $MASK" "$LOC/peer_db" 233 write_file "s $MASK" "$LOC/peer_db"
177 done 234 done
178 235
236 write_file "c $DB_VALID_MASK" "$REM/db_mask"
237 write_file $DB_VALID_MASK "$REM/db_event"
238 write_file "s $DB_VALID_MASK" "$REM/db_mask"
239
240 write_file "c $DB_VALID_MASK" "$REM/db"
241
179 echo " Passed" 242 echo " Passed"
180} 243}
181 244
182function read_spad() 245function get_files_count()
183{ 246{
184 VPATH=$1 247 NAME=$1
185 IDX=$2 248 LOC=$2
249
250 split_remote $LOC
186 251
187 ROW=($(read_file "$VPATH" | grep -e "^$IDX")) 252 if [[ "$REMOTE" == "" ]]; then
188 let VAL=${ROW[1]} || true 253 echo $(ls -1 "$LOC"/${NAME}* 2>/dev/null | wc -l)
189 echo $VAL 254 else
255 echo $(ssh "$REMOTE" "ls -1 \"$VPATH\"/${NAME}* | \
256 wc -l" 2> /dev/null)
257 fi
190} 258}
191 259
192function scratchpad_test() 260function scratchpad_test()
193{ 261{
194 LOC=$1 262 LOC=$1
195 REM=$2 263 REM=$2
196 CNT=$(read_file "$LOC/spad" | wc -l)
197 264
198 echo "Running spad tests on: $(basename $LOC) / $(basename $REM)" 265 echo "Running spad tests on: $(subdirname $LOC) / $(subdirname $REM)"
266
267 CNT=$(get_files_count "spad" "$LOC")
268
269 if [[ $CNT -eq 0 ]]; then
270 echo " Unsupported"
271 return
272 fi
199 273
200 for ((i = 0; i < $CNT; i++)); do 274 for ((i = 0; i < $CNT; i++)); do
201 VAL=$RANDOM 275 VAL=$RANDOM
202 write_file "$i $VAL" "$LOC/peer_spad" 276 write_file "$VAL" "$LOC/spad$i"
203 RVAL=$(read_spad "$REM/spad" $i) 277 RVAL=$(read_file "$REM/../spad$i")
204 278
205 if [[ "$VAL" != "$RVAL" ]]; then 279 if [[ "$VAL" -ne "$RVAL" ]]; then
206 echo "Scratchpad doesn't match expected value $VAL " \ 280 echo "Scratchpad $i value $RVAL doesn't match $VAL" >&2
207 "in $REM/spad, got $RVAL" >&2
208 exit -1 281 exit -1
209 fi 282 fi
283 done
284
285 echo " Passed"
286}
287
288function message_test()
289{
290 LOC=$1
291 REM=$2
292
293 echo "Running msg tests on: $(subdirname $LOC) / $(subdirname $REM)"
294
295 CNT=$(get_files_count "msg" "$LOC")
210 296
297 if [[ $CNT -eq 0 ]]; then
298 echo " Unsupported"
299 return
300 fi
301
302 MSG_OUTBITS_MASK=$(read_file "$LOC/../msg_inbits")
303 MSG_INBITS_MASK=$(read_file "$REM/../msg_inbits")
304
305 write_file "c $MSG_OUTBITS_MASK" "$LOC/../msg_sts"
306 write_file "c $MSG_INBITS_MASK" "$REM/../msg_sts"
307
308 for ((i = 0; i < $CNT; i++)); do
309 VAL=$RANDOM
310 write_file "$VAL" "$LOC/msg$i"
311 RVAL=$(read_file "$REM/../msg$i")
312
313 if [[ "$VAL" -ne "${RVAL%%<-*}" ]]; then
314 echo "Message $i value $RVAL doesn't match $VAL" >&2
315 exit -1
316 fi
211 done 317 done
212 318
213 echo " Passed" 319 echo " Passed"
214} 320}
215 321
322function get_number()
323{
324 KEY=$1
325
326 sed -n "s/^\(${KEY}\)[ \t]*\(0x[0-9a-fA-F]*\)\(\[p\]\)\?$/\2/p"
327}
328
329function mw_alloc()
330{
331 IDX=$1
332 LOC=$2
333 REM=$3
334
335 write_file $MW_SIZE "$LOC/mw_trans$IDX"
336
337 INB_MW=$(read_file "$LOC/mw_trans$IDX")
338 MW_ALIGNED_SIZE=$(echo "$INB_MW" | get_number "Window Size")
339 MW_DMA_ADDR=$(echo "$INB_MW" | get_number "DMA Address")
340
341 write_file "$MW_DMA_ADDR:$(($MW_ALIGNED_SIZE))" "$REM/peer_mw_trans$IDX"
342
343 if [[ $MW_SIZE -ne $MW_ALIGNED_SIZE ]]; then
344 echo "MW $IDX size aligned to $MW_ALIGNED_SIZE"
345 fi
346}
347
216function write_mw() 348function write_mw()
217{ 349{
218 split_remote $2 350 split_remote $2
@@ -225,17 +357,15 @@ function write_mw()
225 fi 357 fi
226} 358}
227 359
228function mw_test() 360function mw_check()
229{ 361{
230 IDX=$1 362 IDX=$1
231 LOC=$2 363 LOC=$2
232 REM=$3 364 REM=$3
233 365
234 echo "Running $IDX tests on: $(basename $LOC) / $(basename $REM)" 366 write_mw "$LOC/mw$IDX"
235 367
236 write_mw "$LOC/$IDX" 368 split_remote "$LOC/mw$IDX"
237
238 split_remote "$LOC/$IDX"
239 if [[ "$REMOTE" == "" ]]; then 369 if [[ "$REMOTE" == "" ]]; then
240 A=$VPATH 370 A=$VPATH
241 else 371 else
@@ -243,7 +373,7 @@ function mw_test()
243 ssh "$REMOTE" cat "$VPATH" > "$A" 373 ssh "$REMOTE" cat "$VPATH" > "$A"
244 fi 374 fi
245 375
246 split_remote "$REM/peer_$IDX" 376 split_remote "$REM/peer_mw$IDX"
247 if [[ "$REMOTE" == "" ]]; then 377 if [[ "$REMOTE" == "" ]]; then
248 B=$VPATH 378 B=$VPATH
249 else 379 else
@@ -251,7 +381,7 @@ function mw_test()
251 ssh "$REMOTE" cat "$VPATH" > "$B" 381 ssh "$REMOTE" cat "$VPATH" > "$B"
252 fi 382 fi
253 383
254 cmp -n $MW_SIZE "$A" "$B" 384 cmp -n $MW_ALIGNED_SIZE "$A" "$B"
255 if [[ $? != 0 ]]; then 385 if [[ $? != 0 ]]; then
256 echo "Memory window $MW did not match!" >&2 386 echo "Memory window $MW did not match!" >&2
257 fi 387 fi
@@ -263,8 +393,39 @@ function mw_test()
263 if [[ "$B" == "/tmp/*" ]]; then 393 if [[ "$B" == "/tmp/*" ]]; then
264 rm "$B" 394 rm "$B"
265 fi 395 fi
396}
397
398function mw_free()
399{
400 IDX=$1
401 LOC=$2
402 REM=$3
403
404 write_file "$MW_DMA_ADDR:0" "$REM/peer_mw_trans$IDX"
405
406 write_file 0 "$LOC/mw_trans$IDX"
407}
408
409function mw_test()
410{
411 LOC=$1
412 REM=$2
413
414 CNT=$(get_files_count "mw_trans" "$LOC")
415
416 for ((i = 0; i < $CNT; i++)); do
417 echo "Running mw$i tests on: $(subdirname $LOC) / " \
418 "$(subdirname $REM)"
419
420 mw_alloc $i $LOC $REM
421
422 mw_check $i $LOC $REM
423
424 mw_free $i $LOC $REM
425
426 echo " Passed"
427 done
266 428
267 echo " Passed"
268} 429}
269 430
270function pingpong_test() 431function pingpong_test()
@@ -274,13 +435,13 @@ function pingpong_test()
274 435
275 echo "Running ping pong tests on: $(basename $LOC) / $(basename $REM)" 436 echo "Running ping pong tests on: $(basename $LOC) / $(basename $REM)"
276 437
277 LOC_START=$(read_file $LOC/count) 438 LOC_START=$(read_file "$LOC/count")
278 REM_START=$(read_file $REM/count) 439 REM_START=$(read_file "$REM/count")
279 440
280 sleep 7 441 sleep 7
281 442
282 LOC_END=$(read_file $LOC/count) 443 LOC_END=$(read_file "$LOC/count")
283 REM_END=$(read_file $REM/count) 444 REM_END=$(read_file "$REM/count")
284 445
285 if [[ $LOC_START == $LOC_END ]] || [[ $REM_START == $REM_END ]]; then 446 if [[ $LOC_START == $LOC_END ]] || [[ $REM_START == $REM_END ]]; then
286 echo "Ping pong counter not incrementing!" >&2 447 echo "Ping pong counter not incrementing!" >&2
@@ -300,19 +461,19 @@ function perf_test()
300 WITH="without" 461 WITH="without"
301 fi 462 fi
302 463
303 _modprobe ntb_perf run_order=$PERF_RUN_ORDER \ 464 _modprobe ntb_perf total_order=$PERF_RUN_ORDER \
304 max_mw_size=$MAX_MW_SIZE use_dma=$USE_DMA 465 max_mw_size=$MAX_MW_SIZE use_dma=$USE_DMA
305 466
306 echo "Running local perf test $WITH DMA" 467 echo "Running local perf test $WITH DMA"
307 write_file "" $LOCAL_PERF/run 468 write_file "$LOCAL_PIDX" "$LOCAL_PERF/run"
308 echo -n " " 469 echo -n " "
309 read_file $LOCAL_PERF/run 470 read_file "$LOCAL_PERF/run"
310 echo " Passed" 471 echo " Passed"
311 472
312 echo "Running remote perf test $WITH DMA" 473 echo "Running remote perf test $WITH DMA"
313 write_file "" $REMOTE_PERF/run 474 write_file "$REMOTE_PIDX" "$REMOTE_PERF/run"
314 echo -n " " 475 echo -n " "
315 read_file $REMOTE_PERF/run 476 read_file "$REMOTE_PERF/run"
316 echo " Passed" 477 echo " Passed"
317 478
318 _modprobe -r ntb_perf 479 _modprobe -r ntb_perf
@@ -320,48 +481,44 @@ function perf_test()
320 481
321function ntb_tool_tests() 482function ntb_tool_tests()
322{ 483{
323 LOCAL_TOOL=$DEBUGFS/ntb_tool/$LOCAL_DEV 484 LOCAL_TOOL="$DEBUGFS/ntb_tool/$LOCAL_DEV"
324 REMOTE_TOOL=$REMOTE_HOST:$DEBUGFS/ntb_tool/$REMOTE_DEV 485 REMOTE_TOOL="$REMOTE_HOST:$DEBUGFS/ntb_tool/$REMOTE_DEV"
325 486
326 echo "Starting ntb_tool tests..." 487 echo "Starting ntb_tool tests..."
327 488
328 _modprobe ntb_tool 489 _modprobe ntb_tool
329 490
330 write_file Y $LOCAL_TOOL/link_event 491 port_test "$LOCAL_TOOL" "$REMOTE_TOOL"
331 write_file Y $REMOTE_TOOL/link_event
332 492
333 link_test $LOCAL_TOOL $REMOTE_TOOL 493 LOCAL_PEER_TOOL="$LOCAL_TOOL/peer$LOCAL_PIDX"
334 link_test $REMOTE_TOOL $LOCAL_TOOL 494 REMOTE_PEER_TOOL="$REMOTE_TOOL/peer$REMOTE_PIDX"
495
496 link_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL"
497 link_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL"
335 498
336 #Ensure the link is up on both sides before continuing 499 #Ensure the link is up on both sides before continuing
337 write_file Y $LOCAL_TOOL/link_event 500 write_file "Y" "$LOCAL_PEER_TOOL/link_event"
338 write_file Y $REMOTE_TOOL/link_event 501 write_file "Y" "$REMOTE_PEER_TOOL/link_event"
339 502
340 for PEER_TRANS in $(ls $LOCAL_TOOL/peer_trans*); do 503 doorbell_test "$LOCAL_TOOL" "$REMOTE_TOOL"
341 PT=$(basename $PEER_TRANS) 504 doorbell_test "$REMOTE_TOOL" "$LOCAL_TOOL"
342 write_file $MW_SIZE $LOCAL_TOOL/$PT
343 write_file $MW_SIZE $REMOTE_TOOL/$PT
344 done
345 505
346 doorbell_test $LOCAL_TOOL $REMOTE_TOOL 506 scratchpad_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL"
347 doorbell_test $REMOTE_TOOL $LOCAL_TOOL 507 scratchpad_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL"
348 scratchpad_test $LOCAL_TOOL $REMOTE_TOOL
349 scratchpad_test $REMOTE_TOOL $LOCAL_TOOL
350 508
351 for MW in $(ls $LOCAL_TOOL/mw*); do 509 message_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL"
352 MW=$(basename $MW) 510 message_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL"
353 511
354 mw_test $MW $LOCAL_TOOL $REMOTE_TOOL 512 mw_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL"
355 mw_test $MW $REMOTE_TOOL $LOCAL_TOOL 513 mw_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL"
356 done
357 514
358 _modprobe -r ntb_tool 515 _modprobe -r ntb_tool
359} 516}
360 517
361function ntb_pingpong_tests() 518function ntb_pingpong_tests()
362{ 519{
363 LOCAL_PP=$DEBUGFS/ntb_pingpong/$LOCAL_DEV 520 LOCAL_PP="$DEBUGFS/ntb_pingpong/$LOCAL_DEV"
364 REMOTE_PP=$REMOTE_HOST:$DEBUGFS/ntb_pingpong/$REMOTE_DEV 521 REMOTE_PP="$REMOTE_HOST:$DEBUGFS/ntb_pingpong/$REMOTE_DEV"
365 522
366 echo "Starting ntb_pingpong tests..." 523 echo "Starting ntb_pingpong tests..."
367 524
@@ -374,8 +531,8 @@ function ntb_pingpong_tests()
374 531
375function ntb_perf_tests() 532function ntb_perf_tests()
376{ 533{
377 LOCAL_PERF=$DEBUGFS/ntb_perf/$LOCAL_DEV 534 LOCAL_PERF="$DEBUGFS/ntb_perf/$LOCAL_DEV"
378 REMOTE_PERF=$REMOTE_HOST:$DEBUGFS/ntb_perf/$REMOTE_DEV 535 REMOTE_PERF="$REMOTE_HOST:$DEBUGFS/ntb_perf/$REMOTE_DEV"
379 536
380 echo "Starting ntb_perf tests..." 537 echo "Starting ntb_perf tests..."
381 538
diff --git a/tools/testing/selftests/powerpc/alignment/Makefile b/tools/testing/selftests/powerpc/alignment/Makefile
index 16b22004e75f..083a48a008b4 100644
--- a/tools/testing/selftests/powerpc/alignment/Makefile
+++ b/tools/testing/selftests/powerpc/alignment/Makefile
@@ -1,4 +1,5 @@
1TEST_GEN_PROGS := copy_unaligned copy_first_unaligned paste_unaligned paste_last_unaligned 1TEST_GEN_PROGS := copy_unaligned copy_first_unaligned paste_unaligned \
2 paste_last_unaligned alignment_handler
2 3
3include ../../lib.mk 4include ../../lib.mk
4 5
diff --git a/tools/testing/selftests/powerpc/alignment/alignment_handler.c b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
new file mode 100644
index 000000000000..39fd362415cf
--- /dev/null
+++ b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
@@ -0,0 +1,491 @@
1/*
2 * Test the powerpc alignment handler on POWER8/POWER9
3 *
4 * Copyright (C) 2017 IBM Corporation (Michael Neuling, Andrew Donnellan)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12/*
13 * This selftest exercises the powerpc alignment fault handler.
14 *
15 * We create two sets of source and destination buffers, one in regular memory,
16 * the other cache-inhibited (we use /dev/fb0 for this).
17 *
18 * We initialise the source buffers, then use whichever set of load/store
19 * instructions is under test to copy bytes from the source buffers to the
20 * destination buffers. For the regular buffers, these instructions will
21 * execute normally. For the cache-inhibited buffers, these instructions
22 * will trap and cause an alignment fault, and the alignment fault handler
23 * will emulate the particular instruction under test. We then compare the
24 * destination buffers to ensure that the native and emulated cases give the
25 * same result.
26 *
27 * TODO:
28 * - Any FIXMEs below
29 * - Test VSX regs < 32 and > 32
30 * - Test all loads and stores
31 * - Check update forms do update register
32 * - Test alignment faults over page boundary
33 *
34 * Some old binutils may not support all the instructions.
35 */
36
37
38#include <sys/mman.h>
39#include <sys/types.h>
40#include <sys/stat.h>
41#include <fcntl.h>
42#include <unistd.h>
43#include <stdio.h>
44#include <stdlib.h>
45#include <string.h>
46#include <assert.h>
47#include <getopt.h>
48#include <setjmp.h>
49#include <signal.h>
50
51#include "utils.h"
52
53int bufsize;
54int debug;
55int testing;
56volatile int gotsig;
57
58void sighandler(int sig, siginfo_t *info, void *ctx)
59{
60 struct ucontext *ucp = ctx;
61
62 if (!testing) {
63 signal(sig, SIG_DFL);
64 kill(0, sig);
65 }
66 gotsig = sig;
67#ifdef __powerpc64__
68 ucp->uc_mcontext.gp_regs[PT_NIP] += 4;
69#else
70 ucp->uc_mcontext.uc_regs->gregs[PT_NIP] += 4;
71#endif
72}
73
74#define XFORM(reg, n) " " #reg " ,%"#n",%2 ;"
75#define DFORM(reg, n) " " #reg " ,0(%"#n") ;"
76
77#define TEST(name, ld_op, st_op, form, ld_reg, st_reg) \
78 void test_##name(char *s, char *d) \
79 { \
80 asm volatile( \
81 #ld_op form(ld_reg, 0) \
82 #st_op form(st_reg, 1) \
83 :: "r"(s), "r"(d), "r"(0) \
84 : "memory", "vs0", "vs32", "r31"); \
85 } \
86 rc |= do_test(#name, test_##name)
87
88#define LOAD_VSX_XFORM_TEST(op) TEST(op, op, stxvd2x, XFORM, 32, 32)
89#define STORE_VSX_XFORM_TEST(op) TEST(op, lxvd2x, op, XFORM, 32, 32)
90#define LOAD_VSX_DFORM_TEST(op) TEST(op, op, stxv, DFORM, 32, 32)
91#define STORE_VSX_DFORM_TEST(op) TEST(op, lxv, op, DFORM, 32, 32)
92#define LOAD_VMX_XFORM_TEST(op) TEST(op, op, stxvd2x, XFORM, 0, 32)
93#define STORE_VMX_XFORM_TEST(op) TEST(op, lxvd2x, op, XFORM, 32, 0)
94#define LOAD_VMX_DFORM_TEST(op) TEST(op, op, stxv, DFORM, 0, 32)
95#define STORE_VMX_DFORM_TEST(op) TEST(op, lxv, op, DFORM, 32, 0)
96
97#define LOAD_XFORM_TEST(op) TEST(op, op, stdx, XFORM, 31, 31)
98#define STORE_XFORM_TEST(op) TEST(op, ldx, op, XFORM, 31, 31)
99#define LOAD_DFORM_TEST(op) TEST(op, op, std, DFORM, 31, 31)
100#define STORE_DFORM_TEST(op) TEST(op, ld, op, DFORM, 31, 31)
101
102#define LOAD_FLOAT_DFORM_TEST(op) TEST(op, op, stfd, DFORM, 0, 0)
103#define STORE_FLOAT_DFORM_TEST(op) TEST(op, lfd, op, DFORM, 0, 0)
104#define LOAD_FLOAT_XFORM_TEST(op) TEST(op, op, stfdx, XFORM, 0, 0)
105#define STORE_FLOAT_XFORM_TEST(op) TEST(op, lfdx, op, XFORM, 0, 0)
106
107
108/* FIXME: Unimplemented tests: */
109// STORE_DFORM_TEST(stq) /* FIXME: need two registers for quad */
110// STORE_DFORM_TEST(stswi) /* FIXME: string instruction */
111
112// STORE_XFORM_TEST(stwat) /* AMO can't emulate or run on CI */
113// STORE_XFORM_TEST(stdat) /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
114
115
116/* preload byte by byte */
117void preload_data(void *dst, int offset, int width)
118{
119 char *c = dst;
120 int i;
121
122 c += offset;
123
124 for (i = 0 ; i < width ; i++)
125 c[i] = i;
126}
127
128int test_memcpy(void *dst, void *src, int size, int offset,
129 void (*test_func)(char *, char *))
130{
131 char *s, *d;
132
133 s = src;
134 s += offset;
135 d = dst;
136 d += offset;
137
138 assert(size == 16);
139 gotsig = 0;
140 testing = 1;
141
142 test_func(s, d); /* run the actual test */
143
144 testing = 0;
145 if (gotsig) {
146 if (debug)
147 printf(" Got signal %i\n", gotsig);
148 return 1;
149 }
150 return 0;
151}
152
153void dumpdata(char *s1, char *s2, int n, char *test_name)
154{
155 int i;
156
157 printf(" %s: unexpected result:\n", test_name);
158 printf(" mem:");
159 for (i = 0; i < n; i++)
160 printf(" %02x", s1[i]);
161 printf("\n");
162 printf(" ci: ");
163 for (i = 0; i < n; i++)
164 printf(" %02x", s2[i]);
165 printf("\n");
166}
167
168int test_memcmp(void *s1, void *s2, int n, int offset, char *test_name)
169{
170 char *s1c, *s2c;
171
172 s1c = s1;
173 s1c += offset;
174 s2c = s2;
175 s2c += offset;
176
177 if (memcmp(s1c, s2c, n)) {
178 if (debug) {
179 printf("\n Compare failed. Offset:%i length:%i\n",
180 offset, n);
181 dumpdata(s1c, s2c, n, test_name);
182 }
183 return 1;
184 }
185 return 0;
186}
187
188/*
189 * Do two memcpy tests using the same instructions. One cachable
190 * memory and the other doesn't.
191 */
192int do_test(char *test_name, void (*test_func)(char *, char *))
193{
194 int offset, width, fd, rc = 0, r;
195 void *mem0, *mem1, *ci0, *ci1;
196
197 printf("\tDoing %s:\t", test_name);
198
199 fd = open("/dev/fb0", O_RDWR);
200 if (fd < 0) {
201 printf("\n");
202 perror("Can't open /dev/fb0");
203 SKIP_IF(1);
204 }
205
206 ci0 = mmap(NULL, bufsize, PROT_WRITE, MAP_SHARED,
207 fd, 0x0);
208 ci1 = mmap(NULL, bufsize, PROT_WRITE, MAP_SHARED,
209 fd, bufsize);
210 if ((ci0 == MAP_FAILED) || (ci1 == MAP_FAILED)) {
211 printf("\n");
212 perror("mmap failed");
213 SKIP_IF(1);
214 }
215
216 rc = posix_memalign(&mem0, bufsize, bufsize);
217 if (rc) {
218 printf("\n");
219 return rc;
220 }
221
222 rc = posix_memalign(&mem1, bufsize, bufsize);
223 if (rc) {
224 printf("\n");
225 free(mem0);
226 return rc;
227 }
228
229 /* offset = 0 no alignment fault, so skip */
230 for (offset = 1; offset < 16; offset++) {
231 width = 16; /* vsx == 16 bytes */
232 r = 0;
233
234 /* load pattern into memory byte by byte */
235 preload_data(ci0, offset, width);
236 preload_data(mem0, offset, width); // FIXME: remove??
237 memcpy(ci0, mem0, bufsize);
238 memcpy(ci1, mem1, bufsize); /* initialise output to the same */
239
240 /* sanity check */
241 test_memcmp(mem0, ci0, width, offset, test_name);
242
243 r |= test_memcpy(ci1, ci0, width, offset, test_func);
244 r |= test_memcpy(mem1, mem0, width, offset, test_func);
245 if (r && !debug) {
246 printf("FAILED: Got signal");
247 break;
248 }
249
250 r |= test_memcmp(mem1, ci1, width, offset, test_name);
251 rc |= r;
252 if (r && !debug) {
253 printf("FAILED: Wrong Data");
254 break;
255 }
256 }
257 if (!r)
258 printf("PASSED");
259 printf("\n");
260
261 munmap(ci0, bufsize);
262 munmap(ci1, bufsize);
263 free(mem0);
264 free(mem1);
265
266 return rc;
267}
268
269int test_alignment_handler_vsx_206(void)
270{
271 int rc = 0;
272
273 printf("VSX: 2.06B\n");
274 LOAD_VSX_XFORM_TEST(lxvd2x);
275 LOAD_VSX_XFORM_TEST(lxvw4x);
276 LOAD_VSX_XFORM_TEST(lxsdx);
277 LOAD_VSX_XFORM_TEST(lxvdsx);
278 STORE_VSX_XFORM_TEST(stxvd2x);
279 STORE_VSX_XFORM_TEST(stxvw4x);
280 STORE_VSX_XFORM_TEST(stxsdx);
281 return rc;
282}
283
284int test_alignment_handler_vsx_207(void)
285{
286 int rc = 0;
287
288 printf("VSX: 2.07B\n");
289 LOAD_VSX_XFORM_TEST(lxsspx);
290 LOAD_VSX_XFORM_TEST(lxsiwax);
291 LOAD_VSX_XFORM_TEST(lxsiwzx);
292 STORE_VSX_XFORM_TEST(stxsspx);
293 STORE_VSX_XFORM_TEST(stxsiwx);
294 return rc;
295}
296
297int test_alignment_handler_vsx_300(void)
298{
299 int rc = 0;
300
301 SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_3_00));
302 printf("VSX: 3.00B\n");
303 LOAD_VMX_DFORM_TEST(lxsd);
304 LOAD_VSX_XFORM_TEST(lxsibzx);
305 LOAD_VSX_XFORM_TEST(lxsihzx);
306 LOAD_VMX_DFORM_TEST(lxssp);
307 LOAD_VSX_DFORM_TEST(lxv);
308 LOAD_VSX_XFORM_TEST(lxvb16x);
309 LOAD_VSX_XFORM_TEST(lxvh8x);
310 LOAD_VSX_XFORM_TEST(lxvx);
311 LOAD_VSX_XFORM_TEST(lxvwsx);
312 LOAD_VSX_XFORM_TEST(lxvl);
313 LOAD_VSX_XFORM_TEST(lxvll);
314 STORE_VMX_DFORM_TEST(stxsd);
315 STORE_VSX_XFORM_TEST(stxsibx);
316 STORE_VSX_XFORM_TEST(stxsihx);
317 STORE_VMX_DFORM_TEST(stxssp);
318 STORE_VSX_DFORM_TEST(stxv);
319 STORE_VSX_XFORM_TEST(stxvb16x);
320 STORE_VSX_XFORM_TEST(stxvh8x);
321 STORE_VSX_XFORM_TEST(stxvx);
322 STORE_VSX_XFORM_TEST(stxvl);
323 STORE_VSX_XFORM_TEST(stxvll);
324 return rc;
325}
326
327int test_alignment_handler_integer(void)
328{
329 int rc = 0;
330
331 printf("Integer\n");
332 LOAD_DFORM_TEST(lbz);
333 LOAD_DFORM_TEST(lbzu);
334 LOAD_XFORM_TEST(lbzx);
335 LOAD_XFORM_TEST(lbzux);
336 LOAD_DFORM_TEST(lhz);
337 LOAD_DFORM_TEST(lhzu);
338 LOAD_XFORM_TEST(lhzx);
339 LOAD_XFORM_TEST(lhzux);
340 LOAD_DFORM_TEST(lha);
341 LOAD_DFORM_TEST(lhau);
342 LOAD_XFORM_TEST(lhax);
343 LOAD_XFORM_TEST(lhaux);
344 LOAD_XFORM_TEST(lhbrx);
345 LOAD_DFORM_TEST(lwz);
346 LOAD_DFORM_TEST(lwzu);
347 LOAD_XFORM_TEST(lwzx);
348 LOAD_XFORM_TEST(lwzux);
349 LOAD_DFORM_TEST(lwa);
350 LOAD_XFORM_TEST(lwax);
351 LOAD_XFORM_TEST(lwaux);
352 LOAD_XFORM_TEST(lwbrx);
353 LOAD_DFORM_TEST(ld);
354 LOAD_DFORM_TEST(ldu);
355 LOAD_XFORM_TEST(ldx);
356 LOAD_XFORM_TEST(ldux);
357 LOAD_XFORM_TEST(ldbrx);
358 LOAD_DFORM_TEST(lmw);
359 STORE_DFORM_TEST(stb);
360 STORE_XFORM_TEST(stbx);
361 STORE_DFORM_TEST(stbu);
362 STORE_XFORM_TEST(stbux);
363 STORE_DFORM_TEST(sth);
364 STORE_XFORM_TEST(sthx);
365 STORE_DFORM_TEST(sthu);
366 STORE_XFORM_TEST(sthux);
367 STORE_XFORM_TEST(sthbrx);
368 STORE_DFORM_TEST(stw);
369 STORE_XFORM_TEST(stwx);
370 STORE_DFORM_TEST(stwu);
371 STORE_XFORM_TEST(stwux);
372 STORE_XFORM_TEST(stwbrx);
373 STORE_DFORM_TEST(std);
374 STORE_XFORM_TEST(stdx);
375 STORE_DFORM_TEST(stdu);
376 STORE_XFORM_TEST(stdux);
377 STORE_XFORM_TEST(stdbrx);
378 STORE_DFORM_TEST(stmw);
379 return rc;
380}
381
382int test_alignment_handler_vmx(void)
383{
384 int rc = 0;
385
386 printf("VMX\n");
387 LOAD_VMX_XFORM_TEST(lvx);
388
389 /*
390 * FIXME: These loads only load part of the register, so our
391 * testing method doesn't work. Also they don't take alignment
392 * faults, so it's kinda pointless anyway
393 *
394 LOAD_VMX_XFORM_TEST(lvebx)
395 LOAD_VMX_XFORM_TEST(lvehx)
396 LOAD_VMX_XFORM_TEST(lvewx)
397 LOAD_VMX_XFORM_TEST(lvxl)
398 */
399 STORE_VMX_XFORM_TEST(stvx);
400 STORE_VMX_XFORM_TEST(stvebx);
401 STORE_VMX_XFORM_TEST(stvehx);
402 STORE_VMX_XFORM_TEST(stvewx);
403 STORE_VMX_XFORM_TEST(stvxl);
404 return rc;
405}
406
407int test_alignment_handler_fp(void)
408{
409 int rc = 0;
410
411 printf("Floating point\n");
412 LOAD_FLOAT_DFORM_TEST(lfd);
413 LOAD_FLOAT_XFORM_TEST(lfdx);
414 LOAD_FLOAT_DFORM_TEST(lfdp);
415 LOAD_FLOAT_XFORM_TEST(lfdpx);
416 LOAD_FLOAT_DFORM_TEST(lfdu);
417 LOAD_FLOAT_XFORM_TEST(lfdux);
418 LOAD_FLOAT_DFORM_TEST(lfs);
419 LOAD_FLOAT_XFORM_TEST(lfsx);
420 LOAD_FLOAT_DFORM_TEST(lfsu);
421 LOAD_FLOAT_XFORM_TEST(lfsux);
422 LOAD_FLOAT_XFORM_TEST(lfiwzx);
423 LOAD_FLOAT_XFORM_TEST(lfiwax);
424 STORE_FLOAT_DFORM_TEST(stfd);
425 STORE_FLOAT_XFORM_TEST(stfdx);
426 STORE_FLOAT_DFORM_TEST(stfdp);
427 STORE_FLOAT_XFORM_TEST(stfdpx);
428 STORE_FLOAT_DFORM_TEST(stfdu);
429 STORE_FLOAT_XFORM_TEST(stfdux);
430 STORE_FLOAT_DFORM_TEST(stfs);
431 STORE_FLOAT_XFORM_TEST(stfsx);
432 STORE_FLOAT_DFORM_TEST(stfsu);
433 STORE_FLOAT_XFORM_TEST(stfsux);
434 STORE_FLOAT_XFORM_TEST(stfiwx);
435
436 return rc;
437}
438
439void usage(char *prog)
440{
441 printf("Usage: %s [options]\n", prog);
442 printf(" -d Enable debug error output\n");
443 printf("\n");
444 printf("This test requires a POWER8 or POWER9 CPU and a usable ");
445 printf("framebuffer at /dev/fb0.\n");
446}
447
448int main(int argc, char *argv[])
449{
450
451 struct sigaction sa;
452 int rc = 0;
453 int option = 0;
454
455 while ((option = getopt(argc, argv, "d")) != -1) {
456 switch (option) {
457 case 'd':
458 debug++;
459 break;
460 default:
461 usage(argv[0]);
462 exit(1);
463 }
464 }
465
466 bufsize = getpagesize();
467
468 sa.sa_sigaction = sighandler;
469 sigemptyset(&sa.sa_mask);
470 sa.sa_flags = SA_SIGINFO;
471 if (sigaction(SIGSEGV, &sa, NULL) == -1
472 || sigaction(SIGBUS, &sa, NULL) == -1
473 || sigaction(SIGILL, &sa, NULL) == -1) {
474 perror("sigaction");
475 exit(1);
476 }
477
478 rc |= test_harness(test_alignment_handler_vsx_206,
479 "test_alignment_handler_vsx_206");
480 rc |= test_harness(test_alignment_handler_vsx_207,
481 "test_alignment_handler_vsx_207");
482 rc |= test_harness(test_alignment_handler_vsx_300,
483 "test_alignment_handler_vsx_300");
484 rc |= test_harness(test_alignment_handler_integer,
485 "test_alignment_handler_integer");
486 rc |= test_harness(test_alignment_handler_vmx,
487 "test_alignment_handler_vmx");
488 rc |= test_harness(test_alignment_handler_fp,
489 "test_alignment_handler_fp");
490 return rc;
491}
diff --git a/tools/testing/selftests/powerpc/benchmarks/mmap_bench.c b/tools/testing/selftests/powerpc/benchmarks/mmap_bench.c
index 8d084a2d6e74..7a0a462a2272 100644
--- a/tools/testing/selftests/powerpc/benchmarks/mmap_bench.c
+++ b/tools/testing/selftests/powerpc/benchmarks/mmap_bench.c
@@ -7,17 +7,34 @@
7#include <stdlib.h> 7#include <stdlib.h>
8#include <sys/mman.h> 8#include <sys/mman.h>
9#include <time.h> 9#include <time.h>
10#include <getopt.h>
10 11
11#include "utils.h" 12#include "utils.h"
12 13
13#define ITERATIONS 5000000 14#define ITERATIONS 5000000
14 15
15#define MEMSIZE (128 * 1024 * 1024) 16#define MEMSIZE (1UL << 27)
17#define PAGE_SIZE (1UL << 16)
18#define CHUNK_COUNT (MEMSIZE/PAGE_SIZE)
19
20static int pg_fault;
21static int iterations = ITERATIONS;
22
23static struct option options[] = {
24 { "pgfault", no_argument, &pg_fault, 1 },
25 { "iterations", required_argument, 0, 'i' },
26 { 0, },
27};
28
29static void usage(void)
30{
31 printf("mmap_bench <--pgfault> <--iterations count>\n");
32}
16 33
17int test_mmap(void) 34int test_mmap(void)
18{ 35{
19 struct timespec ts_start, ts_end; 36 struct timespec ts_start, ts_end;
20 unsigned long i = ITERATIONS; 37 unsigned long i = iterations;
21 38
22 clock_gettime(CLOCK_MONOTONIC, &ts_start); 39 clock_gettime(CLOCK_MONOTONIC, &ts_start);
23 40
@@ -25,6 +42,11 @@ int test_mmap(void)
25 char *c = mmap(NULL, MEMSIZE, PROT_READ|PROT_WRITE, 42 char *c = mmap(NULL, MEMSIZE, PROT_READ|PROT_WRITE,
26 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); 43 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
27 FAIL_IF(c == MAP_FAILED); 44 FAIL_IF(c == MAP_FAILED);
45 if (pg_fault) {
46 int count;
47 for (count = 0; count < CHUNK_COUNT; count++)
48 c[count << 16] = 'c';
49 }
28 munmap(c, MEMSIZE); 50 munmap(c, MEMSIZE);
29 } 51 }
30 52
@@ -35,7 +57,32 @@ int test_mmap(void)
35 return 0; 57 return 0;
36} 58}
37 59
38int main(void) 60int main(int argc, char *argv[])
39{ 61{
62 signed char c;
63 while (1) {
64 int option_index = 0;
65
66 c = getopt_long(argc, argv, "", options, &option_index);
67
68 if (c == -1)
69 break;
70
71 switch (c) {
72 case 0:
73 if (options[option_index].flag != 0)
74 break;
75
76 usage();
77 exit(1);
78 break;
79 case 'i':
80 iterations = atoi(optarg);
81 break;
82 default:
83 usage();
84 exit(1);
85 }
86 }
40 return test_harness(test_mmap, "mmap_bench"); 87 return test_harness(test_mmap, "mmap_bench");
41} 88}
diff --git a/tools/testing/selftests/powerpc/mm/.gitignore b/tools/testing/selftests/powerpc/mm/.gitignore
index e715a3f2fbf4..7d7c42ed6de9 100644
--- a/tools/testing/selftests/powerpc/mm/.gitignore
+++ b/tools/testing/selftests/powerpc/mm/.gitignore
@@ -1,4 +1,5 @@
1hugetlb_vs_thp_test 1hugetlb_vs_thp_test
2subpage_prot 2subpage_prot
3tempfile 3tempfile
4prot_sao \ No newline at end of file 4prot_sao
5segv_errors \ No newline at end of file
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index bf315bcbe663..8ebbe96d80a8 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -2,7 +2,7 @@
2noarg: 2noarg:
3 $(MAKE) -C ../ 3 $(MAKE) -C ../
4 4
5TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao 5TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao segv_errors
6TEST_GEN_FILES := tempfile 6TEST_GEN_FILES := tempfile
7 7
8include ../../lib.mk 8include ../../lib.mk
diff --git a/tools/testing/selftests/powerpc/mm/segv_errors.c b/tools/testing/selftests/powerpc/mm/segv_errors.c
new file mode 100644
index 000000000000..06ae76ee3ea1
--- /dev/null
+++ b/tools/testing/selftests/powerpc/mm/segv_errors.c
@@ -0,0 +1,78 @@
1// SPDX-License-Identifier: GPL-2.0
2
3/*
4 * Copyright 2017 John Sperbeck
5 *
6 * Test that an access to a mapped but inaccessible area causes a SEGV and
7 * reports si_code == SEGV_ACCERR.
8 */
9
10#include <stdbool.h>
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14#include <unistd.h>
15#include <signal.h>
16#include <sys/mman.h>
17#include <assert.h>
18#include <ucontext.h>
19
20#include "utils.h"
21
22static bool faulted;
23static int si_code;
24
25static void segv_handler(int n, siginfo_t *info, void *ctxt_v)
26{
27 ucontext_t *ctxt = (ucontext_t *)ctxt_v;
28 struct pt_regs *regs = ctxt->uc_mcontext.regs;
29
30 faulted = true;
31 si_code = info->si_code;
32 regs->nip += 4;
33}
34
35int test_segv_errors(void)
36{
37 struct sigaction act = {
38 .sa_sigaction = segv_handler,
39 .sa_flags = SA_SIGINFO,
40 };
41 char c, *p = NULL;
42
43 p = mmap(NULL, getpagesize(), 0, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
44 FAIL_IF(p == MAP_FAILED);
45
46 FAIL_IF(sigaction(SIGSEGV, &act, NULL) != 0);
47
48 faulted = false;
49 si_code = 0;
50
51 /*
52 * We just need a compiler barrier, but mb() works and has the nice
53 * property of being easy to spot in the disassembly.
54 */
55 mb();
56 c = *p;
57 mb();
58
59 FAIL_IF(!faulted);
60 FAIL_IF(si_code != SEGV_ACCERR);
61
62 faulted = false;
63 si_code = 0;
64
65 mb();
66 *p = c;
67 mb();
68
69 FAIL_IF(!faulted);
70 FAIL_IF(si_code != SEGV_ACCERR);
71
72 return 0;
73}
74
75int main(void)
76{
77 return test_harness(test_segv_errors, "segv_errors");
78}
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
index 0df3c23b7888..277dade1b382 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
@@ -79,8 +79,8 @@ trans:
79 : [res] "=r" (result), [texasr] "=r" (texasr) 79 : [res] "=r" (result), [texasr] "=r" (texasr)
80 : [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt), 80 : [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt),
81 [sprn_texasr] "i" (SPRN_TEXASR) 81 [sprn_texasr] "i" (SPRN_TEXASR)
82 : "memory", "r0", "r1", "r2", "r3", "r4", 82 : "memory", "r0", "r1", "r3", "r4",
83 "r8", "r9", "r10", "r11" 83 "r7", "r8", "r9", "r10", "r11"
84 ); 84 );
85 85
86 if (result) { 86 if (result) {
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c
index 94e57cb89769..51427a2465f6 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c
@@ -76,8 +76,7 @@ trans:
76 : [tfhar] "=r" (tfhar), [res] "=r" (result), 76 : [tfhar] "=r" (tfhar), [res] "=r" (result),
77 [texasr] "=r" (texasr), [cptr1] "=r" (cptr1) 77 [texasr] "=r" (texasr), [cptr1] "=r" (cptr1)
78 : [sprn_texasr] "i" (SPRN_TEXASR) 78 : [sprn_texasr] "i" (SPRN_TEXASR)
79 : "memory", "r0", "r1", "r2", "r3", "r4", 79 : "memory", "r0", "r8", "r31"
80 "r8", "r9", "r10", "r11", "r31"
81 ); 80 );
82 81
83 /* There are 2 32bit instructions before tbegin. */ 82 /* There are 2 32bit instructions before tbegin. */
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c
index b4081e2b22d5..17c23cabac3e 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c
@@ -67,7 +67,7 @@ trans:
67 : [res] "=r" (result), [texasr] "=r" (texasr) 67 : [res] "=r" (result), [texasr] "=r" (texasr)
68 : [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt), 68 : [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt),
69 [sprn_texasr] "i" (SPRN_TEXASR), [cptr1] "r" (&cptr[1]) 69 [sprn_texasr] "i" (SPRN_TEXASR), [cptr1] "r" (&cptr[1])
70 : "memory", "r0", "r1", "r2", "r3", "r4", 70 : "memory", "r0", "r1", "r3", "r4",
71 "r7", "r8", "r9", "r10", "r11" 71 "r7", "r8", "r9", "r10", "r11"
72 ); 72 );
73 73
diff --git a/tools/testing/selftests/powerpc/tm/.gitignore b/tools/testing/selftests/powerpc/tm/.gitignore
index 241a4a4ee0e4..bb90d4b79524 100644
--- a/tools/testing/selftests/powerpc/tm/.gitignore
+++ b/tools/testing/selftests/powerpc/tm/.gitignore
@@ -13,3 +13,4 @@ tm-signal-context-chk-vmx
13tm-signal-context-chk-vsx 13tm-signal-context-chk-vsx
14tm-vmx-unavail 14tm-vmx-unavail
15tm-unavailable 15tm-unavailable
16tm-trap
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 8ed6f8c57230..a23453943ad2 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -3,7 +3,7 @@ SIGNAL_CONTEXT_CHK_TESTS := tm-signal-context-chk-gpr tm-signal-context-chk-fpu
3 tm-signal-context-chk-vmx tm-signal-context-chk-vsx 3 tm-signal-context-chk-vmx tm-signal-context-chk-vsx
4 4
5TEST_GEN_PROGS := tm-resched-dscr tm-syscall tm-signal-msr-resv tm-signal-stack \ 5TEST_GEN_PROGS := tm-resched-dscr tm-syscall tm-signal-msr-resv tm-signal-stack \
6 tm-vmxcopy tm-fork tm-tar tm-tmspr tm-vmx-unavail tm-unavailable \ 6 tm-vmxcopy tm-fork tm-tar tm-tmspr tm-vmx-unavail tm-unavailable tm-trap \
7 $(SIGNAL_CONTEXT_CHK_TESTS) 7 $(SIGNAL_CONTEXT_CHK_TESTS)
8 8
9include ../../lib.mk 9include ../../lib.mk
@@ -18,6 +18,7 @@ $(OUTPUT)/tm-tmspr: CFLAGS += -pthread
18$(OUTPUT)/tm-vmx-unavail: CFLAGS += -pthread -m64 18$(OUTPUT)/tm-vmx-unavail: CFLAGS += -pthread -m64
19$(OUTPUT)/tm-resched-dscr: ../pmu/lib.o 19$(OUTPUT)/tm-resched-dscr: ../pmu/lib.o
20$(OUTPUT)/tm-unavailable: CFLAGS += -O0 -pthread -m64 -Wno-error=uninitialized -mvsx 20$(OUTPUT)/tm-unavailable: CFLAGS += -O0 -pthread -m64 -Wno-error=uninitialized -mvsx
21$(OUTPUT)/tm-trap: CFLAGS += -O0 -pthread -m64
21 22
22SIGNAL_CONTEXT_CHK_TESTS := $(patsubst %,$(OUTPUT)/%,$(SIGNAL_CONTEXT_CHK_TESTS)) 23SIGNAL_CONTEXT_CHK_TESTS := $(patsubst %,$(OUTPUT)/%,$(SIGNAL_CONTEXT_CHK_TESTS))
23$(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S 24$(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S
diff --git a/tools/testing/selftests/powerpc/tm/tm-trap.c b/tools/testing/selftests/powerpc/tm/tm-trap.c
new file mode 100644
index 000000000000..5d92c23ee6cb
--- /dev/null
+++ b/tools/testing/selftests/powerpc/tm/tm-trap.c
@@ -0,0 +1,329 @@
1/*
2 * Copyright 2017, Gustavo Romero, IBM Corp.
3 * Licensed under GPLv2.
4 *
5 * Check if thread endianness is flipped inadvertently to BE on trap
6 * caught in TM whilst MSR.FP and MSR.VEC are zero (i.e. just after
7 * load_fp and load_vec overflowed).
8 *
9 * The issue can be checked on LE machines simply by zeroing load_fp
10 * and load_vec and then causing a trap in TM. Since the endianness
11 * changes to BE on return from the signal handler, 'nop' is
12 * thread as an illegal instruction in following sequence:
13 * tbegin.
14 * beq 1f
15 * trap
16 * tend.
17 * 1: nop
18 *
19 * However, although the issue is also present on BE machines, it's a
20 * bit trickier to check it on BE machines because MSR.LE bit is set
21 * to zero which determines a BE endianness that is the native
22 * endianness on BE machines, so nothing notably critical happens,
23 * i.e. no illegal instruction is observed immediately after returning
24 * from the signal handler (as it happens on LE machines). Thus to test
25 * it on BE machines LE endianness is forced after a first trap and then
26 * the endianness is verified on subsequent traps to determine if the
27 * endianness "flipped back" to the native endianness (BE).
28 */
29
30#define _GNU_SOURCE
31#include <error.h>
32#include <stdio.h>
33#include <stdlib.h>
34#include <unistd.h>
35#include <htmintrin.h>
36#include <inttypes.h>
37#include <pthread.h>
38#include <sched.h>
39#include <signal.h>
40#include <stdbool.h>
41
42#include "tm.h"
43#include "utils.h"
44
45#define pr_error(error_code, format, ...) \
46 error_at_line(1, error_code, __FILE__, __LINE__, format, ##__VA_ARGS__)
47
48#define MSR_LE 1UL
49#define LE 1UL
50
51pthread_t t0_ping;
52pthread_t t1_pong;
53
54int exit_from_pong;
55
56int trap_event;
57int le;
58
59bool success;
60
61void trap_signal_handler(int signo, siginfo_t *si, void *uc)
62{
63 ucontext_t *ucp = uc;
64 uint64_t thread_endianness;
65
66 /* Get thread endianness: extract bit LE from MSR */
67 thread_endianness = MSR_LE & ucp->uc_mcontext.gp_regs[PT_MSR];
68
69 /***
70 * Little-Endian Machine
71 */
72
73 if (le) {
74 /* First trap event */
75 if (trap_event == 0) {
76 /* Do nothing. Since it is returning from this trap
77 * event that endianness is flipped by the bug, so just
78 * let the process return from the signal handler and
79 * check on the second trap event if endianness is
80 * flipped or not.
81 */
82 }
83 /* Second trap event */
84 else if (trap_event == 1) {
85 /*
86 * Since trap was caught in TM on first trap event, if
87 * endianness was still LE (not flipped inadvertently)
88 * after returning from the signal handler instruction
89 * (1) is executed (basically a 'nop'), as it's located
90 * at address of tbegin. +4 (rollback addr). As (1) on
91 * LE endianness does in effect nothing, instruction (2)
92 * is then executed again as 'trap', generating a second
93 * trap event (note that in that case 'trap' is caught
94 * not in transacional mode). On te other hand, if after
95 * the return from the signal handler the endianness in-
96 * advertently flipped, instruction (1) is tread as a
97 * branch instruction, i.e. b .+8, hence instruction (3)
98 * and (4) are executed (tbegin.; trap;) and we get sim-
99 * ilaly on the trap signal handler, but now in TM mode.
100 * Either way, it's now possible to check the MSR LE bit
101 * once in the trap handler to verify if endianness was
102 * flipped or not after the return from the second trap
103 * event. If endianness is flipped, the bug is present.
104 * Finally, getting a trap in TM mode or not is just
105 * worth noting because it affects the math to determine
106 * the offset added to the NIP on return: the NIP for a
107 * trap caught in TM is the rollback address, i.e. the
108 * next instruction after 'tbegin.', whilst the NIP for
109 * a trap caught in non-transactional mode is the very
110 * same address of the 'trap' instruction that generated
111 * the trap event.
112 */
113
114 if (thread_endianness == LE) {
115 /* Go to 'success', i.e. instruction (6) */
116 ucp->uc_mcontext.gp_regs[PT_NIP] += 16;
117 } else {
118 /*
119 * Thread endianness is BE, so it flipped
120 * inadvertently. Thus we flip back to LE and
121 * set NIP to go to 'failure', instruction (5).
122 */
123 ucp->uc_mcontext.gp_regs[PT_MSR] |= 1UL;
124 ucp->uc_mcontext.gp_regs[PT_NIP] += 4;
125 }
126 }
127 }
128
129 /***
130 * Big-Endian Machine
131 */
132
133 else {
134 /* First trap event */
135 if (trap_event == 0) {
136 /*
137 * Force thread endianness to be LE. Instructions (1),
138 * (3), and (4) will be executed, generating a second
139 * trap in TM mode.
140 */
141 ucp->uc_mcontext.gp_regs[PT_MSR] |= 1UL;
142 }
143 /* Second trap event */
144 else if (trap_event == 1) {
145 /*
146 * Do nothing. If bug is present on return from this
147 * second trap event endianness will flip back "automat-
148 * ically" to BE, otherwise thread endianness will
149 * continue to be LE, just as it was set above.
150 */
151 }
152 /* A third trap event */
153 else {
154 /*
155 * Once here it means that after returning from the sec-
156 * ond trap event instruction (4) (trap) was executed
157 * as LE, generating a third trap event. In that case
158 * endianness is still LE as set on return from the
159 * first trap event, hence no bug. Otherwise, bug
160 * flipped back to BE on return from the second trap
161 * event and instruction (4) was executed as 'tdi' (so
162 * basically a 'nop') and branch to 'failure' in
163 * instruction (5) was taken to indicate failure and we
164 * never get here.
165 */
166
167 /*
168 * Flip back to BE and go to instruction (6), i.e. go to
169 * 'success'.
170 */
171 ucp->uc_mcontext.gp_regs[PT_MSR] &= ~1UL;
172 ucp->uc_mcontext.gp_regs[PT_NIP] += 8;
173 }
174 }
175
176 trap_event++;
177}
178
179void usr1_signal_handler(int signo, siginfo_t *si, void *not_used)
180{
181 /* Got a USR1 signal from ping(), so just tell pong() to exit */
182 exit_from_pong = 1;
183}
184
185void *ping(void *not_used)
186{
187 uint64_t i;
188
189 trap_event = 0;
190
191 /*
192 * Wait an amount of context switches so load_fp and load_vec overflows
193 * and MSR_[FP|VEC|V] is 0.
194 */
195 for (i = 0; i < 1024*1024*512; i++)
196 ;
197
198 asm goto(
199 /*
200 * [NA] means "Native Endianness", i.e. it tells how a
201 * instruction is executed on machine's native endianness (in
202 * other words, native endianness matches kernel endianness).
203 * [OP] means "Opposite Endianness", i.e. on a BE machine, it
204 * tells how a instruction is executed as a LE instruction; con-
205 * versely, on a LE machine, it tells how a instruction is
206 * executed as a BE instruction. When [NA] is omitted, it means
207 * that the native interpretation of a given instruction is not
208 * relevant for the test. Likewise when [OP] is omitted.
209 */
210
211 " tbegin. ;" /* (0) tbegin. [NA] */
212 " tdi 0, 0, 0x48;" /* (1) nop [NA]; b (3) [OP] */
213 " trap ;" /* (2) trap [NA] */
214 ".long 0x1D05007C;" /* (3) tbegin. [OP] */
215 ".long 0x0800E07F;" /* (4) trap [OP]; nop [NA] */
216 " b %l[failure] ;" /* (5) b [NA]; MSR.LE flipped (bug) */
217 " b %l[success] ;" /* (6) b [NA]; MSR.LE did not flip (ok)*/
218
219 : : : : failure, success);
220
221failure:
222 success = false;
223 goto exit_from_ping;
224
225success:
226 success = true;
227
228exit_from_ping:
229 /* Tell pong() to exit before leaving */
230 pthread_kill(t1_pong, SIGUSR1);
231 return NULL;
232}
233
234void *pong(void *not_used)
235{
236 while (!exit_from_pong)
237 /*
238 * Induce context switches on ping() thread
239 * until ping() finishes its job and signs
240 * to exit from this loop.
241 */
242 sched_yield();
243
244 return NULL;
245}
246
247int tm_trap_test(void)
248{
249 uint16_t k = 1;
250
251 int rc;
252
253 pthread_attr_t attr;
254 cpu_set_t cpuset;
255
256 struct sigaction trap_sa;
257
258 trap_sa.sa_flags = SA_SIGINFO;
259 trap_sa.sa_sigaction = trap_signal_handler;
260 sigaction(SIGTRAP, &trap_sa, NULL);
261
262 struct sigaction usr1_sa;
263
264 usr1_sa.sa_flags = SA_SIGINFO;
265 usr1_sa.sa_sigaction = usr1_signal_handler;
266 sigaction(SIGUSR1, &usr1_sa, NULL);
267
268 /* Set only CPU 0 in the mask. Both threads will be bound to cpu 0. */
269 CPU_ZERO(&cpuset);
270 CPU_SET(0, &cpuset);
271
272 /* Init pthread attribute */
273 rc = pthread_attr_init(&attr);
274 if (rc)
275 pr_error(rc, "pthread_attr_init()");
276
277 /*
278 * Bind thread ping() and pong() both to CPU 0 so they ping-pong and
279 * speed up context switches on ping() thread, speeding up the load_fp
280 * and load_vec overflow.
281 */
282 rc = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset);
283 if (rc)
284 pr_error(rc, "pthread_attr_setaffinity()");
285
286 /* Figure out the machine endianness */
287 le = (int) *(uint8_t *)&k;
288
289 printf("%s machine detected. Checking if endianness flips %s",
290 le ? "Little-Endian" : "Big-Endian",
291 "inadvertently on trap in TM... ");
292
293 rc = fflush(0);
294 if (rc)
295 pr_error(rc, "fflush()");
296
297 /* Launch ping() */
298 rc = pthread_create(&t0_ping, &attr, ping, NULL);
299 if (rc)
300 pr_error(rc, "pthread_create()");
301
302 exit_from_pong = 0;
303
304 /* Launch pong() */
305 rc = pthread_create(&t1_pong, &attr, pong, NULL);
306 if (rc)
307 pr_error(rc, "pthread_create()");
308
309 rc = pthread_join(t0_ping, NULL);
310 if (rc)
311 pr_error(rc, "pthread_join()");
312
313 rc = pthread_join(t1_pong, NULL);
314 if (rc)
315 pr_error(rc, "pthread_join()");
316
317 if (success) {
318 printf("no.\n"); /* no, endianness did not flip inadvertently */
319 return EXIT_SUCCESS;
320 }
321
322 printf("yes!\n"); /* yes, endianness did flip inadvertently */
323 return EXIT_FAILURE;
324}
325
326int main(int argc, char **argv)
327{
328 return test_harness(tm_trap_test, "tm_trap_test");
329}
diff --git a/tools/testing/selftests/powerpc/tm/tm-unavailable.c b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
index 96c37f84ce54..e6a0fad2bfd0 100644
--- a/tools/testing/selftests/powerpc/tm/tm-unavailable.c
+++ b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#define _GNU_SOURCE 17#define _GNU_SOURCE
18#include <error.h>
18#include <stdio.h> 19#include <stdio.h>
19#include <stdlib.h> 20#include <stdlib.h>
20#include <unistd.h> 21#include <unistd.h>
@@ -33,6 +34,11 @@
33#define VSX_UNA_EXCEPTION 2 34#define VSX_UNA_EXCEPTION 2
34 35
35#define NUM_EXCEPTIONS 3 36#define NUM_EXCEPTIONS 3
37#define err_at_line(status, errnum, format, ...) \
38 error_at_line(status, errnum, __FILE__, __LINE__, format ##__VA_ARGS__)
39
40#define pr_warn(code, format, ...) err_at_line(0, code, format, ##__VA_ARGS__)
41#define pr_err(code, format, ...) err_at_line(1, code, format, ##__VA_ARGS__)
36 42
37struct Flags { 43struct Flags {
38 int touch_fp; 44 int touch_fp;
@@ -303,10 +309,19 @@ void test_fp_vec(int fp, int vec, pthread_attr_t *attr)
303 * checking if the failure cause is the one we expect. 309 * checking if the failure cause is the one we expect.
304 */ 310 */
305 do { 311 do {
312 int rc;
313
306 /* Bind 'ping' to CPU 0, as specified in 'attr'. */ 314 /* Bind 'ping' to CPU 0, as specified in 'attr'. */
307 pthread_create(&t0, attr, ping, (void *) &flags); 315 rc = pthread_create(&t0, attr, ping, (void *) &flags);
308 pthread_setname_np(t0, "ping"); 316 if (rc)
309 pthread_join(t0, &ret_value); 317 pr_err(rc, "pthread_create()");
318 rc = pthread_setname_np(t0, "ping");
319 if (rc)
320 pr_warn(rc, "pthread_setname_np");
321 rc = pthread_join(t0, &ret_value);
322 if (rc)
323 pr_err(rc, "pthread_join");
324
310 retries--; 325 retries--;
311 } while (ret_value != NULL && retries); 326 } while (ret_value != NULL && retries);
312 327
@@ -320,7 +335,7 @@ void test_fp_vec(int fp, int vec, pthread_attr_t *attr)
320 335
321int main(int argc, char **argv) 336int main(int argc, char **argv)
322{ 337{
323 int exception; /* FP = 0, VEC = 1, VSX = 2 */ 338 int rc, exception; /* FP = 0, VEC = 1, VSX = 2 */
324 pthread_t t1; 339 pthread_t t1;
325 pthread_attr_t attr; 340 pthread_attr_t attr;
326 cpu_set_t cpuset; 341 cpu_set_t cpuset;
@@ -330,13 +345,23 @@ int main(int argc, char **argv)
330 CPU_SET(0, &cpuset); 345 CPU_SET(0, &cpuset);
331 346
332 /* Init pthread attribute. */ 347 /* Init pthread attribute. */
333 pthread_attr_init(&attr); 348 rc = pthread_attr_init(&attr);
349 if (rc)
350 pr_err(rc, "pthread_attr_init()");
334 351
335 /* Set CPU 0 mask into the pthread attribute. */ 352 /* Set CPU 0 mask into the pthread attribute. */
336 pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset); 353 rc = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset);
337 354 if (rc)
338 pthread_create(&t1, &attr /* Bind 'pong' to CPU 0 */, pong, NULL); 355 pr_err(rc, "pthread_attr_setaffinity_np()");
339 pthread_setname_np(t1, "pong"); /* Name it for systemtap convenience */ 356
357 rc = pthread_create(&t1, &attr /* Bind 'pong' to CPU 0 */, pong, NULL);
358 if (rc)
359 pr_err(rc, "pthread_create()");
360
361 /* Name it for systemtap convenience */
362 rc = pthread_setname_np(t1, "pong");
363 if (rc)
364 pr_warn(rc, "pthread_create()");
340 365
341 flags.result = 0; 366 flags.result = 0;
342 367
diff --git a/tools/testing/selftests/ptp/testptp.c b/tools/testing/selftests/ptp/testptp.c
index 5d2eae16f7ee..a5d8f0ab0da0 100644
--- a/tools/testing/selftests/ptp/testptp.c
+++ b/tools/testing/selftests/ptp/testptp.c
@@ -60,9 +60,7 @@ static int clock_adjtime(clockid_t id, struct timex *tx)
60static clockid_t get_clockid(int fd) 60static clockid_t get_clockid(int fd)
61{ 61{
62#define CLOCKFD 3 62#define CLOCKFD 3
63#define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD) 63 return (((unsigned int) ~fd) << 3) | CLOCKFD;
64
65 return FD_TO_CLOCKID(fd);
66} 64}
67 65
68static void handle_alarm(int s) 66static void handle_alarm(int s)
diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh b/tools/testing/selftests/rcutorture/bin/config2frag.sh
deleted file mode 100755
index 56f51ae13d73..000000000000
--- a/tools/testing/selftests/rcutorture/bin/config2frag.sh
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/bin/bash
2# Usage: config2frag.sh < .config > configfrag
3#
4# Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the
5# resulting file becomes a legitimate Kconfig fragment.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, you can access it online at
19# http://www.gnu.org/licenses/gpl-2.0.html.
20#
21# Copyright (C) IBM Corporation, 2013
22#
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24
25LANG=C sed -e 's/^# CONFIG_\([a-zA-Z0-9_]*\) is not set$/CONFIG_\1=n/'
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
index 51f66a7ce876..c15f270e121d 100755
--- a/tools/testing/selftests/rcutorture/bin/configinit.sh
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -51,7 +51,7 @@ then
51 mkdir $builddir 51 mkdir $builddir
52 fi 52 fi
53 else 53 else
54 echo Bad build directory: \"$builddir\" 54 echo Bad build directory: \"$buildloc\"
55 exit 2 55 exit 2
56 fi 56 fi
57fi 57fi
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index fb66d0173638..34d126734cde 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -29,11 +29,6 @@ then
29 exit 1 29 exit 1
30fi 30fi
31builddir=${2} 31builddir=${2}
32if test -z "$builddir" -o ! -d "$builddir" -o ! -w "$builddir"
33then
34 echo "kvm-build.sh :$builddir: Not a writable directory, cannot build into it"
35 exit 1
36fi
37 32
38T=${TMPDIR-/tmp}/test-linux.sh.$$ 33T=${TMPDIR-/tmp}/test-linux.sh.$$
39trap 'rm -rf $T' 0 34trap 'rm -rf $T' 0
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
index 43f764098e50..2de92f43ee8c 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
@@ -23,7 +23,7 @@
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24 24
25i="$1" 25i="$1"
26if test -d $i 26if test -d "$i" -a -r "$i"
27then 27then
28 : 28 :
29else 29else
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index 559e01ac86be..c2e1bb6d0cba 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -23,14 +23,14 @@
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24 24
25i="$1" 25i="$1"
26if test -d $i 26if test -d "$i" -a -r "$i"
27then 27then
28 : 28 :
29else 29else
30 echo Unreadable results directory: $i 30 echo Unreadable results directory: $i
31 exit 1 31 exit 1
32fi 32fi
33. tools/testing/selftests/rcutorture/bin/functions.sh 33. functions.sh
34 34
35configfile=`echo $i | sed -e 's/^.*\///'` 35configfile=`echo $i | sed -e 's/^.*\///'`
36ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'` 36ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh
index f79b0e9e84fc..963f71289d22 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh
@@ -26,7 +26,7 @@
26# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 26# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
27 27
28i="$1" 28i="$1"
29. tools/testing/selftests/rcutorture/bin/functions.sh 29. functions.sh
30 30
31if test "`grep -c 'rcu_exp_grace_period.*start' < $i/console.log`" -lt 100 31if test "`grep -c 'rcu_exp_grace_period.*start' < $i/console.log`" -lt 100
32then 32then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
index 8f3121afc716..ccebf772fa1e 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
@@ -23,7 +23,7 @@
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24 24
25i="$1" 25i="$1"
26if test -d $i 26if test -d "$i" -a -r "$i"
27then 27then
28 : 28 :
29else 29else
@@ -31,7 +31,7 @@ else
31 exit 1 31 exit 1
32fi 32fi
33PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH 33PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
34. tools/testing/selftests/rcutorture/bin/functions.sh 34. functions.sh
35 35
36if kvm-recheck-rcuperf-ftrace.sh $i 36if kvm-recheck-rcuperf-ftrace.sh $i
37then 37then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index f659346d3358..f7e988f369dd 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -25,7 +25,7 @@
25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
26 26
27PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH 27PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
28. tools/testing/selftests/rcutorture/bin/functions.sh 28. functions.sh
29for rd in "$@" 29for rd in "$@"
30do 30do
31 firsttime=1 31 firsttime=1
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index ab14b97c942c..1b78a12740e5 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -42,7 +42,7 @@ T=${TMPDIR-/tmp}/kvm-test-1-run.sh.$$
42trap 'rm -rf $T' 0 42trap 'rm -rf $T' 0
43mkdir $T 43mkdir $T
44 44
45. $KVM/bin/functions.sh 45. functions.sh
46. $CONFIGFRAG/ver_functions.sh 46. $CONFIGFRAG/ver_functions.sh
47 47
48config_template=${1} 48config_template=${1}
@@ -154,9 +154,7 @@ cpu_count=`configfrag_boot_cpus "$boot_args" "$config_template" "$cpu_count"`
154vcpus=`identify_qemu_vcpus` 154vcpus=`identify_qemu_vcpus`
155if test $cpu_count -gt $vcpus 155if test $cpu_count -gt $vcpus
156then 156then
157 echo CPU count limited from $cpu_count to $vcpus 157 echo CPU count limited from $cpu_count to $vcpus | tee -a $resdir/Warnings
158 touch $resdir/Warnings
159 echo CPU count limited from $cpu_count to $vcpus >> $resdir/Warnings
160 cpu_count=$vcpus 158 cpu_count=$vcpus
161fi 159fi
162qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`" 160qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index ccd49e958fd2..7d1f607f0f76 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -1,8 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# 2#
3# Run a series of 14 tests under KVM. These are not particularly 3# Run a series of 14 tests under KVM. These are not particularly
4# well-selected or well-tuned, but are the current set. Run from the 4# well-selected or well-tuned, but are the current set.
5# top level of the source tree.
6# 5#
7# Edit the definitions below to set the locations of the various directories, 6# Edit the definitions below to set the locations of the various directories,
8# as well as the test duration. 7# as well as the test duration.
@@ -34,6 +33,8 @@ T=${TMPDIR-/tmp}/kvm.sh.$$
34trap 'rm -rf $T' 0 33trap 'rm -rf $T' 0
35mkdir $T 34mkdir $T
36 35
36cd `dirname $scriptname`/../../../../../
37
37dur=$((30*60)) 38dur=$((30*60))
38dryrun="" 39dryrun=""
39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM 40KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
@@ -70,7 +71,7 @@ usage () {
70 echo " --kmake-arg kernel-make-arguments" 71 echo " --kmake-arg kernel-make-arguments"
71 echo " --mac nn:nn:nn:nn:nn:nn" 72 echo " --mac nn:nn:nn:nn:nn:nn"
72 echo " --no-initrd" 73 echo " --no-initrd"
73 echo " --qemu-args qemu-system-..." 74 echo " --qemu-args qemu-arguments"
74 echo " --qemu-cmd qemu-system-..." 75 echo " --qemu-cmd qemu-system-..."
75 echo " --results absolute-pathname" 76 echo " --results absolute-pathname"
76 echo " --torture rcu" 77 echo " --torture rcu"
@@ -150,7 +151,7 @@ do
150 TORTURE_INITRD=""; export TORTURE_INITRD 151 TORTURE_INITRD=""; export TORTURE_INITRD
151 ;; 152 ;;
152 --qemu-args|--qemu-arg) 153 --qemu-args|--qemu-arg)
153 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error' 154 checkarg --qemu-args "(qemu arguments)" $# "$2" '^-' '^error'
154 TORTURE_QEMU_ARG="$2" 155 TORTURE_QEMU_ARG="$2"
155 shift 156 shift
156 ;; 157 ;;
@@ -238,7 +239,6 @@ BEGIN {
238} 239}
239 240
240END { 241END {
241 alldone = 0;
242 batch = 0; 242 batch = 0;
243 nc = -1; 243 nc = -1;
244 244
@@ -331,8 +331,7 @@ awk < $T/cfgcpu.pack \
331# Dump out the scripting required to run one test batch. 331# Dump out the scripting required to run one test batch.
332function dump(first, pastlast, batchnum) 332function dump(first, pastlast, batchnum)
333{ 333{
334 print "echo ----Start batch " batchnum ": `date`"; 334 print "echo ----Start batch " batchnum ": `date` | tee -a " rd "log";
335 print "echo ----Start batch " batchnum ": `date` >> " rd "/log";
336 print "needqemurun=" 335 print "needqemurun="
337 jn=1 336 jn=1
338 for (j = first; j < pastlast; j++) { 337 for (j = first; j < pastlast; j++) {
@@ -349,21 +348,18 @@ function dump(first, pastlast, batchnum)
349 ovf = "-ovf"; 348 ovf = "-ovf";
350 else 349 else
351 ovf = ""; 350 ovf = "";
352 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date`"; 351 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` | tee -a " rd "log";
353 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` >> " rd "/log";
354 print "rm -f " builddir ".*"; 352 print "rm -f " builddir ".*";
355 print "touch " builddir ".wait"; 353 print "touch " builddir ".wait";
356 print "mkdir " builddir " > /dev/null 2>&1 || :"; 354 print "mkdir " builddir " > /dev/null 2>&1 || :";
357 print "mkdir " rd cfr[jn] " || :"; 355 print "mkdir " rd cfr[jn] " || :";
358 print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &" 356 print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &"
359 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`"; 357 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
360 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log";
361 print "while test -f " builddir ".wait" 358 print "while test -f " builddir ".wait"
362 print "do" 359 print "do"
363 print "\tsleep 1" 360 print "\tsleep 1"
364 print "done" 361 print "done"
365 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date`"; 362 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
366 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` >> " rd "/log";
367 jn++; 363 jn++;
368 } 364 }
369 for (j = 1; j < jn; j++) { 365 for (j = 1; j < jn; j++) {
@@ -371,8 +367,7 @@ function dump(first, pastlast, batchnum)
371 print "rm -f " builddir ".ready" 367 print "rm -f " builddir ".ready"
372 print "if test -f \"" rd cfr[j] "/builtkernel\"" 368 print "if test -f \"" rd cfr[j] "/builtkernel\""
373 print "then" 369 print "then"
374 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date`"; 370 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` | tee -a " rd "log";
375 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` >> " rd "/log";
376 print "\tneedqemurun=1" 371 print "\tneedqemurun=1"
377 print "fi" 372 print "fi"
378 } 373 }
@@ -386,31 +381,26 @@ function dump(first, pastlast, batchnum)
386 njitter = ja[1]; 381 njitter = ja[1];
387 if (TORTURE_BUILDONLY && njitter != 0) { 382 if (TORTURE_BUILDONLY && njitter != 0) {
388 njitter = 0; 383 njitter = 0;
389 print "echo Build-only run, so suppressing jitter >> " rd "/log" 384 print "echo Build-only run, so suppressing jitter | tee -a " rd "log"
390 } 385 }
391 if (TORTURE_BUILDONLY) { 386 if (TORTURE_BUILDONLY) {
392 print "needqemurun=" 387 print "needqemurun="
393 } 388 }
394 print "if test -n \"$needqemurun\"" 389 print "if test -n \"$needqemurun\""
395 print "then" 390 print "then"
396 print "\techo ---- Starting kernels. `date`"; 391 print "\techo ---- Starting kernels. `date` | tee -a " rd "log";
397 print "\techo ---- Starting kernels. `date` >> " rd "/log";
398 for (j = 0; j < njitter; j++) 392 for (j = 0; j < njitter; j++)
399 print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&" 393 print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&"
400 print "\twait" 394 print "\twait"
401 print "\techo ---- All kernel runs complete. `date`"; 395 print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log";
402 print "\techo ---- All kernel runs complete. `date` >> " rd "/log";
403 print "else" 396 print "else"
404 print "\twait" 397 print "\twait"
405 print "\techo ---- No kernel runs. `date`"; 398 print "\techo ---- No kernel runs. `date` | tee -a " rd "log";
406 print "\techo ---- No kernel runs. `date` >> " rd "/log";
407 print "fi" 399 print "fi"
408 for (j = 1; j < jn; j++) { 400 for (j = 1; j < jn; j++) {
409 builddir=KVM "/b" j 401 builddir=KVM "/b" j
410 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results:"; 402 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: | tee -a " rd "log";
411 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: >> " rd "/log"; 403 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out | tee -a " rd "log";
412 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out";
413 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out >> " rd "/log";
414 } 404 }
415} 405}
416 406
diff --git a/tools/testing/selftests/rcutorture/bin/parse-torture.sh b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
index f12c38909b00..5987e50cfeb4 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-torture.sh
+++ b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
@@ -55,7 +55,7 @@ then
55 exit 55 exit
56fi 56fi
57 57
58grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' | 58grep --binary-files=text 'torture:.*ver:' $file | egrep --binary-files=text -v '\(null\)|rtc: 000000000* ' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
59awk ' 59awk '
60BEGIN { 60BEGIN {
61 ver = 0; 61 ver = 0;
diff --git a/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh
index 252aae618984..80eb646e1319 100644
--- a/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh
@@ -38,6 +38,5 @@ per_version_boot_params () {
38 echo $1 `locktorture_param_onoff "$1" "$2"` \ 38 echo $1 `locktorture_param_onoff "$1" "$2"` \
39 locktorture.stat_interval=15 \ 39 locktorture.stat_interval=15 \
40 locktorture.shutdown_secs=$3 \ 40 locktorture.shutdown_secs=$3 \
41 locktorture.torture_runnable=1 \
42 locktorture.verbose=1 41 locktorture.verbose=1
43} 42}
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh
index ffb85ed786fa..24ec91041957 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh
@@ -51,7 +51,6 @@ per_version_boot_params () {
51 `rcutorture_param_n_barrier_cbs "$1"` \ 51 `rcutorture_param_n_barrier_cbs "$1"` \
52 rcutorture.stat_interval=15 \ 52 rcutorture.stat_interval=15 \
53 rcutorture.shutdown_secs=$3 \ 53 rcutorture.shutdown_secs=$3 \
54 rcutorture.torture_runnable=1 \
55 rcutorture.test_no_idle_hz=1 \ 54 rcutorture.test_no_idle_hz=1 \
56 rcutorture.verbose=1 55 rcutorture.verbose=1
57} 56}
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
index 34f2a1b35ee5..b9603115d7c7 100644
--- a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
@@ -46,7 +46,6 @@ rcuperf_param_nwriters () {
46per_version_boot_params () { 46per_version_boot_params () {
47 echo $1 `rcuperf_param_nreaders "$1"` \ 47 echo $1 `rcuperf_param_nreaders "$1"` \
48 `rcuperf_param_nwriters "$1"` \ 48 `rcuperf_param_nwriters "$1"` \
49 rcuperf.perf_runnable=1 \
50 rcuperf.shutdown=1 \ 49 rcuperf.shutdown=1 \
51 rcuperf.verbose=1 50 rcuperf.verbose=1
52} 51}
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 24dbf634e2dd..0b457e8e0f0c 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -1717,7 +1717,7 @@ void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee,
1717 1717
1718 if (nr == __NR_getpid) 1718 if (nr == __NR_getpid)
1719 change_syscall(_metadata, tracee, __NR_getppid); 1719 change_syscall(_metadata, tracee, __NR_getppid);
1720 if (nr == __NR_open) 1720 if (nr == __NR_openat)
1721 change_syscall(_metadata, tracee, -1); 1721 change_syscall(_metadata, tracee, -1);
1722} 1722}
1723 1723
@@ -1792,7 +1792,7 @@ TEST_F(TRACE_syscall, ptrace_syscall_dropped)
1792 true); 1792 true);
1793 1793
1794 /* Tracer should skip the open syscall, resulting in EPERM. */ 1794 /* Tracer should skip the open syscall, resulting in EPERM. */
1795 EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_open)); 1795 EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_openat));
1796} 1796}
1797 1797
1798TEST_F(TRACE_syscall, syscall_allowed) 1798TEST_F(TRACE_syscall, syscall_allowed)
diff --git a/tools/testing/selftests/vm/.gitignore b/tools/testing/selftests/vm/.gitignore
index 1ca2ee4d15b9..63c94d776e89 100644
--- a/tools/testing/selftests/vm/.gitignore
+++ b/tools/testing/selftests/vm/.gitignore
@@ -10,3 +10,4 @@ userfaultfd
10mlock-intersect-test 10mlock-intersect-test
11mlock-random-test 11mlock-random-test
12virtual_address_range 12virtual_address_range
13gup_benchmark
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 7f45806bd863..fdefa2295ddc 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -8,17 +8,18 @@ endif
8CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) 8CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
9LDLIBS = -lrt 9LDLIBS = -lrt
10TEST_GEN_FILES = compaction_test 10TEST_GEN_FILES = compaction_test
11TEST_GEN_FILES += gup_benchmark
11TEST_GEN_FILES += hugepage-mmap 12TEST_GEN_FILES += hugepage-mmap
12TEST_GEN_FILES += hugepage-shm 13TEST_GEN_FILES += hugepage-shm
13TEST_GEN_FILES += map_hugetlb 14TEST_GEN_FILES += map_hugetlb
15TEST_GEN_FILES += mlock-random-test
14TEST_GEN_FILES += mlock2-tests 16TEST_GEN_FILES += mlock2-tests
15TEST_GEN_FILES += on-fault-limit 17TEST_GEN_FILES += on-fault-limit
16TEST_GEN_FILES += thuge-gen 18TEST_GEN_FILES += thuge-gen
17TEST_GEN_FILES += transhuge-stress 19TEST_GEN_FILES += transhuge-stress
18TEST_GEN_FILES += userfaultfd 20TEST_GEN_FILES += userfaultfd
19TEST_GEN_FILES += mlock-random-test 21TEST_GEN_FILES += va_128TBswitch
20TEST_GEN_FILES += virtual_address_range 22TEST_GEN_FILES += virtual_address_range
21TEST_GEN_FILES += gup_benchmark
22 23
23TEST_PROGS := run_vmtests 24TEST_PROGS := run_vmtests
24 25
diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
index a65b016d4c13..1097f04e4d80 100644
--- a/tools/testing/selftests/vm/compaction_test.c
+++ b/tools/testing/selftests/vm/compaction_test.c
@@ -137,6 +137,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
137 printf("No of huge pages allocated = %d\n", 137 printf("No of huge pages allocated = %d\n",
138 (atoi(nr_hugepages))); 138 (atoi(nr_hugepages)));
139 139
140 lseek(fd, 0, SEEK_SET);
141
140 if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages)) 142 if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
141 != strlen(initial_nr_hugepages)) { 143 != strlen(initial_nr_hugepages)) {
142 perror("Failed to write value to /proc/sys/vm/nr_hugepages\n"); 144 perror("Failed to write value to /proc/sys/vm/nr_hugepages\n");
diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftests/vm/run_vmtests
index cc826326de87..d2561895a021 100755
--- a/tools/testing/selftests/vm/run_vmtests
+++ b/tools/testing/selftests/vm/run_vmtests
@@ -177,4 +177,15 @@ else
177 echo "[PASS]" 177 echo "[PASS]"
178fi 178fi
179 179
180echo "-----------------------------"
181echo "running virtual address 128TB switch test"
182echo "-----------------------------"
183./va_128TBswitch
184if [ $? -ne 0 ]; then
185 echo "[FAIL]"
186 exitcode=1
187else
188 echo "[PASS]"
189fi
190
180exit $exitcode 191exit $exitcode
diff --git a/tools/testing/selftests/vm/va_128TBswitch.c b/tools/testing/selftests/vm/va_128TBswitch.c
new file mode 100644
index 000000000000..e7fe734c374f
--- /dev/null
+++ b/tools/testing/selftests/vm/va_128TBswitch.c
@@ -0,0 +1,297 @@
1/*
2 *
3 * Authors: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
4 * Authors: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 */
15
16#include <stdio.h>
17#include <sys/mman.h>
18#include <string.h>
19
20#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
21
22#ifdef __powerpc64__
23#define PAGE_SIZE (64 << 10)
24/*
25 * This will work with 16M and 2M hugepage size
26 */
27#define HUGETLB_SIZE (16 << 20)
28#else
29#define PAGE_SIZE (4 << 10)
30#define HUGETLB_SIZE (2 << 20)
31#endif
32
33/*
34 * >= 128TB is the hint addr value we used to select
35 * large address space.
36 */
37#define ADDR_SWITCH_HINT (1UL << 47)
38#define LOW_ADDR ((void *) (1UL << 30))
39#define HIGH_ADDR ((void *) (1UL << 48))
40
41struct testcase {
42 void *addr;
43 unsigned long size;
44 unsigned long flags;
45 const char *msg;
46 unsigned int low_addr_required:1;
47 unsigned int keep_mapped:1;
48};
49
50static struct testcase testcases[] = {
51 {
52 /*
53 * If stack is moved, we could possibly allocate
54 * this at the requested address.
55 */
56 .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
57 .size = PAGE_SIZE,
58 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
59 .msg = "mmap(ADDR_SWITCH_HINT - PAGE_SIZE, PAGE_SIZE)",
60 .low_addr_required = 1,
61 },
62 {
63 /*
64 * We should never allocate at the requested address or above it
65 * The len cross the 128TB boundary. Without MAP_FIXED
66 * we will always search in the lower address space.
67 */
68 .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
69 .size = 2 * PAGE_SIZE,
70 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
71 .msg = "mmap(ADDR_SWITCH_HINT - PAGE_SIZE, (2 * PAGE_SIZE))",
72 .low_addr_required = 1,
73 },
74 {
75 /*
76 * Exact mapping at 128TB, the area is free we should get that
77 * even without MAP_FIXED.
78 */
79 .addr = ((void *)(ADDR_SWITCH_HINT)),
80 .size = PAGE_SIZE,
81 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
82 .msg = "mmap(ADDR_SWITCH_HINT, PAGE_SIZE)",
83 .keep_mapped = 1,
84 },
85 {
86 .addr = (void *)(ADDR_SWITCH_HINT),
87 .size = 2 * PAGE_SIZE,
88 .flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
89 .msg = "mmap(ADDR_SWITCH_HINT, 2 * PAGE_SIZE, MAP_FIXED)",
90 },
91 {
92 .addr = NULL,
93 .size = 2 * PAGE_SIZE,
94 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
95 .msg = "mmap(NULL)",
96 .low_addr_required = 1,
97 },
98 {
99 .addr = LOW_ADDR,
100 .size = 2 * PAGE_SIZE,
101 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
102 .msg = "mmap(LOW_ADDR)",
103 .low_addr_required = 1,
104 },
105 {
106 .addr = HIGH_ADDR,
107 .size = 2 * PAGE_SIZE,
108 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
109 .msg = "mmap(HIGH_ADDR)",
110 .keep_mapped = 1,
111 },
112 {
113 .addr = HIGH_ADDR,
114 .size = 2 * PAGE_SIZE,
115 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
116 .msg = "mmap(HIGH_ADDR) again",
117 .keep_mapped = 1,
118 },
119 {
120 .addr = HIGH_ADDR,
121 .size = 2 * PAGE_SIZE,
122 .flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
123 .msg = "mmap(HIGH_ADDR, MAP_FIXED)",
124 },
125 {
126 .addr = (void *) -1,
127 .size = 2 * PAGE_SIZE,
128 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
129 .msg = "mmap(-1)",
130 .keep_mapped = 1,
131 },
132 {
133 .addr = (void *) -1,
134 .size = 2 * PAGE_SIZE,
135 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
136 .msg = "mmap(-1) again",
137 },
138 {
139 .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
140 .size = PAGE_SIZE,
141 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
142 .msg = "mmap(ADDR_SWITCH_HINT - PAGE_SIZE, PAGE_SIZE)",
143 .low_addr_required = 1,
144 },
145 {
146 .addr = (void *)(ADDR_SWITCH_HINT - PAGE_SIZE),
147 .size = 2 * PAGE_SIZE,
148 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
149 .msg = "mmap(ADDR_SWITCH_HINT - PAGE_SIZE, 2 * PAGE_SIZE)",
150 .low_addr_required = 1,
151 .keep_mapped = 1,
152 },
153 {
154 .addr = (void *)(ADDR_SWITCH_HINT - PAGE_SIZE / 2),
155 .size = 2 * PAGE_SIZE,
156 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
157 .msg = "mmap(ADDR_SWITCH_HINT - PAGE_SIZE/2 , 2 * PAGE_SIZE)",
158 .low_addr_required = 1,
159 .keep_mapped = 1,
160 },
161 {
162 .addr = ((void *)(ADDR_SWITCH_HINT)),
163 .size = PAGE_SIZE,
164 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
165 .msg = "mmap(ADDR_SWITCH_HINT, PAGE_SIZE)",
166 },
167 {
168 .addr = (void *)(ADDR_SWITCH_HINT),
169 .size = 2 * PAGE_SIZE,
170 .flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
171 .msg = "mmap(ADDR_SWITCH_HINT, 2 * PAGE_SIZE, MAP_FIXED)",
172 },
173};
174
175static struct testcase hugetlb_testcases[] = {
176 {
177 .addr = NULL,
178 .size = HUGETLB_SIZE,
179 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
180 .msg = "mmap(NULL, MAP_HUGETLB)",
181 .low_addr_required = 1,
182 },
183 {
184 .addr = LOW_ADDR,
185 .size = HUGETLB_SIZE,
186 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
187 .msg = "mmap(LOW_ADDR, MAP_HUGETLB)",
188 .low_addr_required = 1,
189 },
190 {
191 .addr = HIGH_ADDR,
192 .size = HUGETLB_SIZE,
193 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
194 .msg = "mmap(HIGH_ADDR, MAP_HUGETLB)",
195 .keep_mapped = 1,
196 },
197 {
198 .addr = HIGH_ADDR,
199 .size = HUGETLB_SIZE,
200 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
201 .msg = "mmap(HIGH_ADDR, MAP_HUGETLB) again",
202 .keep_mapped = 1,
203 },
204 {
205 .addr = HIGH_ADDR,
206 .size = HUGETLB_SIZE,
207 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
208 .msg = "mmap(HIGH_ADDR, MAP_FIXED | MAP_HUGETLB)",
209 },
210 {
211 .addr = (void *) -1,
212 .size = HUGETLB_SIZE,
213 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
214 .msg = "mmap(-1, MAP_HUGETLB)",
215 .keep_mapped = 1,
216 },
217 {
218 .addr = (void *) -1,
219 .size = HUGETLB_SIZE,
220 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
221 .msg = "mmap(-1, MAP_HUGETLB) again",
222 },
223 {
224 .addr = (void *)(ADDR_SWITCH_HINT - PAGE_SIZE),
225 .size = 2 * HUGETLB_SIZE,
226 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
227 .msg = "mmap(ADDR_SWITCH_HINT - PAGE_SIZE, 2*HUGETLB_SIZE, MAP_HUGETLB)",
228 .low_addr_required = 1,
229 .keep_mapped = 1,
230 },
231 {
232 .addr = (void *)(ADDR_SWITCH_HINT),
233 .size = 2 * HUGETLB_SIZE,
234 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
235 .msg = "mmap(ADDR_SWITCH_HINT , 2*HUGETLB_SIZE, MAP_FIXED | MAP_HUGETLB)",
236 },
237};
238
239static int run_test(struct testcase *test, int count)
240{
241 void *p;
242 int i, ret = 0;
243
244 for (i = 0; i < count; i++) {
245 struct testcase *t = test + i;
246
247 p = mmap(t->addr, t->size, PROT_READ | PROT_WRITE, t->flags, -1, 0);
248
249 printf("%s: %p - ", t->msg, p);
250
251 if (p == MAP_FAILED) {
252 printf("FAILED\n");
253 ret = 1;
254 continue;
255 }
256
257 if (t->low_addr_required && p >= (void *)(ADDR_SWITCH_HINT)) {
258 printf("FAILED\n");
259 ret = 1;
260 } else {
261 /*
262 * Do a dereference of the address returned so that we catch
263 * bugs in page fault handling
264 */
265 memset(p, 0, t->size);
266 printf("OK\n");
267 }
268 if (!t->keep_mapped)
269 munmap(p, t->size);
270 }
271
272 return ret;
273}
274
275static int supported_arch(void)
276{
277#if defined(__powerpc64__)
278 return 1;
279#elif defined(__x86_64__)
280 return 1;
281#else
282 return 0;
283#endif
284}
285
286int main(int argc, char **argv)
287{
288 int ret;
289
290 if (!supported_arch())
291 return 0;
292
293 ret = run_test(testcases, ARRAY_SIZE(testcases));
294 if (argc == 2 && !strcmp(argv[1], "--run-hugetlb"))
295 ret = run_test(hugetlb_testcases, ARRAY_SIZE(hugetlb_testcases));
296 return ret;
297}
diff --git a/tools/testing/selftests/x86/5lvl.c b/tools/testing/selftests/x86/5lvl.c
deleted file mode 100644
index 2eafdcd4c2b3..000000000000
--- a/tools/testing/selftests/x86/5lvl.c
+++ /dev/null
@@ -1,177 +0,0 @@
1#include <stdio.h>
2#include <sys/mman.h>
3
4#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
5
6#define PAGE_SIZE 4096
7#define LOW_ADDR ((void *) (1UL << 30))
8#define HIGH_ADDR ((void *) (1UL << 50))
9
10struct testcase {
11 void *addr;
12 unsigned long size;
13 unsigned long flags;
14 const char *msg;
15 unsigned int low_addr_required:1;
16 unsigned int keep_mapped:1;
17};
18
19static struct testcase testcases[] = {
20 {
21 .addr = NULL,
22 .size = 2 * PAGE_SIZE,
23 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
24 .msg = "mmap(NULL)",
25 .low_addr_required = 1,
26 },
27 {
28 .addr = LOW_ADDR,
29 .size = 2 * PAGE_SIZE,
30 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
31 .msg = "mmap(LOW_ADDR)",
32 .low_addr_required = 1,
33 },
34 {
35 .addr = HIGH_ADDR,
36 .size = 2 * PAGE_SIZE,
37 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
38 .msg = "mmap(HIGH_ADDR)",
39 .keep_mapped = 1,
40 },
41 {
42 .addr = HIGH_ADDR,
43 .size = 2 * PAGE_SIZE,
44 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
45 .msg = "mmap(HIGH_ADDR) again",
46 .keep_mapped = 1,
47 },
48 {
49 .addr = HIGH_ADDR,
50 .size = 2 * PAGE_SIZE,
51 .flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
52 .msg = "mmap(HIGH_ADDR, MAP_FIXED)",
53 },
54 {
55 .addr = (void*) -1,
56 .size = 2 * PAGE_SIZE,
57 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
58 .msg = "mmap(-1)",
59 .keep_mapped = 1,
60 },
61 {
62 .addr = (void*) -1,
63 .size = 2 * PAGE_SIZE,
64 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
65 .msg = "mmap(-1) again",
66 },
67 {
68 .addr = (void *)((1UL << 47) - PAGE_SIZE),
69 .size = 2 * PAGE_SIZE,
70 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
71 .msg = "mmap((1UL << 47), 2 * PAGE_SIZE)",
72 .low_addr_required = 1,
73 .keep_mapped = 1,
74 },
75 {
76 .addr = (void *)((1UL << 47) - PAGE_SIZE / 2),
77 .size = 2 * PAGE_SIZE,
78 .flags = MAP_PRIVATE | MAP_ANONYMOUS,
79 .msg = "mmap((1UL << 47), 2 * PAGE_SIZE / 2)",
80 .low_addr_required = 1,
81 .keep_mapped = 1,
82 },
83 {
84 .addr = (void *)((1UL << 47) - PAGE_SIZE),
85 .size = 2 * PAGE_SIZE,
86 .flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
87 .msg = "mmap((1UL << 47) - PAGE_SIZE, 2 * PAGE_SIZE, MAP_FIXED)",
88 },
89 {
90 .addr = NULL,
91 .size = 2UL << 20,
92 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
93 .msg = "mmap(NULL, MAP_HUGETLB)",
94 .low_addr_required = 1,
95 },
96 {
97 .addr = LOW_ADDR,
98 .size = 2UL << 20,
99 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
100 .msg = "mmap(LOW_ADDR, MAP_HUGETLB)",
101 .low_addr_required = 1,
102 },
103 {
104 .addr = HIGH_ADDR,
105 .size = 2UL << 20,
106 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
107 .msg = "mmap(HIGH_ADDR, MAP_HUGETLB)",
108 .keep_mapped = 1,
109 },
110 {
111 .addr = HIGH_ADDR,
112 .size = 2UL << 20,
113 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
114 .msg = "mmap(HIGH_ADDR, MAP_HUGETLB) again",
115 .keep_mapped = 1,
116 },
117 {
118 .addr = HIGH_ADDR,
119 .size = 2UL << 20,
120 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
121 .msg = "mmap(HIGH_ADDR, MAP_FIXED | MAP_HUGETLB)",
122 },
123 {
124 .addr = (void*) -1,
125 .size = 2UL << 20,
126 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
127 .msg = "mmap(-1, MAP_HUGETLB)",
128 .keep_mapped = 1,
129 },
130 {
131 .addr = (void*) -1,
132 .size = 2UL << 20,
133 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
134 .msg = "mmap(-1, MAP_HUGETLB) again",
135 },
136 {
137 .addr = (void *)((1UL << 47) - PAGE_SIZE),
138 .size = 4UL << 20,
139 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS,
140 .msg = "mmap((1UL << 47), 4UL << 20, MAP_HUGETLB)",
141 .low_addr_required = 1,
142 .keep_mapped = 1,
143 },
144 {
145 .addr = (void *)((1UL << 47) - (2UL << 20)),
146 .size = 4UL << 20,
147 .flags = MAP_HUGETLB | MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
148 .msg = "mmap((1UL << 47) - (2UL << 20), 4UL << 20, MAP_FIXED | MAP_HUGETLB)",
149 },
150};
151
152int main(int argc, char **argv)
153{
154 int i;
155 void *p;
156
157 for (i = 0; i < ARRAY_SIZE(testcases); i++) {
158 struct testcase *t = testcases + i;
159
160 p = mmap(t->addr, t->size, PROT_NONE, t->flags, -1, 0);
161
162 printf("%s: %p - ", t->msg, p);
163
164 if (p == MAP_FAILED) {
165 printf("FAILED\n");
166 continue;
167 }
168
169 if (t->low_addr_required && p >= (void *)(1UL << 47))
170 printf("FAILED\n");
171 else
172 printf("OK\n");
173 if (!t->keep_mapped)
174 munmap(p, t->size);
175 }
176 return 0;
177}
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 5d4f10ac2af2..10ca46df1449 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -27,14 +27,26 @@ UNAME_M := $(shell uname -m)
27CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32) 27CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32)
28CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) 28CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c)
29 29
30define gen-target-rule-32
31$(1) $(1)_32: $(OUTPUT)/$(1)_32
32.PHONY: $(1) $(1)_32
33endef
34
35define gen-target-rule-64
36$(1) $(1)_64: $(OUTPUT)/$(1)_64
37.PHONY: $(1) $(1)_64
38endef
39
30ifeq ($(CAN_BUILD_I386),1) 40ifeq ($(CAN_BUILD_I386),1)
31all: all_32 41all: all_32
32TEST_PROGS += $(BINARIES_32) 42TEST_PROGS += $(BINARIES_32)
43$(foreach t,$(TARGETS_C_32BIT_ALL),$(eval $(call gen-target-rule-32,$(t))))
33endif 44endif
34 45
35ifeq ($(CAN_BUILD_X86_64),1) 46ifeq ($(CAN_BUILD_X86_64),1)
36all: all_64 47all: all_64
37TEST_PROGS += $(BINARIES_64) 48TEST_PROGS += $(BINARIES_64)
49$(foreach t,$(TARGETS_C_64BIT_ALL),$(eval $(call gen-target-rule-64,$(t))))
38endif 50endif
39 51
40all_32: $(BINARIES_32) 52all_32: $(BINARIES_32)
diff --git a/tools/usb/usbip/libsrc/usbip_device_driver.c b/tools/usb/usbip/libsrc/usbip_device_driver.c
index e059b7d1ec5b..ec3a0b794f15 100644
--- a/tools/usb/usbip/libsrc/usbip_device_driver.c
+++ b/tools/usb/usbip/libsrc/usbip_device_driver.c
@@ -77,7 +77,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
77 const char *path, *name; 77 const char *path, *name;
78 char filepath[SYSFS_PATH_MAX]; 78 char filepath[SYSFS_PATH_MAX];
79 struct usb_device_descriptor descr; 79 struct usb_device_descriptor descr;
80 unsigned i; 80 unsigned int i;
81 FILE *fd = NULL; 81 FILE *fd = NULL;
82 struct udev_device *plat; 82 struct udev_device *plat;
83 const char *speed; 83 const char *speed;
@@ -92,7 +92,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
92 return -1; 92 return -1;
93 ret = fread((char *) &descr, sizeof(descr), 1, fd); 93 ret = fread((char *) &descr, sizeof(descr), 1, fd);
94 if (ret < 0) 94 if (ret < 0)
95 return -1; 95 goto err;
96 fclose(fd); 96 fclose(fd);
97 97
98 copy_descr_attr(dev, &descr, bDeviceClass); 98 copy_descr_attr(dev, &descr, bDeviceClass);
@@ -124,6 +124,9 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
124 name = udev_device_get_sysname(plat); 124 name = udev_device_get_sysname(plat);
125 strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE); 125 strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
126 return 0; 126 return 0;
127err:
128 fclose(fd);
129 return -1;
127} 130}
128 131
129static int is_my_device(struct udev_device *dev) 132static int is_my_device(struct udev_device *dev)
diff --git a/tools/usb/usbip/src/usbip_bind.c b/tools/usb/usbip/src/usbip_bind.c
index fa46141ae68b..e121cfb1746a 100644
--- a/tools/usb/usbip/src/usbip_bind.c
+++ b/tools/usb/usbip/src/usbip_bind.c
@@ -144,6 +144,7 @@ static int bind_device(char *busid)
144 int rc; 144 int rc;
145 struct udev *udev; 145 struct udev *udev;
146 struct udev_device *dev; 146 struct udev_device *dev;
147 const char *devpath;
147 148
148 /* Check whether the device with this bus ID exists. */ 149 /* Check whether the device with this bus ID exists. */
149 udev = udev_new(); 150 udev = udev_new();
@@ -152,8 +153,16 @@ static int bind_device(char *busid)
152 err("device with the specified bus ID does not exist"); 153 err("device with the specified bus ID does not exist");
153 return -1; 154 return -1;
154 } 155 }
156 devpath = udev_device_get_devpath(dev);
155 udev_unref(udev); 157 udev_unref(udev);
156 158
159 /* If the device is already attached to vhci_hcd - bail out */
160 if (strstr(devpath, USBIP_VHCI_DRV_NAME)) {
161 err("bind loop detected: device: %s is attached to %s\n",
162 devpath, USBIP_VHCI_DRV_NAME);
163 return -1;
164 }
165
157 rc = unbind_other(busid); 166 rc = unbind_other(busid);
158 if (rc == UNBIND_ST_FAILED) { 167 if (rc == UNBIND_ST_FAILED) {
159 err("could not unbind driver from device on busid %s", busid); 168 err("could not unbind driver from device on busid %s", busid);
diff --git a/tools/usb/usbip/src/usbip_list.c b/tools/usb/usbip/src/usbip_list.c
index f1b38e866dd7..d65a9f444174 100644
--- a/tools/usb/usbip/src/usbip_list.c
+++ b/tools/usb/usbip/src/usbip_list.c
@@ -187,6 +187,7 @@ static int list_devices(bool parsable)
187 const char *busid; 187 const char *busid;
188 char product_name[128]; 188 char product_name[128];
189 int ret = -1; 189 int ret = -1;
190 const char *devpath;
190 191
191 /* Create libudev context. */ 192 /* Create libudev context. */
192 udev = udev_new(); 193 udev = udev_new();
@@ -209,6 +210,14 @@ static int list_devices(bool parsable)
209 path = udev_list_entry_get_name(dev_list_entry); 210 path = udev_list_entry_get_name(dev_list_entry);
210 dev = udev_device_new_from_syspath(udev, path); 211 dev = udev_device_new_from_syspath(udev, path);
211 212
213 /* Ignore devices attached to vhci_hcd */
214 devpath = udev_device_get_devpath(dev);
215 if (strstr(devpath, USBIP_VHCI_DRV_NAME)) {
216 dbg("Skip the device %s already attached to %s\n",
217 devpath, USBIP_VHCI_DRV_NAME);
218 continue;
219 }
220
212 /* Get device information. */ 221 /* Get device information. */
213 idVendor = udev_device_get_sysattr_value(dev, "idVendor"); 222 idVendor = udev_device_get_sysattr_value(dev, "idVendor");
214 idProduct = udev_device_get_sysattr_value(dev, "idProduct"); 223 idProduct = udev_device_get_sysattr_value(dev, "idProduct");
diff --git a/tools/usb/usbip/src/usbipd.c b/tools/usb/usbip/src/usbipd.c
index 009afb4a3aae..c6dad2a13c80 100644
--- a/tools/usb/usbip/src/usbipd.c
+++ b/tools/usb/usbip/src/usbipd.c
@@ -456,7 +456,7 @@ static void set_signal(void)
456 sigaction(SIGTERM, &act, NULL); 456 sigaction(SIGTERM, &act, NULL);
457 sigaction(SIGINT, &act, NULL); 457 sigaction(SIGINT, &act, NULL);
458 act.sa_handler = SIG_IGN; 458 act.sa_handler = SIG_IGN;
459 sigaction(SIGCLD, &act, NULL); 459 sigaction(SIGCHLD, &act, NULL);
460} 460}
461 461
462static const char *pid_file; 462static const char *pid_file;
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index 395521a7a8d8..fca8381bbe04 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -118,7 +118,7 @@ static inline void free_page(unsigned long addr)
118#define dev_err(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__) 118#define dev_err(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
119#define dev_warn(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__) 119#define dev_warn(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
120 120
121#define WARN_ON_ONCE(cond) ((cond) && fprintf (stderr, "WARNING\n")) 121#define WARN_ON_ONCE(cond) ((cond) ? fprintf (stderr, "WARNING\n") : 0)
122 122
123#define min(x, y) ({ \ 123#define min(x, y) ({ \
124 typeof(x) _min1 = (x); \ 124 typeof(x) _min1 = (x); \
diff --git a/tools/virtio/linux/thread_info.h b/tools/virtio/linux/thread_info.h
new file mode 100644
index 000000000000..e0f610d08006
--- /dev/null
+++ b/tools/virtio/linux/thread_info.h
@@ -0,0 +1 @@
#define check_copy_size(A, B, C) (1)
diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h
index 5706e075adf2..301d59bfcd0a 100644
--- a/tools/virtio/ringtest/main.h
+++ b/tools/virtio/ringtest/main.h
@@ -111,7 +111,7 @@ static inline void busy_wait(void)
111} 111}
112 112
113#if defined(__x86_64__) || defined(__i386__) 113#if defined(__x86_64__) || defined(__i386__)
114#define smp_mb() asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc") 114#define smp_mb() asm volatile("lock; addl $0,-132(%%rsp)" ::: "memory", "cc")
115#else 115#else
116/* 116/*
117 * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized 117 * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized
@@ -134,4 +134,61 @@ static inline void busy_wait(void)
134 barrier(); \ 134 barrier(); \
135} while (0) 135} while (0)
136 136
137#if defined(__i386__) || defined(__x86_64__) || defined(__s390x__)
138#define smp_wmb() barrier()
139#else
140#define smp_wmb() smp_release()
141#endif
142
143#ifdef __alpha__
144#define smp_read_barrier_depends() smp_acquire()
145#else
146#define smp_read_barrier_depends() do {} while(0)
147#endif
148
149static __always_inline
150void __read_once_size(const volatile void *p, void *res, int size)
151{
152 switch (size) { \
153 case 1: *(unsigned char *)res = *(volatile unsigned char *)p; break; \
154 case 2: *(unsigned short *)res = *(volatile unsigned short *)p; break; \
155 case 4: *(unsigned int *)res = *(volatile unsigned int *)p; break; \
156 case 8: *(unsigned long long *)res = *(volatile unsigned long long *)p; break; \
157 default: \
158 barrier(); \
159 __builtin_memcpy((void *)res, (const void *)p, size); \
160 barrier(); \
161 } \
162}
163
164static __always_inline void __write_once_size(volatile void *p, void *res, int size)
165{
166 switch (size) {
167 case 1: *(volatile unsigned char *)p = *(unsigned char *)res; break;
168 case 2: *(volatile unsigned short *)p = *(unsigned short *)res; break;
169 case 4: *(volatile unsigned int *)p = *(unsigned int *)res; break;
170 case 8: *(volatile unsigned long long *)p = *(unsigned long long *)res; break;
171 default:
172 barrier();
173 __builtin_memcpy((void *)p, (const void *)res, size);
174 barrier();
175 }
176}
177
178#define READ_ONCE(x) \
179({ \
180 union { typeof(x) __val; char __c[1]; } __u; \
181 __read_once_size(&(x), __u.__c, sizeof(x)); \
182 smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
183 __u.__val; \
184})
185
186#define WRITE_ONCE(x, val) \
187({ \
188 union { typeof(x) __val; char __c[1]; } __u = \
189 { .__val = (typeof(x)) (val) }; \
190 __write_once_size(&(x), __u.__c, sizeof(x)); \
191 __u.__val; \
192})
193
137#endif 194#endif
diff --git a/tools/virtio/ringtest/ptr_ring.c b/tools/virtio/ringtest/ptr_ring.c
index e6e81305ef46..477899c12c51 100644
--- a/tools/virtio/ringtest/ptr_ring.c
+++ b/tools/virtio/ringtest/ptr_ring.c
@@ -187,7 +187,7 @@ bool enable_kick()
187 187
188bool avail_empty() 188bool avail_empty()
189{ 189{
190 return !__ptr_ring_peek(&array); 190 return __ptr_ring_empty(&array);
191} 191}
192 192
193bool use_buf(unsigned *lenp, void **bufp) 193bool use_buf(unsigned *lenp, void **bufp)
diff --git a/tools/virtio/ringtest/ring.c b/tools/virtio/ringtest/ring.c
index 747c5dd47be8..5a41404aaef5 100644
--- a/tools/virtio/ringtest/ring.c
+++ b/tools/virtio/ringtest/ring.c
@@ -84,12 +84,11 @@ void alloc_ring(void)
84 perror("Unable to allocate ring buffer.\n"); 84 perror("Unable to allocate ring buffer.\n");
85 exit(3); 85 exit(3);
86 } 86 }
87 event = malloc(sizeof *event); 87 event = calloc(1, sizeof(*event));
88 if (!event) { 88 if (!event) {
89 perror("Unable to allocate event buffer.\n"); 89 perror("Unable to allocate event buffer.\n");
90 exit(3); 90 exit(3);
91 } 91 }
92 memset(event, 0, sizeof *event);
93 guest.avail_idx = 0; 92 guest.avail_idx = 0;
94 guest.kicked_avail_idx = -1; 93 guest.kicked_avail_idx = -1;
95 guest.last_used_idx = 0; 94 guest.last_used_idx = 0;
@@ -102,12 +101,11 @@ void alloc_ring(void)
102 ring[i] = desc; 101 ring[i] = desc;
103 } 102 }
104 guest.num_free = ring_size; 103 guest.num_free = ring_size;
105 data = malloc(ring_size * sizeof *data); 104 data = calloc(ring_size, sizeof(*data));
106 if (!data) { 105 if (!data) {
107 perror("Unable to allocate data buffer.\n"); 106 perror("Unable to allocate data buffer.\n");
108 exit(3); 107 exit(3);
109 } 108 }
110 memset(data, 0, ring_size * sizeof *data);
111} 109}
112 110
113/* guest side */ 111/* guest side */
@@ -188,16 +186,18 @@ bool enable_call()
188 186
189void kick_available(void) 187void kick_available(void)
190{ 188{
189 bool need;
190
191 /* Flush in previous flags write */ 191 /* Flush in previous flags write */
192 /* Barrier C (for pairing) */ 192 /* Barrier C (for pairing) */
193 smp_mb(); 193 smp_mb();
194 if (!need_event(event->kick_index, 194 need = need_event(event->kick_index,
195 guest.avail_idx, 195 guest.avail_idx,
196 guest.kicked_avail_idx)) 196 guest.kicked_avail_idx);
197 return;
198 197
199 guest.kicked_avail_idx = guest.avail_idx; 198 guest.kicked_avail_idx = guest.avail_idx;
200 kick(); 199 if (need)
200 kick();
201} 201}
202 202
203/* host side */ 203/* host side */
@@ -253,14 +253,18 @@ bool use_buf(unsigned *lenp, void **bufp)
253 253
254void call_used(void) 254void call_used(void)
255{ 255{
256 bool need;
257
256 /* Flush in previous flags write */ 258 /* Flush in previous flags write */
257 /* Barrier D (for pairing) */ 259 /* Barrier D (for pairing) */
258 smp_mb(); 260 smp_mb();
259 if (!need_event(event->call_index, 261
262 need = need_event(event->call_index,
260 host.used_idx, 263 host.used_idx,
261 host.called_used_idx)) 264 host.called_used_idx);
262 return;
263 265
264 host.called_used_idx = host.used_idx; 266 host.called_used_idx = host.used_idx;
265 call(); 267
268 if (need)
269 call();
266} 270}
diff --git a/tools/virtio/ringtest/virtio_ring_0_9.c b/tools/virtio/ringtest/virtio_ring_0_9.c
index bbc3043b2fb1..5fd3fbcb9e57 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -225,16 +225,18 @@ bool enable_call()
225 225
226void kick_available(void) 226void kick_available(void)
227{ 227{
228 bool need;
229
228 /* Flush in previous flags write */ 230 /* Flush in previous flags write */
229 /* Barrier C (for pairing) */ 231 /* Barrier C (for pairing) */
230 smp_mb(); 232 smp_mb();
231 if (!vring_need_event(vring_avail_event(&ring), 233 need = vring_need_event(vring_avail_event(&ring),
232 guest.avail_idx, 234 guest.avail_idx,
233 guest.kicked_avail_idx)) 235 guest.kicked_avail_idx);
234 return;
235 236
236 guest.kicked_avail_idx = guest.avail_idx; 237 guest.kicked_avail_idx = guest.avail_idx;
237 kick(); 238 if (need)
239 kick();
238} 240}
239 241
240/* host side */ 242/* host side */
@@ -316,14 +318,16 @@ bool use_buf(unsigned *lenp, void **bufp)
316 318
317void call_used(void) 319void call_used(void)
318{ 320{
321 bool need;
322
319 /* Flush in previous flags write */ 323 /* Flush in previous flags write */
320 /* Barrier D (for pairing) */ 324 /* Barrier D (for pairing) */
321 smp_mb(); 325 smp_mb();
322 if (!vring_need_event(vring_used_event(&ring), 326 need = vring_need_event(vring_used_event(&ring),
323 host.used_idx, 327 host.used_idx,
324 host.called_used_idx)) 328 host.called_used_idx);
325 return;
326 329
327 host.called_used_idx = host.used_idx; 330 host.called_used_idx = host.used_idx;
328 call(); 331 if (need)
332 call();
329} 333}
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c
index e92903fc7113..a8783f48f77f 100644
--- a/tools/vm/page-types.c
+++ b/tools/vm/page-types.c
@@ -169,9 +169,10 @@ static int opt_raw; /* for kernel developers */
169static int opt_list; /* list pages (in ranges) */ 169static int opt_list; /* list pages (in ranges) */
170static int opt_no_summary; /* don't show summary */ 170static int opt_no_summary; /* don't show summary */
171static pid_t opt_pid; /* process to walk */ 171static pid_t opt_pid; /* process to walk */
172const char * opt_file; /* file or directory path */ 172const char *opt_file; /* file or directory path */
173static uint64_t opt_cgroup; /* cgroup inode */ 173static uint64_t opt_cgroup; /* cgroup inode */
174static int opt_list_cgroup;/* list page cgroup */ 174static int opt_list_cgroup;/* list page cgroup */
175static const char *opt_kpageflags;/* kpageflags file to parse */
175 176
176#define MAX_ADDR_RANGES 1024 177#define MAX_ADDR_RANGES 1024
177static int nr_addr_ranges; 178static int nr_addr_ranges;
@@ -258,7 +259,7 @@ static int checked_open(const char *pathname, int flags)
258 * pagemap/kpageflags routines 259 * pagemap/kpageflags routines
259 */ 260 */
260 261
261static unsigned long do_u64_read(int fd, char *name, 262static unsigned long do_u64_read(int fd, const char *name,
262 uint64_t *buf, 263 uint64_t *buf,
263 unsigned long index, 264 unsigned long index,
264 unsigned long count) 265 unsigned long count)
@@ -283,7 +284,7 @@ static unsigned long kpageflags_read(uint64_t *buf,
283 unsigned long index, 284 unsigned long index,
284 unsigned long pages) 285 unsigned long pages)
285{ 286{
286 return do_u64_read(kpageflags_fd, PROC_KPAGEFLAGS, buf, index, pages); 287 return do_u64_read(kpageflags_fd, opt_kpageflags, buf, index, pages);
287} 288}
288 289
289static unsigned long kpagecgroup_read(uint64_t *buf, 290static unsigned long kpagecgroup_read(uint64_t *buf,
@@ -293,7 +294,7 @@ static unsigned long kpagecgroup_read(uint64_t *buf,
293 if (kpagecgroup_fd < 0) 294 if (kpagecgroup_fd < 0)
294 return pages; 295 return pages;
295 296
296 return do_u64_read(kpagecgroup_fd, PROC_KPAGEFLAGS, buf, index, pages); 297 return do_u64_read(kpagecgroup_fd, opt_kpageflags, buf, index, pages);
297} 298}
298 299
299static unsigned long pagemap_read(uint64_t *buf, 300static unsigned long pagemap_read(uint64_t *buf,
@@ -743,7 +744,7 @@ static void walk_addr_ranges(void)
743{ 744{
744 int i; 745 int i;
745 746
746 kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY); 747 kpageflags_fd = checked_open(opt_kpageflags, O_RDONLY);
747 748
748 if (!nr_addr_ranges) 749 if (!nr_addr_ranges)
749 add_addr_range(0, ULONG_MAX); 750 add_addr_range(0, ULONG_MAX);
@@ -790,6 +791,7 @@ static void usage(void)
790" -N|--no-summary Don't show summary info\n" 791" -N|--no-summary Don't show summary info\n"
791" -X|--hwpoison hwpoison pages\n" 792" -X|--hwpoison hwpoison pages\n"
792" -x|--unpoison unpoison pages\n" 793" -x|--unpoison unpoison pages\n"
794" -F|--kpageflags filename kpageflags file to parse\n"
793" -h|--help Show this usage message\n" 795" -h|--help Show this usage message\n"
794"flags:\n" 796"flags:\n"
795" 0x10 bitfield format, e.g.\n" 797" 0x10 bitfield format, e.g.\n"
@@ -1013,7 +1015,7 @@ static void walk_page_cache(void)
1013{ 1015{
1014 struct stat st; 1016 struct stat st;
1015 1017
1016 kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY); 1018 kpageflags_fd = checked_open(opt_kpageflags, O_RDONLY);
1017 pagemap_fd = checked_open("/proc/self/pagemap", O_RDONLY); 1019 pagemap_fd = checked_open("/proc/self/pagemap", O_RDONLY);
1018 sigaction(SIGBUS, &sigbus_action, NULL); 1020 sigaction(SIGBUS, &sigbus_action, NULL);
1019 1021
@@ -1164,6 +1166,11 @@ static void parse_bits_mask(const char *optarg)
1164 add_bits_filter(mask, bits); 1166 add_bits_filter(mask, bits);
1165} 1167}
1166 1168
1169static void parse_kpageflags(const char *name)
1170{
1171 opt_kpageflags = name;
1172}
1173
1167static void describe_flags(const char *optarg) 1174static void describe_flags(const char *optarg)
1168{ 1175{
1169 uint64_t flags = parse_flag_names(optarg, 0); 1176 uint64_t flags = parse_flag_names(optarg, 0);
@@ -1188,6 +1195,7 @@ static const struct option opts[] = {
1188 { "no-summary", 0, NULL, 'N' }, 1195 { "no-summary", 0, NULL, 'N' },
1189 { "hwpoison" , 0, NULL, 'X' }, 1196 { "hwpoison" , 0, NULL, 'X' },
1190 { "unpoison" , 0, NULL, 'x' }, 1197 { "unpoison" , 0, NULL, 'x' },
1198 { "kpageflags", 0, NULL, 'F' },
1191 { "help" , 0, NULL, 'h' }, 1199 { "help" , 0, NULL, 'h' },
1192 { NULL , 0, NULL, 0 } 1200 { NULL , 0, NULL, 0 }
1193}; 1201};
@@ -1199,7 +1207,7 @@ int main(int argc, char *argv[])
1199 page_size = getpagesize(); 1207 page_size = getpagesize();
1200 1208
1201 while ((c = getopt_long(argc, argv, 1209 while ((c = getopt_long(argc, argv,
1202 "rp:f:a:b:d:c:ClLNXxh", opts, NULL)) != -1) { 1210 "rp:f:a:b:d:c:ClLNXxF:h", opts, NULL)) != -1) {
1203 switch (c) { 1211 switch (c) {
1204 case 'r': 1212 case 'r':
1205 opt_raw = 1; 1213 opt_raw = 1;
@@ -1242,6 +1250,9 @@ int main(int argc, char *argv[])
1242 opt_unpoison = 1; 1250 opt_unpoison = 1;
1243 prepare_hwpoison_fd(); 1251 prepare_hwpoison_fd();
1244 break; 1252 break;
1253 case 'F':
1254 parse_kpageflags(optarg);
1255 break;
1245 case 'h': 1256 case 'h':
1246 usage(); 1257 usage();
1247 exit(0); 1258 exit(0);
@@ -1251,6 +1262,9 @@ int main(int argc, char *argv[])
1251 } 1262 }
1252 } 1263 }
1253 1264
1265 if (!opt_kpageflags)
1266 opt_kpageflags = PROC_KPAGEFLAGS;
1267
1254 if (opt_cgroup || opt_list_cgroup) 1268 if (opt_cgroup || opt_list_cgroup)
1255 kpagecgroup_fd = checked_open(PROC_KPAGECGROUP, O_RDONLY); 1269 kpagecgroup_fd = checked_open(PROC_KPAGECGROUP, O_RDONLY);
1256 1270