Skip to content

Commit 9c7d619

Browse files
committed
Merge tag 'perf-tools-fixes-for-v5.9-2020-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix infinite loop in the TUI for grouped events in 'perf top/record', eg when using "perf top -e '{cycles,instructions,cache-misses}'". - Fix segfault by skipping side-band event setup if HAVE_LIBBPF_SUPPORT is not set. - Fix synthesized branch stacks generated from CoreSight ETM trace and Intel PT hardware traces. - Fix error when synthesizing events from ARM SPE hardware trace. - The SNOOPX and REMOTE offsets in the data_src bitmask in perf records were were both 37, SNOOPX is 38, fix it. - Fix use of CPU list with summary option in 'perf sched timehist'. - Avoid an uninitialized read when using fake PMUs. - Set perf_event_attr.exclude_guest=1 for user-space counting. - Don't order events when doing a 'perf report -D' raw dump of perf.data records. - Set NULL sentinel in pmu_events table in "Parse and process metrics" 'perf test' - Fix basic bpf filtering 'perf test' on s390x. - Fix out of bounds array access in the 'perf stat' print_counters() evlist method. - Add mwait_idle_with_hints.constprop.0 to the list of idle symbols. - Use %zd for size_t printf formats on 32-bit. - Correct the help info of "perf record --no-bpf-event" option. - Add entries for CoreSight and Arm SPE tooling to MAINTAINERS. * tag 'perf-tools-fixes-for-v5.9-2020-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf report: Disable ordered_events for raw dump perf tools: Correct SNOOPX field offset perf intel-pt: Fix corrupt data after perf inject from perf cs-etm: Fix corrupt data after perf inject from perf top/report: Fix infinite loop in the TUI for grouped events perf parse-events: Avoid an uninitialized read when using fake PMUs perf stat: Fix out of bounds array access in the print_counters() evlist method perf test: Set NULL sentinel in pmu_events table in "Parse and process metrics" test perf parse-events: Set exclude_guest=1 for user-space counting perf record: Correct the help info of option "--no-bpf-event" perf tools: Use %zd for size_t printf formats on 32-bit MAINTAINERS: Add entries for CoreSight and Arm SPE tooling perf: arm-spe: Fix check error when synthesizing events perf symbols: Add mwait_idle_with_hints.constprop.0 to the list of idle symbols perf top: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set perf sched timehist: Fix use of CPU list with summary option perf test: Fix basic bpf filtering test
2 parents dcdfd9c + 977f739 commit 9c7d619

18 files changed

Lines changed: 69 additions & 28 deletions

File tree

MAINTAINERS

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13571,12 +13571,18 @@ F: kernel/events/*
1357113571
F: tools/lib/perf/
1357213572
F: tools/perf/
1357313573

13574-
PERFORMANCE EVENTS SUBSYSTEM ARM64 PMU EVENTS
13574+
PERFORMANCE EVENTS TOOLING ARM64
1357513575
R: John Garry <john.garry@huawei.com>
1357613576
R: Will Deacon <will@kernel.org>
13577+
R: Mathieu Poirier <mathieu.poirier@linaro.org>
13578+
R: Leo Yan <leo.yan@linaro.org>
1357713579
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1357813580
S: Supported
13581+
F: tools/build/feature/test-libopencsd.c
13582+
F: tools/perf/arch/arm*/
1357913583
F: tools/perf/pmu-events/arch/arm64/
13584+
F: tools/perf/util/arm-spe*
13585+
F: tools/perf/util/cs-etm*
1358013586

1358113587
PERSONALITY HANDLING
1358213588
M: Christoph Hellwig <hch@infradead.org>

