xref: /linux/tools/perf/arch/x86/tests/arch-tests.c (revision 9e906a9dead17d81d6c2687f65e159231d0e3286)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <string.h>
3 #include "tests/tests.h"
4 #include "arch-tests.h"
5 
6 #ifdef HAVE_EXTRA_TESTS
7 DEFINE_SUITE("x86 instruction decoder - new instructions", insn_x86);
8 #endif
9 
10 static struct test_case intel_pt_tests[] = {
11 	TEST_CASE("Intel PT packet decoder", intel_pt_pkt_decoder),
12 	TEST_CASE("Intel PT hybrid CPU compatibility", intel_pt_hybrid_compat),
13 	{ .name = NULL, }
14 };
15 
16 struct test_suite suite__intel_pt = {
17 	.desc = "Intel PT",
18 	.test_cases = intel_pt_tests,
19 };
20 
21 #if defined(__x86_64__)
22 DEFINE_SUITE("x86 bp modify", bp_modify);
23 #endif
24 DEFINE_SUITE("AMD IBS via core pmu", amd_ibs_via_core_pmu);
25 DEFINE_SUITE_EXCLUSIVE("AMD IBS sample period", amd_ibs_period);
26 static struct test_case hybrid_tests[] = {
27 	TEST_CASE_REASON("x86 hybrid event parsing", hybrid, "not hybrid"),
28 	{ .name = NULL, }
29 };
30 
31 struct test_suite suite__hybrid = {
32 	.desc = "x86 hybrid",
33 	.test_cases = hybrid_tests,
34 };
35 
36 struct test_suite *arch_tests[] = {
37 #ifdef HAVE_DWARF_UNWIND_SUPPORT
38 	&suite__dwarf_unwind,
39 #endif
40 #ifdef HAVE_EXTRA_TESTS
41 	&suite__insn_x86,
42 #endif
43 	&suite__intel_pt,
44 #if defined(__x86_64__)
45 	&suite__bp_modify,
46 #endif
47 	&suite__amd_ibs_via_core_pmu,
48 	&suite__amd_ibs_period,
49 	&suite__hybrid,
50 	&suite__x86_topdown,
51 	NULL,
52 };
53