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

1 // SPDX-License-Identifier: GPL-2.0
41 long total = res->false_hits + res->hits + res->drops; in false_hits_report_progress()
44 iter, (delta_ns - 1000000000) / 1000.0); in false_hits_report_progress()
47 res->false_hits, total, ((float)res->false_hits / total) * 100); in false_hits_report_progress()
73 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress()
75 drops_per_sec = res->drops / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress()
78 iter, (delta_ns - 1000000000) / 1000.0); in hits_drops_report_progress()
92 gp_stat->mean += res[i].gp_ns / 1000.0 / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_latency_basic_stats()
94 #define IT_MEAN_DIFF (res[i].gp_ns / 1000.0 / (double)res[i].gp_ct - gp_stat->mean) in grace_period_latency_basic_stats()
97 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0); in grace_period_latency_basic_stats()
99 gp_stat->stddev = sqrt(gp_stat->stddev); in grace_period_latency_basic_stats()
110 gp_stat->mean += res[i].stime / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_ticks_basic_stats()
112 #define IT_MEAN_DIFF (res[i].stime / (double)res[i].gp_ct - gp_stat->mean) in grace_period_ticks_basic_stats()
115 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0); in grace_period_ticks_basic_stats()
117 gp_stat->stddev = sqrt(gp_stat->stddev); in grace_period_ticks_basic_stats()
136 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in hits_drops_report_final()
137 (hits_mean - res[i].hits / 1000000.0) / in hits_drops_report_final()
138 (res_cnt - 1.0); in hits_drops_report_final()
139 drops_stddev += (drops_mean - res[i].drops / 1000000.0) * in hits_drops_report_final()
140 (drops_mean - res[i].drops / 1000000.0) / in hits_drops_report_final()
141 (res_cnt - 1.0); in hits_drops_report_final()
143 total_ops_stddev += (total_ops_mean - total_ops / 1000000.0) * in hits_drops_report_final()
144 (total_ops_mean - total_ops / 1000000.0) / in hits_drops_report_final()
145 (res_cnt - 1.0); in hits_drops_report_final()
163 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in ops_report_progress()
166 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0); in ops_report_progress()
181 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in ops_report_final()
182 (hits_mean - res[i].hits / 1000000.0) / in ops_report_final()
183 (res_cnt - 1.0); in ops_report_final()
189 printf("latency %8.3lf ns/op\n", 1000.0 / hits_mean * env.producer_cnt); in ops_report_final()
198 hits_per_sec = res->hits / 1000000.0 / delta_sec; in local_storage_report_progress()
199 important_hits_per_sec = res->important_hits / 1000000.0 / delta_sec; in local_storage_report_progress()
201 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0); in local_storage_report_progress()
220 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in local_storage_report_final()
221 (hits_mean - res[i].hits / 1000000.0) / in local_storage_report_final()
222 (res_cnt - 1.0); in local_storage_report_final()
224 (important_hits_mean - res[i].important_hits / 1000000.0) * in local_storage_report_final()
225 (important_hits_mean - res[i].important_hits / 1000000.0) / in local_storage_report_final()
226 (res_cnt - 1.0); in local_storage_report_final()
234 printf("hits latency %8.3lf ns/op, ", 1000.0 / hits_mean); in local_storage_report_final()
246 "USAGE: benchmark <bench-name>\n"
249 " # run 'count-local' benchmark with 1 producer and 1 consumer\n"
250 " benchmark count-local\n"
251 " # run 'count-local' with 16 producer and 8 consumer thread, pinned to CPUs\n"
252 " benchmark -p16 -c8 -a count-local\n";
261 { "duration", 'd', "SEC", 0, "Duration of benchmark, seconds"},
262 { "warmup", 'w', "SEC", 0, "Warm-up period, seconds"},
268 { "prod-affinity", ARG_PROD_AFFINITY_SET, "CPUSET", 0,
269 "Set of CPUs for producer threads; implies --affinity"},
270 { "cons-affinity", ARG_CONS_AFFINITY_SET, "CPUSET", 0,
271 "Set of CPUs for consumer threads; implies --affinity"},
296 { &bench_local_storage_create_argp, 0, "local-storage-create benchmark", 0 },
318 fprintf(stderr, "Invalid duration: %s\n", arg); in parse_arg()
325 fprintf(stderr, "Invalid warm-up duration: %s\n", arg); in parse_arg()
402 if (bench->argp) { in parse_cmdline_args_final()
403 bench_parsers[0].argp = bench->argp; in parse_cmdline_args_final()
404 bench_parsers[0].header = bench->name; in parse_cmdline_args_final()
417 long delta_ns = new_time_ns - last_time_ns; in sigalarm_handler()
424 /* set up periodic 1-second timer */
436 fprintf(stderr, "failed to install SIGALRM handler: %d\n", -errno); in setup_timer()
443 fprintf(stderr, "failed to arm interval timer: %d\n", -errno); in setup_timer()
458 cpu, -err); in set_thread_affinity()
465 if (cpu_set->cpus) { in next_cpu()
469 for (i = cpu_set->next_cpu; i < cpu_set->cpus_len; i++) { in next_cpu()
470 if (cpu_set->cpus[i]) { in next_cpu()
471 cpu_set->next_cpu = i + 1; in next_cpu()
479 return cpu_set->next_cpu++ % env.nr_cpus; in next_cpu()
505 /* batched, staying mostly in-kernel benchmarks */
566 /* batched, staying mostly in-kernel triggers */
623 if (strcmp(benchs[i]->name, env.bench_name) == 0) { in find_benchmark()
639 printf("Setting up benchmark '%s'...\n", bench->name); in setup_benchmark()
648 if (bench->validate) in setup_benchmark()
649 bench->validate(); in setup_benchmark()
650 if (bench->setup) in setup_benchmark()
651 bench->setup(); in setup_benchmark()
654 if (!bench->consumer_thread) { in setup_benchmark()
659 bench->consumer_thread, (void *)(long)i); in setup_benchmark()
662 i, -err); in setup_benchmark()
677 if (!bench->producer_thread) { in setup_benchmark()
682 bench->producer_thread, (void *)(long)i); in setup_benchmark()
685 i, -err); in setup_benchmark()
694 printf("Benchmark '%s' started.\n", bench->name); in setup_benchmark()
704 bench->measure(res); in collect_measurements()
706 if (bench->report_progress) in collect_measurements()
707 bench->report_progress(iter, res, delta_ns); in collect_measurements()
726 printf("- %s\n", benchs[i]->name); in main()
742 if (bench->report_final) in main()
744 bench->report_final(state.results + env.warmup_sec, in main()
745 state.res_cnt - env.warmup_sec); in main()