tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h- Extension
.h- Size
- 6044 bytes
- Lines
- 237
- 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
sys/stat.h../event.h
Detected Declarations
function get_mmcr0_fc56function get_mmcr0_pmccextfunction get_mmcr0_pmaofunction get_mmcr0_cc56runfunction get_mmcr0_pmcjcefunction get_mmcr0_pmc1cefunction get_mmcr0_pmaefunction get_mmcr1_pmcxselfunction get_mmcr1_unitfunction get_mmcr1_combfunction get_mmcr1_cachefunction get_mmcr1_rsqfunction get_mmcr2_fcsfunction get_mmcr2_fcpfunction get_mmcr2_fcpcfunction get_mmcr2_fcm1function get_mmcr2_fcm0function get_mmcr2_fcwaitfunction get_mmcr2_fchfunction get_mmcr2_fctifunction get_mmcr2_fctafunction get_mmcr2_l2l3function get_mmcr3_srcfunction get_mmcra_thd_cmpfunction get_mmcra_smfunction get_mmcra_bhrb_disablefunction get_mmcra_ifmfunction get_mmcra_thd_selfunction get_mmcra_thd_startfunction get_mmcra_thd_stopfunction get_mmcra_rand_samp_eligfunction get_mmcra_sample_modefunction get_mmcra_marked
Annotated Snippet
#include <sys/stat.h>
#include "../event.h"
#define POWER11 0x82
#define POWER10 0x80
#define POWER9 0x4e
#define PERF_POWER9_MASK 0x7f8ffffffffffff
#define PERF_POWER10_MASK 0x7ffffffffffffff
#define PERF_POWER11_MASK PERF_POWER10_MASK
#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */
#define MMCR0_PMCCEXT 0x00000200UL /* PMCCEXT control */
#define MMCR1_RSQ 0x200000000000ULL /* radix scope qual field */
#define BHRB_DISABLE 0x2000000000ULL /* MMCRA BHRB DISABLE bit */
extern int ev_mask_pmcxsel, ev_shift_pmcxsel;
extern int ev_mask_marked, ev_shift_marked;
extern int ev_mask_comb, ev_shift_comb;
extern int ev_mask_unit, ev_shift_unit;
extern int ev_mask_pmc, ev_shift_pmc;
extern int ev_mask_cache, ev_shift_cache;
extern int ev_mask_sample, ev_shift_sample;
extern int ev_mask_thd_sel, ev_shift_thd_sel;
extern int ev_mask_thd_start, ev_shift_thd_start;
extern int ev_mask_thd_stop, ev_shift_thd_stop;
extern int ev_mask_thd_cmp, ev_shift_thd_cmp;
extern int ev_mask_sm, ev_shift_sm;
extern int ev_mask_rsq, ev_shift_rsq;
extern int ev_mask_l2l3, ev_shift_l2l3;
extern int ev_mask_mmcr3_src, ev_shift_mmcr3_src;
extern int pvr;
extern u64 platform_extended_mask;
extern int check_pvr_for_sampling_tests(void);
extern int platform_check_for_tests(void);
extern int check_extended_regs_support(void);
extern u64 perf_get_platform_reg_mask(void);
/*
* Event code field extraction macro.
* Raw event code is combination of multiple
* fields. Macro to extract individual fields
*
* x - Raw event code value
* y - Field to extract
*/
#define EV_CODE_EXTRACT(x, y) \
((x >> ev_shift_##y) & ev_mask_##y)
void *event_sample_buf_mmap(int fd, int mmap_pages);
void *__event_read_samples(void *sample_buff, size_t *size, u64 *sample_count);
int collect_samples(void *sample_buff);
u64 *get_intr_regs(struct event *event, void *sample_buff);
u64 get_reg_value(u64 *intr_regs, char *register_name);
int get_thresh_cmp_val(struct event event);
bool check_for_generic_compat_pmu(void);
bool check_for_compat_mode(void);
static inline int get_mmcr0_fc56(u64 mmcr0, int pmc)
{
return (mmcr0 & MMCR0_FC56);
}
static inline int get_mmcr0_pmccext(u64 mmcr0, int pmc)
{
return (mmcr0 & MMCR0_PMCCEXT);
}
static inline int get_mmcr0_pmao(u64 mmcr0, int pmc)
{
return ((mmcr0 >> 7) & 0x1);
}
static inline int get_mmcr0_cc56run(u64 mmcr0, int pmc)
{
return ((mmcr0 >> 8) & 0x1);
}
static inline int get_mmcr0_pmcjce(u64 mmcr0, int pmc)
{
return ((mmcr0 >> 14) & 0x1);
}
static inline int get_mmcr0_pmc1ce(u64 mmcr0, int pmc)
{
return ((mmcr0 >> 15) & 0x1);
}
static inline int get_mmcr0_pmae(u64 mmcr0, int pmc)
{
return ((mmcr0 >> 27) & 0x1);
Annotation
- Immediate include surface: `sys/stat.h`, `../event.h`.
- Detected declarations: `function get_mmcr0_fc56`, `function get_mmcr0_pmccext`, `function get_mmcr0_pmao`, `function get_mmcr0_cc56run`, `function get_mmcr0_pmcjce`, `function get_mmcr0_pmc1ce`, `function get_mmcr0_pmae`, `function get_mmcr1_pmcxsel`, `function get_mmcr1_unit`, `function get_mmcr1_comb`.
- 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.