Skip to content

Commit e99bc91

Browse files
committed
Merge tag 'perf-urgent-2020-03-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Thomas Gleixner: "A pile of perf fixes: Kernel side: - AMD uncore driver: Replace the open coded sanity check with the core variant, which provides the correct error code and also leaves a hint in dmesg Tooling: - Fix the stdio input handling with glibc versions >= 2.28 - Unbreak the futex-wake benchmark which was reduced to 0 test threads due to the conversion to cpumaps - Initialize sigaction structs before invoking sys_sigactio() - Plug the mapfile memory leak in perf jevents - Fix off by one relative directory includes - Fix an undefined string comparison in perf diff" * tag 'perf-urgent-2020-03-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag tools: Fix off-by 1 relative directory includes perf jevents: Fix leak of mapfile memory perf bench: Clear struct sigaction before sigaction() syscall perf bench futex-wake: Restore thread count default to online CPU count perf top: Fix stdio interface input handling with glibc 2.28+ perf diff: Fix undefined string comparision spotted by clang's -Wstring-compare perf symbols: Don't try to find a vmlinux file when looking for kernel modules perf bench: Share some global variables to fix build with gcc 10 perf parse-events: Use asprintf() instead of strncpy() to read tracepoint files perf env: Do not return pointers to local variables perf tests bp_account: Make global variable static
2 parents ffe6da9 + f967140 commit e99bc91

30 files changed

+139
-134
lines changed

arch/x86/events/amd/uncore.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,12 @@ static int amd_uncore_event_init(struct perf_event *event)
190190

191191
/*
192192
* NB and Last level cache counters (MSRs) are shared across all cores
193-
* that share the same NB / Last level cache. Interrupts can be directed
194-
* to a single target core, however, event counts generated by processes
195-
* running on other cores cannot be masked out. So we do not support
196-
* sampling and per-thread events.
193+
* that share the same NB / Last level cache. On family 16h and below,
194+
* Interrupts can be directed to a single target core, however, event
195+
* counts generated by processes running on other cores cannot be masked
196+
* out. So we do not support sampling and per-thread events via
197+
* CAP_NO_INTERRUPT, and we do not enable counter overflow interrupts:
197198
*/
198-
if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
199-
return -EINVAL;
200-
201-
/* and we do not enable counter overflow interrupts */
202199
hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;
203200
hwc->idx = -1;
204201

@@ -306,7 +303,7 @@ static struct pmu amd_nb_pmu = {
306303
.start = amd_uncore_start,
307304
.stop = amd_uncore_stop,
308305
.read = amd_uncore_read,
309-
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
306+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT,
310307
};
311308

