[PATCH 17/23] perf tools: Get rid of post_processing_offset in record command

From: Jiri Olsa
Date: Wed Jul 17 2013 - 13:51:35 EST


No need to use post_processing_offset variable now when
we know where the data starts.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
---
tools/perf/builtin-record.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index fcd0baf..b67564c 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -75,7 +75,6 @@ struct perf_record {
bool no_buildid;
bool no_buildid_cache;
long samples;
- off_t post_processing_offset;
};

static void advance_output(struct perf_record *rec, size_t size)
@@ -253,15 +252,17 @@ out:

static int process_buildids(struct perf_record *rec)
{
- u64 size = lseek(rec->output, 0, SEEK_CUR);
+ struct perf_session *session = rec->session;
+ u64 data_offset = PERF_FILE_HEADER__DATA_OFFSET;
+ u64 size = session->header.data_size;

if (size == 0)
return 0;

rec->session->fd = rec->output;
- return __perf_session__process_events(rec->session, rec->post_processing_offset,
- size - rec->post_processing_offset,
- size, &build_id__mark_dso_hit_ops);
+ return __perf_session__process_events(session, data_offset,
+ size - data_offset, size,
+ &build_id__mark_dso_hit_ops);
}

static void perf_record__exit(int status, void *arg)
@@ -461,8 +462,6 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
goto out_delete_session;
}

- rec->post_processing_offset = lseek(output, 0, SEEK_CUR);
-
machine = &session->machines.host;

if (opts->pipe_output) {
--
1.7.11.7

--
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/