Skip to content

Commit 40c8432

Browse files
committed
Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull more perf tools updates from Arnaldo Carvalho de Melo: - Fix printing 'phys_addr' in 'perf script'. - Fix failure to add events with 'perf probe' in ppc64 due to not removing leading dot (ppc64 ABIv1). - Fix cpu_map__item() python binding building. - Support event alias in form foo-bar-baz, add pmu-events and parse-event tests for it. - No need to setup affinities when starting a workload or attaching to a pid. - Use path__join() to compose a path instead of ad-hoc snprintf() equivalent. - Override attr->sample_period for non-libpfm4 events. - Use libperf cpumap APIs instead of accessing the internal state directly. - Sync x86 arch prctl headers and files changed by the new set_mempolicy_home_node syscall with the kernel sources. - Remove duplicate include in cpumap.h. - Remove redundant err variable. * tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf tools: Remove redundant err variable perf test: Add parse-events test for aliases with hyphens perf test: Add pmu-events test for aliases with hyphens perf parse-events: Support event alias in form foo-bar-baz perf evsel: Override attr->sample_period for non-libpfm4 events perf cpumap: Remove duplicate include in cpumap.h perf cpumap: Migrate to libperf cpumap api perf python: Fix cpu_map__item() building perf script: Fix printing 'phys_addr' failure issue tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall tools headers UAPI: Sync x86 arch prctl headers with the kernel sources perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename) perf evlist: No need to setup affinities when disabling events for pid targets perf evlist: No need to setup affinities when enabling events for pid targets perf stat: No need to setup affinities when starting a workload perf affinity: Allow passing a NULL arg to affinity__cleanup() perf probe: Fix ppc64 'perf probe add events failed' case
2 parents 67bfce0 + f0ac5b8 commit 40c8432

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+354
-149
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
#ifndef _ASM_X86_PRCTL_H
33
#define _ASM_X86_PRCTL_H
44

5-
#define ARCH_SET_GS 0x1001
6-
#define ARCH_SET_FS 0x1002
7-
#define ARCH_GET_FS 0x1003
8-
#define ARCH_GET_GS 0x1004
5+
#define ARCH_SET_GS 0x1001
6+
#define ARCH_SET_FS 0x1002
7+
#define ARCH_GET_FS 0x1003
8+
#define ARCH_GET_GS 0x1004
99

10-
#define ARCH_GET_CPUID 0x1011
11-
#define ARCH_SET_CPUID 0x1012
10+
#define ARCH_GET_CPUID 0x1011
11+
#define ARCH_SET_CPUID 0x1012
1212

13-
#define ARCH_GET_XCOMP_SUPP 0x1021
14-
#define ARCH_GET_XCOMP_PERM 0x1022
15-
#define ARCH_REQ_XCOMP_PERM 0x1023
13+
#define ARCH_GET_XCOMP_SUPP 0x1021
14+
#define ARCH_GET_XCOMP_PERM 0x1022
15+
#define ARCH_REQ_XCOMP_PERM 0x1023
16+
#define ARCH_GET_XCOMP_GUEST_PERM 0x1024
17+
#define ARCH_REQ_XCOMP_GUEST_PERM 0x1025
1618

17-
#define ARCH_MAP_VDSO_X32 0x2001
18-
#define ARCH_MAP_VDSO_32 0x2002
19-
#define ARCH_MAP_VDSO_64 0x2003
19+
#define ARCH_MAP_VDSO_X32 0x2001
20+
#define ARCH_MAP_VDSO_32 0x2002
21+
#define ARCH_MAP_VDSO_64 0x2003
2022

2123
#endif /* _ASM_X86_PRCTL_H */

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,11 @@ __SYSCALL(__NR_process_mrelease, sys_process_mrelease)
883883
#define __NR_futex_waitv 449
884884
__SYSCALL(__NR_futex_waitv, sys_futex_waitv)
885885

