* perf: don't use obsolete getpagesize
@ 2010-01-14 17:43 Ulrich Drepper
2010-01-14 17:48 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Drepper @ 2010-01-14 17:43 UTC (permalink / raw)
To: a.p.zijlstra, acme, eranian, fweisbec, linux-kernel, lizf, mingo,
paulus
perf uses the obsolete getpagesize function. Let's do better and use the
correct POSIX interface to get the information: sysconf.
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
diff --git a/tools/perf/util/data_map.c b/tools/perf/util/data_map.c
index b557b83..cc8b396 100644
--- a/tools/perf/util/data_map.c
+++ b/tools/perf/util/data_map.c
@@ -153,7 +153,7 @@ int perf_session__process_events(struct perf_session *self,
perf_event_ops__fill_defaults(ops);
- page_size = getpagesize();
+ page_size = sysconf(_SC_PAGESIZE);
head = self->header.data_offset;
self->sample_type = perf_header__sample_type(&self->header);
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index cace355..948dc9e 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -533,7 +533,7 @@ int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events)
write_or_die(buf, 1);
/* save page_size */
- page_size = getpagesize();
+ page_size = sysconf(_SC_PAGESIZE);
write_or_die(&page_size, 4);
read_header_files();
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: perf: don't use obsolete getpagesize
2010-01-14 17:43 perf: don't use obsolete getpagesize Ulrich Drepper
@ 2010-01-14 17:48 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-01-14 17:48 UTC (permalink / raw)
To: Ulrich Drepper
Cc: a.p.zijlstra, eranian, fweisbec, linux-kernel, lizf, mingo,
paulus
Em Thu, Jan 14, 2010 at 12:43:20PM -0500, Ulrich Drepper escreveu:
> perf uses the obsolete getpagesize function. Let's do better and use the
> correct POSIX interface to get the information: sysconf.
>
>
> Signed-off-by: Ulrich Drepper <drepper@redhat.com>
I have this already in my queue, thanks!
acme@parisc:~/git/linux-2.6-tip$ git show 578bb387c17692896a2a7c6b8bcba2c3945c33f4
commit 578bb387c17692896a2a7c6b8bcba2c3945c33f4
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu Jan 14 14:10:35 2010 -0200
perf tools: Convert getpagesize() uses to sysconf(_SC_GETPAGESIZE)
Using the more portable and equivalent sysconf call.
Reported-by: Aristeu Rozanski <aris@redhat.com>
Cc: Aristeu Rozanski <aris@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 604e14f..1951e33 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -384,7 +384,7 @@ int perf_session__process_events(struct perf_session *self,
perf_event_ops__fill_defaults(ops);
- page_size = getpagesize();
+ page_size = sysconf(_SC_PAGESIZE);
head = self->header.data_offset;
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index 407fd65..5ea8973 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -515,7 +515,7 @@ int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events)
write_or_die(buf, 1);
/* save page_size */
- page_size = getpagesize();
+ page_size = sysconf(_SC_PAGESIZE);
write_or_die(&page_size, 4);
read_header_files();
acme@parisc:~/git/linux-2.6-tip$
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-14 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 17:43 perf: don't use obsolete getpagesize Ulrich Drepper
2010-01-14 17:48 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox