Lines Matching refs:stat_config

152 static struct perf_stat_config stat_config = {  variable
351 fprintf(stat_config.output, in read_counter_cpu()
413 if (!stat_config.stop_read_counter) { in read_counters()
428 if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter)) in process_counters()
433 perf_stat_merge_counters(&stat_config, evsel_list); in process_counters()
434 perf_stat_process_percore(&stat_config, evsel_list); in process_counters()
455 update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL); in process_interval()
691 int interval = stat_config.interval; in __run_perf_stat()
692 int times = stat_config.times; in __run_perf_stat()
693 int timeout = stat_config.timeout; in __run_perf_stat()
745 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
802 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
828 if (l > stat_config.unit_width) in __run_perf_stat()
829 stat_config.unit_width = l; in __run_perf_stat()
856 err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list, in __run_perf_stat()
892 wait4(child_pid, &status, 0, &stat_config.ru_data); in __run_perf_stat()
911 if (stat_config.walltime_run_table) in __run_perf_stat()
912 stat_config.walltime_run[run_idx] = t1 - t0; in __run_perf_stat()
914 if (interval && stat_config.summary) { in __run_perf_stat()
915 stat_config.interval = 0; in __run_perf_stat()
916 stat_config.stop_read_counter = true; in __run_perf_stat()
925 update_rusage_stats(&ru_stats, &stat_config.ru_data); in __run_perf_stat()
981 evlist__print_counters(evsel_list, &stat_config, &target, ts, argc, argv); in print_counters()
988 if ((child_pid == -1) || stat_config.interval) in skip_signal()
1029 stat_config.big_num = (set != 0); in perf_stat__set_big_num()
1034 stat_config.no_csv_summary = (set != 0); in perf_stat__set_no_csv_summary()
1049 stat_config.metric_only = !unset; in enable_metric_only()
1084 if (stat_config.cgroup_list) { in parse_stat_cgroups()
1171 OPT_BOOLEAN('i', "no-inherit", &stat_config.no_inherit,
1187 OPT_BOOLEAN(0, "scale", &stat_config.scale,
1191 OPT_INTEGER('r', "repeat", &stat_config.run_count,
1193 OPT_BOOLEAN(0, "table", &stat_config.walltime_run_table,
1195 OPT_BOOLEAN('n', "null", &stat_config.null_run,
1206 OPT_SET_UINT('A', "no-aggr", &stat_config.aggr_mode,
1208 OPT_BOOLEAN(0, "no-merge", &stat_config.no_merge, "Do not merge identical named events"),
1209 OPT_BOOLEAN(0, "hybrid-merge", &stat_config.hybrid_merge,
1211 OPT_STRING('x', "field-separator", &stat_config.csv_sep, "separator",
1213 OPT_BOOLEAN('j', "json-output", &stat_config.json_output,
1217 OPT_STRING(0, "for-each-cgroup", &stat_config.cgroup_list, "name",
1227 OPT_UINTEGER('I', "interval-print", &stat_config.interval,
1230 OPT_INTEGER(0, "interval-count", &stat_config.times,
1232 OPT_BOOLEAN(0, "interval-clear", &stat_config.interval_clear,
1234 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
1236 OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode,
1238 OPT_SET_UINT(0, "per-die", &stat_config.aggr_mode,
1240 OPT_CALLBACK_OPTARG(0, "per-cache", &stat_config.aggr_mode, &stat_config.aggr_level,
1243 OPT_SET_UINT(0, "per-core", &stat_config.aggr_mode,
1245 OPT_SET_UINT(0, "per-thread", &stat_config.aggr_mode,
1247 OPT_SET_UINT(0, "per-node", &stat_config.aggr_mode,
1251 OPT_CALLBACK_NOOPT(0, "metric-only", &stat_config.metric_only, NULL,
1253 OPT_BOOLEAN(0, "metric-no-group", &stat_config.metric_no_group,
1255 OPT_BOOLEAN(0, "metric-no-merge", &stat_config.metric_no_merge,
1257 OPT_BOOLEAN(0, "metric-no-threshold", &stat_config.metric_no_threshold,
1261 OPT_UINTEGER(0, "td-level", &stat_config.topdown_level,
1268 OPT_BOOLEAN_FLAG(0, "all-kernel", &stat_config.all_kernel,
1271 OPT_BOOLEAN_FLAG(0, "all-user", &stat_config.all_user,
1274 OPT_BOOLEAN(0, "percore-show-thread", &stat_config.percore_show_thread,
1278 OPT_BOOLEAN(0, "summary", &stat_config.summary,
1280 OPT_BOOLEAN(0, "no-csv-summary", &stat_config.no_csv_summary,
1293 OPT_CALLBACK(0, "control", &stat_config, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
1298 OPT_CALLBACK_OPTARG(0, "iostat", &evsel_list, &stat_config, "default",
1340 u32 cache_level = stat_config.aggr_level; in cpu__get_cache_details()
1592 aggr_cpu_id_get_t get_id = aggr_mode__get_aggr(stat_config.aggr_mode); in perf_stat_init_aggr_mode()
1595 bool needs_sort = stat_config.aggr_mode != AGGR_NONE; in perf_stat_init_aggr_mode()
1596 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, in perf_stat_init_aggr_mode()
1598 if (!stat_config.aggr_map) { in perf_stat_init_aggr_mode()
1599 pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]); in perf_stat_init_aggr_mode()
1602 stat_config.aggr_get_id = aggr_mode__get_id(stat_config.aggr_mode); in perf_stat_init_aggr_mode()
1605 if (stat_config.aggr_mode == AGGR_THREAD) { in perf_stat_init_aggr_mode()
1607 stat_config.aggr_map = cpu_aggr_map__empty_new(nr); in perf_stat_init_aggr_mode()
1608 if (stat_config.aggr_map == NULL) in perf_stat_init_aggr_mode()
1615 stat_config.aggr_map->map[s] = id; in perf_stat_init_aggr_mode()
1629 stat_config.cpus_aggr_map = cpu_aggr_map__empty_new(nr + 1); in perf_stat_init_aggr_mode()
1630 return stat_config.cpus_aggr_map ? 0 : -ENOMEM; in perf_stat_init_aggr_mode()
1650 cpu_aggr_map__put(stat_config.aggr_map); in perf_stat__exit_aggr_mode()
1651 cpu_aggr_map__put(stat_config.cpus_aggr_map); in perf_stat__exit_aggr_mode()
1652 stat_config.aggr_map = NULL; in perf_stat__exit_aggr_mode()
1653 stat_config.cpus_aggr_map = NULL; in perf_stat__exit_aggr_mode()
1729 u32 cache_level = (perf_stat.aggr_level) ?: stat_config.aggr_level; in perf_env__get_cache_aggr_by_cpu()
1890 aggr_cpu_id_get_t get_id = aggr_mode__get_aggr_file(stat_config.aggr_mode); in perf_stat_init_aggr_mode_file()
1891 bool needs_sort = stat_config.aggr_mode != AGGR_NONE; in perf_stat_init_aggr_mode_file()
1893 if (stat_config.aggr_mode == AGGR_THREAD) { in perf_stat_init_aggr_mode_file()
1896 stat_config.aggr_map = cpu_aggr_map__empty_new(nr); in perf_stat_init_aggr_mode_file()
1897 if (stat_config.aggr_map == NULL) in perf_stat_init_aggr_mode_file()
1904 stat_config.aggr_map->map[s] = id; in perf_stat_init_aggr_mode_file()
1912 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, in perf_stat_init_aggr_mode_file()
1914 if (!stat_config.aggr_map) { in perf_stat_init_aggr_mode_file()
1915 pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]); in perf_stat_init_aggr_mode_file()
1918 stat_config.aggr_get_id = aggr_mode__get_id_file(stat_config.aggr_mode); in perf_stat_init_aggr_mode_file()
2045 if (stat_config.null_run) in add_default_attributes()
2059 stat_config.metric_no_group, in add_default_attributes()
2060 stat_config.metric_no_merge, in add_default_attributes()
2061 stat_config.metric_no_threshold, in add_default_attributes()
2062 stat_config.user_requested_cpu_list, in add_default_attributes()
2063 stat_config.system_wide, in add_default_attributes()
2064 &stat_config.metric_events); in add_default_attributes()
2089 stat_config.metric_only = true; in add_default_attributes()
2092 stat_config.metric_no_group, in add_default_attributes()
2093 stat_config.metric_no_merge, in add_default_attributes()
2094 stat_config.metric_no_threshold, in add_default_attributes()
2095 stat_config.user_requested_cpu_list, in add_default_attributes()
2096 stat_config.system_wide, in add_default_attributes()
2097 &stat_config.metric_events); in add_default_attributes()
2105 stat_config.metric_only = true; in add_default_attributes()
2112 if (stat_config.topdown_level > max_level) { in add_default_attributes()
2115 } else if (!stat_config.topdown_level) in add_default_attributes()
2116 stat_config.topdown_level = 1; in add_default_attributes()
2118 if (!stat_config.interval && !stat_config.metric_only) { in add_default_attributes()
2119 fprintf(stat_config.output, in add_default_attributes()
2123 str[8] = stat_config.topdown_level + '0'; in add_default_attributes()
2129 stat_config.user_requested_cpu_list, in add_default_attributes()
2130 stat_config.system_wide, in add_default_attributes()
2131 &stat_config.metric_events) < 0) in add_default_attributes()
2135 if (!stat_config.topdown_level) in add_default_attributes()
2136 stat_config.topdown_level = 1; in add_default_attributes()
2170 stat_config.user_requested_cpu_list, in add_default_attributes()
2171 stat_config.system_wide, in add_default_attributes()
2172 &stat_config.metric_events) < 0) in add_default_attributes()
2241 if (stat_config.run_count != 1 || forever) { in __cmd_record()
2273 if (stat_config.interval && stat_round->time) { in process_stat_round_event()
2290 perf_event__read_stat_config(&stat_config, &event->stat_config); in process_stat_config_event()
2296 stat_config.aggr_mode = st->aggr_mode; in process_stat_config_event()
2304 if (stat_config.aggr_map) { in process_stat_config_event()
2305 int nr_aggr = stat_config.aggr_map->nr; in process_stat_config_event()
2325 if (evlist__alloc_stats(&stat_config, evsel_list, /*alloc_raw=*/true)) in set_maps()
2383 .stat_config = process_stat_config_event,
2432 stat_config.output = stderr; in __cmd_report()
2505 if (stat_config.csv_sep) { in cmd_stat()
2506 stat_config.csv_output = true; in cmd_stat()
2507 if (!strcmp(stat_config.csv_sep, "\\t")) in cmd_stat()
2508 stat_config.csv_sep = "\t"; in cmd_stat()
2510 stat_config.csv_sep = DEFAULT_SEPARATOR; in cmd_stat()
2519 interval = stat_config.interval; in cmd_stat()
2520 timeout = stat_config.timeout; in cmd_stat()
2535 if (stat_config.metric_only && stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2540 if (stat_config.metric_only && stat_config.run_count > 1) { in cmd_stat()
2545 if (stat_config.walltime_run_table && stat_config.run_count <= 1) { in cmd_stat()
2567 if (!stat_config.json_output) { in cmd_stat()
2580 if (stat_config.interval_clear && !isatty(fileno(output))) { in cmd_stat()
2588 stat_config.output = output; in cmd_stat()
2593 if (stat_config.csv_output) { in cmd_stat()
2601 stat_config.big_num = false; in cmd_stat()
2603 stat_config.big_num = false; in cmd_stat()
2617 if ((stat_config.run_count == 1) && target__none(&target)) in cmd_stat()
2618 stat_config.ru_display = true; in cmd_stat()
2620 if (stat_config.run_count < 0) { in cmd_stat()
2624 } else if (stat_config.run_count == 0) { in cmd_stat()
2626 stat_config.run_count = 1; in cmd_stat()
2629 if (stat_config.walltime_run_table) { in cmd_stat()
2630 stat_config.walltime_run = zalloc(stat_config.run_count * sizeof(stat_config.walltime_run[0])); in cmd_stat()
2631 if (!stat_config.walltime_run) { in cmd_stat()
2637 if ((stat_config.aggr_mode == AGGR_THREAD) && in cmd_stat()
2653 if (((stat_config.aggr_mode != AGGR_GLOBAL && in cmd_stat()
2654 stat_config.aggr_mode != AGGR_THREAD) || in cmd_stat()
2655 (nr_cgroups || stat_config.cgroup_list)) && in cmd_stat()
2667 if (stat_config.iostat_run) { in cmd_stat()
2668 status = iostat_prepare(evsel_list, &stat_config); in cmd_stat()
2672 iostat_list(evsel_list, &stat_config); in cmd_stat()
2675 iostat_list(evsel_list, &stat_config); in cmd_stat()
2680 if ((stat_config.aggr_mode == AGGR_THREAD) && (target.system_wide)) in cmd_stat()
2683 stat_config.system_wide = target.system_wide; in cmd_stat()
2685 stat_config.user_requested_cpu_list = strdup(target.cpu_list); in cmd_stat()
2686 if (!stat_config.user_requested_cpu_list) { in cmd_stat()
2699 stat_config.metric_no_group, in cmd_stat()
2700 stat_config.metric_no_merge, in cmd_stat()
2701 stat_config.metric_no_threshold, in cmd_stat()
2702 stat_config.user_requested_cpu_list, in cmd_stat()
2703 stat_config.system_wide, in cmd_stat()
2704 &stat_config.metric_events); in cmd_stat()
2716 if (stat_config.cgroup_list) { in cmd_stat()
2724 if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list, in cmd_stat()
2725 &stat_config.metric_events, true) < 0) { in cmd_stat()
2753 if (stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2757 if (stat_config.aggr_mode == AGGR_NODE) in cmd_stat()
2760 if (stat_config.times && interval) in cmd_stat()
2762 else if (stat_config.times && !interval) { in cmd_stat()
2790 if (evlist__alloc_stats(&stat_config, evsel_list, interval)) in cmd_stat()
2802 stat_config.identifier = !(STAT_RECORD && perf_stat.data.is_pipe); in cmd_stat()
2817 if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack)) in cmd_stat()
2823 for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) { in cmd_stat()
2824 if (stat_config.run_count != 1 && verbose > 0) in cmd_stat()
2838 if (!forever && status != -1 && (!interval || stat_config.summary)) { in cmd_stat()
2839 if (stat_config.run_count > 1) in cmd_stat()
2840 evlist__copy_res_stats(&stat_config, evsel_list); in cmd_stat()
2886 if (stat_config.iostat_run) in cmd_stat()
2889 zfree(&stat_config.walltime_run); in cmd_stat()
2890 zfree(&stat_config.user_requested_cpu_list); in cmd_stat()
2897 metricgroup__rblist_exit(&stat_config.metric_events); in cmd_stat()
2898 evlist__close_control(stat_config.ctl_fd, stat_config.ctl_fd_ack, &stat_config.ctl_fd_close); in cmd_stat()