[PATCH 1/5] perf symbols: pass the offset to perf_header__read_build_ids

From: Arnaldo Carvalho de Melo
Date: Mon Nov 16 2009 - 13:33:12 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/data_map.c | 3 +--
tools/perf/util/data_map.h | 2 +-
tools/perf/util/header.c | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/data_map.c b/tools/perf/util/data_map.c
index aacb814..14cb846 100644
--- a/tools/perf/util/data_map.c
+++ b/tools/perf/util/data_map.c
@@ -70,11 +70,10 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
}
}

-int perf_header__read_build_ids(int input, off_t size)
+int perf_header__read_build_ids(int input, off_t offset, off_t size)
{
struct build_id_event bev;
char filename[PATH_MAX];
- off_t offset = lseek(input, 0, SEEK_CUR);
off_t limit = offset + size;
int err = -1;

diff --git a/tools/perf/util/data_map.h b/tools/perf/util/data_map.h
index 20b4037..ae036ec 100644
--- a/tools/perf/util/data_map.h
+++ b/tools/perf/util/data_map.h
@@ -27,6 +27,6 @@ int mmap_dispatch_perf_file(struct perf_header **pheader,
int full_paths,
int *cwdlen,
char **cwd);
-int perf_header__read_build_ids(int input, off_t file_size);
+int perf_header__read_build_ids(int input, off_t offset, off_t file_size);

#endif
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index ebed4f4..ca0d657 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -359,7 +359,7 @@ static void perf_header__adds_read(struct perf_header *self, int fd)

buildid_sec = &feat_sec[idx++];
lseek(fd, buildid_sec->offset, SEEK_SET);
- if (perf_header__read_build_ids(fd, buildid_sec->size))
+ if (perf_header__read_build_ids(fd, buildid_sec->offset, buildid_sec->size))
pr_debug("failed to read buildids, continuing...\n");
}

--
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/