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