tools/perf/tests/pmu-events.c

Source file repositories/reference/linux-study-clean/tools/perf/tests/pmu-events.c

File Facts

System
Linux kernel
Corpus path
tools/perf/tests/pmu-events.c
Extension
.c
Size
26147 bytes
Lines
1056
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 perf_pmu_test_event {
	/* used for matching against events from generated pmu-events.c */
	struct pmu_event event;

	/*
	 * Note: For when PublicDescription does not exist in the JSON, we
	 * will have no long_desc in pmu_event.long_desc, but long_desc may
	 * be set in the alias.
	 */
	const char *alias_long_desc;

	/* PMU which we should match against */
	const char *matching_pmu;
};

struct perf_pmu_test_pmu {
	const char *pmu_name;
	bool pmu_is_uncore;
	const char *pmu_id;
	struct perf_pmu_test_event const *aliases[10];
};

static const struct perf_pmu_test_event bp_l1_btb_correct = {
	.event = {
		.pmu = "default_core",
		.name = "bp_l1_btb_correct",
		.event = "event=0x8a",
		.desc = "L1 BTB Correction",
		.topic = "branch",
	},
};

static const struct perf_pmu_test_event bp_l2_btb_correct = {
	.event = {
		.pmu = "default_core",
		.name = "bp_l2_btb_correct",
		.event = "event=0x8b",
		.desc = "L2 BTB Correction",
		.topic = "branch",
	},
};

static const struct perf_pmu_test_event segment_reg_loads_any = {
	.event = {
		.pmu = "default_core",
		.name = "segment_reg_loads.any",
		.event = "event=6,period=200000,umask=0x80",
		.desc = "Number of segment register loads",
		.topic = "other",
	},
};

static const struct perf_pmu_test_event dispatch_blocked_any = {
	.event = {
		.pmu = "default_core",
		.name = "dispatch_blocked.any",
		.event = "event=9,period=200000,umask=0x20",
		.desc = "Memory cluster signals to block micro-op dispatch for any reason",
		.topic = "other",
	},
};

static const struct perf_pmu_test_event eist_trans = {
	.event = {
		.pmu = "default_core",
		.name = "eist_trans",
		.event = "event=0x3a,period=200000",
		.desc = "Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions",
		.topic = "other",
	},
};

static const struct perf_pmu_test_event l3_cache_rd = {
	.event = {
		.pmu = "default_core",
		.name = "l3_cache_rd",
		.event = "event=0x40",
		.desc = "L3 cache access, read",
		.long_desc = "Attributable Level 3 cache access, read",
		.topic = "cache",
	},
	.alias_long_desc = "Attributable Level 3 cache access, read",
};

static const struct perf_pmu_test_event *core_events[] = {
	&bp_l1_btb_correct,
	&bp_l2_btb_correct,
	&segment_reg_loads_any,
	&dispatch_blocked_any,
	&eist_trans,

Annotation

Implementation Notes