Lines Matching refs:stat_config
192 static struct perf_stat_config stat_config = { variable
276 for (i = 0; i < stat_config.stats_num; i++) in perf_stat__reset_stats()
277 perf_stat__reset_shadow_per_stat(&stat_config.stats[i]); in perf_stat__reset_stats()
371 fprintf(stat_config.output, in read_counter_cpu()
416 if (!stat_config.stop_read_counter && (read_affinity_counters(rs) < 0)) in read_counters()
422 if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter)) in read_counters()
476 runtime_stat_reset(&stat_config); in process_interval()
485 update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL); in process_interval()
501 if (stat_config.initial_delay < 0) { in enable_counters()
506 if (stat_config.initial_delay > 0) { in enable_counters()
508 usleep(stat_config.initial_delay * USEC_PER_MSEC); in enable_counters()
516 if (!target__none(&target) || stat_config.initial_delay) { in enable_counters()
518 if (stat_config.initial_delay > 0) in enable_counters()
712 int interval = stat_config.interval; in __run_perf_stat()
713 int times = stat_config.times; in __run_perf_stat()
714 int timeout = stat_config.timeout; in __run_perf_stat()
750 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
811 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
838 if (l > stat_config.unit_width) in __run_perf_stat()
839 stat_config.unit_width = l; in __run_perf_stat()
866 err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list, in __run_perf_stat()
887 wait4(child_pid, &status, 0, &stat_config.ru_data); in __run_perf_stat()
907 if (stat_config.walltime_run_table) in __run_perf_stat()
908 stat_config.walltime_run[run_idx] = t1 - t0; in __run_perf_stat()
910 if (interval && stat_config.summary) { in __run_perf_stat()
911 stat_config.interval = 0; in __run_perf_stat()
912 stat_config.stop_read_counter = true; in __run_perf_stat()
916 if (stat_config.aggr_mode == AGGR_GLOBAL) in __run_perf_stat()
921 runtime_stat_reset(&stat_config); in __run_perf_stat()
976 perf_evlist__print_counters(evsel_list, &stat_config, &target, in print_counters()
984 if ((child_pid == -1) || stat_config.interval) in skip_signal()
1025 stat_config.big_num = (set != 0); in perf_stat__set_big_num()
1040 stat_config.metric_only = !unset; in enable_metric_only()
1049 stat_config.metric_no_group, in parse_metric_groups()
1050 stat_config.metric_no_merge, in parse_metric_groups()
1051 &stat_config.metric_events); in parse_metric_groups()
1066 if (stat_config.cgroup_list) { in parse_stat_cgroups()
1082 OPT_BOOLEAN('i', "no-inherit", &stat_config.no_inherit,
1092 OPT_BOOLEAN(0, "scale", &stat_config.scale,
1096 OPT_INTEGER('r', "repeat", &stat_config.run_count,
1098 OPT_BOOLEAN(0, "table", &stat_config.walltime_run_table,
1100 OPT_BOOLEAN('n', "null", &stat_config.null_run,
1111 OPT_SET_UINT('A', "no-aggr", &stat_config.aggr_mode,
1113 OPT_BOOLEAN(0, "no-merge", &stat_config.no_merge, "Do not merge identical named events"),
1114 OPT_STRING('x', "field-separator", &stat_config.csv_sep, "separator",
1118 OPT_STRING(0, "for-each-cgroup", &stat_config.cgroup_list, "name",
1128 OPT_UINTEGER('I', "interval-print", &stat_config.interval,
1131 OPT_INTEGER(0, "interval-count", &stat_config.times,
1133 OPT_BOOLEAN(0, "interval-clear", &stat_config.interval_clear,
1135 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
1137 OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode,
1139 OPT_SET_UINT(0, "per-die", &stat_config.aggr_mode,
1141 OPT_SET_UINT(0, "per-core", &stat_config.aggr_mode,
1143 OPT_SET_UINT(0, "per-thread", &stat_config.aggr_mode,
1145 OPT_SET_UINT(0, "per-node", &stat_config.aggr_mode,
1147 OPT_INTEGER('D', "delay", &stat_config.initial_delay,
1149 OPT_CALLBACK_NOOPT(0, "metric-only", &stat_config.metric_only, NULL,
1151 OPT_BOOLEAN(0, "metric-no-group", &stat_config.metric_no_group,
1153 OPT_BOOLEAN(0, "metric-no-merge", &stat_config.metric_no_merge,
1162 OPT_BOOLEAN_FLAG(0, "all-kernel", &stat_config.all_kernel,
1165 OPT_BOOLEAN_FLAG(0, "all-user", &stat_config.all_user,
1168 OPT_BOOLEAN(0, "percore-show-thread", &stat_config.percore_show_thread,
1172 OPT_BOOLEAN(0, "summary", &stat_config.summary,
1179 OPT_CALLBACK(0, "control", &stat_config, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
1267 switch (stat_config.aggr_mode) { in perf_stat_init_aggr_mode()
1269 if (cpu_map__build_socket_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1273 stat_config.aggr_get_id = perf_stat__get_socket_cached; in perf_stat_init_aggr_mode()
1276 if (cpu_map__build_die_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1280 stat_config.aggr_get_id = perf_stat__get_die_cached; in perf_stat_init_aggr_mode()
1283 if (cpu_map__build_core_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1287 stat_config.aggr_get_id = perf_stat__get_core_cached; in perf_stat_init_aggr_mode()
1290 if (cpu_map__build_node_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1294 stat_config.aggr_get_id = perf_stat__get_node_cached; in perf_stat_init_aggr_mode()
1299 &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1303 stat_config.aggr_get_id = perf_stat__get_core_cached; in perf_stat_init_aggr_mode()
1319 stat_config.cpus_aggr_map = perf_cpu_map__empty_new(nr + 1); in perf_stat_init_aggr_mode()
1320 return stat_config.cpus_aggr_map ? 0 : -ENOMEM; in perf_stat_init_aggr_mode()
1325 perf_cpu_map__put(stat_config.aggr_map); in perf_stat__exit_aggr_mode()
1326 perf_cpu_map__put(stat_config.cpus_aggr_map); in perf_stat__exit_aggr_mode()
1327 stat_config.aggr_map = NULL; in perf_stat__exit_aggr_mode()
1328 stat_config.cpus_aggr_map = NULL; in perf_stat__exit_aggr_mode()
1466 switch (stat_config.aggr_mode) { in perf_stat_init_aggr_mode_file()
1468 if (perf_env__build_socket_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1472 stat_config.aggr_get_id = perf_stat__get_socket_file; in perf_stat_init_aggr_mode_file()
1475 if (perf_env__build_die_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1479 stat_config.aggr_get_id = perf_stat__get_die_file; in perf_stat_init_aggr_mode_file()
1482 if (perf_env__build_core_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1486 stat_config.aggr_get_id = perf_stat__get_core_file; in perf_stat_init_aggr_mode_file()
1489 if (perf_env__build_node_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1493 stat_config.aggr_get_id = perf_stat__get_node_file; in perf_stat_init_aggr_mode_file()
1628 if (stat_config.null_run) in add_default_attributes()
1642 stat_config.metric_no_group, in add_default_attributes()
1643 stat_config.metric_no_merge, in add_default_attributes()
1644 &stat_config.metric_events); in add_default_attributes()
1682 stat_config.metric_only = true; in add_default_attributes()
1703 stat_config.metric_only = true; in add_default_attributes()
1710 if (!stat_config.interval && !stat_config.metric_only) { in add_default_attributes()
1711 fprintf(stat_config.output, in add_default_attributes()
1720 if (stat_config.aggr_mode != AGGR_GLOBAL && in add_default_attributes()
1721 stat_config.aggr_mode != AGGR_CORE) { in add_default_attributes()
1725 stat_config.aggr_mode = AGGR_CORE; in add_default_attributes()
1827 if (stat_config.run_count != 1 || forever) { in __cmd_record()
1856 perf_stat_process_counter(&stat_config, counter); in process_stat_round_event()
1861 if (stat_config.interval && stat_round->time) { in process_stat_round_event()
1878 perf_event__read_stat_config(&stat_config, &event->stat_config); in process_stat_config_event()
1887 stat_config.aggr_mode = st->aggr_mode; in process_stat_config_event()
1965 .stat_config = process_stat_config_event,
2009 stat_config.output = stderr; in __cmd_report()
2082 if (stat_config.csv_sep) { in cmd_stat()
2083 stat_config.csv_output = true; in cmd_stat()
2084 if (!strcmp(stat_config.csv_sep, "\\t")) in cmd_stat()
2085 stat_config.csv_sep = "\t"; in cmd_stat()
2087 stat_config.csv_sep = DEFAULT_SEPARATOR; in cmd_stat()
2096 interval = stat_config.interval; in cmd_stat()
2097 timeout = stat_config.timeout; in cmd_stat()
2112 if (stat_config.metric_only && stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2117 if (stat_config.metric_only && stat_config.run_count > 1) { in cmd_stat()
2122 if (stat_config.walltime_run_table && stat_config.run_count <= 1) { in cmd_stat()
2155 stat_config.output = output; in cmd_stat()
2160 if (stat_config.csv_output) { in cmd_stat()
2168 stat_config.big_num = false; in cmd_stat()
2170 stat_config.big_num = false; in cmd_stat()
2178 if ((stat_config.run_count == 1) && target__none(&target)) in cmd_stat()
2179 stat_config.ru_display = true; in cmd_stat()
2181 if (stat_config.run_count < 0) { in cmd_stat()
2185 } else if (stat_config.run_count == 0) { in cmd_stat()
2187 stat_config.run_count = 1; in cmd_stat()
2190 if (stat_config.walltime_run_table) { in cmd_stat()
2191 stat_config.walltime_run = zalloc(stat_config.run_count * sizeof(stat_config.walltime_run[0])); in cmd_stat()
2192 if (!stat_config.walltime_run) { in cmd_stat()
2198 if ((stat_config.aggr_mode == AGGR_THREAD) && in cmd_stat()
2214 if (((stat_config.aggr_mode != AGGR_GLOBAL && in cmd_stat()
2215 stat_config.aggr_mode != AGGR_THREAD) || nr_cgroups) && in cmd_stat()
2229 if (stat_config.cgroup_list) { in cmd_stat()
2237 if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list, in cmd_stat()
2238 &stat_config.metric_events, true) < 0) in cmd_stat()
2244 if ((stat_config.aggr_mode == AGGR_THREAD) && (target.system_wide)) in cmd_stat()
2266 if (stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2269 if (runtime_stat_new(&stat_config, in cmd_stat()
2276 if (stat_config.aggr_mode == AGGR_NODE) in cmd_stat()
2279 if (stat_config.times && interval) in cmd_stat()
2281 else if (stat_config.times && !interval) { in cmd_stat()
2321 stat_config.identifier = !(STAT_RECORD && perf_stat.data.is_pipe); in cmd_stat()
2336 if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack)) in cmd_stat()
2340 for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) { in cmd_stat()
2341 if (stat_config.run_count != 1 && verbose > 0) in cmd_stat()
2355 if (!forever && status != -1 && (!interval || stat_config.summary)) in cmd_stat()
2399 zfree(&stat_config.walltime_run); in cmd_stat()
2406 metricgroup__rblist_exit(&stat_config.metric_events); in cmd_stat()
2407 runtime_stat_delete(&stat_config); in cmd_stat()
2408 evlist__close_control(stat_config.ctl_fd, stat_config.ctl_fd_ack, &stat_config.ctl_fd_close); in cmd_stat()