Skip to content

Commit b5b65f1

Browse files
committed
Merge tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull more perf tools updates from Arnaldo Carvalho de Melo: - Add missing fields and remove some duplicate fields when printing a perf_event_attr. - Fix hybrid config terms list corruption. - Update kernel header copies, some resulted in new kernel features being automagically added to 'perf trace' syscall/tracepoint argument id->string translators. - Add a file generated during the documentation build to .gitignore. - Add an option to build without libbfd, as some distros, like Debian consider its ABI unstable. - Add support to print a textual representation of IBS raw sample data in 'perf report'. - Fix bpf 'perf test' sample mismatch reporting - Fix passing arguments to stackcollapse report in a 'perf script' python script. - Allow build-id with trailing zeros. - Look for ImageBase in PE file to compute .text offset. * tag 'perf-tools-for-v5.15-2021-09-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (25 commits) tools headers UAPI: Update tools's copy of drm.h headers tools headers UAPI: Sync drm/i915_drm.h with the kernel sources tools headers UAPI: Sync linux/fs.h with the kernel sources tools headers UAPI: Sync linux/in.h copy with the kernel sources perf tools: Add an option to build without libbfd perf tools: Allow build-id with trailing zeros perf tools: Fix hybrid config terms list corruption perf tools: Factor out copy_config_terms() and free_config_terms() perf tools: Fix perf_event_attr__fprintf() missing/dupl. fields perf tools: Ignore Documentation dependency file perf bpf: Provide a weak btf__load_from_kernel_by_id() for older libbpf versions tools include UAPI: Update linux/mount.h copy perf beauty: Cover more flags in the move_mount syscall argument beautifier tools headers UAPI: Sync linux/prctl.h with the kernel sources tools include UAPI: Sync sound/asound.h copy with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources perf report: Add support to print a textual representation of IBS raw sample data perf report: Add tools/arch/x86/include/asm/amd-ibs.h perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings ...
2 parents c3e4687 + 17a99e5 commit b5b65f1

File tree

36 files changed

+1147
-175
lines changed

36 files changed

+1147
-175
lines changed

