mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'perf-tools-for-v6.16-1-2025-06-03' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf tools updates from Arnaldo Carvalho de Melo:
"perf report/top/annotate TUI:
- Accept the left arrow key as a Zoom out if done on the first column
- Show if source code toggle status in title, to help spotting bugs
with the various disassemblers (capstone, llvm, objdump)
- Provide feedback on unhandled hotkeys
Build:
- Better inform when certain features are not available with warnings
in the build process and in 'perf version --build-options' or 'perf -vv'
perf record:
- Improve the --off-cpu code by synthesizing events for switch-out ->
switch-in intervals using a BPF program. This can be fine tuned
using a --off-cpu-thresh knob
perf report:
- Add 'tgid' sort key
perf mem/c2c:
- Add 'op', 'cache', 'snoop', 'dtlb' output fields
- Add support for 'ldlat' on AMD IBS (Instruction Based Sampling)
perf ftrace:
- Use process/session specific trace settings instead of messing with
the global ftrace knobs
perf trace:
- Implement syscall summary in BPF
- Support --summary-mode=cgroup
- Always print return value for syscalls returning a pid
- The rseq and set_robust_list don't return a pid, just -errno
perf lock contention:
- Symbolize zone->lock using BTF
- Add -J/--inject-delay option to estimate impact on application
performance by optimization of kernel locking behavior
perf stat:
- Improve hybrid support for the NMI watchdog warning
Symbol resolution:
- Handle 'u' and 'l' symbols in /proc/kallsyms, resolving some Rust
symbols
- Improve Rust demangler
Hardware tracing:
Intel PT:
- Fix PEBS-via-PT data_src
- Do not default to recording all switch events
- Fix pattern matching with python3 on the SQL viewer script
arm64:
- Fixups for the hip08 hha PMU
Vendor events:
- Update Intel events/metrics files for alderlake, alderlaken,
arrowlake, bonnell, broadwell, broadwellde, broadwellx,
cascadelakex, clearwaterforest, elkhartlake, emeraldrapids,
grandridge, graniterapids, haswell, haswellx, icelake, icelakex,
ivybridge, ivytown, jaketown, lunarlake, meteorlake, nehalemep,
nehalemex, rocketlake, sandybridge, sapphirerapids, sierraforest,
skylake, skylakex, snowridgex, tigerlake, westmereep-dp,
westmereep-sp, westmereep-sx
python support:
- Add support for event counts in the python binding, add a
counting.py example
perf list:
- Display the PMU name associated with a perf metric in JSON
perf test:
- Hybrid improvements for metric value validation test
- Fix LBR test by ignoring idle task
- Add AMD IBS sw filter ana d'ldlat' tests
- Add 'perf trace --summary-mode=cgroup' test
- Add tests for the various language symbol demanglers
Miscellaneous:
- Allow specifying the cpu an event will be tied using '-e
event/cpu=N/'
- Sync various headers with the kernel sources
- Add annotations to use clang's -Wthread-safety and fix some
problems it detected
- Make dump_stack() use perf's symbol resolution to provide better
backtraces
- Intel TPEBS support cleanups and fixes. TPEBS stands for Timed PEBS
(Precision Event-Based Sampling), that adds timing info, the
retirement latency of instructions
- Various memory allocation (some detected by ASAN) and reference
counting fixes
- Add a 8-byte aligned PERF_RECORD_COMPRESSED2 to replace
PERF_RECORD_COMPRESSED
- Skip unsupported event types in perf.data files, don't stop when
finding one
- Improve lookups using hashmaps and binary searches"
* tag 'perf-tools-for-v6.16-1-2025-06-03' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: (206 commits)
perf callchain: Always populate the addr_location map when adding IP
perf lock contention: Reject more than 10ms delays for safety
perf trace: Set errpid to false for rseq and set_robust_list
perf symbol: Move demangling code out of symbol-elf.c
perf trace: Always print return value for syscalls returning a pid
perf script: Print PERF_AUX_FLAG_COLLISION flag
perf mem: Show absolute percent in mem_stat output
perf mem: Display sort order only if it's available
perf mem: Describe overhead calculation in brief
perf record: Fix incorrect --user-regs comments
Revert "perf thread: Ensure comm_lock held for comm_list"
perf test trace_summary: Skip --bpf-summary tests if no libbpf
perf test intel-pt: Skip jitdump test if no libelf
perf intel-tpebs: Avoid race when evlist is being deleted
perf test demangle-java: Don't segv if demangling fails
perf symbol: Fix use-after-free in filename__read_build_id
perf pmu: Avoid segv for missing name/alias_name in wildcarding
perf machine: Factor creating a "live" machine out of dwarf-unwind
perf test: Add AMD IBS sw filter test
perf mem: Count L2 HITM for c2c statistic
...
This commit is contained in:
@@ -10860,6 +10860,7 @@ W: http://www.hisilicon.com
|
||||
F: Documentation/admin-guide/perf/hisi-pcie-pmu.rst
|
||||
F: Documentation/admin-guide/perf/hisi-pmu.rst
|
||||
F: drivers/perf/hisilicon
|
||||
F: tools/perf/pmu-events/arch/arm64/hisilicon/
|
||||
|
||||
HISILICON PTT DRIVER
|
||||
M: Yicong Yang <yangyicong@hisilicon.com>
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
#define FUJITSU_CPU_PART_A64FX 0x001
|
||||
|
||||
#define HISI_CPU_PART_TSV110 0xD01
|
||||
#define HISI_CPU_PART_HIP12 0xD06
|
||||
|
||||
#define APPLE_CPU_PART_M1_ICESTORM 0x022
|
||||
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
|
||||
@@ -202,6 +203,7 @@
|
||||
#define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL)
|
||||
#define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX)
|
||||
#define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
|
||||
#define MIDR_HISI_HIP12 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP12)
|
||||
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
|
||||
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
|
||||
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
#define X86_FEATURE_CENTAUR_MCR ( 3*32+ 3) /* "centaur_mcr" Centaur MCRs (= MTRRs) */
|
||||
#define X86_FEATURE_K8 ( 3*32+ 4) /* Opteron, Athlon64 */
|
||||
#define X86_FEATURE_ZEN5 ( 3*32+ 5) /* CPU based on Zen5 microarchitecture */
|
||||
/* Free ( 3*32+ 6) */
|
||||
#define X86_FEATURE_ZEN6 ( 3*32+ 6) /* CPU based on Zen6 microarchitecture */
|
||||
/* Free ( 3*32+ 7) */
|
||||
#define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* "constant_tsc" TSC ticks at a constant rate */
|
||||
#define X86_FEATURE_UP ( 3*32+ 9) /* "up" SMP kernel running on UP */
|
||||
@@ -482,6 +482,7 @@
|
||||
#define X86_FEATURE_AMD_HTR_CORES (21*32+ 6) /* Heterogeneous Core Topology */
|
||||
#define X86_FEATURE_AMD_WORKLOAD_CLASS (21*32+ 7) /* Workload Classification */
|
||||
#define X86_FEATURE_PREFER_YMM (21*32+ 8) /* Avoid ZMM registers due to downclocking */
|
||||
#define X86_FEATURE_INDIRECT_THUNK_ITS (21*32+ 9) /* Use thunk for indirect branches in lower half of cacheline */
|
||||
|
||||
/*
|
||||
* BUG word(s)
|
||||
@@ -534,4 +535,6 @@
|
||||
#define X86_BUG_BHI X86_BUG( 1*32+ 3) /* "bhi" CPU is affected by Branch History Injection */
|
||||
#define X86_BUG_IBPB_NO_RET X86_BUG( 1*32+ 4) /* "ibpb_no_ret" IBPB omits return target predictions */
|
||||
#define X86_BUG_SPECTRE_V2_USER X86_BUG( 1*32+ 5) /* "spectre_v2_user" CPU is affected by Spectre variant 2 attack between user processes */
|
||||
#define X86_BUG_ITS X86_BUG( 1*32+ 6) /* "its" CPU is affected by Indirect Target Selection */
|
||||
#define X86_BUG_ITS_NATIVE_ONLY X86_BUG( 1*32+ 7) /* "its_native_only" CPU is affected by ITS, VMX is not affected */
|
||||
#endif /* _ASM_X86_CPUFEATURES_H */
|
||||
|
||||
@@ -211,6 +211,14 @@
|
||||
* VERW clears CPU Register
|
||||
* File.
|
||||
*/
|
||||
#define ARCH_CAP_ITS_NO BIT_ULL(62) /*
|
||||
* Not susceptible to
|
||||
* Indirect Target Selection.
|
||||
* This bit is not set by
|
||||
* HW, but is synthesized by
|
||||
* VMMs for guests to know
|
||||
* their affected status.
|
||||
*/
|
||||
|
||||
#define MSR_IA32_FLUSH_CMD 0x0000010b
|
||||
#define L1D_FLUSH BIT(0) /*
|
||||
|
||||
@@ -87,7 +87,6 @@ FEATURE_TESTS_BASIC := \
|
||||
libtracefs \
|
||||
libcpupower \
|
||||
libcrypto \
|
||||
libunwind \
|
||||
pthread-attr-setaffinity-np \
|
||||
pthread-barrier \
|
||||
reallocarray \
|
||||
@@ -148,15 +147,12 @@ endif
|
||||
FEATURE_DISPLAY ?= \
|
||||
libdw \
|
||||
glibc \
|
||||
libbfd \
|
||||
libbfd-buildid \
|
||||
libelf \
|
||||
libnuma \
|
||||
numa_num_possible_cpus \
|
||||
libperl \
|
||||
libpython \
|
||||
libcrypto \
|
||||
libunwind \
|
||||
libcapstone \
|
||||
llvm-perf \
|
||||
zlib \
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
*/
|
||||
#if !defined(__ASSEMBLY__)
|
||||
#include <linux/build_bug.h>
|
||||
#define GENMASK_INPUT_CHECK(h, l) \
|
||||
(BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
|
||||
__is_constexpr((l) > (h)), (l) > (h), 0)))
|
||||
#include <linux/compiler.h>
|
||||
#define GENMASK_INPUT_CHECK(h, l) BUILD_BUG_ON_ZERO(const_true((l) > (h)))
|
||||
#else
|
||||
/*
|
||||
* BUILD_BUG_ON_ZERO is not available in h files included from asm files,
|
||||
|
||||
@@ -81,6 +81,28 @@
|
||||
#define __is_constexpr(x) \
|
||||
(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
|
||||
|
||||
/*
|
||||
* Similar to statically_true() but produces a constant expression
|
||||
*
|
||||
* To be used in conjunction with macros, such as BUILD_BUG_ON_ZERO(),
|
||||
* which require their input to be a constant expression and for which
|
||||
* statically_true() would otherwise fail.
|
||||
*
|
||||
* This is a trade-off: const_true() requires all its operands to be
|
||||
* compile time constants. Else, it would always returns false even on
|
||||
* the most trivial cases like:
|
||||
*
|
||||
* true || non_const_var
|
||||
*
|
||||
* On the opposite, statically_true() is able to fold more complex
|
||||
* tautologies and will return true on expressions such as:
|
||||
*
|
||||
* !(non_const_var * 8 % 4)
|
||||
*
|
||||
* For the general case, statically_true() is better.
|
||||
*/
|
||||
#define const_true(x) __builtin_choose_expr(__is_constexpr(x), x, false)
|
||||
|
||||
#ifdef __ANDROID__
|
||||
/*
|
||||
* FIXME: Big hammer to get rid of tons of:
|
||||
|
||||
@@ -4,13 +4,9 @@
|
||||
#ifndef _UAPI_LINUX_BITS_H
|
||||
#define _UAPI_LINUX_BITS_H
|
||||
|
||||
#define __GENMASK(h, l) \
|
||||
(((~_UL(0)) - (_UL(1) << (l)) + 1) & \
|
||||
(~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
|
||||
#define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (BITS_PER_LONG - 1 - (h))))
|
||||
|
||||
#define __GENMASK_ULL(h, l) \
|
||||
(((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
|
||||
(~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
|
||||
#define __GENMASK_ULL(h, l) (((~_ULL(0)) << (l)) & (~_ULL(0) >> (BITS_PER_LONG_LONG - 1 - (h))))
|
||||
|
||||
#define __GENMASK_U128(h, l) \
|
||||
((_BIT128((h)) << 1) - (_BIT128(l)))
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
#ifndef __VDSO_UNALIGNED_H
|
||||
#define __VDSO_UNALIGNED_H
|
||||
|
||||
#define __get_unaligned_t(type, ptr) ({ \
|
||||
const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
|
||||
__pptr->x; \
|
||||
#define __get_unaligned_t(type, ptr) ({ \
|
||||
const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr); \
|
||||
__get_pptr->x; \
|
||||
})
|
||||
|
||||
#define __put_unaligned_t(type, val, ptr) do { \
|
||||
struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
|
||||
__pptr->x = (val); \
|
||||
#define __put_unaligned_t(type, val, ptr) do { \
|
||||
struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr); \
|
||||
__put_pptr->x = (val); \
|
||||
} while (0)
|
||||
|
||||
#endif /* __VDSO_UNALIGNED_H */
|
||||
|
||||
@@ -210,6 +210,7 @@ SYNOPSIS
|
||||
struct perf_record_time_conv;
|
||||
struct perf_record_header_feature;
|
||||
struct perf_record_compressed;
|
||||
struct perf_record_compressed2;
|
||||
--
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
@@ -242,6 +242,16 @@ out:
|
||||
return cpus;
|
||||
}
|
||||
|
||||
struct perf_cpu_map *perf_cpu_map__new_int(int cpu)
|
||||
{
|
||||
struct perf_cpu_map *cpus = perf_cpu_map__alloc(1);
|
||||
|
||||
if (cpus)
|
||||
RC_CHK_ACCESS(cpus)->map[0].cpu = cpu;
|
||||
|
||||
return cpus;
|
||||
}
|
||||
|
||||
static int __perf_cpu_map__nr(const struct perf_cpu_map *cpus)
|
||||
{
|
||||
return RC_CHK_ACCESS(cpus)->nr;
|
||||
|
||||
@@ -37,6 +37,8 @@ LIBPERF_API struct perf_cpu_map *perf_cpu_map__new_online_cpus(void);
|
||||
* perf_cpu_map__new_online_cpus is returned.
|
||||
*/
|
||||
LIBPERF_API struct perf_cpu_map *perf_cpu_map__new(const char *cpu_list);
|
||||
/** perf_cpu_map__new_int - create a map with the one given cpu. */
|
||||
LIBPERF_API struct perf_cpu_map *perf_cpu_map__new_int(int cpu);
|
||||
LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
|
||||
LIBPERF_API int perf_cpu_map__merge(struct perf_cpu_map **orig,
|
||||
struct perf_cpu_map *other);
|
||||
|
||||
@@ -457,6 +457,16 @@ struct perf_record_compressed {
|
||||
char data[];
|
||||
};
|
||||
|
||||
/*
|
||||
* `header.size` includes the padding we are going to add while writing the record.
|
||||
* `data_size` only includes the size of `data[]` itself.
|
||||
*/
|
||||
struct perf_record_compressed2 {
|
||||
struct perf_event_header header;
|
||||
__u64 data_size;
|
||||
char data[];
|
||||
};
|
||||
|
||||
enum perf_user_event_type { /* above any possible kernel type */
|
||||
PERF_RECORD_USER_TYPE_START = 64,
|
||||
PERF_RECORD_HEADER_ATTR = 64,
|
||||
@@ -478,6 +488,7 @@ enum perf_user_event_type { /* above any possible kernel type */
|
||||
PERF_RECORD_HEADER_FEATURE = 80,
|
||||
PERF_RECORD_COMPRESSED = 81,
|
||||
PERF_RECORD_FINISHED_INIT = 82,
|
||||
PERF_RECORD_COMPRESSED2 = 83,
|
||||
PERF_RECORD_HEADER_MAX
|
||||
};
|
||||
|
||||
@@ -518,6 +529,7 @@ union perf_event {
|
||||
struct perf_record_time_conv time_conv;
|
||||
struct perf_record_header_feature feat;
|
||||
struct perf_record_compressed pack;
|
||||
struct perf_record_compressed2 pack2;
|
||||
};
|
||||
|
||||
#endif /* __LIBPERF_EVENT_H */
|
||||
|
||||
@@ -14,6 +14,7 @@ LIBPERF_API void perf_thread_map__set_pid(struct perf_thread_map *map, int idx,
|
||||
LIBPERF_API char *perf_thread_map__comm(struct perf_thread_map *map, int idx);
|
||||
LIBPERF_API int perf_thread_map__nr(struct perf_thread_map *threads);
|
||||
LIBPERF_API pid_t perf_thread_map__pid(struct perf_thread_map *map, int idx);
|
||||
LIBPERF_API int perf_thread_map__idx(struct perf_thread_map *map, pid_t pid);
|
||||
|
||||
LIBPERF_API struct perf_thread_map *perf_thread_map__get(struct perf_thread_map *map);
|
||||
LIBPERF_API void perf_thread_map__put(struct perf_thread_map *map);
|
||||
|
||||
@@ -97,5 +97,22 @@ int perf_thread_map__nr(struct perf_thread_map *threads)
|
||||
|
||||
pid_t perf_thread_map__pid(struct perf_thread_map *map, int idx)
|
||||
{
|
||||
if (!map) {
|
||||
assert(idx == 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return map->map[idx].pid;
|
||||
}
|
||||
|
||||
int perf_thread_map__idx(struct perf_thread_map *threads, pid_t pid)
|
||||
{
|
||||
if (!threads)
|
||||
return pid == -1 ? 0 : -1;
|
||||
|
||||
for (int i = 0; i < threads->nr; ++i) {
|
||||
if (threads->map[i].pid == pid)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -85,6 +85,15 @@ System-wide profile, uOps event, sampling period: 100000, L3MissOnly (Zen4 onwar
|
||||
|
||||
# perf record -e ibs_op/cnt_ctl=1,l3missonly=1/ -c 100000 -a
|
||||
|
||||
System-wide profile, cycles event, sampling period: 100000, LdLat filtering (Zen5
|
||||
onward)
|
||||
|
||||
# perf record -e ibs_op/ldlat=128/ -c 100000 -a
|
||||
|
||||
Supported load latency threshold values are 128 to 2048 (both inclusive).
|
||||
Latency value which is a multiple of 128 incurs a little less profiling
|
||||
overhead compared to other values.
|
||||
|
||||
Per process(upstream v6.2 onward), uOps event, sampling period: 100000
|
||||
|
||||
# perf record -e ibs_op/cnt_ctl=1/ -c 100000 -p 1234
|
||||
|
||||
@@ -54,8 +54,15 @@ RECORD OPTIONS
|
||||
|
||||
-l::
|
||||
--ldlat::
|
||||
Configure mem-loads latency. Supported on Intel and Arm64 processors
|
||||
only. Ignored on other archs.
|
||||
Configure mem-loads latency. Supported on Intel, Arm64 and some AMD
|
||||
processors. Ignored on other archs.
|
||||
|
||||
On supported AMD processors:
|
||||
- /sys/bus/event_source/devices/ibs_op/caps/ldlat file contains '1'.
|
||||
- Supported latency values are 128 to 2048 (both inclusive).
|
||||
- Latency value which is a multiple of 128 incurs a little less profiling
|
||||
overhead compared to other values.
|
||||
- Load latency filtering is disabled by default.
|
||||
|
||||
-k::
|
||||
--all-kernel::
|
||||
|
||||
@@ -708,6 +708,10 @@ intel-pt.*::
|
||||
the maximum is exceeded there will be a "Never-ending loop"
|
||||
error. The default is 100000.
|
||||
|
||||
intel-pt.all-switch-events::
|
||||
If the user has permission to do so, always record all context
|
||||
switch events on all CPUs.
|
||||
|
||||
auxtrace.*::
|
||||
|
||||
auxtrace.dumpdir::
|
||||
|
||||
@@ -289,6 +289,15 @@ Sums up the event counts for all hardware threads in a core, e.g.:
|
||||
|
||||
perf stat -e cpu/event=0,umask=0x3,percore=1/
|
||||
|
||||
cpu:
|
||||
|
||||
Specifies the CPU to open the event upon. The value may be repeated to
|
||||
specify opening the event on multiple CPUs:
|
||||
|
||||
|
||||
perf stat -e instructions/cpu=0,cpu=2/,cycles/cpu=1,cpu=2/ -a sleep 1
|
||||
perf stat -e data_read/cpu=0/,data_write/cpu=1/ -a sleep 1
|
||||
|
||||
|
||||
EVENT GROUPS
|
||||
------------
|
||||
|
||||
@@ -216,6 +216,21 @@ CONTENTION OPTIONS
|
||||
--cgroup-filter=<value>::
|
||||
Show lock contention only in the given cgroups (comma separated list).
|
||||
|
||||
-J::
|
||||
--inject-delay=<time@function>::
|
||||
Add delays to the given lock. It's added to the contention-end part so
|
||||
that the (new) owner of the lock will be delayed. But by slowing down
|
||||
the owner, the waiters will also be delayed as well. This is working
|
||||
only with -b/--use-bpf.
|
||||
|
||||
The 'time' is specified in nsec but it can have a unit suffix. Available
|
||||
units are "ms", "us" and "ns". Currently it accepts up to 10ms of delays
|
||||
for safety reasons.
|
||||
|
||||
Note that it will busy-wait after it gets the lock. Delaying locks can
|
||||
have significant consequences including potential kernel crashes. Please
|
||||
use it at your own risk.
|
||||
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user