Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/x86/events/amd/ibs.c | static inline int ibs_eilvt_valid(void) {
int offset;
u64 val;
int valid = 0;
preempt_disable();
rdmsrl(MSR_AMD64_IBSCTL, val);
offset = val & IBSCTL_LVT_OFFSET_MASK;
if (!(val & IBSCTL_LVT_OFFSET_VALID)) {
pr_err(FW_BUG
"cpu %d, invalid IBS interrupt offset %d (MSR%08X=0x%016llx)\n",
... | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/ibs.c |
static void clear_APIC_ibs(void) {
int offset;
offset = get_ibs_lvt_offset();
if (offset >= 0)
setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_FIX, 1);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/ibs.c |
static int x86_pmu_amd_ibs_starting_cpu(unsigned int cpu) {
setup_APIC_ibs();
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/ibs.c |
static void perf_ibs_pm_init(void) {
register_syscore_ops(&perf_ibs_syscore_ops);
}
#else | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/ibs.c | static __init int amd_ibs_init(void) {
u32 caps;
caps = __get_ibs_caps();
if (!caps)
return -ENODEV;
ibs_eilvt_setup();
if (!ibs_eilvt_valid())
return -EINVAL;
perf_ibs_pm_init();
ibs_caps = caps;
/* make ibs_caps visible to other cpus: */
smp_mb();
/*
* x86_pmu_amd_ibs_starting_cpu ... | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/iommu.c |
static ssize_t _iommu_event_show(struct device *dev,
struct device_attribute *attr, char *buf) {
struct amd_iommu_event_desc *event =
container_of(attr, struct amd_iommu_event_desc, attr);
return sprintf(buf, "%s\n", event->event);
}
#define AMD_IOMMU_EVENT_DESC(_name, _even... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/iommu.c |
static void perf_iommu_disable_event(struct perf_event *event) {
struct amd_iommu *iommu = perf_event_2_iommu(event);
struct hw_perf_event *hwc = &event->hw;
u64 reg = 0ULL;
amd_iommu_pc_set_reg(iommu, hwc->iommu_bank, hwc->iommu_cntr,
IOMMU_PC_COUNTER_SRC_REG, ®);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/iommu.c | static void perf_iommu_read(struct perf_event *event) {
u64 count;
struct hw_perf_event *hwc = &event->hw;
struct amd_iommu *iommu = perf_event_2_iommu(event);
if (amd_iommu_pc_get_reg(iommu, hwc->iommu_bank, hwc->iommu_cntr,
IOMMU_PC_COUNTER_REG, &count))
return;
count &= GEN... | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/iommu.c | static __init int amd_iommu_pc_init(void) {
unsigned int i, cnt = 0;
int ret;
if (!amd_iommu_pc_supported())
return -ENODEV;
ret = _init_events_attrs();
if (ret)
return ret;
/*
* An IOMMU PMU is specific to an IOMMU, and can function independently.
* So we go through all IOMMUs and ignore t... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/lbr.c | int amd_pmu_lbr_hw_config(struct perf_event *event) {
int ret = 0;
if (!is_sampling_event(event))
return -EINVAL;
ret = amd_pmu_lbr_setup_filter(event);
if (!ret)
event->attach_state |= PERF_ATTACH_SCHED_CB;
return ret;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/lbr.c | void amd_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
bool sched_in) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
if (cpuc->lbr_users && sched_in)
amd_pmu_lbr_reset();
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/lbr.c | void amd_pmu_lbr_enable_all(void) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
u64 lbr_select, dbg_ctl, dbg_extn_cfg;
if (!cpuc->lbr_users || !x86_pmu.lbr_nr)
return;
if (cpuc->lbr_select) {
lbr_select = cpuc->lbr_sel->config & LBR_SELECT_MASK;
wrmsrl(MSR_AMD64_LBR_SELECT, lbr_sele... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/lbr.c |
void amd_pmu_lbr_disable_all(void) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
u64 dbg_ctl, dbg_extn_cfg;
if (!cpuc->lbr_users || !x86_pmu.lbr_nr)
return;
rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
wrmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg & ~... | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/lbr.c | __init int amd_pmu_lbr_init(void) {
union cpuid_0x80000022_ebx ebx;
if (x86_pmu.version < 2 || !boot_cpu_has(X86_FEATURE_AMD_LBR_V2))
return -EOPNOTSUPP;
ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
x86_pmu.lbr_nr = ebx.split.lbr_v2_stack_sz;
pr_cont("%d-deep LBR, ", x86_pmu.lbr_nr);
return 0;
... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/power.c | static int power_cpu_exit(unsigned int cpu) {
int target;
if (!cpumask_test_and_clear_cpu(cpu, &cpu_mask))
return 0;
target = cpumask_any_but(topology_sibling_cpumask(cpu), cpu);
if (target < nr_cpumask_bits) {
cpumask_set_cpu(target, &cpu_mask);
perf_pmu_migrate_context(&pmu_class, cpu, target);
... | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c |
static bool is_llc_event(struct perf_event *event) {
return event->pmu->type == amd_llc_pmu.type;
} | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c |
static struct amd_uncore *event_to_amd_uncore(struct perf_event *event) {
if (is_nb_event(event) && amd_uncore_nb)
return *per_cpu_ptr(amd_uncore_nb, event->cpu);
else if (is_llc_event(event) && amd_uncore_llc)
return *per_cpu_ptr(amd_uncore_llc, event->cpu);
return NULL;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c | static void amd_uncore_read(struct perf_event *event) {
struct hw_perf_event *hwc = &event->hw;
u64 prev, new;
s64 delta;
prev = local64_read(&hwc->prev_count);
rdpmcl(hwc->event_base_rdpmc, new);
local64_set(&hwc->prev_count, new);
delta = (new << COUNTER_SHIFT) - (prev << COUNTER_SHIFT);
delta >>= CO... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c | static int amd_uncore_event_init(struct perf_event *event) {
struct amd_uncore *uncore;
struct hw_perf_event *hwc = &event->hw;
u64 event_mask = AMD64_RAW_EVENT_MASK_NB;
if (event->attr.type != event->pmu->type)
return -ENOENT;
if (pmu_version >= 2 && is_nb_event(event))
event_mask = AMD64_PERFMON_V... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c |
static struct amd_uncore *amd_uncore_alloc(unsigned int cpu) {
return kzalloc_node(sizeof(struct amd_uncore), GFP_KERNEL, cpu_to_node(cpu));
} | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c | static void uncore_down_prepare(unsigned int cpu,
struct amd_uncore *__percpu *uncores) {
unsigned int i;
struct amd_uncore *this = *per_cpu_ptr(uncores, cpu);
if (this->cpu != cpu)
return;
for_each_online_cpu(i) {
struct amd_uncore *that = *per_cpu_ptr(uncores, i);
... | [
0,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c |
static void uncore_dead(unsigned int cpu,
struct amd_uncore *__percpu *uncores) {
struct amd_uncore *uncore = *per_cpu_ptr(uncores, cpu);
if (cpu == uncore->cpu)
cpumask_clear_cpu(cpu, uncore->active_mask);
if (!--uncore->refcnt) {
kfree(uncore->events);
kfree(uncore);
}
... | [
1,
0
] |
Linux Kernel | arch/x86/events/amd/uncore.c |
static void __exit amd_uncore_exit(void) {
cpuhp_remove_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE);
cpuhp_remove_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING);
cpuhp_remove_state(CPUHP_PERF_X86_AMD_UNCORE_PREP);
if (boot_cpu_has(X86_FEATURE_PERFCTR_LLC)) {
perf_pmu_unregister(&amd_llc_pmu);
free_percpu... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static int x86_pmu_extra_regs(u64 config, struct perf_event *event) {
struct extra_reg *extra_regs = hybrid(event->pmu, extra_regs);
struct hw_perf_event_extra *reg;
struct extra_reg *er;
reg = &event->hw.extra_reg;
if (!extra_regs)
return 0;
for (er = extra_regs; er->msr; er++) {
if (er->event !... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static void release_pmc_hardware(void) {
int i, num_counters = get_possible_num_counters();
for (i = 0; i < num_counters; i++) {
release_perfctr_nmi(x86_pmu_event_addr(i));
release_evntsel_nmi(x86_pmu_config_addr(i));
}
}
#else | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static bool reserve_pmc_hardware(void) { return true; } | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static void release_pmc_hardware(void) {}
#endif | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
int x86_reserve_hardware(void) {
int err = 0;
if (!atomic_inc_not_zero(&pmc_refcount)) {
mutex_lock(&pmc_reserve_mutex);
if (atomic_read(&pmc_refcount) == 0) {
if (!reserve_pmc_hardware()) {
err = -EBUSY;
} else {
reserve_ds_buffers();
reserve_lbr_buffers();
}
... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
void x86_release_hardware(void) {
if (atomic_dec_and_mutex_lock(&pmc_refcount, &pmc_reserve_mutex)) {
release_pmc_hardware();
release_ds_buffers();
release_lbr_buffers();
mutex_unlock(&pmc_reserve_mutex);
}
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static int __x86_pmu_event_init(struct perf_event *event) {
int err;
if (!x86_pmu_initialized())
return -ENODEV;
err = x86_reserve_hardware();
if (err)
return err;
atomic_inc(&active_events);
event->destroy = hw_perf_event_destroy;
event->hw.idx = -1;
event->hw.last_cpu = -1;
event->hw.las... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr, void *data) {
return static_call(x86_pmu_guest_get_msrs)(nr, data);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static inline int is_x86_event(struct perf_event *event) {
int i;
if (!is_hybrid())
return event->pmu == &pmu;
for (i = 0; i < x86_pmu.num_hybrid_pmus; i++) {
if (event->pmu == &x86_pmu.hybrid_pmu[i].pmu)
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | struct pmu *x86_get_pmu(unsigned int cpu) {
struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
if (WARN_ON_ONCE(!cpuc->pmu))
return &pmu;
return cpuc->pmu;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | int perf_assign_events(struct event_constraint **constraints, int n, int wmin,
int wmax, int gpmax, int *assign) {
struct perf_sched sched;
perf_sched_init(&sched, constraints, n, wmin, wmax, gpmax);
do {
if (!perf_sched_find_counter(&sched))
break;
if (assign)
assign[... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static void del_nr_metric_event(struct cpu_hw_events *cpuc,
struct perf_event *event) {
if (is_metric_event(event))
cpuc->n_metric--;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,
bool dogrp) {
int num_counters = hybrid(cpuc->pmu, num_counters);
int num_counters_fixed = hybrid(cpuc->pmu, num_counters_fixed);
struct perf_event *event;
int n, max_count;
max_count = num_counters + n... | [
1,
0
] |
Linux Kernel | arch/x86/events/core.c |
static inline int match_prev_assignment(struct hw_perf_event *hwc,
struct cpu_hw_events *cpuc, int i) {
return hwc->idx == cpuc->assign[i] && hwc->last_cpu == smp_processor_id() &&
hwc->last_tag == cpuc->tags[i];
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | int x86_perf_event_set_period(struct perf_event *event) {
struct hw_perf_event *hwc = &event->hw;
s64 left = local64_read(&hwc->period_left);
s64 period = hwc->sample_period;
int ret = 0, idx = hwc->idx;
if (unlikely(!hwc->event_base))
return 0;
if (unlikely(left <= -period)) {
left = period;
... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
void x86_pmu_enable_event(struct perf_event *event) {
if (__this_cpu_read(cpu_hw_events.enabled))
__x86_pmu_enable_event(&event->hw, ARCH_PERFMON_EVENTSEL_ENABLE);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static void x86_pmu_del(struct perf_event *event, int flags) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
union perf_capabilities intel_cap = hybrid(cpuc->pmu, intel_cap);
int i;
/*
* If we're called during a txn, we only need to undo x86_pmu.add.
* The events never got scheduled and ->ca... | [
1,
1
] |
Linux Kernel | arch/x86/events/core.c |
static int x86_pmu_dead_cpu(unsigned int cpu) {
if (x86_pmu.cpu_dead)
x86_pmu.cpu_dead(cpu);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static int x86_pmu_online_cpu(unsigned int cpu) {
struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
int i;
for (i = 0; i < X86_PERF_KFREE_MAX; i++) {
kfree(cpuc->kfree_on_online[i]);
cpuc->kfree_on_online[i] = NULL;
}
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static int x86_pmu_starting_cpu(unsigned int cpu) {
if (x86_pmu.cpu_starting)
x86_pmu.cpu_starting(cpu);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | ssize_t events_ht_sysfs_show(struct device *dev, struct device_attribute *attr,
char *page) {
struct perf_pmu_events_ht_attr *pmu_attr =
container_of(attr, struct perf_pmu_events_ht_attr, attr);
return sprintf(page, "%s",
topology_max_smt_threads() > 1 ? pmu_attr... | [
1,
0
] |
Linux Kernel | arch/x86/events/core.c |
void x86_pmu_show_pmu_cap(int num_counters, int num_counters_fixed,
u64 intel_ctrl) {
pr_info("... version: %d\n", x86_pmu.version);
pr_info("... bit width: %d\n", x86_pmu.cntval_bits);
pr_info("... generic registers: %d\n", num_counters);
pr_info("...... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | void perf_clear_dirty_counters(void) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
int i;
for (i = 0; i < cpuc->n_events; i++)
__clear_bit(cpuc->assign[i], cpuc->dirty);
if (bitmap_empty(cpuc->dirty, X86_PMC_IDX_MAX))
return;
for_each_set_bit(i, cpuc->dirty, X86_PMC_IDX_MAX) {
if... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static int x86_pmu_event_idx(struct perf_event *event) {
struct hw_perf_event *hwc = &event->hw;
if (!(hwc->flags & PERF_EVENT_FLAG_USER_READ_CNT))
return 0;
if (is_metric_idx(hwc->idx))
return INTEL_PMC_FIXED_RDPMC_METRICS + 1;
else
return hwc->event_base_rdpmc + 1;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static ssize_t set_attr_rdpmc(struct device *cdev,
struct device_attribute *attr, const char *buf,
size_t count) {
unsigned long val;
ssize_t ret;
ret = kstrtoul(buf, 0, &val);
if (ret)
return ret;
if (val > 2)
return -EINVAL;
if (x86_pm... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
static void x86_pmu_swap_task_ctx(struct perf_event_pmu_context *prev_epc,
struct perf_event_pmu_context *next_epc) {
static_call_cond(x86_pmu_swap_task_ctx)(prev_epc, next_epc);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c |
void perf_check_microcode(void) {
if (x86_pmu.check_microcode)
x86_pmu.check_microcode();
} | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | void arch_perf_update_userpage(struct perf_event *event,
struct perf_event_mmap_page *userpg, u64 now) {
struct cyc2ns_data data;
u64 offset;
userpg->cap_user_time = 0;
userpg->cap_user_time_zero = 0;
userpg->cap_user_rdpmc = !!(event->hw.flags & PERF_EVENT_FLAG_USER_READ_CNT);... | [
0,
0
] |
Linux Kernel | arch/x86/events/core.c | static unsigned long get_segment_base(unsigned int segment) {
struct desc_struct *desc;
unsigned int idx = segment >> 3;
if ((segment & SEGMENT_TI_MASK) == SEGMENT_LDT) {
#ifdef CONFIG_MODIFY_LDT_SYSCALL
struct ldt_struct *ldt;
ldt = READ_ONCE(current->active_mm->context.ldt);
if (!ldt || idx >= ldt... | [
1,
0
] |
Linux Kernel | arch/x86/events/core.c |
u64 perf_get_hw_event_config(int hw_event) {
int max = x86_pmu.max_events;
if (hw_event < max)
return x86_pmu.event_map(array_index_nospec(hw_event, max));
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c |
static int buf_nr_pages(struct page *page) {
if (!PagePrivate(page))
return 1;
return 1 << page_private(page);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c |
static size_t buf_size(struct page *page) {
return buf_nr_pages(page) * PAGE_SIZE;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c |
static unsigned long bts_buffer_offset(struct bts_buffer *buf,
unsigned int idx) {
return buf->buf[idx].offset + buf->buf[idx].displacement;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c |
static void bts_config_buffer(struct bts_buffer *buf) {
int cpu = raw_smp_processor_id();
struct debug_store *ds = per_cpu(cpu_hw_events, cpu).ds;
struct bts_phys *phys = &buf->buf[buf->cur_buf];
unsigned long index, thresh = 0, end = phys->size;
struct page *page = phys->page;
index = local_read(&buf->he... | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c | static void __bts_event_start(struct perf_event *event) {
struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
struct bts_buffer *buf = perf_get_aux(&bts->handle);
u64 config = 0;
if (!buf->snapshot)
config |= ARCH_PERFMON_EVENTSEL_INT;
if (!event->attr.exclude_kernel)
config |= ARCH_PERFMON_EVENTSEL_OS;
... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c |
static void bts_event_start(struct perf_event *event, int flags) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
struct bts_buffer *buf;
buf = perf_aux_output_begin(&bts->handle, event);
if (!buf)
goto fail_stop;
if (bts_buffer_reset(buf, &bt... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/bts.c |
static void bts_event_read(struct perf_event *event) {} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static void intel_tfa_commit_scheduling(struct cpu_hw_events *cpuc, int idx,
int cntr) {
if (cntr == 3)
intel_set_tfa(cpuc, true);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static inline void intel_pmu_ack_status(u64 ack) {
wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, ack);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static inline void intel_clear_masks(struct perf_event *event, int idx) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
__clear_bit(idx, (unsigned long *)&cpuc->intel_ctrl_guest_mask);
__clear_bit(idx, (unsigned long *)&cpuc->intel_ctrl_host_mask);
__clear_bit(idx, (unsigned long *)&cpuc->intel_c... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static void intel_pmu_disable_fixed(struct perf_event *event) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx;
u64 mask;
if (is_topdown_idx(idx)) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
if (*(u64 *)cpuc->act... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static inline u64 icl_get_metrics_event_value(u64 metric, u64 slots, int idx) {
u32 val;
val = (metric >> ((idx - INTEL_PMC_IDX_METRIC_BASE) * 8)) & 0xff;
return mul_u64_u32_div(slots, val, 0xff);
} | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static u64 adl_update_topdown_event(struct perf_event *event) {
struct x86_hybrid_pmu *pmu = hybrid_pmu(event->pmu);
if (pmu->cpu_type != hybrid_big)
return 0;
return icl_update_topdown_event(event);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static void intel_pmu_read_topdown_event(struct perf_event *event) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
if ((cpuc->txn_flags & PERF_PMU_TXN_READ) && !is_slots_event(event))
return;
perf_pmu_disable(event->pmu);
static_call(intel_pmu_update_topdown_event)(event);
perf_pmu_enable(e... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static void intel_pmu_read_event(struct perf_event *event) {
if (event->hw.flags & PERF_X86_EVENT_AUTO_RELOAD)
intel_pmu_auto_reload_read(event);
else if (is_topdown_count(event))
intel_pmu_read_topdown_event(event);
else
x86_perf_event_update(event);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static void intel_pmu_enable_fixed(struct perf_event *event) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct hw_perf_event *hwc = &event->hw;
u64 mask, bits = 0;
int idx = hwc->idx;
if (is_topdown_idx(idx)) {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
if (*(u64 *)... | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static void intel_pmu_enable_event(struct perf_event *event) {
struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx;
if (unlikely(event->attr.precise_ip))
intel_pmu_pebs_enable(event);
switch (idx) {
case 0 ... INTEL_PMC_IDX_FIXED - 1:
intel_set_masks(event, idx);
__x86_pmu_enable_event(h... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static void intel_pmu_add_event(struct perf_event *event) {
if (event->attr.precise_ip)
intel_pmu_pebs_add(event);
if (needs_branch_stack(event))
intel_pmu_lbr_add(event);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static int intel_pmu_set_period(struct perf_event *event) {
if (unlikely(is_topdown_count(event)))
return static_call(intel_pmu_set_topdown_event_period)(event);
return x86_perf_event_set_period(event);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static void intel_pmu_reset(void) {
struct debug_store *ds = __this_cpu_read(cpu_hw_events.ds);
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
int num_counters_fixed = hybrid(cpuc->pmu, num_counters_fixed);
int num_counters = hybrid(cpuc->pmu, num_counters);
unsigned long flags;
int idx;
if (... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
struct event_constraint *x86_get_event_constraints(struct cpu_hw_events *cpuc,
int idx,
struct perf_event *event) {
struct event_constraint *event_constraints =
hybrid(cpuc->pmu, event_constraints);
struct e... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static struct event_constraint *
__intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
struct perf_event *event) {
struct event_constraint *c;
c = intel_vlbr_constraints(event);
if (c)
return c;
c = intel_bts_constraints(event);
if (c)
return c;
c = int... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static void intel_put_excl_constraints(struct cpu_hw_events *cpuc,
struct perf_event *event) {
struct hw_perf_event *hwc = &event->hw;
struct intel_excl_cntrs *excl_cntrs = cpuc->excl_cntrs;
int tid = cpuc->excl_thread_id;
struct intel_excl_states *xl;
if (cpuc->is_fake... | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static int hsw_hw_config(struct perf_event *event) {
int ret = intel_pmu_hw_config(event);
if (ret)
return ret;
if (!boot_cpu_has(X86_FEATURE_RTM) && !boot_cpu_has(X86_FEATURE_HLE))
return 0;
event->hw.config |= event->attr.config & (HSW_IN_TX | HSW_IN_TX_CHECKPOINTED);
if ((event->hw.config & (HSW_... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static struct event_constraint *
spr_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
struct perf_event *event) {
struct event_constraint *c;
c = icl_get_event_constraints(cpuc, idx, event);
if ((event->attr.precise_ip == 3) &&
!constraint_match(&fixed0_constraint, even... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static bool init_hybrid_pmu(int cpu) {
struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
u8 cpu_type = get_this_hybrid_cpu_type();
struct x86_hybrid_pmu *pmu = NULL;
int i;
if (!cpu_type && x86_pmu.get_hybrid_cpu_type)
cpu_type = x86_pmu.get_hybrid_cpu_type();
for (i = 0; i < x86_pmu.num_hybr... | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
void intel_cpuc_finish(struct cpu_hw_events *cpuc) {
struct intel_shared_regs *pc;
pc = cpuc->shared_regs;
if (pc) {
if (pc->core_id == -1 || --pc->refcnt == 0)
kfree(pc);
cpuc->shared_regs = NULL;
}
free_excl_cntrs(cpuc);
} | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static void intel_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx,
bool sched_in) {
intel_pmu_pebs_sched_task(pmu_ctx, sched_in);
intel_pmu_lbr_sched_task(pmu_ctx, sched_in);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static int intel_pmu_check_period(struct perf_event *event, u64 value) {
return intel_pmu_has_bts_period(event, value) ? -EINVAL : 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static int intel_pmu_aux_output_match(struct perf_event *event) {
if (!x86_pmu.intel_cap.pebs_output_pt_available)
return 0;
return is_intel_pt_event(event);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c | static __init void intel_clovertown_quirk(void) {
pr_warn("PEBS disabled due to CPU errata\n");
x86_pmu.pebs = 0;
x86_pmu.pebs_constraints = NULL;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static __init void intel_pebs_isolation_quirk(void) {
WARN_ON_ONCE(x86_pmu.check_microcode);
x86_pmu.check_microcode = intel_check_pebs_isolation;
intel_check_pebs_isolation();
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static __init void intel_sandybridge_quirk(void) {
x86_pmu.check_microcode = intel_snb_check_microcode;
cpus_read_lock();
intel_snb_check_microcode();
cpus_read_unlock();
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static ssize_t freeze_on_smi_store(struct device *cdev,
struct device_attribute *attr,
const char *buf, size_t count) {
unsigned long val;
ssize_t ret;
ret = kstrtoul(buf, 0, &val);
if (ret)
return ret;
if (val > 1)
return -EINVA... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static ssize_t show_sysctl_tfa(struct device *cdev,
struct device_attribute *attr, char *buf) {
return snprintf(buf, 40, "%d\n", allow_tsx_force_abort);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static ssize_t branches_show(struct device *cdev, struct device_attribute *attr,
char *buf) {
return snprintf(buf, PAGE_SIZE, "%d\n", x86_pmu.lbr_nr);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static umode_t tsx_is_visible(struct kobject *kobj, struct attribute *attr,
int i) {
return boot_cpu_has(X86_FEATURE_RTM) ? attr->mode : 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static umode_t exra_is_visible(struct kobject *kobj, struct attribute *attr,
int i) {
return x86_pmu.version >= 2 ? attr->mode : 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static inline int hybrid_find_supported_cpu(struct x86_hybrid_pmu *pmu) {
int cpu = cpumask_first(&pmu->supported_cpus);
return (cpu >= nr_cpu_ids) ? -1 : cpu;
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static umode_t hybrid_tsx_is_visible(struct kobject *kobj,
struct attribute *attr, int i) {
struct device *dev = kobj_to_dev(kobj);
struct x86_hybrid_pmu *pmu =
container_of(dev_get_drvdata(dev), struct x86_hybrid_pmu, pmu);
int cpu = hybrid_find_supported_cpu(pmu);
... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static umode_t hybrid_format_is_visible(struct kobject *kobj,
struct attribute *attr, int i) {
struct device *dev = kobj_to_dev(kobj);
struct x86_hybrid_pmu *pmu =
container_of(dev_get_drvdata(dev), struct x86_hybrid_pmu, pmu);
struct perf_pmu_format_hybrid_attr *pmu... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static void intel_pmu_check_num_counters(int *num_counters,
int *num_counters_fixed,
u64 *intel_ctrl, u64 fixed_mask) {
if (*num_counters > INTEL_PMC_MAX_GENERIC) {
WARN(1, KERN_ERR "hw perf events %d > max(%d), clipping!", *num_co... | [
1,
0
] |
Linux Kernel | arch/x86/events/intel/core.c |
static void intel_pmu_check_hybrid_pmus(u64 fixed_mask) {
struct x86_hybrid_pmu *pmu;
int i;
for (i = 0; i < x86_pmu.num_hybrid_pmus; i++) {
pmu = &x86_pmu.hybrid_pmu[i];
intel_pmu_check_num_counters(&pmu->num_counters, &pmu->num_counters_fixed,
&pmu->intel_ctrl, fixed_... | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/cstate.c |
static void cstate_pmu_event_start(struct perf_event *event, int mode) {
local64_set(&event->hw.prev_count, cstate_pmu_read_counter(event));
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/cstate.c |
static void cstate_pmu_event_stop(struct perf_event *event, int mode) {
cstate_pmu_event_update(event);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/cstate.c |
static void cstate_pmu_event_del(struct perf_event *event, int mode) {
cstate_pmu_event_stop(event, PERF_EF_UPDATE);
} | [
0,
0
] |
Linux Kernel | arch/x86/events/intel/cstate.c |
static int cstate_pmu_event_add(struct perf_event *event, int mode) {
if (mode & PERF_EF_START)
cstate_pmu_event_start(event, mode);
return 0;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.