Skip to contentSkip to conversation

perf report: fix compile failure on ppc, 32-bit

PATCH In review David Ahern 2 participants 2 messages May 8, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf report: fix compile failure on ppc, 32-bit

Builds currently fail with:
CC /tmp/pbuild/builtin-report.o
cc1: warnings being treated as errors
builtin-report.c: In function ‘hists__fprintf_nr_sample_events’:
builtin-report.c:307: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘u64’
make: *** [/tmp/pbuild/builtin-report.o] Error 1

$ rpm -q gcc
gcc-4.4.4-10.fc12.ppc
---
 tools/perf/builtin-report.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/builtin-report.c +1 -1
index 5df829f..7477655 100644
@@ -304,7 +304,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *self,
 	if (evname != NULL)
 		ret += fprintf(fp, " of event '%s'", evname);
 
-	ret += fprintf(fp, "\n# Event count (approx.): %lu", nr_events);
+	ret += fprintf(fp, "\n# Event count (approx.): %" PRIu64, nr_events);
 	return ret + fprintf(fp, "\n#\n");
 }
 
Signature · 1 line
1.7.5.4
#1 lore raw

Em Mon, May 07, 2012 at 07:59:22PM -0600, David Ahern escreveu:

Quoted 6 lines

Builds currently fail with:
CC /tmp/pbuild/builtin-report.o
cc1: warnings being treated as errors
builtin-report.c: In function ‘hists__fprintf_nr_sample_events’:
builtin-report.c:307: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘u64’
make: *** [/tmp/pbuild/builtin-report.o] Error 1

Jiri sent this, I reproduced it yesterday on an Atom machine, will push today, thanks,

- Arnaldo

Quoted 23 lines
$ rpm -q gcc
gcc-4.4.4-10.fc12.ppc
---
 tools/perf/builtin-report.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/builtin-report.c +1 -1
index 5df829f..7477655 100644
@@ -304,7 +304,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *self,
 	if (evname != NULL)
 		ret += fprintf(fp, " of event '%s'", evname);
 
-	ret += fprintf(fp, "\n# Event count (approx.): %lu", nr_events);
+	ret += fprintf(fp, "\n# Event count (approx.): %" PRIu64, nr_events);
 	return ret + fprintf(fp, "\n#\n");
 }
 
Signature · 1 line
1.7.5.4