tools/include/uapi/linux/perf_event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ union perf_mem_data_src {
11961196

11971197
#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
11981198
/* 1 free */
1199-
#define PERF_MEM_SNOOPX_SHIFT 37
1199+
#define PERF_MEM_SNOOPX_SHIFT 38
12001200

12011201
/* locked instruction */
12021202
#define PERF_MEM_LOCK_NA 0x01 /* not available */

tools/perf/builtin-record.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,7 @@ static struct option __record_options[] = {
24522452
OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
24532453
"synthesize non-sample events at the end of output"),
24542454
OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
2455-
OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "record bpf events"),
2455+
OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
24562456
OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
24572457
"Fail if the specified frequency can't be used"),
24582458
OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",

tools/perf/builtin-report.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,9 @@ int cmd_report(int argc, const char **argv)
13321332
if (report.mmaps_mode)
13331333
report.tasks_mode = true;
13341334

1335+
if (dump_trace)
1336+
report.tool.ordered_events = false;
1337+
13351338
if (quiet)
13361339
perf_quiet_option();
13371340

tools/perf/builtin-sched.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,8 @@ static int timehist_sched_change_event(struct perf_tool *tool,
25842584
}
25852585

25862586
if (!sched->idle_hist || thread->tid == 0) {
2587-
timehist_update_runtime_stats(tr, t, tprev);
2587+
if (!cpu_list || test_bit(sample->cpu, cpu_bitmap))
2588+
timehist_update_runtime_stats(tr, t, tprev);
25882589

25892590
if (sched->idle_hist) {
25902591
struct idle_thread_runtime *itr = (void *)tr;
@@ -2857,6 +2858,9 @@ static void timehist_print_summary(struct perf_sched *sched,
28572858

28582859
printf("\nIdle stats:\n");
28592860
for (i = 0; i < idle_max_cpu; ++i) {
2861+
if (cpu_list && !test_bit(i, cpu_bitmap))
2862+
continue;
2863+
28602864
t = idle_threads[i];
28612865
if (!t)
28622866
continue;

tools/perf/builtin-top.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,7 @@ int cmd_top(int argc, const char **argv)
17461746
goto out_delete_evlist;
17471747
}
17481748

1749+
#ifdef HAVE_LIBBPF_SUPPORT
17491750
if (!top.record_opts.no_bpf_event) {
17501751
top.sb_evlist = evlist__new();
17511752

@@ -1759,6 +1760,7 @@ int cmd_top(int argc, const char **argv)
17591760
goto out_delete_evlist;
17601761
}
17611762
}
1763+
#endif
17621764

17631765
if (perf_evlist__start_sb_thread(top.sb_evlist, target)) {
17641766
pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n");

tools/perf/tests/bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
197197
perf_mmap__read_done(&md->core);
198198
}
199199

200-
if (count != expect) {
200+
if (count != expect * evlist->core.nr_entries) {
201201
pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
202202
goto out_delete_evlist;
203203
}

tools/perf/tests/parse-events.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static int test__group2(struct evlist *evlist)
719719
TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
720720
TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
721721
TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
722-
TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
722+
TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
723723
TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
724724
TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
725725
TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
@@ -842,7 +842,7 @@ static int test__group3(struct evlist *evlist __maybe_unused)
842842
TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
843843
TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
844844
TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
845-
TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
845+
TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
846846
TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
847847
TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
848848
TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));

tools/perf/tests/parse-metric.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ static struct pmu_event pme_test[] = {
7070
{
7171
.metric_expr = "1/m3",
7272
.metric_name = "M3",
73+
},
74+
{
75+
.name = NULL,
7376
}
7477
};
7578

tools/perf/ui/browsers/hists.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3629,15 +3629,16 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
36293629
{
36303630
int nr_entries = evlist->core.nr_entries;
36313631

3632-
single_entry:
36333632
if (perf_evlist__single_entry(evlist)) {
3633+
single_entry: {
36343634
struct evsel *first = evlist__first(evlist);
36353635

36363636
return perf_evsel__hists_browse(first, nr_entries, help,
36373637
false, hbt, min_pcnt,
36383638
env, warn_lost_event,
36393639
annotation_opts);
36403640
}
3641+
}
36413642

36423643
if (symbol_conf.event_group) {
36433644
struct evsel *pos;

0 commit comments

Comments
 (0)