Re: [PATCH] Fix perf build failure on glibc trunk

Ingo Molnar
2012-04-04T09:46:11Z

* Markus Trippelsdorf <markus@trippelsdorf.de> wrote:

> 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(+)

Can I add:

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>

?

Thanks,

Ingo