Commit 944d62ba authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf header: Remove attr_offset from perf_header

Removing attr_offset from perf_header as it's possible to use it as a
local variable.
Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1374083403-14591-4-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 75211dbf
...@@ -2272,6 +2272,7 @@ int perf_session__write_header(struct perf_session *session, ...@@ -2272,6 +2272,7 @@ int perf_session__write_header(struct perf_session *session,
struct perf_file_attr f_attr; struct perf_file_attr f_attr;
struct perf_header *header = &session->header; struct perf_header *header = &session->header;
struct perf_evsel *evsel; struct perf_evsel *evsel;
u64 attr_offset;
int err; int err;
lseek(fd, sizeof(f_header), SEEK_SET); lseek(fd, sizeof(f_header), SEEK_SET);
...@@ -2285,7 +2286,7 @@ int perf_session__write_header(struct perf_session *session, ...@@ -2285,7 +2286,7 @@ int perf_session__write_header(struct perf_session *session,
} }
} }
header->attr_offset = lseek(fd, 0, SEEK_CUR); attr_offset = lseek(fd, 0, SEEK_CUR);
list_for_each_entry(evsel, &evlist->entries, node) { list_for_each_entry(evsel, &evlist->entries, node) {
f_attr = (struct perf_file_attr){ f_attr = (struct perf_file_attr){
...@@ -2315,7 +2316,7 @@ int perf_session__write_header(struct perf_session *session, ...@@ -2315,7 +2316,7 @@ int perf_session__write_header(struct perf_session *session,
.size = sizeof(f_header), .size = sizeof(f_header),
.attr_size = sizeof(f_attr), .attr_size = sizeof(f_attr),
.attrs = { .attrs = {
.offset = header->attr_offset, .offset = attr_offset,
.size = evlist->nr_entries * sizeof(f_attr), .size = evlist->nr_entries * sizeof(f_attr),
}, },
.data = { .data = {
......
...@@ -86,7 +86,6 @@ struct perf_session_env { ...@@ -86,7 +86,6 @@ struct perf_session_env {
struct perf_header { struct perf_header {
bool needs_swap; bool needs_swap;
s64 attr_offset;
u64 data_offset; u64 data_offset;
u64 data_size; u64 data_size;
DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS); DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment