Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/powerpc/perf/8xx-pmu.c |
static int event_type(struct perf_event *event) {
switch (event->attr.type) {
case PERF_TYPE_HARDWARE:
if (event->attr.config == PERF_COUNT_HW_CPU_CYCLES)
return PERF_8xx_ID_CPU_CYCLES;
if (event->attr.config == PERF_COUNT_HW_INSTRUCTIONS)
return PERF_8xx_ID_HW_INSTRUCTIONS;
break;
case P... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/8xx-pmu.c |
static int mpc8xx_pmu_event_init(struct perf_event *event) {
int type = event_type(event);
if (type < 0)
return type;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/callchain.c | void __no_sanitize_address perf_callchain_kernel(
struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) {
unsigned long sp, next_sp;
unsigned long next_ip;
unsigned long lr;
long level = 0;
unsigned long *fp;
lr = regs->link;
sp = regs->gpr[1];
perf_callchain_store(entry, perf_instruction_p... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/callchain.h |
static inline bool invalid_user_sp(unsigned long sp) {
unsigned long mask = is_32bit_task() ? 3 : 7;
unsigned long top = STACK_TOP - (is_32bit_task() ? 16 : 32);
return (!sp || (sp & mask) || (sp > top));
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/callchain.h | static inline int __read_user_stack(const void __user *ptr, void *ret,
size_t size) {
unsigned long addr = (unsigned long)ptr;
if (addr > TASK_SIZE - size || (addr & (size - 1)))
return -EFAULT;
return copy_from_user_nofault(ret, ptr, size);
}
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/callchain_32.c |
static int read_user_stack_32(const unsigned int __user *ptr,
unsigned int *ret) {
return __read_user_stack(ptr, ret, sizeof(*ret));
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/callchain_32.c |
static int sane_rt_signal_32_frame(unsigned int sp) {
struct rt_signal_frame_32 __user *sf;
unsigned int regs;
sf = (struct rt_signal_frame_32 __user *)(unsigned long)sp;
if (read_user_stack_32((unsigned int __user *)&sf->uc.uc_regs, ®s))
return 0;
return regs == (unsigned long)&sf->uc.uc_mcontext;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/callchain_64.c |
static int read_user_stack_64(const unsigned long __user *ptr,
unsigned long *ret) {
return __read_user_stack(ptr, ret, sizeof(*ret));
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/callchain_64.c | void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry,
struct pt_regs *regs) {
unsigned long sp, next_sp;
unsigned long next_ip;
unsigned long lr;
long level = 0;
struct signal_frame_64 __user *sigframe;
unsigned long __user *fp, *uregs;
next_ip = perf_instruction... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c |
static bool is_ebb_event(struct perf_event *event) { return false; } | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static void ebb_switch_out(unsigned long mmcr0) {} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static void power_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx,
bool sched_in) {} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | unsigned long get_pmcs_ext_regs(int idx) {
struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
return cpuhw->pmcs[idx];
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static bool regs_use_siar(struct pt_regs *regs) {
return ((TRAP(regs) == INTERRUPT_PERFMON) && regs->result);
}
/*
* Things that are specific to 64-bit implementations.
*/ | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static inline void perf_get_data_addr(struct perf_event *event,
struct pt_regs *regs, u64 *addrp) {
unsigned long mmcra = regs->dsisr;
bool sdar_valid;
if (ppmu->flags & PPMU_HAS_SIER)
sdar_valid = regs->dar & SIER_SDAR_VALID;
else {
unsigned long sdsync;
if (... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static inline u32 perf_get_misc_flags(struct pt_regs *regs) {
bool use_siar = regs_use_siar(regs);
unsigned long mmcra = regs->dsisr;
int marked = mmcra & MMCRA_SAMPLE_ENABLE;
if (!use_siar)
return perf_flags_from_msr(regs);
if (marked && (ppmu->flags & PPMU_P10_DD1)) {
unsigned long siar = mfspr(SP... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static inline int siar_valid(struct pt_regs *regs) {
unsigned long mmcra = regs->dsisr;
int marked = mmcra & MMCRA_SAMPLE_ENABLE;
if (marked) {
if (ppmu->flags & PPMU_P10_DD1)
return 0x1;
else if (ppmu->flags & PPMU_HAS_SIER)
return regs->dar & SIER_SIAR_VALID;
if (ppmu->flags & PPMU_SI... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static void power_pmu_bhrb_disable(struct perf_event *event) {
struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
if (!ppmu->bhrb_nr)
return;
WARN_ON_ONCE(!cpuhw->bhrb_users);
cpuhw->bhrb_users--;
perf_sched_cb_dec(event->pmu);
if (!cpuhw->disabled && !cpuhw->bhrb_users) {
/* avoid stal... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static __u64 power_pmu_bhrb_to(u64 addr) {
unsigned int instr;
__u64 target;
if (is_kernel_addr(addr)) {
if (copy_from_kernel_nofault(&instr, (void *)addr, sizeof(instr)))
return 0;
return branch_target(&instr);
}
if (copy_from_user_nofault(&instr, (unsigned int __user *)addr,
... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static int ebb_event_check(struct perf_event *event) {
struct perf_event *leader = event->group_leader;
if (is_ebb_event(leader) != is_ebb_event(event))
return -EINVAL;
if (is_ebb_event(event)) {
if (!(event->attach_state & PERF_ATTACH_TASK))
return -EINVAL;
if (!leader->attr.pinned || !leade... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static void write_pmc(int idx, unsigned long val) {
switch (idx) {
case 1:
mtspr(SPRN_PMC1, val);
break;
case 2:
mtspr(SPRN_PMC2, val);
break;
case 3:
mtspr(SPRN_PMC3, val);
break;
case 4:
mtspr(SPRN_PMC4, val);
break;
case 5:
mtspr(SPRN_PMC5, val);
break;
case 6:
... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c | static int can_go_on_limited_pmc(struct perf_event *event, u64 ev,
unsigned int flags) {
int n;
u64 alt[MAX_EVENT_ALTERNATIVES];
if (event->attr.exclude_user || event->attr.exclude_kernel ||
event->attr.exclude_hv || event->attr.sample_period)
return 0;
if (ppmu->lim... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c |
static int power_pmu_event_idx(struct perf_event *event) {
return event->hw.idx;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c |
static bool pmc_overflow(unsigned long val) {
if ((int)val < 0)
return true;
return false;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-book3s.c |
static int power_pmu_prepare_cpu(unsigned int cpu) {
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
if (ppmu) {
memset(cpuhw, 0, sizeof(*cpuhw));
cpuhw->mmcr.mmcr0 = MMCR0_FC;
}
return 0;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/core-fsl-emb.c | static unsigned long read_pmc(int idx) {
unsigned long val;
switch (idx) {
case 0:
val = mfpmr(PMRN_PMC0);
break;
case 1:
val = mfpmr(PMRN_PMC1);
break;
case 2:
val = mfpmr(PMRN_PMC2);
break;
case 3:
val = mfpmr(PMRN_PMC3);
break;
case 4:
val = mfpmr(PMRN_PMC4);
br... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-fsl-emb.c | static void write_pmlcb(int idx, unsigned long val) {
switch (idx) {
case 0:
mtpmr(PMRN_PMLCB0, val);
break;
case 1:
mtpmr(PMRN_PMLCB1, val);
break;
case 2:
mtpmr(PMRN_PMLCB2, val);
break;
case 3:
mtpmr(PMRN_PMLCB3, val);
break;
case 4:
mtpmr(PMRN_PMLCB4, val);
break;... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-fsl-emb.c | static void fsl_emb_pmu_disable(struct pmu *pmu) {
struct cpu_hw_events *cpuhw;
unsigned long flags;
local_irq_save(flags);
cpuhw = this_cpu_ptr(&cpu_hw_events);
if (!cpuhw->disabled) {
cpuhw->disabled = 1;
if (!cpuhw->pmcs_enabled) {
ppc_enable_pmcs();
cpuhw->pmcs_enabled = 1;
}
... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/core-fsl-emb.c | static void fsl_emb_pmu_del(struct perf_event *event, int flags) {
struct cpu_hw_events *cpuhw;
int i = event->hw.idx;
perf_pmu_disable(event->pmu);
if (i < 0)
goto out;
fsl_emb_pmu_read(event);
cpuhw = &get_cpu_var(cpu_hw_events);
WARN_ON(event != cpuhw->event[event->hw.idx]);
write_pmlca(i, 0... | [
1,
1
] |
Linux Kernel | arch/powerpc/perf/core-fsl-emb.c | static void record_and_restart(struct perf_event *event, unsigned long val,
struct pt_regs *regs) {
u64 period = event->hw.sample_period;
s64 prev, delta, left;
int record = 0;
if (event->hw.state & PERF_HES_STOPPED) {
write_pmc(event->hw.idx, 0);
return;
}
prev = lo... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/e500-pmu.c | static int init_e500_pmu(void) {
unsigned int pvr = mfspr(SPRN_PVR);
if (PVR_VER(pvr) == PVR_VER_E500MC || PVR_VER(pvr) == PVR_VER_E5500)
num_events = 256;
/* e500 */
else if (PVR_VER(pvr) != PVR_VER_E500V1 && PVR_VER(pvr) != PVR_VER_E500V2)
return -ENODEV;
return register_fsl_emb_pmu(&e500_pmu);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/e6500-pmu.c | static u64 e6500_xlate_event(u64 event_id) {
u32 event_low = (u32)event_id;
if (event_low >= num_events ||
(event_id & (FSL_EMB_EVENT_THRESHMUL | FSL_EMB_EVENT_THRESH)))
return 0;
return FSL_EMB_EVENT_VALID;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/generic-compat-pmu.c |
static int generic_get_alternatives(u64 event, unsigned int flags, u64 alt[]) {
int num_alt = 0;
num_alt = isa207_get_alternatives(event, alt,
ARRAY_SIZE(generic_event_alternatives),
flags, generic_event_alternatives);
return num_alt;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/generic-compat-pmu.c | static int generic_compute_mmcr(u64 event[], int n_ev, unsigned int hwc[],
struct mmcr_regs *mmcr,
struct perf_event *pevents[], u32 flags) {
int ret;
ret = isa207_compute_mmcr(event, n_ev, hwc, mmcr, pevents, flags);
if (!ret)
mmcr->mmcr0 |= MM... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | void read_24x7_sys_info(void) {
int call_status, len, ntypes;
spin_lock(&rtas_data_buf_lock);
phys_sockets = 1;
phys_chipspersocket = 1;
phys_coresperchip = 1;
call_status =
rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1, NULL,
PROCESSOR_MODULE_INFO, __pa(rtas_data_buf), RTA... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static const char *domain_name(unsigned int domain) {
if (!domain_is_valid(domain))
return NULL;
switch (domain) {
case HV_PERF_DOMAIN_PHYS_CHIP:
return "Physical Chip";
case HV_PERF_DOMAIN_PHYS_CORE:
return "Physical Core";
case HV_PERF_DOMAIN_VCPU_HOME_CORE:
return "VCPU Home Core";
case... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static char *event_name(struct hv_24x7_event_data *ev, int *len) {
*len = be16_to_cpu(ev->event_name_len) - 2;
return (char *)ev->remainder;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static char *event_desc(struct hv_24x7_event_data *ev, int *len) {
unsigned int nl = be16_to_cpu(ev->event_name_len);
__be16 *desc_len = (__be16 *)(ev->remainder + nl - 2);
*len = be16_to_cpu(*desc_len) - 2;
return (char *)ev->remainder + nl;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static long h_get_24x7_catalog_page(char page[], u64 version, u32 index) {
return h_get_24x7_catalog_page_(virt_to_phys(page), version, index);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static char *event_fmt(struct hv_24x7_event_data *event, unsigned int domain) {
const char *sindex;
const char *lpar;
const char *domain_str;
char buf[8];
switch (domain) {
case HV_PERF_DOMAIN_PHYS_CHIP:
snprintf(buf, sizeof(buf), "%d", domain);
domain_str = buf;
lpar = "0x0";
sindex = "chi... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static ssize_t device_show_string(struct device *dev,
struct device_attribute *attr, char *buf) {
struct dev_ext_attribute *d;
d = container_of(attr, struct dev_ext_attribute, attr);
return sprintf(buf, "%s\n", (char *)d->var);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static ssize_t sockets_show(struct device *dev, struct device_attribute *attr,
char *buf) {
return sprintf(buf, "%d\n", phys_sockets);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static struct attribute *device_str_attr_create_(char *name, char *str) {
struct dev_ext_attribute *attr = kzalloc(sizeof(*attr), GFP_KERNEL);
if (!attr)
return NULL;
sysfs_attr_init(&attr->attr.attr);
attr->var = str;
attr->attr.attr.name = name;
attr->attr.attr.mode = 0444;
attr->attr.show = dev... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static struct attribute *event_to_desc_attr(struct hv_24x7_event_data *event,
int nonce) {
int nl, dl;
char *name = event_name(event, &nl);
char *desc = event_desc(event, &dl);
if (!dl)
return NULL;
return device_str_attr_create(name, nl, nonce, desc, dl);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static int ev_uniq_ord(const void *v1, size_t s1, unsigned int d1,
const void *v2, size_t s2, unsigned int d2) {
int r = memord(v1, s1, v2, s2);
if (r)
return r;
if (d1 > d2)
return 1;
if (d2 > d1)
return -1;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static ssize_t catalog_event_len_validate(struct hv_24x7_event_data *event,
size_t event_idx,
size_t event_data_bytes,
size_t event_entry_count,
size_t ... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static void
init_24x7_request(struct hv_24x7_request_buffer *request_buffer,
struct hv_24x7_data_result_buffer *result_buffer) {
memset(request_buffer, 0, H24x7_DATA_BUFFER_SIZE);
memset(result_buffer, 0, H24x7_DATA_BUFFER_SIZE);
request_buffer->interface_version = interface_version;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static int make_24x7_request(struct hv_24x7_request_buffer *request_buffer,
struct hv_24x7_data_result_buffer *result_buffer) {
long ret;
ret = plpar_hcall_norets(H_GET_24X7_DATA, virt_to_phys(request_buffer),
H24x7_DATA_BUFFER_SIZE, virt_to_phys(result_buffe... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static int single_24x7_request(struct perf_event *event, u64 *count) {
int ret;
struct hv_24x7_request_buffer *request_buffer;
struct hv_24x7_data_result_buffer *result_buffer;
BUILD_BUG_ON(sizeof(*request_buffer) > 4096);
BUILD_BUG_ON(sizeof(*result_buffer) > 4096);
request_buffer = (void *)get_cpu_var(h... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static int h_24x7_event_init(struct perf_event *event) {
struct hv_perf_caps caps;
unsigned int domain;
unsigned long hret;
u64 ct;
if (event->attr.type != event->pmu->type)
return -ENOENT;
/* Unused areas must be 0 */
if (event_get_reserved1(event) || event_get_reserved2(event) ||
event_get_r... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c |
static void update_event_count(struct perf_event *event, u64 now) {
s64 prev;
prev = local64_xchg(&event->hw.prev_count, now);
local64_add(now - prev, &event->count);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static void h_24x7_event_read(struct perf_event *event) {
u64 now;
struct hv_24x7_request_buffer *request_buffer;
struct hv_24x7_hw *h24x7hw;
int txn_flags;
txn_flags = __this_cpu_read(hv_24x7_txn_flags);
if (txn_flags & PERF_PMU_TXN_READ) {
int i;
int ret;
if (__this_cpu_read(hv_24x7_txn_err... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-24x7.c | static int h_24x7_event_commit_txn(struct pmu *pmu) {
struct hv_24x7_request_buffer *request_buffer;
struct hv_24x7_data_result_buffer *result_buffer;
struct hv_24x7_result *res, *next_res;
u64 count;
int i, ret, txn_flags;
struct hv_24x7_hw *h24x7hw;
txn_flags = __this_cpu_read(hv_24x7_txn_flags);
WAR... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-gpci.c |
static ssize_t kernel_version_show(struct device *dev,
struct device_attribute *attr, char *page) {
return sprintf(page, "0x%x\n", COUNTER_INFO_VERSION_CURRENT);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/hv-gpci.c |
static void h_gpci_event_stop(struct perf_event *event, int flags) {
h_gpci_event_update(event);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/hv-gpci.c |
static int h_gpci_event_add(struct perf_event *event, int flags) {
if (flags & PERF_EF_START)
h_gpci_event_start(event, flags);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static struct imc_pmu *imc_event_to_pmu(struct perf_event *event) {
return container_of(event->pmu, struct imc_pmu, pmu);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static ssize_t imc_pmu_cpumask_get_attr(struct device *dev,
struct device_attribute *attr,
char *buf) {
struct pmu *pmu = dev_get_drvdata(dev);
struct imc_pmu *imc_pmu = container_of(pmu, struct imc_pmu, pmu);
cpumask_t *active_mask;
... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static struct imc_pmu_ref *get_nest_pmu_ref(int cpu) {
return per_cpu(local_nest_imc_refc, cpu);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static int ppc_nest_imc_cpu_offline(unsigned int cpu) {
int nid, target = -1;
const struct cpumask *l_cpumask;
struct imc_pmu_ref *ref;
if (!cpumask_test_and_clear_cpu(cpu, &nest_imc_cpumask))
return 0;
/*
* Check whether nest_imc is registered. We could end up here if the
* cpuhotplug callback re... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static int nest_pmu_cpumask_init(void) {
return cpuhp_setup_state(CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE,
"perf/powerpc/imc:online", ppc_nest_imc_cpu_online,
ppc_nest_imc_cpu_offline);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static int core_imc_mem_init(int cpu, int size) {
int nid, rc = 0, core_id = (cpu / threads_per_core);
struct imc_mem_info *mem_info;
struct page *page;
nid = cpu_to_node(cpu);
mem_info = &core_imc_pmu->mem_info[core_id];
mem_info->id = core_id;
/* We need only vbase for core counters */
page = alloc_... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static bool is_core_imc_mem_inited(int cpu) {
struct imc_mem_info *mem_info;
int core_id = (cpu / threads_per_core);
mem_info = &core_imc_pmu->mem_info[core_id];
if (!mem_info->vbase)
return false;
return true;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static int ppc_thread_imc_cpu_online(unsigned int cpu) {
return thread_imc_mem_alloc(cpu, thread_imc_mem_size);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static void thread_imc_pmu_cancel_txn(struct pmu *pmu) { perf_pmu_enable(pmu); } | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static void imc_event_start(struct perf_event *event, int flags) {
imc_read_counter(event);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static void imc_event_stop(struct perf_event *event, int flags) {
imc_event_update(event);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static int imc_event_add(struct perf_event *event, int flags) {
if (flags & PERF_EF_START)
imc_event_start(event, flags);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static int ppc_trace_imc_cpu_online(unsigned int cpu) {
return trace_imc_mem_alloc(cpu, trace_imc_mem_size);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static int trace_imc_prepare_sample(struct trace_imc_data *mem,
struct perf_sample_data *data, u64 *prev_tb,
struct perf_event_header *header,
struct perf_event *event) {
if (be64_to_cpu(READ_ONCE(mem->tb1)) >... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static void trace_imc_event_read(struct perf_event *event) { return; } | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static void trace_imc_event_del(struct perf_event *event, int flags) {
int core_id = smp_processor_id() / threads_per_core;
struct imc_pmu_ref *ref = NULL;
if (trace_imc_refc)
ref = &trace_imc_refc[core_id];
if (!ref) {
pr_debug("imc: Failed to get event reference count\n");
return;
}
mutex_l... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static int update_pmu_ops(struct imc_pmu *pmu) {
pmu->pmu.task_ctx_nr = perf_invalid_context;
pmu->pmu.add = imc_event_add;
pmu->pmu.del = imc_event_stop;
pmu->pmu.start = imc_event_start;
pmu->pmu.stop = imc_event_stop;
pmu->pmu.read = imc_event_update;
pmu->pmu.attr_groups = pmu->attr_groups;
pmu->pmu... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static int init_nest_pmu_ref(void) {
int nid, i, cpu;
nest_imc_refc =
kcalloc(num_possible_nodes(), sizeof(*nest_imc_refc), GFP_KERNEL);
if (!nest_imc_refc)
return -ENOMEM;
i = 0;
for_each_node(nid) {
mutex_init(&nest_imc_refc[i].lock);
/*
* Loop to init the "id" with the node_id. ... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static void thread_imc_ldbar_disable(void *dummy) {
mtspr(SPRN_LDBAR, (mfspr(SPRN_LDBAR) & (~(1UL << 63))));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static void cleanup_all_thread_imc_memory(void) {
int i, order = get_order(thread_imc_mem_size);
for_each_online_cpu(i) {
if (per_cpu(thread_imc_mem, i))
free_pages((u64)per_cpu(thread_imc_mem, i), order);
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c |
static void cleanup_all_trace_imc_memory(void) {
int i, order = get_order(trace_imc_mem_size);
for_each_online_cpu(i) {
if (per_cpu(trace_imc_mem, i))
free_pages((u64)per_cpu(trace_imc_mem, i), order);
}
kfree(trace_imc_refc);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/imc-pmu.c | static void imc_common_cpuhp_mem_free(struct imc_pmu *pmu_ptr) {
if (pmu_ptr->domain == IMC_DOMAIN_NEST) {
mutex_lock(&nest_init_lock);
if (nest_pmus == 1) {
cpuhp_remove_state(CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE);
kfree(nest_imc_refc);
kfree(per_nest_pmu_arr);
per_nest_pmu_arr = NUL... | [
0,
1
] |
Linux Kernel | arch/powerpc/perf/isa207-common.c | static void mmcra_sdar_mode(u64 event, unsigned long *mmcra) {
if (cpu_has_feature(CPU_FTR_ARCH_300)) {
if (is_event_marked(event) || (*mmcra & MMCRA_SAMPLE_ENABLE))
*mmcra &= MMCRA_SDAR_MODE_NO_UPDATES;
else if (sdar_mod_val(event))
*mmcra |= sdar_mod_val(event) << MMCRA_SDAR_MODE_SHIFT;
els... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/isa207-common.c |
static int find_alternative(u64 event, const unsigned int ev_alt[][MAX_ALT],
int size) {
int i, j;
for (i = 0; i < size; ++i) {
if (event < ev_alt[i][0])
break;
for (j = 0; j < MAX_ALT && ev_alt[i][j]; ++j)
if (event == ev_alt[i][j])
return i;
}
return... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/isa207-common.c | int isa207_get_alternatives(u64 event, u64 alt[], int size, unsigned int flags,
const unsigned int ev_alt[][MAX_ALT]) {
int i, j, num_alt = 0;
u64 alt_event;
alt[num_alt++] = event;
i = find_alternative(event, ev_alt, size);
if (i >= 0) {
for (j = 0; j < MAX_ALT; ++j) {
... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/mpc7450-pmu.c | static int mpc7450_threshold_use(u32 event) {
int pmc, sel;
pmc = (event >> PM_PMC_SH) & PM_PMC_MSK;
sel = event & PM_PMCSEL_MSK;
switch (pmc) {
case 1:
if (sel == 0x1e || sel == 0x1f)
return 1;
if (sel == 0x28 || sel == 0x2b)
return 2;
break;
case 2:
if (sel == 0x20)
retu... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/mpc7450-pmu.c | static int find_alternative(u32 event) {
int i, j;
for (i = 0; i < ARRAY_SIZE(event_alternatives); ++i) {
if (event < event_alternatives[i][0])
break;
for (j = 0; j < MAX_ALT && event_alternatives[i][j]; ++j)
if (event == event_alternatives[i][j])
return i;
}
return -1;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/mpc7450-pmu.c |
static int __init init_mpc7450_pmu(void) {
unsigned int pvr = mfspr(SPRN_PVR);
if (PVR_VER(pvr) != PVR_7450)
return -ENODEV;
return register_power_pmu(&mpc7450_pmu);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/perf_regs.c |
int perf_reg_validate(u64 mask) {
if (!mask || mask & REG_RESERVED)
return -EINVAL;
return 0;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power10-pmu.c | static void power10_config_bhrb(u64 pmu_bhrb_filter) {
pmu_bhrb_filter &= POWER10_MMCRA_BHRB_MASK;
mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/power10-pmu.c | static int power10_compute_mmcr(u64 event[], int n_ev, unsigned int hwc[],
struct mmcr_regs *mmcr,
struct perf_event *pevents[], u32 flags) {
int ret;
ret = isa207_compute_mmcr(event, n_ev, hwc, mmcr, pevents, flags);
if (!ret)
mmcr->mmcr0 |= MM... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/power5+-pmu.c | static s64 find_alternative_bdecode(u64 event) {
int pmc, altpmc, pp, j;
pmc = (event >> PM_PMC_SH) & PM_PMC_MSK;
if (pmc == 0 || pmc > 4)
return -1;
altpmc = 5 - pmc;
pp = event & PM_PMCSEL_MSK;
for (j = 0; j < 4; ++j) {
if (bytedecode_alternatives[pmc - 1][j] == pp) {
return (event & ~(PM_P... | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/power5-pmu.c | static int find_alternative(u64 event) {
int i, j;
for (i = 0; i < ARRAY_SIZE(event_alternatives); ++i) {
if (event < event_alternatives[i][0])
break;
for (j = 0; j < MAX_ALT && event_alternatives[i][j]; ++j)
if (event == event_alternatives[i][j])
return i;
}
return -1;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power5-pmu.c |
static int power5_get_alternatives(u64 event, unsigned int flags, u64 alt[]) {
int i, j, nalt = 1;
s64 ae;
alt[0] = event;
nalt = 1;
i = find_alternative(event);
if (i >= 0) {
for (j = 0; j < MAX_ALT; ++j) {
ae = event_alternatives[i][j];
if (ae && ae != event)
alt[nalt++] = ae;
... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power5-pmu.c |
int __init init_power5_pmu(void) {
unsigned int pvr = mfspr(SPRN_PVR);
if (PVR_VER(pvr) != PVR_POWER5)
return -ENODEV;
return register_power_pmu(&power5_pmu);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power6-pmu.c | static int power6_marked_instr_event(u64 event) {
int pmc, psel, ptype;
int bit, byte, unit;
u32 mask;
pmc = (event >> PM_PMC_SH) & PM_PMC_MSK;
psel = (event & PM_PMCSEL_MSK) >> 1;
if (pmc >= 5)
return 0;
bit = -1;
if (psel < sizeof(direct_event_is_marked)) {
ptype = direct_event_is_marked[pse... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power6-pmu.c | static int p6_get_constraint(u64 event, unsigned long *maskp,
unsigned long *valp,
u64 event_config1 __maybe_unused) {
int pmc, byte, sh, subunit;
unsigned long mask = 0, value = 0;
pmc = (event >> PM_PMC_SH) & PM_PMC_MSK;
if (pmc) {
if (pmc > 4 && ... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power6-pmu.c | static int find_alternatives_list(u64 event) {
int i, j;
unsigned int alt;
for (i = 0; i < ARRAY_SIZE(event_alternatives); ++i) {
if (event < event_alternatives[i][0])
return -1;
for (j = 0; j < MAX_ALT; ++j) {
alt = event_alternatives[i][j];
if (!alt || event < alt)
break;
... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power6-pmu.c | static void p6_disable_pmc(unsigned int pmc, struct mmcr_regs *mmcr) {
if (pmc <= 3)
mmcr->mmcr1 &= ~(0xffUL << MMCR1_PMCSEL_SH(pmc));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/power7-pmu.c | static int power7_get_constraint(u64 event, unsigned long *maskp,
unsigned long *valp,
u64 event_config1 __maybe_unused) {
int pmc, sh, unit;
unsigned long mask = 0, value = 0;
pmc = (event >> PM_PMC_SH) & PM_PMC_MSK;
if (pmc) {
if (pmc > 6)... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power7-pmu.c | static int find_alternative(u64 event) {
int i, j;
for (i = 0; i < ARRAY_SIZE(event_alternatives); ++i) {
if (event < event_alternatives[i][0])
break;
for (j = 0; j < MAX_ALT && event_alternatives[i][j]; ++j)
if (event == event_alternatives[i][j])
return i;
}
return -1;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power7-pmu.c | static int power7_get_alternatives(u64 event, unsigned int flags, u64 alt[]) {
int i, j, nalt = 1;
s64 ae;
alt[0] = event;
nalt = 1;
i = find_alternative(event);
if (i >= 0) {
for (j = 0; j < MAX_ALT; ++j) {
ae = event_alternatives[i][j];
if (ae && ae != event)
alt[nalt++] = ae;
... | [
1,
0
] |
Linux Kernel | arch/powerpc/perf/power8-pmu.c | static void power8_config_bhrb(u64 pmu_bhrb_filter) {
pmu_bhrb_filter &= POWER8_MMCRA_BHRB_MASK;
mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/perf/power8-pmu.c | int __init init_power8_pmu(void) {
int rc;
unsigned int pvr = mfspr(SPRN_PVR);
if (PVR_VER(pvr) != PVR_POWER8E && PVR_VER(pvr) != PVR_POWER8NVL &&
PVR_VER(pvr) != PVR_POWER8)
return -ENODEV;
rc = register_power_pmu(&power8_pmu);
if (rc)
return rc;
cur_cpu_spec->cpu_user_features2 |= PPC_FEA... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.