Removing attr_offset from perf_header as it's possible
to use it as a local variable.

Signed-off-by: Jiri Olsa <jo...@redhat.com>
Cc: Corey Ashford <cjash...@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweis...@gmail.com>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: David Ahern <dsah...@gmail.com>
---
 tools/perf/util/header.c | 5 +++--
 tools/perf/util/header.h | 1 -
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 035efe7..dcba56a 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2272,6 +2272,7 @@ int perf_session__write_header(struct perf_session 
*session,
        struct perf_file_attr   f_attr;
        struct perf_header *header = &session->header;
        struct perf_evsel *evsel;
+       u64 attr_offset;
        int err;
 
        lseek(fd, sizeof(f_header), SEEK_SET);
@@ -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) {
                f_attr = (struct perf_file_attr){
@@ -2315,7 +2316,7 @@ int perf_session__write_header(struct perf_session 
*session,
                .size      = sizeof(f_header),
                .attr_size = sizeof(f_attr),
                .attrs = {
-                       .offset = header->attr_offset,
+                       .offset = attr_offset,
                        .size   = evlist->nr_entries * sizeof(f_attr),
                },
                .data = {
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 0bacb2d..6fa80f9 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -86,7 +86,6 @@ struct perf_session_env {
 
 struct perf_header {
        bool                    needs_swap;
-       s64                     attr_offset;
        u64                     data_offset;
        u64                     data_size;
        DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
-- 
1.7.11.7

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

Reply via email to