Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/events/intel/cstate.c
static int cstate_cpu_init(unsigned int cpu) { unsigned int target; target = cpumask_any_and(&cstate_core_cpu_mask, topology_sibling_cpumask(cpu)); if (has_cstate_core && target >= nr_cpu_ids) cpumask_set_cpu(cpu, &cstate_core_cpu_mask); /* * If this is the first online thread of that package, s...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/cstate.c
static int __init cstate_probe(const struct cstate_model *cm) { if (cm->quirks & SLM_PKG_C6_USE_C7_MSR) pkg_msr[PERF_CSTATE_PKG_C6_RES].msr = MSR_PKG_C7_RESIDENCY; /* KNL has different MSR for CORE C6 */ if (cm->quirks & KNL_CORE_C6_MSR) pkg_msr[PERF_CSTATE_CORE_C6_RES].msr = MSR_KNL_CORE_C6_RESIDENCY; ...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/cstate.c
static int __init cstate_init(void) { int err; cpuhp_setup_state(CPUHP_AP_PERF_X86_CSTATE_STARTING, "perf/x86/cstate:starting", cstate_cpu_init, NULL); cpuhp_setup_state(CPUHP_AP_PERF_X86_CSTATE_ONLINE, "perf/x86/cstate:online", NULL, cstate_cpu_exit); if (has_cstate_c...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/cstate.c
static void __exit cstate_pmu_exit(void) { cstate_cleanup(); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void __init __intel_pmu_pebs_data_source_grt(u64 *data_source) { data_source[0x05] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HIT); data_source[0x06] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HITM); data_source[0x08] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOPX, FWD); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static u64 precise_datala_hsw(struct perf_event *event, u64 status) { union perf_mem_data_src dse; dse.val = PERF_MEM_NA; if (event->hw.flags & PERF_X86_EVENT_PEBS_ST_HSW) dse.mem_op = PERF_MEM_OP_STORE; else if (event->hw.flags & PERF_X86_EVENT_PEBS_LD_HSW) dse.mem_op = PERF_MEM_OP_LOAD; if (event...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
u64 adl_latency_data_small(struct perf_event *event, u64 status) { union intel_x86_pebs_dse dse; u64 val; WARN_ON_ONCE(hybrid_pmu(event->pmu)->cpu_type == hybrid_big); dse.val = status; val = hybrid_var(event->pmu, pebs_data_source)[dse.ld_dse]; pebs_set_tlb_lock(&val, dse.ld_locked, dse.ld_stlb_miss); ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static u64 load_latency_data(struct perf_event *event, u64 status) { union intel_x86_pebs_dse dse; u64 val; dse.val = status; val = hybrid_var(event->pmu, pebs_data_source)[dse.ld_dse]; /* * Nehalem models do not support TLB, Lock infos */ if (x86_pmu.pebs_no_tlb) { val |= P(TLB, NA) | P(LOCK, ...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static u64 store_latency_data(struct perf_event *event, u64 status) { union intel_x86_pebs_dse dse; union perf_mem_data_src src; u64 val; dse.val = status; val = hybrid_var(event->pmu, pebs_data_source)[dse.st_lat_dse]; pebs_set_tlb_lock(&val, dse.st_lat_stlb_miss, dse.st_lat_locked); val |= P(BLK, NA...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
void init_debug_store_on_cpu(int cpu) { struct debug_store *ds = per_cpu(cpu_hw_events, cpu).ds; if (!ds) return; wrmsr_on_cpu(cpu, MSR_IA32_DS_AREA, (u32)((u64)(unsigned long)ds), (u32)((u64)(unsigned long)ds >> 32)); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void *dsalloc_pages(size_t size, gfp_t flags, int cpu) { unsigned int order = get_order(size); int node = cpu_to_node(cpu); struct page *page; page = __alloc_pages_node(node, flags | __GFP_ZERO, order); return page ? page_address(page) : NULL; }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void dsfree_pages(const void *buffer, size_t size) { if (buffer) free_pages((unsigned long)buffer, get_order(size)); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static int alloc_pebs_buffer(int cpu) { struct cpu_hw_events *hwev = per_cpu_ptr(&cpu_hw_events, cpu); struct debug_store *ds = hwev->ds; size_t bsiz = x86_pmu.pebs_buffer_size; int max, node = cpu_to_node(cpu); void *buffer, *insn_buff, *cea; if (!x86_pmu.pebs) return 0; buffer = dsalloc_pages(bsiz...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static int alloc_bts_buffer(int cpu) { struct cpu_hw_events *hwev = per_cpu_ptr(&cpu_hw_events, cpu); struct debug_store *ds = hwev->ds; void *buffer, *cea; int max; if (!x86_pmu.bts) return 0; buffer = dsalloc_pages(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_NOWARN, cpu); if (unlikely(!buffer)) { WARN...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static int alloc_ds_buffer(int cpu) { struct debug_store *ds = &get_cpu_entry_area(cpu)->cpu_debug_store; memset(ds, 0, sizeof(*ds)); per_cpu(cpu_hw_events, cpu).ds = ds; return 0; }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void release_ds_buffer(int cpu) { per_cpu(cpu_hw_events, cpu).ds = NULL; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static inline void intel_pmu_drain_pebs_buffer(void) { struct perf_sample_data data; x86_pmu.drain_pebs(NULL, &data); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void adaptive_pebs_record_size_update(void) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); u64 pebs_data_cfg = cpuc->pebs_data_cfg; int sz = sizeof(struct pebs_basic); if (pebs_data_cfg & PEBS_DATACFG_MEMINFO) sz += sizeof(struct pebs_meminfo); if (pebs_data_cfg & PEBS_DATACFG_GP) ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static u64 pebs_update_adaptive_cfg(struct perf_event *event) { struct perf_event_attr *attr = &event->attr; u64 sample_type = attr->sample_type; u64 pebs_data_cfg = 0; bool gprs, tsx_weight; if (!(sample_type & ~(PERF_SAMPLE_IP | PERF_SAMPLE_TIME)) && attr->precise_ip > 1) return pebs_data_cfg; ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc, struct perf_event *event, bool add) { struct pmu *pmu = event->pmu; bool update = cpuc->n_pebs == 1; if (needed_cb != pebs_needs_sched_cb(cpuc)) { if (!needed_cb) perf_sched_cb_inc(pmu); else ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void intel_pmu_pebs_via_pt_disable(struct perf_event *event) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); if (!is_pebs_pt(event)) return; if (!(cpuc->pebs_enabled & ~PEBS_VIA_PT_MASK)) cpuc->pebs_enabled &= ~PEBS_VIA_PT_MASK; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void intel_pmu_pebs_via_pt_enable(struct perf_event *event) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); struct hw_perf_event *hwc = &event->hw; struct debug_store *ds = cpuc->ds; u64 value = ds->pebs_event_reset[hwc->idx]; u32 base = MSR_RELOAD_PMC0; unsigned int idx = hwc->idx; ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
void intel_pmu_pebs_del(struct perf_event *event) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); struct hw_perf_event *hwc = &event->hw; bool needed_cb = pebs_needs_sched_cb(cpuc); cpuc->n_pebs--; if (hwc->flags & PERF_X86_EVENT_LARGE_PEBS) cpuc->n_large_pebs--; if (hwc->flags & PERF_X86...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static inline u64 get_pebs_status(void *n) { if (x86_pmu.intel_cap.pebs_format < 4) return ((struct pebs_record_nhm *)n)->status; return ((struct pebs_basic *)n)->applicable_counters; } #define PERF_X86_EVENT_PEBS_HSW_PREC \ (PERF_X86_EVENT_PEBS_ST_HSW | PERF_X86_EV...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static inline void *get_next_pebs_record_by_bit(void *base, void *top, int bit) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); void *at; u64 pebs_status; if (x86_pmu.intel_cap.pebs_format < 1) return base; if (base == NULL) return NULL; ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void intel_pmu_drain_pebs_core(struct pt_regs *iregs, struct perf_sample_data *data) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); struct debug_store *ds = cpuc->ds; struct perf_event *event = cpuc->events[0]; struct pebs_record_core *at, *top; int n...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/ds.c
static void intel_pmu_pebs_event_update_no_drain(struct cpu_hw_events *cpuc, int size) { struct perf_event *event; int bit; for_each_set_bit(bit, (unsigned long *)&cpuc->pebs_enabled, size) { event = cpuc->events[bit]; if (event->hw.flags & PERF_X86_EVENT_...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/knc.c
static u64 knc_pmu_event_map(int hw_event) { return knc_perfmon_event_map[hw_event]; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/knc.c
static inline u64 knc_pmu_get_status(void) { u64 status; rdmsrl(MSR_KNC_IA32_PERF_GLOBAL_STATUS, status); return status; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/knc.c
static int knc_pmu_handle_irq(struct pt_regs *regs) { struct perf_sample_data data; struct cpu_hw_events *cpuc; int handled = 0; int bit, loops; u64 status; cpuc = this_cpu_ptr(&cpu_hw_events); knc_pmu_disable_all(); status = knc_pmu_get_status(); if (!status) { knc_pmu_enable_all(0); retur...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
static __always_inline bool is_lbr_call_stack_bit_set(u64 config) { if (static_cpu_has(X86_FEATURE_ARCH_LBR)) return !!(config & ARCH_LBR_CALL_STACK); return !!(config & LBR_CALL_STACK); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
static void __intel_pmu_lbr_enable(bool pmi) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); u64 debugctl, lbr_select = 0, orig_debugctl; if (pmi && x86_pmu.version >= 4) return; /* * No need to reprogram LBR_SELECT in a PMI, as it * did not change. */ if (cpuc->lbr_sel) lbr_se...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
void intel_pmu_lbr_reset_64(void) { int i; for (i = 0; i < x86_pmu.lbr_nr; i++) { wrmsrl(x86_pmu.lbr_from + i, 0); wrmsrl(x86_pmu.lbr_to + i, 0); if (x86_pmu.lbr_has_info) wrmsrl(x86_pmu.lbr_info + i, 0); } }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
static __always_inline u64 rdlbr_info(unsigned int idx, struct lbr_entry *lbr) { u64 val; if (lbr) return lbr->info; rdmsrl(x86_pmu.lbr_info + idx, val); return val; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
void release_lbr_buffers(void) { struct kmem_cache *kmem_cache; struct cpu_hw_events *cpuc; int cpu; if (!static_cpu_has(X86_FEATURE_ARCH_LBR)) return; for_each_possible_cpu(cpu) { cpuc = per_cpu_ptr(&cpu_hw_events, cpu); kmem_cache = x86_get_pmu(cpu)->task_ctx_cache; if (kmem_cache && cpuc...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
void intel_pmu_lbr_enable_all(bool pmi) { struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); if (cpuc->lbr_users && !vlbr_exclude_host()) __intel_pmu_lbr_enable(pmi); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
static __always_inline u16 get_lbr_cycles(u64 info) { u16 cycles = info & LBR_INFO_CYCLES; if (static_cpu_has(X86_FEATURE_ARCH_LBR) && (!static_branch_likely(&x86_lbr_cycles) || !(info & LBR_INFO_CYC_CNT_VALID))) cycles = 0; return cycles; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
static void intel_pmu_arch_lbr_read_xsave(struct cpu_hw_events *cpuc) { struct x86_perf_task_context_arch_lbr_xsave *xsave = cpuc->lbr_xsave; if (!xsave) { intel_pmu_store_lbr(cpuc, NULL); return; } xsaves(&xsave->xsave, XFEATURE_MASK_LBR); intel_pmu_store_lbr(cpuc, xsave->lbr.entries); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
int intel_pmu_setup_lbr_filter(struct perf_event *event) { int ret = 0; if (!x86_pmu.lbr_nr) return -EOPNOTSUPP; /* * setup SW LBR filter */ ret = intel_pmu_setup_sw_lbr_filter(event); if (ret) return ret; /* * setup HW LBR filter, if any */ if (x86_pmu.lbr_sel_map) ret = intel_...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
void __init intel_pmu_lbr_init_slm(void) { x86_pmu.lbr_nr = 8; x86_pmu.lbr_tos = MSR_LBR_TOS; x86_pmu.lbr_from = MSR_LBR_CORE_FROM; x86_pmu.lbr_to = MSR_LBR_CORE_TO; x86_pmu.lbr_sel_mask = LBR_SEL_MASK; x86_pmu.lbr_sel_map = nhm_lbr_sel_map; pr_cont("8-deep LBR, "); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/lbr.c
void intel_pmu_lbr_init(void) { switch (x86_pmu.intel_cap.lbr_format) { case LBR_FORMAT_EIP_FLAGS2: x86_pmu.lbr_has_tsx = 1; x86_pmu.lbr_from_flags = 1; if (lbr_from_signext_quirk_needed()) static_branch_enable(&lbr_from_quirk_key); break; case LBR_FORMAT_EIP_FLAGS: x86_pmu.lbr_from_fla...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/p4.c
static struct p4_event_bind *p4_config_get_bind(u64 config) { unsigned int evnt = p4_config_unpack_event(config); struct p4_event_bind *bind = NULL; if (evnt < ARRAY_SIZE(p4_event_bind_map)) bind = &p4_event_bind_map[evnt]; return bind; }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/p4.c
static void p4_pmu_disable_pebs(void) { /* * FIXME * * It's still allowed that two threads setup same cache * events so we can't simply clear metrics until we knew * no one is depending on us, so we need kind of counter * for "ReplayEvent" users. * * What is more complex -- RAW events, if user...
[ 0, 1 ]
Linux Kernel
arch/x86/events/intel/p4.c
static void p4_pmu_enable_pebs(u64 config) { struct p4_pebs_bind *bind; unsigned int idx; BUILD_BUG_ON(P4_PEBS_METRIC__max > P4_PEBS_CONFIG_METRIC_MASK); idx = p4_config_unpack_metric(config); if (idx == P4_PEBS_METRIC__none) return; bind = &p4_pebs_bind_map[idx]; (void)wrmsrl_safe(MSR_IA32_PEBS_E...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/p4.c
static int p4_next_cntr(int thread, unsigned long *used_mask, struct p4_event_bind *bind) { int i, j; for (i = 0; i < P4_CNTR_LIMIT; i++) { j = bind->cntr[thread][i]; if (j != -1 && !test_bit(j, used_mask)) return j; } return -1; }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/p6.c
static void p6_pmu_disable_all(void) { u64 val; rdmsrl(MSR_P6_EVNTSEL0, val); val &= ~ARCH_PERFMON_EVENTSEL_ENABLE; wrmsrl(MSR_P6_EVNTSEL0, val); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
u32 intel_pt_validate_hw_cap(enum pt_capabilities cap) { return intel_pt_validate_cap(pt_pmu.caps, cap); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static u64 pt_config_filters(struct perf_event *event) { struct pt_filters *filters = event->hw.addr_filters; struct pt *pt = this_cpu_ptr(&pt_ctx); unsigned int range = 0; u64 rtit_ctl = 0; if (!filters) return 0; perf_event_addr_filters_sync(event); for (range = 0; range < filters->nr_filters; ra...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static inline struct topa_page *topa_to_page(struct topa *topa) { return container_of(topa, struct topa_page, topa); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static bool topa_table_full(struct topa *topa) { if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) return !!topa->last; return topa->last == TENTS_PER_PAGE - 1; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static void pt_buffer_advance(struct pt_buffer *buf) { buf->output_off = 0; buf->cur_idx++; if (buf->cur_idx == buf->cur->last) { if (buf->cur == buf->last) buf->cur = buf->first; else buf->cur = list_entry(buf->cur->list.next, struct topa, list); buf->cur_idx = 0; } }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static void pt_buffer_free_aux(void *data) { struct pt_buffer *buf = data; pt_buffer_fini_topa(buf); kfree(buf); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static u64 clamp_to_ge_canonical_addr(u64 vaddr, u8 vaddr_bits) { return __is_canonical_address(vaddr, vaddr_bits) ? vaddr : -BIT_ULL(vaddr_bits - 1); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static long pt_event_snapshot_aux(struct perf_event *event, struct perf_output_handle *handle, unsigned long size) { struct pt *pt = this_cpu_ptr(&pt_ctx); struct pt_buffer *buf = perf_get_aux(&pt->handle); unsigned long from = 0, to; long ret;...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
static void pt_event_destroy(struct perf_event *event) { pt_addr_filters_fini(event); x86_del_exclusive(x86_lbr_exclusive_pt); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/pt.c
int is_intel_pt_event(struct perf_event *event) { return event->pmu == &pt_pmu.pmu; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
int uncore_die_to_segment(int die) { struct pci_bus *bus = NULL; while ((bus = pci_find_next_bus(bus)) && (die != uncore_pcibus_to_dieid(bus))) ; return bus ? pci_domain_nr(bus) : -EINVAL; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
u64 uncore_mmio_read_counter(struct intel_uncore_box *box, struct perf_event *event) { if (!box->io_addr) return 0; if (!uncore_mmio_is_valid_offset(box, event->hw.event_base)) return 0; return readq(box->io_addr + event->hw.event_base); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
void uncore_put_constraint(struct intel_uncore_box *box, struct perf_event *event) { struct intel_uncore_extra_reg *er; struct hw_perf_event_extra *reg1 = &event->hw.extra_reg; if (uncore_box_is_fake(box) || !reg1->alloc) return; er = &box->shared_regs[reg1->idx]; atomic_dec(&...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_assign_hw_event(struct intel_uncore_box *box, struct perf_event *event, int idx) { struct hw_perf_event *hwc = &event->hw; hwc->idx = idx; hwc->last_tag = ++box->tags[idx]; if (uncore_pmc_fixed(hwc->idx)) { hwc->event_base = uncore_fixed_ctr(box); ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static enum hrtimer_restart uncore_pmu_hrtimer(struct hrtimer *hrtimer) { struct intel_uncore_box *box; struct perf_event *event; unsigned long flags; int bit; box = container_of(hrtimer, struct intel_uncore_box, hrtimer); if (!box->n_active || box->cpu != smp_processor_id()) return HRTIMER_NORESTART; ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int node) { int i, size, numshared = type->num_shared_regs; struct intel_uncore_box *box; size = sizeof(*box) + numshared * sizeof(struct intel_uncore_extra_reg); box = kzalloc_nod...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
void uncore_pmu_event_del(struct perf_event *event, int flags) { struct intel_uncore_box *box = uncore_event_to_box(event); int i; uncore_pmu_event_stop(event, PERF_EF_UPDATE); if (uncore_pmc_freerunning(event->hw.idx)) return; for (i = 0; i < box->n_events; i++) { if (event == box->event_list[i]) ...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static int uncore_validate_group(struct intel_uncore_pmu *pmu, struct perf_event *event) { struct perf_event *leader = event->group_leader; struct intel_uncore_box *fake_box; int ret = -EINVAL, n; if (uncore_pmc_freerunning(event->hw.idx)) return 0; fake_box = uncore_all...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_pmu_disable(struct pmu *pmu) { struct intel_uncore_pmu *uncore_pmu; struct intel_uncore_box *box; uncore_pmu = container_of(pmu, struct intel_uncore_pmu, pmu); box = uncore_pmu_to_box(uncore_pmu, smp_processor_id()); if (!box) return; if (uncore_pmu->type->ops->disable_box) un...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static int uncore_pmu_register(struct intel_uncore_pmu *pmu) { int ret; if (!pmu->type->pmu) { pmu->pmu = (struct pmu){ .attr_groups = pmu->type->attr_groups, .task_ctx_nr = perf_invalid_context, .pmu_enable = uncore_pmu_enable, .pmu_disable = uncore_pmu_disable, .event...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct intel_uncore_type *type; struct intel_uncore_pmu *pmu = NULL; int die, ret; ret = uncore_pci_get_dev_die_info(pdev, &die); if (ret) return ret; if (UNCORE_PCI_DEV_TYPE(id->driver_data...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_pci_pmu_unregister(struct intel_uncore_pmu *pmu, int die) { struct intel_uncore_box *box = pmu->boxes[die]; pmu->boxes[die] = NULL; if (atomic_dec_return(&pmu->activeboxes) == 0) uncore_pmu_unregister(pmu); uncore_box_exit(box); kfree(box); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_pci_remove(struct pci_dev *pdev) { struct intel_uncore_box *box; struct intel_uncore_pmu *pmu; int i, die; if (uncore_pci_get_dev_die_info(pdev, &die)) return; box = pci_get_drvdata(pdev); if (!box) { for (i = 0; i < UNCORE_EXTRA_PCI_DEV_MAX; i++) { if (uncore_extra_pci_d...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_pci_sub_driver_init(void) { const struct pci_device_id *ids = uncore_pci_sub_driver->id_table; struct intel_uncore_type *type; struct intel_uncore_pmu *pmu; struct pci_dev *pci_sub_dev; bool notify = false; unsigned int devfn; int die; while (ids && ids->vendor) { pci_sub_dev = N...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static int uncore_pci_bus_notify(struct notifier_block *nb, unsigned long action, void *data) { return uncore_bus_notify(nb, action, data, NULL); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_pci_exit(void) { if (pcidrv_registered) { pcidrv_registered = false; if (uncore_pci_sub_driver) bus_unregister_notifier(&pci_bus_type, &uncore_pci_sub_notifier); if (uncore_pci_driver) pci_unregister_driver(uncore_pci_driver); else bus_unregister_notifier(&pci_bus...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_change_context(struct intel_uncore_type **uncores, int old_cpu, int new_cpu) { for (; *uncores; uncores++) uncore_change_type_ctx(*uncores, old_cpu, new_cpu); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static void uncore_box_unref(struct intel_uncore_type **types, int id) { struct intel_uncore_type *type; struct intel_uncore_pmu *pmu; struct intel_uncore_box *box; int i; for (; *types; types++) { type = *types; pmu = type->pmus; for (i = 0; i < type->num_boxes; i++, pmu++) { box = pmu->b...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.c
static int uncore_event_cpu_offline(unsigned int cpu) { int die, target; if (!cpumask_test_and_clear_cpu(cpu, &uncore_cpu_mask)) goto unref; /* Find a new cpu to collect uncore events */ target = cpumask_any_but(topology_die_cpumask(cpu), cpu); /* Migrate uncore events to the new target */ if (target ...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline bool uncore_pmc_fixed(int idx) { return idx == UNCORE_PMC_IDX_FIXED; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned int uncore_mmio_box_ctl(struct intel_uncore_box *box) { return box->pmu->type->box_ctl + box->pmu->type->mmio_offset * box->pmu->pmu_idx; }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_pci_fixed_ctr(struct intel_uncore_box *box) { return box->pmu->type->fixed_ctr; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_msr_box_offset(struct intel_uncore_box *box) { struct intel_uncore_pmu *pmu = box->pmu; return pmu->type->msr_offsets ? pmu->type->msr_offsets[pmu->pmu_idx] : pmu->type->msr_offset * pmu->pmu_idx; }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_msr_fixed_ctl(struct intel_uncore_box *box) { if (!box->pmu->type->fixed_ctl) return 0; return box->pmu->type->fixed_ctl + uncore_msr_box_offset(box); }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_msr_fixed_ctr(struct intel_uncore_box *box) { return box->pmu->type->fixed_ctr + uncore_msr_box_offset(box); }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned int uncore_freerunning_type(u64 config) { return ((((config >> 8) - UNCORE_FREERUNNING_UMASK_START) >> 4) & 0xf); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_msr_event_ctl(struct intel_uncore_box *box, int idx) { if (test_bit(UNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS, &box->flags)) { return CFL_UNC_CBO_7_PERFEVTSEL0 + (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx); } else { return box...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_fixed_ctl(struct intel_uncore_box *box) { if (box->pci_dev || box->io_addr) return uncore_pci_fixed_ctl(box); else return uncore_msr_fixed_ctl(box); }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline unsigned uncore_perf_ctr(struct intel_uncore_box *box, int idx) { if (box->pci_dev || box->io_addr) return uncore_pci_perf_ctr(box, idx); else return uncore_msr_perf_ctr(box, idx); }
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline int uncore_fixed_ctr_bits(struct intel_uncore_box *box) { return box->pmu->type->fixed_ctr_bits; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline bool check_valid_freerunning_event(struct intel_uncore_box *box, struct perf_event *event) { unsigned int type = uncore_freerunning_type(event->hw.config); unsigned int idx = uncore_freerunning_idx(event->hw.config); return (type < uncore_num_freeru...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore.h
static inline bool uncore_box_is_fake(struct intel_uncore_box *box) { return (box->dieid < 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
static bool has_generic_discovery_table(void) { struct pci_dev *dev; int dvsec; dev = pci_get_device(PCI_VENDOR_ID_INTEL, UNCORE_DISCOVERY_TABLE_DEVICE, NULL); if (!dev) return false; dvsec = pci_find_next_ext_capability(dev, 0, UNCORE_EXT_CAP_ID_DISCOVERY); pci_dev_put(dev); if (dvsec) re...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
static inline int __type_cmp(const void *key, const struct rb_node *b) { struct intel_uncore_discovery_type *type_b = __node_2_type(b); const u16 *type_id = key; if (type_b->type > *type_id) return -1; else if (type_b->type < *type_id) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
static inline bool __type_less(struct rb_node *a, const struct rb_node *b) { return (__node_2_type(a)->type < __node_2_type(b)->type); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
static void uncore_insert_box_info(struct uncore_unit_discovery *unit, int die, bool parsed) { struct intel_uncore_discovery_type *type; unsigned int *box_offset, *ids; int i; if (WARN_ON_ONCE(!unit->ctl || !unit->ctl_offset || !unit->ctr_offset)) return; if (parsed) {...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
static int parse_discovery_table(struct pci_dev *dev, int die, u32 bar_offset, bool *parsed) { struct uncore_global_discovery global; struct uncore_unit_discovery unit; void __iomem *io_addr; resource_size_t addr; unsigned long size; u32 val; int i; pci_read_config_dwor...
[ 1, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
bool intel_uncore_has_discovery_tables(void) { u32 device, val, entry_id, bar_offset; int die, dvsec = 0, ret = true; struct pci_dev *dev = NULL; bool parsed = false; if (has_generic_discovery_table()) device = UNCORE_DISCOVERY_TABLE_DEVICE; else device = PCI_ANY_ID; while ((dev = pci_get_device...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
void intel_uncore_clear_discovery_tables(void) { struct intel_uncore_discovery_type *type, *next; rbtree_postorder_for_each_entry_safe(type, next, &discovery_tables, node) { kfree(type->box_ctrl_die); kfree(type); } }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
void intel_generic_uncore_msr_init_box(struct intel_uncore_box *box) { wrmsrl(uncore_msr_box_ctl(box), GENERIC_PMON_BOX_CTL_INT); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
static void intel_generic_uncore_msr_disable_event(struct intel_uncore_box *box, struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; wrmsrl(hwc->config_base, 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
u64 intel_generic_uncore_pci_read_counter(struct intel_uncore_box *box, struct perf_event *event) { struct pci_dev *pdev = box->pci_dev; struct hw_perf_event *hwc = &event->hw; u64 count = 0; pci_read_config_dword(pdev, hwc->event_base, (u32 *)&count); pci_read_conf...
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_discovery.c
void intel_uncore_generic_uncore_cpu_init(void) { uncore_msr_uncores = intel_uncore_generic_init_uncores(UNCORE_ACCESS_MSR, 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/events/intel/uncore_nhmex.c
static void nhmex_uncore_msr_init_box(struct intel_uncore_box *box) { wrmsrl(NHMEX_U_MSR_PMON_GLOBAL_CTL, NHMEX_U_PMON_GLOBAL_EN_ALL); }
[ 0, 0 ]