Lines Matching refs:stat_config
152 static struct perf_stat_config stat_config = {
351 fprintf(stat_config.output,
413 if (!stat_config.stop_read_counter) {
428 if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter))
433 perf_stat_merge_counters(&stat_config, evsel_list);
434 perf_stat_process_percore(&stat_config, evsel_list);
455 update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL);
691 int interval = stat_config.interval;
692 int times = stat_config.times;
693 int timeout = stat_config.timeout;
745 if (create_perf_stat_counter(counter, &stat_config, &target,
802 if (create_perf_stat_counter(counter, &stat_config, &target,
828 if (l > stat_config.unit_width)
829 stat_config.unit_width = l;
856 err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list,
892 wait4(child_pid, &status, 0, &stat_config.ru_data);
911 if (stat_config.walltime_run_table)
912 stat_config.walltime_run[run_idx] = t1 - t0;
914 if (interval && stat_config.summary) {
915 stat_config.interval = 0;
916 stat_config.stop_read_counter = true;
925 update_rusage_stats(&ru_stats, &stat_config.ru_data);
981 evlist__print_counters(evsel_list, &stat_config, &target, ts, argc, argv);
988 if ((child_pid == -1) || stat_config.interval)
1029 stat_config.big_num = (set != 0);
1034 stat_config.no_csv_summary = (set != 0);
1049 stat_config.metric_only = !unset;
1084 if (stat_config.cgroup_list) {
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;
1592 aggr_cpu_id_get_t get_id = aggr_mode__get_aggr(stat_config.aggr_mode);
1595 bool needs_sort = stat_config.aggr_mode != AGGR_NONE;
1596 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus,
1598 if (!stat_config.aggr_map) {
1599 pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]);
1602 stat_config.aggr_get_id = aggr_mode__get_id(stat_config.aggr_mode);
1605 if (stat_config.aggr_mode == AGGR_THREAD) {
1607 stat_config.aggr_map = cpu_aggr_map__empty_new(nr);
1608 if (stat_config.aggr_map == NULL)
1615 stat_config.aggr_map->map[s] = id;
1629 stat_config.cpus_aggr_map = cpu_aggr_map__empty_new(nr + 1);
1630 return stat_config.cpus_aggr_map ? 0 : -ENOMEM;
1650 cpu_aggr_map__put(stat_config.aggr_map);
1651 cpu_aggr_map__put(stat_config.cpus_aggr_map);
1652 stat_config.aggr_map = NULL;
1653 stat_config.cpus_aggr_map = NULL;
1729 u32 cache_level = (perf_stat.aggr_level) ?: stat_config.aggr_level;
1890 aggr_cpu_id_get_t get_id = aggr_mode__get_aggr_file(stat_config.aggr_mode);
1891 bool needs_sort = stat_config.aggr_mode != AGGR_NONE;
1893 if (stat_config.aggr_mode == AGGR_THREAD) {
1896 stat_config.aggr_map = cpu_aggr_map__empty_new(nr);
1897 if (stat_config.aggr_map == NULL)
1904 stat_config.aggr_map->map[s] = id;
1912 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus,
1914 if (!stat_config.aggr_map) {
1915 pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]);
1918 stat_config.aggr_get_id = aggr_mode__get_id_file(stat_config.aggr_mode);
2045 if (stat_config.null_run)
2059 stat_config.metric_no_group,
2060 stat_config.metric_no_merge,
2061 stat_config.metric_no_threshold,
2062 stat_config.user_requested_cpu_list,
2063 stat_config.system_wide,
2064 &stat_config.metric_events);
2089 stat_config.metric_only = true;
2092 stat_config.metric_no_group,
2093 stat_config.metric_no_merge,
2094 stat_config.metric_no_threshold,
2095 stat_config.user_requested_cpu_list,
2096 stat_config.system_wide,
2097 &stat_config.metric_events);
2105 stat_config.metric_only = true;
2112 if (stat_config.topdown_level > max_level) {
2115 } else if (!stat_config.topdown_level)
2116 stat_config.topdown_level = 1;
2118 if (!stat_config.interval && !stat_config.metric_only) {
2119 fprintf(stat_config.output,
2123 str[8] = stat_config.topdown_level + '0';
2129 stat_config.user_requested_cpu_list,
2130 stat_config.system_wide,
2131 &stat_config.metric_events) < 0)
2135 if (!stat_config.topdown_level)
2136 stat_config.topdown_level = 1;
2170 stat_config.user_requested_cpu_list,
2171 stat_config.system_wide,
2172 &stat_config.metric_events) < 0)
2241 if (stat_config.run_count != 1 || forever) {
2273 if (stat_config.interval && stat_round->time) {
2290 perf_event__read_stat_config(&stat_config, &event->stat_config);
2296 stat_config.aggr_mode = st->aggr_mode;
2304 if (stat_config.aggr_map) {
2305 int nr_aggr = stat_config.aggr_map->nr;
2325 if (evlist__alloc_stats(&stat_config, evsel_list, /*alloc_raw=*/true))
2383 .stat_config = process_stat_config_event,
2432 stat_config.output = stderr;
2505 if (stat_config.csv_sep) {
2506 stat_config.csv_output = true;
2507 if (!strcmp(stat_config.csv_sep, "\\t"))
2508 stat_config.csv_sep = "\t";
2510 stat_config.csv_sep = DEFAULT_SEPARATOR;
2519 interval = stat_config.interval;
2520 timeout = stat_config.timeout;
2535 if (stat_config.metric_only && stat_config.aggr_mode == AGGR_THREAD) {
2540 if (stat_config.metric_only && stat_config.run_count > 1) {
2545 if (stat_config.walltime_run_table && stat_config.run_count <= 1) {
2567 if (!stat_config.json_output) {
2580 if (stat_config.interval_clear && !isatty(fileno(output))) {
2588 stat_config.output = output;
2593 if (stat_config.csv_output) {
2601 stat_config.big_num = false;
2603 stat_config.big_num = false;
2617 if ((stat_config.run_count == 1) && target__none(&target))
2618 stat_config.ru_display = true;
2620 if (stat_config.run_count < 0) {
2624 } else if (stat_config.run_count == 0) {
2626 stat_config.run_count = 1;
2629 if (stat_config.walltime_run_table) {
2630 stat_config.walltime_run = zalloc(stat_config.run_count * sizeof(stat_config.walltime_run[0]));
2631 if (!stat_config.walltime_run) {
2637 if ((stat_config.aggr_mode == AGGR_THREAD) &&
2653 if (((stat_config.aggr_mode != AGGR_GLOBAL &&
2654 stat_config.aggr_mode != AGGR_THREAD) ||
2655 (nr_cgroups || stat_config.cgroup_list)) &&
2667 if (stat_config.iostat_run) {
2668 status = iostat_prepare(evsel_list, &stat_config);
2672 iostat_list(evsel_list, &stat_config);
2675 iostat_list(evsel_list, &stat_config);
2680 if ((stat_config.aggr_mode == AGGR_THREAD) && (target.system_wide))
2683 stat_config.system_wide = target.system_wide;
2685 stat_config.user_requested_cpu_list = strdup(target.cpu_list);
2686 if (!stat_config.user_requested_cpu_list) {
2699 stat_config.metric_no_group,
2700 stat_config.metric_no_merge,
2701 stat_config.metric_no_threshold,
2702 stat_config.user_requested_cpu_list,
2703 stat_config.system_wide,
2704 &stat_config.metric_events);
2716 if (stat_config.cgroup_list) {
2724 if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list,
2725 &stat_config.metric_events, true) < 0) {
2753 if (stat_config.aggr_mode == AGGR_THREAD) {
2757 if (stat_config.aggr_mode == AGGR_NODE)
2760 if (stat_config.times && interval)
2762 else if (stat_config.times && !interval) {
2790 if (evlist__alloc_stats(&stat_config, evsel_list, interval))
2802 stat_config.identifier = !(STAT_RECORD && perf_stat.data.is_pipe);
2817 if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack))
2823 for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) {
2824 if (stat_config.run_count != 1 && verbose > 0)
2838 if (!forever && status != -1 && (!interval || stat_config.summary)) {
2839 if (stat_config.run_count > 1)
2840 evlist__copy_res_stats(&stat_config, evsel_list);
2886 if (stat_config.iostat_run)
2889 zfree(&stat_config.walltime_run);
2890 zfree(&stat_config.user_requested_cpu_list);
2897 metricgroup__rblist_exit(&stat_config.metric_events);
2898 evlist__close_control(stat_config.ctl_fd, stat_config.ctl_fd_ack, &stat_config.ctl_fd_close);