From: Arnaldo Carvalho de Melo on
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(a)redhat.com>

I have this already in my queue, thanks!

acme(a)parisc:~/git/linux-2.6-tip$ git show 578bb387c17692896a2a7c6b8bcba2c3945c33f4
commit 578bb387c17692896a2a7c6b8bcba2c3945c33f4
Author: Arnaldo Carvalho de Melo <acme(a)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(a)redhat.com>
Cc: Aristeu Rozanski <aris(a)redhat.com>
Cc: Fr�d�ric Weisbecker <fweisbec(a)gmail.com>
Cc: Mike Galbraith <efault(a)gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra(a)chello.nl>
Cc: Paul Mackerras <paulus(a)samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme(a)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(a)parisc:~/git/linux-2.6-tip$
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/