#ifndef _ASM_X86_PERF_EVENT_H
#define _ASM_X86_PERF_EVENT_H
#include <linux/static_call.h>
#define INTEL_PMC_MAX_GENERIC …
#define INTEL_PMC_MAX_FIXED …
#define INTEL_PMC_IDX_FIXED …
#define X86_PMC_IDX_MAX …
#define MSR_ARCH_PERFMON_PERFCTR0 …
#define MSR_ARCH_PERFMON_PERFCTR1 …
#define MSR_ARCH_PERFMON_EVENTSEL0 …
#define MSR_ARCH_PERFMON_EVENTSEL1 …
#define ARCH_PERFMON_EVENTSEL_EVENT …
#define ARCH_PERFMON_EVENTSEL_UMASK …
#define ARCH_PERFMON_EVENTSEL_USR …
#define ARCH_PERFMON_EVENTSEL_OS …
#define ARCH_PERFMON_EVENTSEL_EDGE …
#define ARCH_PERFMON_EVENTSEL_PIN_CONTROL …
#define ARCH_PERFMON_EVENTSEL_INT …
#define ARCH_PERFMON_EVENTSEL_ANY …
#define ARCH_PERFMON_EVENTSEL_ENABLE …
#define ARCH_PERFMON_EVENTSEL_INV …
#define ARCH_PERFMON_EVENTSEL_CMASK …
#define ARCH_PERFMON_EVENTSEL_BR_CNTR …
#define ARCH_PERFMON_EVENTSEL_EQ …
#define ARCH_PERFMON_EVENTSEL_UMASK2 …
#define INTEL_FIXED_BITS_MASK …
#define INTEL_FIXED_BITS_STRIDE …
#define INTEL_FIXED_0_KERNEL …
#define INTEL_FIXED_0_USER …
#define INTEL_FIXED_0_ANYTHREAD …
#define INTEL_FIXED_0_ENABLE_PMI …
#define HSW_IN_TX …
#define HSW_IN_TX_CHECKPOINTED …
#define ICL_EVENTSEL_ADAPTIVE …
#define ICL_FIXED_0_ADAPTIVE …
#define intel_fixed_bits_by_idx(_idx, _bits) …
#define AMD64_EVENTSEL_INT_CORE_ENABLE …
#define AMD64_EVENTSEL_GUESTONLY …
#define AMD64_EVENTSEL_HOSTONLY …
#define AMD64_EVENTSEL_INT_CORE_SEL_SHIFT …
#define AMD64_EVENTSEL_INT_CORE_SEL_MASK …
#define AMD64_EVENTSEL_EVENT …
#define INTEL_ARCH_EVENT_MASK …
#define AMD64_L3_SLICE_SHIFT …
#define AMD64_L3_SLICE_MASK …
#define AMD64_L3_SLICEID_MASK …
#define AMD64_L3_THREAD_SHIFT …
#define AMD64_L3_THREAD_MASK …
#define AMD64_L3_F19H_THREAD_MASK …
#define AMD64_L3_EN_ALL_CORES …
#define AMD64_L3_EN_ALL_SLICES …
#define AMD64_L3_COREID_SHIFT …
#define AMD64_L3_COREID_MASK …
#define X86_RAW_EVENT_MASK …
#define X86_ALL_EVENT_FLAGS …
#define AMD64_RAW_EVENT_MASK …
#define AMD64_RAW_EVENT_MASK_NB …
#define AMD64_PERFMON_V2_EVENTSEL_EVENT_NB …
#define AMD64_PERFMON_V2_EVENTSEL_UMASK_NB …
#define AMD64_PERFMON_V2_RAW_EVENT_MASK_NB …
#define AMD64_PERFMON_V2_ENABLE_UMC …
#define AMD64_PERFMON_V2_EVENTSEL_EVENT_UMC …
#define AMD64_PERFMON_V2_EVENTSEL_RDWRMASK_UMC …
#define AMD64_PERFMON_V2_RAW_EVENT_MASK_UMC …
#define AMD64_NUM_COUNTERS …
#define AMD64_NUM_COUNTERS_CORE …
#define AMD64_NUM_COUNTERS_NB …
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL …
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK …
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX …
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT …
#define ARCH_PERFMON_BRANCH_MISSES_RETIRED …
#define ARCH_PERFMON_EVENTS_COUNT …
#define PEBS_DATACFG_MEMINFO …
#define PEBS_DATACFG_GP …
#define PEBS_DATACFG_XMMS …
#define PEBS_DATACFG_LBRS …
#define PEBS_DATACFG_LBR_SHIFT …
#define PEBS_UPDATE_DS_SW …
cpuid10_eax;
cpuid10_ebx;
cpuid10_edx;
#define ARCH_PERFMON_EXT_LEAF …
#define ARCH_PERFMON_EXT_UMASK2 …
#define ARCH_PERFMON_EXT_EQ …
#define ARCH_PERFMON_NUM_COUNTER_LEAF_BIT …
#define ARCH_PERFMON_NUM_COUNTER_LEAF …
cpuid28_eax;
cpuid28_ebx;
cpuid28_ecx;
cpuid_0x80000022_ebx;
struct x86_pmu_capability { … };
#define INTEL_PMC_FIXED_RDPMC_BASE …
#define INTEL_PMC_FIXED_RDPMC_METRICS …
#define MSR_ARCH_PERFMON_FIXED_CTR_CTRL …
#define MSR_ARCH_PERFMON_FIXED_CTR0 …
#define INTEL_PMC_IDX_FIXED_INSTRUCTIONS …
#define MSR_ARCH_PERFMON_FIXED_CTR1 …
#define INTEL_PMC_IDX_FIXED_CPU_CYCLES …
#define MSR_ARCH_PERFMON_FIXED_CTR2 …
#define INTEL_PMC_IDX_FIXED_REF_CYCLES …
#define INTEL_PMC_MSK_FIXED_REF_CYCLES …
#define MSR_ARCH_PERFMON_FIXED_CTR3 …
#define INTEL_PMC_IDX_FIXED_SLOTS …
#define INTEL_PMC_MSK_FIXED_SLOTS …
static inline bool use_fixed_pseudo_encoding(u64 code)
{ … }
#define INTEL_PMC_IDX_FIXED_BTS …
#define INTEL_PMC_IDX_METRIC_BASE …
#define INTEL_PMC_IDX_TD_RETIRING …
#define INTEL_PMC_IDX_TD_BAD_SPEC …
#define INTEL_PMC_IDX_TD_FE_BOUND …
#define INTEL_PMC_IDX_TD_BE_BOUND …
#define INTEL_PMC_IDX_TD_HEAVY_OPS …
#define INTEL_PMC_IDX_TD_BR_MISPREDICT …
#define INTEL_PMC_IDX_TD_FETCH_LAT …
#define INTEL_PMC_IDX_TD_MEM_BOUND …
#define INTEL_PMC_IDX_METRIC_END …
#define INTEL_PMC_MSK_TOPDOWN …
#define INTEL_TD_SLOTS …
#define INTEL_TD_METRIC_RETIRING …
#define INTEL_TD_METRIC_BAD_SPEC …
#define INTEL_TD_METRIC_FE_BOUND …
#define INTEL_TD_METRIC_BE_BOUND …
#define INTEL_TD_METRIC_HEAVY_OPS …
#define INTEL_TD_METRIC_BR_MISPREDICT …
#define INTEL_TD_METRIC_FETCH_LAT …
#define INTEL_TD_METRIC_MEM_BOUND …
#define INTEL_TD_METRIC_MAX …
#define INTEL_TD_METRIC_NUM …
static inline bool is_metric_idx(int idx)
{ … }
static inline bool is_topdown_idx(int idx)
{ … }
#define INTEL_PMC_OTHER_TOPDOWN_BITS(bit) …
#define GLOBAL_STATUS_COND_CHG …
#define GLOBAL_STATUS_BUFFER_OVF_BIT …
#define GLOBAL_STATUS_BUFFER_OVF …
#define GLOBAL_STATUS_UNC_OVF …
#define GLOBAL_STATUS_ASIF …
#define GLOBAL_STATUS_COUNTERS_FROZEN …
#define GLOBAL_STATUS_LBRS_FROZEN_BIT …
#define GLOBAL_STATUS_LBRS_FROZEN …
#define GLOBAL_STATUS_TRACE_TOPAPMI_BIT …
#define GLOBAL_STATUS_TRACE_TOPAPMI …
#define GLOBAL_STATUS_PERF_METRICS_OVF_BIT …
#define GLOBAL_CTRL_EN_PERF_METRICS …
#define INTEL_PMC_IDX_FIXED_VLBR …
#define INTEL_FIXED_VLBR_EVENT …
struct pebs_basic { … };
struct pebs_meminfo { … };
struct pebs_gprs { … };
struct pebs_xmm { … };
#define EXT_PERFMON_DEBUG_FEATURES …
#define IBS_CPUID_FEATURES …
#define IBS_CAPS_AVAIL …
#define IBS_CAPS_FETCHSAM …
#define IBS_CAPS_OPSAM …
#define IBS_CAPS_RDWROPCNT …
#define IBS_CAPS_OPCNT …
#define IBS_CAPS_BRNTRGT …
#define IBS_CAPS_OPCNTEXT …
#define IBS_CAPS_RIPINVALIDCHK …
#define IBS_CAPS_OPBRNFUSE …
#define IBS_CAPS_FETCHCTLEXTD …
#define IBS_CAPS_OPDATA4 …
#define IBS_CAPS_ZEN4 …
#define IBS_CAPS_DEFAULT …
#define IBSCTL …
#define IBSCTL_LVT_OFFSET_VALID …
#define IBSCTL_LVT_OFFSET_MASK …
#define IBS_FETCH_L3MISSONLY …
#define IBS_FETCH_RAND_EN …
#define IBS_FETCH_VAL …
#define IBS_FETCH_ENABLE …
#define IBS_FETCH_CNT …
#define IBS_FETCH_MAX_CNT …
#define IBS_OP_CUR_CNT …
#define IBS_OP_CUR_CNT_RAND …
#define IBS_OP_CNT_CTL …
#define IBS_OP_VAL …
#define IBS_OP_ENABLE …
#define IBS_OP_L3MISSONLY …
#define IBS_OP_MAX_CNT …
#define IBS_OP_MAX_CNT_EXT …
#define IBS_OP_MAX_CNT_EXT_MASK …
#define IBS_RIP_INVALID …
#ifdef CONFIG_X86_LOCAL_APIC
extern u32 get_ibs_caps(void);
extern int forward_event_to_ibs(struct perf_event *event);
#else
static inline u32 get_ibs_caps(void) { return 0; }
static inline int forward_event_to_ibs(struct perf_event *event) { return -ENOENT; }
#endif
#ifdef CONFIG_PERF_EVENTS
extern void perf_events_lapic_init(void);
#define PERF_EFLAGS_EXACT …
#define PERF_EFLAGS_VM …
struct pt_regs;
struct x86_perf_regs { … };
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
extern unsigned long perf_misc_flags(struct pt_regs *regs);
#define perf_misc_flags(regs) …
#include <asm/stacktrace.h>
#define perf_arch_fetch_caller_regs(regs, __ip) …
struct perf_guest_switch_msr { … };
struct x86_pmu_lbr { … };
extern void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap);
extern u64 perf_get_hw_event_config(int hw_event);
extern void perf_check_microcode(void);
extern void perf_clear_dirty_counters(void);
extern int x86_perf_rdpmc_index(struct perf_event *event);
#else
static inline void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
{
memset(cap, 0, sizeof(*cap));
}
static inline u64 perf_get_hw_event_config(int hw_event)
{
return 0;
}
static inline void perf_events_lapic_init(void) { }
static inline void perf_check_microcode(void) { }
#endif
#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr, void *data);
extern void x86_perf_get_lbr(struct x86_pmu_lbr *lbr);
#else
struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr, void *data);
static inline void x86_perf_get_lbr(struct x86_pmu_lbr *lbr)
{
memset(lbr, 0, sizeof(*lbr));
}
#endif
#ifdef CONFIG_CPU_SUP_INTEL
extern void intel_pt_handle_vmx(int on);
#else
static inline void intel_pt_handle_vmx(int on)
{
}
#endif
#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_AMD)
extern void amd_pmu_enable_virt(void);
extern void amd_pmu_disable_virt(void);
#if defined(CONFIG_PERF_EVENTS_AMD_BRS)
#define PERF_NEEDS_LOPWR_CB …
extern void perf_amd_brs_lopwr_cb(bool lopwr_in);
DECLARE_STATIC_CALL(perf_lopwr_cb, perf_amd_brs_lopwr_cb);
static __always_inline void perf_lopwr_cb(bool lopwr_in)
{ … }
#endif
#else
static inline void amd_pmu_enable_virt(void) { }
static inline void amd_pmu_disable_virt(void) { }
#endif
#define arch_perf_out_copy_user …
#endif