Lines Matching refs:env
16 struct env env = { variable
27 if (level == LIBBPF_DEBUG && !env.verbose) in libbpf_print_fn()
89 hits_per_prod = hits_per_sec / env.producer_cnt; in hits_drops_report_progress()
130 hits_mean, hits_stddev, hits_mean / env.producer_cnt); in hits_drops_report_final()
187 env.verbose = true; in parse_arg()
190 env.list = true; in parse_arg()
193 env.duration_sec = strtol(arg, NULL, 10); in parse_arg()
194 if (env.duration_sec <= 0) { in parse_arg()
200 env.warmup_sec = strtol(arg, NULL, 10); in parse_arg()
201 if (env.warmup_sec <= 0) { in parse_arg()
207 env.producer_cnt = strtol(arg, NULL, 10); in parse_arg()
208 if (env.producer_cnt <= 0) { in parse_arg()
214 env.consumer_cnt = strtol(arg, NULL, 10); in parse_arg()
215 if (env.consumer_cnt <= 0) { in parse_arg()
221 env.affinity = true; in parse_arg()
224 env.affinity = true; in parse_arg()
225 if (parse_num_list(arg, &env.prod_cpus.cpus, in parse_arg()
226 &env.prod_cpus.cpus_len)) { in parse_arg()
232 env.affinity = true; in parse_arg()
233 if (parse_num_list(arg, &env.cons_cpus.cpus, in parse_arg()
234 &env.cons_cpus.cpus_len)) { in parse_arg()
245 env.bench_name = strdup(arg); in parse_arg()
263 if (!env.list && !env.bench_name) { in parse_cmdline_args()
403 if (!env.bench_name) { in setup_benchmark()
409 if (strcmp(benchs[i]->name, env.bench_name) == 0) { in setup_benchmark()
415 fprintf(stderr, "benchmark '%s' not found\n", env.bench_name); in setup_benchmark()
421 state.producers = calloc(env.producer_cnt, sizeof(*state.producers)); in setup_benchmark()
422 state.consumers = calloc(env.consumer_cnt, sizeof(*state.consumers)); in setup_benchmark()
423 state.results = calloc(env.duration_sec + env.warmup_sec + 2, in setup_benchmark()
433 for (i = 0; i < env.consumer_cnt; i++) { in setup_benchmark()
441 if (env.affinity) in setup_benchmark()
443 next_cpu(&env.cons_cpus)); in setup_benchmark()
449 if (!env.prod_cpus.cpus) in setup_benchmark()
450 env.prod_cpus.next_cpu = env.cons_cpus.next_cpu; in setup_benchmark()
452 for (i = 0; i < env.producer_cnt; i++) { in setup_benchmark()
460 if (env.affinity) in setup_benchmark()
462 next_cpu(&env.prod_cpus)); in setup_benchmark()
480 if (iter == env.duration_sec + env.warmup_sec) { in collect_measurements()
491 if (env.list) { in main()
511 bench->report_final(state.results + env.warmup_sec, in main()
512 state.res_cnt - env.warmup_sec); in main()