tools/perf/tests/tests.h

Source file repositories/reference/linux-study-clean/tools/perf/tests/tests.h

File Facts

System
Linux kernel
Corpus path
tools/perf/tests/tests.h
Extension
.h
Size
6413 bytes
Lines
253
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct test_case {
	const char *name;
	const char *desc;
	const char *skip_reason;
	test_fnptr run_case;
	bool exclusive;
};

struct test_suite {
	const char *desc;
	struct test_case *test_cases;
	void *priv;
};

#define DECLARE_SUITE(name) \
	extern struct test_suite suite__##name;

#define TEST_CASE(description, _name)			\
	{						\
		.name = #_name,				\
		.desc = description,			\
		.run_case = test__##_name,		\
	}

#define TEST_CASE_REASON(description, _name, _reason)	\
	{						\
		.name = #_name,				\
		.desc = description,			\
		.run_case = test__##_name,		\
		.skip_reason = _reason,			\
	}

#define TEST_CASE_EXCLUSIVE(description, _name)		\
	{						\
		.name = #_name,				\
		.desc = description,			\
		.run_case = test__##_name,		\
		.exclusive = true,			\
	}

#define TEST_CASE_REASON_EXCLUSIVE(description, _name, _reason)	\
	{						\
		.name = #_name,				\
		.desc = description,			\
		.run_case = test__##_name,		\
		.skip_reason = _reason,			\
		.exclusive = true,			\
	}

#define DEFINE_SUITE(description, _name)		\
	struct test_case tests__##_name[] = {           \
		TEST_CASE(description, _name),		\
		{	.name = NULL, }			\
	};						\
	struct test_suite suite__##_name = {		\
		.desc = description,			\
		.test_cases = tests__##_name,		\
	}

#define DEFINE_SUITE_EXCLUSIVE(description, _name)	\
	struct test_case tests__##_name[] = {           \
		TEST_CASE_EXCLUSIVE(description, _name),\
		{	.name = NULL, }			\
	};						\
	struct test_suite suite__##_name = {		\
		.desc = description,			\
		.test_cases = tests__##_name,		\
	}

/* Tests */
DECLARE_SUITE(vmlinux_matches_kallsyms);
DECLARE_SUITE(openat_syscall_event);
DECLARE_SUITE(openat_syscall_event_on_all_cpus);
DECLARE_SUITE(basic_mmap);
DECLARE_SUITE(PERF_RECORD);
DECLARE_SUITE(perf_evsel__roundtrip_name_test);
DECLARE_SUITE(perf_evsel__tp_sched_test);
DECLARE_SUITE(syscall_openat_tp_fields);
DECLARE_SUITE(pmu);
DECLARE_SUITE(pmu_events);
DECLARE_SUITE(hwmon_pmu);
DECLARE_SUITE(tool_pmu);
DECLARE_SUITE(attr);
DECLARE_SUITE(dso_data);
DECLARE_SUITE(dso_data_cache);
DECLARE_SUITE(dso_data_reopen);
DECLARE_SUITE(parse_events);
DECLARE_SUITE(hists_link);
DECLARE_SUITE(bp_signal);
DECLARE_SUITE(bp_signal_overflow);

Annotation

Implementation Notes