lkml.org 
[lkml]   [2012]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fix perf build failure on glibc trunk
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2012-04-04 10:47    [W:0.028 / U:20.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site