Lines Matching +full:smi +full:- +full:based

1 // SPDX-License-Identifier: GPL-2.0-only
3 * builtin-stat.c
16 1708.761321 task-clock # 11.037 CPUs utilized
17 41,190 context-switches # 0.024 M/sec
18 6,735 CPU-migrations # 0.004 M/sec
19 17,318 page-faults # 0.010 M/sec
21 3,856,436,920 stalled-cycles-frontend # 74.09% frontend cycles idle
22 1,600,790,871 stalled-cycles-backend # 30.75% backend cycles idle
26 6,388,934 branch-misses # 1.32% of all branches
31 * Copyright (C) 2008-2011, Red Hat Inc, Ingo Molnar <mingo@redhat.com>
46 #include <subcmd/parse-options.h>
47 #include "util/parse-events.h"
51 #include "util/evlist-hybrid.h"
65 #include "util/synthetic-events.h"
67 #include "util/time-utils.h"
73 #include "util/pmu-hybrid.h"
102 /* Default events used for perf stat -T */
104 "task-clock,"
108 "cpu/cycles-t/,"
109 "cpu/tx-start/,"
110 "cpu/el-start/,"
111 "cpu/cycles-ct/"
117 "task-clock,"
121 "cpu/cycles-t/,"
122 "cpu/tx-start/"
127 "topdown-total-slots",
128 "topdown-slots-retired",
129 "topdown-recovery-bubbles",
130 "topdown-fetch-bubbles",
131 "topdown-slots-issued",
137 "topdown-retiring",
138 "topdown-bad-spec",
139 "topdown-fe-bound",
140 "topdown-be-bound",
146 "topdown-retiring",
147 "topdown-bad-spec",
148 "topdown-fe-bound",
149 "topdown-be-bound",
150 "topdown-heavy-ops",
151 "topdown-br-mispredict",
152 "topdown-fetch-lat",
153 "topdown-mem-bound",
162 "msr/smi/,"
176 static volatile pid_t child_pid = -1;
182 static int big_num_opt = -1;
222 .ctl_fd = -1,
223 .ctl_fd_ack = -1,
229 if (!a->core.cpus && !b->core.cpus) in cpus_map_matched()
232 if (!a->core.cpus || !b->core.cpus) in cpus_map_matched()
235 if (perf_cpu_map__nr(a->core.cpus) != perf_cpu_map__nr(b->core.cpus)) in cpus_map_matched()
238 for (int i = 0; i < perf_cpu_map__nr(a->core.cpus); i++) { in cpus_map_matched()
239 if (perf_cpu_map__cpu(a->core.cpus, i).cpu != in cpus_map_matched()
240 perf_cpu_map__cpu(b->core.cpus, i).cpu) in cpus_map_matched()
270 cpu_map__snprint(leader->core.cpus, buf, sizeof(buf)); in evlist__check_cpu_maps()
271 pr_warning(" %s: %s\n", leader->name, buf); in evlist__check_cpu_maps()
272 cpu_map__snprint(evsel->core.cpus, buf, sizeof(buf)); in evlist__check_cpu_maps()
273 pr_warning(" %s: %s\n", evsel->name, buf); in evlist__check_cpu_maps()
284 r->tv_sec = a->tv_sec - b->tv_sec; in diff_timespec()
285 if (a->tv_nsec < b->tv_nsec) { in diff_timespec()
286 r->tv_nsec = a->tv_nsec + NSEC_PER_SEC - b->tv_nsec; in diff_timespec()
287 r->tv_sec--; in diff_timespec()
289 r->tv_nsec = a->tv_nsec - b->tv_nsec ; in diff_timespec()
304 if (perf_data__write(&perf_stat.data, event, event->header.size) < 0) { in process_synthesized_event()
306 return -1; in process_synthesized_event()
309 perf_stat.bytes_written += event->header.size; in process_synthesized_event()
323 #define SID(e, x, y) xyarray__entry(e->core.sample_id, x, y)
331 return perf_event__synthesize_stat(NULL, cpu, thread, sid->id, count, in evsel__write_stat_event()
338 switch(counter->tool_event) { in read_single_counter()
340 u64 val = rs->tv_nsec + rs->tv_sec*1000000000ULL; in read_single_counter()
342 perf_counts(counter->counts, cpu_map_idx, thread); in read_single_counter()
343 count->ena = count->run = val; in read_single_counter()
344 count->val = val; in read_single_counter()
351 perf_counts(counter->counts, cpu_map_idx, thread); in read_single_counter()
352 if (counter->tool_event == PERF_TOOL_USER_TIME) in read_single_counter()
356 count->ena = count->run = val; in read_single_counter()
357 count->val = val; in read_single_counter()
371 * do not aggregate counts across CPUs in system-wide mode
375 int nthreads = perf_thread_map__nr(evsel_list->core.threads); in read_counter_cpu()
378 if (!counter->supported) in read_counter_cpu()
379 return -ENOENT; in read_counter_cpu()
384 count = perf_counts(counter->counts, cpu_map_idx, thread); in read_counter_cpu()
388 * (via evsel__read_counter()) and sets their count->loaded. in read_counter_cpu()
390 if (!perf_counts__is_loaded(counter->counts, cpu_map_idx, thread) && in read_counter_cpu()
392 counter->counts->scaled = -1; in read_counter_cpu()
393 perf_counts(counter->counts, cpu_map_idx, thread)->ena = 0; in read_counter_cpu()
394 perf_counts(counter->counts, cpu_map_idx, thread)->run = 0; in read_counter_cpu()
395 return -1; in read_counter_cpu()
398 perf_counts__set_loaded(counter->counts, cpu_map_idx, thread, false); in read_counter_cpu()
403 return -1; in read_counter_cpu()
413 count->val, count->ena, count->run); in read_counter_cpu()
431 return -1; in read_affinity_counters()
441 if (!counter->err) { in read_affinity_counters()
442 counter->err = read_counter_cpu(counter, rs, in read_affinity_counters()
479 if (counter->err) in read_counters()
480 pr_debug("failed to read counter %s\n", counter->name); in read_counters()
481 if (counter->err == 0 && perf_stat_process_counter(&stat_config, counter)) in read_counters()
482 pr_warning("failed to process counter %s\n", counter->name); in read_counters()
483 counter->err = 0; in read_counters()
511 if (interval_count && !(--(*times))) in handle_interval()
543 * - we don't have tracee (attaching to task or cpu) in enable_counters()
544 * - we have initial delay configured in enable_counters()
582 workload_exec_errno = info->si_value.sival_int; in workload_exec_failed_signal()
587 return STAT_RECORD || counter->core.attr.read_format & PERF_FORMAT_ID; in evsel__should_store_id()
599 for (i = 0; i < threads->nr; i++) { in is_target_alive()
603 threads->map[i].pid); in is_target_alive()
644 tts -= time_diff.tv_sec * MSEC_PER_SEC + in compute_tts()
672 child_exited = !is_target_alive(&target, evsel_list->core.threads) ? 1 : 0; in dispatch_events()
711 counter->supported = false; in stat_handle_error()
716 counter->errored = true; in stat_handle_error()
719 !(counter->core.leader->nr_members > 1)) in stat_handle_error()
726 evsel_list->core.threads && in stat_handle_error()
727 evsel_list->core.threads->err_thread != -1) { in stat_handle_error()
729 * For global --per-thread case, skip current in stat_handle_error()
732 if (!thread_map__remove(evsel_list->core.threads, in stat_handle_error()
733 evsel_list->core.threads->err_thread)) { in stat_handle_error()
734 evsel_list->core.threads->err_thread = -1; in stat_handle_error()
742 if (child_pid != -1) in stat_handle_error()
767 return -1; in __run_perf_stat()
769 child_pid = evsel_list->workload.pid; in __run_perf_stat()
775 if (!cpu_map__is_dummy(evsel_list->core.user_requested_cpus)) { in __run_perf_stat()
777 return -1; in __run_perf_stat()
782 counter->reset_group = false; in __run_perf_stat()
784 return -1; in __run_perf_stat()
799 if (counter->reset_group || counter->errored) in __run_perf_stat()
816 counter->weak_group) { in __run_perf_stat()
818 assert(counter->reset_group); in __run_perf_stat()
825 return -1; in __run_perf_stat()
835 counter->supported = true; in __run_perf_stat()
848 if (!counter->reset_group && !counter->errored) in __run_perf_stat()
851 perf_evsel__close_cpu(&counter->core, evlist_cpu_itr.cpu_map_idx); in __run_perf_stat()
857 if (!counter->reset_group) in __run_perf_stat()
866 return -1; in __run_perf_stat()
875 counter->supported = true; in __run_perf_stat()
881 if (!counter->supported) { in __run_perf_stat()
882 perf_evsel__free_fd(&counter->core); in __run_perf_stat()
886 l = strlen(counter->unit); in __run_perf_stat()
892 return -1; in __run_perf_stat()
897 counter->filter, evsel__name(counter), errno, in __run_perf_stat()
899 return -1; in __run_perf_stat()
923 return -1; in __run_perf_stat()
935 if (child_pid != -1) { in __run_perf_stat()
944 return -1; in __run_perf_stat()
958 stat_config.walltime_run[run_idx] = t1 - t0; in __run_perf_stat()
964 update_stats(&walltime_nsecs_stats, t1 - t0); in __run_perf_stat()
973 update_stats(&walltime_nsecs_stats, t1 - t0); in __run_perf_stat()
983 read_counters(&(struct timespec) { .tv_nsec = t1-t0 }); in __run_perf_stat()
1032 static volatile int signr = -1;
1036 if ((child_pid == -1) || stat_config.interval) in skip_signal()
1046 child_pid = -1; in skip_signal()
1063 if (child_pid != -1) in sig_atexit()
1068 if (signr == -1) in sig_atexit()
1109 return -ENOMEM; in append_metric_groups()
1115 return -ENOMEM; in append_metric_groups()
1124 struct perf_stat_config *config = opt->value; in parse_control_option()
1126 return evlist__parse_control(str, &config->ctl_fd, &config->ctl_fd_ack, &config->ctl_fd_close); in parse_control_option()
1133 pr_err("--cgroup and --for-each-cgroup cannot be used together\n"); in parse_stat_cgroups()
1134 return -1; in parse_stat_cgroups()
1144 struct evlist *evlist = *(struct evlist **)opt->value; in parse_hybrid_type()
1146 if (!list_empty(&evlist->core.entries)) { in parse_hybrid_type()
1148 return -1; in parse_hybrid_type()
1151 evlist->hybrid_pmu_name = perf_pmu__hybrid_type_to_pmu(str); in parse_hybrid_type()
1152 if (!evlist->hybrid_pmu_name) { in parse_hybrid_type()
1153 fprintf(stderr, "--cputype %s is not supported!\n", str); in parse_hybrid_type()
1154 return -1; in parse_hybrid_type()
1168 OPT_BOOLEAN('i', "no-inherit", &stat_config.no_inherit,
1175 OPT_STRING('b', "bpf-prog", &target.bpf_str, "bpf-prog-id",
1177 OPT_BOOLEAN(0, "bpf-counters", &target.use_bpf,
1179 OPT_STRING(0, "bpf-attr-map", &target.attr_map, "attr-map-path",
1182 OPT_BOOLEAN('a', "all-cpus", &target.system_wide,
1183 "system-wide collection from all CPUs"),
1187 "Use --no-scale to disable counter scaling for multiplexing"),
1193 "display details about each run (only with -r option)"),
1195 "null run - dont start any counters"),
1197 "detailed run - start a lot of events"),
1200 OPT_CALLBACK_NOOPT('B', "big-num", NULL, NULL,
1204 "list of cpus to monitor in system-wide"),
1205 OPT_SET_UINT('A', "no-aggr", &stat_config.aggr_mode,
1207 OPT_BOOLEAN(0, "no-merge", &stat_config.no_merge, "Do not merge identical named events"),
1208 OPT_BOOLEAN(0, "hybrid-merge", &stat_config.hybrid_merge,
1210 OPT_STRING('x', "field-separator", &stat_config.csv_sep, "separator",
1212 OPT_BOOLEAN('j', "json-output", &stat_config.json_output,
1216 OPT_STRING(0, "for-each-cgroup", &stat_config.cgroup_list, "name",
1220 OPT_INTEGER(0, "log-fd", &output_fd,
1226 OPT_UINTEGER('I', "interval-print", &stat_config.interval,
1229 OPT_INTEGER(0, "interval-count", &stat_config.times,
1231 OPT_BOOLEAN(0, "interval-clear", &stat_config.interval_clear,
1235 OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode,
1237 OPT_SET_UINT(0, "per-die", &stat_config.aggr_mode,
1239 OPT_SET_UINT(0, "per-core", &stat_config.aggr_mode,
1241 OPT_SET_UINT(0, "per-thread", &stat_config.aggr_mode,
1243 OPT_SET_UINT(0, "per-node", &stat_config.aggr_mode,
1246 … "ms to wait before starting measurement after program start (-1: start with events disabled)"),
1247 OPT_CALLBACK_NOOPT(0, "metric-only", &stat_config.metric_only, NULL,
1249 OPT_BOOLEAN(0, "metric-no-group", &stat_config.metric_no_group,
1251 OPT_BOOLEAN(0, "metric-no-merge", &stat_config.metric_no_merge,
1254 "measure top-down statistics"),
1255 OPT_UINTEGER(0, "td-level", &stat_config.topdown_level,
1256 "Set the metrics level for the top-down statistics (0: max level)"),
1257 OPT_BOOLEAN(0, "smi-cost", &smi_cost,
1258 "measure SMI cost"),
1262 OPT_BOOLEAN_FLAG(0, "all-kernel", &stat_config.all_kernel,
1265 OPT_BOOLEAN_FLAG(0, "all-user", &stat_config.all_user,
1268 OPT_BOOLEAN(0, "percore-show-thread", &stat_config.percore_show_thread,
1274 OPT_BOOLEAN(0, "no-csv-summary", &stat_config.no_csv_summary,
1283 OPT_CALLBACK(0, "pfm-events", &evsel_list, "event",
1287 OPT_CALLBACK(0, "control", &stat_config, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
1288 …"Listen on ctl-fd descriptor for command to control measurement ('enable': enable events, 'disable…
1289 "\t\t\t Optionally send control command completion ('ack\\n') to ack-fd descriptor.\n"
1290 "\t\t\t Alternatively, ctl-fifo / ack-fifo will be opened and used as ctl-fd / ack-fd.",
1338 if (aggr_cpu_id__is_empty(&config->cpus_aggr_map->map[cpu.cpu])) in perf_stat__get_aggr()
1339 config->cpus_aggr_map->map[cpu.cpu] = get_id(config, cpu); in perf_stat__get_aggr()
1341 id = config->cpus_aggr_map->map[cpu.cpu]; in perf_stat__get_aggr()
1374 if (counter->percore) in term_percore_set()
1437 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, in perf_stat_init_aggr_mode()
1441 return -1; in perf_stat_init_aggr_mode()
1447 * The evsel_list->cpus is the base we operate on, in perf_stat_init_aggr_mode()
1451 if (evsel_list->core.user_requested_cpus) in perf_stat_init_aggr_mode()
1452 nr = perf_cpu_map__max(evsel_list->core.user_requested_cpus).cpu; in perf_stat_init_aggr_mode()
1456 return stat_config.cpus_aggr_map ? 0 : -ENOMEM; in perf_stat_init_aggr_mode()
1462 WARN_ONCE(refcount_read(&map->refcnt) != 0, in cpu_aggr_map__delete()
1470 if (map && refcount_dec_and_test(&map->refcnt)) in cpu_aggr_map__put()
1487 if (cpu.cpu != -1) in perf_env__get_socket_aggr_by_cpu()
1488 id.socket = env->cpu[cpu.cpu].socket_id; in perf_env__get_socket_aggr_by_cpu()
1498 if (cpu.cpu != -1) { in perf_env__get_die_aggr_by_cpu()
1504 id.socket = env->cpu[cpu.cpu].socket_id; in perf_env__get_die_aggr_by_cpu()
1505 id.die = env->cpu[cpu.cpu].die_id; in perf_env__get_die_aggr_by_cpu()
1516 if (cpu.cpu != -1) { in perf_env__get_core_aggr_by_cpu()
1522 id.socket = env->cpu[cpu.cpu].socket_id; in perf_env__get_core_aggr_by_cpu()
1523 id.die = env->cpu[cpu.cpu].die_id; in perf_env__get_core_aggr_by_cpu()
1524 id.core = env->cpu[cpu.cpu].core_id; in perf_env__get_core_aggr_by_cpu()
1541 return perf_env__get_socket_aggr_by_cpu(cpu, &perf_stat.session->header.env); in perf_stat__get_socket_file()
1546 return perf_env__get_die_aggr_by_cpu(cpu, &perf_stat.session->header.env); in perf_stat__get_die_file()
1552 return perf_env__get_core_aggr_by_cpu(cpu, &perf_stat.session->header.env); in perf_stat__get_core_file()
1558 return perf_env__get_node_aggr_by_cpu(cpu, &perf_stat.session->header.env); in perf_stat__get_node_file()
1605 struct perf_env *env = &st->session->header.env; in perf_stat_init_aggr_mode_file()
1611 stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, get_id, env); in perf_stat_init_aggr_mode_file()
1614 return -1; in perf_stat_init_aggr_mode_file()
1622 * if -d/--detailed, -d -d or -d -d -d is used:
1650 * Detailed stats (-d), covering the L1 and last level data caches: in add_default_attributes()
1680 * Very detailed stats (-d -d), covering the instruction cache and the TLB caches: in add_default_attributes()
1723 * Very, very detailed stats (-d -d -d), adding prefetch events: in add_default_attributes()
1748 /* Handle -T as -M transaction. Once platform specific metrics in add_default_attributes()
1763 if (pmu_have_event("cpu", "cycles-ct") && in add_default_attributes()
1764 pmu_have_event("cpu", "el-start")) in add_default_attributes()
1776 return err ? -1 : 0; in add_default_attributes()
1781 int smi; in add_default_attributes() local
1783 if (sysfs__read_int(FREEZE_ON_SMI_PATH, &smi) < 0) { in add_default_attributes()
1785 return -1; in add_default_attributes()
1788 if (!smi) { in add_default_attributes()
1791 return -1; in add_default_attributes()
1797 !pmu_have_event("msr", "smi")) { in add_default_attributes()
1798 fprintf(stderr, "To measure SMI cost, it needs " in add_default_attributes()
1799 "msr/aperf/, msr/smi/ and cpu/cycles/ support\n"); in add_default_attributes()
1800 return -1; in add_default_attributes()
1809 fprintf(stderr, "Cannot set up SMI cost events\n"); in add_default_attributes()
1812 return err ? -1 : 0; in add_default_attributes()
1831 pr_err("Invalid top-down metrics level. The max level is %u.\n", max_level); in add_default_attributes()
1832 return -1; in add_default_attributes()
1838 return -1; in add_default_attributes()
1845 "Please print the result regularly, e.g. -I1000\n"); in add_default_attributes()
1854 pr_err("top down event configuration requires --per-core mode\n"); in add_default_attributes()
1855 return -1; in add_default_attributes()
1859 pr_err("top down event configuration requires system-wide mode (-a)\n"); in add_default_attributes()
1860 return -1; in add_default_attributes()
1867 return -1; in add_default_attributes()
1884 return -1; in add_default_attributes()
1889 return -1; in add_default_attributes()
1897 if (!evsel_list->core.nr_entries) { in add_default_attributes()
1902 return -1; in add_default_attributes()
1903 if (pmu_have_event("cpu", "stalled-cycles-frontend")) { in add_default_attributes()
1905 return -1; in add_default_attributes()
1907 if (pmu_have_event("cpu", "stalled-cycles-backend")) { in add_default_attributes()
1909 return -1; in add_default_attributes()
1912 return -1; in add_default_attributes()
1915 return -1; in add_default_attributes()
1925 return -1; in add_default_attributes()
1932 return -1; in add_default_attributes()
1951 perf_header__set_feat(&session->header, feat); in init_features()
1953 perf_header__clear_feat(&session->header, HEADER_DIR_FORMAT); in init_features()
1954 perf_header__clear_feat(&session->header, HEADER_BUILD_ID); in init_features()
1955 perf_header__clear_feat(&session->header, HEADER_TRACING_DATA); in init_features()
1956 perf_header__clear_feat(&session->header, HEADER_BRANCH_STACK); in init_features()
1957 perf_header__clear_feat(&session->header, HEADER_AUXTRACE); in init_features()
1969 data->path = output_name; in __cmd_record()
1972 pr_err("Cannot use -r option with perf stat record.\n"); in __cmd_record()
1973 return -1; in __cmd_record()
1984 session->evlist = evsel_list; in __cmd_record()
1993 struct perf_record_stat_round *stat_round = &event->stat_round; in process_stat_round_event()
1996 const char **argv = session->header.env.cmdline_argv; in process_stat_round_event()
1997 int argc = session->header.env.nr_cmdline; in process_stat_round_event()
2002 if (stat_round->type == PERF_STAT_ROUND_TYPE__FINAL) in process_stat_round_event()
2003 update_stats(&walltime_nsecs_stats, stat_round->time); in process_stat_round_event()
2005 if (stat_config.interval && stat_round->time) { in process_stat_round_event()
2006 tsh.tv_sec = stat_round->time / NSEC_PER_SEC; in process_stat_round_event()
2007 tsh.tv_nsec = stat_round->time % NSEC_PER_SEC; in process_stat_round_event()
2019 struct perf_tool *tool = session->tool; in process_stat_config_event()
2022 perf_event__read_stat_config(&stat_config, &event->stat_config); in process_stat_config_event()
2024 if (perf_cpu_map__empty(st->cpus)) { in process_stat_config_event()
2025 if (st->aggr_mode != AGGR_UNSET) in process_stat_config_event()
2030 if (st->aggr_mode != AGGR_UNSET) in process_stat_config_event()
2031 stat_config.aggr_mode = st->aggr_mode; in process_stat_config_event()
2043 if (!st->cpus || !st->threads) in set_maps()
2046 if (WARN_ONCE(st->maps_allocated, "stats double allocation\n")) in set_maps()
2047 return -EINVAL; in set_maps()
2049 perf_evlist__set_maps(&evsel_list->core, st->cpus, st->threads); in set_maps()
2052 return -ENOMEM; in set_maps()
2054 st->maps_allocated = true; in set_maps()
2062 struct perf_tool *tool = session->tool; in process_thread_map_event()
2065 if (st->threads) { in process_thread_map_event()
2070 st->threads = thread_map__new_event(&event->thread_map); in process_thread_map_event()
2071 if (!st->threads) in process_thread_map_event()
2072 return -ENOMEM; in process_thread_map_event()
2081 struct perf_tool *tool = session->tool; in process_cpu_map_event()
2085 if (st->cpus) { in process_cpu_map_event()
2090 cpus = cpu_map__new_data(&event->cpu_map.data); in process_cpu_map_event()
2092 return -ENOMEM; in process_cpu_map_event()
2094 st->cpus = cpus; in process_cpu_map_event()
2121 OPT_SET_UINT(0, "per-socket", &perf_stat.aggr_mode, in __cmd_report()
2123 OPT_SET_UINT(0, "per-die", &perf_stat.aggr_mode, in __cmd_report()
2125 OPT_SET_UINT(0, "per-core", &perf_stat.aggr_mode, in __cmd_report()
2127 OPT_SET_UINT(0, "per-node", &perf_stat.aggr_mode, in __cmd_report()
2129 OPT_SET_UINT('A', "no-aggr", &perf_stat.aggr_mode, in __cmd_report()
2140 input_name = "-"; in __cmd_report()
2156 evsel_list = session->evlist; in __cmd_report()
2169 * Make system wide (-a) the default target if in setup_system_wide()
2173 * - there's no workload specified in setup_system_wide()
2174 * - there is workload specified but all requested in setup_system_wide()
2186 if (!counter->core.requires_cpu && in setup_system_wide()
2187 strcmp(counter->name, "duration_time")) { in setup_system_wide()
2192 if (evsel_list->core.nr_entries) in setup_system_wide()
2203 int status = -EINVAL, run_idx, err; in cmd_stat()
2214 return -ENOMEM; in cmd_stat()
2218 /* String-parsing callback-based options would segfault when negated */ in cmd_stat()
2237 return -1; in cmd_stat()
2245 * For record command the -o is already taken care of. in cmd_stat()
2247 if (!STAT_RECORD && output_name && strcmp(output_name, "-")) in cmd_stat()
2251 fprintf(stderr, "cannot use both --output and --log-fd\n"); in cmd_stat()
2253 parse_options_usage(NULL, stat_options, "log-fd", 0); in cmd_stat()
2258 fprintf(stderr, "--metric-only is not supported with --per-thread\n"); in cmd_stat()
2263 fprintf(stderr, "--metric-only is not supported with -r\n"); in cmd_stat()
2268 fprintf(stderr, "--table is only supported with -r\n"); in cmd_stat()
2275 fprintf(stderr, "argument to --log-fd must be a > 0\n"); in cmd_stat()
2276 parse_options_usage(stat_usage, stat_options, "log-fd", 0); in cmd_stat()
2287 return -1; in cmd_stat()
2296 return -errno; in cmd_stat()
2303 * let the spreadsheet do the pretty-printing in cmd_stat()
2306 /* User explicitly passed -B? */ in cmd_stat()
2308 fprintf(stderr, "-B option not supported with -x\n"); in cmd_stat()
2314 } else if (big_num_opt == 0) /* User passed --no-big-num */ in cmd_stat()
2344 pr_err("failed to setup -r option"); in cmd_stat()
2352 fprintf(stderr, "The --per-thread option is only " in cmd_stat()
2353 "available when monitoring via -p -t -a " in cmd_stat()
2354 "options or only --per-thread.\n"); in cmd_stat()
2362 * no_aggr, cgroup are for system-wide only in cmd_stat()
2363 * --per-thread is aggregated per thread, we dont mix it with cpu mode in cmd_stat()
2369 fprintf(stderr, "both cgroup and no-aggregation " in cmd_stat()
2370 "modes only available in system-wide mode\n"); in cmd_stat()
2375 parse_options_usage(NULL, stat_options, "for-each-cgroup", 0); in cmd_stat()
2399 status = -ENOMEM; in cmd_stat()
2406 * knowing the target is system-wide. in cmd_stat()
2425 pr_err("--cgroup and --for-each-cgroup cannot be used together\n"); in cmd_stat()
2427 parse_options_usage(NULL, stat_options, "for-each-cgroup", 0); in cmd_stat()
2434 "for-each-cgroup", 0); in cmd_stat()
2465 thread_map__read_comms(evsel_list->core.threads); in cmd_stat()
2474 pr_err("interval-count option should be used together with " in cmd_stat()
2475 "interval-print.\n"); in cmd_stat()
2476 parse_options_usage(stat_usage, stat_options, "interval-count", 0); in cmd_stat()
2492 pr_err("timeout option is not supported with interval-print.\n"); in cmd_stat()
2510 * by attr->sample_type != 0, and we can't run it on in cmd_stat()
2516 * We dont want to block the signals - that would cause in cmd_stat()
2517 * child tasks to inherit that and Ctrl-C would not work. in cmd_stat()
2518 * What we want is for Ctrl-C to work in the exec()-ed in cmd_stat()
2531 /* Enable ignoring missing threads when -p option is defined. */ in cmd_stat()
2532 evlist__first(evsel_list)->ignore_missing_thread = target.pid; in cmd_stat()
2543 if (forever && status != -1 && !interval) { in cmd_stat()
2549 if (!forever && status != -1 && (!interval || stat_config.summary)) in cmd_stat()
2565 * tools remain -acme in cmd_stat()
2571 &perf_stat.session->machines.host); in cmd_stat()
2583 perf_stat.session->header.data_size += perf_stat.bytes_written; in cmd_stat()