From: Denis Kirjanov <dkirjanov@kernel.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
paulus@samba.org, acme@ghostprotocols.net
Subject: Re: [PATCH] perftools: Fix build error
Date: Thu, 20 Jan 2011 18:44:38 +0300 [thread overview]
Message-ID: <4D385866.3060405@kernel.org> (raw)
In-Reply-To: <20110120114719.GD23661@elte.hu>
On 01/20/2011 02:47 PM, Ingo Molnar wrote:
>
> * Denis Kirjanov <dkirjanov@kernel.org> wrote:
>
>> Fix perftools build error (ppc64 box) with PERF_VERSION = 2.6.38.rc1.47.g12fcdb
>> CC builtin-top.o
>> cc1: warnings being treated as errors
>> builtin-top.c: In function 'print_sym_table':
>> builtin-top.c:540: error: format '%Ld' expects type 'long long int', but argument 2 has type '__u64'
>>
>> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
>> ---
>> tools/perf/builtin-top.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
>> index 05344c6..8202a2e 100644
>> --- a/tools/perf/builtin-top.c
>> +++ b/tools/perf/builtin-top.c
>> @@ -537,7 +537,7 @@ static void print_sym_table(void)
>> if (nr_counters == 1 || !display_weighted) {
>> struct perf_evsel *first;
>> first = list_entry(evsel_list.next, struct perf_evsel, node);
>> - printf("%Ld", first->attr.sample_period);
>> + printf("%Ld", (unsigned long long)first->attr.sample_period);
>
> Wouldnt %Lu solve this in a cleaner way?
>
> Thanks,
>
> Ingo
>
I think that cleaner way is to use PRIu64.
>From 492bf54effdf8c154e76c4ca734f27ce1db46df6 Mon Sep 17 00:00:00 2001
From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Thu, 20 Jan 2011 18:34:56 +0300
Subject: [PATCH] perftools: Fix build error
CC perf.o
CC builtin-top.o
cc1: warnings being treated as errors
builtin-top.c: In function 'print_sym_table':
builtin-top.c:540: error: format '%Ld' expects type 'long long int', but argument 2 has type '__u64'
make: *** [builtin-top.o] Error 1
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
tools/perf/builtin-top.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 05344c6..a7bc50b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
+#include <inttypes.h>
#include <errno.h>
#include <time.h>
@@ -537,7 +538,7 @@ static void print_sym_table(void)
if (nr_counters == 1 || !display_weighted) {
struct perf_evsel *first;
first = list_entry(evsel_list.next, struct perf_evsel, node);
- printf("%Ld", first->attr.sample_period);
+ printf("%" PRIu64, first->attr.sample_period);
if (freq)
printf("Hz ");
else
--
1.7.3.4
next prev parent reply other threads:[~2011-01-20 15:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 9:32 [PATCH] perftools: Fix build error Denis Kirjanov
2011-01-20 11:47 ` Ingo Molnar
2011-01-20 15:44 ` Denis Kirjanov [this message]
2011-01-20 17:22 ` Arnaldo Carvalho de Melo
2011-01-21 8:57 ` Han Pingtian
2011-01-21 13:20 ` Arnaldo Carvalho de Melo
2011-01-24 2:53 ` Han Pingtian
2011-01-24 4:15 ` Han Pingtian
2011-01-24 12:27 ` Arnaldo Carvalho de Melo
2011-01-21 18:53 ` Arnaldo Carvalho de Melo
2011-01-21 19:30 ` Arnaldo Carvalho de Melo
2011-01-22 5:08 ` Pingtian Han
2011-01-22 9:13 ` Denis Kirjanov
2011-01-22 8:54 ` Denis Kirjanov
2011-01-23 18:01 ` [tip:perf/urgent] perf tools: Fix 64 bit integer format strings tip-bot for Arnaldo Carvalho de Melo
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=4D385866.3060405@kernel.org \
--to=dkirjanov@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).