Skip to content

Commit 7ee0225

Browse files
committed
Merge tag 'perf-tools-fixes-for-v5.17-2022-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix double free in in the error path when opening perf.data from multiple files in a directory instead of from a single file - Sync the msr-index.h copy with the kernel sources - Fix error when printing 'weight' field in 'perf script' - Skip failing sigtrap test for arm+aarch64 in 'perf test' - Fix failure to use a cpu list for uncore events in hybrid systems, e.g. Intel Alder Lake * tag 'perf-tools-fixes-for-v5.17-2022-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf script: Fix error when printing 'weight' field tools arch x86: Sync the msr-index.h copy with the kernel sources perf data: Fix double free in perf_session__delete() perf evlist: Fix failed to use cpu list for uncore events perf test: Skip failing sigtrap test for arm+aarch64
2 parents 1f840c0 + 13e741b commit 7ee0225

5 files changed

Lines changed: 8 additions & 21 deletions

File tree

tools/arch/x86/include/asm/msr-index.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@
476476
#define MSR_AMD64_ICIBSEXTDCTL 0xc001103c
477477
#define MSR_AMD64_IBSOPDATA4 0xc001103d
478478
#define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */
479+
#define MSR_AMD64_SVM_AVIC_DOORBELL 0xc001011b
479480
#define MSR_AMD64_VM_PAGE_FLUSH 0xc001011e
480481
#define MSR_AMD64_SEV_ES_GHCB 0xc0010130
481482
#define MSR_AMD64_SEV 0xc0010131

tools/perf/builtin-script.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
463463
return -EINVAL;
464464

465465
if (PRINT_FIELD(WEIGHT) &&
466-
evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT))
466+
evsel__do_check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT, allow_user_set))
467467
return -EINVAL;
468468

469469
if (PRINT_FIELD(SYM) &&

tools/perf/tests/sigtrap.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@
2222
#include "tests.h"
2323
#include "../perf-sys.h"
2424

25-
/*
26-
* PowerPC and S390 do not support creation of instruction breakpoints using the
27-
* perf_event interface.
28-
*
29-
* Just disable the test for these architectures until these issues are
30-
* resolved.
31-
*/
32-
#if defined(__powerpc__) || defined(__s390x__)
33-
#define BP_ACCOUNT_IS_SUPPORTED 0
34-
#else
35-
#define BP_ACCOUNT_IS_SUPPORTED 1
36-
#endif
37-
3825
#define NUM_THREADS 5
3926

4027
static struct {
@@ -135,7 +122,7 @@ static int test__sigtrap(struct test_suite *test __maybe_unused, int subtest __m
135122
char sbuf[STRERR_BUFSIZE];
136123
int i, fd, ret = TEST_FAIL;
137124

138-
if (!BP_ACCOUNT_IS_SUPPORTED) {
125+
if (!BP_SIGNAL_IS_SUPPORTED) {
139126
pr_debug("Test not supported on this architecture");
140127
return TEST_SKIP;
141128
}

tools/perf/util/data.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ int perf_data__create_dir(struct perf_data *data, int nr)
4444
if (!files)
4545
return -ENOMEM;
4646

47-
data->dir.version = PERF_DIR_VERSION;
48-
data->dir.files = files;
49-
data->dir.nr = nr;
50-
5147
for (i = 0; i < nr; i++) {
5248
struct perf_data_file *file = &files[i];
5349

@@ -62,6 +58,9 @@ int perf_data__create_dir(struct perf_data *data, int nr)
6258
file->fd = ret;
6359
}
6460

61+
data->dir.version = PERF_DIR_VERSION;
62+
data->dir.files = files;
63+
data->dir.nr = nr;
6564
return 0;
6665

6766
out_err:

tools/perf/util/evlist-hybrid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ int evlist__fix_hybrid_cpus(struct evlist *evlist, const char *cpu_list)
154154
perf_cpu_map__put(matched_cpus);
155155
perf_cpu_map__put(unmatched_cpus);
156156
}
157-
158-
ret = (unmatched_count == events_nr) ? -1 : 0;
157+
if (events_nr)
158+
ret = (unmatched_count == events_nr) ? -1 : 0;
159159
out:
160160
perf_cpu_map__put(cpus);
161161
return ret;

0 commit comments

Comments
 (0)