From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Denis Kirjanov <dkirjanov@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
paulus@samba.org
Subject: Re: [PATCH] perftools: Fix build error
Date: Fri, 21 Jan 2011 16:53:37 -0200 [thread overview]
Message-ID: <20110121185337.GA15881@ghostprotocols.net> (raw)
In-Reply-To: <4D385866.3060405@kernel.org>
Em Thu, Jan 20, 2011 at 06:44:38PM +0300, Denis Kirjanov escreveu:
> 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
Now, after applying your patch, I get:
[acme@felicio linux]$ make -j2 O=~acme/git/build/perf -C tools/perf/ install
make: Entering directory `/media/tbs/acme/git/linux/tools/perf'
GEN perf-archive
CC /home/acme/git/build/perf/builtin-top.o
cc1: warnings being treated as errors
builtin-top.c: In function ‘print_sym_table’:
builtin-top.c:541:3: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘__u64’
make: *** [/home/acme/git/build/perf/builtin-top.o] Error 1
make: Leaving directory `/media/tbs/acme/git/linux/tools/perf'
[acme@felicio linux]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
[acme@felicio linux]$ cat /etc/fedora-release
Fedora release 14 (Laughlin)
[acme@felicio linux]$
- Arnaldo
next prev parent reply other threads:[~2011-01-21 18:53 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
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 [this message]
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=20110121185337.GA15881@ghostprotocols.net \
--to=acme@ghostprotocols.net \
--cc=a.p.zijlstra@chello.nl \
--cc=dkirjanov@kernel.org \
--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).