Hi,

I'm pretty new to the list. So I'm apologizing if this question has already been answered.
We've been having some problems with oprofile cross platform compatibility (oprofile-0.9.7) an I was wondering if we are trying to do something that's somehow unsupported.

Here's my setup: 
I'm profiling an ARM Linux system so I'm running this on my device:
root# opcontrol --start --session-dir=/tmp/oprofile --no-vmlinux
root# opcontrol --stop
root# opcontrol --dump

Then I tar/gz the session dir and copy it over my x86 machine (Ubuntu running on VMWare). And try to run oreport on it. This oreport has been compiled from the same sources as the one that was cross compiled. 
andrea@ubuntu $ cd /tmp
andrea@ubuntu $ tar xzf oprofile.tgz
andrea@ubuntu $ LD_LIBRARY_PATH=/path/to/binutils/usr/lib /path/to/usr/bin/opreport --debug-info --session-dir=/tmp/oprofile /app/i/care/about -c -l --root /path/to/root/filesystem
/path/to/usr/bin/opreport error: /tmp/oprofile/samples/current/{root}/app/i/care/about/{dep}/{root}/app/i/care/about/CPU_CYCLES.100000.0.all.all.all: Invalid argument

I debugged it a bit and found out that when I cross compile for my ARM (it's a Cortex-A8 and I'm using CodeSourcery gcc as a cross compiler) doubles in structs are aligned by default, whereas in x86 gcc that doesn't happen unless we compile with -malign-double.

This causes a problem (at least) in this definition -- see my comment with the asterisks:

struct opd_header {
u8 magic[4];
u32 version;
u32 cpu_type;
u32 ctr_event;
u32 ctr_um;
u32 ctr_count;
// for cg file the from_cg_is_kernel
u32 is_kernel;
double cpu_speed; // NOTE: *** this is not naturally aligned and creates a _hole_ in the ARM case ***
time_t mtime;
u32 cg_to_is_kernel;
/* spu_profile=1 says sample file contains Cell BE SPU profile data */
u32 spu_profile;
uint64_t embedded_offset;
u64 anon_start;
u64 cg_to_anon_start;
/* binary compatibility reserve */
u32 reserved1[1];
};

I've been working around this issue by compiling the x86 version with -malign-double.
Am I doing something wrong in general? Any suggestions?

Thanks in advance,

Andrea