lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Sep 2011 09:48:35 -0600
From:	David Ahern <dsahern@...il.com>
To:	Stephane Eranian <eranian@...gle.com>,
	Anton Blanchard <anton@...ba.org>
CC:	linux-kernel@...r.kernel.org, acme@...hat.com,
	peterz@...radead.org, mingo@...e.hu, robert.richter@....com,
	ak@...ux.intel.com
Subject: Re: [PATCH] perf: make perf.data more self-descriptive (v5)

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