linux/debian/patches/perf-fix-numa-types.patch

47 lines
1.5 KiB
Diff

From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 18 Nov 2013 05:12:30 +0000
Subject: perf: Fix type errors in bench/numa.c
Forwarded: no
Fix the following errors on i386 and probably most other 32-bit
architectures:
bench/numa.c: In function 'worker_thread':
bench/numa.c:1113:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (diff.tv_sec >= g->p.nr_secs) {
^
bench/numa.c:1161:6: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'u64' [-Werror=format=]
process_nr, thread_nr, runtime_ns_max / bytes_done, val);
^
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -12,6 +12,7 @@
#include "bench.h"
#include <errno.h>
+#include <inttypes.h>
#include <sched.h>
#include <stdio.h>
#include <assert.h>
@@ -1110,7 +1111,7 @@ static void *worker_thread(void *__tdata
/* Check whether our max runtime timed out: */
if (g->p.nr_secs) {
timersub(&stop, &start0, &diff);
- if (diff.tv_sec >= g->p.nr_secs) {
+ if (diff.tv_sec >= (time_t)g->p.nr_secs) {
g->stop_work = true;
break;
}
@@ -1157,7 +1158,7 @@ static void *worker_thread(void *__tdata
runtime_ns_max += diff.tv_usec * 1000;
if (details >= 0) {
- printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016lx]\n",
+ printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016"PRIx64"]\n",
process_nr, thread_nr, runtime_ns_max / bytes_done, val);
}
fflush(stdout);