Lines Matching full:env

142 static struct env {  struct
182 } env; variable
186 if (!env.verbose) in libbpf_print_fn()
188 if (level == LIBBPF_DEBUG && !env.debug) in libbpf_print_fn()
248 env.show_version = true; in parse_arg()
251 env.verbose = true; in parse_arg()
254 env.debug = true; in parse_arg()
255 env.verbose = true; in parse_arg()
258 env.quiet = true; in parse_arg()
261 err = parse_stats(arg, &env.output_spec); in parse_arg()
266 err = parse_stats(arg, &env.sort_spec); in parse_arg()
272 env.out_fmt = RESFMT_TABLE; in parse_arg()
274 env.out_fmt = RESFMT_CSV; in parse_arg()
282 env.log_level = strtol(arg, NULL, 10); in parse_arg()
289 env.log_fixed = true; in parse_arg()
293 env.log_size = strtol(arg, NULL, 10); in parse_arg()
300 env.force_checkpoints = true; in parse_arg()
303 env.force_reg_invariants = true; in parse_arg()
307 env.top_n = strtol(arg, NULL, 10); in parse_arg()
313 env.comparison_mode = true; in parse_arg()
316 env.replay_mode = true; in parse_arg()
322 err = append_filter(&env.deny_filters, &env.deny_filter_cnt, arg + 1); in parse_arg()
324 err = append_filter(&env.allow_filters, &env.allow_filter_cnt, arg); in parse_arg()
331 tmp = realloc(env.filenames, (env.filename_cnt + 1) * sizeof(*env.filenames)); in parse_arg()
334 env.filenames = tmp; in parse_arg()
335 env.filenames[env.filename_cnt] = strdup(arg); in parse_arg()
336 if (!env.filenames[env.filename_cnt]) in parse_arg()
338 env.filename_cnt++; in parse_arg()
412 for (i = 0; i < env.deny_filter_cnt; i++) { in should_process_file_prog()
413 f = &env.deny_filters[i]; in should_process_file_prog()
427 for (i = 0; i < env.allow_filter_cnt; i++) { in should_process_file_prog()
428 f = &env.allow_filters[i]; in should_process_file_prog()
619 err = append_filter(&env.deny_filters, &env.deny_filter_cnt, buf + 1); in append_filter_file()
621 err = append_filter(&env.allow_filters, &env.allow_filter_cnt, buf); in append_filter_file()
974 if (!env.quiet) { in fixup_obj()
980 if (!env.quiet) { in fixup_obj()
1001 env.progs_skipped++; in process_prog()
1005 tmp = realloc(env.prog_stats, (env.prog_stat_cnt + 1) * sizeof(*env.prog_stats)); in process_prog()
1008 env.prog_stats = tmp; in process_prog()
1009 stats = &env.prog_stats[env.prog_stat_cnt++]; in process_prog()
1012 if (env.verbose) { in process_prog()
1013 buf_sz = env.log_size ? env.log_size : 16 * 1024 * 1024; in process_prog()
1018 log_level = env.log_level | 4 | (env.log_fixed ? 8 : 0); in process_prog()
1023 log_level = 4 | (env.log_fixed ? 8 : 0); in process_prog()
1033 if (env.force_checkpoints) in process_prog()
1035 if (env.force_reg_invariants) in process_prog()
1039 env.progs_processed++; in process_prog()
1046 if (env.verbose) { in process_prog()
1068 if (env.verbose) in process_obj()
1070 env.files_skipped++; in process_obj()
1074 if (env.verbose) in process_obj()
1076 env.files_skipped++; in process_obj()
1080 if (!env.quiet && env.out_fmt == RESFMT_TABLE) in process_obj()
1093 env.files_skipped++; in process_obj()
1098 env.files_processed++; in process_obj()
1187 for (i = 0; i < env.sort_spec.spec_cnt; i++) { in cmp_prog_stats()
1188 cmp = cmp_stat(s1, s2, env.sort_spec.ids[i], in cmp_prog_stats()
1189 env.sort_spec.asc[i], env.sort_spec.abs[i]); in cmp_prog_stats()
1286 for (i = 0; i < env.sort_spec.spec_cnt; i++) { in cmp_join_stats()
1288 env.sort_spec.ids[i], in cmp_join_stats()
1289 env.sort_spec.variants[i], in cmp_join_stats()
1290 env.sort_spec.asc[i], in cmp_join_stats()
1291 env.sort_spec.abs[i]); in cmp_join_stats()
1310 for (i = 0; i < env.output_spec.spec_cnt; i++) { in output_header_underlines()
1311 len = env.output_spec.lens[i]; in output_header_underlines()
1325 for (i = 0; i < env.output_spec.spec_cnt; i++) { in output_headers()
1326 int id = env.output_spec.ids[i]; in output_headers()
1327 int *max_len = &env.output_spec.lens[i]; in output_headers()
1338 if (i == env.output_spec.spec_cnt - 1) in output_headers()
1343 if (i == env.output_spec.spec_cnt - 1) in output_headers()
1387 for (i = 0; i < env.output_spec.spec_cnt; i++) { in output_stats()
1388 int id = env.output_spec.ids[i]; in output_stats()
1389 int *max_len = &env.output_spec.lens[i], len; in output_stats()
1409 if (i == env.output_spec.spec_cnt - 1) in output_stats()
1417 if (i == env.output_spec.spec_cnt - 1) in output_stats()
1426 env.files_processed, env.files_skipped, env.progs_processed, env.progs_skipped); in output_stats()
1590 for (i = 0; i < env.output_spec.spec_cnt; i++) { in output_comp_header_underlines()
1591 int id = env.output_spec.ids[i]; in output_comp_header_underlines()
1595 int len = env.output_spec.lens[3 * i + j]; in output_comp_header_underlines()
1612 for (i = 0; i < env.output_spec.spec_cnt; i++) { in output_comp_headers()
1613 int id = env.output_spec.ids[i]; in output_comp_headers()
1618 int *max_len = &env.output_spec.lens[3 * i + j]; in output_comp_headers()
1619 bool last = (i == env.output_spec.spec_cnt - 1) && (j == max_j - 1); in output_comp_headers()
1658 for (i = 0; i < env.output_spec.spec_cnt; i++) { in output_comp_stats()
1659 int id = env.output_spec.ids[i], len; in output_comp_stats()
1660 int *max_len_base = &env.output_spec.lens[3 * i + 0]; in output_comp_stats()
1661 int *max_len_comp = &env.output_spec.lens[3 * i + 1]; in output_comp_stats()
1662 int *max_len_diff = &env.output_spec.lens[3 * i + 2]; in output_comp_stats()
1736 if (i == env.output_spec.spec_cnt - 1) in output_comp_stats()
1746 if (i == env.output_spec.spec_cnt - 1) in output_comp_stats()
1795 for (i = 0; i < env.deny_filter_cnt; i++) { in should_output_join_stats()
1796 f = &env.deny_filters[i]; in should_output_join_stats()
1804 for (i = 0; i < env.allow_filter_cnt; i++) { in should_output_join_stats()
1805 f = &env.allow_filters[i]; in should_output_join_stats()
1825 if (env.filename_cnt != 2) { in handle_comparison_mode()
1831 err = parse_stats_csv(env.filenames[0], &base_specs, in handle_comparison_mode()
1832 &env.baseline_stats, &env.baseline_stat_cnt); in handle_comparison_mode()
1834 fprintf(stderr, "Failed to parse stats from '%s': %d\n", env.filenames[0], err); in handle_comparison_mode()
1837 err = parse_stats_csv(env.filenames[1], &comp_specs, in handle_comparison_mode()
1838 &env.prog_stats, &env.prog_stat_cnt); in handle_comparison_mode()
1840 fprintf(stderr, "Failed to parse stats from '%s': %d\n", env.filenames[1], err); in handle_comparison_mode()
1850 env.filenames[0], env.filenames[1], in handle_comparison_mode()
1857 env.filenames[0], env.filenames[1], in handle_comparison_mode()
1868 tmp_sort_spec = env.sort_spec; in handle_comparison_mode()
1869 env.sort_spec = join_sort_spec; in handle_comparison_mode()
1870 qsort(env.prog_stats, env.prog_stat_cnt, sizeof(*env.prog_stats), cmp_prog_stats); in handle_comparison_mode()
1871 qsort(env.baseline_stats, env.baseline_stat_cnt, sizeof(*env.baseline_stats), cmp_prog_stats); in handle_comparison_mode()
1872 env.sort_spec = tmp_sort_spec; in handle_comparison_mode()
1880 while (i < env.baseline_stat_cnt || j < env.prog_stat_cnt) { in handle_comparison_mode()
1886 base = i < env.baseline_stat_cnt ? &env.baseline_stats[i] : &fallback_stats; in handle_comparison_mode()
1887 comp = j < env.prog_stat_cnt ? &env.prog_stats[j] : &fallback_stats; in handle_comparison_mode()
1891 i, env.filenames[0]); in handle_comparison_mode()
1896 j, env.filenames[1]); in handle_comparison_mode()
1900 tmp = realloc(env.join_stats, (env.join_stat_cnt + 1) * sizeof(*env.join_stats)); in handle_comparison_mode()
1903 env.join_stats = tmp; in handle_comparison_mode()
1905 join = &env.join_stats[env.join_stat_cnt]; in handle_comparison_mode()
1933 env.join_stat_cnt += 1; in handle_comparison_mode()
1937 qsort(env.join_stats, env.join_stat_cnt, sizeof(*env.join_stats), cmp_join_stats); in handle_comparison_mode()
1944 if (env.out_fmt == RESFMT_TABLE) in handle_comparison_mode()
1947 cur_fmt = env.out_fmt; in handle_comparison_mode()
1954 for (i = 0; i < env.join_stat_cnt; i++) { in handle_comparison_mode()
1955 const struct verif_stats_join *join = &env.join_stats[i]; in handle_comparison_mode()
1960 if (env.top_n && cnt >= env.top_n) in handle_comparison_mode()
2004 for (i = 0; i < env.deny_filter_cnt; i++) { in should_output_stats()
2005 f = &env.deny_filters[i]; in should_output_stats()
2013 for (i = 0; i < env.allow_filter_cnt; i++) { in should_output_stats()
2014 f = &env.allow_filters[i]; in should_output_stats()
2032 if (env.out_fmt == RESFMT_TABLE) { in output_prog_stats()
2035 for (i = 0; i < env.prog_stat_cnt; i++) { in output_prog_stats()
2036 stats = &env.prog_stats[i]; in output_prog_stats()
2045 output_headers(env.out_fmt); in output_prog_stats()
2046 for (i = 0; i < env.prog_stat_cnt; i++) { in output_prog_stats()
2047 stats = &env.prog_stats[i]; in output_prog_stats()
2050 if (env.top_n && cnt >= env.top_n) in output_prog_stats()
2052 output_stats(stats, env.out_fmt, i == last_stat_idx); in output_prog_stats()
2061 if (env.filename_cnt == 0) { in handle_verif_mode()
2067 for (i = 0; i < env.filename_cnt; i++) { in handle_verif_mode()
2068 err = process_obj(env.filenames[i]); in handle_verif_mode()
2070 fprintf(stderr, "Failed to process '%s': %d\n", env.filenames[i], err); in handle_verif_mode()
2075 qsort(env.prog_stats, env.prog_stat_cnt, sizeof(*env.prog_stats), cmp_prog_stats); in handle_verif_mode()
2087 if (env.filename_cnt != 1) { in handle_replay_mode()
2093 err = parse_stats_csv(env.filenames[0], &specs, in handle_replay_mode()
2094 &env.prog_stats, &env.prog_stat_cnt); in handle_replay_mode()
2096 fprintf(stderr, "Failed to parse stats from '%s': %d\n", env.filenames[0], err); in handle_replay_mode()
2100 qsort(env.prog_stats, env.prog_stat_cnt, sizeof(*env.prog_stats), cmp_prog_stats); in handle_replay_mode()
2114 if (env.show_version) { in main()
2119 if (env.verbose && env.quiet) { in main()
2124 if (env.verbose && env.log_level == 0) in main()
2125 env.log_level = 1; in main()
2127 if (env.output_spec.spec_cnt == 0) { in main()
2128 if (env.out_fmt == RESFMT_CSV) in main()
2129 env.output_spec = default_csv_output_spec; in main()
2131 env.output_spec = default_output_spec; in main()
2133 if (env.sort_spec.spec_cnt == 0) in main()
2134 env.sort_spec = default_sort_spec; in main()
2136 if (env.comparison_mode && env.replay_mode) { in main()
2142 if (env.comparison_mode) in main()
2144 else if (env.replay_mode) in main()
2149 free_verif_stats(env.prog_stats, env.prog_stat_cnt); in main()
2150 free_verif_stats(env.baseline_stats, env.baseline_stat_cnt); in main()
2151 free(env.join_stats); in main()
2152 for (i = 0; i < env.filename_cnt; i++) in main()
2153 free(env.filenames[i]); in main()
2154 free(env.filenames); in main()
2155 for (i = 0; i < env.allow_filter_cnt; i++) { in main()
2156 free(env.allow_filters[i].any_glob); in main()
2157 free(env.allow_filters[i].file_glob); in main()
2158 free(env.allow_filters[i].prog_glob); in main()
2160 free(env.allow_filters); in main()
2161 for (i = 0; i < env.deny_filter_cnt; i++) { in main()
2162 free(env.deny_filters[i].any_glob); in main()
2163 free(env.deny_filters[i].file_glob); in main()
2164 free(env.deny_filters[i].prog_glob); in main()
2166 free(env.deny_filters); in main()