Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Thomas Gleixner:

- Prevent a division by zero in the perf aux buffer handling

- Sync kernel headers with perf tool headers

- Fix a build failure in the syscalltbl code

- Make the debug messages of perf report --call-graph work correctly

- Make sure that all required perf files are in the MANIFEST for
container builds

- Fix the atrr.exclude kernel handling so it respects the
perf_event_paranoid and the user permissions

- Make perf test on s390x work correctly

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/aux: Only update ->aux_wakeup in non-overwrite mode
perf test: Fix vmlinux failure on s390x part 2
perf test: Fix vmlinux failure on s390x
perf tools: Fix syscalltbl build failure
perf report: Fix debug messages with --call-graph option
perf evsel: Fix attr.exclude_kernel setting for default cycles:p
tools include: Sync kernel ABI headers with tooling headers
perf tools: Get all of tools/{arch,include}/ in the MANIFEST

+210 -174
+15 -5
kernel/events/ring_buffer.c
··· 412 412 return NULL; 413 413 } 414 414 415 + static bool __always_inline rb_need_aux_wakeup(struct ring_buffer *rb) 416 + { 417 + if (rb->aux_overwrite) 418 + return false; 419 + 420 + if (rb->aux_head - rb->aux_wakeup >= rb->aux_watermark) { 421 + rb->aux_wakeup = rounddown(rb->aux_head, rb->aux_watermark); 422 + return true; 423 + } 424 + 425 + return false; 426 + } 427 + 415 428 /* 416 429 * Commit the data written by hardware into the ring buffer by adjusting 417 430 * aux_head and posting a PERF_RECORD_AUX into the perf buffer. It is the ··· 464 451 } 465 452 466 453 rb->user_page->aux_head = rb->aux_head; 467 - if (rb->aux_head - rb->aux_wakeup >= rb->aux_watermark) { 454 + if (rb_need_aux_wakeup(rb)) 468 455 wakeup = true; 469 - rb->aux_wakeup = rounddown(rb->aux_head, rb->aux_watermark); 470 - } 471 456 472 457 if (wakeup) { 473 458 if (handle->aux_flags & PERF_AUX_FLAG_TRUNCATED) ··· 495 484 rb->aux_head += size; 496 485 497 486 rb->user_page->aux_head = rb->aux_head; 498 - if (rb->aux_head - rb->aux_wakeup >= rb->aux_watermark) { 487 + if (rb_need_aux_wakeup(rb)) { 499 488 perf_output_wakeup(handle); 500 - rb->aux_wakeup = rounddown(rb->aux_head, rb->aux_watermark); 501 489 handle->wakeup = rb->aux_wakeup + rb->aux_watermark; 502 490 } 503 491
+6
tools/arch/s390/include/uapi/asm/kvm.h
··· 88 88 /* kvm attributes for KVM_S390_VM_TOD */ 89 89 #define KVM_S390_VM_TOD_LOW 0 90 90 #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 + }; 91 97 92 98 /* kvm attributes for KVM_S390_VM_CPU_MODEL */ 93 99 /* processor related attributes are r/w */
+2
tools/arch/x86/include/asm/cpufeatures.h
··· 196 196 197 197 #define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */ 198 198 #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */ 199 + #define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */ 199 200 200 201 #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ 201 202 #define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */ ··· 288 287 #define X86_FEATURE_PFTHRESHOLD (15*32+12) /* pause filter threshold */ 289 288 #define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */ 290 289 #define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* Virtual VMSAVE VMLOAD */ 290 + #define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */ 291 291 292 292 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */ 293 293 #define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/
+3 -1
tools/arch/x86/include/asm/disabled-features.h
··· 21 21 # define DISABLE_K6_MTRR (1<<(X86_FEATURE_K6_MTRR & 31)) 22 22 # define DISABLE_CYRIX_ARR (1<<(X86_FEATURE_CYRIX_ARR & 31)) 23 23 # define DISABLE_CENTAUR_MCR (1<<(X86_FEATURE_CENTAUR_MCR & 31)) 24 + # define DISABLE_PCID 0 24 25 #else 25 26 # define DISABLE_VME 0 26 27 # define DISABLE_K6_MTRR 0 27 28 # define DISABLE_CYRIX_ARR 0 28 29 # define DISABLE_CENTAUR_MCR 0 30 + # define DISABLE_PCID (1<<(X86_FEATURE_PCID & 31)) 29 31 #endif /* CONFIG_X86_64 */ 30 32 31 33 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS ··· 51 49 #define DISABLED_MASK1 0 52 50 #define DISABLED_MASK2 0 53 51 #define DISABLED_MASK3 (DISABLE_CYRIX_ARR|DISABLE_CENTAUR_MCR|DISABLE_K6_MTRR) 54 - #define DISABLED_MASK4 0 52 + #define DISABLED_MASK4 (DISABLE_PCID) 55 53 #define DISABLED_MASK5 0 56 54 #define DISABLED_MASK6 0 57 55 #define DISABLED_MASK7 0
+34
tools/include/asm-generic/hugetlb_encode.h
··· 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_ */
+3 -11
tools/include/uapi/asm-generic/mman-common.h
··· 58 58 overrides the coredump filter bits */ 59 59 #define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag */ 60 60 61 + #define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */ 62 + #define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */ 63 + 61 64 /* compatibility flags */ 62 65 #define MAP_FILE 0 63 - 64 - /* 65 - * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. 66 - * This gives us 6 bits, which is enough until someone invents 128 bit address 67 - * spaces. 68 - * 69 - * Assume these are all power of twos. 70 - * When 0 use the default page size. 71 - */ 72 - #define MAP_HUGE_SHIFT 26 73 - #define MAP_HUGE_MASK 0x3f 74 66 75 67 #define PKEY_DISABLE_ACCESS 0x1 76 68 #define PKEY_DISABLE_WRITE 0x2
+22
tools/include/uapi/drm/drm.h
··· 700 700 701 701 struct drm_syncobj_create { 702 702 __u32 handle; 703 + #define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) 703 704 __u32 flags; 704 705 }; 705 706 ··· 716 715 __u32 flags; 717 716 718 717 __s32 fd; 718 + __u32 pad; 719 + }; 720 + 721 + #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) 722 + #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) 723 + struct drm_syncobj_wait { 724 + __u64 handles; 725 + /* absolute timeout */ 726 + __s64 timeout_nsec; 727 + __u32 count_handles; 728 + __u32 flags; 729 + __u32 first_signaled; /* only valid when not waiting all */ 730 + __u32 pad; 731 + }; 732 + 733 + struct drm_syncobj_array { 734 + __u64 handles; 735 + __u32 count_handles; 719 736 __u32 pad; 720 737 }; 721 738 ··· 859 840 #define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) 860 841 #define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) 861 842 #define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) 843 + #define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) 844 + #define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) 845 + #define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) 862 846 863 847 /** 864 848 * Device specific ioctls should only be in their respective headers
+49 -2
tools/include/uapi/drm/i915_drm.h
··· 260 260 #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 261 261 #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 262 262 #define DRM_I915_PERF_OPEN 0x36 263 + #define DRM_I915_PERF_ADD_CONFIG 0x37 264 + #define DRM_I915_PERF_REMOVE_CONFIG 0x38 263 265 264 266 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 265 267 #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) ··· 317 315 #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) 318 316 #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) 319 317 #define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param) 318 + #define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config) 319 + #define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64) 320 320 321 321 /* Allow drivers to submit batchbuffers directly to hardware, relying 322 322 * on the security mechanisms provided by hardware. ··· 434 430 * as the first execobject as opposed to the last. See I915_EXEC_BATCH_FIRST. 435 431 */ 436 432 #define I915_PARAM_HAS_EXEC_BATCH_FIRST 48 433 + 434 + /* Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying an array of 435 + * drm_i915_gem_exec_fence structures. See I915_EXEC_FENCE_ARRAY. 436 + */ 437 + #define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49 437 438 438 439 typedef struct drm_i915_getparam { 439 440 __s32 param; ··· 821 812 __u64 rsvd2; 822 813 }; 823 814 815 + struct drm_i915_gem_exec_fence { 816 + /** 817 + * User's handle for a drm_syncobj to wait on or signal. 818 + */ 819 + __u32 handle; 820 + 821 + #define I915_EXEC_FENCE_WAIT (1<<0) 822 + #define I915_EXEC_FENCE_SIGNAL (1<<1) 823 + __u32 flags; 824 + }; 825 + 824 826 struct drm_i915_gem_execbuffer2 { 825 827 /** 826 828 * List of gem_exec_object2 structs ··· 846 826 __u32 DR1; 847 827 __u32 DR4; 848 828 __u32 num_cliprects; 849 - /** This is a struct drm_clip_rect *cliprects */ 829 + /** 830 + * This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY 831 + * is not set. If I915_EXEC_FENCE_ARRAY is set, then this is a 832 + * struct drm_i915_gem_exec_fence *fences. 833 + */ 850 834 __u64 cliprects_ptr; 851 835 #define I915_EXEC_RING_MASK (7<<0) 852 836 #define I915_EXEC_DEFAULT (0<<0) ··· 951 927 * element). 952 928 */ 953 929 #define I915_EXEC_BATCH_FIRST (1<<18) 954 - #define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_BATCH_FIRST<<1)) 930 + 931 + /* Setting I915_FENCE_ARRAY implies that num_cliprects and cliprects_ptr 932 + * define an array of i915_gem_exec_fence structures which specify a set of 933 + * dma fences to wait upon or signal. 934 + */ 935 + #define I915_EXEC_FENCE_ARRAY (1<<19) 936 + 937 + #define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_ARRAY<<1)) 955 938 956 939 #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) 957 940 #define i915_execbuffer2_set_context_id(eb2, context) \ ··· 1496 1465 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3, 1497 1466 1498 1467 DRM_I915_PERF_RECORD_MAX /* non-ABI */ 1468 + }; 1469 + 1470 + /** 1471 + * Structure to upload perf dynamic configuration into the kernel. 1472 + */ 1473 + struct drm_i915_perf_oa_config { 1474 + /** String formatted like "%08x-%04x-%04x-%04x-%012x" */ 1475 + char uuid[36]; 1476 + 1477 + __u32 n_mux_regs; 1478 + __u32 n_boolean_regs; 1479 + __u32 n_flex_regs; 1480 + 1481 + __u64 __user mux_regs_ptr; 1482 + __u64 __user boolean_regs_ptr; 1483 + __u64 __user flex_regs_ptr; 1499 1484 }; 1500 1485 1501 1486 #if defined(__cplusplus)
+20 -12
tools/include/uapi/linux/bpf.h
··· 143 143 144 144 #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE 145 145 146 - enum bpf_sockmap_flags { 147 - BPF_SOCKMAP_UNSPEC, 148 - BPF_SOCKMAP_STRPARSER, 149 - __MAX_BPF_SOCKMAP_FLAG 150 - }; 151 - 152 146 /* If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command 153 147 * to the given target_fd cgroup the descendent cgroup will be able to 154 148 * override effective bpf program that was inherited from this cgroup ··· 362 368 * int bpf_redirect(ifindex, flags) 363 369 * redirect to another netdev 364 370 * @ifindex: ifindex of the net device 365 - * @flags: bit 0 - if set, redirect to ingress instead of egress 366 - * other bits - reserved 367 - * Return: TC_ACT_REDIRECT 371 + * @flags: 372 + * cls_bpf: 373 + * bit 0 - if set, redirect to ingress instead of egress 374 + * other bits - reserved 375 + * xdp_bpf: 376 + * all bits - reserved 377 + * Return: cls_bpf: TC_ACT_REDIRECT on success or TC_ACT_SHOT on error 378 + * xdp_bfp: XDP_REDIRECT on success or XDP_ABORT on error 379 + * int bpf_redirect_map(map, key, flags) 380 + * redirect to endpoint in map 381 + * @map: pointer to dev map 382 + * @key: index in map to lookup 383 + * @flags: -- 384 + * Return: XDP_REDIRECT on success or XDP_ABORT on error 368 385 * 369 386 * u32 bpf_get_route_realm(skb) 370 387 * retrieve a dst's tclassid ··· 637 632 FN(skb_adjust_room), \ 638 633 FN(redirect_map), \ 639 634 FN(sk_redirect_map), \ 640 - FN(sock_map_update), 635 + FN(sock_map_update), \ 641 636 642 637 /* integer value in 'imm' field of BPF_CALL instruction selects which helper 643 638 * function eBPF program intends to call ··· 758 753 __u32 family; 759 754 __u32 type; 760 755 __u32 protocol; 756 + __u32 mark; 757 + __u32 priority; 761 758 }; 762 759 763 760 #define XDP_PACKET_HEADROOM 256 764 761 765 762 /* User return codes for XDP prog type. 766 763 * A valid XDP program must return one of these defined values. All other 767 - * return codes are reserved for future use. Unknown return codes will result 768 - * in packet drop. 764 + * return codes are reserved for future use. Unknown return codes will 765 + * result in packet drops and a warning via bpf_warn_invalid_xdp_action(). 769 766 */ 770 767 enum xdp_action { 771 768 XDP_ABORTED = 0, 772 769 XDP_DROP, 773 770 XDP_PASS, 774 771 XDP_TX, 772 + XDP_REDIRECT, 775 773 }; 776 774 777 775 /* user accessible metadata for XDP packet hook
+2 -1
tools/include/uapi/linux/kvm.h
··· 711 711 struct kvm_ppc_smmu_info { 712 712 __u64 flags; 713 713 __u32 slb_size; 714 - __u32 pad; 714 + __u16 data_keys; /* # storage keys supported for data */ 715 + __u16 instr_keys; /* # storage keys supported for instructions */ 715 716 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; 716 717 }; 717 718
+23 -1
tools/include/uapi/linux/mman.h
··· 1 1 #ifndef _UAPI_LINUX_MMAN_H 2 2 #define _UAPI_LINUX_MMAN_H 3 3 4 - #include <uapi/asm/mman.h> 4 + #include <asm/mman.h> 5 + #include <asm-generic/hugetlb_encode.h> 5 6 6 7 #define MREMAP_MAYMOVE 1 7 8 #define MREMAP_FIXED 2 ··· 10 9 #define OVERCOMMIT_GUESS 0 11 10 #define OVERCOMMIT_ALWAYS 1 12 11 #define OVERCOMMIT_NEVER 2 12 + 13 + /* 14 + * Huge page size encoding when MAP_HUGETLB is specified, and a huge page 15 + * size other than the default is desired. See hugetlb_encode.h. 16 + * All known huge page size encodings are provided here. It is the 17 + * responsibility of the application to know which sizes are supported on 18 + * the running system. See mmap(2) man page for details. 19 + */ 20 + #define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT 21 + #define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK 22 + 23 + #define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB 24 + #define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB 25 + #define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB 26 + #define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB 27 + #define MAP_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB 28 + #define MAP_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB 29 + #define MAP_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB 30 + #define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB 31 + #define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB 32 + #define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB 13 33 14 34 #endif /* _UAPI_LINUX_MMAN_H */
+2 -85
tools/perf/MANIFEST
··· 1 1 tools/perf 2 - tools/arch/alpha/include/asm/barrier.h 3 - tools/arch/arm/include/asm/barrier.h 4 - tools/arch/arm64/include/asm/barrier.h 5 - tools/arch/ia64/include/asm/barrier.h 6 - tools/arch/mips/include/asm/barrier.h 7 - tools/arch/powerpc/include/asm/barrier.h 8 - tools/arch/s390/include/asm/barrier.h 9 - tools/arch/sh/include/asm/barrier.h 10 - tools/arch/sparc/include/asm/barrier.h 11 - tools/arch/sparc/include/asm/barrier_32.h 12 - tools/arch/sparc/include/asm/barrier_64.h 13 - tools/arch/tile/include/asm/barrier.h 14 - tools/arch/x86/include/asm/barrier.h 15 - tools/arch/x86/include/asm/cmpxchg.h 16 - tools/arch/x86/include/asm/cpufeatures.h 17 - tools/arch/x86/include/asm/disabled-features.h 18 - tools/arch/x86/include/asm/required-features.h 19 - tools/arch/x86/include/uapi/asm/svm.h 20 - tools/arch/x86/include/uapi/asm/vmx.h 21 - tools/arch/x86/include/uapi/asm/kvm.h 22 - tools/arch/x86/include/uapi/asm/kvm_perf.h 23 - tools/arch/x86/lib/memcpy_64.S 24 - tools/arch/x86/lib/memset_64.S 25 - tools/arch/s390/include/uapi/asm/kvm_perf.h 26 - tools/arch/s390/include/uapi/asm/sie.h 27 - tools/arch/xtensa/include/asm/barrier.h 2 + tools/arch 28 3 tools/scripts 29 4 tools/build 30 - tools/arch/x86/include/asm/atomic.h 31 - tools/arch/x86/include/asm/rmwcc.h 5 + tools/include 32 6 tools/lib/traceevent 33 7 tools/lib/api 34 8 tools/lib/bpf ··· 16 42 tools/lib/bitmap.c 17 43 tools/lib/str_error_r.c 18 44 tools/lib/vsprintf.c 19 - tools/include/asm/alternative-asm.h 20 - tools/include/asm/atomic.h 21 - tools/include/asm/barrier.h 22 - tools/include/asm/bug.h 23 - tools/include/asm-generic/atomic-gcc.h 24 - tools/include/asm-generic/barrier.h 25 - tools/include/asm-generic/bitops/arch_hweight.h 26 - tools/include/asm-generic/bitops/atomic.h 27 - tools/include/asm-generic/bitops/const_hweight.h 28 - tools/include/asm-generic/bitops/__ffs.h 29 - tools/include/asm-generic/bitops/__ffz.h 30 - tools/include/asm-generic/bitops/__fls.h 31 - tools/include/asm-generic/bitops/find.h 32 - tools/include/asm-generic/bitops/fls64.h 33 - tools/include/asm-generic/bitops/fls.h 34 - tools/include/asm-generic/bitops/hweight.h 35 - tools/include/asm-generic/bitops.h 36 - tools/include/linux/atomic.h 37 - tools/include/linux/bitops.h 38 - tools/include/linux/compiler.h 39 - tools/include/linux/compiler-gcc.h 40 - tools/include/linux/coresight-pmu.h 41 - tools/include/linux/bug.h 42 - tools/include/linux/filter.h 43 - tools/include/linux/hash.h 44 - tools/include/linux/kernel.h 45 - tools/include/linux/list.h 46 - tools/include/linux/log2.h 47 - tools/include/uapi/asm-generic/fcntl.h 48 - tools/include/uapi/asm-generic/ioctls.h 49 - tools/include/uapi/asm-generic/mman-common.h 50 - tools/include/uapi/asm-generic/mman.h 51 - tools/include/uapi/drm/drm.h 52 - tools/include/uapi/drm/i915_drm.h 53 - tools/include/uapi/linux/bpf.h 54 - tools/include/uapi/linux/bpf_common.h 55 - tools/include/uapi/linux/fcntl.h 56 - tools/include/uapi/linux/hw_breakpoint.h 57 - tools/include/uapi/linux/kvm.h 58 - tools/include/uapi/linux/mman.h 59 - tools/include/uapi/linux/perf_event.h 60 - tools/include/uapi/linux/sched.h 61 - tools/include/uapi/linux/stat.h 62 - tools/include/uapi/linux/vhost.h 63 - tools/include/uapi/sound/asound.h 64 - tools/include/linux/poison.h 65 - tools/include/linux/rbtree.h 66 - tools/include/linux/rbtree_augmented.h 67 - tools/include/linux/refcount.h 68 - tools/include/linux/string.h 69 - tools/include/linux/stringify.h 70 - tools/include/linux/types.h 71 - tools/include/linux/err.h 72 - tools/include/linux/bitmap.h 73 - tools/include/linux/time64.h 74 - tools/arch/*/include/uapi/asm/mman.h 75 - tools/arch/*/include/uapi/asm/perf_regs.h
-1
tools/perf/arch/s390/util/Build
··· 1 1 libperf-y += header.o 2 - libperf-y += sym-handling.o 3 2 libperf-y += kvm-stat.o 4 3 5 4 libperf-$(CONFIG_DWARF) += dwarf-regs.o
-29
tools/perf/arch/s390/util/sym-handling.c
··· 1 - /* 2 - * Architecture specific ELF symbol handling and relocation mapping. 3 - * 4 - * Copyright 2017 IBM Corp. 5 - * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com> 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 (version 2 only) 9 - * as published by the Free Software Foundation. 10 - */ 11 - 12 - #include "symbol.h" 13 - 14 - #ifdef HAVE_LIBELF_SUPPORT 15 - bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) 16 - { 17 - if (ehdr.e_type == ET_EXEC) 18 - return false; 19 - return ehdr.e_type == ET_REL || ehdr.e_type == ET_DYN; 20 - } 21 - 22 - void arch__adjust_sym_map_offset(GElf_Sym *sym, 23 - GElf_Shdr *shdr __maybe_unused, 24 - struct map *map) 25 - { 26 - if (map->type == MAP__FUNCTION) 27 - sym->st_value += map->start; 28 - } 29 - #endif
+21 -14
tools/perf/util/callchain.c
··· 65 65 callchain_param.mode = CHAIN_FOLDED; 66 66 return 0; 67 67 } 68 - 69 - pr_err("Invalid callchain mode: %s\n", value); 70 68 return -1; 71 69 } 72 70 ··· 80 82 callchain_param.order_set = true; 81 83 return 0; 82 84 } 83 - 84 - pr_err("Invalid callchain order: %s\n", value); 85 85 return -1; 86 86 } 87 87 ··· 101 105 callchain_param.branch_callstack = 1; 102 106 return 0; 103 107 } 104 - 105 - pr_err("Invalid callchain sort key: %s\n", value); 106 108 return -1; 107 109 } 108 110 ··· 118 124 callchain_param.value = CCVAL_COUNT; 119 125 return 0; 120 126 } 121 - 122 - pr_err("Invalid callchain config key: %s\n", value); 123 127 return -1; 124 128 } 125 129 ··· 311 319 312 320 return ret; 313 321 } 314 - if (!strcmp(var, "print-type")) 315 - return parse_callchain_mode(value); 316 - if (!strcmp(var, "order")) 317 - return parse_callchain_order(value); 318 - if (!strcmp(var, "sort-key")) 319 - return parse_callchain_sort_key(value); 322 + if (!strcmp(var, "print-type")){ 323 + int ret; 324 + ret = parse_callchain_mode(value); 325 + if (ret == -1) 326 + pr_err("Invalid callchain mode: %s\n", value); 327 + return ret; 328 + } 329 + if (!strcmp(var, "order")){ 330 + int ret; 331 + ret = parse_callchain_order(value); 332 + if (ret == -1) 333 + pr_err("Invalid callchain order: %s\n", value); 334 + return ret; 335 + } 336 + if (!strcmp(var, "sort-key")){ 337 + int ret; 338 + ret = parse_callchain_sort_key(value); 339 + if (ret == -1) 340 + pr_err("Invalid callchain sort key: %s\n", value); 341 + return ret; 342 + } 320 343 if (!strcmp(var, "threshold")) { 321 344 callchain_param.min_percent = strtod(value, &endptr); 322 345 if (value == endptr) {
+6 -1
tools/perf/util/evsel.c
··· 271 271 return evsel; 272 272 } 273 273 274 + static bool perf_event_can_profile_kernel(void) 275 + { 276 + return geteuid() == 0 || perf_event_paranoid() == -1; 277 + } 278 + 274 279 struct perf_evsel *perf_evsel__new_cycles(bool precise) 275 280 { 276 281 struct perf_event_attr attr = { 277 282 .type = PERF_TYPE_HARDWARE, 278 283 .config = PERF_COUNT_HW_CPU_CYCLES, 279 - .exclude_kernel = geteuid() != 0, 284 + .exclude_kernel = !perf_event_can_profile_kernel(), 280 285 }; 281 286 struct perf_evsel *evsel; 282 287
+1 -7
tools/perf/util/symbol-elf.c
··· 810 810 void __weak arch__sym_update(struct symbol *s __maybe_unused, 811 811 GElf_Sym *sym __maybe_unused) { } 812 812 813 - void __weak arch__adjust_sym_map_offset(GElf_Sym *sym, GElf_Shdr *shdr, 814 - struct map *map __maybe_unused) 815 - { 816 - sym->st_value -= shdr->sh_addr - shdr->sh_offset; 817 - } 818 - 819 813 int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, 820 814 struct symsrc *runtime_ss, int kmodule) 821 815 { ··· 990 996 991 997 /* Adjust symbol to map to file offset */ 992 998 if (adjust_kernel_syms) 993 - arch__adjust_sym_map_offset(&sym, &shdr, map); 999 + sym.st_value -= shdr.sh_addr - shdr.sh_offset; 994 1000 995 1001 if (strcmp(section_name, 996 1002 (curr_dso->short_name +
-3
tools/perf/util/symbol.h
··· 344 344 #ifdef HAVE_LIBELF_SUPPORT 345 345 bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); 346 346 void arch__sym_update(struct symbol *s, GElf_Sym *sym); 347 - void arch__adjust_sym_map_offset(GElf_Sym *sym, 348 - GElf_Shdr *shdr __maybe_unused, 349 - struct map *map __maybe_unused); 350 347 #endif 351 348 352 349 #define SYMBOL_A 0
+1 -1
tools/perf/util/syscalltbl.c
··· 15 15 16 16 #include "syscalltbl.h" 17 17 #include <stdlib.h> 18 + #include <linux/compiler.h> 18 19 19 20 #ifdef HAVE_SYSCALL_TABLE 20 - #include <linux/compiler.h> 21 21 #include <string.h> 22 22 #include "string2.h" 23 23 #include "util.h"