forked from Minki/linux
936be50306
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.
v3 -> v4:
- fixed use of WARN_ONCE
v2 -> v3:
- used WARN_ONCE for message regarding raw data
- removed struct wrapper around union
- fixed whitespace issues
v1 -> v2:
- added a union for undoing the byte-swap on u64 and redoing swap on
u32's to address compiler errors (see git commit
|
||
---|---|---|
.. | ||
arch | ||
bench | ||
config | ||
Documentation | ||
python | ||
scripts | ||
util | ||
.gitignore | ||
builtin-annotate.c | ||
builtin-bench.c | ||
builtin-buildid-cache.c | ||
builtin-buildid-list.c | ||
builtin-diff.c | ||
builtin-evlist.c | ||
builtin-help.c | ||
builtin-inject.c | ||
builtin-kmem.c | ||
builtin-kvm.c | ||
builtin-list.c | ||
builtin-lock.c | ||
builtin-probe.c | ||
builtin-record.c | ||
builtin-report.c | ||
builtin-sched.c | ||
builtin-script.c | ||
builtin-stat.c | ||
builtin-test.c | ||
builtin-timechart.c | ||
builtin-top.c | ||
builtin.h | ||
command-list.txt | ||
CREDITS | ||
design.txt | ||
Makefile | ||
MANIFEST | ||
perf-archive.sh | ||
perf.c | ||
perf.h |