Skip to content

Commit b229b6c

Browse files
committed
Merge tag 'perf-tools-fixes-for-v6.1-2022-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tool fixes from Arnaldo Carvalho de Melo: - Fix some aspects of building with an older (than the one in the kernel sources) libbpf present in a distro, when building with LIBBPF_DYNAMIC=1. - Fix errno setting races with event_fd and the signal handler in 'perf record'. - Fix Power10 hv-24x7 metric events when some events may have a zero count based on system configuration. - Do not fail Intel-PT misc test w/o libpython, just skip it. - Fix incorrect arm64 Hisi hip08 L3 metrics (IF_BP_MISP_BR_RET, IF_BP_MISP_BR_RET, IF_BP_MISP_BR_BL) due to mistakes in the documentation used to generate the JSON files for these metrics. - Fix auxtrace (Intel PT, ARM Coresight) address filter symbol name match for modules, we need to skip the module name. - Sync copies of files with the kernel sources, including ppc syscall tables and assorted headers, some resulting in tools being able to decode new network protocols (IPPROTO_L2TP) and statx masks (STATX_DIOALIGN). - Fix PMU name pai_crypto in the vendor events file (JSON) for s390. - Fix man page build wrt perf-arm-coresight.txt as the build process assumes files starting with 'perf-' are man pages, and this file isn't one. * tag 'perf-tools-fixes-for-v6.1-2022-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf vendor events arm64: Fix incorrect Hisi hip08 L3 metrics perf auxtrace: Fix address filter symbol name match for modules tools headers UAPI: Sync linux/perf_event.h with the kernel sources tools headers cpufeatures: Sync with the kernel sources tools headers uapi: Sync linux/stat.h with the kernel sources tools include UAPI: Sync sound/asound.h copy with the kernel sources tools headers uapi: Update linux/in.h copy tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench' tools headers arm64: Sync arm64's cputype.h with the kernel sources perf test: Do not fail Intel-PT misc test w/o libpython perf list: Fix PMU name pai_crypto in perf list on s390 perf record: Fix event fd races perf bpf: Fix build with libbpf 0.7.0 by checking if bpf_program__set_insns() is available perf bpf: Fix build with libbpf 0.7.0 by adding prototype for bpf_load_program() perf vendor events power10: Fix hv-24x7 metric events perf docs: Fix man page build wrt perf-arm-coresight.txt tools headers UAPI: Sync powerpc syscall tables with the kernel sources
2 parents a271838 + e9229d5 commit b229b6c

File tree

24 files changed

+181
-104
lines changed

24 files changed

+181
-104
lines changed

tools/arch/arm64/include/asm/cputype.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#define ARM_CPU_IMP_FUJITSU 0x46
6161
#define ARM_CPU_IMP_HISI 0x48
6262
#define ARM_CPU_IMP_APPLE 0x61
63+
#define ARM_CPU_IMP_AMPERE 0xC0
6364

6465
#define ARM_CPU_PART_AEM_V8 0xD0F
6566
#define ARM_CPU_PART_FOUNDATION 0xD00
@@ -123,6 +124,8 @@
123124
#define APPLE_CPU_PART_M1_ICESTORM_MAX 0x028
124125
#define APPLE_CPU_PART_M1_FIRESTORM_MAX 0x029
125126

127+
#define AMPERE_CPU_PART_AMPERE1 0xAC3
128+
126129
#define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
127130
#define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
128131
#define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72)
@@ -172,6 +175,7 @@
172175
#define MIDR_APPLE_M1_FIRESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_PRO)
173176
#define MIDR_APPLE_M1_ICESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_MAX)
174177
#define MIDR_APPLE_M1_FIRESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_MAX)
178+
#define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1)
175179

176180
/* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */
177181
#define MIDR_FUJITSU_ERRATUM_010001 MIDR_FUJITSU_A64FX

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
#define X86_FEATURE_SYSCALL32 ( 3*32+14) /* "" syscall in IA32 userspace */
9797
#define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in IA32 userspace */
9898
#define X86_FEATURE_REP_GOOD ( 3*32+16) /* REP microcode works well */
99-
/* FREE! ( 3*32+17) */
99+
#define X86_FEATURE_AMD_LBR_V2 ( 3*32+17) /* AMD Last Branch Record Extension Version 2 */
100100
#define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" LFENCE synchronizes RDTSC */
101101
#define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */
102102
#define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */

