All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Stephane Eranian <eranian@google.com>, Anton Blanchard <anton@samba.org>
Cc: linux-kernel@vger.kernel.org, acme@redhat.com,
	peterz@infradead.org, mingo@elte.hu, robert.richter@amd.com,
	ak@linux.intel.com
Subject: Re: [PATCH] perf: make perf.data more self-descriptive (v5)
Date: Thu, 22 Sep 2011 09:48:35 -0600	[thread overview]
Message-ID: <4E7B58D3.5060006@gmail.com> (raw)
In-Reply-To: <CABPqkBSBXenw7AFg-HZY+j0kVAk+cu53S_dF3_GKD8VUGf9UYQ@mail.gmail.com>

On 09/22/2011 09:40 AM, Stephane Eranian wrote:
>>> diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
>>> new file mode 100644
>>> index 0000000..d4bf958
>>> --- /dev/null
>>> +++ b/tools/perf/arch/powerpc/util/header.c
>>> @@ -0,0 +1,36 @@
>>> +#include <sys/types.h>
>>> +#include <unistd.h>
>>> +#include <stdio.h>
>>> +#include <stdlib.h>
>>> +#include <string.h>
>>> +
>>> +#include "../../util/header.h"
>>> +
>>> +static inline unsigned long mfspr(int rn)
>>> +{
>>> +     unsigned long rval;
>>> +     asm volatile("mfspr %0," __stringify(rn) : "=r" (rval));
>>> +     return  rval;
>>> +}
>>
>> Fails to compile on powerpc:
>>
>> arch/powerpc/util/header.c: In function ‘mfspr’:
>> arch/powerpc/util/header.c:12: error: expected ‘:’ or ‘)’ before
>> ‘__stringify’
>> cc1: warnings being treated as errors
>> arch/powerpc/util/header.c:9: error: unused parameter ‘rn’
>> make: *** [/tmp/stephane/arch/powerpc/util/header.o] Error 1
>> make: *** Waiting for unfinished jobs....
>>
> 
> Argh, I don't have a PPC system, so I made this up (based on libpfm4 code).
> 
> Does adding:
> 
> #define __stringify_1(x)        #x
> #define __stringify(x)          __stringify_1(x)
> 
> Solve the problem?

No. I added those lines above mfspr(). Now the error is:
cc1: warnings being treated as errors
arch/powerpc/util/header.c: In function ‘mfspr’:
arch/powerpc/util/header.c:11: error: unused parameter ‘rn’
make: *** [/tmp/stephane/arch/powerpc/util/header.o] Error 1
make: *** Waiting for unfinished jobs....

which does seem logical given that rn is used in stringify.

Maybe Anton can help with this (cc'ed).

David

  reply	other threads:[~2011-09-22 15:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 12:31 [PATCH] perf: make perf.data more self-descriptive (v5) Stephane Eranian
2011-09-22 15:35 ` David Ahern
2011-09-22 15:40   ` Stephane Eranian
2011-09-22 15:48     ` David Ahern [this message]
2011-09-22 21:20 ` Andi Kleen
2011-09-22 21:25   ` Stephane Eranian
2011-09-23  3:26     ` Andi Kleen
2011-09-23  6:28       ` Stephane Eranian
2011-09-23  6:40 ` Pekka Enberg
2011-09-23  7:31   ` Stephane Eranian
2011-09-23  8:03     ` Pekka Enberg
2011-09-23  9:04       ` Stephane Eranian
2011-09-23  9:17         ` Pekka Enberg
2011-09-23 13:36         ` David Ahern
     [not found]           ` <CABPqkBTuc_jowJx0PqPPhcCuj6B5dqRaQNiZWiyhhHMN+NkLYg@mail.gmail.com>
2011-09-23 14:09             ` David Ahern
2011-09-23 14:22               ` Stephane Eranian
2011-09-23 22:13       ` Valdis.Kletnieks
2011-09-23 10:13 ` Robert Richter

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=4E7B58D3.5060006@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=anton@samba.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.