diff options
author | David Ahern <dsahern@gmail.com> | 2011-07-15 12:34:09 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-04 21:58:35 -0700 |
commit | 5dd830d09df97bc9318d6e0841fcf652bdc46bfa (patch) | |
tree | 093da618b5afc26c3074b6c6f52cabeace91599b /tools/perf/util/session.h | |
parent | 64d488f079f68f58210f4c79c7e76b04a7c9db20 (diff) | |
download | kernel_samsung_smdk4412-5dd830d09df97bc9318d6e0841fcf652bdc46bfa.zip kernel_samsung_smdk4412-5dd830d09df97bc9318d6e0841fcf652bdc46bfa.tar.gz kernel_samsung_smdk4412-5dd830d09df97bc9318d6e0841fcf652bdc46bfa.tar.bz2 |
perf tools: Fix endian conversion reading event attr from file header
commit eda3913bb70ecebac13adccffe1e7f96e93cee02 upstream.
The perf_event_attr struct has two __u32's at the top and
they need to be swapped individually.
With this change I was able to analyze a perf.data collected in a
32-bit PPC VM on an x86 system. I tested both 32-bit and 64-bit
binaries for the Intel analysis side; both read the PPC perf.data
file correctly.
-v2:
- changed the existing perf_event__attr_swap() to swap only elements
of perf_event_attr and exported it for use in swapping the
attributes in the file header
- updated swap_ops used for processing events
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: acme@ghostprotocols.net
Cc: peterz@infradead.org
Cc: paulus@samba.org
Link: http://lkml.kernel.org/r/1310754849-12474-1-git-send-email-dsahern@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r-- | tools/perf/util/session.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 66d4e14..b84c003 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h @@ -112,6 +112,7 @@ int perf_session__set_kallsyms_ref_reloc_sym(struct map **maps, u64 addr); void mem_bswap_64(void *src, int byte_size); +void perf_event__attr_swap(struct perf_event_attr *attr); int perf_session__create_kernel_maps(struct perf_session *self); |