mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
To: namhyung@kernel.org, acme@ghostprotocols.net
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
	Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Subject: [PATCH] perf: fix bench numa compilation
Date: Mon, 17 Jun 2013 12:54:59 +0200	[thread overview]
Message-ID: <1371466499-28291-1-git-send-email-riccardo.magliocchetti@gmail.com> (raw)
In-Reply-To: <8761xd2k1c.fsf@sejong.aot.lge.com>

Fix the following errors on gcc 4.8.1 / x86:

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: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
---
 tools/perf/bench/numa.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

changes from v1:
- make it actually work on 64bit too as reported by Namhyung Kim

diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 30d1c32..bd501454 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -1110,7 +1110,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 >= (long int)g->p.nr_secs) {
 				g->stop_work = true;
 				break;
 			}
@@ -1157,8 +1157,8 @@ 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",
-					process_nr, thread_nr, runtime_ns_max / bytes_done, val);
+				printf(" #%2d / %2d: %14.2lf nsecs/op [val: %016llx]\n",
+					process_nr, thread_nr, runtime_ns_max / bytes_done, (unsigned long long)val);
 			}
 			fflush(stdout);
 		}
-- 
1.8.3.1


  reply	other threads:[~2013-06-17 10:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-15 10:15 Riccardo Magliocchetti
2013-06-17  8:55 ` Namhyung Kim
2013-06-17 10:54   ` Riccardo Magliocchetti [this message]
2013-06-19 17:23     ` Arnaldo Carvalho de Melo
2013-06-20  7:33       ` Riccardo Magliocchetti
2013-06-20  7:39       ` [PATCH v3] " Riccardo Magliocchetti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371466499-28291-1-git-send-email-riccardo.magliocchetti@gmail.com \
    --to=riccardo.magliocchetti@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®