summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpftool/Makefile6
-rw-r--r--tools/build/feature/Makefile14
-rw-r--r--tools/build/feature/test-libcrypto.c21
-rw-r--r--tools/include/uapi/linux/perf_event.h2
-rw-r--r--tools/perf/Documentation/guest-files.txt16
-rw-r--r--tools/perf/Documentation/guestmount.txt11
-rw-r--r--tools/perf/Documentation/perf-c2c.txt31
-rw-r--r--tools/perf/Documentation/perf-inject.txt4
-rw-r--r--tools/perf/Documentation/perf-kvm.txt25
-rw-r--r--tools/perf/Documentation/perf-script.txt8
-rw-r--r--tools/perf/Documentation/perf-stat.txt21
-rw-r--r--tools/perf/Makefile.config13
-rw-r--r--tools/perf/Makefile.perf3
-rw-r--r--tools/perf/arch/arm/util/cs-etm.c2
-rw-r--r--tools/perf/arch/arm64/util/arm-spe.c2
-rw-r--r--tools/perf/arch/arm64/util/pmu.c4
-rw-r--r--tools/perf/arch/x86/tests/intel-cqm.c2
-rw-r--r--tools/perf/arch/x86/util/intel-bts.c2
-rw-r--r--tools/perf/arch/x86/util/intel-pt.c2
-rw-r--r--tools/perf/arch/x86/util/iostat.c2
-rw-r--r--tools/perf/arch/x86/util/topdown.c2
-rw-r--r--tools/perf/builtin-c2c.c454
-rw-r--r--tools/perf/builtin-kvm.c8
-rw-r--r--tools/perf/builtin-record.c11
-rw-r--r--tools/perf/builtin-sched.c2
-rw-r--r--tools/perf/builtin-script.c2
-rw-r--r--tools/perf/builtin-stat.c7
-rw-r--r--tools/perf/builtin-trace.c2
-rw-r--r--tools/perf/pmu-events/Build6
-rw-r--r--tools/perf/pmu-events/arch/s390/cf_z16/pai.json1101
-rw-r--r--tools/perf/pmu-events/arch/test/test_soc/cpu/metrics.json64
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/bdwde-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json97
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/uncore-other.json13
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/bdx-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json163
-rw-r--r--tools/perf/pmu-events/arch/x86/cascadelakex/clx-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/cascadelakex/uncore-memory.json4400
-rw-r--r--tools/perf/pmu-events/arch/x86/cascadelakex/uncore-other.json22482
-rw-r--r--tools/perf/pmu-events/arch/x86/cascadelakex/uncore-power.json201
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/hsx-metrics.json411
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json173
-rw-r--r--tools/perf/pmu-events/arch/x86/icelakex/icx-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/icelakex/uncore-memory.json1523
-rw-r--r--tools/perf/pmu-events/arch/x86/icelakex/uncore-other.json37134
-rw-r--r--tools/perf/pmu-events/arch/x86/icelakex/uncore-power.json225
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/ivt-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json90
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json1
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-other.json13
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json19
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/jkt-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json30
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-other.json13
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json11
-rw-r--r--tools/perf/pmu-events/arch/x86/knightslanding/uncore-other.json213
-rw-r--r--tools/perf/pmu-events/arch/x86/sapphirerapids/spr-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json6
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/uncore-memory.json3562
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/uncore-other.json22306
-rw-r--r--tools/perf/pmu-events/arch/x86/skylakex/uncore-power.json201
-rw-r--r--tools/perf/pmu-events/arch/x86/snowridgex/uncore-other.json111
-rw-r--r--tools/perf/pmu-events/empty-pmu-events.c204
-rwxr-xr-xtools/perf/pmu-events/jevents.py496
-rw-r--r--tools/perf/pmu-events/pmu-events.h40
-rw-r--r--tools/perf/tests/Build1
-rw-r--r--tools/perf/tests/builtin-test-list.c207
-rw-r--r--tools/perf/tests/builtin-test-list.h12
-rw-r--r--tools/perf/tests/builtin-test.c152
-rw-r--r--tools/perf/tests/code-reading.c2
-rw-r--r--tools/perf/tests/event-times.c2
-rw-r--r--tools/perf/tests/evsel-roundtrip-name.c4
-rw-r--r--tools/perf/tests/expand-cgroup.c25
-rw-r--r--tools/perf/tests/hists_cumulate.c2
-rw-r--r--tools/perf/tests/hists_filter.c4
-rw-r--r--tools/perf/tests/hists_link.c4
-rw-r--r--tools/perf/tests/hists_output.c2
-rw-r--r--tools/perf/tests/keep-tracking.c4
-rw-r--r--tools/perf/tests/parse-metric.c77
-rw-r--r--tools/perf/tests/perf-time-to-tsc.c4
-rw-r--r--tools/perf/tests/pmu-events.c466
-rw-r--r--tools/perf/tests/shell/lib/perf_json_output_lint.py96
-rwxr-xr-xtools/perf/tests/shell/record_offcpu.sh57
-rwxr-xr-xtools/perf/tests/shell/stat+json_output.sh147
-rw-r--r--tools/perf/tests/switch-tracking.c24
-rw-r--r--tools/perf/util/Build1
-rw-r--r--tools/perf/util/arm-spe-decoder/arm-spe-decoder.c1
-rw-r--r--tools/perf/util/arm-spe-decoder/arm-spe-decoder.h12
-rw-r--r--tools/perf/util/arm-spe.c130
-rw-r--r--tools/perf/util/bpf-loader.c2
-rw-r--r--tools/perf/util/bpf_off_cpu.c53
-rw-r--r--tools/perf/util/bpf_skel/off_cpu.bpf.c38
-rw-r--r--tools/perf/util/build-id.c26
-rw-r--r--tools/perf/util/events_stats.h2
-rw-r--r--tools/perf/util/jitdump.c9
-rw-r--r--tools/perf/util/machine.c1
-rw-r--r--tools/perf/util/mem-events.c46
-rw-r--r--tools/perf/util/mem-events.h3
-rw-r--r--tools/perf/util/metricgroup.c275
-rw-r--r--tools/perf/util/metricgroup.h5
-rw-r--r--tools/perf/util/parse-events.c22
-rw-r--r--tools/perf/util/parse-events.h4
-rw-r--r--tools/perf/util/perf_api_probe.c2
-rw-r--r--tools/perf/util/pmu.c139
-rw-r--r--tools/perf/util/pmu.h10
-rw-r--r--tools/perf/util/probe-event.c6
-rw-r--r--tools/perf/util/record.c2
-rw-r--r--tools/perf/util/s390-sample-raw.c50
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c2
-rw-r--r--tools/perf/util/stat-display.c383
-rw-r--r--tools/perf/util/stat.c1
-rw-r--r--tools/perf/util/stat.h2
112 files changed, 93678 insertions, 4871 deletions
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 04d733e98bff..4a95c017ad4c 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -93,9 +93,11 @@ INSTALL ?= install
RM ?= rm -f
FEATURE_USER = .bpftool
-FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled libcap \
+FEATURE_TESTS = libbfd libbfd-liberty libbfd-liberty-z \
+ disassembler-four-args disassembler-init-styled libcap \
clang-bpf-co-re
-FEATURE_DISPLAY = libbfd libcap clang-bpf-co-re
+FEATURE_DISPLAY = libbfd libbfd-liberty libbfd-liberty-z \
+ libcap clang-bpf-co-re
check_feat := 1
NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index c3059739318a..04b07ff88234 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -90,6 +90,8 @@ all: $(FILES)
__BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
+ BUILD_BFD = $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
+ BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap
__BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
@@ -97,7 +99,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
###############################
$(OUTPUT)test-all.bin:
- $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap
+ $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty
$(OUTPUT)test-hello.bin:
$(BUILD)
@@ -241,16 +243,18 @@ $(OUTPUT)test-libpython.bin:
$(BUILD) $(FLAGS_PYTHON_EMBED)
$(OUTPUT)test-libbfd.bin:
- $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
+ $(BUILD_BFD)
$(OUTPUT)test-libbfd-buildid.bin:
- $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
+ $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz
$(OUTPUT)test-disassembler-four-args.bin:
- $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \
+ $(BUILD_BFD) -lopcodes -liberty -lz
$(OUTPUT)test-disassembler-init-styled.bin:
- $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \
+ $(BUILD_BFD) -lopcodes -liberty -lz
$(OUTPUT)test-reallocarray.bin:
$(BUILD)
diff --git a/tools/build/feature/test-libcrypto.c b/tools/build/feature/test-libcrypto.c
index 31afff093d0b..bc34a5bbb504 100644
--- a/tools/build/feature/test-libcrypto.c
+++ b/tools/build/feature/test-libcrypto.c
@@ -1,22 +1,23 @@
// SPDX-License-Identifier: GPL-2.0
+#include <openssl/evp.h>
#include <openssl/sha.h>
#include <openssl/md5.h>
-/*
- * The MD5_* API have been deprecated since OpenSSL 3.0, which causes the
- * feature test to fail silently. This is a workaround.
- */
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
int main(void)
{
- MD5_CTX context;
+ EVP_MD_CTX *mdctx;
unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH];
unsigned char dat[] = "12345";
+ unsigned int digest_len;
+
+ mdctx = EVP_MD_CTX_new();
+ if (!mdctx)
+ return 0;
- MD5_Init(&context);
- MD5_Update(&context, &dat[0], sizeof(dat));
- MD5_Final(&md[0], &context);
+ EVP_DigestInit_ex(mdctx, EVP_md5(), NULL);
+ EVP_DigestUpdate(mdctx, &dat[0], sizeof(dat));
+ EVP_DigestFinal_ex(mdctx, &md[0], &digest_len);
+ EVP_MD_CTX_free(mdctx);
SHA1(&dat[0], sizeof(dat), &md[0]);
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index 4653834f078f..e2b77fbca91e 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -1310,7 +1310,7 @@ union perf_mem_data_src {
#define PERF_MEM_SNOOP_SHIFT 19
#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
-/* 1 free */
+#define PERF_MEM_SNOOPX_PEER 0x02 /* xfer from peer */
#define PERF_MEM_SNOOPX_SHIFT 38
/* locked instruction */
diff --git a/tools/perf/Documentation/guest-files.txt b/tools/perf/Documentation/guest-files.txt
new file mode 100644
index 000000000000..8cc0b092f996
--- /dev/null
+++ b/tools/perf/Documentation/guest-files.txt
@@ -0,0 +1,16 @@
+include::guestmount.txt[]
+
+--guestkallsyms=<path>::
+ Guest OS /proc/kallsyms file copy. perf reads it to get guest
+ kernel symbols. Users copy it out from guest OS.
+
+--guestmodules=<path>::
+ Guest OS /proc/modules file copy. perf reads it to get guest
+ kernel module information. Users copy it out from guest OS.
+
+--guestvmlinux=<path>::
+ Guest OS kernel vmlinux.
+
+--guest-code::
+ Indicate that guest code can be found in the hypervisor process,
+ which is a common case for KVM test programs.
diff --git a/tools/perf/Documentation/guestmount.txt b/tools/perf/Documentation/guestmount.txt
new file mode 100644
index 000000000000..6edf12363add
--- /dev/null
+++ b/tools/perf/Documentation/guestmount.txt
@@ -0,0 +1,11 @@
+--guestmount=<path>::
+ Guest OS root file system mount directory. Users mount guest OS
+ root directories under <path> by a specific filesystem access method,
+ typically, sshfs.
+ For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
+[verse]
+ $ mkdir \~/guestmount
+ $ cd \~/guestmount
+ $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
+ $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
+ $ perf {GMEXAMPLECMD} --guestmount=~/guestmount {GMEXAMPLESUBCMD}
diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
index 6f69173731aa..f1f7ae6b08d1 100644
--- a/tools/perf/Documentation/perf-c2c.txt
+++ b/