tools/arch/x86/lib/memcpy_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* Output:
2828
* rax original destination
2929
*/
30-
SYM_FUNC_START(__memcpy)
30+
SYM_TYPED_FUNC_START(__memcpy)
3131
ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
3232
"jmp memcpy_erms", X86_FEATURE_ERMS
3333

tools/build/Makefile.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ FEATURE_TESTS_EXTRA := \
103103
libbpf-bpf_prog_load \
104104
libbpf-bpf_object__next_program \
105105
libbpf-bpf_object__next_map \
106+
libbpf-bpf_program__set_insns \
106107
libbpf-bpf_create_map \
107108
libpfm4 \
108109
libdebuginfod \

tools/build/feature/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ FILES= \
6363
test-libbpf-bpf_map_create.bin \
6464
test-libbpf-bpf_object__next_program.bin \
6565
test-libbpf-bpf_object__next_map.bin \
66+
test-libbpf-bpf_program__set_insns.bin \
6667
test-libbpf-btf__raw_data.bin \
6768
test-get_cpuid.bin \
6869
test-sdt.bin \
@@ -316,6 +317,9 @@ $(OUTPUT)test-libbpf-bpf_object__next_program.bin:
316317
$(OUTPUT)test-libbpf-bpf_object__next_map.bin:
317318
$(BUILD) -lbpf
318319

320+
$(OUTPUT)test-libbpf-bpf_program__set_insns.bin:
321+
$(BUILD) -lbpf
322+
319323
$(OUTPUT)test-libbpf-btf__raw_data.bin:
320324
$(BUILD) -lbpf
321325

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bpf/libbpf.h>
3+
4+
int main(void)
5+
{
6+
bpf_program__set_insns(NULL /* prog */, NULL /* new_insns */, 0 /* new_insn_cnt */);
7+
return 0;
8+
}

