Lines Matching +full:stdout +full:- +full:path

1 // SPDX-License-Identifier: GPL-2.0
3 * builtin-report.c
23 #include "util/mem-events.h"
38 #include <subcmd/parse-options.h>
39 #include <subcmd/exec-cmd.h>
40 #include "util/parse-events.h"
47 #include "util/time-utils.h"
53 #include "util/block-info.h"
126 if (!strcmp(var, "report.percent-limit")) { in report__config()
129 rep->min_percent = pcnt; in report__config()
137 if (!strcmp(var, "report.queue-size")) in report__config()
138 return perf_config_u64(&rep->queue_size, var, value); in report__config()
145 if (!strcmp(var, "report.skip-empty")) { in report__config()
146 rep->skip_empty = perf_config_bool(var, value); in report__config()
159 struct hist_entry *he = iter->he; in hist_iter__report_callback()
160 struct evsel *evsel = iter->evsel; in hist_iter__report_callback()
161 struct perf_sample *sample = iter->sample; in hist_iter__report_callback()
165 if (!ui__has_annotation() && !rep->symbol_ipc) in hist_iter__report_callback()
169 bi = he->branch_info; in hist_iter__report_callback()
170 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); in hist_iter__report_callback()
174 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); in hist_iter__report_callback()
176 } else if (rep->mem_mode) { in hist_iter__report_callback()
177 mi = he->mem_info; in hist_iter__report_callback()
178 err = addr_map_symbol__inc_samples(&mi->daddr, sample, evsel); in hist_iter__report_callback()
182 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
186 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
188 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
200 struct hist_entry *he = iter->he; in hist_iter__branch_callback()
202 struct branch_info *bi = he->branch_info; in hist_iter__branch_callback()
203 struct perf_sample *sample = iter->sample; in hist_iter__branch_callback()
204 struct evsel *evsel = iter->evsel; in hist_iter__branch_callback()
207 branch_type_count(&rep->brtype_stat, &bi->flags, in hist_iter__branch_callback()
208 bi->from.addr, bi->to.addr); in hist_iter__branch_callback()
210 if (!ui__has_annotation() && !rep->symbol_ipc) in hist_iter__branch_callback()
213 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); in hist_iter__branch_callback()
217 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); in hist_iter__branch_callback()
226 if (report->group_set) in setup_forced_leader()
233 struct report *rep = container_of(session->tool, struct report, tool); in process_feature_event()
235 if (event->feat.feat_id < HEADER_LAST_FEATURE) in process_feature_event()
238 if (event->feat.feat_id != HEADER_LAST_FEATURE) { in process_feature_event()
240 event->feat.feat_id); in process_feature_event()
241 return -1; in process_feature_event()
242 } else if (rep->header_only) { in process_feature_event()
251 setup_forced_leader(rep, session->evlist); in process_feature_event()
271 if (perf_time__ranges_skip_sample(rep->ptime_range, rep->range_num, in process_sample_event()
272 sample->time)) { in process_sample_event()
276 if (evswitch__discard(&rep->evswitch, evsel)) in process_sample_event()
281 event->header.type); in process_sample_event()
282 return -1; in process_sample_event()
285 if (rep->stitch_lbr) in process_sample_event()
286 al.thread->lbr_stitch_enable = true; in process_sample_event()
291 if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) in process_sample_event()
296 * A non-synthesized event might not have a branch stack if in process_sample_event()
299 if (!sample->branch_stack) in process_sample_event()
304 } else if (rep->mem_mode) { in process_sample_event()
313 al.map->dso->hit = 1; in process_sample_event()
315 if (ui__has_annotation() || rep->symbol_ipc || rep->total_cycles_mode) { in process_sample_event()
316 hist__account_cycles(sample->branch_stack, &al, sample, in process_sample_event()
317 rep->nonany_branch_mode, in process_sample_event()
318 &rep->total_cycles); in process_sample_event()
321 ret = hist_entry_iter__add(&iter, &al, rep->max_stack, rep); in process_sample_event()
337 if (rep->show_threads) { in process_read_event()
339 int err = perf_read_values_add_value(&rep->show_threads_values, in process_read_event()
340 event->read.pid, event->read.tid, in process_read_event()
341 evsel->core.idx, in process_read_event()
343 event->read.value); in process_read_event()
355 struct perf_session *session = rep->session; in report__setup_sample_type()
356 u64 sample_type = evlist__combined_sample_type(session->evlist); in report__setup_sample_type()
357 bool is_pipe = perf_data__is_pipe(session->data); in report__setup_sample_type()
360 if (session->itrace_synth_opts->callchain || in report__setup_sample_type()
361 session->itrace_synth_opts->add_callchain || in report__setup_sample_type()
363 perf_header__has_feat(&session->header, HEADER_AUXTRACE) && in report__setup_sample_type()
364 !session->itrace_synth_opts->set)) in report__setup_sample_type()
367 if (session->itrace_synth_opts->last_branch || in report__setup_sample_type()
368 session->itrace_synth_opts->add_last_branch) in report__setup_sample_type()
373 ui__error("Selected --sort parent, but no " in report__setup_sample_type()
375 "'perf record' without -g?\n"); in report__setup_sample_type()
376 return -EINVAL; in report__setup_sample_type()
380 ui__error("Selected -g or --branch-history.\n" in report__setup_sample_type()
382 "Did you call 'perf record' without -g or -b?\n"); in report__setup_sample_type()
383 return -1; in report__setup_sample_type()
391 return -EINVAL; in report__setup_sample_type()
406 ui__error("Selected -b but no branch data. " in report__setup_sample_type()
407 "Did you call perf record without -b?\n"); in report__setup_sample_type()
408 return -1; in report__setup_sample_type()
418 evlist__for_each_entry(session->evlist, evsel) { in report__setup_sample_type()
419 if (strstr(evsel->name, "arm_spe") && in report__setup_sample_type()
421 evsel->core.attr.sample_type |= PERF_SAMPLE_DATA_SRC; in report__setup_sample_type()
427 ui__error("Selected --mem-mode but no mem data. " in report__setup_sample_type()
428 "Did you call perf record without -d?\n"); in report__setup_sample_type()
429 return -1; in report__setup_sample_type()
433 callchain_param_setup(sample_type, perf_env__arch(&rep->session->header.env)); in report__setup_sample_type()
435 if (rep->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) { in report__setup_sample_type()
436 ui__warning("Can't find LBR callchain. Switch off --stitch-lbr.\n" in report__setup_sample_type()
437 "Please apply --call-graph lbr when recording.\n"); in report__setup_sample_type()
438 rep->stitch_lbr = false; in report__setup_sample_type()
442 if (!(evlist__combined_branch_type(session->evlist) & PERF_SAMPLE_BRANCH_ANY)) in report__setup_sample_type()
443 rep->nonany_branch_mode = true; in report__setup_sample_type()
465 unsigned long nr_samples = hists->stats.nr_samples; in hists__fprintf_nr_sample_events()
466 u64 nr_events = hists->stats.total_period; in hists__fprintf_nr_sample_events()
470 int socked_id = hists->socket_filter; in hists__fprintf_nr_sample_events()
476 nr_samples = hists->stats.nr_non_filtered_samples; in hists__fprintf_nr_sample_events()
477 nr_events = hists->stats.total_non_filtered_period; in hists__fprintf_nr_sample_events()
490 nr_samples += pos_hists->stats.nr_non_filtered_samples; in hists__fprintf_nr_sample_events()
491 nr_events += pos_hists->stats.total_non_filtered_period; in hists__fprintf_nr_sample_events()
493 nr_samples += pos_hists->stats.nr_samples; in hists__fprintf_nr_sample_events()
494 nr_events += pos_hists->stats.total_period; in hists__fprintf_nr_sample_events()
503 evsel->core.nr_members > 1 ? "s" : "", evname); in hists__fprintf_nr_sample_events()
506 if (rep->time_str) in hists__fprintf_nr_sample_events()
507 ret += fprintf(fp, " (time slices: %s)", rep->time_str); in hists__fprintf_nr_sample_events()
509 if (symbol_conf.show_ref_callgraph && evname && strstr(evname, "call-graph=no")) { in hists__fprintf_nr_sample_events()
513 if (rep->mem_mode) { in hists__fprintf_nr_sample_events()
519 if (socked_id > -1) in hists__fprintf_nr_sample_events()
531 ret = report__browse_block_hists(&rep->block_reports[i++].hist, in evlist__tui_block_hists_browse()
532 rep->min_percent, pos, in evlist__tui_block_hists_browse()
533 &rep->session->header.env, in evlist__tui_block_hists_browse()
534 &rep->annotation_opts); in evlist__tui_block_hists_browse()
548 fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", in evlist__tty_browse_hists()
549 evlist->stats.total_lost_samples); in evlist__tty_browse_hists()
559 if (rep->skip_empty && !hists->stats.nr_samples) in evlist__tty_browse_hists()
562 hists__fprintf_nr_sample_events(hists, rep, evname, stdout); in evlist__tty_browse_hists()
564 if (rep->total_cycles_mode) { in evlist__tty_browse_hists()
565 report__browse_block_hists(&rep->block_reports[i++].hist, in evlist__tty_browse_hists()
566 rep->min_percent, pos, in evlist__tty_browse_hists()
571 hists__fprintf(hists, !quiet, 0, 0, rep->min_percent, stdout, in evlist__tty_browse_hists()
574 fprintf(stdout, "\n\n"); in evlist__tty_browse_hists()
578 fprintf(stdout, "#\n# (%s)\n#\n", help); in evlist__tty_browse_hists()
580 if (rep->show_threads) { in evlist__tty_browse_hists()
581 bool style = !strcmp(rep->pretty_printing_style, "raw"); in evlist__tty_browse_hists()
582 perf_read_values_display(stdout, &rep->show_threads_values, in evlist__tty_browse_hists()
584 perf_read_values_destroy(&rep->show_threads_values); in evlist__tty_browse_hists()
588 branch_type_stat_display(stdout, &rep->brtype_stat); in evlist__tty_browse_hists()
595 struct map *kernel_map = machine__kernel_map(&rep->session->machines.host); in report__warn_kptr_restrict()
598 if (evlist__exclude_kernel(rep->session->evlist)) in report__warn_kptr_restrict()
602 (kernel_map->dso->hit && in report__warn_kptr_restrict()
603 (kernel_kmap->ref_reloc_sym == NULL || in report__warn_kptr_restrict()
604 kernel_kmap->ref_reloc_sym->addr == 0))) { in report__warn_kptr_restrict()
631 return -1; in report__gtk_browse_hists()
634 return hist_browser(rep->session->evlist, help, NULL, rep->min_percent); in report__gtk_browse_hists()
640 struct perf_session *session = rep->session; in report__browse_hists()
641 struct evlist *evlist = session->evlist; in report__browse_hists()
642 char *help = NULL, *path = NULL; in report__browse_hists() local
644 path = system_path(TIPDIR); in report__browse_hists()
645 if (perf_tip(&help, path) || help == NULL) { in report__browse_hists()
646 /* fallback for people who don't install perf ;-) */ in report__browse_hists()
647 free(path); in report__browse_hists()
648 path = system_path(DOCDIR); in report__browse_hists()
649 if (perf_tip(&help, path) || help == NULL) in report__browse_hists()
652 free(path); in report__browse_hists()
656 if (rep->total_cycles_mode) { in report__browse_hists()
661 ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent, in report__browse_hists()
662 &session->header.env, true, &rep->annotation_opts); in report__browse_hists()
687 ui_progress__init(&prog, rep->nr_entries, "Merging related events..."); in report__collapse_hists()
689 evlist__for_each_entry(rep->session->evlist, pos) { in report__collapse_hists()
692 if (pos->core.idx == 0) in report__collapse_hists()
693 hists->symbol_filter_str = rep->symbol_filter_str; in report__collapse_hists()
695 hists->socket_filter = rep->socket_filter; in report__collapse_hists()
701 /* Non-group events are considered as leader */ in report__collapse_hists()
717 struct symbol *sym = he->ms.sym; in hists__resort_cb()
719 if (rep->symbol_ipc && sym && !sym->annotate2) { in hists__resort_cb()
720 struct evsel *evsel = hists_to_evsel(he->hists); in hists__resort_cb()
722 symbol__annotate2(&he->ms, evsel, in hists__resort_cb()
734 ui_progress__init(&prog, rep->nr_entries, "Sorting events for output..."); in report__output_resort()
736 evlist__for_each_entry(rep->session->evlist, pos) { in report__output_resort()
763 evsel = evlist__id2evsel(rep->session->evlist, sample->id); in count_lost_samples_event()
766 event->lost_samples.lost); in count_lost_samples_event()
777 memset(&rep->tool, 0, sizeof(rep->tool)); in stats_setup()
778 rep->tool.attr = process_attr; in stats_setup()
779 rep->tool.sample = count_sample_event; in stats_setup()
780 rep->tool.lost_samples = count_lost_samples_event; in stats_setup()
781 rep->tool.no_warn = true; in stats_setup()
786 struct perf_session *session = rep->session; in stats_print()
788 perf_session__fprintf_nr_events(session, stdout, rep->skip_empty); in stats_print()
789 evlist__fprintf_nr_events(session->evlist, stdout, rep->skip_empty); in stats_print()
795 memset(&rep->tool, 0, sizeof(rep->tool)); in tasks_setup()
796 rep->tool.ordered_events = true; in tasks_setup()
797 if (rep->mmaps_mode) { in tasks_setup()
798 rep->tool.mmap = perf_event__process_mmap; in tasks_setup()
799 rep->tool.mmap2 = perf_event__process_mmap2; in tasks_setup()
801 rep->tool.attr = process_attr; in tasks_setup()
802 rep->tool.comm = perf_event__process_comm; in tasks_setup()
803 rep->tool.exit = perf_event__process_exit; in tasks_setup()
804 rep->tool.fork = perf_event__process_fork; in tasks_setup()
805 rep->tool.no_warn = true; in tasks_setup()
816 struct thread *parent_thread, *thread = task->thread; in tasks_list()
820 if (!list_empty(&task->list)) in tasks_list()
824 if (thread->ppid == -1) in tasks_list()
827 parent_thread = machine__find_thread(machine, -1, thread->ppid); in tasks_list()
829 return ERR_PTR(-ENOENT); in tasks_list()
832 list_add_tail(&task->list, &parent_task->children); in tasks_list()
842 printed += fprintf(fp, "%*s %" PRIx64 "-%" PRIx64 " %c%c%c%c %08" PRIx64 " %" PRIu64 " %s\n", in maps__fprintf_task()
843 indent, "", map->start, map->end, in maps__fprintf_task()
844 map->prot & PROT_READ ? 'r' : '-', in maps__fprintf_task()
845 map->prot & PROT_WRITE ? 'w' : '-', in maps__fprintf_task()
846 map->prot & PROT_EXEC ? 'x' : '-', in maps__fprintf_task()
847 map->flags & MAP_SHARED ? 's' : 'p', in maps__fprintf_task()
848 map->pgoff, in maps__fprintf_task()
849 map->dso->id.ino, map->dso->name); in maps__fprintf_task()
857 struct thread *thread = task->thread; in task__print_level()
860 thread->pid_, thread->tid, thread->ppid, in task__print_level()
865 maps__fprintf_task(thread->maps, comm_indent, fp); in task__print_level()
867 if (!list_empty(&task->children)) { in task__print_level()
868 list_for_each_entry(child, &task->children, list) in task__print_level()
875 struct perf_session *session = rep->session; in tasks_print()
876 struct machine *machine = &session->machines.host; in tasks_print()
883 * No locking needed while accessing machine->threads, in tasks_print()
884 * because --tasks is single threaded command. in tasks_print()
889 nr += machine->threads[i].nr; in tasks_print()
893 return -ENOMEM; in tasks_print()
896 struct threads *threads = &machine->threads[i]; in tasks_print()
898 for (nd = rb_first_cached(&threads->entries); nd; in tasks_print()
902 task->thread = rb_entry(nd, struct thread, rb_node); in tasks_print()
903 INIT_LIST_HEAD(&task->children); in tasks_print()
904 INIT_LIST_HEAD(&task->list); in tasks_print()
905 thread__set_priv(task->thread, task); in tasks_print()
917 if (!list_empty(&task->list)) in tasks_print()
928 list_add_tail(&task->list, &list); in tasks_print()
943 struct perf_session *session = rep->session; in __cmd_report()
945 struct perf_data *data = session->data; in __cmd_report()
949 if (rep->cpu_list) { in __cmd_report()
950 ret = perf_session__cpu_bitmap(session, rep->cpu_list, in __cmd_report()
951 rep->cpu_bitmap); in __cmd_report()
956 session->itrace_synth_opts->cpu_bitmap = rep->cpu_bitmap; in __cmd_report()
959 if (rep->show_threads) { in __cmd_report()
960 ret = perf_read_values_init(&rep->show_threads_values); in __cmd_report()
971 if (rep->stats_mode) in __cmd_report()
974 if (rep->tasks_mode) in __cmd_report()
983 evlist__check_mem_load_aux(session->evlist); in __cmd_report()
985 if (rep->stats_mode) in __cmd_report()
988 if (rep->tasks_mode) in __cmd_report()
989 return tasks_print(rep, stdout); in __cmd_report()
993 evlist__for_each_entry(session->evlist, pos) in __cmd_report()
994 rep->nr_entries += evsel__hists(pos)->nr_entries; in __cmd_report()
998 perf_session__fprintf(session, stdout); in __cmd_report()
1001 perf_session__fprintf_dsos(session, stdout); in __cmd_report()
1004 perf_session__fprintf_nr_events(session, stdout, in __cmd_report()
1005 rep->skip_empty); in __cmd_report()
1006 evlist__fprintf_nr_events(session->evlist, stdout, in __cmd_report()
1007 rep->skip_empty); in __cmd_report()
1025 rep->nr_entries = 0; in __cmd_report()
1026 evlist__for_each_entry(session->evlist, pos) in __cmd_report()
1027 rep->nr_entries += evsel__hists(pos)->nr_entries; in __cmd_report()
1029 if (rep->nr_entries == 0) { in __cmd_report()
1030 ui__error("The %s data has no samples!\n", data->path); in __cmd_report()
1036 if (rep->total_cycles_mode) { in __cmd_report()
1046 rep->block_reports = block_info__create_report(session->evlist, in __cmd_report()
1047 rep->total_cycles, in __cmd_report()
1049 &rep->nr_block_reports); in __cmd_report()
1050 if (!rep->block_reports) in __cmd_report()
1051 return -1; in __cmd_report()
1060 struct callchain_param *callchain = opt->value; in report_parse_callchain_opt()
1062 callchain->enabled = !unset; in report_parse_callchain_opt()
1064 * --no-call-graph in report_parse_callchain_opt()
1068 callchain->mode = CHAIN_NONE; in report_parse_callchain_opt()
1079 unsigned long *time_q = opt->value; in parse_time_quantum()
1087 return -1; in parse_time_quantum()
1108 return -1; in parse_time_quantum()
1120 pr_err("Invalid --ignore-callees regex: %s\n%s", arg, buf); in report_parse_ignore_callees_opt()
1121 return -1; in report_parse_ignore_callees_opt()
1133 int *branch_mode = opt->value; in parse_branch_mode()
1143 struct report *rep = opt->value; in parse_percent_limit()
1146 rep->min_percent = pcnt; in parse_percent_limit()
1167 callchain_param_setup(sample_type, perf_env__arch((*pevlist)->env)); in process_attr()
1177 int branch_mode = -1; in cmd_report()
1214 .socket_filter = -1, in cmd_report()
1226 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, in cmd_report()
1233 OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux, in cmd_report()
1239 "load module symbols - WARNING: use only with -k and LIVE kernel"), in cmd_report()
1240 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, in cmd_report()
1243 "Show per-thread event counters"), in cmd_report()
1255 OPT_BOOLEAN(0, "header-only", &report.header_only, in cmd_report()
1261 OPT_BOOLEAN(0, "show-cpu-utilization", &symbol_conf.show_cpu_utilization, in cmd_report()
1266 "regex filter to identify parent, see: '--sort parent'"), in cmd_report()
1267 OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, in cmd_report()
1268 "Only display entries with parent-match"), in cmd_report()
1269 OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param, in cmd_report()
1275 "Enabled by default, use --no-children to disable."), in cmd_report()
1276 OPT_INTEGER(0, "max-stack", &report.max_stack, in cmd_report()
1282 OPT_CALLBACK(0, "ignore-callees", NULL, "regex", in cmd_report()
1295 OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter", in cmd_report()
1297 OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, in cmd_report()
1300 OPT_STRING_NOEMPTY('t', "field-separator", &symbol_conf.field_sep, "separator", in cmd_report()
1303 OPT_BOOLEAN('U', "hide-unresolved", &symbol_conf.hide_unresolved, in cmd_report()
1310 OPT_BOOLEAN('I', "show-info", &report.show_full_info, in cmd_report()
1314 OPT_BOOLEAN(0, "asm-raw", &report.annotation_opts.show_asm_raw, in cmd_report()
1316 …OPT_STRING('M', "disassembler-style", &report.annotation_opts.disassembler_style, "disassembler st… in cmd_report()
1317 "Specify disassembler style (e.g. -M intel for intel syntax)"), in cmd_report()
1319 "Add prefix to source file path names in programs (with --prefix-strip)"), in cmd_report()
1320 OPT_STRING(0, "prefix-strip", &report.annotation_opts.prefix_strip, "N", in cmd_report()
1321 "Strip first N entries of source file path name in programs (with --prefix)"), in cmd_report()
1322 OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, in cmd_report()
1326 OPT_INTEGER(0, "group-sort-idx", &symbol_conf.group_sort_idx, in cmd_report()
1330 OPT_CALLBACK_NOOPT('b', "branch-stack", &branch_mode, "", in cmd_report()
1333 OPT_BOOLEAN(0, "branch-history", &branch_call_mode, in cmd_report()
1335 OPT_STRING(0, "objdump", &report.annotation_opts.objdump_path, "path", in cmd_report()
1339 OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, in cmd_report()
1341 OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"), in cmd_report()
1344 OPT_CALLBACK(0, "percent-limit", &report, "percent", in cmd_report()
1351 OPT_BOOLEAN(0, "full-source-path", &srcline_full_filename, in cmd_report()
1352 "Show full source file name path for source lines"), in cmd_report()
1353 OPT_BOOLEAN(0, "show-ref-call-graph", &symbol_conf.show_ref_callgraph, in cmd_report()
1355 OPT_BOOLEAN(0, "stitch-lbr", &report.stitch_lbr, in cmd_report()
1357 OPT_INTEGER(0, "socket-filter", &report.socket_filter, in cmd_report()
1359 OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace, in cmd_report()
1363 OPT_CALLBACK_DEFAULT(0, "stdio-color", NULL, "mode", in cmd_report()
1364 "'always' (default), 'never' or 'auto' only applicable to --stdio mode", in cmd_report()
1370 OPT_CALLBACK(0, "percent-type", &report.annotation_opts, "local-period", in cmd_report()
1371 "Set percent type local/global-period/hits", in cmd_report()
1374 OPT_CALLBACK(0, "time-quantum", &symbol_conf.time_quantum, "time (ms|us|ns|s)", in cmd_report()
1378 OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode, in cmd_report()
1380 OPT_BOOLEAN(0, "disable-order", &report.disable_order, in cmd_report()
1382 OPT_BOOLEAN(0, "skip-empty", &report.skip_empty, in cmd_report()
1412 ret = -EINVAL; in cmd_report()
1440 input_name = "-"; in cmd_report()
1445 data.path = input_name; in cmd_report()
1455 ret = evswitch__init(&report.evswitch, session->evlist, stderr); in cmd_report()
1459 if (zstd_init(&(session->zstd_data), 0) < 0) in cmd_report()
1463 ordered_events__set_alloc_size(&session->ordered_events, in cmd_report()
1467 session->itrace_synth_opts = &itrace_synth_opts; in cmd_report()
1471 has_br_stack = perf_header__has_feat(&session->header, in cmd_report()
1473 if (evlist__combined_sample_type(session->evlist) & PERF_SAMPLE_STACK_USER) in cmd_report()
1476 setup_forced_leader(&report, session->evlist); in cmd_report()
1478 if (symbol_conf.group_sort_idx && !session->evlist->core.nr_groups) { in cmd_report()
1479 parse_options_usage(NULL, options, "group-sort-idx", 0); in cmd_report()
1480 ret = -EINVAL; in cmd_report()
1494 * -1 means default, so decide based on the file having branch data. in cmd_report()
1497 if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) && in cmd_report()
1525 pr_err("Error: --hierarchy and --fields options cannot be used together\n"); in cmd_report()
1545 /* Force tty output for header output and per-thread stat. */ in cmd_report()
1555 pr_err("Error: --tasks and --mmaps can't be used together with --stats\n"); in cmd_report()
1566 if (strcmp(input_name, "-") != 0) in cmd_report()
1590 (setup_sorting(session->evlist) < 0)) { in cmd_report()
1600 perf_session__fprintf_info(session, stdout, in cmd_report()
1615 fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n", in cmd_report()
1616 stdout); in cmd_report()
1647 if (symbol__init(&session->header.env) < 0) in cmd_report()
1663 if (session->tevent.pevent && in cmd_report()
1664 tep_set_function_resolver(session->tevent.pevent, in cmd_report()
1666 &session->machines.host) < 0) { in cmd_report()
1669 return -1; in cmd_report()
1672 sort__setup_elide(stdout); in cmd_report()
1694 zstd_fini(&(session->zstd_data)); in cmd_report()