tools/arch/x86/include/asm/amd-ibs.h

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* From PPR Vol 1 for AMD Family 19h Model 01h B1
4+
* 55898 Rev 0.35 - Feb 5, 2021
5+
*/
6+
7+
#include "msr-index.h"
8+
9+
/*
10+
* IBS Hardware MSRs
11+
*/
12+
13+
/* MSR 0xc0011030: IBS Fetch Control */
14+
union ibs_fetch_ctl {
15+
__u64 val;
16+
struct {
17+
__u64 fetch_maxcnt:16,/* 0-15: instruction fetch max. count */
18+
fetch_cnt:16, /* 16-31: instruction fetch count */
19+
fetch_lat:16, /* 32-47: instruction fetch latency */
20+
fetch_en:1, /* 48: instruction fetch enable */
21+
fetch_val:1, /* 49: instruction fetch valid */
22+
fetch_comp:1, /* 50: instruction fetch complete */
23+
ic_miss:1, /* 51: i-cache miss */
24+
phy_addr_valid:1,/* 52: physical address valid */
25+
l1tlb_pgsz:2, /* 53-54: i-cache L1TLB page size
26+
* (needs IbsPhyAddrValid) */
27+
l1tlb_miss:1, /* 55: i-cache fetch missed in L1TLB */
28+
l2tlb_miss:1, /* 56: i-cache fetch missed in L2TLB */
29+
rand_en:1, /* 57: random tagging enable */
30+
fetch_l2_miss:1,/* 58: L2 miss for sampled fetch
31+
* (needs IbsFetchComp) */
32+
reserved:5; /* 59-63: reserved */
33+
};
34+
};
35+
36+
/* MSR 0xc0011033: IBS Execution Control */
37+
union ibs_op_ctl {
38+
__u64 val;
39+
struct {
40+
__u64 opmaxcnt:16, /* 0-15: periodic op max. count */
41+
reserved0:1, /* 16: reserved */
42+
op_en:1, /* 17: op sampling enable */
43+
op_val:1, /* 18: op sample valid */
44+
cnt_ctl:1, /* 19: periodic op counter control */
45+
opmaxcnt_ext:7, /* 20-26: upper 7 bits of periodic op maximum count */
46+
reserved1:5, /* 27-31: reserved */
47+
opcurcnt:27, /* 32-58: periodic op counter current count */
48+
reserved2:5; /* 59-63: reserved */
49+
};
50+
};
51+
52+
/* MSR 0xc0011035: IBS Op Data 2 */
53+
union ibs_op_data {
54+
__u64 val;
55+
struct {
56+
__u64 comp_to_ret_ctr:16, /* 0-15: op completion to retire count */
57+
tag_to_ret_ctr:16, /* 15-31: op tag to retire count */
58+
reserved1:2, /* 32-33: reserved */
59+
op_return:1, /* 34: return op */
60+
op_brn_taken:1, /* 35: taken branch op */
61+
op_brn_misp:1, /* 36: mispredicted branch op */
62+
op_brn_ret:1, /* 37: branch op retired */
63+
op_rip_invalid:1, /* 38: RIP is invalid */
64+
op_brn_fuse:1, /* 39: fused branch op */
65+
op_microcode:1, /* 40: microcode op */
66+
reserved2:23; /* 41-63: reserved */
67+
};
68+
};
69+
70+
/* MSR 0xc0011036: IBS Op Data 2 */
71+
union ibs_op_data2 {
72+
__u64 val;
73+
struct {
74+
__u64 data_src:3, /* 0-2: data source */
75+
reserved0:1, /* 3: reserved */
76+
rmt_node:1, /* 4: destination node */
77+
cache_hit_st:1, /* 5: cache hit state */
78+
reserved1:57; /* 5-63: reserved */
79+
};
80+
};
81+
82+
/* MSR 0xc0011037: IBS Op Data 3 */
83+
union ibs_op_data3 {
84+
__u64 val;
85+
struct {
86+
__u64 ld_op:1, /* 0: load op */
87+
st_op:1, /* 1: store op */
88+
dc_l1tlb_miss:1, /* 2: data cache L1TLB miss */
89+
dc_l2tlb_miss:1, /* 3: data cache L2TLB hit in 2M page */
90+
dc_l1tlb_hit_2m:1, /* 4: data cache L1TLB hit in 2M page */
91+
dc_l1tlb_hit_1g:1, /* 5: data cache L1TLB hit in 1G page */
92+
dc_l2tlb_hit_2m:1, /* 6: data cache L2TLB hit in 2M page */
93+
dc_miss:1, /* 7: data cache miss */
94+
dc_mis_acc:1, /* 8: misaligned access */
95+
reserved:4, /* 9-12: reserved */
96+
dc_wc_mem_acc:1, /* 13: write combining memory access */
97+
dc_uc_mem_acc:1, /* 14: uncacheable memory access */
98+
dc_locked_op:1, /* 15: locked operation */
99+
dc_miss_no_mab_alloc:1, /* 16: DC miss with no MAB allocated */
100+
dc_lin_addr_valid:1, /* 17: data cache linear address valid */
101+
dc_phy_addr_valid:1, /* 18: data cache physical address valid */
102+
dc_l2_tlb_hit_1g:1, /* 19: data cache L2 hit in 1GB page */
103+
l2_miss:1, /* 20: L2 cache miss */
104+
sw_pf:1, /* 21: software prefetch */
105+
op_mem_width:4, /* 22-25: load/store size in bytes */
106+
op_dc_miss_open_mem_reqs:6, /* 26-31: outstanding mem reqs on DC fill */
107+
dc_miss_lat:16, /* 32-47: data cache miss latency */
108+
tlb_refill_lat:16; /* 48-63: L1 TLB refill latency */
109+
};
110+
};
111+
112+
/* MSR 0xc001103c: IBS Fetch Control Extended */
113+
union ic_ibs_extd_ctl {
114+
__u64 val;
115+
struct {
116+
__u64 itlb_refill_lat:16, /* 0-15: ITLB Refill latency for sampled fetch */
117+
reserved:48; /* 16-63: reserved */
118+
};
119+
};
120+
121+
/*
122+
* IBS driver related
123+
*/
124+
125+
struct perf_ibs_data {
126+
u32 size;
127+
union {
128+
u32 data[0]; /* data buffer starts here */
129+
u32 caps;
130+
};
131+
u64 regs[MSR_AMD64_IBS_REG_COUNT_MAX];
132+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ struct kvm_debug_exit_arch {
295295
#define KVM_GUESTDBG_USE_HW_BP 0x00020000
296296
#define KVM_GUESTDBG_INJECT_DB 0x00040000
297297
#define KVM_GUESTDBG_INJECT_BP 0x00080000
298+
#define KVM_GUESTDBG_BLOCKIRQ 0x00100000
298299

299300
/* for KVM_SET_GUEST_DEBUG */
300301
struct kvm_guest_debug_arch {

tools/include/uapi/asm-generic/unistd.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -673,15 +673,15 @@ __SYSCALL(__NR_madvise, sys_madvise)
673673
#define __NR_remap_file_pages 234
674674
__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
675675
#define __NR_mbind 235
676-
__SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)
676+
__SYSCALL(__NR_mbind, sys_mbind)
677677
#define __NR_get_mempolicy 236
678-
__SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy)
678+
__SYSCALL(__NR_get_mempolicy, sys_get_mempolicy)
679679
#define __NR_set_mempolicy 237
680-
__SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy)
680+
__SYSCALL(__NR_set_mempolicy, sys_set_mempolicy)
681681
#define __NR_migrate_pages 238
682-
__SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages)
682+
__SYSCALL(__NR_migrate_pages, sys_migrate_pages)
683683
#define __NR_move_pages 239
684-
__SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)
684+
__SYSCALL(__NR_move_pages, sys_move_pages)
685685
#endif
686686

