Re: [PATCH] perf: make perf.data more self-descriptive (v5)

From: David Ahern
Date: Thu Sep 22 2011 - 11:48:41 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/