diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-11 20:10:26 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 07:37:58 -0500 |
commit | 246d4ce8107ea16521384c8b2a8fcff354ef2b7c (patch) | |
tree | 07fbf7ad718cb25b8520d5ad28254c681459ca84 | |
parent | 10d0f086df77f3ff259b46cb501362dbaf2c7989 (diff) |
perf session: Remove superfluous callchain_cursor member
Since we have it in evsel->hists.callchain_cursor, remove it from
perf_session.
One more step in disentangling several places from requiring a
perf_session pointer.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-rxr5dj3di7ckyfmnz0naku1z@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-report.c | 5 | ||||
-rw-r--r-- | tools/perf/builtin-script.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/util/session.c | 12 | ||||
-rw-r--r-- | tools/perf/util/session.h | 5 |
5 files changed, 14 insertions, 14 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 758a287fc07a..b7ab373b9acc 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -65,7 +65,7 @@ static int perf_session__add_hist_entry(struct perf_session *session, | |||
65 | struct hist_entry *he; | 65 | struct hist_entry *he; |
66 | 66 | ||
67 | if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) { | 67 | if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) { |
68 | err = perf_session__resolve_callchain(session, al->thread, | 68 | err = perf_session__resolve_callchain(session, evsel, al->thread, |
69 | sample->callchain, &parent); | 69 | sample->callchain, &parent); |
70 | if (err) | 70 | if (err) |
71 | return err; | 71 | return err; |
@@ -76,7 +76,8 @@ static int perf_session__add_hist_entry(struct perf_session *session, | |||
76 | return -ENOMEM; | 76 | return -ENOMEM; |
77 | 77 | ||
78 | if (symbol_conf.use_callchain) { | 78 | if (symbol_conf.use_callchain) { |
79 | err = callchain_append(he->callchain, &session->callchain_cursor, | 79 | err = callchain_append(he->callchain, |
80 | &evsel->hists.callchain_cursor, | ||
80 | sample->period); | 81 | sample->period); |
81 | if (err) | 82 | if (err) |
82 | return err; | 83 | return err; |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 2f62a2952269..47545e9c9b27 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -384,7 +384,7 @@ static void process_event(union perf_event *event __unused, | |||
384 | printf(" "); | 384 | printf(" "); |
385 | else | 385 | else |
386 | printf("\n"); | 386 | printf("\n"); |
387 | perf_session__print_ip(event, sample, session, | 387 | perf_session__print_ip(event, evsel, sample, session, |
388 | PRINT_FIELD(SYM), PRINT_FIELD(DSO)); | 388 | PRINT_FIELD(SYM), PRINT_FIELD(DSO)); |
389 | } | 389 | } |
390 | 390 | ||
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 04288ee223ed..9b3bbb40d46f 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -777,7 +777,7 @@ static void perf_event__process_sample(const union perf_event *event, | |||
777 | 777 | ||
778 | if ((sort__has_parent || symbol_conf.use_callchain) && | 778 | if ((sort__has_parent || symbol_conf.use_callchain) && |
779 | sample->callchain) { | 779 | sample->callchain) { |
780 | err = perf_session__resolve_callchain(session, al.thread, | 780 | err = perf_session__resolve_callchain(session, evsel, al.thread, |
781 | sample->callchain, &parent); | 781 | sample->callchain, &parent); |
782 | if (err) | 782 | if (err) |
783 | return; | 783 | return; |
@@ -790,7 +790,7 @@ static void perf_event__process_sample(const union perf_event *event, | |||
790 | } | 790 | } |
791 | 791 | ||
792 | if (symbol_conf.use_callchain) { | 792 | if (symbol_conf.use_callchain) { |
793 | err = callchain_append(he->callchain, &session->callchain_cursor, | 793 | err = callchain_append(he->callchain, &evsel->hists.callchain_cursor, |
794 | sample->period); | 794 | sample->period); |
795 | if (err) | 795 | if (err) |
796 | return; | 796 | return; |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 6e7d5f54b37d..734358b51ed1 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -216,7 +216,7 @@ static bool symbol__match_parent_regex(struct symbol *sym) | |||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | int perf_session__resolve_callchain(struct perf_session *self, | 219 | int perf_session__resolve_callchain(struct perf_session *self, struct perf_evsel *evsel, |
220 | struct thread *thread, | 220 | struct thread *thread, |
221 | struct ip_callchain *chain, | 221 | struct ip_callchain *chain, |
222 | struct symbol **parent) | 222 | struct symbol **parent) |
@@ -225,7 +225,7 @@ int perf_session__resolve_callchain(struct perf_session *self, | |||
225 | unsigned int i; | 225 | unsigned int i; |
226 | int err; | 226 | int err; |
227 | 227 | ||
228 | callchain_cursor_reset(&self->callchain_cursor); | 228 | callchain_cursor_reset(&evsel->hists.callchain_cursor); |
229 | 229 | ||
230 | for (i = 0; i < chain->nr; i++) { | 230 | for (i = 0; i < chain->nr; i++) { |
231 | u64 ip; | 231 | u64 ip; |
@@ -261,7 +261,7 @@ int perf_session__resolve_callchain(struct perf_session *self, | |||
261 | break; | 261 | break; |
262 | } | 262 | } |
263 | 263 | ||
264 | err = callchain_cursor_append(&self->callchain_cursor, | 264 | err = callchain_cursor_append(&evsel->hists.callchain_cursor, |
265 | ip, al.map, al.sym); | 265 | ip, al.map, al.sym); |
266 | if (err) | 266 | if (err) |
267 | return err; | 267 | return err; |
@@ -1254,14 +1254,14 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session, | |||
1254 | return NULL; | 1254 | return NULL; |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | void perf_session__print_ip(union perf_event *event, | 1257 | void perf_session__print_ip(union perf_event *event, struct perf_evsel *evsel, |
1258 | struct perf_sample *sample, | 1258 | struct perf_sample *sample, |
1259 | struct perf_session *session, | 1259 | struct perf_session *session, |
1260 | int print_sym, int print_dso) | 1260 | int print_sym, int print_dso) |
1261 | { | 1261 | { |
1262 | struct addr_location al; | 1262 | struct addr_location al; |
1263 | const char *symname, *dsoname; | 1263 | const char *symname, *dsoname; |
1264 | struct callchain_cursor *cursor = &session->callchain_cursor; | 1264 | struct callchain_cursor *cursor = &evsel->hists.callchain_cursor; |
1265 | struct callchain_cursor_node *node; | 1265 | struct callchain_cursor_node *node; |
1266 | 1266 | ||
1267 | if (perf_event__preprocess_sample(event, session, &al, sample, | 1267 | if (perf_event__preprocess_sample(event, session, &al, sample, |
@@ -1273,7 +1273,7 @@ void perf_session__print_ip(union perf_event *event, | |||
1273 | 1273 | ||
1274 | if (symbol_conf.use_callchain && sample->callchain) { | 1274 | if (symbol_conf.use_callchain && sample->callchain) { |
1275 | 1275 | ||
1276 | if (perf_session__resolve_callchain(session, al.thread, | 1276 | if (perf_session__resolve_callchain(session, evsel, al.thread, |
1277 | sample->callchain, NULL) != 0) { | 1277 | sample->callchain, NULL) != 0) { |
1278 | if (verbose) | 1278 | if (verbose) |
1279 | error("Failed to resolve callchain. Skipping\n"); | 1279 | error("Failed to resolve callchain. Skipping\n"); |
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 13bd5e0a0691..d2f430367713 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -50,7 +50,6 @@ struct perf_session { | |||
50 | int cwdlen; | 50 | int cwdlen; |
51 | char *cwd; | 51 | char *cwd; |
52 | struct ordered_samples ordered_samples; | 52 | struct ordered_samples ordered_samples; |
53 | struct callchain_cursor callchain_cursor; | ||
54 | char filename[0]; | 53 | char filename[0]; |
55 | }; | 54 | }; |
56 | 55 | ||
@@ -100,7 +99,7 @@ int __perf_session__process_events(struct perf_session *self, | |||
100 | int perf_session__process_events(struct perf_session *self, | 99 | int perf_session__process_events(struct perf_session *self, |
101 | struct perf_event_ops *event_ops); | 100 | struct perf_event_ops *event_ops); |
102 | 101 | ||
103 | int perf_session__resolve_callchain(struct perf_session *self, | 102 | int perf_session__resolve_callchain(struct perf_session *self, struct perf_evsel *evsel, |
104 | struct thread *thread, | 103 | struct thread *thread, |
105 | struct ip_callchain *chain, | 104 | struct ip_callchain *chain, |
106 | struct symbol **parent); | 105 | struct symbol **parent); |
@@ -169,7 +168,7 @@ static inline int perf_session__parse_sample(struct perf_session *session, | |||
169 | struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session, | 168 | struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session, |
170 | unsigned int type); | 169 | unsigned int type); |
171 | 170 | ||
172 | void perf_session__print_ip(union perf_event *event, | 171 | void perf_session__print_ip(union perf_event *event, struct perf_evsel *evsel, |
173 | struct perf_sample *sample, | 172 | struct perf_sample *sample, |
174 | struct perf_session *session, | 173 | struct perf_session *session, |
175 | int print_sym, int print_dso); | 174 | int print_sym, int print_dso); |