687687
#define __NR_rt_tgsigqueueinfo 240
@@ -877,9 +877,11 @@ __SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
877877
#define __NR_memfd_secret 447
878878
__SYSCALL(__NR_memfd_secret, sys_memfd_secret)
879879
#endif
880+
#define __NR_process_mrelease 448
881+
__SYSCALL(__NR_process_mrelease, sys_process_mrelease)
880882

881883
#undef __NR_syscalls
882-
#define __NR_syscalls 448
884+
#define __NR_syscalls 449
883885

884886
/*
885887
* 32 bit systems traditionally used different

tools/include/uapi/drm/drm.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ struct drm_gem_open {
635635
/**
636636
* DRM_CAP_VBLANK_HIGH_CRTC
637637
*
638-
* If set to 1, the kernel supports specifying a CRTC index in the high bits of
639-
* &drm_wait_vblank_request.type.
638+
* If set to 1, the kernel supports specifying a :ref:`CRTC index<crtc_index>`
639+
* in the high bits of &drm_wait_vblank_request.type.
640640
*
641641
* Starting kernel version 2.6.39, this capability is always set to 1.
642642
*/
@@ -1050,6 +1050,16 @@ extern "C" {
10501050
#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
10511051
#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
10521052
#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
1053+
/**
1054+
* DRM_IOCTL_MODE_RMFB - Remove a framebuffer.
1055+
*
1056+
* This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
1057+
* argument is a framebuffer object ID.
1058+
*
1059+
* Warning: removing a framebuffer currently in-use on an enabled plane will
1060+
* disable that plane. The CRTC the plane is linked to may also be disabled
1061+
* (depending on driver capabilities).
1062+
*/
10531063
#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
10541064
#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
10551065
#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)

0 commit comments

Comments
 (0)