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, 1 Sep 2011 13:19:00 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	David Ahern <dsahern@...il.com>
Cc:	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	mingo@...e.hu, peterz@...radead.org, fweisbec@...il.com,
	paulus@...ba.org, tglx@...utronix.de, anton@...ba.org
Subject: Re: [PATCH] perf tool: fix endianness handling of u32 data in samples

Em Mon, Aug 29, 2011 at 03:55:24PM -0600, David Ahern escreveu:
> Currently, analyzing PPC data files on x86 the cpu field is always 0 and
> the tid and pid are backwards. For example, analyzing a PPC file on PPC
> the pid/tid fields show:
>         rsyslogd  1210/1212
> 
> and analyzing the same PPC file using an x86 perf binary shows:
>         rsyslogd  1212/1210
> 
> The problem is that the swap_op method for samples is
> perf_event__all64_swap which assumes all elements in the sample_data
> struct are u64s. cpu, tid and pid are u32s and need to be handled
> individually. Given that the swap is done before the sample is parsed,
> the simplest solution is to undo the 64-bit swap of those elements when
> the sample is parsed and do the proper swap.
> 
> The RAW data field is generic and perf cannot have programmatic knowledge
> of how to treat that data. Instead a warning is given to the user.
> 
> Thanks to Anton Blanchard for providing a data file for a mult-CPU
> PPC system so I could verify the fix for the CPU fields.
> 
> Signed-off-by: David Ahern <dsahern@...il.com>

cc1: warnings being treated as errors
util/evsel.c: In function ‘perf_event__parse_sample’:
util/evsel.c:379: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:375: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:375: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:371: note: initialized from here
util/evsel.c:376: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
util/evsel.c:376: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
util/evsel.c:376: note: initialized from here
util/evsel.c:380: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
util/evsel.c:380: note: initialized from here
util/evsel.c:414: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:412: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:408: note: initialized from here
util/evsel.c:462: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:450: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:450: error: dereferencing pointer ‘p’ does break strict-aliasing rules
util/evsel.c:444: note: initialized from here
util/evsel.c:451: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
util/evsel.c:451: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
util/evsel.c:451: note: initialized from here
    CC /home/acme/git/build/perf//util/symbol.o
make: *** [/home/acme/git/build/perf//util/evsel.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@...lia linux]$

[acme@...lia linux]$ uname -a
Linux emilia.ghostprotocols.net 3.0.3-rt12.14.el6rt.x86_64 #1 SMP PREEMPT RT Wed Aug 31 12:38:53 BRT 2011 x86_64 x86_64 x86_64 GNU/Linux
[acme@...lia linux]$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 6.0 Beta (Santiago)
[acme@...lia linux]$

- Arnaldo
--
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