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;
44 iter, (delta_ns - 1000000000) / 1000.0);
47 res->false_hits, total, ((float)res->false_hits / total) * 100);
73 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0);
75 drops_per_sec = res->drops / 1000000.0 / (delta_ns / 1000000000.0);
78 iter, (delta_ns - 1000000000) / 1000.0);
92 gp_stat->mean += res[i].gp_ns / 1000.0 / (double)res[i].gp_ct / (0.0 + res_cnt);
94 #define IT_MEAN_DIFF (res[i].gp_ns / 1000.0 / (double)res[i].gp_ct - gp_stat->mean)
97 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0);
99 gp_stat->stddev = sqrt(gp_stat->stddev);
110 gp_stat->mean += res[i].stime / (double)res[i].gp_ct / (0.0 + res_cnt);
112 #define IT_MEAN_DIFF (res[i].stime / (double)res[i].gp_ct - gp_stat->mean)
115 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0);
117 gp_stat->stddev = sqrt(gp_stat->stddev);
136 hits_stddev += (hits_mean - res[i].hits / 1000000.0) *
137 (hits_mean - res[i].hits / 1000000.0) /
138 (res_cnt - 1.0);
139 drops_stddev += (drops_mean - res[i].drops / 1000000.0) *
140 (drops_mean - res[i].drops / 1000000.0) /
141 (res_cnt - 1.0);
143 total_ops_stddev += (total_ops_mean - total_ops / 1000000.0) *
144 (total_ops_mean - total_ops / 1000000.0) /
145 (res_cnt - 1.0);
163 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0);
166 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0);
181 hits_stddev += (hits_mean - res[i].hits / 1000000.0) *
182 (hits_mean - res[i].hits / 1000000.0) /
183 (res_cnt - 1.0);
189 printf("latency %8.3lf ns/op\n", 1000.0 / hits_mean * env.producer_cnt);
198 hits_per_sec = res->hits / 1000000.0 / delta_sec;
199 important_hits_per_sec = res->important_hits / 1000000.0 / delta_sec;
201 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0);
220 hits_stddev += (hits_mean - res[i].hits / 1000000.0) *
221 (hits_mean - res[i].hits / 1000000.0) /
222 (res_cnt - 1.0);
224 (important_hits_mean - res[i].important_hits / 1000000.0) *
225 (important_hits_mean - res[i].important_hits / 1000000.0) /
226 (res_cnt - 1.0);
234 printf("hits latency %8.3lf ns/op, ", 1000.0 / hits_mean);
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"},
298 { &bench_local_storage_create_argp, 0, "local-storage-create benchmark", 0 },
322 fprintf(stderr, "Invalid duration: %s\n", arg);
329 fprintf(stderr, "Invalid warm-up duration: %s\n", arg);
406 if (bench->argp) {
407 bench_parsers[0].argp = bench->argp;
408 bench_parsers[0].header = bench->name;
421 long delta_ns = new_time_ns - last_time_ns;
428 /* set up periodic 1-second timer */
440 fprintf(stderr, "failed to install SIGALRM handler: %d\n", -errno);
447 fprintf(stderr, "failed to arm interval timer: %d\n", -errno);
462 cpu, -err);
469 if (cpu_set->cpus) {
473 for (i = cpu_set->next_cpu; i < cpu_set->cpus_len; i++) {
474 if (cpu_set->cpus[i]) {
475 cpu_set->next_cpu = i + 1;
483 return cpu_set->next_cpu++ % env.nr_cpus;
509 /* batched, staying mostly in-kernel benchmarks */
586 /* batched, staying mostly in-kernel triggers */
659 if (strcmp(benchs[i]->name, env.bench_name) == 0) {
675 printf("Setting up benchmark '%s'...\n", bench->name);
684 if (bench->validate)
685 bench->validate();
686 if (bench->setup)
687 bench->setup();
690 if (!bench->consumer_thread) {
695 bench->consumer_thread, (void *)(long)i);
698 i, -err);
713 if (!bench->producer_thread) {
718 bench->producer_thread, (void *)(long)i);
721 i, -err);
730 printf("Benchmark '%s' started.\n", bench->name);
740 bench->measure(res);
742 if (bench->report_progress)
743 bench->report_progress(iter, res, delta_ns);
762 printf("- %s\n", benchs[i]->name);
778 if (bench->report_final)
780 bench->report_final(state.results + env.warmup_sec,
781 state.res_cnt - env.warmup_sec);