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]
Message-ID: <4B6133DF.9080207@dcl.info.waseda.ac.jp>
Date:	Thu, 28 Jan 2010 15:51:11 +0900
From:	Hitoshi Mitake <mitake@....info.waseda.ac.jp>
To:	Hitoshi Mitake <mitake@....info.waseda.ac.jp>,
	Ingo Molnar <mingo@...e.hu>
CC:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 11/12] perf lock: New subcommand "perf lock", for analyzing
 lock statistics

On 2010年01月22日 22:39, Hitoshi Mitake wrote:

Hi Ingo,
I have a trivial but difficult problem on this 11th patch.

 > +static void
 > +process_lock_acquire_event(void *data,
 > +			   struct event *event __used,
 > +			   int cpu __used,
 > +			   u64 timestamp __used,
 > +			   struct thread *thread __used)
 > +{
 > +	struct trace_acquire_event acquire_event;
 > +	u64 tmp;		/* this is required for casting... */
 > +
 > +	tmp = raw_field_value(event, "lockdep_addr", data);
 > +	acquire_event.addr = (void *)tmp;   # <- type of addr is void *

In the above function,
the statement:
     raw_field_value(event, "lockdep_addr", data);
reads member of event which is type of void *.

But, direct assigning like
     acquire_event.addr = (void *)raw_field_value(event, "lockdep_addr", 
data);
produces warning and it is treated as error on build environment of perf.
GCC says "cast from function call of type ‘long long unsigned int’ to 
non-matching type ‘void *’".
# Why is tmp to acquire_event.addr allowed? It's mysterious...

So I declared "u64 tmp" as temporary place for casting.
But next, this tmp causes compile error on x86_32.
Because it is u64. tmp should be u32 on x86_32.

I have to switch type of tmp u64 or u32 based on environment.
Don't you know some good preprocessor flag or some other avoiding methods?
I seeked but not found...

Thanks,
	Hitoshi
--
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