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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
math.hparse-events.hpmu.hpmus.htests.herrno.hstdio.hlinux/kernel.hlinux/zalloc.hdebug.h../pmu-events/pmu-events.hperf/evlist.hutil/evlist.hutil/expr.hutil/hashmap.hutil/parse-events.hmetricgroup.hstat.h
Detected Declarations
struct perf_pmu_test_eventstruct perf_pmu_test_pmustruct test_core_pmu_event_aliases_cb_argsstruct metricstruct test_metricfunction is_samefunction compare_pmu_eventsfunction compare_alias_to_test_eventfunction test__pmu_event_table_core_callbackfunction test__pmu_event_table_sys_callbackfunction test__pmu_event_tablefunction test_core_pmu_event_aliases_cbfunction __test_core_pmu_event_aliasesfunction __test_uncore_pmu_event_aliasesfunction test__aliasesfunction is_numberfunction check_parse_idfunction check_parse_fakefunction test__parsing_callbackfunction list_for_each_entryfunction test__parsingfunction metric_parse_fakefunction hashmap__for_each_entryfunction test__parsing_fake_callbackfunction test__parsing_fakefunction test__parsing_threshold_callbackfunction test__parsing_threshold
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
- Immediate include surface: `math.h`, `parse-events.h`, `pmu.h`, `pmus.h`, `tests.h`, `errno.h`, `stdio.h`, `linux/kernel.h`.
- Detected declarations: `struct perf_pmu_test_event`, `struct perf_pmu_test_pmu`, `struct test_core_pmu_event_aliases_cb_args`, `struct metric`, `struct test_metric`, `function is_same`, `function compare_pmu_events`, `function compare_alias_to_test_event`, `function test__pmu_event_table_core_callback`, `function test__pmu_event_table_sys_callback`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.