tools/perf/arch/x86/tests/hybrid.c
Source file repositories/reference/linux-study-clean/tools/perf/arch/x86/tests/hybrid.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/arch/x86/tests/hybrid.c- Extension
.c- Size
- 9904 bytes
- Lines
- 311
- 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
arch-tests.hdebug.hevlist.hevsel.hpmu.hpmus.htests/tests.h
Detected Declarations
struct evlist_testfunction test_configfunction test_perf_configfunction test_hybrid_typefunction test__hybrid_hw_event_with_pmufunction test__hybrid_hw_group_eventfunction test__hybrid_sw_hw_group_eventfunction test__hybrid_hw_sw_group_eventfunction test__hybrid_group_modifier1function test__hybrid_raw1function perf_evlist__for_each_evselfunction test__hybrid_raw2function test__hybrid_cache_eventfunction test__checkevent_pmufunction test__hybrid_hw_group_event_2function test_eventfunction combine_test_resultsfunction test_eventsfunction test__hybrid
Annotated Snippet
struct evlist_test {
const char *name;
bool (*valid)(void);
int (*check)(struct evlist *evlist);
};
static const struct evlist_test test__hybrid_events[] = {
{
.name = "cpu_core/cycles/",
.check = test__hybrid_hw_event_with_pmu,
/* 0 */
},
{
.name = "{cpu_core/cycles/,cpu_core/branches/}",
.check = test__hybrid_hw_group_event,
/* 1 */
},
{
.name = "{cpu-clock,cpu_core/cycles/}",
.check = test__hybrid_sw_hw_group_event,
/* 2 */
},
{
.name = "{cpu_core/cycles/,cpu-clock}",
.check = test__hybrid_hw_sw_group_event,
/* 3 */
},
{
.name = "{cpu_core/cycles/k,cpu_core/branches/u}",
.check = test__hybrid_group_modifier1,
/* 4 */
},
{
.name = "r1a",
.check = test__hybrid_raw1,
/* 5 */
},
{
.name = "cpu_core/r1a/",
.check = test__hybrid_raw2,
/* 6 */
},
{
.name = "cpu_core/config=10,config1,config2=3,period=1000/u",
.check = test__checkevent_pmu,
/* 7 */
},
{
.name = "cpu_core/LLC-loads/",
.check = test__hybrid_cache_event,
/* 8 */
},
{
.name = "{cpu_core/cycles/,cpu_core/cpu-cycles/}",
.check = test__hybrid_hw_group_event_2,
/* 9 */
},
};
static int test_event(const struct evlist_test *e)
{
struct parse_events_error err;
struct evlist *evlist;
int ret;
if (e->valid && !e->valid()) {
pr_debug("... SKIP\n");
return TEST_OK;
}
evlist = evlist__new();
if (evlist == NULL) {
pr_err("Failed allocation");
return TEST_FAIL;
}
parse_events_error__init(&err);
ret = parse_events(evlist, e->name, &err);
if (ret) {
pr_debug("failed to parse event '%s', err %d\n", e->name, ret);
parse_events_error__print(&err, e->name);
ret = TEST_FAIL;
if (parse_events_error__contains(&err, "can't access trace events"))
ret = TEST_SKIP;
} else {
ret = e->check(evlist);
}
parse_events_error__exit(&err);
evlist__delete(evlist);
return ret;
Annotation
- Immediate include surface: `arch-tests.h`, `debug.h`, `evlist.h`, `evsel.h`, `pmu.h`, `pmus.h`, `tests/tests.h`.
- Detected declarations: `struct evlist_test`, `function test_config`, `function test_perf_config`, `function test_hybrid_type`, `function test__hybrid_hw_event_with_pmu`, `function test__hybrid_hw_group_event`, `function test__hybrid_sw_hw_group_event`, `function test__hybrid_hw_sw_group_event`, `function test__hybrid_group_modifier1`, `function test__hybrid_raw1`.
- 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.