Skip to content

Commit 4b50239

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-core-for-mingo-4.15-20171003' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: - Multithread the synthesizing of PERF_RECORD_ events for pre-existing threads in 'perf top', speeding up that phase, greatly improving the user experience in systems such as Intel's Knights Mill (Kan Liang) - 'perf test' fixes for the perf_event_attr test case (Jiri Olsa, Thomas Richter) Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents a47ba4d + f6a9820 commit 4b50239

38 files changed

+439
-125
lines changed

tools/arch/s390/include/uapi/asm/kvm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ struct kvm_s390_io_adapter_req {
8888
/* kvm attributes for KVM_S390_VM_TOD */
8989
#define KVM_S390_VM_TOD_LOW 0
9090
#define KVM_S390_VM_TOD_HIGH 1
91+
#define KVM_S390_VM_TOD_EXT 2
92+
93+
struct kvm_s390_vm_tod_clock {
94+
__u8 epoch_idx;
95+
__u64 tod;
96+
};
9197

9298
/* kvm attributes for KVM_S390_VM_CPU_MODEL */
9399
/* processor related attributes are r/w */

tools/arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196

197197
#define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
198198
#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
199+
#define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */
199200

200201
#define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */
201202
#define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */
@@ -287,6 +288,7 @@
287288
#define X86_FEATURE_PFTHRESHOLD (15*32+12) /* pause filter threshold */
288289
#define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */
289290
#define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* Virtual VMSAVE VMLOAD */
291+
#define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */
290292

291293
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */
292294
#define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/

tools/arch/x86/include/asm/disabled-features.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
# define DISABLE_K6_MTRR (1<<(X86_FEATURE_K6_MTRR & 31))
2222
# define DISABLE_CYRIX_ARR (1<<(X86_FEATURE_CYRIX_ARR & 31))
2323
# define DISABLE_CENTAUR_MCR (1<<(X86_FEATURE_CENTAUR_MCR & 31))
24+
# define DISABLE_PCID 0
2425
#else
2526
# define DISABLE_VME 0
2627
# define DISABLE_K6_MTRR 0
2728
# define DISABLE_CYRIX_ARR 0
2829
# define DISABLE_CENTAUR_MCR 0
30+
# define DISABLE_PCID (1<<(X86_FEATURE_PCID & 31))
2931
#endif /* CONFIG_X86_64 */
3032

3133
#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
@@ -49,7 +51,7 @@
4951
#define DISABLED_MASK1 0
5052
#define DISABLED_MASK2 0
5153
#define DISABLED_MASK3 (DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR)
52-
#define DISABLED_MASK4 0
54+
#define DISABLED_MASK4 (DISABLE_PCID)
5355
#define DISABLED_MASK5 0
5456
#define DISABLED_MASK6 0
5557
#define DISABLED_MASK7 0
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef _ASM_GENERIC_HUGETLB_ENCODE_H_
2+
#define _ASM_GENERIC_HUGETLB_ENCODE_H_
3+
4+
/*
5+
* Several system calls take a flag to request "hugetlb" huge pages.
6+
* Without further specification, these system calls will use the
7+
* system's default huge page size. If a system supports multiple
8+
* huge page sizes, the desired huge page size can be specified in
9+
* bits [26:31] of the flag arguments. The value in these 6 bits
10+
* will encode the log2 of the huge page size.
11+
*
12+
* The following definitions are associated with this huge page size
13+
* encoding in flag arguments. System call specific header files
14+
* that use this encoding should include this file. They can then
15+
* provide definitions based on these with their own specific prefix.
16+
* for example:
17+
* #define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT
18+
*/
19+
20+
#define HUGETLB_FLAG_ENCODE_SHIFT 26
21+
#define HUGETLB_FLAG_ENCODE_MASK 0x3f
22+
23+
#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT)
24+
#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT)
25+
#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT)
26+
#define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT)
27+
#define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT)
28+
#define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT)
29+
#define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT)
30+
#define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT)
31+
#define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT)
32+
#define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT)
33+
34+
#endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */

tools/include/uapi/drm/drm.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ struct drm_prime_handle {
700700

701701
struct drm_syncobj_create {
702702
__u32 handle;
703+
#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
703704
__u32 flags;
704705
};
705706

@@ -718,6 +719,24 @@ struct drm_syncobj_handle {
718719
__u32 pad;
719720
};
720721

722+
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
723+
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
724+
struct drm_syncobj_wait {
725+
__u64 handles;
726+
/* absolute timeout */
727+
__s64 timeout_nsec;
728+
__u32 count_handles;
729+
__u32 flags;
730+
__u32 first_signaled; /* only valid when not waiting all */
731+
__u32 pad;
732+
};
733+
734+
struct drm_syncobj_array {
735+
__u64 handles;
736+
__u32 count_handles;
737+
__u32 pad;
738+
};
739+
721740
#if defined(__cplusplus)
722741
}
723742
#endif
@@ -840,6 +859,9 @@ extern "C" {
840859
#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
841860
#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
842861
#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
862+
#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
863+
#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
864+
#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
843865

844866
/**
845867
* Device specific ioctls should only be in their respective headers

tools/include/uapi/drm/i915_drm.h

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ typedef struct _drm_i915_sarea {
260260
#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
261261
#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
262262
#define DRM_I915_PERF_OPEN 0x36
263+
#define DRM_I915_PERF_ADD_CONFIG 0x37
264+
#define DRM_I915_PERF_REMOVE_CONFIG 0x38
263265

264266
#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
265267
#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -315,6 +317,8 @@ typedef struct _drm_i915_sarea {
315317
#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
316318
#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
317319
#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
320+
#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
321+
#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
318322

319323
/* Allow drivers to submit batchbuffers directly to hardware, relying
320324
* on the security mechanisms provided by hardware.
@@ -431,6 +435,11 @@ typedef struct drm_i915_irq_wait {
431435
*/
432436
#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
433437

438+
/* Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying an array of
439+
* drm_i915_gem_exec_fence structures. See I915_EXEC_FENCE_ARRAY.
440+
*/
441+
#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
442+
434443
typedef struct drm_i915_getparam {
435444
__s32 param;
436445
/*
@@ -812,6 +821,17 @@ struct drm_i915_gem_exec_object2 {
812821
__u64 rsvd2;
813822
};
814823

824+
struct drm_i915_gem_exec_fence {
825+
/**
826+
* User's handle for a drm_syncobj to wait on or signal.
827+
*/
828+
__u32 handle;
829+
830+
#define I915_EXEC_FENCE_WAIT (1<<0)
831+
#define I915_EXEC_FENCE_SIGNAL (1<<1)
832+
__u32 flags;
833+
};
834+
815835
struct drm_i915_gem_execbuffer2 {
816836
/**
817837
* List of gem_exec_object2 structs
@@ -826,7 +846,11 @@ struct drm_i915_gem_execbuffer2 {
826846
__u32 DR1;
827847
__u32 DR4;
828848
__u32 num_cliprects;
829-
/** This is a struct drm_clip_rect *cliprects */
849+
/**
850+
* This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY
851+
* is not set. If I915_EXEC_FENCE_ARRAY is set, then this is a
852+
* struct drm_i915_gem_exec_fence *fences.
853+
*/
830854
__u64 cliprects_ptr;
831855
#define I915_EXEC_RING_MASK (7<<0)
832856
#define I915_EXEC_DEFAULT (0<<0)
@@ -927,7 +951,14 @@ struct drm_i915_gem_execbuffer2 {
927951
* element).
928952
*/
929953
#define I915_EXEC_BATCH_FIRST (1<<18)
930-
#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_BATCH_FIRST<<1))
954+
955+
/* Setting I915_FENCE_ARRAY implies that num_cliprects and cliprects_ptr
956+
* define an array of i915_gem_exec_fence structures which specify a set of
957+
* dma fences to wait upon or signal.
958+
*/
959+
#define I915_EXEC_FENCE_ARRAY (1<<19)
960+
961+
#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_ARRAY<<1))
931962

932963
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
933964
#define i915_execbuffer2_set_context_id(eb2, context) \
@@ -1467,6 +1498,22 @@ enum drm_i915_perf_record_type {
14671498
DRM_I915_PERF_RECORD_MAX /* non-ABI */
14681499
};
14691500

1501+
/**
1502+
* Structure to upload perf dynamic configuration into the kernel.
1503+
*/
1504+
struct drm_i915_perf_oa_config {
1505+
/** String formatted like "%08x-%04x-%04x-%04x-%012x" */
1506+
char uuid[36];
1507+
1508+
__u32 n_mux_regs;
1509+
__u32 n_boolean_regs;
1510+
__u32 n_flex_regs;
1511+
1512+
__u64 __user mux_regs_ptr;
1513+
__u64 __user boolean_regs_ptr;
1514+
__u64 __user flex_regs_ptr;
1515+
};
1516+
14701517
#if defined(__cplusplus)
14711518
}
14721519
#endif

tools/include/uapi/linux/bpf.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ enum bpf_attach_type {
143143

144144
#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
145145

146-
enum bpf_sockmap_flags {
147-
BPF_SOCKMAP_UNSPEC,
148-
BPF_SOCKMAP_STRPARSER,
149-
__MAX_BPF_SOCKMAP_FLAG
150-
};
151-
152146
/* If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command
153147
* to the given target_fd cgroup the descendent cgroup will be able to
154148
* override effective bpf program that was inherited from this cgroup
@@ -368,9 +362,20 @@ union bpf_attr {
368362
* int bpf_redirect(ifindex, flags)
369363
* redirect to another netdev
370364
* @ifindex: ifindex of the net device
371-
* @flags: bit 0 - if set, redirect to ingress instead of egress
372-
* other bits - reserved
373-
* Return: TC_ACT_REDIRECT
365+
* @flags:
366+
* cls_bpf:
367+
* bit 0 - if set, redirect to ingress instead of egress
368+
* other bits - reserved
369+
* xdp_bpf:
370+
* all bits - reserved
371+
* Return: cls_bpf: TC_ACT_REDIRECT on success or TC_ACT_SHOT on error
372+
* xdp_bfp: XDP_REDIRECT on success or XDP_ABORT on error
373+
* int bpf_redirect_map(map, key, flags)
374+
* redirect to endpoint in map
375+
* @map: pointer to dev map
376+
* @key: index in map to lookup
377+
* @flags: --
378+
* Return: XDP_REDIRECT on success or XDP_ABORT on error
374379
*
375380
* u32 bpf_get_route_realm(skb)
376381
* retrieve a dst's tclassid
@@ -632,7 +637,7 @@ union bpf_attr {
632637
FN(skb_adjust_room), \
633638
FN(redirect_map), \
634639
FN(sk_redirect_map), \
635-
FN(sock_map_update),
640+
FN(sock_map_update), \
636641

637642
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
638643
* function eBPF program intends to call
@@ -753,20 +758,23 @@ struct bpf_sock {
753758
__u32 family;
754759
__u32 type;
755760
__u32 protocol;
761+
__u32 mark;
762+
__u32 priority;
756763
};
757764

758765
#define XDP_PACKET_HEADROOM 256
759766

760767
/* User return codes for XDP prog type.
761768
* A valid XDP program must return one of these defined values. All other
762-
* return codes are reserved for future use. Unknown return codes will result
763-
* in packet drop.
769+
* return codes are reserved for future use. Unknown return codes will
770+
* result in packet drops and a warning via bpf_warn_invalid_xdp_action().
764771
*/
765772
enum xdp_action {
766773
XDP_ABORTED = 0,
767774
XDP_DROP,
768775
XDP_PASS,
769776
XDP_TX,
777+
XDP_REDIRECT,
770778
};
771779

772780
/* user accessible metadata for XDP packet hook

tools/include/uapi/linux/kvm.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,8 @@ struct kvm_ppc_one_seg_page_size {
711711
struct kvm_ppc_smmu_info {
712712
__u64 flags;
713713
__u32 slb_size;
714-
__u32 pad;
714+
__u16 data_keys; /* # storage keys supported for data */
715+
__u16 instr_keys; /* # storage keys supported for instructions */
715716
struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
716717
};
717718

tools/include/uapi/linux/mman.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#ifndef _UAPI_LINUX_MMAN_H
22
#define _UAPI_LINUX_MMAN_H
33

4-
#include <uapi/asm/mman.h>
4+
#include <asm/mman.h>
5+
#include <asm-generic/hugetlb_encode.h>
56

67
#define MREMAP_MAYMOVE 1
78
#define MREMAP_FIXED 2
@@ -10,4 +11,25 @@
1011
#define OVERCOMMIT_ALWAYS 1
1112
#define OVERCOMMIT_NEVER 2
1213

14+
/*
15+
* Huge page size encoding when MAP_HUGETLB is specified, and a huge page
16+
* size other than the default is desired. See hugetlb_encode.h.
17+
* All known huge page size encodings are provided here. It is the
18+
* responsibility of the application to know which sizes are supported on
19+
* the running system. See mmap(2) man page for details.
20+
*/
21+
#define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT
22+
#define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK
23+
24+
#define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB
25+
#define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB
26+
#define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB
27+
#define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB
28+
#define MAP_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB
29+
#define MAP_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB
30+
#define MAP_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB
31+
#define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB
32+
#define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB
33+
#define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
34+
1335
#endif /* _UAPI_LINUX_MMAN_H */

tools/perf/Documentation/perf-top.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ Default is to monitor all CPUS.
240240
--force::
241241
Don't do ownership validation.
242242

243+
--num-thread-synthesize::
244+
The number of threads to run when synthesizing events for existing processes.
245+
By default, the number of threads equals to the number of online CPUs.
243246

244247
INTERACTIVE PROMPTING KEYS
245248
--------------------------

tools/perf/arch/s390/util/Build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
libperf-y += header.o
2-
libperf-y += sym-handling.o
32
libperf-y += kvm-stat.o
43

54
libperf-$(CONFIG_DWARF) += dwarf-regs.o

tools/perf/arch/s390/util/sym-handling.c

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)