Patchwork [16/21] perf tools, powerpc: Fix compile warnings in tests/attr.c

mail settings
Submitter Arnaldo Carvalho de Melo
Date Jan. 30, 2013, 2:46 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/216931/
State Not Applicable
Headers show


Arnaldo Carvalho de Melo - Jan. 30, 2013, 2:46 p.m.
From: Sukadev Bhattiprolu <>

We print several '__u64' quantities using '%llu'. On powerpc, we by
default include '<asm-generic/int-l64.h> which results in __u64 being an
unsigned long. This causes compile warnings which are treated as errors
due to '-Werror'.

By defining __SANE_USERSPACE_TYPES__ we include <asm-generic/int-ll64.h>
and define __u64 as unsigned long long.

	[Michael Ellerman] Use __SANE_USERSPACE_TYPES__ and avoid PRIu64
	format specifier - which as Jiri Olsa pointed out, breaks on x86-64.

Signed-off-by: Sukadev Bhattiprolu <>
Cc: Anton Blanchard <>
Cc: Jiri Olsa <>
Cc: Michael Ellerman <>
Signed-off-by: Arnaldo Carvalho de Melo <>
 tools/perf/tests/attr.c | 5 +++++
 1 file changed, 5 insertions(+)


diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index f61dd3f..bdcceb8 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -19,6 +19,11 @@ 
  * permissions. All the event text files are stored there.
+ * Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select
+ * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu.
+ */
 #include <stdlib.h>
 #include <stdio.h>
 #include <inttypes.h>