aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2015-01-29 03:06:43 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-01-29 14:36:32 -0500
commit4ac30cf74b308fb01338e660d3471cd490a7958a (patch)
treeac57740782b921747bb474bf93654c36fac356af /tools
parentf1f13af99a903ae873f5373e965508e0486c1c29 (diff)
perf tools: Do not use __perf_session__process_events() directly
It's only used for perf record to process build-id because its file size it's not fixed at this time due to remaining header features. However data offset and size is available so that we can use the perf_session__process_events() once we set the file size as the current offset like for now. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1422518843-25818-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-record.c7
-rw-r--r--tools/perf/util/session.c6
-rw-r--r--tools/perf/util/session.h3
3 files changed, 6 insertions, 10 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 8648c6d3003d..1134de22979e 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -194,12 +194,13 @@ static int process_buildids(struct record *rec)
194{ 194{
195 struct perf_data_file *file = &rec->file; 195 struct perf_data_file *file = &rec->file;
196 struct perf_session *session = rec->session; 196 struct perf_session *session = rec->session;
197 u64 start = session->header.data_offset;
198 197
199 u64 size = lseek(file->fd, 0, SEEK_CUR); 198 u64 size = lseek(file->fd, 0, SEEK_CUR);
200 if (size == 0) 199 if (size == 0)
201 return 0; 200 return 0;
202 201
202 file->size = size;
203
203 /* 204 /*
204 * During this process, it'll load kernel map and replace the 205 * During this process, it'll load kernel map and replace the
205 * dso->long_name to a real pathname it found. In this case 206 * dso->long_name to a real pathname it found. In this case
@@ -211,9 +212,7 @@ static int process_buildids(struct record *rec)
211 */ 212 */
212 symbol_conf.ignore_vmlinux_buildid = true; 213 symbol_conf.ignore_vmlinux_buildid = true;
213 214
214 return __perf_session__process_events(session, start, 215 return perf_session__process_events(session, &build_id__mark_dso_hit_ops);
215 size - start,
216 size, &build_id__mark_dso_hit_ops);
217} 216}
218 217
219static void perf_event__synthesize_guest_os(struct machine *machine, void *data) 218static void perf_event__synthesize_guest_os(struct machine *machine, void *data)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index b0ce3d6e6231..0baf75f12b7c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1251,9 +1251,9 @@ fetch_mmaped_event(struct perf_session *session,
1251#define NUM_MMAPS 128 1251#define NUM_MMAPS 128
1252#endif 1252#endif
1253 1253
1254int __perf_session__process_events(struct perf_session *session, 1254static int __perf_session__process_events(struct perf_session *session,
1255 u64 data_offset, u64 data_size, 1255 u64 data_offset, u64 data_size,
1256 u64 file_size, struct perf_tool *tool) 1256 u64 file_size, struct perf_tool *tool)
1257{ 1257{
1258 int fd = perf_data_file__fd(session->file); 1258 int fd = perf_data_file__fd(session->file);
1259 u64 head, page_offset, file_offset, file_pos, size; 1259 u64 head, page_offset, file_offset, file_pos, size;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index dc26ebf60fe4..6d663dc76404 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -49,9 +49,6 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset,
49 union perf_event **event_ptr, 49 union perf_event **event_ptr,
50 struct perf_sample *sample); 50 struct perf_sample *sample);
51 51
52int __perf_session__process_events(struct perf_session *session,
53 u64 data_offset, u64 data_size, u64 size,
54 struct perf_tool *tool);
55int perf_session__process_events(struct perf_session *session, 52int perf_session__process_events(struct perf_session *session,
56 struct perf_tool *tool); 53 struct perf_tool *tool);
57 54