perf: intel-pt: Add hybrid CPU compatibility test
Adrian Hunter
reviewercover perf: intel-pt: Add hybrid CPU compatibility test
Hi
The kernel driver assumes hybrid CPUs will have Intel PT capabilities that are compatible with the boot CPU. Add a test to check that is the case.
First 2 patches are preparation.
Adrian Hunter (3):
perf: intel-pt: Rename intel-pt-pkt-decoder-test.c
perf: intel-pt: Redefine test_suite
perf: intel-pt: Add hybrid CPU compatibility test
tools/perf/arch/x86/include/arch-tests.h | 1 +
tools/perf/arch/x86/tests/Build | 2 +-
tools/perf/arch/x86/tests/arch-tests.c | 15 +-
...intel-pt-pkt-decoder-test.c => intel-pt-test.c} | 154 +++++++++++++++++++++
4 files changed, 169 insertions(+), 3 deletions(-)
rename tools/perf/arch/x86/tests/{intel-pt-pkt-decoder-test.c => intel-pt-test.c} (80%)Regards
Adrian
Adrian Hunter
reviewerPATCH 1/3 perf: intel-pt: Rename intel-pt-pkt-decoder-test.c
In preparation for adding more Intel PT testing, rename intel-pt-pkt-decoder-test.c to intel-pt-test.c.
Subtests will later be added to intel-pt-test.c.
---
tools/perf/arch/x86/tests/Build | 2 +-
.../x86/tests/{intel-pt-pkt-decoder-test.c => intel-pt-test.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename tools/perf/arch/x86/tests/{intel-pt-pkt-decoder-test.c => intel-pt-test.c} (100%)tools/perf/arch/x86/tests/Build +1 -1
@@ -3,5 +3,5 @@ perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o perf-y += arch-tests.o perf-y += sample-parsing.o -perf-$(CONFIG_AUXTRACE) += insn-x86.o intel-pt-pkt-decoder-test.o +perf-$(CONFIG_AUXTRACE) += insn-x86.o intel-pt-test.o perf-$(CONFIG_X86_64) += bp-modify.o
tools/perf/arch/x86/tests/intel-pt-test.c renamed from tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c +0 -0
Signature · 1 line
2.34.1
Adrian Hunter
reviewerPATCH 2/3 perf: intel-pt: Redefine test_suite
In reply to Adrian HunterIn preparation for adding more Intel PT testing, redefine the test_suite to allow for adding more subtests.
--- tools/perf/arch/x86/tests/arch-tests.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
tools/perf/arch/x86/tests/arch-tests.c +12 -2
@@ -5,7 +5,17 @@#ifdef HAVE_AUXTRACE_SUPPORT DEFINE_SUITE ("x86 instruction decoder - new instructions" , insn_x86); -DEFINE_SUITE ("Intel PT packet decoder" , intel_pt_pkt_decoder); + +static struct test_case intel_pt_tests[] = { +TEST_CASE ("Intel PT packet decoder" , intel_pt_pkt_decoder), + { .name =NULL , } +}; + +struct test_suite suite__intel_pt = { + .desc ="Intel PT packet decoder" , + .test_cases = intel_pt_tests, +}; +#endif #if defined(__x86_64__)DEFINE_SUITE ("x86 bp modify" , bp_modify);
@@ -18,7 +28,7 @@ struct test_suite *arch_tests[] = {#endif #ifdef HAVE_AUXTRACE_SUPPORT &suite__insn_x86, - &suite__intel_pt_pkt_decoder, + &suite__intel_pt,#endif #if defined(__x86_64__) &suite__bp_modify,
Signature · 1 line
2.34.1
Adrian Hunter
reviewerPATCH 3/3 perf: intel-pt: Add hybrid CPU compatibility test
In reply to Adrian HunterThe kernel driver assumes hybrid CPUs will have Intel PT capabilities that are compatible with the boot CPU. Add a test to check that is the case.
--- tools/perf/arch/x86/include/arch-tests.h | 1 + tools/perf/arch/x86/tests/arch-tests.c | 3 +- tools/perf/arch/x86/tests/intel-pt-test.c | 154 ++++++++++++++++++++++ 3 files changed, 157 insertions(+), 1 deletion(-)
tools/perf/arch/x86/include/arch-tests.h +1 -0
@@ -8,6 +8,7 @@ struct test_suite;int test__rdpmc (struct test_suite *test,int subtest);int test__insn_x86 (struct test_suite *test,int subtest);int test__intel_pt_pkt_decoder (struct test_suite *test,int subtest); +int test__intel_pt_hybrid_compat (struct test_suite *test,int subtest);int test__bp_modify (struct test_suite *test,int subtest);int test__x86_sample_parsing (struct test_suite *test,int subtest);
tools/perf/arch/x86/tests/arch-tests.c +2 -1
@@ -8,11 +8,12 @@ DEFINE_SUITE("x86 instruction decoder - new instructions", insn_x86);static struct test_case intel_pt_tests[] = {TEST_CASE ("Intel PT packet decoder" , intel_pt_pkt_decoder), +TEST_CASE ("Intel PT hybrid CPU compatibility" , intel_pt_hybrid_compat), { .name =NULL , } };struct test_suite suite__intel_pt = { - .desc ="Intel PT packet decoder" , + .desc ="Intel PT" , .test_cases = intel_pt_tests, };
tools/perf/arch/x86/tests/intel-pt-test.c +154 -0
169 lines not on this page · raw message
Signature · 1 line
2.34.1
Hi Adrian,
Quoted 7 lines · Adrian Hunter
Hi
The kernel driver assumes hybrid CPUs will have Intel PT capabilities that are compatible with the boot CPU. Add a test to check that is the case.
Quoted 7 lines
First 2 patches are preparation.
Adrian Hunter (3):
perf: intel-pt: Renameintel-pt-pkt-decoder-test.c
perf: intel-pt: Redefinetest_suite
perf: intel-pt: Add hybrid CPU compatibility test
Thanks,
Namhyung
Quoted 11 lines
tools/perf/arch/x86/include/arch-tests.h | 1 + tools/perf/arch/x86/tests/Build | 2 +- tools/perf/arch/x86/tests/arch-tests.c | 15 +- ...intel-pt-pkt-decoder-test.c => intel-pt-test.c} | 154 +++++++++++++++++++++ 4 files changed, 169 insertions(+), 3 deletions(-) rename tools/perf/arch/x86/tests/{intel-pt-pkt-decoder-test.c => intel-pt-test.c} (80%)Regards
Adrian
Em Mon, Nov 07, 2022 at 11:32:56AM -0800, Namhyung Kim escreveu:
Quoted 13 lines
Hi Adrian,
Quoted 10 lines · Adrian Hunter
Hi
The kernel driver assumes hybrid CPUs will have Intel PT capabilities that are compatible with the boot CPU. Add a test to check that is the case.
First 2 patches are preparation.
Quoted 6 lines
Quoted 4 lines
Adrian Hunter (3):
perf: intel-pt: Renameintel-pt-pkt-decoder-test.c
perf: intel-pt: Redefinetest_suite
perf: intel-pt: Add hybrid CPU compatibility testAcked-by Namhyung Kim <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 14 lines
Thanks,
NamhyungQuoted 11 lines
tools/perf/arch/x86/include/arch-tests.h | 1 + tools/perf/arch/x86/tests/Build | 2 +- tools/perf/arch/x86/tests/arch-tests.c | 15 +- ...intel-pt-pkt-decoder-test.c => intel-pt-test.c} | 154 +++++++++++++++++++++ 4 files changed, 169 insertions(+), 3 deletions(-) rename tools/perf/arch/x86/tests/{intel-pt-pkt-decoder-test.c => intel-pt-test.c} (80%)Regards
Adrian
Signature · 1 line
- Arnaldo