perf record: Remove post_processing_offset variable
authorDavid Ahern <[email protected]>
Wed, 6 Nov 2013 18:41:36 +0000 (11:41 -0700)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 7 Nov 2013 14:01:59 +0000 (11:01 -0300)
Duplicates the data_offset from header in the session.

Signed-off-by: David Ahern <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-record.c

index 19c4db6bdd6f91ea6d61ce3e04450770f44feb9b..15280b5e5574669c78376a419a8512eb5e774258 100644 (file)
@@ -74,7 +74,6 @@ struct perf_record {
        bool                    no_buildid;
        bool                    no_buildid_cache;
        long                    samples;
-       off_t                   post_processing_offset;
 };
 
 static int write_output(struct perf_record *rec, void *buf, size_t size)
@@ -247,13 +246,14 @@ static int process_buildids(struct perf_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;
 
-       return __perf_session__process_events(session, rec->post_processing_offset,
-                                             size - rec->post_processing_offset,
+       return __perf_session__process_events(session, start,
+                                             size - start,
                                              size, &build_id__mark_dso_hit_ops);
 }
 
@@ -429,8 +429,6 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
                goto out_delete_session;
        }
 
-       rec->post_processing_offset = lseek(file->fd, 0, SEEK_CUR);
-
        machine = &session->machines.host;
 
        if (file->is_pipe) {