886+
#define __NR_set_mempolicy_home_node 450
887+
__SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
888+
886889
#undef __NR_syscalls
887-
#define __NR_syscalls 450
890+
#define __NR_syscalls 451
888891

889892
/*
890893
* 32 bit systems traditionally used different

tools/lib/perf/evsel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus,
141141
}
142142

143143
if (evsel->fd == NULL &&
144-
perf_evsel__alloc_fd(evsel, cpus->nr, threads->nr) < 0)
144+
perf_evsel__alloc_fd(evsel, perf_cpu_map__nr(cpus), threads->nr) < 0)
145145
return -ENOMEM;
146146

147147
perf_cpu_map__for_each_cpu(cpu, idx, cpus) {
@@ -384,7 +384,7 @@ int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter)
384384
{
385385
int err = 0, i;
386386

387-
for (i = 0; i < evsel->cpus->nr && !err; i++)
387+
for (i = 0; i < perf_cpu_map__nr(evsel->cpus) && !err; i++)
388388
err = perf_evsel__run_ioctl(evsel,
389389
PERF_EVENT_IOC_SET_FILTER,
390390
(void *)filter, i);

tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,4 @@
364364
# 447 reserved for memfd_secret
365365
448 n64 process_mrelease sys_process_mrelease
366366
449 n64 futex_waitv sys_futex_waitv
367+
450 common set_mempolicy_home_node sys_set_mempolicy_home_node

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,3 +529,4 @@
529529
# 447 reserved for memfd_secret
530530
448 common process_mrelease sys_process_mrelease
531531
449 common futex_waitv sys_futex_waitv
532+
450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node

tools/perf/arch/s390/entry/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,4 @@
452452
# 447 reserved for memfd_secret
453453
448 common process_mrelease sys_process_mrelease sys_process_mrelease
454454
449 common futex_waitv sys_futex_waitv sys_futex_waitv
455+
450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371
447 common memfd_secret sys_memfd_secret
372372
448 common process_mrelease sys_process_mrelease
373373
449 common futex_waitv sys_futex_waitv
374+
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
374375

375376
#
376377
# Due to a historical design error, certain syscalls are numbered differently

tools/perf/bench/epoll-ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ int bench_epoll_ctl(int argc, const char **argv)
333333

334334
/* default to the number of CPUs */
335335
if (!nthreads)
336-
nthreads = cpu->nr;
336+
nthreads = perf_cpu_map__nr(cpu);
337337

338338
worker = calloc(nthreads, sizeof(*worker));
339339
if (!worker)

tools/perf/bench/epoll-wait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ int bench_epoll_wait(int argc, const char **argv)
452452

453453
/* default to the number of CPUs and leave one for the writer pthread */
454454
if (!nthreads)
455-
nthreads = cpu->nr - 1;
455+
nthreads = perf_cpu_map__nr(cpu) - 1;
456456

457457
worker = calloc(nthreads, sizeof(*worker));
458458
if (!worker) {

tools/perf/bench/evlist-open-close.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int evlist__count_evsel_fds(struct evlist *evlist)
7171
int cnt = 0;
7272

7373
evlist__for_each_entry(evlist, evsel)
74-
cnt += evsel->core.threads->nr * evsel->core.cpus->nr;
74+
cnt += evsel->core.threads->nr * perf_cpu_map__nr(evsel->core.cpus);
7575

7676
return cnt;
7777
}
@@ -151,7 +151,7 @@ static int bench_evlist_open_close__run(char *evstr)
151151

152152
init_stats(&time_stats);
153153

154-
printf(" Number of cpus:\t%d\n", evlist->core.cpus->nr);
154+
printf(" Number of cpus:\t%d\n", perf_cpu_map__nr(evlist->core.cpus));
155155
printf(" Number of threads:\t%d\n", evlist->core.threads->nr);
156156
printf(" Number of events:\t%d (%d fds)\n",
157157
evlist->core.nr_entries, evlist__count_evsel_fds(evlist));

0 commit comments

Comments
 (0)