tools/testing/selftests/powerpc/pmu/event_code_tests/blacklisted_events_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/pmu/event_code_tests/blacklisted_events_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/pmu/event_code_tests/blacklisted_events_test.c- Extension
.c- Size
- 3043 bytes
- Lines
- 133
- 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.hsys/prctl.hlimits.h../event.h../sampling_tests/misc.h
Detected Declarations
function check_for_power9_versionfunction blacklisted_eventsfunction main
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright 2022, Athira Rajeev, IBM Corp.
*/
#include <stdio.h>
#include <sys/prctl.h>
#include <limits.h>
#include "../event.h"
#include "../sampling_tests/misc.h"
#define PM_DTLB_MISS_16G 0x1c058
#define PM_DERAT_MISS_2M 0x1c05a
#define PM_DTLB_MISS_2M 0x1c05c
#define PM_MRK_DTLB_MISS_1G 0x1d15c
#define PM_DTLB_MISS_4K 0x2c056
#define PM_DERAT_MISS_1G 0x2c05a
#define PM_MRK_DERAT_MISS_2M 0x2d152
#define PM_MRK_DTLB_MISS_4K 0x2d156
#define PM_MRK_DTLB_MISS_16G 0x2d15e
#define PM_DTLB_MISS_64K 0x3c056
#define PM_MRK_DERAT_MISS_1G 0x3d152
#define PM_MRK_DTLB_MISS_64K 0x3d156
#define PM_DISP_HELD_SYNC_HOLD 0x4003c
#define PM_DTLB_MISS_16M 0x4c056
#define PM_DTLB_MISS_1G 0x4c05a
#define PM_MRK_DTLB_MISS_16M 0x4c15e
#define PM_MRK_ST_DONE_L2 0x10134
#define PM_RADIX_PWC_L1_HIT 0x1f056
#define PM_FLOP_CMPL 0x100f4
#define PM_MRK_NTF_FIN 0x20112
#define PM_RADIX_PWC_L2_HIT 0x2d024
#define PM_IFETCH_THROTTLE 0x3405e
#define PM_MRK_L2_TM_ST_ABORT_SISTER 0x3e15c
#define PM_RADIX_PWC_L3_HIT 0x3f056
#define PM_RUN_CYC_SMT2_MODE 0x3006c
#define PM_TM_TX_PASS_RUN_INST 0x4e014
#define PVR_POWER9_CUMULUS 0x00002000
int blacklist_events_dd21[] = {
PM_MRK_ST_DONE_L2,
PM_RADIX_PWC_L1_HIT,
PM_FLOP_CMPL,
PM_MRK_NTF_FIN,
PM_RADIX_PWC_L2_HIT,
PM_IFETCH_THROTTLE,
PM_MRK_L2_TM_ST_ABORT_SISTER,
PM_RADIX_PWC_L3_HIT,
PM_RUN_CYC_SMT2_MODE,
PM_TM_TX_PASS_RUN_INST,
PM_DISP_HELD_SYNC_HOLD,
};
int blacklist_events_dd22[] = {
PM_DTLB_MISS_16G,
PM_DERAT_MISS_2M,
PM_DTLB_MISS_2M,
PM_MRK_DTLB_MISS_1G,
PM_DTLB_MISS_4K,
PM_DERAT_MISS_1G,
PM_MRK_DERAT_MISS_2M,
PM_MRK_DTLB_MISS_4K,
PM_MRK_DTLB_MISS_16G,
PM_DTLB_MISS_64K,
PM_MRK_DERAT_MISS_1G,
PM_MRK_DTLB_MISS_64K,
PM_DISP_HELD_SYNC_HOLD,
PM_DTLB_MISS_16M,
PM_DTLB_MISS_1G,
PM_MRK_DTLB_MISS_16M,
};
int pvr_min;
/*
* check for power9 support for 2.1 and
* 2.2 model where blacklist is applicable.
*/
int check_for_power9_version(void)
{
pvr_min = PVR_MIN(mfspr(SPRN_PVR));
SKIP_IF(PVR_VER(pvr) != POWER9);
SKIP_IF(!(pvr & PVR_POWER9_CUMULUS));
SKIP_IF(!(3 - pvr_min));
return 0;
}
Annotation
- Immediate include surface: `stdio.h`, `sys/prctl.h`, `limits.h`, `../event.h`, `../sampling_tests/misc.h`.
- Detected declarations: `function check_for_power9_version`, `function blacklisted_events`, `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.