perf symbols: Pass the offset to perf_header__read_build_ids()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 16 Nov 2009 18:32:41 +0000 (16:32 -0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 16 Nov 2009 21:05:49 +0000 (22:05 +0100)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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>
LKML-Reference: <1258396365-29217-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/data_map.c
tools/perf/util/data_map.h
tools/perf/util/header.c

index aacb814a4eff88b18d84232f135688b1ed9392bb..14cb8465eb089817aa38b195c526c8b716fa344a 100644 (file)
@@ -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;
 
index 20b4037a8236d89201907d3d9147a7def3586764..ae036ecd76254f993000f4847b1bc28a928f1fa1 100644 (file)
@@ -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
index ebed4f44ed36f8dff5641a0655956dcdc495088e..ca0d657eefadfc1d01e8ba47c9abbdacfacdd9db 100644 (file)
@@ -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");
        }