perf tools: Unify page_size usage
authorJiri Olsa <jolsa@redhat.com>
Thu, 12 Sep 2013 16:39:35 +0000 (18:39 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Oct 2013 14:22:55 +0000 (11:22 -0300)
Making page_size global from the util object.

Removing the not needed one.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
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/1379003976-5839-4-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c
tools/perf/perf.c
tools/perf/util/python.c

index cf36ba2a159184cbf4e0bb1cc5a2a8c5bce267aa..0aacd6295fe6ad780899c442e3759c0132549d83 100644 (file)
@@ -70,7 +70,6 @@ struct perf_record {
        struct perf_session     *session;
        const char              *progname;
        int                     output;
-       unsigned int            page_size;
        int                     realtime_prio;
        bool                    no_buildid;
        bool                    no_buildid_cache;
@@ -119,7 +118,7 @@ static int perf_record__mmap_read(struct perf_record *rec,
 {
        unsigned int head = perf_mmap__read_head(md);
        unsigned int old = md->prev;
-       unsigned char *data = md->base + rec->page_size;
+       unsigned char *data = md->base + page_size;
        unsigned long size;
        void *buf;
        int rc = 0;
@@ -360,8 +359,6 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
 
        rec->progname = argv[0];
 
-       rec->page_size = sysconf(_SC_PAGE_SIZE);
-
        on_exit(perf_record__sig_exit, rec);
        signal(SIGCHLD, sig_handler);
        signal(SIGINT, sig_handler);
index 245020cc6180e05ff87df7b8bc2f7e6755fdf247..626577830264baf6401fd037137d736cf4d6b00d 100644 (file)
@@ -456,6 +456,7 @@ int main(int argc, const char **argv)
 {
        const char *cmd;
 
+       /* The page_size is placed in util object. */
        page_size = sysconf(_SC_PAGE_SIZE);
 
        cmd = perf_extract_argv0_path(argv[0]);
index 71b5412bbbb9d1197dc5ae999c94704211108238..a24ce0a6a941cfb6c03c9994bb09f32e5e76fe59 100644 (file)
@@ -1036,6 +1036,7 @@ PyMODINIT_FUNC initperf(void)
            pyrf_cpu_map__setup_types() < 0)
                return;
 
+       /* The page_size is placed in util object. */
        page_size = sysconf(_SC_PAGE_SIZE);
 
        Py_INCREF(&pyrf_evlist__type);