1 From 503daf4789dd23e4dc1e16c256de0c163fc2bf87 Mon Sep 17 00:00:00 2001
2 From: Markus Trippelsdorf <markus@trippelsdorf.de>
3 Date: Wed, 4 Apr 2012 10:45:27 +0200
4 Subject: [PATCH] perf tools: Fix getrusage() related build failure on glibc
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9 Organization: O.S. Systems Software LTDA.
11 On a system running glibc trunk perf doesn't build:
14 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]
17 Fix it by including sys/resource.h.
19 Upstream-Status: Pending
21 Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
22 Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
23 Link: http://lkml.kernel.org/r/20120404084527.GA294@x4
24 Signed-off-by: Ingo Molnar <mingo@kernel.org>
26 tools/perf/builtin-sched.c | 1 +
27 1 file changed, 1 insertion(+)
29 diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
30 index dcfe887..3632c2f 100644
31 --- a/tools/perf/builtin-sched.c
32 +++ b/tools/perf/builtin-sched.c
34 #include "util/debug.h"
36 #include <sys/prctl.h>
37 +#include <sys/resource.h>
39 #include <semaphore.h>