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 <traceevent/event-parse.h>
132 if (!strcmp(var, "report.percent-limit")) { in report__config()
135 rep->min_percent = pcnt; in report__config()
143 if (!strcmp(var, "report.queue-size")) in report__config()
144 return perf_config_u64(&rep->queue_size, var, value); in report__config()
150 return -1; in report__config()
155 if (!strcmp(var, "report.skip-empty")) { in report__config()
156 rep->skip_empty = perf_config_bool(var, value); in report__config()
170 struct hist_entry *he = iter->he; in hist_iter__report_callback()
171 struct evsel *evsel = iter->evsel; in hist_iter__report_callback()
172 struct perf_sample *sample = iter->sample; in hist_iter__report_callback()
176 if (!ui__has_annotation() && !rep->symbol_ipc) in hist_iter__report_callback()
180 bi = he->branch_info; in hist_iter__report_callback()
181 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); in hist_iter__report_callback()
185 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); in hist_iter__report_callback()
187 } else if (rep->mem_mode) { in hist_iter__report_callback()
188 mi = he->mem_info; in hist_iter__report_callback()
193 err = hist_entry__inc_addr_samples(he, sample, evsel, al->addr); in hist_iter__report_callback()
197 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()
211 struct hist_entry *he = iter->he; in hist_iter__branch_callback()
213 struct branch_info *bi = he->branch_info; in hist_iter__branch_callback()
214 struct perf_sample *sample = iter->sample; in hist_iter__branch_callback()
215 struct evsel *evsel = iter->evsel; in hist_iter__branch_callback()
218 branch_type_count(&rep->brtype_stat, &bi->flags, in hist_iter__branch_callback()
219 bi->from.addr, bi->to.addr); in hist_iter__branch_callback()
221 if (!ui__has_annotation() && !rep->symbol_ipc) in hist_iter__branch_callback()
224 err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); in hist_iter__branch_callback()
228 err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); in hist_iter__branch_callback()
237 if (report->group_set) in setup_forced_leader()
244 struct report *rep = container_of(session->tool, struct report, tool); in process_feature_event()
246 if (event->feat.feat_id < HEADER_LAST_FEATURE) in process_feature_event()
249 if (event->feat.feat_id != HEADER_LAST_FEATURE) { in process_feature_event()
251 event->feat.feat_id); in process_feature_event()
252 return -1; in process_feature_event()
253 } else if (rep->header_only) { in process_feature_event()
262 setup_forced_leader(rep, session->evlist); in process_feature_event()
282 if (perf_time__ranges_skip_sample(rep->ptime_range, rep->range_num, in process_sample_event()
283 sample->time)) { in process_sample_event()
287 if (evswitch__discard(&rep->evswitch, evsel)) in process_sample_event()
293 event->header.type); in process_sample_event()
294 ret = -1; in process_sample_event()
298 if (rep->stitch_lbr) in process_sample_event()
304 if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) in process_sample_event()
309 * A non-synthesized event might not have a branch stack if in process_sample_event()
312 if (!sample->branch_stack) in process_sample_event()
317 } else if (rep->mem_mode) { in process_sample_event()
328 if (ui__has_annotation() || rep->symbol_ipc || rep->total_cycles_mode) { in process_sample_event()
329 hist__account_cycles(sample->branch_stack, &al, sample, in process_sample_event()
330 rep->nonany_branch_mode, in process_sample_event()
331 &rep->total_cycles, evsel); in process_sample_event()
334 ret = hist_entry_iter__add(&iter, &al, rep->max_stack, rep); in process_sample_event()
350 if (rep->show_threads) { in process_read_event()
352 int err = perf_read_values_add_value(&rep->show_threads_values, in process_read_event()
353 event->read.pid, event->read.tid, in process_read_event()
354 evsel->core.idx, in process_read_event()
356 event->read.value); in process_read_event()
368 struct perf_session *session = rep->session; in report__setup_sample_type()
369 u64 sample_type = evlist__combined_sample_type(session->evlist); in report__setup_sample_type()
370 bool is_pipe = perf_data__is_pipe(session->data); in report__setup_sample_type()
373 if (session->itrace_synth_opts->callchain || in report__setup_sample_type()
374 session->itrace_synth_opts->add_callchain || in report__setup_sample_type()
376 perf_header__has_feat(&session->header, HEADER_AUXTRACE) && in report__setup_sample_type()
377 !session->itrace_synth_opts->set)) in report__setup_sample_type()
380 if (session->itrace_synth_opts->last_branch || in report__setup_sample_type()
381 session->itrace_synth_opts->add_last_branch) in report__setup_sample_type()
386 ui__error("Selected --sort parent, but no " in report__setup_sample_type()
388 "'perf record' without -g?\n"); in report__setup_sample_type()
389 return -EINVAL; in report__setup_sample_type()
393 ui__error("Selected -g or --branch-history.\n" in report__setup_sample_type()
395 "Did you call 'perf record' without -g or -b?\n"); in report__setup_sample_type()
396 return -1; in report__setup_sample_type()
404 return -EINVAL; in report__setup_sample_type()
419 ui__error("Selected -b but no branch data. " in report__setup_sample_type()
420 "Did you call perf record without -b?\n"); in report__setup_sample_type()
421 return -1; in report__setup_sample_type()
431 evlist__for_each_entry(session->evlist, evsel) { in report__setup_sample_type()
434 evsel->core.attr.sample_type |= PERF_SAMPLE_DATA_SRC; in report__setup_sample_type()
440 ui__error("Selected --mem-mode but no mem data. " in report__setup_sample_type()
441 "Did you call perf record without -d?\n"); in report__setup_sample_type()
442 return -1; in report__setup_sample_type()
446 callchain_param_setup(sample_type, perf_env__arch(&rep->session->header.env)); in report__setup_sample_type()
448 if (rep->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) { in report__setup_sample_type()
449 ui__warning("Can't find LBR callchain. Switch off --stitch-lbr.\n" in report__setup_sample_type()
450 "Please apply --call-graph lbr when recording.\n"); in report__setup_sample_type()
451 rep->stitch_lbr = false; in report__setup_sample_type()
455 if (!(evlist__combined_branch_type(session->evlist) & PERF_SAMPLE_BRANCH_ANY)) in report__setup_sample_type()
456 rep->nonany_branch_mode = true; in report__setup_sample_type()
478 unsigned long nr_samples = hists->stats.nr_samples; in hists__fprintf_nr_sample_events()
479 u64 nr_events = hists->stats.total_period; in hists__fprintf_nr_sample_events()
483 int socked_id = hists->socket_filter; in hists__fprintf_nr_sample_events()
489 nr_samples = hists->stats.nr_non_filtered_samples; in hists__fprintf_nr_sample_events()
490 nr_events = hists->stats.total_non_filtered_period; in hists__fprintf_nr_sample_events()
503 nr_samples += pos_hists->stats.nr_non_filtered_samples; in hists__fprintf_nr_sample_events()
504 nr_events += pos_hists->stats.total_non_filtered_period; in hists__fprintf_nr_sample_events()
506 nr_samples += pos_hists->stats.nr_samples; in hists__fprintf_nr_sample_events()
507 nr_events += pos_hists->stats.total_period; in hists__fprintf_nr_sample_events()
516 evsel->core.nr_members > 1 ? "s" : "", evname); in hists__fprintf_nr_sample_events()
519 if (rep->time_str) in hists__fprintf_nr_sample_events()
520 ret += fprintf(fp, " (time slices: %s)", rep->time_str); in hists__fprintf_nr_sample_events()
522 if (symbol_conf.show_ref_callgraph && evname && strstr(evname, "call-graph=no")) { in hists__fprintf_nr_sample_events()
526 if (rep->mem_mode) { in hists__fprintf_nr_sample_events()
532 if (socked_id > -1) in hists__fprintf_nr_sample_events()
544 ret = report__browse_block_hists(&rep->block_reports[i++].hist, in evlist__tui_block_hists_browse()
545 rep->min_percent, pos, in evlist__tui_block_hists_browse()
546 &rep->session->header.env); in evlist__tui_block_hists_browse()
560 fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", in evlist__tty_browse_hists()
561 evlist->stats.total_lost_samples); in evlist__tty_browse_hists()
572 if (rep->skip_empty && !hists->stats.nr_samples) in evlist__tty_browse_hists()
575 hists__fprintf_nr_sample_events(hists, rep, evname, stdout); in evlist__tty_browse_hists()
577 if (rep->total_cycles_mode) { in evlist__tty_browse_hists()
581 fprintf(stdout, "%s", buf); in evlist__tty_browse_hists()
582 fprintf(stdout, "#\n"); in evlist__tty_browse_hists()
585 report__browse_block_hists(&rep->block_reports[i - 1].hist, in evlist__tty_browse_hists()
586 rep->min_percent, pos, NULL); in evlist__tty_browse_hists()
590 hists__fprintf(hists, !quiet, 0, 0, rep->min_percent, stdout, in evlist__tty_browse_hists()
593 fprintf(stdout, "\n\n"); in evlist__tty_browse_hists()
597 fprintf(stdout, "#\n# (%s)\n#\n", help); in evlist__tty_browse_hists()
599 if (rep->show_threads) { in evlist__tty_browse_hists()
600 bool style = !strcmp(rep->pretty_printing_style, "raw"); in evlist__tty_browse_hists()
601 perf_read_values_display(stdout, &rep->show_threads_values, in evlist__tty_browse_hists()
603 perf_read_values_destroy(&rep->show_threads_values); in evlist__tty_browse_hists()
607 branch_type_stat_display(stdout, &rep->brtype_stat); in evlist__tty_browse_hists()
614 struct map *kernel_map = machine__kernel_map(&rep->session->machines.host); in report__warn_kptr_restrict()
617 if (evlist__exclude_kernel(rep->session->evlist)) in report__warn_kptr_restrict()
622 (kernel_kmap->ref_reloc_sym == NULL || in report__warn_kptr_restrict()
623 kernel_kmap->ref_reloc_sym->addr == 0))) { in report__warn_kptr_restrict()
650 return -1; in report__gtk_browse_hists()
653 return hist_browser(rep->session->evlist, help, NULL, rep->min_percent); in report__gtk_browse_hists()
659 struct perf_session *session = rep->session; in report__browse_hists()
660 struct evlist *evlist = session->evlist; in report__browse_hists()
661 char *help = NULL, *path = NULL; in report__browse_hists() local
663 path = system_path(TIPDIR); in report__browse_hists()
664 if (perf_tip(&help, path) || help == NULL) { in report__browse_hists()
665 /* fallback for people who don't install perf ;-) */ in report__browse_hists()
666 free(path); in report__browse_hists()
667 path = system_path(DOCDIR); in report__browse_hists()
668 if (perf_tip(&help, path) || help == NULL) in report__browse_hists()
671 free(path); in report__browse_hists()
675 if (rep->total_cycles_mode) { in report__browse_hists()
680 ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent, in report__browse_hists()
681 &session->header.env, true); in report__browse_hists()
702 struct perf_session *session = rep->session; in report__collapse_hists()
703 struct evlist *evlist = session->evlist; in report__collapse_hists()
714 if (perf_data__is_pipe(session->data)) { in report__collapse_hists()
717 return -1; in report__collapse_hists()
721 ui_progress__init(&prog, rep->nr_entries, "Merging related events..."); in report__collapse_hists()
723 evlist__for_each_entry(rep->session->evlist, pos) { in report__collapse_hists()
726 if (pos->core.idx == 0) in report__collapse_hists()
727 hists->symbol_filter_str = rep->symbol_filter_str; in report__collapse_hists()
729 hists->socket_filter = rep->socket_filter; in report__collapse_hists()
735 /* Non-group events are considered as leader */ in report__collapse_hists()
751 struct symbol *sym = he->ms.sym; in hists__resort_cb()
753 if (rep->symbol_ipc && sym && !sym->annotate2) { in hists__resort_cb()
754 struct evsel *evsel = hists_to_evsel(he->hists); in hists__resort_cb()
756 symbol__annotate2(&he->ms, evsel, NULL); in hists__resort_cb()
767 ui_progress__init(&prog, rep->nr_entries, "Sorting events for output..."); in report__output_resort()
769 evlist__for_each_entry(rep->session->evlist, pos) { in report__output_resort()
796 evsel = evlist__id2evsel(rep->session->evlist, sample->id); in count_lost_samples_event()
799 u32 count = event->lost_samples.lost; in count_lost_samples_event()
801 if (event->header.misc & PERF_RECORD_MISC_LOST_SAMPLES_BPF) in count_lost_samples_event()
815 perf_tool__init(&rep->tool, /*ordered_events=*/false); in stats_setup()
816 rep->tool.attr = process_attr; in stats_setup()
817 rep->tool.sample = count_sample_event; in stats_setup()
818 rep->tool.lost_samples = count_lost_samples_event; in stats_setup()
819 rep->tool.event_update = perf_event__process_event_update; in stats_setup()
820 rep->tool.no_warn = true; in stats_setup()
825 struct perf_session *session = rep->session; in stats_print()
827 perf_session__fprintf_nr_events(session, stdout); in stats_print()
828 evlist__fprintf_nr_events(session->evlist, stdout); in stats_print()
834 perf_tool__init(&rep->tool, /*ordered_events=*/true); in tasks_setup()
835 if (rep->mmaps_mode) { in tasks_setup()
836 rep->tool.mmap = perf_event__process_mmap; in tasks_setup()
837 rep->tool.mmap2 = perf_event__process_mmap2; in tasks_setup()
839 rep->tool.attr = process_attr; in tasks_setup()
840 rep->tool.comm = perf_event__process_comm; in tasks_setup()
841 rep->tool.exit = perf_event__process_exit; in tasks_setup()
842 rep->tool.fork = perf_event__process_fork; in tasks_setup()
843 rep->tool.no_warn = true; in tasks_setup()
859 ret = fprintf(args->fp, in maps__fprintf_task_cb()
860 "%*s %" PRIx64 "-%" PRIx64 " %c%c%c%c %08" PRIx64 " %" PRIu64 " %s\n", in maps__fprintf_task_cb()
861 args->indent, "", map__start(map), map__end(map), in maps__fprintf_task_cb()
862 prot & PROT_READ ? 'r' : '-', in maps__fprintf_task_cb()
863 prot & PROT_WRITE ? 'w' : '-', in maps__fprintf_task_cb()
864 prot & PROT_EXEC ? 'x' : '-', in maps__fprintf_task_cb()
867 dso__id_const(dso)->ino, dso__name(dso)); in maps__fprintf_task_cb()
872 args->printed += ret; in maps__fprintf_task_cb()
900 parent_thread = machine__find_thread(machine, -1, thread__ppid(thread)); in thread_level()
927 * - init with a TID 1 and a parent of 0
928 * - systemd with a TID 3000 and a parent of init/1
929 * - systemd child thread with TID 4000, the parent is 3000
930 * - NetworkManager is a child of init with a TID of 3500.
937 struct thread *a = task_a->thread; in task_list_cmp()
938 struct thread *b = task_b->thread; in task_list_cmp()
947 return -1; in task_list_cmp()
954 return thread__tid(a) < thread__tid(b) ? -1 : 1; in task_list_cmp()
965 for (int i = level_a; i > level_b; i--) { in task_list_cmp()
966 struct thread *parent = machine__find_thread(machine, -1, thread__ppid(a)); in task_list_cmp()
972 return -1; in task_list_cmp()
976 for (int i = level_b; i > level_a; i--) { in task_list_cmp()
977 struct thread *parent = machine__find_thread(machine, -1, thread__ppid(b)); in task_list_cmp()
991 parent = machine__find_thread(machine, -1, thread__ppid(a)); in task_list_cmp()
996 parent = machine__find_thread(machine, -1, thread__ppid(b)); in task_list_cmp()
1005 return !a && !b ? 0 : (!a ? -1 : 1); in task_list_cmp()
1009 /* a is a child of b or vice-versa, deeper levels appear later. */ in task_list_cmp()
1010 res = level_a < level_b ? -1 : (level_a > level_b ? 1 : 0); in task_list_cmp()
1013 res = thread__tid(a) < thread__tid(b) ? -1 : 1; in task_list_cmp()
1022 struct machine *machine = &rep->session->machines.host; in tasks_print()
1035 task__print_level(machine, task->thread, fp); in tasks_print()
1044 struct perf_session *session = rep->session; in __cmd_report()
1046 struct perf_data *data = session->data; in __cmd_report()
1050 if (rep->cpu_list) { in __cmd_report()
1051 ret = perf_session__cpu_bitmap(session, rep->cpu_list, in __cmd_report()
1052 rep->cpu_bitmap); in __cmd_report()
1057 session->itrace_synth_opts->cpu_bitmap = rep->cpu_bitmap; in __cmd_report()
1060 if (rep->show_threads) { in __cmd_report()
1061 ret = perf_read_values_init(&rep->show_threads_values); in __cmd_report()
1072 if (rep->stats_mode) in __cmd_report()
1075 if (rep->tasks_mode) in __cmd_report()
1084 evlist__check_mem_load_aux(session->evlist); in __cmd_report()
1086 if (rep->stats_mode) in __cmd_report()
1089 if (rep->tasks_mode) in __cmd_report()
1090 return tasks_print(rep, stdout); in __cmd_report()
1094 evlist__for_each_entry(session->evlist, pos) in __cmd_report()
1095 rep->nr_entries += evsel__hists(pos)->nr_entries; in __cmd_report()
1099 perf_session__fprintf(session, stdout); in __cmd_report()
1102 perf_session__fprintf_dsos(session, stdout); in __cmd_report()
1123 rep->nr_entries = 0; in __cmd_report()
1124 evlist__for_each_entry(session->evlist, pos) in __cmd_report()
1125 rep->nr_entries += evsel__hists(pos)->nr_entries; in __cmd_report()
1127 if (rep->nr_entries == 0) { in __cmd_report()
1128 ui__error("The %s data has no samples!\n", data->path); in __cmd_report()
1134 if (rep->total_cycles_mode) { in __cmd_report()
1143 if (session->evlist->nr_br_cntr > 0) in __cmd_report()
1149 rep->block_reports = block_info__create_report(session->evlist, in __cmd_report()
1150 rep->total_cycles, in __cmd_report()
1152 &rep->nr_block_reports); in __cmd_report()
1153 if (!rep->block_reports) in __cmd_report()
1154 return -1; in __cmd_report()
1163 struct callchain_param *callchain = opt->value; in report_parse_callchain_opt()
1165 callchain->enabled = !unset; in report_parse_callchain_opt()
1167 * --no-call-graph in report_parse_callchain_opt()
1171 callchain->mode = CHAIN_NONE; in report_parse_callchain_opt()
1182 unsigned long *time_q = opt->value; in parse_time_quantum()
1190 return -1; in parse_time_quantum()
1211 return -1; in parse_time_quantum()
1223 pr_err("Invalid --ignore-callees regex: %s\n%s", arg, buf); in report_parse_ignore_callees_opt()
1224 return -1; in report_parse_ignore_callees_opt()
1236 int *branch_mode = opt->value; in parse_branch_mode()
1246 struct report *rep = opt->value; in parse_percent_limit()
1249 rep->min_percent = pcnt; in parse_percent_limit()
1270 callchain_param_setup(sample_type, perf_env__arch((*pevlist)->env)); in process_attr()
1280 int branch_mode = -1; in cmd_report()
1295 .socket_filter = -1, in cmd_report()
1307 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, in cmd_report()
1314 OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux, in cmd_report()
1320 "load module symbols - WARNING: use only with -k and LIVE kernel"), in cmd_report()
1321 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, in cmd_report()
1324 "Show per-thread event counters"), in cmd_report()
1336 OPT_BOOLEAN(0, "header-only", &report.header_only, in cmd_report()
1342 OPT_BOOLEAN(0, "show-cpu-utilization", &symbol_conf.show_cpu_utilization, in cmd_report()
1347 "regex filter to identify parent, see: '--sort parent'"), in cmd_report()
1348 OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, in cmd_report()
1349 "Only display entries with parent-match"), in cmd_report()
1350 OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param, in cmd_report()
1356 "Enabled by default, use --no-children to disable."), in cmd_report()
1357 OPT_INTEGER(0, "max-stack", &report.max_stack, in cmd_report()
1363 OPT_CALLBACK(0, "ignore-callees", NULL, "regex", in cmd_report()
1376 OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter", in cmd_report()
1378 OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, in cmd_report()
1381 OPT_STRING_NOEMPTY('t', "field-separator", &symbol_conf.field_sep, "separator", in cmd_report()
1384 OPT_BOOLEAN('U', "hide-unresolved", &symbol_conf.hide_unresolved, in cmd_report()
1391 OPT_BOOLEAN('I', "show-info", &report.show_full_info, in cmd_report()
1395 OPT_BOOLEAN(0, "asm-raw", &annotate_opts.show_asm_raw, in cmd_report()
1397 OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", in cmd_report()
1398 "Specify disassembler style (e.g. -M intel for intel syntax)"), in cmd_report()
1400 "Add prefix to source file path names in programs (with --prefix-strip)"), in cmd_report()
1401 OPT_STRING(0, "prefix-strip", &annotate_opts.prefix_strip, "N", in cmd_report()
1402 "Strip first N entries of source file path name in programs (with --prefix)"), in cmd_report()
1403 OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, in cmd_report()
1407 OPT_INTEGER(0, "group-sort-idx", &symbol_conf.group_sort_idx, in cmd_report()
1411 OPT_CALLBACK_NOOPT('b', "branch-stack", &branch_mode, "", in cmd_report()
1414 OPT_BOOLEAN(0, "branch-history", &branch_call_mode, in cmd_report()
1416 OPT_STRING(0, "objdump", &objdump_path, "path", in cmd_report()
1418 OPT_STRING(0, "addr2line", &addr2line_path, "path", in cmd_report()
1422 OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, in cmd_report()
1424 OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"), in cmd_report()
1427 OPT_CALLBACK(0, "percent-limit", &report, "percent", in cmd_report()
1434 OPT_BOOLEAN(0, "full-source-path", &srcline_full_filename, in cmd_report()
1435 "Show full source file name path for source lines"), in cmd_report()
1436 OPT_BOOLEAN(0, "show-ref-call-graph", &symbol_conf.show_ref_callgraph, in cmd_report()
1438 OPT_BOOLEAN(0, "stitch-lbr", &report.stitch_lbr, in cmd_report()
1440 OPT_INTEGER(0, "socket-filter", &report.socket_filter, in cmd_report()
1442 OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace, in cmd_report()
1446 OPT_CALLBACK_DEFAULT(0, "stdio-color", NULL, "mode", in cmd_report()
1447 "'always' (default), 'never' or 'auto' only applicable to --stdio mode", in cmd_report()
1453 OPT_CALLBACK(0, "percent-type", &annotate_opts, "local-period", in cmd_report()
1454 "Set percent type local/global-period/hits", in cmd_report()
1457 OPT_CALLBACK(0, "time-quantum", &symbol_conf.time_quantum, "time (ms|us|ns|s)", in cmd_report()
1461 OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode, in cmd_report()
1463 OPT_BOOLEAN(0, "disable-order", &report.disable_order, in cmd_report()
1465 OPT_BOOLEAN(0, "skip-empty", &report.skip_empty, in cmd_report()
1481 * the data file. Off-cpu events are synthesized after other events and in cmd_report()
1507 return -ENOMEM; in cmd_report()
1512 return -ENOMEM; in cmd_report()
1517 return -ENOMEM; in cmd_report()
1521 ret = -EINVAL; in cmd_report()
1549 input_name = "-"; in cmd_report()
1554 data.path = input_name; in cmd_report()
1589 ret = evswitch__init(&report.evswitch, session->evlist, stderr); in cmd_report()
1593 if (zstd_init(&(session->zstd_data), 0) < 0) in cmd_report()
1597 ordered_events__set_alloc_size(&session->ordered_events, in cmd_report()
1601 session->itrace_synth_opts = &itrace_synth_opts; in cmd_report()
1605 has_br_stack = perf_header__has_feat(&session->header, in cmd_report()
1607 if (evlist__combined_sample_type(session->evlist) & PERF_SAMPLE_STACK_USER) in cmd_report()
1610 setup_forced_leader(&report, session->evlist); in cmd_report()
1612 if (symbol_conf.group_sort_idx && evlist__nr_groups(session->evlist) == 0) { in cmd_report()
1613 parse_options_usage(NULL, options, "group-sort-idx", 0); in cmd_report()
1614 ret = -EINVAL; in cmd_report()
1628 * -1 means default, so decide based on the file having branch data. in cmd_report()
1631 if (((branch_mode == -1 && has_br_stack) || branch_mode == 1) && in cmd_report()
1659 pr_err("Error: --hierarchy and --fields options cannot be used together\n"); in cmd_report()
1679 /* Force tty output for header output and per-thread stat. */ in cmd_report()
1689 pr_err("Error: --tasks and --mmaps can't be used together with --stats\n"); in cmd_report()
1710 if (strcmp(input_name, "-") != 0) in cmd_report()
1739 (setup_sorting(session->evlist) < 0)) { in cmd_report()
1749 perf_session__fprintf_info(session, stdout, in cmd_report()
1764 fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n", in cmd_report()
1765 stdout); in cmd_report()
1795 if (symbol__init(&session->header.env) < 0) in cmd_report()
1812 if (session->tevent.pevent && in cmd_report()
1813 tep_set_function_resolver(session->tevent.pevent, in cmd_report()
1815 &session->machines.host) < 0) { in cmd_report()
1818 return -1; in cmd_report()
1821 sort__setup_elide(stdout); in cmd_report()
1845 zstd_fini(&(session->zstd_data)); in cmd_report()