tools/include/uapi/linux/in.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ enum {
6868
#define IPPROTO_PIM IPPROTO_PIM
6969
IPPROTO_COMP = 108, /* Compression Header Protocol */
7070
#define IPPROTO_COMP IPPROTO_COMP
71+
IPPROTO_L2TP = 115, /* Layer 2 Tunnelling Protocol */
72+
#define IPPROTO_L2TP IPPROTO_L2TP
7173
IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
7274
#define IPPROTO_SCTP IPPROTO_SCTP
7375
IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
@@ -188,21 +190,13 @@ struct ip_mreq_source {
188190
};
189191

190192
struct ip_msfilter {
193+
__be32 imsf_multiaddr;
194+
__be32 imsf_interface;
195+
__u32 imsf_fmode;
196+
__u32 imsf_numsrc;
191197
union {
192-
struct {
193-
__be32 imsf_multiaddr_aux;
194-
__be32 imsf_interface_aux;
195-
__u32 imsf_fmode_aux;
196-
__u32 imsf_numsrc_aux;
197-
__be32 imsf_slist[1];
198-
};
199-
struct {
200-
__be32 imsf_multiaddr;
201-
__be32 imsf_interface;
202-
__u32 imsf_fmode;
203-
__u32 imsf_numsrc;
204-
__be32 imsf_slist_flex[];
205-
};
198+
__be32 imsf_slist[1];
199+
__DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
206200
};
207201
};
208202

tools/include/uapi/linux/perf_event.h

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ enum perf_event_sample_format {
164164
PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24,
165165

166166
PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */
167-
168-
__PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
169167
};
170168

171169
#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)
@@ -263,6 +261,17 @@ enum {
263261
PERF_BR_MAX,
264262
};
265263

264+
/*
265+
* Common branch speculation outcome classification
266+
*/
267+
enum {
268+
PERF_BR_SPEC_NA = 0, /* Not available */
269+
PERF_BR_SPEC_WRONG_PATH = 1, /* Speculative but on wrong path */
270+
PERF_BR_NON_SPEC_CORRECT_PATH = 2, /* Non-speculative but on correct path */
271+
PERF_BR_SPEC_CORRECT_PATH = 3, /* Speculative and on correct path */
272+
PERF_BR_SPEC_MAX,
273+
};
274+
266275
enum {
267276
PERF_BR_NEW_FAULT_ALGN = 0, /* Alignment fault */
268277
PERF_BR_NEW_FAULT_DATA = 1, /* Data fault */
@@ -282,11 +291,11 @@ enum {
282291
PERF_BR_PRIV_HV = 3,
283292
};
284293

285-
#define PERF_BR_ARM64_FIQ PERF_BR_NEW_ARCH_1
286-
#define PERF_BR_ARM64_DEBUG_HALT PERF_BR_NEW_ARCH_2
287-
#define PERF_BR_ARM64_DEBUG_EXIT PERF_BR_NEW_ARCH_3
288-
#define PERF_BR_ARM64_DEBUG_INST PERF_BR_NEW_ARCH_4
289-
#define PERF_BR_ARM64_DEBUG_DATA PERF_BR_NEW_ARCH_5
294+
#define PERF_BR_ARM64_FIQ PERF_BR_NEW_ARCH_1
295+
#define PERF_BR_ARM64_DEBUG_HALT PERF_BR_NEW_ARCH_2
296+
#define PERF_BR_ARM64_DEBUG_EXIT PERF_BR_NEW_ARCH_3
297+
#define PERF_BR_ARM64_DEBUG_INST PERF_BR_NEW_ARCH_4
298+
#define PERF_BR_ARM64_DEBUG_DATA PERF_BR_NEW_ARCH_5
290299

291300
#define PERF_SAMPLE_BRANCH_PLM_ALL \
292301
(PERF_SAMPLE_BRANCH_USER|\
@@ -1397,6 +1406,7 @@ union perf_mem_data_src {
13971406
* abort: aborting a hardware transaction
13981407
* cycles: cycles from last branch (or 0 if not supported)
13991408
* type: branch type
1409+
* spec: branch speculation info (or 0 if not supported)
14001410
*/
14011411
struct perf_branch_entry {
14021412
__u64 from;
@@ -1407,9 +1417,10 @@ struct perf_branch_entry {
14071417
abort:1, /* transaction abort */
14081418
cycles:16, /* cycle count to last branch */
14091419
type:4, /* branch type */
1420+
spec:2, /* branch speculation info */
14101421
new_type:4, /* additional branch type */
14111422
priv:3, /* privilege level */
1412-
reserved:33;
1423+
reserved:31;
14131424
};
14141425

14151426
union perf_sample_weight {

tools/include/uapi/linux/stat.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ struct statx {
124124
__u32 stx_dev_minor;
125125
/* 0x90 */
126126
__u64 stx_mnt_id;
127-
__u64 __spare2;
127+
__u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */
128+
__u32 stx_dio_offset_align; /* File offset alignment for direct I/O */
128129
/* 0xa0 */
129130
__u64 __spare3[12]; /* Spare space for future expansion */
130131
/* 0x100 */
@@ -152,6 +153,7 @@ struct statx {
152153
#define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */
153154
#define STATX_BTIME 0x00000800U /* Want/got stx_btime */
154155
#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
156+
#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
155157

156158
#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
157159

tools/include/uapi/sound/asound.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33
* Advanced Linux Sound Architecture - ALSA - Driver
44
* Copyright (c) 1994-2003 by Jaroslav Kysela <[email protected]>,
55
* Abramo Bagnara <[email protected]>
6-
*
7-
*
8-
* This program is free software; you can redistribute it and/or modify
9-
* it under the terms of the GNU General Public License as published by
10-
* the Free Software Foundation; either version 2 of the License, or
11-
* (at your option) any later version.
12-
*
13-
* This program is distributed in the hope that it will be useful,
14-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16-
* GNU General Public License for more details.
17-
*
18-
* You should have received a copy of the GNU General Public License
19-
* along with this program; if not, write to the Free Software
20-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21-
*
226
*/
237

248
#ifndef _UAPI__SOUND_ASOUND_H

0 commit comments

Comments
 (0)