Lines Matching refs:stat_config

153 static struct perf_stat_config stat_config = {  variable
354 fprintf(stat_config.output, in read_counter_cpu()
414 if (!stat_config.stop_read_counter) { in read_counters()
429 if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter)) in process_counters()
434 perf_stat_merge_counters(&stat_config, evsel_list); in process_counters()
435 perf_stat_process_percore(&stat_config, evsel_list); in process_counters()
456 update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL); in process_interval()
695 int interval = stat_config.interval; in __run_perf_stat()
696 int times = stat_config.times; in __run_perf_stat()
697 int timeout = stat_config.timeout; in __run_perf_stat()
749 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
806 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
832 if (l > stat_config.unit_width) in __run_perf_stat()
833 stat_config.unit_width = l; in __run_perf_stat()
860 err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list, in __run_perf_stat()
896 wait4(child_pid, &status, 0, &stat_config.ru_data); in __run_perf_stat()
915 if (stat_config.walltime_run_table) in __run_perf_stat()
916 stat_config.walltime_run[run_idx] = t1 - t0; in __run_perf_stat()
918 if (interval && stat_config.summary) { in __run_perf_stat()
919 stat_config.interval = 0; in __run_perf_stat()
920 stat_config.stop_read_counter = true; in __run_perf_stat()
929 update_rusage_stats(&ru_stats, &stat_config.ru_data); in __run_perf_stat()
985 evlist__print_counters(evsel_list, &stat_config, &target, ts, argc, argv); in print_counters()
992 if ((child_pid == -1) || stat_config.interval) in skip_signal()
1033 stat_config.big_num = (set != 0); in perf_stat__set_big_num()
1038 stat_config.no_csv_summary = (set != 0); in perf_stat__set_no_csv_summary()
1053 stat_config.metric_only = !unset; in enable_metric_only()
1088 if (stat_config.cgroup_list) { in parse_stat_cgroups()
1202 u32 cache_level = stat_config.aggr_level; in cpu__get_cache_details()
1471 aggr_cpu_id_get_t get_id = aggr_mode__get_aggr(stat_config.aggr_mode); in perf_stat_init_aggr_mode()
1474 bool needs_sort = stat_config.aggr_mode != AGGR_NONE; in perf_stat_init_aggr_mode()
1475 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, in perf_stat_init_aggr_mode()
1477 if (!stat_config.aggr_map) { in perf_stat_init_aggr_mode()
1478 pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]); in perf_stat_init_aggr_mode()
1481 stat_config.aggr_get_id = aggr_mode__get_id(stat_config.aggr_mode); in perf_stat_init_aggr_mode()
1484 if (stat_config.aggr_mode == AGGR_THREAD) { in perf_stat_init_aggr_mode()
1486 stat_config.aggr_map = cpu_aggr_map__empty_new(nr); in perf_stat_init_aggr_mode()
1487 if (stat_config.aggr_map == NULL) in perf_stat_init_aggr_mode()
1494 stat_config.aggr_map->map[s] = id; in perf_stat_init_aggr_mode()
1508 stat_config.cpus_aggr_map = cpu_aggr_map__empty_new(nr + 1); in perf_stat_init_aggr_mode()
1509 return stat_config.cpus_aggr_map ? 0 : -ENOMEM; in perf_stat_init_aggr_mode()
1519 cpu_aggr_map__delete(stat_config.aggr_map); in perf_stat__exit_aggr_mode()
1520 cpu_aggr_map__delete(stat_config.cpus_aggr_map); in perf_stat__exit_aggr_mode()
1521 stat_config.aggr_map = NULL; in perf_stat__exit_aggr_mode()
1522 stat_config.cpus_aggr_map = NULL; in perf_stat__exit_aggr_mode()
1598 u32 cache_level = (perf_stat.aggr_level) ?: stat_config.aggr_level; in perf_env__get_cache_aggr_by_cpu()
1784 aggr_cpu_id_get_t get_id = aggr_mode__get_aggr_file(stat_config.aggr_mode); in perf_stat_init_aggr_mode_file()
1785 bool needs_sort = stat_config.aggr_mode != AGGR_NONE; in perf_stat_init_aggr_mode_file()
1787 if (stat_config.aggr_mode == AGGR_THREAD) { in perf_stat_init_aggr_mode_file()
1790 stat_config.aggr_map = cpu_aggr_map__empty_new(nr); in perf_stat_init_aggr_mode_file()
1791 if (stat_config.aggr_map == NULL) in perf_stat_init_aggr_mode_file()
1798 stat_config.aggr_map->map[s] = id; in perf_stat_init_aggr_mode_file()
1806 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, in perf_stat_init_aggr_mode_file()
1808 if (!stat_config.aggr_map) { in perf_stat_init_aggr_mode_file()
1809 pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]); in perf_stat_init_aggr_mode_file()
1812 stat_config.aggr_get_id = aggr_mode__get_id_file(stat_config.aggr_mode); in perf_stat_init_aggr_mode_file()
1939 if (stat_config.null_run) in add_default_attributes()
1953 stat_config.metric_no_group, in add_default_attributes()
1954 stat_config.metric_no_merge, in add_default_attributes()
1955 stat_config.metric_no_threshold, in add_default_attributes()
1956 stat_config.user_requested_cpu_list, in add_default_attributes()
1957 stat_config.system_wide, in add_default_attributes()
1958 stat_config.hardware_aware_grouping, in add_default_attributes()
1959 &stat_config.metric_events); in add_default_attributes()
1984 stat_config.metric_only = true; in add_default_attributes()
1987 stat_config.metric_no_group, in add_default_attributes()
1988 stat_config.metric_no_merge, in add_default_attributes()
1989 stat_config.metric_no_threshold, in add_default_attributes()
1990 stat_config.user_requested_cpu_list, in add_default_attributes()
1991 stat_config.system_wide, in add_default_attributes()
1992 stat_config.hardware_aware_grouping, in add_default_attributes()
1993 &stat_config.metric_events); in add_default_attributes()
2001 stat_config.metric_only = true; in add_default_attributes()
2008 if (stat_config.topdown_level > max_level) { in add_default_attributes()
2011 } else if (!stat_config.topdown_level) in add_default_attributes()
2012 stat_config.topdown_level = 1; in add_default_attributes()
2014 if (!stat_config.interval && !stat_config.metric_only) { in add_default_attributes()
2015 fprintf(stat_config.output, in add_default_attributes()
2019 str[8] = stat_config.topdown_level + '0'; in add_default_attributes()
2025 stat_config.user_requested_cpu_list, in add_default_attributes()
2026 stat_config.system_wide, in add_default_attributes()
2027 stat_config.hardware_aware_grouping, in add_default_attributes()
2028 &stat_config.metric_events) < 0) in add_default_attributes()
2032 if (!stat_config.topdown_level) in add_default_attributes()
2033 stat_config.topdown_level = 1; in add_default_attributes()
2067 stat_config.user_requested_cpu_list, in add_default_attributes()
2068 stat_config.system_wide, in add_default_attributes()
2069 stat_config.hardware_aware_grouping, in add_default_attributes()
2070 &stat_config.metric_events) < 0) in add_default_attributes()
2136 stat_config.aggr_mode = opt_aggr_mode_to_aggr_mode(opt_mode); in __cmd_record()
2141 if (stat_config.run_count != 1 || forever) { in __cmd_record()
2173 if (stat_config.interval && stat_round->time) { in process_stat_round_event()
2190 perf_event__read_stat_config(&stat_config, &event->stat_config); in process_stat_config_event()
2196 stat_config.aggr_mode = st->aggr_mode; in process_stat_config_event()
2204 if (stat_config.aggr_map) { in process_stat_config_event()
2205 int nr_aggr = stat_config.aggr_map->nr; in process_stat_config_event()
2225 if (evlist__alloc_stats(&stat_config, evsel_list, /*alloc_raw=*/true)) in set_maps()
2325 perf_stat.tool.stat_config = process_stat_config_event; in __cmd_report()
2334 stat_config.output = stderr; in __cmd_report()
2388 OPT_BOOLEAN('i', "no-inherit", &stat_config.no_inherit, in cmd_stat()
2404 OPT_BOOLEAN(0, "scale", &stat_config.scale, in cmd_stat()
2408 OPT_INTEGER('r', "repeat", &stat_config.run_count, in cmd_stat()
2410 OPT_BOOLEAN(0, "table", &stat_config.walltime_run_table, in cmd_stat()
2412 OPT_BOOLEAN('n', "null", &stat_config.null_run, in cmd_stat()
2427 OPT_BOOLEAN(0, "hybrid-merge", &stat_config.hybrid_merge, in cmd_stat()
2429 OPT_STRING('x', "field-separator", &stat_config.csv_sep, "separator", in cmd_stat()
2431 OPT_BOOLEAN('j', "json-output", &stat_config.json_output, in cmd_stat()
2435 OPT_STRING(0, "for-each-cgroup", &stat_config.cgroup_list, "name", in cmd_stat()
2445 OPT_UINTEGER('I', "interval-print", &stat_config.interval, in cmd_stat()
2448 OPT_INTEGER(0, "interval-count", &stat_config.times, in cmd_stat()
2450 OPT_BOOLEAN(0, "interval-clear", &stat_config.interval_clear, in cmd_stat()
2452 OPT_UINTEGER(0, "timeout", &stat_config.timeout, in cmd_stat()
2459 OPT_CALLBACK_OPTARG(0, "per-cache", &opt_mode, &stat_config.aggr_level, in cmd_stat()
2468 OPT_CALLBACK_NOOPT(0, "metric-only", &stat_config.metric_only, NULL, in cmd_stat()
2470 OPT_BOOLEAN(0, "metric-no-group", &stat_config.metric_no_group, in cmd_stat()
2472 OPT_BOOLEAN(0, "metric-no-merge", &stat_config.metric_no_merge, in cmd_stat()
2474 OPT_BOOLEAN(0, "metric-no-threshold", &stat_config.metric_no_threshold, in cmd_stat()
2482 OPT_UINTEGER(0, "td-level", &stat_config.topdown_level, in cmd_stat()
2489 OPT_BOOLEAN_FLAG(0, "all-kernel", &stat_config.all_kernel, in cmd_stat()
2492 OPT_BOOLEAN_FLAG(0, "all-user", &stat_config.all_user, in cmd_stat()
2495 OPT_BOOLEAN(0, "percore-show-thread", &stat_config.percore_show_thread, in cmd_stat()
2499 OPT_BOOLEAN(0, "summary", &stat_config.summary, in cmd_stat()
2501 OPT_BOOLEAN(0, "no-csv-summary", &stat_config.no_csv_summary, in cmd_stat()
2514 OPT_CALLBACK(0, "control", &stat_config, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]", in cmd_stat()
2519 OPT_CALLBACK_OPTARG(0, "iostat", &evsel_list, &stat_config, "default", in cmd_stat()
2552 stat_config.aggr_mode = opt_aggr_mode_to_aggr_mode(&opt_mode); in cmd_stat()
2554 if (stat_config.csv_sep) { in cmd_stat()
2555 stat_config.csv_output = true; in cmd_stat()
2556 if (!strcmp(stat_config.csv_sep, "\\t")) in cmd_stat()
2557 stat_config.csv_sep = "\t"; in cmd_stat()
2559 stat_config.csv_sep = DEFAULT_SEPARATOR; in cmd_stat()
2568 interval = stat_config.interval; in cmd_stat()
2569 timeout = stat_config.timeout; in cmd_stat()
2584 if (stat_config.metric_only && stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2589 if (stat_config.metric_only && stat_config.run_count > 1) { in cmd_stat()
2594 if (stat_config.walltime_run_table && stat_config.run_count <= 1) { in cmd_stat()
2616 if (!stat_config.json_output) { in cmd_stat()
2629 if (stat_config.interval_clear && !isatty(fileno(output))) { in cmd_stat()
2637 stat_config.output = output; in cmd_stat()
2642 if (stat_config.csv_output) { in cmd_stat()
2650 stat_config.big_num = false; in cmd_stat()
2652 stat_config.big_num = false; in cmd_stat()
2666 if ((stat_config.run_count == 1) && target__none(&target)) in cmd_stat()
2667 stat_config.ru_display = true; in cmd_stat()
2669 if (stat_config.run_count < 0) { in cmd_stat()
2673 } else if (stat_config.run_count == 0) { in cmd_stat()
2675 stat_config.run_count = 1; in cmd_stat()
2678 if (stat_config.walltime_run_table) { in cmd_stat()
2679 stat_config.walltime_run = zalloc(stat_config.run_count * sizeof(stat_config.walltime_run[0])); in cmd_stat()
2680 if (!stat_config.walltime_run) { in cmd_stat()
2686 if ((stat_config.aggr_mode == AGGR_THREAD) && in cmd_stat()
2702 if (((stat_config.aggr_mode != AGGR_GLOBAL && in cmd_stat()
2703 stat_config.aggr_mode != AGGR_THREAD) || in cmd_stat()
2704 (nr_cgroups || stat_config.cgroup_list)) && in cmd_stat()
2716 if (stat_config.iostat_run) { in cmd_stat()
2717 status = iostat_prepare(evsel_list, &stat_config); in cmd_stat()
2721 iostat_list(evsel_list, &stat_config); in cmd_stat()
2724 iostat_list(evsel_list, &stat_config); in cmd_stat()
2729 if ((stat_config.aggr_mode == AGGR_THREAD) && (target.system_wide)) in cmd_stat()
2732 stat_config.system_wide = target.system_wide; in cmd_stat()
2734 stat_config.user_requested_cpu_list = strdup(target.cpu_list); in cmd_stat()
2735 if (!stat_config.user_requested_cpu_list) { in cmd_stat()
2748 stat_config.metric_no_group, in cmd_stat()
2749 stat_config.metric_no_merge, in cmd_stat()
2750 stat_config.metric_no_threshold, in cmd_stat()
2751 stat_config.user_requested_cpu_list, in cmd_stat()
2752 stat_config.system_wide, in cmd_stat()
2753 stat_config.hardware_aware_grouping, in cmd_stat()
2754 &stat_config.metric_events); in cmd_stat()
2766 if (stat_config.cgroup_list) { in cmd_stat()
2774 if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list, in cmd_stat()
2775 &stat_config.metric_events, true) < 0) { in cmd_stat()
2803 if (stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2807 if (stat_config.aggr_mode == AGGR_NODE) in cmd_stat()
2810 if (stat_config.times && interval) in cmd_stat()
2812 else if (stat_config.times && !interval) { in cmd_stat()
2840 if (evlist__alloc_stats(&stat_config, evsel_list, interval)) in cmd_stat()
2852 stat_config.identifier = !(STAT_RECORD && perf_stat.data.is_pipe); in cmd_stat()
2867 if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack)) in cmd_stat()
2873 for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) { in cmd_stat()
2874 if (stat_config.run_count != 1 && verbose > 0) in cmd_stat()
2888 if (!forever && status != -1 && (!interval || stat_config.summary)) { in cmd_stat()
2889 if (stat_config.run_count > 1) in cmd_stat()
2890 evlist__copy_res_stats(&stat_config, evsel_list); in cmd_stat()
2936 if (stat_config.iostat_run) in cmd_stat()
2939 zfree(&stat_config.walltime_run); in cmd_stat()
2940 zfree(&stat_config.user_requested_cpu_list); in cmd_stat()
2947 metricgroup__rblist_exit(&stat_config.metric_events); in cmd_stat()
2948 evlist__close_control(stat_config.ctl_fd, stat_config.ctl_fd_ack, &stat_config.ctl_fd_close); in cmd_stat()