public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix perf build failure on glibc trunk
@ 2012-04-04  8:45 Markus Trippelsdorf
  2012-04-04  9:46 ` Ingo Molnar
  2012-04-04 10:08 ` [tip:perf/urgent] perf tools: Fix getrusage() related " tip-bot for Markus Trippelsdorf
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Trippelsdorf @ 2012-04-04  8:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Peter Zijlstra

On a system running glibc trunk perf doesn't build:

    CC builtin-sched.o
builtin-sched.c: In function ‘get_cpu_usage_nsec_parent’:
builtin-sched.c:399:16: error: storage size of ‘ru’ isn’t known
builtin-sched.c:403:2: error: implicit declaration of function ‘getrusage’ [-Werror=implicit-function-declaration]
builtin-sched.c:403:2: error: nested extern declaration of ‘getrusage’ [-Werror=nested-externs]
builtin-sched.c:403:18: error: ‘RUSAGE_SELF’ undeclared (first use in this function)
builtin-sched.c:403:18: note: each undeclared identifier is reported only once for each function it appears in
builtin-sched.c:399:16: error: unused variable ‘ru’ [-Werror=unused-variable]
cc1: all warnings being treated as errors

Fix it by including sys/resource.h.
---
 tools/perf/builtin-sched.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index fb8b5f8..1cad3af 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -17,6 +17,7 @@
 #include "util/debug.h"
 
 #include <sys/prctl.h>
+#include <sys/resource.h>
 
 #include <semaphore.h>
 #include <pthread.h>
-- 
Markus

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-04 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04  8:45 [PATCH] Fix perf build failure on glibc trunk Markus Trippelsdorf
2012-04-04  9:46 ` Ingo Molnar
2012-04-04  9:55   ` Markus Trippelsdorf
2012-04-04 10:08 ` [tip:perf/urgent] perf tools: Fix getrusage() related " tip-bot for Markus Trippelsdorf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox