/kernel/linux/linux-5.10/arch/x86/lib/ |
H A D | delay.c | 37 static void (*delay_halt_fn)(u64 start, u64 cycles) __ro_after_init; 63 static void delay_tsc(u64 cycles) in delay_tsc() argument 73 if ((now - bclock) >= cycles) in delay_tsc() 91 cycles -= (now - bclock); in delay_tsc() 105 static void delay_halt_tpause(u64 start, u64 cycles) in delay_halt_tpause() argument 107 u64 until = start + cycles; in delay_halt_tpause() 122 * counts with TSC frequency. The input value is the number of TSC cycles 125 static void delay_halt_mwaitx(u64 unused, u64 cycles) in delay_halt_mwaitx() argument 129 delay = min_t(u64, MWAITX_MAX_WAIT_CYCLES, cycles); in delay_halt_mwaitx() 151 u64 start, end, cycles in delay_halt() local [all...] |
/kernel/linux/linux-6.6/arch/x86/lib/ |
H A D | delay.c | 37 static void (*delay_halt_fn)(u64 start, u64 cycles) __ro_after_init; 63 static void delay_tsc(u64 cycles) in delay_tsc() argument 73 if ((now - bclock) >= cycles) in delay_tsc() 91 cycles -= (now - bclock); in delay_tsc() 105 static void delay_halt_tpause(u64 start, u64 cycles) in delay_halt_tpause() argument 107 u64 until = start + cycles; in delay_halt_tpause() 122 * counts with TSC frequency. The input value is the number of TSC cycles 125 static void delay_halt_mwaitx(u64 unused, u64 cycles) in delay_halt_mwaitx() argument 129 delay = min_t(u64, MWAITX_MAX_WAIT_CYCLES, cycles); in delay_halt_mwaitx() 151 u64 start, end, cycles in delay_halt() local [all...] |
/kernel/linux/linux-6.6/tools/perf/dlfilters/ |
H A D | dlfilter-show-cycles.c | 3 * dlfilter-show-cycles.c: Print the number of cycles at the start of each line 19 static __u64 cycles[MAX_CPU][MAX_ENTRY]; variable 30 __u64 cycles[MAX_ENTRY]; member 77 e->cycles[pos] += cnt; in add_entry() 92 cycles[cpu][pos] += sample->cyc_cnt; in filter_event_early() 98 static void print_vals(__u64 cycles, __u64 delta) in print_vals() argument 101 printf("%10llu %10llu ", (unsigned long long)cycles, (unsigned long long)delta); in print_vals() 103 printf("%10llu %10s ", (unsigned long long)cycles, ""); in print_vals() 115 print_vals(cycles[cp in filter_event() [all...] |
/kernel/linux/linux-5.10/drivers/gpu/drm/i915/gt/ |
H A D | selftest_gt_pm.c | 44 u32 cycles[5]; in measure_clocks() local 49 cycles[i] = -ENGINE_READ_FW(engine, RING_TIMESTAMP); in measure_clocks() 55 cycles[i] += ENGINE_READ_FW(engine, RING_TIMESTAMP); in measure_clocks() 60 sort(cycles, 5, sizeof(*cycles), cmp_u32, NULL); in measure_clocks() 61 *out_cycles = (cycles[1] + 2 * cycles[2] + cycles[3]) / 4; in measure_clocks() 105 u32 cycles; in live_gt_clocks() local 113 measure_clocks(engine, &cycles, in live_gt_clocks() [all...] |
/kernel/linux/linux-6.6/drivers/gpu/drm/i915/gt/ |
H A D | selftest_gt_pm.c | 56 u32 cycles[5]; in measure_clocks() local 61 cycles[i] = -read_timestamp(engine); in measure_clocks() 66 cycles[i] += read_timestamp(engine); in measure_clocks() 72 sort(cycles, 5, sizeof(*cycles), cmp_u32, NULL); in measure_clocks() 73 *out_cycles = (cycles[1] + 2 * cycles[2] + cycles[3]) / 4; in measure_clocks() 98 u32 cycles; in live_gt_clocks() local 106 measure_clocks(engine, &cycles, in live_gt_clocks() [all...] |
/kernel/uniproton/src/core/kernel/sys/ |
H A D | prt_sys_time.c | 54 OS_SEC_ALW_INLINE INLINE void OsTimerDelayCount(U64 cycles) in OsTimerDelayCount() argument 60 end = cur + cycles; in OsTimerDelayCount() 84 U64 cycles; in PRT_ClkDelayMs() local 87 cycles = OS_MS2CYCLE(delay, g_systemClock); in PRT_ClkDelayMs() 89 OsTimerDelayCount(cycles); in PRT_ClkDelayMs() 97 U64 cycles; in PRT_ClkDelayUs() local 99 cycles = OS_US2CYCLE(delay, g_systemClock); in PRT_ClkDelayUs() 101 OsTimerDelayCount(cycles); in PRT_ClkDelayUs()
|
/kernel/linux/linux-5.10/drivers/memory/ |
H A D | jz4780-nemc.c | 163 uint32_t smcr, val, cycles; in jz4780_nemc_configure_bank() local 172 /* 11 - 12 -> 12 cycles */ in jz4780_nemc_configure_bank() 175 /* 13 - 15 -> 15 cycles */ in jz4780_nemc_configure_bank() 178 /* 16 - 20 -> 20 cycles */ in jz4780_nemc_configure_bank() 181 /* 21 - 25 -> 25 cycles */ in jz4780_nemc_configure_bank() 184 /* 26 - 31 -> 31 cycles */ in jz4780_nemc_configure_bank() 209 cycles = jz4780_nemc_ns_to_cycles(nemc, val); in jz4780_nemc_configure_bank() 210 if (cycles > nemc->soc_info->tas_tah_cycles_max) { in jz4780_nemc_configure_bank() 211 dev_err(nemc->dev, "tAS %u is too high (%u cycles)\n", in jz4780_nemc_configure_bank() 212 val, cycles); in jz4780_nemc_configure_bank() [all...] |
/kernel/linux/linux-6.6/drivers/memory/ |
H A D | jz4780-nemc.c | 162 uint32_t smcr, val, cycles; in jz4780_nemc_configure_bank() local 171 /* 11 - 12 -> 12 cycles */ in jz4780_nemc_configure_bank() 174 /* 13 - 15 -> 15 cycles */ in jz4780_nemc_configure_bank() 177 /* 16 - 20 -> 20 cycles */ in jz4780_nemc_configure_bank() 180 /* 21 - 25 -> 25 cycles */ in jz4780_nemc_configure_bank() 183 /* 26 - 31 -> 31 cycles */ in jz4780_nemc_configure_bank() 208 cycles = jz4780_nemc_ns_to_cycles(nemc, val); in jz4780_nemc_configure_bank() 209 if (cycles > nemc->soc_info->tas_tah_cycles_max) { in jz4780_nemc_configure_bank() 210 dev_err(nemc->dev, "tAS %u is too high (%u cycles)\n", in jz4780_nemc_configure_bank() 211 val, cycles); in jz4780_nemc_configure_bank() [all...] |
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx4/ |
H A D | en_clock.c | 44 container_of(tc, struct mlx4_en_dev, cycles); in mlx4_en_read_clock() 141 mdev->cycles.mult = neg_adj ? mult - diff : mult + diff; in mlx4_en_phc_adjfreq() 210 timecounter_init(&mdev->clock, &mdev->cycles, ns); in mlx4_en_phc_settime() 249 * of MLX4_EN_WRAP_AROUND_SEC values in the cycles register. 277 memset(&mdev->cycles, 0, sizeof(mdev->cycles)); in mlx4_en_init_timestamp() 278 mdev->cycles.read = mlx4_en_read_clock; in mlx4_en_init_timestamp() 279 mdev->cycles.mask = CLOCKSOURCE_MASK(48); in mlx4_en_init_timestamp() 280 mdev->cycles.shift = freq_to_shift(dev->caps.hca_core_clock); in mlx4_en_init_timestamp() 281 mdev->cycles in mlx4_en_init_timestamp() [all...] |
/kernel/linux/linux-6.6/drivers/net/ethernet/mellanox/mlx4/ |
H A D | en_clock.c | 44 container_of(tc, struct mlx4_en_dev, cycles); in mlx4_en_read_clock() 139 mdev->cycles.mult = mult; in mlx4_en_phc_adjfine() 208 timecounter_init(&mdev->clock, &mdev->cycles, ns); in mlx4_en_phc_settime() 247 * of MLX4_EN_WRAP_AROUND_SEC values in the cycles register. 275 memset(&mdev->cycles, 0, sizeof(mdev->cycles)); in mlx4_en_init_timestamp() 276 mdev->cycles.read = mlx4_en_read_clock; in mlx4_en_init_timestamp() 277 mdev->cycles.mask = CLOCKSOURCE_MASK(48); in mlx4_en_init_timestamp() 278 mdev->cycles.shift = freq_to_shift(dev->caps.hca_core_clock); in mlx4_en_init_timestamp() 279 mdev->cycles in mlx4_en_init_timestamp() [all...] |
/kernel/liteos_a/arch/arm/arm/src/ |
H A D | arm_generic_timer.c | 151 UINT64 cycles = (UINT64)usecs * g_sysClock / OS_SYS_US_PER_SECOND;
in HalDelayUs() local 152 UINT64 deadline = HalClockGetCycles() + cycles;
in HalDelayUs() 167 UINT64 cycles = HalClockGetCycles();
in HalClockGetTickTimerCycles() local 169 return (UINT32)((cval > cycles) ? (cval - cycles) : 0);
in HalClockGetTickTimerCycles() 172 UINT64 HalClockTickTimerReload(UINT64 cycles)
in HalClockTickTimerReload() argument 178 TimerCvalWrite(HalClockGetCycles() + cycles);
in HalClockTickTimerReload() 182 return cycles;
in HalClockTickTimerReload()
|
/kernel/linux/linux-6.6/arch/arm64/lib/ |
H A D | delay.c | 26 void __delay(unsigned long cycles) in __delay() argument 31 u64 end = start + cycles; in __delay() 38 while ((get_cycles() - start) < cycles) in __delay() 44 while ((get_cycles() - start + timer_evt_period) < cycles) in __delay() 48 while ((get_cycles() - start) < cycles) in __delay()
|
/kernel/linux/linux-5.10/drivers/net/wireless/ath/ |
H A D | hw.c | 144 u32 cycles, busy, rx, tx; in ath_hw_cycle_counters_update() local 151 cycles = REG_READ(ah, AR_CCCNT); in ath_hw_cycle_counters_update() 166 common->cc_ani.cycles += cycles; in ath_hw_cycle_counters_update() 171 common->cc_survey.cycles += cycles; in ath_hw_cycle_counters_update() 183 listen_time = (cc->cycles - cc->rx_frame - cc->tx_frame) / in ath_hw_get_listen_time()
|
/kernel/linux/linux-6.6/drivers/net/wireless/ath/ |
H A D | hw.c | 144 u32 cycles, busy, rx, tx; in ath_hw_cycle_counters_update() local 151 cycles = REG_READ(ah, AR_CCCNT); in ath_hw_cycle_counters_update() 166 common->cc_ani.cycles += cycles; in ath_hw_cycle_counters_update() 171 common->cc_survey.cycles += cycles; in ath_hw_cycle_counters_update() 183 listen_time = (cc->cycles - cc->rx_frame - cc->tx_frame) / in ath_hw_get_listen_time()
|
/kernel/linux/linux-5.10/arch/xtensa/include/asm/ |
H A D | delay.h | 25 /* 2 cycles per loop. */ in __delay() 40 unsigned long cycles = (usecs * (ccount_freq >> 15)) >> 5; in __udelay() local 43 while (((unsigned long)get_ccount()) - start < cycles) in __udelay() 61 unsigned long cycles = (nsec * (ccount_freq >> 15)) >> 15; in __ndelay() local 62 __delay(cycles); in __ndelay()
|
/kernel/linux/linux-6.6/arch/xtensa/include/asm/ |
H A D | delay.h | 25 /* 2 cycles per loop. */ in __delay() 40 unsigned long cycles = (usecs * (ccount_freq >> 15)) >> 5; in __udelay() local 43 while (((unsigned long)get_ccount()) - start < cycles) in __udelay() 61 unsigned long cycles = (nsec * (ccount_freq >> 15)) >> 15; in __ndelay() local 62 __delay(cycles); in __ndelay()
|
/kernel/linux/linux-5.10/drivers/pwm/ |
H A D | pwm-berlin.c | 96 u64 cycles; in berlin_pwm_config() local 98 cycles = clk_get_rate(pwm->clk); in berlin_pwm_config() 99 cycles *= period_ns; in berlin_pwm_config() 100 do_div(cycles, NSEC_PER_SEC); in berlin_pwm_config() 102 if (cycles > BERLIN_PWM_MAX_TCNT) { in berlin_pwm_config() 104 cycles >>= 12; // Prescaled by 4096 in berlin_pwm_config() 106 if (cycles > BERLIN_PWM_MAX_TCNT) in berlin_pwm_config() 110 period = cycles; in berlin_pwm_config() 111 cycles *= duty_ns; in berlin_pwm_config() 112 do_div(cycles, period_n in berlin_pwm_config() [all...] |
/kernel/linux/linux-6.6/drivers/pwm/ |
H A D | pwm-berlin.c | 97 u64 cycles; in berlin_pwm_config() local 99 cycles = clk_get_rate(bpc->clk); in berlin_pwm_config() 100 cycles *= period_ns; in berlin_pwm_config() 101 do_div(cycles, NSEC_PER_SEC); in berlin_pwm_config() 103 if (cycles > BERLIN_PWM_MAX_TCNT) { in berlin_pwm_config() 105 cycles >>= 12; // Prescaled by 4096 in berlin_pwm_config() 107 if (cycles > BERLIN_PWM_MAX_TCNT) in berlin_pwm_config() 111 period = cycles; in berlin_pwm_config() 112 cycles *= duty_ns; in berlin_pwm_config() 113 do_div(cycles, period_n in berlin_pwm_config() [all...] |
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/lib/ |
H A D | clock.c | 92 struct mlx5_timer *timer = container_of(cc, struct mlx5_timer, cycles); in read_internal_timer() 115 clock_info->cycles = timer->tc.cycle_last; in mlx5_update_clock_info_page() 116 clock_info->mult = timer->cycles.mult; in mlx5_update_clock_info_page() 187 timecounter_init(&timer->tc, &timer->cycles, ns); in mlx5_ptp_settime() 201 u64 cycles, ns; in mlx5_ptp_gettimex() local 205 cycles = mlx5_read_internal_timer(mdev, sts); in mlx5_ptp_gettimex() 206 ns = timecounter_cyc2time(&timer->tc, cycles); in mlx5_ptp_gettimex() 252 timer->cycles.mult = neg_adj ? timer->nominal_c_mult - diff : in mlx5_ptp_adjfreq() 375 cycles_delta = div64_u64(nsec_delta << timer->cycles.shift, in mlx5_perout_configure() 376 timer->cycles in mlx5_perout_configure() [all...] |
/kernel/linux/linux-6.6/tools/perf/tests/shell/ |
H A D | stat_bpf_counters.sh | 25 if ! perf stat -e cycles --bpf-counters true > /dev/null 2>&1; then 28 perf --no-pager stat -e cycles --bpf-counters true || true 33 base_cycles=$(perf stat --no-big-num -e cycles -- perf bench sched messaging -g 1 -l 100 -t 2>&1 | awk '/cycles/ {print $1}') 35 echo "Skipping: cycles event not counted" 38 bpf_cycles=$(perf stat --no-big-num --bpf-counters -e cycles -- perf bench sched messaging -g 1 -l 100 -t 2>&1 | awk '/cycles/ {print $1}') 40 echo "Failed: cycles not counted with --bpf-counters"
|
H A D | stat+shadow_stat.sh | 11 perf stat -a -e cycles sleep 1 2>&1 | grep -e cpu_core && exit 2 15 perf stat -a --no-big-num -e cycles,instructions sleep 1 2>&1 | \ 16 grep -e cycles -e instructions | \ 24 # save cycles count 25 if [ "$evt" = "cycles" ]; then 30 # skip if no cycles 46 perf stat -a -A --no-big-num -e cycles,instructions sleep 1 2>&1 | \ 55 # save cycles count 56 if [ "$evt" = "cycles" ]; then 64 # skip if no cycles [all...] |
/kernel/uniproton/src/om/cpup/ |
H A D | prt_cpup_thread_internal.h | 72 U64 cycles = curCycle - g_cpuWinStart; in OsCpupGetWinCycles() local 75 if (cycles == 0) { in OsCpupGetWinCycles() 76 cycles = (U64)(-1); in OsCpupGetWinCycles() 79 return cycles; in OsCpupGetWinCycles()
|
/kernel/linux/linux-5.10/tools/perf/util/ |
H A D | block-info.c | 106 bi->cycles = ch->cycles; in init_block_info() 122 u64 cycles = 0; in block_info__process_sym() local 146 cycles += bi->cycles_aggr / bi->num_aggr; in block_info__process_sym() 158 *block_cycles_aggr += cycles; in block_info__process_sym() 229 static void cycles_string(u64 cycles, char *buf, int size) in cycles_string() argument 231 if (cycles >= 1000000) in cycles_string() 232 scnprintf(buf, size, "%.1fM", (double)cycles / 1000000.0); in cycles_string() 233 else if (cycles >= 1000) in cycles_string() 234 scnprintf(buf, size, "%.1fK", (double)cycles / 1000. in cycles_string() [all...] |
/kernel/linux/linux-6.6/tools/perf/util/ |
H A D | block-info.c | 106 bi->cycles = ch->cycles; in init_block_info() 122 u64 cycles = 0; in block_info__process_sym() local 146 cycles += bi->cycles_aggr / bi->num_aggr; in block_info__process_sym() 158 *block_cycles_aggr += cycles; in block_info__process_sym() 229 static void cycles_string(u64 cycles, char *buf, int size) in cycles_string() argument 231 if (cycles >= 1000000) in cycles_string() 232 scnprintf(buf, size, "%.1fM", (double)cycles / 1000000.0); in cycles_string() 233 else if (cycles >= 1000) in cycles_string() 234 scnprintf(buf, size, "%.1fK", (double)cycles / 1000. in cycles_string() [all...] |
/kernel/linux/linux-5.10/arch/arm/plat-omap/ |
H A D | counter_32k.c | 47 * 32k sync timer. Convert the cycles elapsed since last read into 51 static cycles_t cycles; variable 59 last_cycles = cycles; in omap_read_persistent_clock64() 60 cycles = sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; in omap_read_persistent_clock64() 62 nsecs = clocksource_cyc2ns(cycles - last_cycles, in omap_read_persistent_clock64()
|