aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-09-12 12:39:35 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-10-09 10:22:55 -0400
commit918512b435e15fefe609d236e0ecd62cb8f389c9 (patch)
treeeb6c139580b9ba5507eb2978ac837ab21ebac65b /tools/perf
parent5283ec23a02e8afdc984c7f5f07e2a2662d4934a (diff)
perf tools: Unify page_size usage
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>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c5
-rw-r--r--tools/perf/perf.c1
-rw-r--r--tools/perf/util/python.c1
3 files changed, 3 insertions, 4 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index cf36ba2a1591..0aacd6295fe6 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -70,7 +70,6 @@ struct perf_record {
70 struct perf_session *session; 70 struct perf_session *session;
71 const char *progname; 71 const char *progname;
72 int output; 72 int output;
73 unsigned int page_size;
74 int realtime_prio; 73 int realtime_prio;
75 bool no_buildid; 74 bool no_buildid;
76 bool no_buildid_cache; 75 bool no_buildid_cache;
@@ -119,7 +118,7 @@ static int perf_record__mmap_read(struct perf_record *rec,
119{ 118{
120 unsigned int head = perf_mmap__read_head(md); 119 unsigned int head = perf_mmap__read_head(md);
121 unsigned int old = md->prev; 120 unsigned int old = md->prev;
122 unsigned char *data = md->base + rec->page_size; 121 unsigned char *data = md->base + page_size;
123 unsigned long size; 122 unsigned long size;
124 void *buf; 123 void *buf;
125 int rc = 0; 124 int rc = 0;
@@ -360,8 +359,6 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
360 359
361 rec->progname = argv[0]; 360 rec->progname = argv[0];
362 361
363 rec->page_size = sysconf(_SC_PAGE_SIZE);
364
365 on_exit(perf_record__sig_exit, rec); 362 on_exit(perf_record__sig_exit, rec);
366 signal(SIGCHLD, sig_handler); 363 signal(SIGCHLD, sig_handler);
367 signal(SIGINT, sig_handler); 364 signal(SIGINT, sig_handler);
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 245020cc6180..626577830264 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -456,6 +456,7 @@ int main(int argc, const char **argv)
456{ 456{
457 const char *cmd; 457 const char *cmd;
458 458
459 /* The page_size is placed in util object. */
459 page_size = sysconf(_SC_PAGE_SIZE); 460 page_size = sysconf(_SC_PAGE_SIZE);
460 461
461 cmd = perf_extract_argv0_path(argv[0]); 462 cmd = perf_extract_argv0_path(argv[0]);
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 71b5412bbbb9..a24ce0a6a941 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -1036,6 +1036,7 @@ PyMODINIT_FUNC initperf(void)
1036 pyrf_cpu_map__setup_types() < 0) 1036 pyrf_cpu_map__setup_types() < 0)
1037 return; 1037 return;
1038 1038
1039 /* The page_size is placed in util object. */
1039 page_size = sysconf(_SC_PAGE_SIZE); 1040 page_size = sysconf(_SC_PAGE_SIZE);
1040 1041
1041 Py_INCREF(&pyrf_evlist__type); 1042 Py_INCREF(&pyrf_evlist__type);