Skip to content

Commit 047e603

Browse files
German Gomezacmel
authored andcommitted
perf test: Fix arm64 perf_event_attr tests wrt --call-graph initialization
The struct perf_event_attr is initialised differently in Arm64 when recording in call-graph fp mode, so update the relevant tests, and add two extra arm64-only tests. Before: $ perf test 17 -v 17: Setup struct perf_event_attr [...] running './tests/attr/test-record-graph-default' expected sample_type=295, got 4391 expected sample_regs_user=0, got 1073741824 FAILED './tests/attr/test-record-graph-default' - match failure test child finished with -1 ---- end ---- After: [...] running './tests/attr/test-record-graph-default-aarch64' test limitation 'aarch64' running './tests/attr/test-record-graph-fp-aarch64' test limitation 'aarch64' running './tests/attr/test-record-graph-default' test limitation '!aarch64' excluded architecture list ['aarch64'] skipped [aarch64] './tests/attr/test-record-graph-default' running './tests/attr/test-record-graph-fp' test limitation '!aarch64' excluded architecture list ['aarch64'] skipped [aarch64] './tests/attr/test-record-graph-fp' [...] Fixes: 7248e30 ("perf tools: Record ARM64 LR register automatically") Signed-off-by: German Gomez <german.gomez@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexandre Truong <alexandre.truong@arm.com> Cc: Ian Rogers <irogers@google.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Fastabend <john.fastabend@gmail.com> Cc: KP Singh <kpsingh@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin KaFai Lau <kafai@fb.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Cc: Yonghong Song <yhs@fb.com> Link: http://lore.kernel.org/lkml/20220125104435.2737-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 52a9dab commit 047e603

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

tools/perf/tests/attr/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ Following tests are defined (with perf commands):
4545
perf record -d kill (test-record-data)
4646
perf record -F 100 kill (test-record-freq)
4747
perf record -g kill (test-record-graph-default)
48+
perf record -g kill (test-record-graph-default-aarch64)
4849
perf record --call-graph dwarf kill (test-record-graph-dwarf)
4950
perf record --call-graph fp kill (test-record-graph-fp)
51+
perf record --call-graph fp kill (test-record-graph-fp-aarch64)
5052
perf record --group -e cycles,instructions kill (test-record-group)
5153
perf record -e '{cycles,instructions}' kill (test-record-group1)
5254
perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)

tools/perf/tests/attr/test-record-graph-default

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
command = record
33
args = --no-bpf-event -g kill >/dev/null 2>&1
44
ret = 1
5+
# arm64 enables registers in the default mode (fp)
6+
arch = !aarch64
57

68
[event:base-record]
79
sample_type=295
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[config]
2+
command = record
3+
args = --no-bpf-event -g kill >/dev/null 2>&1
4+
ret = 1
5+
arch = aarch64
6+
7+
[event:base-record]
8+
sample_type=4391
9+
sample_regs_user=1073741824

tools/perf/tests/attr/test-record-graph-fp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
command = record
33
args = --no-bpf-event --call-graph fp kill >/dev/null 2>&1
44
ret = 1
5+
# arm64 enables registers in fp mode
6+
arch = !aarch64
57

68
[event:base-record]
79
sample_type=295
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[config]
2+
command = record
3+
args = --no-bpf-event --call-graph fp kill >/dev/null 2>&1
4+
ret = 1
5+
arch = aarch64
6+
7+
[event:base-record]
8+
sample_type=4391
9+
sample_regs_user=1073741824

0 commit comments

Comments
 (0)