tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_pmc56_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_pmc56_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_pmc56_test.c- Extension
.c- Size
- 1395 bytes
- Lines
- 64
- 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
stdio.h../event.h../sampling_tests/misc.h
Detected Declarations
function group_constraint_pmc56function main
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright 2022, Athira Rajeev, IBM Corp.
*/
#include <stdio.h>
#include "../event.h"
#include "../sampling_tests/misc.h"
/*
* Testcase for checking constraint checks for
* Performance Monitor Counter 5 (PMC5) and also
* Performance Monitor Counter 6 (PMC6). Events using
* PMC5/PMC6 shouldn't have other fields in event
* code like cache bits, thresholding or marked bit.
*/
static int group_constraint_pmc56(void)
{
struct event event;
/* Check for platform support for the test */
SKIP_IF(platform_check_for_tests());
/*
* Events using PMC5 and PMC6 with cache bit
* set in event code is expected to fail.
*/
event_init(&event, 0x2500fa);
FAIL_IF(!event_open(&event));
event_init(&event, 0x2600f4);
FAIL_IF(!event_open(&event));
/*
* PMC5 and PMC6 only supports base events:
* ie 500fa and 600f4. Other combinations
* should fail.
*/
event_init(&event, 0x501e0);
FAIL_IF(!event_open(&event));
event_init(&event, 0x6001e);
FAIL_IF(!event_open(&event));
event_init(&event, 0x501fa);
FAIL_IF(!event_open(&event));
/*
* Events using PMC5 and PMC6 with random
* sampling bits set in event code should fail
* to schedule.
*/
event_init(&event, 0x35340500fa);
FAIL_IF(!event_open(&event));
return 0;
}
int main(void)
{
return test_harness(group_constraint_pmc56, "group_constraint_pmc56");
}
Annotation
- Immediate include surface: `stdio.h`, `../event.h`, `../sampling_tests/misc.h`.
- Detected declarations: `function group_constraint_pmc56`, `function main`.
- 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.