Lines Matching +full:setup +full:- +full:duration +full:- +full:ns

1 // SPDX-License-Identifier: GPL-2.0
40 long total = res->false_hits + res->hits + res->drops; in false_hits_report_progress()
43 iter, (delta_ns - 1000000000) / 1000.0); in false_hits_report_progress()
46 res->false_hits, total, ((float)res->false_hits / total) * 100); in false_hits_report_progress()
72 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress()
74 drops_per_sec = res->drops / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress()
77 iter, (delta_ns - 1000000000) / 1000.0); in hits_drops_report_progress()
91 gp_stat->mean += res[i].gp_ns / 1000.0 / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_latency_basic_stats()
93 #define IT_MEAN_DIFF (res[i].gp_ns / 1000.0 / (double)res[i].gp_ct - gp_stat->mean) in grace_period_latency_basic_stats()
96 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0); in grace_period_latency_basic_stats()
98 gp_stat->stddev = sqrt(gp_stat->stddev); in grace_period_latency_basic_stats()
109 gp_stat->mean += res[i].stime / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_ticks_basic_stats()
111 #define IT_MEAN_DIFF (res[i].stime / (double)res[i].gp_ct - gp_stat->mean) in grace_period_ticks_basic_stats()
114 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0); in grace_period_ticks_basic_stats()
116 gp_stat->stddev = sqrt(gp_stat->stddev); in grace_period_ticks_basic_stats()
135 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in hits_drops_report_final()
136 (hits_mean - res[i].hits / 1000000.0) / in hits_drops_report_final()
137 (res_cnt - 1.0); in hits_drops_report_final()
138 drops_stddev += (drops_mean - res[i].drops / 1000000.0) * in hits_drops_report_final()
139 (drops_mean - res[i].drops / 1000000.0) / in hits_drops_report_final()
140 (res_cnt - 1.0); in hits_drops_report_final()
142 total_ops_stddev += (total_ops_mean - total_ops / 1000000.0) * in hits_drops_report_final()
143 (total_ops_mean - total_ops / 1000000.0) / in hits_drops_report_final()
144 (res_cnt - 1.0); in hits_drops_report_final()
162 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in ops_report_progress()
165 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0); in ops_report_progress()
180 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in ops_report_final()
181 (hits_mean - res[i].hits / 1000000.0) / in ops_report_final()
182 (res_cnt - 1.0); in ops_report_final()
188 printf("latency %8.3lf ns/op\n", 1000.0 / hits_mean * env.producer_cnt); in ops_report_final()
197 hits_per_sec = res->hits / 1000000.0 / delta_sec; in local_storage_report_progress()
198 important_hits_per_sec = res->important_hits / 1000000.0 / delta_sec; in local_storage_report_progress()
200 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0); in local_storage_report_progress()
219 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in local_storage_report_final()
220 (hits_mean - res[i].hits / 1000000.0) / in local_storage_report_final()
221 (res_cnt - 1.0); in local_storage_report_final()
223 (important_hits_mean - res[i].important_hits / 1000000.0) * in local_storage_report_final()
224 (important_hits_mean - res[i].important_hits / 1000000.0) / in local_storage_report_final()
225 (res_cnt - 1.0); in local_storage_report_final()
233 printf("hits latency %8.3lf ns/op, ", 1000.0 / hits_mean); in local_storage_report_final()
245 "USAGE: benchmark <bench-name>\n"
248 " # run 'count-local' benchmark with 1 producer and 1 consumer\n"
249 " benchmark count-local\n"
250 " # run 'count-local' with 16 producer and 8 consumer thread, pinned to CPUs\n"
251 " benchmark -p16 -c8 -a count-local\n";
260 { "duration", 'd', "SEC", 0, "Duration of benchmark, seconds"},
261 { "warmup", 'w', "SEC", 0, "Warm-up period, seconds"},
267 { "prod-affinity", ARG_PROD_AFFINITY_SET, "CPUSET", 0,
268 "Set of CPUs for producer threads; implies --affinity"},
269 { "cons-affinity", ARG_CONS_AFFINITY_SET, "CPUSET", 0,
270 "Set of CPUs for consumer threads; implies --affinity"},
293 { &bench_local_storage_create_argp, 0, "local-storage-create benchmark", 0 },
313 fprintf(stderr, "Invalid duration: %s\n", arg); in parse_arg()
320 fprintf(stderr, "Invalid warm-up duration: %s\n", arg); in parse_arg()
397 if (bench->argp) { in parse_cmdline_args_final()
398 bench_parsers[0].argp = bench->argp; in parse_cmdline_args_final()
399 bench_parsers[0].header = bench->name; in parse_cmdline_args_final()
412 long delta_ns = new_time_ns - last_time_ns; in sigalarm_handler()
419 /* set up periodic 1-second timer */
431 fprintf(stderr, "failed to install SIGALRM handler: %d\n", -errno); in setup_timer()
438 fprintf(stderr, "failed to arm interval timer: %d\n", -errno); in setup_timer()
453 cpu, -err); in set_thread_affinity()
460 if (cpu_set->cpus) { in next_cpu()
464 for (i = cpu_set->next_cpu; i < cpu_set->cpus_len; i++) { in next_cpu()
465 if (cpu_set->cpus[i]) { in next_cpu()
466 cpu_set->next_cpu = i + 1; in next_cpu()
474 return cpu_set->next_cpu++ % env.nr_cpus; in next_cpu()
579 if (strcmp(benchs[i]->name, env.bench_name) == 0) { in find_benchmark()
595 printf("Setting up benchmark '%s'...\n", bench->name); in setup_benchmark()
604 if (bench->validate) in setup_benchmark()
605 bench->validate(); in setup_benchmark()
606 if (bench->setup) in setup_benchmark()
607 bench->setup(); in setup_benchmark()
611 bench->consumer_thread, (void *)(long)i); in setup_benchmark()
614 i, -err); in setup_benchmark()
630 bench->producer_thread, (void *)(long)i); in setup_benchmark()
633 i, -err); in setup_benchmark()
642 printf("Benchmark '%s' started.\n", bench->name); in setup_benchmark()
652 bench->measure(res); in collect_measurements()
654 if (bench->report_progress) in collect_measurements()
655 bench->report_progress(iter, res, delta_ns); in collect_measurements()
674 printf("- %s\n", benchs[i]->name); in main()
690 if (bench->report_final) in main()
692 bench->report_final(state.results + env.warmup_sec, in main()
693 state.res_cnt - env.warmup_sec); in main()