Lines Matching refs:rec

111 bool time_bench_calc_stats(struct time_bench_record *rec)  in time_bench_calc_stats()  argument
122 if (rec->flags & TIME_BENCH_LOOP) { in time_bench_calc_stats()
123 if (rec->invoked_cnt < 1000) { in time_bench_calc_stats()
125 rec->invoked_cnt); in time_bench_calc_stats()
128 if (rec->invoked_cnt > ((1ULL << 32) - 1)) { in time_bench_calc_stats()
131 rec->invoked_cnt); in time_bench_calc_stats()
134 invoked_cnt = (uint32_t)rec->invoked_cnt; in time_bench_calc_stats()
138 if (rec->flags & TIME_BENCH_TSC) { in time_bench_calc_stats()
139 rec->tsc_interval = rec->tsc_stop - rec->tsc_start; in time_bench_calc_stats()
140 if (rec->tsc_interval == 0) { in time_bench_calc_stats()
145 if (rec->flags & TIME_BENCH_LOOP) in time_bench_calc_stats()
146 rec->tsc_cycles = rec->tsc_interval / invoked_cnt; in time_bench_calc_stats()
148 rec->tsc_cycles = rec->tsc_interval; in time_bench_calc_stats()
152 if (rec->flags & TIME_BENCH_WALLCLOCK) { in time_bench_calc_stats()
153 rec->time_start = rec->ts_start.tv_nsec + in time_bench_calc_stats()
154 (NANOSEC_PER_SEC * rec->ts_start.tv_sec); in time_bench_calc_stats()
155 rec->time_stop = rec->ts_stop.tv_nsec + in time_bench_calc_stats()
156 (NANOSEC_PER_SEC * rec->ts_stop.tv_sec); in time_bench_calc_stats()
157 rec->time_interval = rec->time_stop - rec->time_start; in time_bench_calc_stats()
158 if (rec->time_interval == 0) { in time_bench_calc_stats()
166 rec->time_sec = div_u64_rem(rec->time_interval, NANOSEC_PER_SEC, in time_bench_calc_stats()
167 &rec->time_sec_remainder); in time_bench_calc_stats()
170 if (rec->flags & TIME_BENCH_LOOP) { in time_bench_calc_stats()
174 rec->ns_per_call_quotient = in time_bench_calc_stats()
175 div_u64_rem(rec->time_interval, invoked_cnt, in time_bench_calc_stats()
181 rec->ns_per_call_decimal = in time_bench_calc_stats()
190 if (rec->flags & TIME_BENCH_PMU) { in time_bench_calc_stats()
192 rec->pmc_inst = rec->pmc_inst_stop - rec->pmc_inst_start; in time_bench_calc_stats()
193 rec->pmc_clk = rec->pmc_clk_stop - rec->pmc_clk_start; in time_bench_calc_stats()
197 rec->pmc_ipc_quotient = div_u64_rem(rec->pmc_inst, rec->pmc_clk, in time_bench_calc_stats()
201 pmc_ipc_div = rec->pmc_clk / 1000; in time_bench_calc_stats()
203 rec->pmc_ipc_decimal = div_u64_rem(pmc_ipc_tmp_rem, in time_bench_calc_stats()
219 struct time_bench_record rec; in time_bench_loop() local
222 memset(&rec, 0, sizeof(rec)); /* zero func might not update all */ in time_bench_loop()
223 rec.version_abi = 1; in time_bench_loop()
224 rec.loops = loops; in time_bench_loop()
225 rec.step = step; in time_bench_loop()
226 rec.flags = (TIME_BENCH_LOOP | TIME_BENCH_TSC | TIME_BENCH_WALLCLOCK); in time_bench_loop()
229 if (!func(&rec, data)) { in time_bench_loop()
234 if (rec.invoked_cnt < loops) in time_bench_loop()
236 rec.invoked_cnt, loops); in time_bench_loop()
239 time_bench_calc_stats(&rec); in time_bench_loop()
242 txt, rec.tsc_cycles, rec.ns_per_call_quotient, in time_bench_loop()
243 rec.ns_per_call_decimal, rec.step, rec.time_sec, in time_bench_loop()
244 rec.time_sec_remainder, rec.time_interval, rec.invoked_cnt, in time_bench_loop()
245 rec.tsc_interval); in time_bench_loop()
246 if (rec.flags & TIME_BENCH_PMU) in time_bench_loop()
248 txt, rec.pmc_inst, rec.pmc_clk, rec.pmc_ipc_quotient, in time_bench_loop()
249 rec.pmc_ipc_decimal); in time_bench_loop()
262 cpumask_set_cpu(cpu->rec.cpu, &newmask); in invoke_test_on_cpu_func()
270 if (!cpu->bench_func(&cpu->rec, data)) { in invoke_test_on_cpu_func()
272 cpu->rec.cpu, smp_processor_id()); in invoke_test_on_cpu_func()
275 pr_info("SUCCESS: ran on CPU:%d(%d)\n", cpu->rec.cpu, in invoke_test_on_cpu_func()
306 struct time_bench_record *rec = &c->rec; in time_bench_print_stats_cpumask() local
309 time_bench_calc_stats(rec); in time_bench_print_stats_cpumask()
312 desc, cpu, rec->tsc_cycles, rec->ns_per_call_quotient, in time_bench_print_stats_cpumask()
313 rec->ns_per_call_decimal, rec->step, rec->time_sec, in time_bench_print_stats_cpumask()
314 rec->time_sec_remainder, rec->time_interval, in time_bench_print_stats_cpumask()
315 rec->invoked_cnt, rec->tsc_interval); in time_bench_print_stats_cpumask()
319 sum.tsc_cycles += rec->tsc_cycles; in time_bench_print_stats_cpumask()
320 step = rec->step; in time_bench_print_stats_cpumask()
354 memset(&c->rec, 0, sizeof(struct time_bench_record)); in time_bench_run_concurrent()
355 c->rec.version_abi = 1; in time_bench_run_concurrent()
356 c->rec.loops = loops; in time_bench_run_concurrent()
357 c->rec.step = step; in time_bench_run_concurrent()
358 c->rec.flags = (TIME_BENCH_LOOP | TIME_BENCH_TSC | in time_bench_run_concurrent()
360 c->rec.cpu = cpu; in time_bench_run_concurrent()