Commit 4ac30cf7 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarNamhyung 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f1f13af9
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -194,12 +194,13 @@ static int process_buildids(struct record *rec)
{
	struct perf_data_file *file  = &rec->file;
	struct perf_session *session = rec->session;
	u64 start = session->header.data_offset;

	u64 size = lseek(file->fd, 0, SEEK_CUR);
	if (size == 0)
		return 0;

	file->size = size;

	/*
	 * During this process, it'll load kernel map and replace the
	 * dso->long_name to a real pathname it found.  In this case
@@ -211,9 +212,7 @@ static int process_buildids(struct record *rec)
	 */
	symbol_conf.ignore_vmlinux_buildid = true;

	return __perf_session__process_events(session, start,
					      size - start,
					      size, &build_id__mark_dso_hit_ops);
	return perf_session__process_events(session, &build_id__mark_dso_hit_ops);
}

static void perf_event__synthesize_guest_os(struct machine *machine, void *data)
+3 −3
Original line number Diff line number Diff line
@@ -1251,7 +1251,7 @@ fetch_mmaped_event(struct perf_session *session,
#define NUM_MMAPS 128
#endif

int __perf_session__process_events(struct perf_session *session,
static int __perf_session__process_events(struct perf_session *session,
					  u64 data_offset, u64 data_size,
					  u64 file_size, struct perf_tool *tool)
{
+0 −3
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset,
			     union perf_event **event_ptr,
			     struct perf_sample *sample);

int __perf_session__process_events(struct perf_session *session,
				   u64 data_offset, u64 data_size, u64 size,
				   struct perf_tool *tool);
int perf_session__process_events(struct perf_session *session,
				 struct perf_tool *tool);