Lines Matching refs:stat_config

212 static struct perf_stat_config stat_config = {  variable
300 for (i = 0; i < stat_config.stats_num; i++) in perf_stat__reset_stats()
301 perf_stat__reset_shadow_per_stat(&stat_config.stats[i]); in perf_stat__reset_stats()
395 fprintf(stat_config.output, in read_counter_cpu()
461 if (!stat_config.stop_read_counter) { in read_counters()
470 if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter)) in read_counters()
524 runtime_stat_reset(&stat_config); in process_interval()
533 update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000ULL); in process_interval()
561 if (stat_config.initial_delay < 0) { in enable_counters()
566 if (stat_config.initial_delay > 0) { in enable_counters()
568 usleep(stat_config.initial_delay * USEC_PER_MSEC); in enable_counters()
576 if (!target__none(&target) || stat_config.initial_delay) { in enable_counters()
579 if (stat_config.initial_delay > 0) in enable_counters()
781 int interval = stat_config.interval; in __run_perf_stat()
782 int times = stat_config.times; in __run_perf_stat()
783 int timeout = stat_config.timeout; in __run_perf_stat()
833 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
894 if (create_perf_stat_counter(counter, &stat_config, &target, in __run_perf_stat()
921 if (l > stat_config.unit_width) in __run_perf_stat()
922 stat_config.unit_width = l; in __run_perf_stat()
949 err = perf_event__synthesize_stat_events(&stat_config, NULL, evsel_list, in __run_perf_stat()
972 wait4(child_pid, &status, 0, &stat_config.ru_data); in __run_perf_stat()
998 if (stat_config.walltime_run_table) in __run_perf_stat()
999 stat_config.walltime_run[run_idx] = t1 - t0; in __run_perf_stat()
1001 if (interval && stat_config.summary) { in __run_perf_stat()
1002 stat_config.interval = 0; in __run_perf_stat()
1003 stat_config.stop_read_counter = true; in __run_perf_stat()
1007 if (stat_config.aggr_mode == AGGR_GLOBAL) in __run_perf_stat()
1012 runtime_stat_reset(&stat_config); in __run_perf_stat()
1066 if (stat_config.quiet) in print_counters()
1069 evlist__print_counters(evsel_list, &stat_config, &target, ts, argc, argv); in print_counters()
1076 if ((child_pid == -1) || stat_config.interval) in skip_signal()
1117 stat_config.big_num = (set != 0); in perf_stat__set_big_num()
1122 stat_config.no_csv_summary = (set != 0); in perf_stat__set_no_csv_summary()
1137 stat_config.metric_only = !unset; in enable_metric_only()
1146 stat_config.metric_no_group, in parse_metric_groups()
1147 stat_config.metric_no_merge, in parse_metric_groups()
1148 &stat_config.metric_events); in parse_metric_groups()
1163 if (stat_config.cgroup_list) { in parse_stat_cgroups()
1179 OPT_BOOLEAN('i', "no-inherit", &stat_config.no_inherit,
1197 OPT_BOOLEAN(0, "scale", &stat_config.scale,
1201 OPT_INTEGER('r', "repeat", &stat_config.run_count,
1203 OPT_BOOLEAN(0, "table", &stat_config.walltime_run_table,
1205 OPT_BOOLEAN('n', "null", &stat_config.null_run,
1216 OPT_SET_UINT('A', "no-aggr", &stat_config.aggr_mode,
1218 OPT_BOOLEAN(0, "no-merge", &stat_config.no_merge, "Do not merge identical named events"),
1219 OPT_STRING('x', "field-separator", &stat_config.csv_sep, "separator",
1223 OPT_STRING(0, "for-each-cgroup", &stat_config.cgroup_list, "name",
1233 OPT_UINTEGER('I', "interval-print", &stat_config.interval,
1236 OPT_INTEGER(0, "interval-count", &stat_config.times,
1238 OPT_BOOLEAN(0, "interval-clear", &stat_config.interval_clear,
1240 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
1242 OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode,
1244 OPT_SET_UINT(0, "per-die", &stat_config.aggr_mode,
1246 OPT_SET_UINT(0, "per-core", &stat_config.aggr_mode,
1248 OPT_SET_UINT(0, "per-thread", &stat_config.aggr_mode,
1250 OPT_SET_UINT(0, "per-node", &stat_config.aggr_mode,
1252 OPT_INTEGER('D', "delay", &stat_config.initial_delay,
1254 OPT_CALLBACK_NOOPT(0, "metric-only", &stat_config.metric_only, NULL,
1256 OPT_BOOLEAN(0, "metric-no-group", &stat_config.metric_no_group,
1258 OPT_BOOLEAN(0, "metric-no-merge", &stat_config.metric_no_merge,
1262 OPT_UINTEGER(0, "td-level", &stat_config.topdown_level,
1269 OPT_BOOLEAN_FLAG(0, "all-kernel", &stat_config.all_kernel,
1272 OPT_BOOLEAN_FLAG(0, "all-user", &stat_config.all_user,
1275 OPT_BOOLEAN(0, "percore-show-thread", &stat_config.percore_show_thread,
1279 OPT_BOOLEAN(0, "summary", &stat_config.summary,
1281 OPT_BOOLEAN(0, "no-csv-summary", &stat_config.no_csv_summary,
1283 OPT_BOOLEAN(0, "quiet", &stat_config.quiet,
1290 OPT_CALLBACK(0, "control", &stat_config, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
1295 OPT_CALLBACK_OPTARG(0, "iostat", &evsel_list, &stat_config, "default",
1383 switch (stat_config.aggr_mode) { in perf_stat_init_aggr_mode()
1385 if (cpu_map__build_socket_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1389 stat_config.aggr_get_id = perf_stat__get_socket_cached; in perf_stat_init_aggr_mode()
1392 if (cpu_map__build_die_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1396 stat_config.aggr_get_id = perf_stat__get_die_cached; in perf_stat_init_aggr_mode()
1399 if (cpu_map__build_core_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1403 stat_config.aggr_get_id = perf_stat__get_core_cached; in perf_stat_init_aggr_mode()
1406 if (cpu_map__build_node_map(evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1410 stat_config.aggr_get_id = perf_stat__get_node_cached; in perf_stat_init_aggr_mode()
1415 &stat_config.aggr_map)) { in perf_stat_init_aggr_mode()
1419 stat_config.aggr_get_id = perf_stat__get_core_cached; in perf_stat_init_aggr_mode()
1435 stat_config.cpus_aggr_map = cpu_aggr_map__empty_new(nr + 1); in perf_stat_init_aggr_mode()
1436 return stat_config.cpus_aggr_map ? 0 : -ENOMEM; in perf_stat_init_aggr_mode()
1456 cpu_aggr_map__put(stat_config.aggr_map); in perf_stat__exit_aggr_mode()
1457 cpu_aggr_map__put(stat_config.cpus_aggr_map); in perf_stat__exit_aggr_mode()
1458 stat_config.aggr_map = NULL; in perf_stat__exit_aggr_mode()
1459 stat_config.cpus_aggr_map = NULL; in perf_stat__exit_aggr_mode()
1588 switch (stat_config.aggr_mode) { in perf_stat_init_aggr_mode_file()
1590 if (perf_env__build_socket_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1594 stat_config.aggr_get_id = perf_stat__get_socket_file; in perf_stat_init_aggr_mode_file()
1597 if (perf_env__build_die_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1601 stat_config.aggr_get_id = perf_stat__get_die_file; in perf_stat_init_aggr_mode_file()
1604 if (perf_env__build_core_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1608 stat_config.aggr_get_id = perf_stat__get_core_file; in perf_stat_init_aggr_mode_file()
1611 if (perf_env__build_node_map(env, evsel_list->core.cpus, &stat_config.aggr_map)) { in perf_stat_init_aggr_mode_file()
1615 stat_config.aggr_get_id = perf_stat__get_node_file; in perf_stat_init_aggr_mode_file()
1754 if (stat_config.null_run) in add_default_attributes()
1768 stat_config.metric_no_group, in add_default_attributes()
1769 stat_config.metric_no_merge, in add_default_attributes()
1770 &stat_config.metric_events); in add_default_attributes()
1814 stat_config.metric_only = true; in add_default_attributes()
1833 stat_config.metric_only = true; in add_default_attributes()
1840 if (stat_config.topdown_level > max_level) { in add_default_attributes()
1843 } else if (!stat_config.topdown_level) in add_default_attributes()
1844 stat_config.topdown_level = max_level; in add_default_attributes()
1851 if (!stat_config.interval && !stat_config.metric_only) { in add_default_attributes()
1852 fprintf(stat_config.output, in add_default_attributes()
1861 if (stat_config.aggr_mode != AGGR_GLOBAL && in add_default_attributes()
1862 stat_config.aggr_mode != AGGR_CORE) { in add_default_attributes()
1866 stat_config.aggr_mode = AGGR_CORE; in add_default_attributes()
1942 stat_config.topdown_level = TOPDOWN_MAX_LEVEL; in add_default_attributes()
2000 if (stat_config.run_count != 1 || forever) { in __cmd_record()
2029 perf_stat_process_counter(&stat_config, counter); in process_stat_round_event()
2034 if (stat_config.interval && stat_round->time) { in process_stat_round_event()
2051 perf_event__read_stat_config(&stat_config, &event->stat_config); in process_stat_config_event()
2060 stat_config.aggr_mode = st->aggr_mode; in process_stat_config_event()
2138 .stat_config = process_stat_config_event,
2182 stat_config.output = stderr; in __cmd_report()
2256 if (stat_config.csv_sep) { in cmd_stat()
2257 stat_config.csv_output = true; in cmd_stat()
2258 if (!strcmp(stat_config.csv_sep, "\\t")) in cmd_stat()
2259 stat_config.csv_sep = "\t"; in cmd_stat()
2261 stat_config.csv_sep = DEFAULT_SEPARATOR; in cmd_stat()
2270 interval = stat_config.interval; in cmd_stat()
2271 timeout = stat_config.timeout; in cmd_stat()
2286 if (stat_config.metric_only && stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2291 if (stat_config.metric_only && stat_config.run_count > 1) { in cmd_stat()
2296 if (stat_config.walltime_run_table && stat_config.run_count <= 1) { in cmd_stat()
2309 if (!output && !stat_config.quiet) { in cmd_stat()
2329 stat_config.output = output; in cmd_stat()
2334 if (stat_config.csv_output) { in cmd_stat()
2342 stat_config.big_num = false; in cmd_stat()
2344 stat_config.big_num = false; in cmd_stat()
2358 if ((stat_config.run_count == 1) && target__none(&target)) in cmd_stat()
2359 stat_config.ru_display = true; in cmd_stat()
2361 if (stat_config.run_count < 0) { in cmd_stat()
2365 } else if (stat_config.run_count == 0) { in cmd_stat()
2367 stat_config.run_count = 1; in cmd_stat()
2370 if (stat_config.walltime_run_table) { in cmd_stat()
2371 stat_config.walltime_run = zalloc(stat_config.run_count * sizeof(stat_config.walltime_run[0])); in cmd_stat()
2372 if (!stat_config.walltime_run) { in cmd_stat()
2378 if ((stat_config.aggr_mode == AGGR_THREAD) && in cmd_stat()
2394 if (((stat_config.aggr_mode != AGGR_GLOBAL && in cmd_stat()
2395 stat_config.aggr_mode != AGGR_THREAD) || in cmd_stat()
2396 (nr_cgroups || stat_config.cgroup_list)) && in cmd_stat()
2408 if (stat_config.iostat_run) { in cmd_stat()
2409 status = iostat_prepare(evsel_list, &stat_config); in cmd_stat()
2413 iostat_list(evsel_list, &stat_config); in cmd_stat()
2416 iostat_list(evsel_list, &stat_config); in cmd_stat()
2424 if (stat_config.cgroup_list) { in cmd_stat()
2432 if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list, in cmd_stat()
2433 &stat_config.metric_events, true) < 0) { in cmd_stat()
2440 if ((stat_config.aggr_mode == AGGR_THREAD) && (target.system_wide)) in cmd_stat()
2468 if (stat_config.aggr_mode == AGGR_THREAD) { in cmd_stat()
2471 if (runtime_stat_new(&stat_config, in cmd_stat()
2478 if (stat_config.aggr_mode == AGGR_NODE) in cmd_stat()
2481 if (stat_config.times && interval) in cmd_stat()
2483 else if (stat_config.times && !interval) { in cmd_stat()
2523 stat_config.identifier = !(STAT_RECORD && perf_stat.data.is_pipe); in cmd_stat()
2538 if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack)) in cmd_stat()
2542 for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) { in cmd_stat()
2543 if (stat_config.run_count != 1 && verbose > 0) in cmd_stat()
2557 if (!forever && status != -1 && (!interval || stat_config.summary)) in cmd_stat()
2602 if (stat_config.iostat_run) in cmd_stat()
2605 zfree(&stat_config.walltime_run); in cmd_stat()
2612 metricgroup__rblist_exit(&stat_config.metric_events); in cmd_stat()
2613 runtime_stat_delete(&stat_config); in cmd_stat()
2614 evlist__close_control(stat_config.ctl_fd, stat_config.ctl_fd_ack, &stat_config.ctl_fd_close); in cmd_stat()