diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
| -rw-r--r-- | tools/perf/builtin-report.c | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 359205782964..55fc1f46892a 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -107,7 +107,7 @@ static int perf_session__add_hist_entry(struct perf_session *self, | |||
| 107 | goto out_free_syms; | 107 | goto out_free_syms; |
| 108 | err = 0; | 108 | err = 0; |
| 109 | if (symbol_conf.use_callchain) { | 109 | if (symbol_conf.use_callchain) { |
| 110 | err = append_chain(he->callchain, data->callchain, syms); | 110 | err = append_chain(he->callchain, data->callchain, syms, data->period); |
| 111 | if (err) | 111 | if (err) |
| 112 | goto out_free_syms; | 112 | goto out_free_syms; |
| 113 | } | 113 | } |
| @@ -155,30 +155,7 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
| 155 | struct addr_location al; | 155 | struct addr_location al; |
| 156 | struct perf_event_attr *attr; | 156 | struct perf_event_attr *attr; |
| 157 | 157 | ||
| 158 | event__parse_sample(event, session->sample_type, &data); | 158 | if (event__preprocess_sample(event, session, &al, &data, NULL) < 0) { |
| 159 | |||
| 160 | dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc, | ||
| 161 | data.pid, data.tid, data.ip, data.period); | ||
| 162 | |||
| 163 | if (session->sample_type & PERF_SAMPLE_CALLCHAIN) { | ||
| 164 | unsigned int i; | ||
| 165 | |||
| 166 | dump_printf("... chain: nr:%Lu\n", data.callchain->nr); | ||
| 167 | |||
| 168 | if (!ip_callchain__valid(data.callchain, event)) { | ||
| 169 | pr_debug("call-chain problem with event, " | ||
| 170 | "skipping it.\n"); | ||
| 171 | return 0; | ||
| 172 | } | ||
| 173 | |||
| 174 | if (dump_trace) { | ||
| 175 | for (i = 0; i < data.callchain->nr; i++) | ||
| 176 | dump_printf("..... %2d: %016Lx\n", | ||
| 177 | i, data.callchain->ips[i]); | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 181 | if (event__preprocess_sample(event, session, &al, NULL) < 0) { | ||
| 182 | fprintf(stderr, "problem processing %d event, skipping it.\n", | 159 | fprintf(stderr, "problem processing %d event, skipping it.\n", |
| 183 | event->header.type); | 160 | event->header.type); |
| 184 | return -1; | 161 | return -1; |
| @@ -371,7 +348,18 @@ static int __cmd_report(void) | |||
| 371 | hists__tty_browse_tree(&session->hists_tree, help); | 348 | hists__tty_browse_tree(&session->hists_tree, help); |
| 372 | 349 | ||
| 373 | out_delete: | 350 | out_delete: |
| 374 | perf_session__delete(session); | 351 | /* |
| 352 | * Speed up the exit process, for large files this can | ||
| 353 | * take quite a while. | ||
| 354 | * | ||
| 355 | * XXX Enable this when using valgrind or if we ever | ||
| 356 | * librarize this command. | ||
| 357 | * | ||
| 358 | * Also experiment with obstacks to see how much speed | ||
| 359 | * up we'll get here. | ||
| 360 | * | ||
| 361 | * perf_session__delete(session); | ||
| 362 | */ | ||
| 375 | return ret; | 363 | return ret; |
| 376 | } | 364 | } |
| 377 | 365 | ||
| @@ -464,8 +452,6 @@ static const struct option options[] = { | |||
| 464 | "pretty printing style key: normal raw"), | 452 | "pretty printing style key: normal raw"), |
| 465 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", | 453 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", |
| 466 | "sort by key(s): pid, comm, dso, symbol, parent"), | 454 | "sort by key(s): pid, comm, dso, symbol, parent"), |
| 467 | OPT_BOOLEAN('P', "full-paths", &symbol_conf.full_paths, | ||
| 468 | "Don't shorten the pathnames taking into account the cwd"), | ||
| 469 | OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, | 455 | OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, |
| 470 | "Show sample percentage for different cpu modes"), | 456 | "Show sample percentage for different cpu modes"), |
| 471 | OPT_STRING('p', "parent", &parent_pattern, "regex", | 457 | OPT_STRING('p', "parent", &parent_pattern, "regex", |
| @@ -503,8 +489,24 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
| 503 | * so don't allocate extra space that won't be used in the stdio | 489 | * so don't allocate extra space that won't be used in the stdio |
| 504 | * implementation. | 490 | * implementation. |
| 505 | */ | 491 | */ |
| 506 | if (use_browser > 0) | 492 | if (use_browser > 0) { |
| 507 | symbol_conf.priv_size = sizeof(struct sym_priv); | 493 | symbol_conf.priv_size = sizeof(struct sym_priv); |
| 494 | /* | ||
| 495 | * For searching by name on the "Browse map details". | ||
| 496 | * providing it only in verbose mode not to bloat too | ||
| 497 | * much struct symbol. | ||
| 498 | */ | ||
| 499 | if (verbose) { | ||
| 500 | /* | ||
| 501 | * XXX: Need to provide a less kludgy way to ask for | ||
| 502 | * more space per symbol, the u32 is for the index on | ||
| 503 | * the ui browser. | ||
| 504 | * See symbol__browser_index. | ||
| 505 | */ | ||
| 506 | symbol_conf.priv_size += sizeof(u32); | ||
| 507 | symbol_conf.sort_by_name = true; | ||
| 508 | } | ||
| 509 | } | ||
| 508 | 510 | ||
| 509 | if (symbol__init() < 0) | 511 | if (symbol__init() < 0) |
| 510 | return -1; | 512 | return -1; |
