/Linux-v4.19/drivers/iio/buffer/ |
D | industrialio-hw-consumer.c | 53 struct iio_hw_consumer *hwc, struct iio_dev *indio_dev) in iio_hw_consumer_get_buffer() argument 58 list_for_each_entry(buf, &hwc->buffers, head) { in iio_hw_consumer_get_buffer() 72 list_add_tail(&buf->head, &hwc->buffers); in iio_hw_consumer_get_buffer() 86 struct iio_hw_consumer *hwc; in iio_hw_consumer_alloc() local 90 hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); in iio_hw_consumer_alloc() 91 if (!hwc) in iio_hw_consumer_alloc() 94 INIT_LIST_HEAD(&hwc->buffers); in iio_hw_consumer_alloc() 96 hwc->channels = iio_channel_get_all(dev); in iio_hw_consumer_alloc() 97 if (IS_ERR(hwc->channels)) { in iio_hw_consumer_alloc() 98 ret = PTR_ERR(hwc->channels); in iio_hw_consumer_alloc() [all …]
|
/Linux-v4.19/arch/alpha/kernel/ |
D | perf_event.c | 253 struct hw_perf_event *hwc, int idx) in alpha_perf_event_set_period() argument 255 long left = local64_read(&hwc->period_left); in alpha_perf_event_set_period() 256 long period = hwc->sample_period; in alpha_perf_event_set_period() 261 local64_set(&hwc->period_left, left); in alpha_perf_event_set_period() 262 hwc->last_period = period; in alpha_perf_event_set_period() 268 local64_set(&hwc->period_left, left); in alpha_perf_event_set_period() 269 hwc->last_period = period; in alpha_perf_event_set_period() 283 local64_set(&hwc->prev_count, (unsigned long)(-left)); in alpha_perf_event_set_period() 308 struct hw_perf_event *hwc, int idx, long ovf) in alpha_perf_event_update() argument 314 prev_raw_count = local64_read(&hwc->prev_count); in alpha_perf_event_update() [all …]
|
/Linux-v4.19/arch/s390/include/asm/ |
D | perf_event.h | 66 #define OVERFLOW_REG(hwc) ((hwc)->extra_reg.config) argument 67 #define SFB_ALLOC_REG(hwc) ((hwc)->extra_reg.alloc) argument 68 #define TEAR_REG(hwc) ((hwc)->last_tag) argument 69 #define SAMPL_RATE(hwc) ((hwc)->event_base) argument 70 #define SAMPL_FLAGS(hwc) ((hwc)->config_base) argument 71 #define SAMPL_DIAG_MODE(hwc) (SAMPL_FLAGS(hwc) & PERF_CPUM_SF_DIAG_MODE) argument 72 #define SDB_FULL_BLOCKS(hwc) (SAMPL_FLAGS(hwc) & PERF_CPUM_SF_FULL_BLOCKS) argument
|
/Linux-v4.19/arch/arc/kernel/ |
D | perf_event.c | 104 struct hw_perf_event *hwc, int idx) in arc_perf_event_update() argument 106 uint64_t prev_raw_count = local64_read(&hwc->prev_count); in arc_perf_event_update() 114 local64_set(&hwc->prev_count, new_raw_count); in arc_perf_event_update() 116 local64_sub(delta, &hwc->period_left); in arc_perf_event_update() 154 struct hw_perf_event *hwc = &event->hw; in arc_pmu_event_init() local 158 hwc->sample_period = arc_pmu->max_period; in arc_pmu_event_init() 159 hwc->last_period = hwc->sample_period; in arc_pmu_event_init() 160 local64_set(&hwc->period_left, hwc->sample_period); in arc_pmu_event_init() 163 hwc->config = 0; in arc_pmu_event_init() 168 hwc->config |= ARC_REG_PCT_CONFIG_KERN; in arc_pmu_event_init() [all …]
|
/Linux-v4.19/drivers/perf/hisilicon/ |
D | hisi_uncore_pmu.c | 131 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_event_init() local 179 hwc->idx = -1; in hisi_uncore_pmu_event_init() 180 hwc->config_base = event->attr.config; in hisi_uncore_pmu_event_init() 195 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_enable_event() local 197 hisi_pmu->ops->write_evtype(hisi_pmu, hwc->idx, in hisi_uncore_pmu_enable_event() 200 hisi_pmu->ops->enable_counter_int(hisi_pmu, hwc); in hisi_uncore_pmu_enable_event() 201 hisi_pmu->ops->enable_counter(hisi_pmu, hwc); in hisi_uncore_pmu_enable_event() 210 struct hw_perf_event *hwc = &event->hw; in hisi_uncore_pmu_disable_event() local 212 hisi_pmu->ops->disable_counter(hisi_pmu, hwc); in hisi_uncore_pmu_disable_event() 213 hisi_pmu->ops->disable_counter_int(hisi_pmu, hwc); in hisi_uncore_pmu_disable_event() [all …]
|
D | hisi_uncore_ddrc_pmu.c | 50 #define GET_DDRC_EVENTID(hwc) (hwc->config_base & 0x7) argument 68 struct hw_perf_event *hwc) in hisi_ddrc_pmu_read_counter() argument 71 u32 idx = GET_DDRC_EVENTID(hwc); in hisi_ddrc_pmu_read_counter() 82 struct hw_perf_event *hwc, u64 val) in hisi_ddrc_pmu_write_counter() argument 84 u32 idx = GET_DDRC_EVENTID(hwc); in hisi_ddrc_pmu_write_counter() 125 struct hw_perf_event *hwc) in hisi_ddrc_pmu_enable_counter() argument 131 val |= (1 << GET_DDRC_EVENTID(hwc)); in hisi_ddrc_pmu_enable_counter() 136 struct hw_perf_event *hwc) in hisi_ddrc_pmu_disable_counter() argument 142 val &= ~(1 << GET_DDRC_EVENTID(hwc)); in hisi_ddrc_pmu_disable_counter() 150 struct hw_perf_event *hwc = &event->hw; in hisi_ddrc_pmu_get_event_idx() local [all …]
|
/Linux-v4.19/arch/x86/events/amd/ |
D | iommu.c | 212 struct hw_perf_event *hwc = &event->hw; in perf_iommu_event_init() local 235 hwc->conf = event->attr.config; in perf_iommu_event_init() 236 hwc->conf1 = event->attr.config1; in perf_iommu_event_init() 249 struct hw_perf_event *hwc = &ev->hw; in perf_iommu_enable_event() local 250 u8 bank = hwc->iommu_bank; in perf_iommu_enable_event() 251 u8 cntr = hwc->iommu_cntr; in perf_iommu_enable_event() 254 reg = GET_CSOURCE(hwc); in perf_iommu_enable_event() 257 reg = GET_DEVID_MASK(hwc); in perf_iommu_enable_event() 258 reg = GET_DEVID(hwc) | (reg << 32); in perf_iommu_enable_event() 263 reg = GET_PASID_MASK(hwc); in perf_iommu_enable_event() [all …]
|
D | ibs.c | 111 perf_event_set_period(struct hw_perf_event *hwc, u64 min, u64 max, u64 *hw_period) in perf_event_set_period() argument 113 s64 left = local64_read(&hwc->period_left); in perf_event_set_period() 114 s64 period = hwc->sample_period; in perf_event_set_period() 122 local64_set(&hwc->period_left, left); in perf_event_set_period() 123 hwc->last_period = period; in perf_event_set_period() 129 local64_set(&hwc->period_left, left); in perf_event_set_period() 130 hwc->last_period = period; in perf_event_set_period() 156 struct hw_perf_event *hwc = &event->hw; in perf_event_try_update() local 168 prev_raw_count = local64_read(&hwc->prev_count); in perf_event_try_update() 169 if (local64_cmpxchg(&hwc->prev_count, prev_raw_count, in perf_event_try_update() [all …]
|
D | uncore.c | 87 struct hw_perf_event *hwc = &event->hw; in amd_uncore_read() local 96 prev = local64_read(&hwc->prev_count); in amd_uncore_read() 97 rdpmcl(hwc->event_base_rdpmc, new); in amd_uncore_read() 98 local64_set(&hwc->prev_count, new); in amd_uncore_read() 106 struct hw_perf_event *hwc = &event->hw; in amd_uncore_start() local 109 wrmsrl(hwc->event_base, (u64)local64_read(&hwc->prev_count)); in amd_uncore_start() 111 hwc->state = 0; in amd_uncore_start() 112 wrmsrl(hwc->config_base, (hwc->config | ARCH_PERFMON_EVENTSEL_ENABLE)); in amd_uncore_start() 118 struct hw_perf_event *hwc = &event->hw; in amd_uncore_stop() local 120 wrmsrl(hwc->config_base, hwc->config); in amd_uncore_stop() [all …]
|
D | power.c | 52 struct hw_perf_event *hwc = &event->hw; in event_update() local 56 prev_pwr_acc = hwc->pwr_acc; in event_update() 57 prev_ptsc = hwc->ptsc; in event_update() 96 struct hw_perf_event *hwc = &event->hw; in pmu_event_stop() local 99 if (!(hwc->state & PERF_HES_STOPPED)) in pmu_event_stop() 100 hwc->state |= PERF_HES_STOPPED; in pmu_event_stop() 103 if ((mode & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { in pmu_event_stop() 109 hwc->state |= PERF_HES_UPTODATE; in pmu_event_stop() 115 struct hw_perf_event *hwc = &event->hw; in pmu_event_add() local 117 hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED; in pmu_event_add()
|
/Linux-v4.19/arch/xtensa/kernel/ |
D | perf_event.c | 140 struct hw_perf_event *hwc, int idx) in xtensa_perf_event_update() argument 146 prev_raw_count = local64_read(&hwc->prev_count); in xtensa_perf_event_update() 148 } while (local64_cmpxchg(&hwc->prev_count, prev_raw_count, in xtensa_perf_event_update() 154 local64_sub(delta, &hwc->period_left); in xtensa_perf_event_update() 158 struct hw_perf_event *hwc, int idx) in xtensa_perf_event_set_period() argument 166 s64 period = hwc->sample_period; in xtensa_perf_event_set_period() 168 left = local64_read(&hwc->period_left); in xtensa_perf_event_set_period() 171 local64_set(&hwc->period_left, left); in xtensa_perf_event_set_period() 172 hwc->last_period = period; in xtensa_perf_event_set_period() 176 local64_set(&hwc->period_left, left); in xtensa_perf_event_set_period() [all …]
|
/Linux-v4.19/arch/riscv/kernel/ |
D | perf_event.c | 216 struct hw_perf_event *hwc = &event->hw; in riscv_pmu_read() local 219 int idx = hwc->idx; in riscv_pmu_read() 223 prev_raw_count = local64_read(&hwc->prev_count); in riscv_pmu_read() 226 oldval = local64_cmpxchg(&hwc->prev_count, prev_raw_count, in riscv_pmu_read() 253 struct hw_perf_event *hwc = &event->hw; in riscv_pmu_stop() local 255 WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED); in riscv_pmu_stop() 256 hwc->state |= PERF_HES_STOPPED; in riscv_pmu_stop() 258 if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { in riscv_pmu_stop() 260 hwc->state |= PERF_HES_UPTODATE; in riscv_pmu_stop() 269 struct hw_perf_event *hwc = &event->hw; in riscv_pmu_start() local [all …]
|
/Linux-v4.19/drivers/perf/ |
D | arm_pmu.c | 122 struct hw_perf_event *hwc = &event->hw; in armpmu_event_set_period() local 123 s64 left = local64_read(&hwc->period_left); in armpmu_event_set_period() 124 s64 period = hwc->sample_period; in armpmu_event_set_period() 131 local64_set(&hwc->period_left, left); in armpmu_event_set_period() 132 hwc->last_period = period; in armpmu_event_set_period() 138 local64_set(&hwc->period_left, left); in armpmu_event_set_period() 139 hwc->last_period = period; in armpmu_event_set_period() 152 local64_set(&hwc->prev_count, (u64)-left); in armpmu_event_set_period() 164 struct hw_perf_event *hwc = &event->hw; in armpmu_event_update() local 169 prev_raw_count = local64_read(&hwc->prev_count); in armpmu_event_update() [all …]
|
D | qcom_l2_pmu.c | 349 struct hw_perf_event *hwc = &event->hw; in l2_cache_event_update() local 351 u32 idx = hwc->idx; in l2_cache_event_update() 354 prev = local64_read(&hwc->prev_count); in l2_cache_event_update() 356 } while (local64_cmpxchg(&hwc->prev_count, prev, now) != prev); in l2_cache_event_update() 370 struct hw_perf_event *hwc) in l2_cache_cluster_set_period() argument 372 u32 idx = hwc->idx; in l2_cache_cluster_set_period() 385 local64_set(&hwc->prev_count, new); in l2_cache_cluster_set_period() 392 struct hw_perf_event *hwc = &event->hw; in l2_cache_get_event_idx() local 397 if (hwc->config_base == L2CYCLE_CTR_RAW_CODE) { in l2_cache_get_event_idx() 414 group = L2_EVT_GROUP(hwc->config_base); in l2_cache_get_event_idx() [all …]
|
/Linux-v4.19/arch/s390/kernel/ |
D | perf_cpum_sf.c | 316 static unsigned long sfb_max_limit(struct hw_perf_event *hwc) in sfb_max_limit() argument 318 return SAMPL_DIAG_MODE(hwc) ? CPUM_SF_MAX_SDB * CPUM_SF_SDB_DIAG_FACTOR in sfb_max_limit() 323 struct hw_perf_event *hwc) in sfb_pending_allocs() argument 326 return SFB_ALLOC_REG(hwc); in sfb_pending_allocs() 327 if (SFB_ALLOC_REG(hwc) > sfb->num_sdb) in sfb_pending_allocs() 328 return SFB_ALLOC_REG(hwc) - sfb->num_sdb; in sfb_pending_allocs() 333 struct hw_perf_event *hwc) in sfb_has_pending_allocs() argument 335 return sfb_pending_allocs(sfb, hwc) > 0; in sfb_has_pending_allocs() 338 static void sfb_account_allocs(unsigned long num, struct hw_perf_event *hwc) in sfb_account_allocs() argument 341 num = min_t(unsigned long, num, sfb_max_limit(hwc) - SFB_ALLOC_REG(hwc)); in sfb_account_allocs() [all …]
|
D | perf_cpum_cf.c | 99 static int validate_ctr_version(const struct hw_perf_event *hwc) in validate_ctr_version() argument 108 switch (hwc->config_base) { in validate_ctr_version() 118 if ((cpuhw->info.csvn == 1 && hwc->config > 159) || in validate_ctr_version() 119 (cpuhw->info.csvn == 2 && hwc->config > 175) || in validate_ctr_version() 120 (cpuhw->info.csvn > 2 && hwc->config > 255)) in validate_ctr_version() 150 static int validate_ctr_auth(const struct hw_perf_event *hwc) in validate_ctr_auth() argument 163 ctrs_state = cpumf_state_ctl[hwc->config_base]; in validate_ctr_auth() 333 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init() local 392 hwc->config = ev; in __hw_perf_event_init() 393 hwc->config_base = set; in __hw_perf_event_init() [all …]
|
/Linux-v4.19/arch/arm/kernel/ |
D | perf_event_xscale.c | 175 struct hw_perf_event *hwc; in xscale1pmu_handle_irq() local 183 hwc = &event->hw; in xscale1pmu_handle_irq() 185 perf_sample_data_init(&data, 0, hwc->last_period); in xscale1pmu_handle_irq() 208 struct hw_perf_event *hwc = &event->hw; in xscale1pmu_enable_event() local 210 int idx = hwc->idx; in xscale1pmu_enable_event() 219 evt = (hwc->config_base << XSCALE1_COUNT0_EVT_SHFT) | in xscale1pmu_enable_event() 224 evt = (hwc->config_base << XSCALE1_COUNT1_EVT_SHFT) | in xscale1pmu_enable_event() 244 struct hw_perf_event *hwc = &event->hw; in xscale1pmu_disable_event() local 246 int idx = hwc->idx; in xscale1pmu_disable_event() 278 struct hw_perf_event *hwc = &event->hw; in xscale1pmu_get_event_idx() local [all …]
|
D | perf_event_v7.c | 749 struct hw_perf_event *hwc = &event->hw; in armv7pmu_read_counter() local 750 int idx = hwc->idx; in armv7pmu_read_counter() 769 struct hw_perf_event *hwc = &event->hw; in armv7pmu_write_counter() local 770 int idx = hwc->idx; in armv7pmu_write_counter() 874 struct hw_perf_event *hwc = &event->hw; in armv7pmu_enable_event() local 877 int idx = hwc->idx; in armv7pmu_enable_event() 902 armv7_pmnc_write_evtsel(idx, hwc->config_base); in armv7pmu_enable_event() 920 struct hw_perf_event *hwc = &event->hw; in armv7pmu_disable_event() local 923 int idx = hwc->idx; in armv7pmu_disable_event() 975 struct hw_perf_event *hwc; in armv7pmu_handle_irq() local [all …]
|
/Linux-v4.19/arch/x86/events/intel/ |
D | uncore_nhmex.c | 247 struct hw_perf_event *hwc = &event->hw; in nhmex_uncore_msr_enable_event() local 249 if (hwc->idx == UNCORE_PMC_IDX_FIXED) in nhmex_uncore_msr_enable_event() 250 wrmsrl(hwc->config_base, NHMEX_PMON_CTL_EN_BIT0); in nhmex_uncore_msr_enable_event() 252 wrmsrl(hwc->config_base, hwc->config | NHMEX_PMON_CTL_EN_BIT22); in nhmex_uncore_msr_enable_event() 254 wrmsrl(hwc->config_base, hwc->config | NHMEX_PMON_CTL_EN_BIT0); in nhmex_uncore_msr_enable_event() 352 struct hw_perf_event *hwc = &event->hw; in nhmex_bbox_hw_config() local 353 struct hw_perf_event_extra *reg1 = &hwc->extra_reg; in nhmex_bbox_hw_config() 354 struct hw_perf_event_extra *reg2 = &hwc->branch_reg; in nhmex_bbox_hw_config() 357 ctr = (hwc->config & NHMEX_B_PMON_CTR_MASK) >> in nhmex_bbox_hw_config() 359 ev_sel = (hwc->config & NHMEX_B_PMON_CTL_EV_SEL_MASK) >> in nhmex_bbox_hw_config() [all …]
|
D | p4.c | 855 static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc) in p4_pmu_clear_cccr_ovf() argument 860 rdmsrl(hwc->config_base, v); in p4_pmu_clear_cccr_ovf() 862 wrmsrl(hwc->config_base, v & ~P4_CCCR_OVF); in p4_pmu_clear_cccr_ovf() 873 rdmsrl(hwc->event_base, v); in p4_pmu_clear_cccr_ovf() 905 struct hw_perf_event *hwc = &event->hw; in p4_pmu_disable_event() local 912 (void)wrmsrl_safe(hwc->config_base, in p4_pmu_disable_event() 913 p4_config_unpack_cccr(hwc->config) & ~P4_CCCR_ENABLE & ~P4_CCCR_OVF & ~P4_CCCR_RESERVED); in p4_pmu_disable_event() 951 struct hw_perf_event *hwc = &event->hw; in p4_pmu_enable_event() local 952 int thread = p4_ht_config_thread(hwc->config); in p4_pmu_enable_event() 953 u64 escr_conf = p4_config_unpack_escr(p4_clear_ht_bit(hwc->config)); in p4_pmu_enable_event() [all …]
|
/Linux-v4.19/arch/x86/events/ |
D | core.c | 70 struct hw_perf_event *hwc = &event->hw; in x86_perf_event_update() local 73 int idx = hwc->idx; in x86_perf_event_update() 87 prev_raw_count = local64_read(&hwc->prev_count); in x86_perf_event_update() 88 rdpmcl(hwc->event_base_rdpmc, new_raw_count); in x86_perf_event_update() 90 if (local64_cmpxchg(&hwc->prev_count, prev_raw_count, in x86_perf_event_update() 106 local64_sub(delta, &hwc->period_left); in x86_perf_event_update() 300 set_ext_hw_attr(struct hw_perf_event *hwc, struct perf_event *event) in set_ext_hw_attr() argument 331 hwc->config |= val; in set_ext_hw_attr() 410 struct hw_perf_event *hwc = &event->hw; in x86_setup_perfctr() local 414 hwc->sample_period = x86_pmu.max_period; in x86_setup_perfctr() [all …]
|
/Linux-v4.19/arch/sh/kernel/ |
D | perf_event.c | 124 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init() local 174 hwc->config |= config; in __hw_perf_event_init() 180 struct hw_perf_event *hwc, int idx) in sh_perf_event_update() argument 199 prev_raw_count = local64_read(&hwc->prev_count); in sh_perf_event_update() 202 if (local64_cmpxchg(&hwc->prev_count, prev_raw_count, in sh_perf_event_update() 223 struct hw_perf_event *hwc = &event->hw; in sh_pmu_stop() local 224 int idx = hwc->idx; in sh_pmu_stop() 227 sh_pmu->disable(hwc, idx); in sh_pmu_stop() 241 struct hw_perf_event *hwc = &event->hw; in sh_pmu_start() local 242 int idx = hwc->idx; in sh_pmu_start() [all …]
|
/Linux-v4.19/arch/mips/kernel/ |
D | perf_event_mipsxx.c | 295 struct hw_perf_event *hwc) in mipsxx_pmu_alloc_counter() argument 303 unsigned long cntr_mask = (hwc->event_base >> 8) & 0xffff; in mipsxx_pmu_alloc_counter() 389 struct hw_perf_event *hwc, in mipspmu_event_set_period() argument 392 u64 left = local64_read(&hwc->period_left); in mipspmu_event_set_period() 393 u64 period = hwc->sample_period; in mipspmu_event_set_period() 399 local64_set(&hwc->period_left, left); in mipspmu_event_set_period() 400 hwc->last_period = period; in mipspmu_event_set_period() 405 local64_set(&hwc->period_left, left); in mipspmu_event_set_period() 406 hwc->last_period = period; in mipspmu_event_set_period() 412 local64_set(&hwc->period_left, left); in mipspmu_event_set_period() [all …]
|
/Linux-v4.19/drivers/clk/ |
D | clk-qoriq.c | 712 struct mux_hwclock *hwc = to_mux_hwclock(hw); in mux_set_parent() local 715 if (idx >= hwc->num_parents) in mux_set_parent() 718 clksel = hwc->parent_to_clksel[idx]; in mux_set_parent() 719 cg_out(hwc->cg, (clksel << CLKSEL_SHIFT) & CLKSEL_MASK, hwc->reg); in mux_set_parent() 726 struct mux_hwclock *hwc = to_mux_hwclock(hw); in mux_get_parent() local 730 clksel = (cg_in(hwc->cg, hwc->reg) & CLKSEL_MASK) >> CLKSEL_SHIFT; in mux_get_parent() 732 ret = hwc->clksel_to_parent[clksel]; in mux_get_parent() 734 pr_err("%s: mux at %p has bad clksel\n", __func__, hwc->reg); in mux_get_parent() 755 struct mux_hwclock *hwc, in get_pll_div() argument 760 if (!(hwc->info->clksel[idx].flags & CLKSEL_VALID)) in get_pll_div() [all …]
|
/Linux-v4.19/include/linux/iio/ |
D | hw-consumer.h | 15 void iio_hw_consumer_free(struct iio_hw_consumer *hwc); 17 void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc); 18 int iio_hw_consumer_enable(struct iio_hw_consumer *hwc); 19 void iio_hw_consumer_disable(struct iio_hw_consumer *hwc);
|