Skip to content

Commit

Permalink
Merge tag 'perf-tools-fixes-for-v5.17-2022-02-24' of git://git.kernel…
Browse files Browse the repository at this point in the history
….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
  • Loading branch information
torvalds committed Feb 24, 2022
2 parents 1f840c0 + 13e741b commit 7ee0225
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
1 change: 1 addition & 0 deletions tools/arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@
#define MSR_AMD64_ICIBSEXTDCTL 0xc001103c
#define MSR_AMD64_IBSOPDATA4 0xc001103d
#define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */
#define MSR_AMD64_SVM_AVIC_DOORBELL 0xc001011b
#define MSR_AMD64_VM_PAGE_FLUSH 0xc001011e
#define MSR_AMD64_SEV_ES_GHCB 0xc0010130
#define MSR_AMD64_SEV 0xc0010131
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-script.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
return -EINVAL;

if (PRINT_FIELD(WEIGHT) &&
evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT))
evsel__do_check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT, allow_user_set))
return -EINVAL;

if (PRINT_FIELD(SYM) &&
Expand Down
15 changes: 1 addition & 14 deletions tools/perf/tests/sigtrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@
#include "tests.h"
#include "../perf-sys.h"

/*
* PowerPC and S390 do not support creation of instruction breakpoints using the
* perf_event interface.
*
* Just disable the test for these architectures until these issues are
* resolved.
*/
#if defined(__powerpc__) || defined(__s390x__)
#define BP_ACCOUNT_IS_SUPPORTED 0
#else
#define BP_ACCOUNT_IS_SUPPORTED 1
#endif

#define NUM_THREADS 5

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

if (!BP_ACCOUNT_IS_SUPPORTED) {
if (!BP_SIGNAL_IS_SUPPORTED) {
pr_debug("Test not supported on this architecture");
return TEST_SKIP;
}
Expand Down
7 changes: 3 additions & 4 deletions tools/perf/util/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ int perf_data__create_dir(struct perf_data *data, int nr)
if (!files)
return -ENOMEM;

data->dir.version = PERF_DIR_VERSION;
data->dir.files = files;
data->dir.nr = nr;

for (i = 0; i < nr; i++) {
struct perf_data_file *file = &files[i];

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

data->dir.version = PERF_DIR_VERSION;
data->dir.files = files;
data->dir.nr = nr;
return 0;

out_err:
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/util/evlist-hybrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ int evlist__fix_hybrid_cpus(struct evlist *evlist, const char *cpu_list)
perf_cpu_map__put(matched_cpus);
perf_cpu_map__put(unmatched_cpus);
}

ret = (unmatched_count == events_nr) ? -1 : 0;
if (events_nr)
ret = (unmatched_count == events_nr) ? -1 : 0;
out:
perf_cpu_map__put(cpus);
return ret;
Expand Down

0 comments on commit 7ee0225

Please sign in to comment.