Skip to content

Commit fc33dcc

Browse files
kliang2acmel
authored andcommitted
perf test: Add test case for PERF_SAMPLE_PHYS_ADDR
Extend sample-parsing test cases to support new sample type PERF_SAMPLE_PHYS_ADDR. Signed-off-by: Kan Liang <[email protected]> Tested-by: Jiri Olsa <[email protected]> Acked-by: Stephane Eranian <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 49d58f0 commit fc33dcc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/perf/tests/sample-parsing.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ static bool samples_same(const struct perf_sample *s1,
141141
}
142142
}
143143

144+
if (type & PERF_SAMPLE_PHYS_ADDR)
145+
COMP(phys_addr);
146+
144147
return true;
145148
}
146149

@@ -206,6 +209,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
206209
.mask = sample_regs,
207210
.regs = regs,
208211
},
212+
.phys_addr = 113,
209213
};
210214
struct sample_read_value values[] = {{1, 5}, {9, 3}, {2, 7}, {6, 4},};
211215
struct perf_sample sample_out;
@@ -305,7 +309,7 @@ int test__sample_parsing(struct test *test __maybe_unused, int subtest __maybe_u
305309
* were added. Please actually update the test rather than just change
306310
* the condition below.
307311
*/
308-
if (PERF_SAMPLE_MAX > PERF_SAMPLE_REGS_INTR << 1) {
312+
if (PERF_SAMPLE_MAX > PERF_SAMPLE_PHYS_ADDR << 1) {
309313
pr_debug("sample format has changed, some new PERF_SAMPLE_ bit was introduced - test needs updating\n");
310314
return -1;
311315
}

0 commit comments

Comments
 (0)