Lines Matching +full:stdout +full:- +full:path
1 // SPDX-License-Identifier: GPL-2.0
3 * builtin-report.c
23 #include "util/mem-events.h"
34 #include "util/mem-info.h"
39 #include <subcmd/parse-options.h>
40 #include <subcmd/exec-cmd.h>
41 #include "util/parse-events.h"
48 #include "util/time-utils.h"
54 #include "util/block-info.h"
73 #include <event-parse.h>
134 if (!strcmp(var, "report.percent-limit")) { in report__config()
137 rep->min_percent = pcnt; in report__config()
145 if (!strcmp(var, "report.queue-size")) in report__config()
146 return perf_config_u64(&rep->queue_size, var, value); in report__config()
152 return -1; in report__config()
157 if (!strcmp(var, "report.skip-empty")) { in report__config()
158 rep->skip_empty = perf_config_bool(var, value); in report__config()
172 struct hist_entry *he = iter->he; in hist_iter__report_callback()
173 struct evsel *evsel = iter->evsel; in hist_iter__report_callback()
174 struct perf_sample *sample = iter->sample; in hist_iter__report_callback()
178 if (!ui__has_annotation() && !rep->symbol_ipc) in hist_iter__report_callback()
182 bi = he->branch_info; in hist_iter__report_callback()
183 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); in hist_iter__report_callback()
187 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); in hist_iter__report_callback()
189 } else if (rep->mem_mode) { in hist_iter__report_callback()
190 mi = he->mem_info; in hist_iter__report_callback()
195 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
199 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
201 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
213 struct hist_entry *he = iter->he; in hist_iter__branch_callback()
215 struct branch_info *bi = he->branch_info; in hist_iter__branch_callback()
216 struct perf_sample *sample = iter->sample; in hist_iter__branch_callback()
217 struct evsel *evsel = iter->evsel; in hist_iter__branch_callback()
220 branch_type_count(&rep->brtype_stat, &bi->flags, in hist_iter__branch_callback()
221 bi->from.addr, bi->to.addr); in hist_iter__branch_callback()
223 if (!ui__has_annotation() && !rep->symbol_ipc) in hist_iter__branch_callback()
226 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); in hist_iter__branch_callback()
230 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); in hist_iter__branch_callback()
239 if (report->group_set) in setup_forced_leader()
246 struct report *rep = container_of(session->tool, struct report, tool); in process_feature_event()
248 if (event->feat.feat_id < HEADER_LAST_FEATURE) in process_feature_event()
251 if (event->feat.feat_id != HEADER_LAST_FEATURE) { in process_feature_event()
253 event->feat.feat_id); in process_feature_event()
254 return -1; in process_feature_event()
255 } else if (rep->header_only) { in process_feature_event()
264 setup_forced_leader(rep, session->evlist); in process_feature_event()
284 if (perf_time__ranges_skip_sample(rep->ptime_range, rep->range_num, in process_sample_event()
285 sample->time)) { in process_sample_event()
289 if (evswitch__discard(&rep->evswitch, evsel)) in process_sample_event()
295 event->header.type); in process_sample_event()
296 ret = -1; in process_sample_event()
300 if (rep->stitch_lbr) in process_sample_event()
306 if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) in process_sample_event()
311 * A non-synthesized event might not have a branch stack if in process_sample_event()
314 if (!sample->branch_stack) in process_sample_event()
319 } else if (rep->mem_mode) { in process_sample_event()
330 if (ui__has_annotation() || rep->symbol_ipc || rep->total_cycles_mode) { in process_sample_event()
331 hist__account_cycles(sample->branch_stack, &al, sample, in process_sample_event()
332 rep->nonany_branch_mode, in process_sample_event()
333 &rep->total_cycles, evsel); in process_sample_event()
336 rep->total_samples++; in process_sample_event()
338 rep->singlethreaded_samples++; in process_sample_event()
340 ret = hist_entry_iter__add(&iter, &al, rep->max_stack, rep); in process_sample_event()
356 if (rep->show_threads) { in process_read_event()
357 int err = perf_read_values_add_value(&rep->show_threads_values, in process_read_event()
358 event->read.pid, event->read.tid, in process_read_event()
360 event->read.value); in process_read_event()
372 struct perf_session *session = rep->session; in report__setup_sample_type()
373 u64 sample_type = evlist__combined_sample_type(session->evlist); in report__setup_sample_type()
374 bool is_pipe = perf_data__is_pipe(session->data); in report__setup_sample_type()
377 if (session->itrace_synth_opts->callchain || in report__setup_sample_type()
378 session->itrace_synth_opts->add_callchain || in report__setup_sample_type()
380 perf_header__has_feat(&session->header, HEADER_AUXTRACE) && in report__setup_sample_type()
381 !session->itrace_synth_opts->set)) in report__setup_sample_type()
384 if (session->itrace_synth_opts->last_branch || in report__setup_sample_type()
385 session->itrace_synth_opts->add_last_branch) in report__setup_sample_type()
390 ui__error("Selected --sort parent, but no " in report__setup_sample_type()
392 "'perf record' without -g?\n"); in report__setup_sample_type()
393 return -EINVAL; in report__setup_sample_type()
397 ui__error("Selected -g or --branch-history.\n" in report__setup_sample_type()
399 "Did you call 'perf record' without -g or -b?\n"); in report__setup_sample_type()
400 return -1; in report__setup_sample_type()
408 return -EINVAL; in report__setup_sample_type()
423 ui__error("Selected -b but no branch data. " in report__setup_sample_type()
424 "Did you call perf record without -b?\n"); in report__setup_sample_type()
425 return -1; in report__setup_sample_type()
435 evlist__for_each_entry(session->evlist, evsel) { in report__setup_sample_type()
438 evsel->core.attr.sample_type |= PERF_SAMPLE_DATA_SRC; in report__setup_sample_type()
444 ui__error("Selected --mem-mode but no mem data. " in report__setup_sample_type()
445 "Did you call perf record without -d?\n"); in report__setup_sample_type()
446 return -1; in report__setup_sample_type()
450 callchain_param_setup(sample_type, perf_env__arch(&rep->session->header.env)); in report__setup_sample_type()
452 if (rep->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) { in report__setup_sample_type()
453 ui__warning("Can't find LBR callchain. Switch off --stitch-lbr.\n" in report__setup_sample_type()
454 "Please apply --call-graph lbr when recording.\n"); in report__setup_sample_type()
455 rep->stitch_lbr = false; in report__setup_sample_type()
459 if (!(evlist__combined_branch_type(session->evlist) & PERF_SAMPLE_BRANCH_ANY)) in report__setup_sample_type()
460 rep->nonany_branch_mode = true; in report__setup_sample_type()
482 unsigned long nr_samples = hists->stats.nr_samples; in hists__fprintf_nr_sample_events()
483 u64 nr_events = hists->stats.total_period; in hists__fprintf_nr_sample_events()
487 int socked_id = hists->socket_filter; in hists__fprintf_nr_sample_events()
493 nr_samples = hists->stats.nr_non_filtered_samples; in hists__fprintf_nr_sample_events()
494 nr_events = hists->stats.total_non_filtered_period; in hists__fprintf_nr_sample_events()
507 nr_samples += pos_hists->stats.nr_non_filtered_samples; in hists__fprintf_nr_sample_events()
508 nr_events += pos_hists->stats.total_non_filtered_period; in hists__fprintf_nr_sample_events()
510 nr_samples += pos_hists->stats.nr_samples; in hists__fprintf_nr_sample_events()
511 nr_events += pos_hists->stats.total_period; in hists__fprintf_nr_sample_events()
520 evsel->core.nr_members > 1 ? "s" : "", evname); in hists__fprintf_nr_sample_events()
523 if (rep->time_str) in hists__fprintf_nr_sample_events()
524 ret += fprintf(fp, " (time slices: %s)", rep->time_str); in hists__fprintf_nr_sample_events()
526 if (symbol_conf.show_ref_callgraph && evname && strstr(evname, "call-graph=no")) { in hists__fprintf_nr_sample_events()
530 if (rep->mem_mode) { in hists__fprintf_nr_sample_events()
536 if (socked_id > -1) in hists__fprintf_nr_sample_events()
548 ret = report__browse_block_hists(&rep->block_reports[i++].hist, in evlist__tui_block_hists_browse()
549 rep->min_percent, pos, in evlist__tui_block_hists_browse()
550 &rep->session->header.env); in evlist__tui_block_hists_browse()
564 fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", in evlist__tty_browse_hists()
565 evlist->stats.total_lost_samples); in evlist__tty_browse_hists()
576 if (rep->skip_empty && !hists->stats.nr_samples) in evlist__tty_browse_hists()
579 hists__fprintf_nr_sample_events(hists, rep, evname, stdout); in evlist__tty_browse_hists()
581 if (rep->total_cycles_mode) { in evlist__tty_browse_hists()
585 fprintf(stdout, "%s", buf); in evlist__tty_browse_hists()
586 fprintf(stdout, "#\n"); in evlist__tty_browse_hists()
589 report__browse_block_hists(&rep->block_reports[i - 1].hist, in evlist__tty_browse_hists()
590 rep->min_percent, pos, NULL); in evlist__tty_browse_hists()
594 hists__fprintf(hists, !quiet, 0, 0, rep->min_percent, stdout, in evlist__tty_browse_hists()
597 fprintf(stdout, "\n\n"); in evlist__tty_browse_hists()
601 fprintf(stdout, "#\n# (%s)\n#\n", help); in evlist__tty_browse_hists()
603 if (rep->show_threads) { in evlist__tty_browse_hists()
604 bool style = !strcmp(rep->pretty_printing_style, "raw"); in evlist__tty_browse_hists()
605 perf_read_values_display(stdout, &rep->show_threads_values, in evlist__tty_browse_hists()
607 perf_read_values_destroy(&rep->show_threads_values); in evlist__tty_browse_hists()
611 branch_type_stat_display(stdout, &rep->brtype_stat); in evlist__tty_browse_hists()
618 struct map *kernel_map = machine__kernel_map(&rep->session->machines.host); in report__warn_kptr_restrict()
621 if (evlist__exclude_kernel(rep->session->evlist)) in report__warn_kptr_restrict()
626 (kernel_kmap->ref_reloc_sym == NULL || in report__warn_kptr_restrict()
627 kernel_kmap->ref_reloc_sym->addr == 0))) { in report__warn_kptr_restrict()
654 return -1; in report__gtk_browse_hists()
657 return hist_browser(rep->session->evlist, help, NULL, rep->min_percent); in report__gtk_browse_hists()
663 struct perf_session *session = rep->session; in report__browse_hists()
664 struct evlist *evlist = session->evlist; in report__browse_hists()
665 char *help = NULL, *path = NULL; in report__browse_hists() local
667 path = system_path(TIPDIR); in report__browse_hists()
668 if (perf_tip(&help, path) || help == NULL) { in report__browse_hists()
669 /* fallback for people who don't install perf ;-) */ in report__browse_hists()
670 free(path); in report__browse_hists()
671 path = system_path(DOCDIR); in report__browse_hists()
672 if (perf_tip(&help, path) || help == NULL) in report__browse_hists()
675 free(path); in report__browse_hists()
679 if (rep->total_cycles_mode) { in report__browse_hists()
684 ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent, in report__browse_hists()
685 &session->header.env, true); in report__browse_hists()
706 struct perf_session *session = rep->session; in report__collapse_hists()
707 struct evlist *evlist = session->evlist; in report__collapse_hists()
718 if (perf_data__is_pipe(session->data)) { in report__collapse_hists()
721 return -1; in report__collapse_hists()
725 ui_progress__init(&prog, rep->nr_entries, "Merging related events..."); in report__collapse_hists()
727 evlist__for_each_entry(rep->session->evlist, pos) { in report__collapse_hists()
730 if (pos->core.idx == 0) in report__collapse_hists()
731 hists->symbol_filter_str = rep->symbol_filter_str; in report__collapse_hists()
733 hists->socket_filter = rep->socket_filter; in report__collapse_hists()
739 /* Non-group events are considered as leader */ in report__collapse_hists()
755 struct symbol *sym = he->ms.sym; in hists__resort_cb()
757 if (rep->symbol_ipc && sym && !sym->annotate2) { in hists__resort_cb()
758 struct evsel *evsel = hists_to_evsel(he->hists); in hists__resort_cb()
760 symbol__annotate2(&he->ms, evsel, NULL); in hists__resort_cb()
771 ui_progress__init(&prog, rep->nr_entries, "Sorting events for output..."); in report__output_resort()
773 evlist__for_each_entry(rep->session->evlist, pos) { in report__output_resort()
800 evsel = evlist__id2evsel(rep->session->evlist, sample->id); in count_lost_samples_event()
803 u32 count = event->lost_samples.lost; in count_lost_samples_event()
805 if (event->header.misc & PERF_RECORD_MISC_LOST_SAMPLES_BPF) in count_lost_samples_event()
819 perf_tool__init(&rep->tool, /*ordered_events=*/false); in stats_setup()
820 rep->tool.attr = process_attr; in stats_setup()
821 rep->tool.sample = count_sample_event; in stats_setup()
822 rep->tool.lost_samples = count_lost_samples_event; in stats_setup()
823 rep->tool.event_update = perf_event__process_event_update; in stats_setup()
824 rep->tool.no_warn = true; in stats_setup()
829 struct perf_session *session = rep->session; in stats_print()
831 perf_session__fprintf_nr_events(session, stdout); in stats_print()
832 evlist__fprintf_nr_events(session->evlist, stdout); in stats_print()
838 perf_tool__init(&rep->tool, /*ordered_events=*/true); in tasks_setup()
839 if (rep->mmaps_mode) { in tasks_setup()
840 rep->tool.mmap = perf_event__process_mmap; in tasks_setup()
841 rep->tool.mmap2 = perf_event__process_mmap2; in tasks_setup()
843 rep->tool.attr = process_attr; in tasks_setup()
844 rep->tool.comm = perf_event__process_comm; in tasks_setup()
845 rep->tool.exit = perf_event__process_exit; in tasks_setup()
846 rep->tool.fork = perf_event__process_fork; in tasks_setup()
847 rep->tool.no_warn = true; in tasks_setup()
863 ret = fprintf(args->fp, in maps__fprintf_task_cb()
864 "%*s %" PRIx64 "-%" PRIx64 " %c%c%c%c %08" PRIx64 " %" PRIu64 " %s\n", in maps__fprintf_task_cb()
865 args->indent, "", map__start(map), map__end(map), in maps__fprintf_task_cb()
866 prot & PROT_READ ? 'r' : '-', in maps__fprintf_task_cb()
867 prot & PROT_WRITE ? 'w' : '-', in maps__fprintf_task_cb()
868 prot & PROT_EXEC ? 'x' : '-', in maps__fprintf_task_cb()
871 dso__id_const(dso)->ino, dso__name(dso)); in maps__fprintf_task_cb()
876 args->printed += ret; in maps__fprintf_task_cb()
904 parent_thread = machine__find_thread(machine, -1, thread__ppid(thread)); in thread_level()
931 * - init with a TID 1 and a parent of 0
932 * - systemd with a TID 3000 and a parent of init/1
933 * - systemd child thread with TID 4000, the parent is 3000
934 * - NetworkManager is a child of init with a TID of 3500.
941 struct thread *a = task_a->thread; in task_list_cmp()
942 struct thread *b = task_b->thread; in task_list_cmp()
951 return -1; in task_list_cmp()
958 return thread__tid(a) < thread__tid(b) ? -1 : 1; in task_list_cmp()
969 for (int i = level_a; i > level_b; i--) { in task_list_cmp()
970 struct thread *parent = machine__find_thread(machine, -1, thread__ppid(a)); in task_list_cmp()
976 return -1; in task_list_cmp()
980 for (int i = level_b; i > level_a; i--) { in task_list_cmp()
981 struct thread *parent = machine__find_thread(machine, -1, thread__ppid(b)); in task_list_cmp()
995 parent = machine__find_thread(machine, -1, thread__ppid(a)); in task_list_cmp()
1000 parent = machine__find_thread(machine, -1, thread__ppid(b)); in task_list_cmp()
1009 return !a && !b ? 0 : (!a ? -1 : 1); in task_list_cmp()
1013 /* a is a child of b or vice-versa, deeper levels appear later. */ in task_list_cmp()
1014 res = level_a < level_b ? -1 : (level_a > level_b ? 1 : 0); in task_list_cmp()
1017 res = thread__tid(a) < thread__tid(b) ? -1 : 1; in task_list_cmp()
1026 struct machine *machine = &rep->session->machines.host; in tasks_print()
1039 task__print_level(machine, task->thread, fp); in tasks_print()
1048 struct perf_session *session = rep->session; in __cmd_report()
1050 struct perf_data *data = session->data; in __cmd_report()
1054 if (rep->cpu_list) { in __cmd_report()
1055 ret = perf_session__cpu_bitmap(session, rep->cpu_list, in __cmd_report()
1056 rep->cpu_bitmap); in __cmd_report()
1061 session->itrace_synth_opts->cpu_bitmap = rep->cpu_bitmap; in __cmd_report()
1064 if (rep->show_threads) { in __cmd_report()
1065 ret = perf_read_values_init(&rep->show_threads_values); in __cmd_report()
1076 if (rep->stats_mode) in __cmd_report()
1079 if (rep->tasks_mode) in __cmd_report()
1088 /* Don't show Latency column for non-parallel profiles by default. */ in __cmd_report()
1089 if (!symbol_conf.prefer_latency && rep->total_samples && in __cmd_report()
1090 rep->singlethreaded_samples * 100 / rep->total_samples >= 99) in __cmd_report()
1093 evlist__check_mem_load_aux(session->evlist); in __cmd_report()
1095 if (rep->stats_mode) in __cmd_report()
1098 if (rep->tasks_mode) in __cmd_report()
1099 return tasks_print(rep, stdout); in __cmd_report()
1103 evlist__for_each_entry(session->evlist, pos) in __cmd_report()
1104 rep->nr_entries += evsel__hists(pos)->nr_entries; in __cmd_report()
1108 perf_session__fprintf(session, stdout); in __cmd_report()
1111 perf_session__fprintf_dsos(session, stdout); in __cmd_report()
1132 rep->nr_entries = 0; in __cmd_report()
1133 evlist__for_each_entry(session->evlist, pos) in __cmd_report()
1134 rep->nr_entries += evsel__hists(pos)->nr_entries; in __cmd_report()
1136 if (rep->nr_entries == 0) { in __cmd_report()
1137 ui__error("The %s data has no samples!\n", data->path); in __cmd_report()
1143 if (rep->total_cycles_mode) { in __cmd_report()
1152 if (session->evlist->nr_br_cntr > 0) in __cmd_report()
1158 rep->block_reports = block_info__create_report(session->evlist, in __cmd_report()
1159 rep->total_cycles, in __cmd_report()
1161 &rep->nr_block_reports); in __cmd_report()
1162 if (!rep->block_reports) in __cmd_report()
1163 return -1; in __cmd_report()
1172 struct callchain_param *callchain = opt->value; in report_parse_callchain_opt()
1174 callchain->enabled = !unset; in report_parse_callchain_opt()
1176 * --no-call-graph in report_parse_callchain_opt()
1180 callchain->mode = CHAIN_NONE; in report_parse_callchain_opt()
1191 unsigned long *time_q = opt->value; in parse_time_quantum()
1199 return -1; in parse_time_quantum()
1220 return -1; in parse_time_quantum()
1232 pr_err("Invalid --ignore-callees regex: %s\n%s", arg, buf); in report_parse_ignore_callees_opt()
1233 return -1; in report_parse_ignore_callees_opt()
1245 int *branch_mode = opt->value; in parse_branch_mode()
1255 struct report *rep = opt->value; in parse_percent_limit()
1258 rep->min_percent = pcnt; in parse_percent_limit()
1279 callchain_param_setup(sample_type, perf_env__arch((*pevlist)->env)); in process_attr()
1293 int branch_mode = -1; in cmd_report()
1308 .socket_filter = -1, in cmd_report()
1320 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, in cmd_report()
1327 OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux, in cmd_report()
1333 "load module symbols - WARNING: use only with -k and LIVE kernel"), in cmd_report()
1334 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, in cmd_report()
1337 "Show per-thread event counters"), in cmd_report()
1349 OPT_BOOLEAN(0, "header-only", &report.header_only, in cmd_report()
1355 OPT_BOOLEAN(0, "show-cpu-utilization", &symbol_conf.show_cpu_utilization, in cmd_report()
1360 "regex filter to identify parent, see: '--sort parent'"), in cmd_report()
1361 OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, in cmd_report()
1362 "Only display entries with parent-match"), in cmd_report()
1363 OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param, in cmd_report()
1369 "Enabled by default, use --no-children to disable."), in cmd_report()
1370 OPT_INTEGER(0, "max-stack", &report.max_stack, in cmd_report()
1376 OPT_CALLBACK(0, "ignore-callees", NULL, "regex", in cmd_report()
1389 OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter", in cmd_report()
1391 OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, in cmd_report()
1394 OPT_STRING_NOEMPTY('t', "field-separator", &symbol_conf.field_sep, "separator", in cmd_report()
1397 OPT_BOOLEAN('U', "hide-unresolved", &symbol_conf.hide_unresolved, in cmd_report()
1406 OPT_BOOLEAN('I', "show-info", &report.show_full_info, in cmd_report()
1410 OPT_BOOLEAN(0, "asm-raw", &annotate_opts.show_asm_raw, in cmd_report()
1412 OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", in cmd_report()
1413 "Specify disassembler style (e.g. -M intel for intel syntax)"), in cmd_report()
1415 "Add prefix to source file path names in programs (with --prefix-strip)"), in cmd_report()
1416 OPT_STRING(0, "prefix-strip", &annotate_opts.prefix_strip, "N", in cmd_report()
1417 "Strip first N entries of source file path name in programs (with --prefix)"), in cmd_report()
1418 OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, in cmd_report()
1422 OPT_INTEGER(0, "group-sort-idx", &symbol_conf.group_sort_idx, in cmd_report()
1426 OPT_CALLBACK_NOOPT('b', "branch-stack", &branch_mode, "", in cmd_report()
1429 OPT_BOOLEAN(0, "branch-history", &branch_call_mode, in cmd_report()
1431 OPT_STRING(0, "objdump", &objdump_path, "path", in cmd_report()
1433 OPT_STRING(0, "addr2line", &addr2line_path, "path", in cmd_report()
1436 "Symbol demangling. Enabled by default, use --no-demangle to disable."), in cmd_report()
1437 OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, in cmd_report()
1439 OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"), in cmd_report()
1442 OPT_CALLBACK(0, "percent-limit", &report, "percent", in cmd_report()
1449 OPT_BOOLEAN(0, "full-source-path", &srcline_full_filename, in cmd_report()
1450 "Show full source file name path for source lines"), in cmd_report()
1451 OPT_BOOLEAN(0, "show-ref-call-graph", &symbol_conf.show_ref_callgraph, in cmd_report()
1453 OPT_BOOLEAN(0, "stitch-lbr", &report.stitch_lbr, in cmd_report()
1455 OPT_INTEGER(0, "socket-filter", &report.socket_filter, in cmd_report()
1457 OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace, in cmd_report()
1461 OPT_CALLBACK_DEFAULT(0, "stdio-color", NULL, "mode", in cmd_report()
1462 "'always' (default), 'never' or 'auto' only applicable to --stdio mode", in cmd_report()
1468 OPT_CALLBACK(0, "percent-type", &annotate_opts, "local-period", in cmd_report()
1469 "Set percent type local/global-period/hits", in cmd_report()
1472 OPT_CALLBACK(0, "time-quantum", &symbol_conf.time_quantum, "time (ms|us|ns|s)", in cmd_report()
1476 OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode, in cmd_report()
1478 OPT_BOOLEAN(0, "disable-order", &report.disable_order, in cmd_report()
1480 OPT_BOOLEAN(0, "skip-empty", &report.skip_empty, in cmd_report()
1483 "Show latency-centric profile rather than the default\n" in cmd_report()
1484 "\t\t\t CPU-consumption-centric profile\n" in cmd_report()
1485 "\t\t\t (requires perf record --latency flag)."), in cmd_report()
1500 * the data file. Off-cpu events are synthesized after other events and in cmd_report()
1526 return -ENOMEM; in cmd_report()
1531 return -ENOMEM; in cmd_report()
1536 return -ENOMEM; in cmd_report()
1540 ret = -EINVAL; in cmd_report()
1568 input_name = "-"; in cmd_report()
1574 data.path = input_name; in cmd_report()
1609 ret = evswitch__init(&report.evswitch, session->evlist, stderr); in cmd_report()
1613 if (zstd_init(&(session->zstd_data), 0) < 0) in cmd_report()
1617 ordered_events__set_alloc_size(&session->ordered_events, in cmd_report()
1621 session->itrace_synth_opts = &itrace_synth_opts; in cmd_report()
1625 has_br_stack = perf_header__has_feat(&session->header, in cmd_report()
1627 if (evlist__combined_sample_type(session->evlist) & PERF_SAMPLE_STACK_USER) in cmd_report()
1630 setup_forced_leader(&report, session->evlist); in cmd_report()
1632 if (symbol_conf.group_sort_idx && evlist__nr_groups(session->evlist) == 0) { in cmd_report()
1633 parse_options_usage(NULL, options, "group-sort-idx", 0); in cmd_report()
1634 ret = -EINVAL; in cmd_report()
1648 * -1 means default, so decide based on the file having branch data. in cmd_report()
1651 if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) && in cmd_report()
1677 pr_err("Error: --hierarchy and --fields options cannot be used together\n"); in cmd_report()
1697 /* Force tty output for header output and per-thread stat. */ in cmd_report()
1707 pr_err("Error: --tasks and --mmaps can't be used together with --stats\n"); in cmd_report()
1731 if (strcmp(input_name, "-") != 0) in cmd_report()
1750 ui__error("Use of latency profile or parallelism is incompatible with --disable-order.\n"); in cmd_report()
1752 ui__error("Use of latency profile or parallelism requires --latency flag during record.\n"); in cmd_report()
1753 return -1; in cmd_report()
1783 (setup_sorting(session->evlist) < 0)) { in cmd_report()
1793 perf_session__fprintf_info(session, stdout, in cmd_report()
1808 fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n", in cmd_report()
1809 stdout); in cmd_report()
1839 if (symbol__init(&session->header.env) < 0) in cmd_report()
1856 if (session->tevent.pevent && in cmd_report()
1857 tep_set_function_resolver(session->tevent.pevent, in cmd_report()
1859 &session->machines.host) < 0) { in cmd_report()
1862 return -1; in cmd_report()
1865 sort__setup_elide(stdout); in cmd_report()
1894 zstd_fini(&(session->zstd_data)); in cmd_report()