builtin-report.c (fb2baceb5a64990163e93b77ee205d0173202ee6) builtin-report.c (efad14150a0b4429f37da7245001a8096ef7ee38)
1/*
2 * builtin-report.c
3 *
4 * Builtin report command: Analyze the perf.data input file,
5 * look up and read DSOs and symbol information and display
6 * a histogram of results, along various sorting keys.
7 */
8#include "builtin.h"

--- 307 unchanged lines hidden (view full) ---

316 struct hists *hists = &pos->hists;
317
318 hists__collapse_resort(hists);
319 hists__output_resort(hists);
320 nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE];
321 }
322
323 if (nr_samples == 0) {
1/*
2 * builtin-report.c
3 *
4 * Builtin report command: Analyze the perf.data input file,
5 * look up and read DSOs and symbol information and display
6 * a histogram of results, along various sorting keys.
7 */
8#include "builtin.h"

--- 307 unchanged lines hidden (view full) ---

316 struct hists *hists = &pos->hists;
317
318 hists__collapse_resort(hists);
319 hists__output_resort(hists);
320 nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE];
321 }
322
323 if (nr_samples == 0) {
324 ui__warning("The %s file has no samples!\n",
325 rep->input_name);
324 ui__warning("The %s file has no samples!\n", session->filename);
326 goto out_delete;
327 }
328
329 if (use_browser > 0) {
330 perf_evlist__tui_browse_hists(session->evlist, help,
331 NULL, NULL, 0);
332 } else
333 perf_evlist__tty_browse_hists(session->evlist, rep, help);

--- 91 unchanged lines hidden (view full) ---

425 fprintf(stderr, "Can't register callchain params\n");
426 return -1;
427 }
428 return 0;
429}
430
431int cmd_report(int argc, const char **argv, const char *prefix __used)
432{
325 goto out_delete;
326 }
327
328 if (use_browser > 0) {
329 perf_evlist__tui_browse_hists(session->evlist, help,
330 NULL, NULL, 0);
331 } else
332 perf_evlist__tty_browse_hists(session->evlist, rep, help);

--- 91 unchanged lines hidden (view full) ---

424 fprintf(stderr, "Can't register callchain params\n");
425 return -1;
426 }
427 return 0;
428}
429
430int cmd_report(int argc, const char **argv, const char *prefix __used)
431{
432 struct stat st;
433 char callchain_default_opt[] = "fractal,0.5,callee";
434 const char * const report_usage[] = {
435 "perf report [<options>]",
436 NULL
437 };
438 struct perf_report report = {
439 .tool = {
440 .sample = process_sample_event,

--- 5 unchanged lines hidden (view full) ---

446 .read = process_read_event,
447 .attr = perf_event__process_attr,
448 .event_type = perf_event__process_event_type,
449 .tracing_data = perf_event__process_tracing_data,
450 .build_id = perf_event__process_build_id,
451 .ordered_samples = true,
452 .ordering_requires_timestamps = true,
453 },
433 char callchain_default_opt[] = "fractal,0.5,callee";
434 const char * const report_usage[] = {
435 "perf report [<options>]",
436 NULL
437 };
438 struct perf_report report = {
439 .tool = {
440 .sample = process_sample_event,

--- 5 unchanged lines hidden (view full) ---

446 .read = process_read_event,
447 .attr = perf_event__process_attr,
448 .event_type = perf_event__process_event_type,
449 .tracing_data = perf_event__process_tracing_data,
450 .build_id = perf_event__process_build_id,
451 .ordered_samples = true,
452 .ordering_requires_timestamps = true,
453 },
454 .input_name = "perf.data",
455 .pretty_printing_style = "normal",
456 };
457 const struct option options[] = {
458 OPT_STRING('i', "input", &report.input_name, "file",
459 "input file name"),
460 OPT_INCR('v', "verbose", &verbose,
461 "be more verbose (show symbol address, etc)"),
462 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,

--- 63 unchanged lines hidden (view full) ---

526 if (report.use_stdio)
527 use_browser = 0;
528 else if (report.use_tui)
529 use_browser = 1;
530
531 if (report.inverted_callchain)
532 callchain_param.order = ORDER_CALLER;
533
454 .pretty_printing_style = "normal",
455 };
456 const struct option options[] = {
457 OPT_STRING('i', "input", &report.input_name, "file",
458 "input file name"),
459 OPT_INCR('v', "verbose", &verbose,
460 "be more verbose (show symbol address, etc)"),
461 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,

--- 63 unchanged lines hidden (view full) ---

525 if (report.use_stdio)
526 use_browser = 0;
527 else if (report.use_tui)
528 use_browser = 1;
529
530 if (report.inverted_callchain)
531 callchain_param.order = ORDER_CALLER;
532
533 if (!report.input_name || !strlen(report.input_name)) {
534 if (!fstat(STDIN_FILENO, &st) && S_ISFIFO(st.st_mode))
535 report.input_name = "-";
536 else
537 report.input_name = "perf.data";
538 }
539
534 if (strcmp(report.input_name, "-") != 0)
535 setup_browser(true);
536 else
537 use_browser = 0;
540 if (strcmp(report.input_name, "-") != 0)
541 setup_browser(true);
542 else
543 use_browser = 0;
544
538 /*
539 * Only in the newt browser we are doing integrated annotation,
540 * so don't allocate extra space that won't be used in the stdio
541 * implementation.
542 */
543 if (use_browser > 0) {
544 symbol_conf.priv_size = sizeof(struct annotation);
545 report.annotate_init = symbol__annotate_init;

--- 48 unchanged lines hidden ---
545 /*
546 * Only in the newt browser we are doing integrated annotation,
547 * so don't allocate extra space that won't be used in the stdio
548 * implementation.
549 */
550 if (use_browser > 0) {
551 symbol_conf.priv_size = sizeof(struct annotation);
552 report.annotate_init = symbol__annotate_init;

--- 48 unchanged lines hidden ---