312309
static struct pmu amd_llc_pmu = {
@@ -317,7 +314,7 @@ static struct pmu amd_llc_pmu = {
317314
.start = amd_uncore_start,
318315
.stop = amd_uncore_stop,
319316
.read = amd_uncore_read,
320-
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
317+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT,
321318
};
322319

323320
static struct amd_uncore *amd_uncore_alloc(unsigned int cpu)

tools/include/uapi/asm/errno.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
#if defined(__i386__) || defined(__x86_64__)
3-
#include "../../arch/x86/include/uapi/asm/errno.h"
3+
#include "../../../arch/x86/include/uapi/asm/errno.h"
44
#elif defined(__powerpc__)
5-
#include "../../arch/powerpc/include/uapi/asm/errno.h"
5+
#include "../../../arch/powerpc/include/uapi/asm/errno.h"
66
#elif defined(__sparc__)
7-
#include "../../arch/sparc/include/uapi/asm/errno.h"
7+
#include "../../../arch/sparc/include/uapi/asm/errno.h"
88
#elif defined(__alpha__)
9-
#include "../../arch/alpha/include/uapi/asm/errno.h"
9+
#include "../../../arch/alpha/include/uapi/asm/errno.h"
1010
#elif defined(__mips__)
11-
#include "../../arch/mips/include/uapi/asm/errno.h"
11+
#include "../../../arch/mips/include/uapi/asm/errno.h"
1212
#elif defined(__ia64__)
13-
#include "../../arch/ia64/include/uapi/asm/errno.h"
13+
#include "../../../arch/ia64/include/uapi/asm/errno.h"
1414
#elif defined(__xtensa__)
15-
#include "../../arch/xtensa/include/uapi/asm/errno.h"
15+
#include "../../../arch/xtensa/include/uapi/asm/errno.h"
1616
#else
1717
#include <asm-generic/errno.h>
1818
#endif

tools/perf/arch/arm64/util/arm-spe.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
#include <linux/zalloc.h>
1212
#include <time.h>
1313

14-
#include "../../util/cpumap.h"
15-
#include "../../util/event.h"
16-
#include "../../util/evsel.h"
17-
#include "../../util/evlist.h"
18-
#include "../../util/session.h"
14+
#include "../../../util/cpumap.h"
15+
#include "../../../util/event.h"
16+
#include "../../../util/evsel.h"
17+
#include "../../../util/evlist.h"
18+
#include "../../../util/session.h"
1919
#include <internal/lib.h> // page_size
20-
#include "../../util/pmu.h"
21-
#include "../../util/debug.h"
22-
#include "../../util/auxtrace.h"
23-
#include "../../util/record.h"
24-
#include "../../util/arm-spe.h"
20+
#include "../../../util/pmu.h"
21+
#include "../../../util/debug.h"
22+
#include "../../../util/auxtrace.h"
23+
#include "../../../util/record.h"
24+
#include "../../../util/arm-spe.h"
2525

2626
#define KiB(x) ((x) * 1024)
2727
#define MiB(x) ((x) * 1024 * 1024)

tools/perf/arch/arm64/util/perf_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
2-
#include "../../util/perf_regs.h"
2+
#include "../../../util/perf_regs.h"
33

44
const struct sample_reg sample_reg_masks[] = {
55
SMPL_REG_END

tools/perf/arch/powerpc/util/perf_regs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <regex.h>
55
#include <linux/zalloc.h>
66

7-
#include "../../util/perf_regs.h"
8-
#include "../../util/debug.h"
7+
#include "../../../util/perf_regs.h"
8+
#include "../../../util/debug.h"
99

1010
#include <linux/kernel.h>
1111

tools/perf/arch/x86/util/auxtrace.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#include <errno.h>
88
#include <stdbool.h>
99

10-
#include "../../util/header.h"
11-
#include "../../util/debug.h"
12-
#include "../../util/pmu.h"
13-
#include "../../util/auxtrace.h"
14-
#include "../../util/intel-pt.h"
15-
#include "../../util/intel-bts.h"
16-
#include "../../util/evlist.h"
10+
#include "../../../util/header.h"
11+
#include "../../../util/debug.h"
12+
#include "../../../util/pmu.h"
13+
#include "../../../util/auxtrace.h"
14+
#include "../../../util/intel-pt.h"
15+
#include "../../../util/intel-bts.h"
16+
#include "../../../util/evlist.h"
1717

1818
static
1919
struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist,

tools/perf/arch/x86/util/event.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#include <linux/string.h>
44
#include <linux/zalloc.h>
55

6-
#include "../../util/event.h"
7-
#include "../../util/synthetic-events.h"
8-
#include "../../util/machine.h"
9-
#include "../../util/tool.h"
10-
#include "../../util/map.h"
11-
#include "../../util/debug.h"
6+
#include "../../../util/event.h"
7+
#include "../../../util/synthetic-events.h"
8+
#include "../../../util/machine.h"
9+
#include "../../../util/tool.h"
10+
#include "../../../util/map.h"
11+
#include "../../../util/debug.h"
1212

1313
#if defined(__x86_64__)
1414

tools/perf/arch/x86/util/header.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include <string.h>
88
#include <regex.h>
99

10-
#include "../../util/debug.h"
11-
#include "../../util/header.h"
10+
#include "../../../util/debug.h"
11+
#include "../../../util/header.h"
1212

1313
static inline void
1414
cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,

tools/perf/arch/x86/util/intel-bts.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
#include <linux/log2.h>
1212
#include <linux/zalloc.h>
1313

14-
#include "../../util/cpumap.h"
15-
#include "../../util/event.h"
16-
#include "../../util/evsel.h"
17-
#include "../../util/evlist.h"
18-
#include "../../util/mmap.h"
19-
#include "../../util/session.h"
20-
#include "../../util/pmu.h"
21-
#include "../../util/debug.h"
22-
#include "../../util/record.h"
23-
#include "../../util/tsc.h"
24-
#include "../../util/auxtrace.h"
25-
#include "../../util/intel-bts.h"
14+
#include "../../../util/cpumap.h"
15+
#include "../../../util/event.h"
16+
#include "../../../util/evsel.h"
17+
#include "../../../util/evlist.h"
18+
#include "../../../util/mmap.h"
19+
#include "../../../util/session.h"
20+
#include "../../../util/pmu.h"
21+
#include "../../../util/debug.h"
22+
#include "../../../util/record.h"
23+
#include "../../../util/tsc.h"
24+
#include "../../../util/auxtrace.h"
25+
#include "../../../util/intel-bts.h"
2626
#include <internal/lib.h> // page_size
2727

2828
#define KiB(x) ((x) * 1024)

tools/perf/arch/x86/util/intel-pt.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
#include <linux/zalloc.h>
1414
#include <cpuid.h>
1515

16-
#include "../../util/session.h"
17-
#include "../../util/event.h"
18-
#include "../../util/evlist.h"
19-
#include "../../util/evsel.h"
20-
#include "../../util/evsel_config.h"
21-
#include "../../util/cpumap.h"
22-
#include "../../util/mmap.h"
16+
#include "../../../util/session.h"
17+
#include "../../../util/event.h"
18+
#include "../../../util/evlist.h"
19+
#include "../../../util/evsel.h"
20+
#include "../../../util/evsel_config.h"
21+
#include "../../../util/cpumap.h"
22+
#include "../../../util/mmap.h"
2323
#include <subcmd/parse-options.h>
24-
#include "../../util/parse-events.h"
25-
#include "../../util/pmu.h"
26-
#include "../../util/debug.h"
27-
#include "../../util/auxtrace.h"
28-
#include "../../util/record.h"
29-
#include "../../util/target.h"
30-
#include "../../util/tsc.h"
24+
#include "../../../util/parse-events.h"
25+
#include "../../../util/pmu.h"
26+
#include "../../../util/debug.h"
27+
#include "../../../util/auxtrace.h"
28+
#include "../../../util/record.h"
29+
#include "../../../util/target.h"
30+
#include "../../../util/tsc.h"
3131
#include <internal/lib.h> // page_size
32-
#include "../../util/intel-pt.h"
32+
#include "../../../util/intel-pt.h"
3333

3434
#define KiB(x) ((x) * 1024)
3535
#define MiB(x) ((x) * 1024 * 1024)

0 commit comments

Comments
 (0)