summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-07-29 17:24:07 -0400
committerIngo Molnar <mingo@kernel.org>2019-07-29 17:24:07 -0400
commitb3c303be4c35856945cb17ec639b94637447dae2 (patch)
tree93c033dee9842938db5037e84086a03c0972b7a4 /tools
parent2a11c76e5301dddefcb618dac04f74e6314df6bc (diff)
parent8aa259b10a6a759c50137bbbf225df0c17ca5d27 (diff)
Merge tag 'perf-urgent-for-mingo-5.3-20190729' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: perf header: Vince Weaver: - Fix divide by zero error if f_header.attr_size==0, found using a perf tool fuzzer. Numfor Mbiziwo-Tiapo: - Silence use of uninitialized value warning pointed out by clang's MSAN tool. libbpf: Andrii Nakryiko: - Fix missing __WORDSIZE definition in some systems, such as musl libc (Alpine Linux). tools header UAPI: Arnaldo Carvalho de Melo: - Sync headers to address perf build warnings: - syscalls_64.tbl and generic unistd.h to pick up clone3 and pidfd_open. - With new ioctls: kvm.h, drm.h and usbdevice_fs.h. - No tooling change: mman.h, sched.h and if_link.h. Documentation: Vince Weaver: - Fix perf.data documentation units for memory size, its kB, not bytes. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/arch/arm/include/uapi/asm/kvm.h12
-rw-r--r--tools/arch/arm64/include/uapi/asm/kvm.h10
-rw-r--r--tools/arch/powerpc/include/uapi/asm/mman.h4
-rw-r--r--tools/arch/sparc/include/uapi/asm/mman.h4
-rw-r--r--tools/arch/x86/include/uapi/asm/kvm.h22
-rw-r--r--tools/arch/x86/include/uapi/asm/vmx.h1
-rw-r--r--tools/include/uapi/asm-generic/mman-common.h15
-rw-r--r--tools/include/uapi/asm-generic/mman.h10
-rw-r--r--tools/include/uapi/asm-generic/unistd.h8
-rw-r--r--tools/include/uapi/drm/drm.h1
-rw-r--r--tools/include/uapi/drm/i915_drm.h209
-rw-r--r--tools/include/uapi/linux/if_link.h5
-rw-r--r--tools/include/uapi/linux/kvm.h3
-rw-r--r--tools/include/uapi/linux/sched.h30
-rw-r--r--tools/include/uapi/linux/usbdevice_fs.h26
-rw-r--r--tools/lib/bpf/hashmap.h5
-rw-r--r--tools/perf/Documentation/perf.data-file-format.txt2
-rw-r--r--tools/perf/arch/x86/entry/syscalls/syscall_64.tbl2
-rwxr-xr-xtools/perf/trace/beauty/usbdevfs_ioctl.sh9
-rw-r--r--tools/perf/util/header.c9
20 files changed, 352 insertions, 35 deletions
diff --git a/tools/arch/arm/include/uapi/asm/kvm.h b/tools/arch/arm/include/uapi/asm/kvm.h
index 4602464ebdfb..a4217c1a5d01 100644
--- a/tools/arch/arm/include/uapi/asm/kvm.h
+++ b/tools/arch/arm/include/uapi/asm/kvm.h
@@ -214,6 +214,18 @@ struct kvm_vcpu_events {
214#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \ 214#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \
215 KVM_REG_ARM_FW | ((r) & 0xffff)) 215 KVM_REG_ARM_FW | ((r) & 0xffff))
216#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0) 216#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
217#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1 KVM_REG_ARM_FW_REG(1)
218 /* Higher values mean better protection. */
219#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL 0
220#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL 1
221#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED 2
222#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 KVM_REG_ARM_FW_REG(2)
223 /* Higher values mean better protection. */
224#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL 0
225#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN 1
226#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_AVAIL 2
227#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3
228#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4)
217 229
218/* Device Control API: ARM VGIC */ 230/* Device Control API: ARM VGIC */
219#define KVM_DEV_ARM_VGIC_GRP_ADDR 0 231#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
diff --git a/tools/arch/arm64/include/uapi/asm/kvm.h b/tools/arch/arm64/include/uapi/asm/kvm.h
index d819a3e8b552..9a507716ae2f 100644
--- a/tools/arch/arm64/include/uapi/asm/kvm.h
+++ b/tools/arch/arm64/include/uapi/asm/kvm.h
@@ -229,6 +229,16 @@ struct kvm_vcpu_events {
229#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \ 229#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
230 KVM_REG_ARM_FW | ((r) & 0xffff)) 230 KVM_REG_ARM_FW | ((r) & 0xffff))
231#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0) 231#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
232#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1 KVM_REG_ARM_FW_REG(1)
233#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL 0
234#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL 1
235#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED 2
236#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 KVM_REG_ARM_FW_REG(2)
237#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL 0
238#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN 1
239#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_AVAIL 2
240#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3
241#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4)
232 242
233/* SVE registers */ 243/* SVE registers */
234#define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT) 244#define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT)
diff --git a/tools/arch/powerpc/include/uapi/asm/mman.h b/tools/arch/powerpc/include/uapi/asm/mman.h
index f33105bc5ca6..8601d824a9c6 100644
--- a/tools/arch/powerpc/include/uapi/asm/mman.h
+++ b/tools/arch/powerpc/include/uapi/asm/mman.h
@@ -4,12 +4,8 @@
4#define MAP_DENYWRITE 0x0800 4#define MAP_DENYWRITE 0x0800
5#define MAP_EXECUTABLE 0x1000 5#define MAP_EXECUTABLE 0x1000
6#define MAP_GROWSDOWN 0x0100 6#define MAP_GROWSDOWN 0x0100
7#define MAP_HUGETLB 0x40000
8#define MAP_LOCKED 0x80 7#define MAP_LOCKED 0x80
9#define MAP_NONBLOCK 0x10000
10#define MAP_NORESERVE 0x40 8#define MAP_NORESERVE 0x40
11#define MAP_POPULATE 0x8000
12#define MAP_STACK 0x20000
13#include <uapi/asm-generic/mman-common.h> 9#include <uapi/asm-generic/mman-common.h>
14/* MAP_32BIT is undefined on powerpc, fix it for perf */ 10/* MAP_32BIT is undefined on powerpc, fix it for perf */
15#define MAP_32BIT 0 11#define MAP_32BIT 0
diff --git a/tools/arch/sparc/include/uapi/asm/mman.h b/tools/arch/sparc/include/uapi/asm/mman.h
index 38920eed8cbf..7b94dccc843d 100644
--- a/tools/arch/sparc/include/uapi/asm/mman.h
+++ b/tools/arch/sparc/include/uapi/asm/mman.h
@@ -4,12 +4,8 @@
4#define MAP_DENYWRITE 0x0800 4#define MAP_DENYWRITE 0x0800
5#define MAP_EXECUTABLE 0x1000 5#define MAP_EXECUTABLE 0x1000
6#define MAP_GROWSDOWN 0x0200 6#define MAP_GROWSDOWN 0x0200
7#define MAP_HUGETLB 0x40000
8#define MAP_LOCKED 0x100 7#define MAP_LOCKED 0x100
9#define MAP_NONBLOCK 0x10000
10#define MAP_NORESERVE 0x40 8#define MAP_NORESERVE 0x40
11#define MAP_POPULATE 0x8000
12#define MAP_STACK 0x20000
13#include <uapi/asm-generic/mman-common.h> 9#include <uapi/asm-generic/mman-common.h>
14/* MAP_32BIT is undefined on sparc, fix it for perf */ 10/* MAP_32BIT is undefined on sparc, fix it for perf */
15#define MAP_32BIT 0 11#define MAP_32BIT 0
diff --git a/tools/arch/x86/include/uapi/asm/kvm.h b/tools/arch/x86/include/uapi/asm/kvm.h
index d6ab5b4d15e5..503d3f42da16 100644
--- a/tools/arch/x86/include/uapi/asm/kvm.h
+++ b/tools/arch/x86/include/uapi/asm/kvm.h
@@ -378,10 +378,11 @@ struct kvm_sync_regs {
378 struct kvm_vcpu_events events; 378 struct kvm_vcpu_events events;
379}; 379};
380 380
381#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0) 381#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
382#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1) 382#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
383#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2) 383#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
384#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3) 384#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
385#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
385 386
386#define KVM_STATE_NESTED_FORMAT_VMX 0 387#define KVM_STATE_NESTED_FORMAT_VMX 0
387#define KVM_STATE_NESTED_FORMAT_SVM 1 /* unused */ 388#define KVM_STATE_NESTED_FORMAT_SVM 1 /* unused */
@@ -432,4 +433,17 @@ struct kvm_nested_state {
432 } data; 433 } data;
433}; 434};
434 435
436/* for KVM_CAP_PMU_EVENT_FILTER */
437struct kvm_pmu_event_filter {
438 __u32 action;
439 __u32 nevents;
440 __u32 fixed_counter_bitmap;
441 __u32 flags;
442 __u32 pad[4];
443 __u64 events[0];
444};
445
446#define KVM_PMU_EVENT_ALLOW 0
447#define KVM_PMU_EVENT_DENY 1
448
435#endif /* _ASM_X86_KVM_H */ 449#endif /* _ASM_X86_KVM_H */
diff --git a/tools/arch/x86/include/uapi/asm/vmx.h b/tools/arch/x86/include/uapi/asm/vmx.h
index d213ec5c3766..f0b0c90dd398 100644
--- a/tools/arch/x86/include/uapi/asm/vmx.h
+++ b/tools/arch/x86/include/uapi/asm/vmx.h
@@ -146,7 +146,6 @@
146 146
147#define VMX_ABORT_SAVE_GUEST_MSR_FAIL 1 147#define VMX_ABORT_SAVE_GUEST_MSR_FAIL 1
148#define VMX_ABORT_LOAD_HOST_PDPTE_FAIL 2 148#define VMX_ABORT_LOAD_HOST_PDPTE_FAIL 2
149#define VMX_ABORT_VMCS_CORRUPTED 3
150#define VMX_ABORT_LOAD_HOST_MSR_FAIL 4 149#define VMX_ABORT_LOAD_HOST_MSR_FAIL 4
151 150
152#endif /* _UAPIVMX_H */ 151#endif /* _UAPIVMX_H */
diff --git a/tools/include/uapi/asm-generic/mman-common.h b/tools/include/uapi/asm-generic/mman-common.h
index abd238d0f7a4..63b1f506ea67 100644
--- a/tools/include/uapi/asm-generic/mman-common.h
+++ b/tools/include/uapi/asm-generic/mman-common.h
@@ -19,15 +19,18 @@
19#define MAP_TYPE 0x0f /* Mask for type of mapping */ 19#define MAP_TYPE 0x0f /* Mask for type of mapping */
20#define MAP_FIXED 0x10 /* Interpret addr exactly */ 20#define MAP_FIXED 0x10 /* Interpret addr exactly */
21#define MAP_ANONYMOUS 0x20 /* don't use a file */ 21#define MAP_ANONYMOUS 0x20 /* don't use a file */
22#ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED
23# define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be uninitialized */
24#else
25# define MAP_UNINITIALIZED 0x0 /* Don't support this flag */
26#endif
27 22
28/* 0x0100 - 0x80000 flags are defined in asm-generic/mman.h */ 23/* 0x0100 - 0x4000 flags are defined in asm-generic/mman.h */
24#define MAP_POPULATE 0x008000 /* populate (prefault) pagetables */
25#define MAP_NONBLOCK 0x010000 /* do not block on IO */
26#define MAP_STACK 0x020000 /* give out an address that is best suited for process/thread stacks */
27#define MAP_HUGETLB 0x040000 /* create a huge page mapping */
28#define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */
29#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */ 29#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
30 30
31#define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be
32 * uninitialized */
33
31/* 34/*
32 * Flags for mlock 35 * Flags for mlock
33 */ 36 */
diff --git a/tools/include/uapi/asm-generic/mman.h b/tools/include/uapi/asm-generic/mman.h
index 36c197fc44a0..406f7718f9ad 100644
--- a/tools/include/uapi/asm-generic/mman.h
+++ b/tools/include/uapi/asm-generic/mman.h
@@ -9,13 +9,11 @@
9#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ 9#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
10#define MAP_LOCKED 0x2000 /* pages are locked */ 10#define MAP_LOCKED 0x2000 /* pages are locked */
11#define MAP_NORESERVE 0x4000 /* don't check for reservations */ 11#define MAP_NORESERVE 0x4000 /* don't check for reservations */
12#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
13#define MAP_NONBLOCK 0x10000 /* do not block on IO */
14#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
15#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
16#define MAP_SYNC 0x80000 /* perform synchronous page faults for the mapping */
17 12
18/* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */ 13/*
14 * Bits [26:31] are reserved, see asm-generic/hugetlb_encode.h
15 * for MAP_HUGETLB usage
16 */
19 17
20#define MCL_CURRENT 1 /* lock all current mappings */ 18#define MCL_CURRENT 1 /* lock all current mappings */
21#define MCL_FUTURE 2 /* lock all future mappings */ 19#define MCL_FUTURE 2 /* lock all future mappings */
diff --git a/tools/include/uapi/asm-generic/unistd.h b/tools/include/uapi/asm-generic/unistd.h
index a87904daf103..1be0e798e362 100644
--- a/tools/include/uapi/asm-generic/unistd.h
+++ b/tools/include/uapi/asm-generic/unistd.h
@@ -844,9 +844,15 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig)
844__SYSCALL(__NR_fsmount, sys_fsmount) 844__SYSCALL(__NR_fsmount, sys_fsmount)
845#define __NR_fspick 433 845#define __NR_fspick 433
846__SYSCALL(__NR_fspick, sys_fspick) 846__SYSCALL(__NR_fspick, sys_fspick)
847#define __NR_pidfd_open 434
848__SYSCALL(__NR_pidfd_open, sys_pidfd_open)
849#ifdef __ARCH_WANT_SYS_CLONE3
850#define __NR_clone3 435
851__SYSCALL(__NR_clone3, sys_clone3)
852#endif
847 853
848#undef __NR_syscalls 854#undef __NR_syscalls
849#define __NR_syscalls 434 855#define __NR_syscalls 436
850 856
851/* 857/*
852 * 32 bit systems traditionally used different 858 * 32 bit systems traditionally used different
diff --git a/tools/include/uapi/drm/drm.h b/tools/include/uapi/drm/drm.h
index 661d73f9a919..8a5b2f8f8eb9 100644
--- a/tools/include/uapi/drm/drm.h
+++ b/tools/include/uapi/drm/drm.h
@@ -50,6 +50,7 @@ typedef unsigned int drm_handle_t;
50 50
51#else /* One of the BSDs */ 51#else /* One of the BSDs */
52 52
53#include <stdint.h>
53#include <sys/ioccom.h> 54#include <sys/ioccom.h>
54#include <sys/types.h> 55#include <sys/types.h>
55typedef int8_t __s8; 56typedef int8_t __s8;
diff --git a/tools/include/uapi/drm/i915_drm.h b/tools/include/uapi/drm/i915_drm.h
index 3a73f5316766..328d05e77d9f 100644
--- a/tools/include/uapi/drm/i915_drm.h
+++ b/tools/include/uapi/drm/i915_drm.h
@@ -136,6 +136,8 @@ enum drm_i915_gem_engine_class {
136struct i915_engine_class_instance { 136struct i915_engine_class_instance {
137 __u16 engine_class; /* see enum drm_i915_gem_engine_class */ 137 __u16 engine_class; /* see enum drm_i915_gem_engine_class */
138 __u16 engine_instance; 138 __u16 engine_instance;
139#define I915_ENGINE_CLASS_INVALID_NONE -1
140#define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
139}; 141};
140 142
141/** 143/**
@@ -355,6 +357,8 @@ typedef struct _drm_i915_sarea {
355#define DRM_I915_PERF_ADD_CONFIG 0x37 357#define DRM_I915_PERF_ADD_CONFIG 0x37
356#define DRM_I915_PERF_REMOVE_CONFIG 0x38 358#define DRM_I915_PERF_REMOVE_CONFIG 0x38
357#define DRM_I915_QUERY 0x39 359#define DRM_I915_QUERY 0x39
360#define DRM_I915_GEM_VM_CREATE 0x3a
361#define DRM_I915_GEM_VM_DESTROY 0x3b
358/* Must be kept compact -- no holes */ 362/* Must be kept compact -- no holes */
359 363
360#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 364#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
@@ -415,6 +419,8 @@ typedef struct _drm_i915_sarea {
415#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config) 419#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
416#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64) 420#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
417#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query) 421#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
422#define DRM_IOCTL_I915_GEM_VM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_VM_CREATE, struct drm_i915_gem_vm_control)
423#define DRM_IOCTL_I915_GEM_VM_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_VM_DESTROY, struct drm_i915_gem_vm_control)
418 424
419/* Allow drivers to submit batchbuffers directly to hardware, relying 425/* Allow drivers to submit batchbuffers directly to hardware, relying
420 * on the security mechanisms provided by hardware. 426 * on the security mechanisms provided by hardware.
@@ -598,6 +604,12 @@ typedef struct drm_i915_irq_wait {
598 */ 604 */
599#define I915_PARAM_MMAP_GTT_COHERENT 52 605#define I915_PARAM_MMAP_GTT_COHERENT 52
600 606
607/*
608 * Query whether DRM_I915_GEM_EXECBUFFER2 supports coordination of parallel
609 * execution through use of explicit fence support.
610 * See I915_EXEC_FENCE_OUT and I915_EXEC_FENCE_SUBMIT.
611 */
612#define I915_PARAM_HAS_EXEC_SUBMIT_FENCE 53
601/* Must be kept compact -- no holes and well documented */ 613/* Must be kept compact -- no holes and well documented */
602 614
603typedef struct drm_i915_getparam { 615typedef struct drm_i915_getparam {
@@ -1120,7 +1132,16 @@ struct drm_i915_gem_execbuffer2 {
1120 */ 1132 */
1121#define I915_EXEC_FENCE_ARRAY (1<<19) 1133#define I915_EXEC_FENCE_ARRAY (1<<19)
1122 1134
1123#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_ARRAY<<1)) 1135/*
1136 * Setting I915_EXEC_FENCE_SUBMIT implies that lower_32_bits(rsvd2) represent
1137 * a sync_file fd to wait upon (in a nonblocking manner) prior to executing
1138 * the batch.
1139 *
1140 * Returns -EINVAL if the sync_file fd cannot be found.
1141 */
1142#define I915_EXEC_FENCE_SUBMIT (1 << 20)
1143
1144#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SUBMIT << 1))
1124 1145
1125#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) 1146#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
1126#define i915_execbuffer2_set_context_id(eb2, context) \ 1147#define i915_execbuffer2_set_context_id(eb2, context) \
@@ -1464,8 +1485,9 @@ struct drm_i915_gem_context_create_ext {
1464 __u32 ctx_id; /* output: id of new context*/ 1485 __u32 ctx_id; /* output: id of new context*/
1465 __u32 flags; 1486 __u32 flags;
1466#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0) 1487#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
1488#define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
1467#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \ 1489#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \
1468 (-(I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS << 1)) 1490 (-(I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
1469 __u64 extensions; 1491 __u64 extensions;
1470}; 1492};
1471 1493
@@ -1507,6 +1529,41 @@ struct drm_i915_gem_context_param {
1507 * On creation, all new contexts are marked as recoverable. 1529 * On creation, all new contexts are marked as recoverable.
1508 */ 1530 */
1509#define I915_CONTEXT_PARAM_RECOVERABLE 0x8 1531#define I915_CONTEXT_PARAM_RECOVERABLE 0x8
1532
1533 /*
1534 * The id of the associated virtual memory address space (ppGTT) of
1535 * this context. Can be retrieved and passed to another context
1536 * (on the same fd) for both to use the same ppGTT and so share
1537 * address layouts, and avoid reloading the page tables on context
1538 * switches between themselves.
1539 *
1540 * See DRM_I915_GEM_VM_CREATE and DRM_I915_GEM_VM_DESTROY.
1541 */
1542#define I915_CONTEXT_PARAM_VM 0x9
1543
1544/*
1545 * I915_CONTEXT_PARAM_ENGINES:
1546 *
1547 * Bind this context to operate on this subset of available engines. Henceforth,
1548 * the I915_EXEC_RING selector for DRM_IOCTL_I915_GEM_EXECBUFFER2 operates as
1549 * an index into this array of engines; I915_EXEC_DEFAULT selecting engine[0]
1550 * and upwards. Slots 0...N are filled in using the specified (class, instance).
1551 * Use
1552 * engine_class: I915_ENGINE_CLASS_INVALID,
1553 * engine_instance: I915_ENGINE_CLASS_INVALID_NONE
1554 * to specify a gap in the array that can be filled in later, e.g. by a
1555 * virtual engine used for load balancing.
1556 *
1557 * Setting the number of engines bound to the context to 0, by passing a zero
1558 * sized argument, will revert back to default settings.
1559 *
1560 * See struct i915_context_param_engines.
1561 *
1562 * Extensions:
1563 * i915_context_engines_load_balance (I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE)
1564 * i915_context_engines_bond (I915_CONTEXT_ENGINES_EXT_BOND)
1565 */
1566#define I915_CONTEXT_PARAM_ENGINES 0xa
1510/* Must be kept compact -- no holes and well documented */ 1567/* Must be kept compact -- no holes and well documented */
1511 1568
1512 __u64 value; 1569 __u64 value;
@@ -1540,9 +1597,10 @@ struct drm_i915_gem_context_param_sseu {
1540 struct i915_engine_class_instance engine; 1597 struct i915_engine_class_instance engine;
1541 1598
1542 /* 1599 /*
1543 * Unused for now. Must be cleared to zero. 1600 * Unknown flags must be cleared to zero.
1544 */ 1601 */
1545 __u32 flags; 1602 __u32 flags;
1603#define I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX (1u << 0)
1546 1604
1547 /* 1605 /*
1548 * Mask of slices to enable for the context. Valid values are a subset 1606 * Mask of slices to enable for the context. Valid values are a subset
@@ -1570,12 +1628,115 @@ struct drm_i915_gem_context_param_sseu {
1570 __u32 rsvd; 1628 __u32 rsvd;
1571}; 1629};
1572 1630
1631/*
1632 * i915_context_engines_load_balance:
1633 *
1634 * Enable load balancing across this set of engines.
1635 *
1636 * Into the I915_EXEC_DEFAULT slot [0], a virtual engine is created that when
1637 * used will proxy the execbuffer request onto one of the set of engines
1638 * in such a way as to distribute the load evenly across the set.
1639 *
1640 * The set of engines must be compatible (e.g. the same HW class) as they
1641 * will share the same logical GPU context and ring.
1642 *
1643 * To intermix rendering with the virtual engine and direct rendering onto
1644 * the backing engines (bypassing the load balancing proxy), the context must
1645 * be defined to use a single timeline for all engines.
1646 */
1647struct i915_context_engines_load_balance {
1648 struct i915_user_extension base;
1649
1650 __u16 engine_index;
1651 __u16 num_siblings;
1652 __u32 flags; /* all undefined flags must be zero */
1653
1654 __u64 mbz64; /* reserved for future use; must be zero */
1655
1656 struct i915_engine_class_instance engines[0];
1657} __attribute__((packed));
1658
1659#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
1660 struct i915_user_extension base; \
1661 __u16 engine_index; \
1662 __u16 num_siblings; \
1663 __u32 flags; \
1664 __u64 mbz64; \
1665 struct i915_engine_class_instance engines[N__]; \
1666} __attribute__((packed)) name__
1667
1668/*
1669 * i915_context_engines_bond:
1670 *
1671 * Constructed bonded pairs for execution within a virtual engine.
1672 *
1673 * All engines are equal, but some are more equal than others. Given
1674 * the distribution of resources in the HW, it may be preferable to run
1675 * a request on a given subset of engines in parallel to a request on a
1676 * specific engine. We enable this selection of engines within a virtual
1677 * engine by specifying bonding pairs, for any given master engine we will
1678 * only execute on one of the corresponding siblings within the virtual engine.
1679 *
1680 * To execute a request in parallel on the master engine and a sibling requires
1681 * coordination with a I915_EXEC_FENCE_SUBMIT.
1682 */
1683struct i915_context_engines_bond {
1684 struct i915_user_extension base;
1685
1686 struct i915_engine_class_instance master;
1687
1688 __u16 virtual_index; /* index of virtual engine in ctx->engines[] */
1689 __u16 num_bonds;
1690
1691 __u64 flags; /* all undefined flags must be zero */
1692 __u64 mbz64[4]; /* reserved for future use; must be zero */
1693
1694 struct i915_engine_class_instance engines[0];
1695} __attribute__((packed));
1696
1697#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
1698 struct i915_user_extension base; \
1699 struct i915_engine_class_instance master; \
1700 __u16 virtual_index; \
1701 __u16 num_bonds; \
1702 __u64 flags; \
1703 __u64 mbz64[4]; \
1704 struct i915_engine_class_instance engines[N__]; \
1705} __attribute__((packed)) name__
1706
1707struct i915_context_param_engines {
1708 __u64 extensions; /* linked chain of extension blocks, 0 terminates */
1709#define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0 /* see i915_context_engines_load_balance */
1710#define I915_CONTEXT_ENGINES_EXT_BOND 1 /* see i915_context_engines_bond */
1711 struct i915_engine_class_instance engines[0];
1712} __attribute__((packed));
1713
1714#define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \
1715 __u64 extensions; \
1716 struct i915_engine_class_instance engines[N__]; \
1717} __attribute__((packed)) name__
1718
1573struct drm_i915_gem_context_create_ext_setparam { 1719struct drm_i915_gem_context_create_ext_setparam {
1574#define I915_CONTEXT_CREATE_EXT_SETPARAM 0 1720#define I915_CONTEXT_CREATE_EXT_SETPARAM 0
1575 struct i915_user_extension base; 1721 struct i915_user_extension base;
1576 struct drm_i915_gem_context_param param; 1722 struct drm_i915_gem_context_param param;
1577}; 1723};
1578 1724
1725struct drm_i915_gem_context_create_ext_clone {
1726#define I915_CONTEXT_CREATE_EXT_CLONE 1
1727 struct i915_user_extension base;
1728 __u32 clone_id;
1729 __u32 flags;
1730#define I915_CONTEXT_CLONE_ENGINES (1u << 0)
1731#define I915_CONTEXT_CLONE_FLAGS (1u << 1)
1732#define I915_CONTEXT_CLONE_SCHEDATTR (1u << 2)
1733#define I915_CONTEXT_CLONE_SSEU (1u << 3)
1734#define I915_CONTEXT_CLONE_TIMELINE (1u << 4)
1735#define I915_CONTEXT_CLONE_VM (1u << 5)
1736#define I915_CONTEXT_CLONE_UNKNOWN -(I915_CONTEXT_CLONE_VM << 1)
1737 __u64 rsvd;
1738};
1739
1579struct drm_i915_gem_context_destroy { 1740struct drm_i915_gem_context_destroy {
1580 __u32 ctx_id; 1741 __u32 ctx_id;
1581 __u32 pad; 1742 __u32 pad;
@@ -1821,6 +1982,7 @@ struct drm_i915_perf_oa_config {
1821struct drm_i915_query_item { 1982struct drm_i915_query_item {
1822 __u64 query_id; 1983 __u64 query_id;
1823#define DRM_I915_QUERY_TOPOLOGY_INFO 1 1984#define DRM_I915_QUERY_TOPOLOGY_INFO 1
1985#define DRM_I915_QUERY_ENGINE_INFO 2
1824/* Must be kept compact -- no holes and well documented */ 1986/* Must be kept compact -- no holes and well documented */
1825 1987
1826 /* 1988 /*
@@ -1919,6 +2081,47 @@ struct drm_i915_query_topology_info {
1919 __u8 data[]; 2081 __u8 data[];
1920}; 2082};
1921 2083
2084/**
2085 * struct drm_i915_engine_info
2086 *
2087 * Describes one engine and it's capabilities as known to the driver.
2088 */
2089struct drm_i915_engine_info {
2090 /** Engine class and instance. */
2091 struct i915_engine_class_instance engine;
2092
2093 /** Reserved field. */
2094 __u32 rsvd0;
2095
2096 /** Engine flags. */
2097 __u64 flags;
2098
2099 /** Capabilities of this engine. */
2100 __u64 capabilities;
2101#define I915_VIDEO_CLASS_CAPABILITY_HEVC (1 << 0)
2102#define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC (1 << 1)
2103
2104 /** Reserved fields. */
2105 __u64 rsvd1[4];
2106};
2107
2108/**
2109 * struct drm_i915_query_engine_info
2110 *
2111 * Engine info query enumerates all engines known to the driver by filling in
2112 * an array of struct drm_i915_engine_info structures.
2113 */
2114struct drm_i915_query_engine_info {
2115 /** Number of struct drm_i915_engine_info structs following. */
2116 __u32 num_engines;
2117
2118 /** MBZ */
2119 __u32 rsvd[3];
2120
2121 /** Marker for drm_i915_engine_info structures. */
2122 struct drm_i915_engine_info engines[];
2123};
2124
1922#if defined(__cplusplus) 2125#if defined(__cplusplus)
1923} 2126}
1924#endif 2127#endif
diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h
index 7d113a9602f0..4a8c02cafa9a 100644
--- a/tools/include/uapi/linux/if_link.h
+++ b/tools/include/uapi/linux/if_link.h
@@ -695,6 +695,7 @@ enum {
695 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */ 695 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
696 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */ 696 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
697 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */ 697 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
698 IFLA_VF_BROADCAST, /* VF broadcast */
698 __IFLA_VF_MAX, 699 __IFLA_VF_MAX,
699}; 700};
700 701
@@ -705,6 +706,10 @@ struct ifla_vf_mac {
705 __u8 mac[32]; /* MAX_ADDR_LEN */ 706 __u8 mac[32]; /* MAX_ADDR_LEN */
706}; 707};
707 708
709struct ifla_vf_broadcast {
710 __u8 broadcast[32];
711};
712
708struct ifla_vf_vlan { 713struct ifla_vf_vlan {
709 __u32 vf; 714 __u32 vf;
710 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */ 715 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index e7c67be7c15f..5e3f12d5359e 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -995,6 +995,7 @@ struct kvm_ppc_resize_hpt {
995#define KVM_CAP_ARM_SVE 170 995#define KVM_CAP_ARM_SVE 170
996#define KVM_CAP_ARM_PTRAUTH_ADDRESS 171 996#define KVM_CAP_ARM_PTRAUTH_ADDRESS 171
997#define KVM_CAP_ARM_PTRAUTH_GENERIC 172 997#define KVM_CAP_ARM_PTRAUTH_GENERIC 172
998#define KVM_CAP_PMU_EVENT_FILTER 173
998 999
999#ifdef KVM_CAP_IRQ_ROUTING 1000#ifdef KVM_CAP_IRQ_ROUTING
1000 1001
@@ -1329,6 +1330,8 @@ struct kvm_s390_ucas_mapping {
1329#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info) 1330#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)
1330/* Available with KVM_CAP_PPC_GET_CPU_CHAR */ 1331/* Available with KVM_CAP_PPC_GET_CPU_CHAR */
1331#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char) 1332#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
1333/* Available with KVM_CAP_PMU_EVENT_FILTER */
1334#define KVM_SET_PMU_EVENT_FILTER _IOW(KVMIO, 0xb2, struct kvm_pmu_event_filter)
1332 1335
1333/* ioctl for vm fd */ 1336/* ioctl for vm fd */
1334#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device) 1337#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)
diff --git a/tools/include/uapi/linux/sched.h b/tools/include/uapi/linux/sched.h
index ed4ee170bee2..b3105ac1381a 100644
--- a/tools/include/uapi/linux/sched.h
+++ b/tools/include/uapi/linux/sched.h
@@ -2,6 +2,8 @@
2#ifndef _UAPI_LINUX_SCHED_H 2#ifndef _UAPI_LINUX_SCHED_H
3#define _UAPI_LINUX_SCHED_H 3#define _UAPI_LINUX_SCHED_H
4 4
5#include <linux/types.h>
6
5/* 7/*
6 * cloning flags: 8 * cloning flags:
7 */ 9 */
@@ -32,6 +34,20 @@
32#define CLONE_IO 0x80000000 /* Clone io context */ 34#define CLONE_IO 0x80000000 /* Clone io context */
33 35
34/* 36/*
37 * Arguments for the clone3 syscall
38 */
39struct clone_args {
40 __aligned_u64 flags;
41 __aligned_u64 pidfd;
42 __aligned_u64 child_tid;
43 __aligned_u64 parent_tid;
44 __aligned_u64 exit_signal;
45 __aligned_u64 stack;
46 __aligned_u64 stack_size;
47 __aligned_u64 tls;
48};
49
50/*
35 * Scheduling policies 51 * Scheduling policies
36 */ 52 */
37#define SCHED_NORMAL 0 53#define SCHED_NORMAL 0
@@ -51,9 +67,21 @@
51#define SCHED_FLAG_RESET_ON_FORK 0x01 67#define SCHED_FLAG_RESET_ON_FORK 0x01
52#define SCHED_FLAG_RECLAIM 0x02 68#define SCHED_FLAG_RECLAIM 0x02
53#define SCHED_FLAG_DL_OVERRUN 0x04 69#define SCHED_FLAG_DL_OVERRUN 0x04
70#define SCHED_FLAG_KEEP_POLICY 0x08
71#define SCHED_FLAG_KEEP_PARAMS 0x10
72#define SCHED_FLAG_UTIL_CLAMP_MIN 0x20
73#define SCHED_FLAG_UTIL_CLAMP_MAX 0x40
74
75#define SCHED_FLAG_KEEP_ALL (SCHED_FLAG_KEEP_POLICY | \
76 SCHED_FLAG_KEEP_PARAMS)
77
78#define SCHED_FLAG_UTIL_CLAMP (SCHED_FLAG_UTIL_CLAMP_MIN | \
79 SCHED_FLAG_UTIL_CLAMP_MAX)
54 80
55#define SCHED_FLAG_ALL (SCHED_FLAG_RESET_ON_FORK | \ 81#define SCHED_FLAG_ALL (SCHED_FLAG_RESET_ON_FORK | \
56 SCHED_FLAG_RECLAIM | \ 82 SCHED_FLAG_RECLAIM | \
57 SCHED_FLAG_DL_OVERRUN) 83 SCHED_FLAG_DL_OVERRUN | \
84 SCHED_FLAG_KEEP_ALL | \
85 SCHED_FLAG_UTIL_CLAMP)
58 86
59#endif /* _UAPI_LINUX_SCHED_H */ 87#endif /* _UAPI_LINUX_SCHED_H */
diff --git a/tools/include/uapi/linux/usbdevice_fs.h b/tools/include/uapi/linux/usbdevice_fs.h
index 964e87217be4..78efe870c2b7 100644
--- a/tools/include/uapi/linux/usbdevice_fs.h
+++ b/tools/include/uapi/linux/usbdevice_fs.h
@@ -76,6 +76,26 @@ struct usbdevfs_connectinfo {
76 unsigned char slow; 76 unsigned char slow;
77}; 77};
78 78
79struct usbdevfs_conninfo_ex {
80 __u32 size; /* Size of the structure from the kernel's */
81 /* point of view. Can be used by userspace */
82 /* to determine how much data can be */
83 /* used/trusted. */
84 __u32 busnum; /* USB bus number, as enumerated by the */
85 /* kernel, the device is connected to. */
86 __u32 devnum; /* Device address on the bus. */
87 __u32 speed; /* USB_SPEED_* constants from ch9.h */
88 __u8 num_ports; /* Number of ports the device is connected */
89 /* to on the way to the root hub. It may */
90 /* be bigger than size of 'ports' array so */
91 /* userspace can detect overflows. */
92 __u8 ports[7]; /* List of ports on the way from the root */
93 /* hub to the device. Current limit in */
94 /* USB specification is 7 tiers (root hub, */
95 /* 5 intermediate hubs, device), which */
96 /* gives at most 6 port entries. */
97};
98
79#define USBDEVFS_URB_SHORT_NOT_OK 0x01 99#define USBDEVFS_URB_SHORT_NOT_OK 0x01
80#define USBDEVFS_URB_ISO_ASAP 0x02 100#define USBDEVFS_URB_ISO_ASAP 0x02
81#define USBDEVFS_URB_BULK_CONTINUATION 0x04 101#define USBDEVFS_URB_BULK_CONTINUATION 0x04
@@ -137,6 +157,7 @@ struct usbdevfs_hub_portinfo {
137#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10 157#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10
138#define USBDEVFS_CAP_MMAP 0x20 158#define USBDEVFS_CAP_MMAP 0x20
139#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40 159#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40
160#define USBDEVFS_CAP_CONNINFO_EX 0x80
140 161
141/* USBDEVFS_DISCONNECT_CLAIM flags & struct */ 162/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
142 163
@@ -197,5 +218,10 @@ struct usbdevfs_streams {
197#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams) 218#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
198#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32) 219#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32)
199#define USBDEVFS_GET_SPEED _IO('U', 31) 220#define USBDEVFS_GET_SPEED _IO('U', 31)
221/*
222 * Returns struct usbdevfs_conninfo_ex; length is variable to allow
223 * extending size of the data returned.
224 */
225#define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len)
200 226
201#endif /* _UAPI_LINUX_USBDEVICE_FS_H */ 227#endif /* _UAPI_LINUX_USBDEVICE_FS_H */
diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
index 03748a742146..bae8879cdf58 100644
--- a/tools/lib/bpf/hashmap.h
+++ b/tools/lib/bpf/hashmap.h
@@ -10,6 +10,11 @@
10 10
11#include <stdbool.h> 11#include <stdbool.h>
12#include <stddef.h> 12#include <stddef.h>
13#ifdef __GLIBC__
14#include <bits/wordsize.h>
15#else
16#include <bits/reg.h>
17#endif
13#include "libbpf_internal.h" 18#include "libbpf_internal.h"
14 19
15static inline size_t hash_bits(size_t h, int bits) 20static inline size_t hash_bits(size_t h, int bits)
diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt
index 5f54feb19977..d030c87ed9f5 100644
--- a/tools/perf/Documentation/perf.data-file-format.txt
+++ b/tools/perf/Documentation/perf.data-file-format.txt
@@ -126,7 +126,7 @@ vendor,family,model,stepping. For example: GenuineIntel,6,69,1
126 126
127 HEADER_TOTAL_MEM = 10, 127 HEADER_TOTAL_MEM = 10,
128 128
129An uint64_t with the total memory in bytes. 129An uint64_t with the total memory in kilobytes.
130 130
131 HEADER_CMDLINE = 11, 131 HEADER_CMDLINE = 11,
132 132
diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
index b4e6f9e6204a..c29976eca4a8 100644
--- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
@@ -355,6 +355,8 @@
355431 common fsconfig __x64_sys_fsconfig 355431 common fsconfig __x64_sys_fsconfig
356432 common fsmount __x64_sys_fsmount 356432 common fsmount __x64_sys_fsmount
357433 common fspick __x64_sys_fspick 357433 common fspick __x64_sys_fspick
358434 common pidfd_open __x64_sys_pidfd_open
359435 common clone3 __x64_sys_clone3/ptregs
358 360
359# 361#
360# x32-specific system call numbers start at 512 to avoid cache impact 362# x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/tools/perf/trace/beauty/usbdevfs_ioctl.sh b/tools/perf/trace/beauty/usbdevfs_ioctl.sh
index 930b80f422e8..aa597ae53747 100755
--- a/tools/perf/trace/beauty/usbdevfs_ioctl.sh
+++ b/tools/perf/trace/beauty/usbdevfs_ioctl.sh
@@ -3,10 +3,13 @@
3 3
4[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ 4[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
5 5
6# also as:
7# #define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len)
8
6printf "static const char *usbdevfs_ioctl_cmds[] = {\n" 9printf "static const char *usbdevfs_ioctl_cmds[] = {\n"
7regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)[[:space:]]+_IO[WR]{0,2}\([[:space:]]*'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*" 10regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)(\(\w+\))?[[:space:]]+_IO[CWR]{0,2}\([[:space:]]*(_IOC_\w+,[[:space:]]*)?'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*"
8egrep $regex ${header_dir}/usbdevice_fs.h | egrep -v 'USBDEVFS_\w+32[[:space:]]' | \ 11egrep "$regex" ${header_dir}/usbdevice_fs.h | egrep -v 'USBDEVFS_\w+32[[:space:]]' | \
9 sed -r "s/$regex/\2 \1/g" | \ 12 sed -r "s/$regex/\4 \1/g" | \
10 sort | xargs printf "\t[%s] = \"%s\",\n" 13 sort | xargs printf "\t[%s] = \"%s\",\n"
11printf "};\n\n" 14printf "};\n\n"
12printf "#if 0\n" 15printf "#if 0\n"
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 20111f8da5cb..1903d7ec9797 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3559,6 +3559,13 @@ int perf_session__read_header(struct perf_session *session)
3559 data->file.path); 3559 data->file.path);
3560 } 3560 }
3561 3561
3562 if (f_header.attr_size == 0) {
3563 pr_err("ERROR: The %s file's attr size field is 0 which is unexpected.\n"
3564 "Was the 'perf record' command properly terminated?\n",
3565 data->file.path);
3566 return -EINVAL;
3567 }
3568
3562 nr_attrs = f_header.attrs.size / f_header.attr_size; 3569 nr_attrs = f_header.attrs.size / f_header.attr_size;
3563 lseek(fd, f_header.attrs.offset, SEEK_SET); 3570 lseek(fd, f_header.attrs.offset, SEEK_SET);
3564 3571
@@ -3639,7 +3646,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool,
3639 size += sizeof(struct perf_event_header); 3646 size += sizeof(struct perf_event_header);
3640 size += ids * sizeof(u64); 3647 size += ids * sizeof(u64);
3641 3648
3642 ev = malloc(size); 3649 ev = zalloc(size);
3643 3650
3644 if (ev == NULL) 3651 if (ev == NULL)
3645 return -ENOMEM; 3652 return -ENOMEM;