aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-11 20:10:26 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:37:58 -0500
commit246d4ce8107ea16521384c8b2a8fcff354ef2b7c (patch)
tree07fbf7ad718cb25b8520d5ad28254c681459ca84 /tools/perf/util
parent10d0f086df77f3ff259b46cb501362dbaf2c7989 (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>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/session.c12
-rw-r--r--tools/perf/util/session.h5
2 files changed, 8 insertions, 9 deletions
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
219int perf_session__resolve_callchain(struct perf_session *self, 219int 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
1257void perf_session__print_ip(union perf_event *event, 1257void 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,
100int perf_session__process_events(struct perf_session *self, 99int perf_session__process_events(struct perf_session *self,
101 struct perf_event_ops *event_ops); 100 struct perf_event_ops *event_ops);
102 101
103int perf_session__resolve_callchain(struct perf_session *self, 102int 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,
169struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session, 168struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
170 unsigned int type); 169 unsigned int type);
171 170
172void perf_session__print_ip(union perf_event *event, 171void 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);