diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-06-03 10:43:03 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-06-03 10:43:03 +0200 |
commit | aef29bf20bd79c73992ab23d5067e9f0448b466e (patch) | |
tree | 3eaab6efdc123e13e688a8150c8b57e128982da4 /tools/perf/util/session.c | |
parent | 27eb4a1e4a56afacb0540c24084b9e0342f9956b (diff) | |
parent | 7cec0922389e080d11ec43dd23aa778e136bd1e1 (diff) | |
download | blackbird-op-linux-aef29bf20bd79c73992ab23d5067e9f0448b466e.tar.gz blackbird-op-linux-aef29bf20bd79c73992ab23d5067e9f0448b466e.zip |
Merge branch 'perf/core' of ssh://k/pub/scm/linux/kernel/git/acme/linux into perf/core
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 73 |
1 files changed, 49 insertions, 24 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 64500fc78799..b723f211881c 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -58,6 +58,16 @@ static int perf_session__open(struct perf_session *self, bool force) goto out_close; } + if (!perf_evlist__valid_sample_type(self->evlist)) { + pr_err("non matching sample_type"); + goto out_close; + } + + if (!perf_evlist__valid_sample_id_all(self->evlist)) { + pr_err("non matching sample_id_all"); + goto out_close; + } + self->size = input_stat.st_size; return 0; @@ -97,7 +107,7 @@ out: void perf_session__update_sample_type(struct perf_session *self) { self->sample_type = perf_evlist__sample_type(self->evlist); - self->sample_size = perf_sample_size(self->sample_type); + self->sample_size = __perf_evsel__sample_size(self->sample_type); self->sample_id_all = perf_evlist__sample_id_all(self->evlist); perf_session__id_header_size(self); } @@ -698,9 +708,9 @@ static void dump_sample(struct perf_session *session, union perf_event *event, if (!dump_trace) return; - printf("(IP, %d): %d/%d: %#" PRIx64 " period: %" PRIu64 "\n", + printf("(IP, %d): %d/%d: %#" PRIx64 " period: %" PRIu64 " addr: %#" PRIx64 "\n", event->header.misc, sample->pid, sample->tid, sample->ip, - sample->period); + sample->period, sample->addr); if (session->sample_type & PERF_SAMPLE_CALLCHAIN) callchain__printf(sample); @@ -1192,9 +1202,10 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session, return NULL; } -void perf_session__print_symbols(union perf_event *event, - struct perf_sample *sample, - struct perf_session *session) +void perf_session__print_ip(union perf_event *event, + struct perf_sample *sample, + struct perf_session *session, + int print_sym, int print_dso) { struct addr_location al; const char *symname, *dsoname; @@ -1223,32 +1234,46 @@ void perf_session__print_symbols(union perf_event *event, if (!node) break; - if (node->sym && node->sym->name) - symname = node->sym->name; - else - symname = ""; + printf("\t%16" PRIx64, node->ip); + if (print_sym) { + if (node->sym && node->sym->name) + symname = node->sym->name; + else + symname = ""; - if (node->map && node->map->dso && node->map->dso->name) - dsoname = node->map->dso->name; - else - dsoname = ""; + printf(" %s", symname); + } + if (print_dso) { + if (node->map && node->map->dso && node->map->dso->name) + dsoname = node->map->dso->name; + else + dsoname = ""; - printf("\t%16" PRIx64 " %s (%s)\n", node->ip, symname, dsoname); + printf(" (%s)", dsoname); + } + printf("\n"); callchain_cursor_advance(cursor); } } else { - if (al.sym && al.sym->name) - symname = al.sym->name; - else - symname = ""; + printf("%16" PRIx64, al.addr); + if (print_sym) { + if (al.sym && al.sym->name) + symname = al.sym->name; + else + symname = ""; - if (al.map && al.map->dso && al.map->dso->name) - dsoname = al.map->dso->name; - else - dsoname = ""; + printf(" %s", symname); + } - printf("%16" PRIx64 " %s (%s)", al.addr, symname, dsoname); + if (print_dso) { + if (al.map && al.map->dso && al.map->dso->name) + dsoname = al.map->dso->name; + else + dsoname = ""; + + printf(" (%s)", dsoname); + } } } |