How did you get the sample information over to the host?
I assume the steps would be:
- oparchive on target
- transfer archive to host
- opimport on host (to convert samples)
- opreport on host (on converted samples)
I had a problem running oparchive on my target:
[root@srp-ge-head bin]# oparchive -o /tmp/current_data
warning: /no-vmlinux could not be found.
can't copy from /var/lib/oprofile/abi to /tmp/current_data/var/lib/oprofile/abi cause: No such file or directory
can't copy from /var/lib/oprofile/oprofiled.log to /tmp/current_data/var/lib/oprofile/oprofiled.log cause: No such file or directory
Note that I ran opcontrol –setup –no-vmlinux because of embedded system
When I manually copied the /var/lib/oprofile directory to my host, and tried opimport, this did not work as well.
opimport: opimport.cpp:202: int main(int, const char**): Assertion `(in = mmap(0
, statb.st_size, 0x1, 0x02, in_fd, 0)) != (void *)-1' failed.
The one example in the oprofile manual was not clear if source and dest pointed to a single sample file, or the /var/lib/oprofile directories. Since there are many sample files, it is unwieldy to have to convert individual files.
Has this worked for anyone?
Sent: Wednesday, June 25, 2008 10:13 PM
To: Donak, John;
Subject: RE: Running oprofile on embedded systems
I¡¯ve done that before to run opcontrol on mips target and opreport on host x86 desktop (connected to target via nfs). The followings are the things that I needed to do to that.
- Libbfd version installed on target and host should be same
- All the element of opd_header definition in libop/op_sample_file.h should be consistent between the two
- File name of the sample directory is used to generate hash key, so, I needed to modify file name (str) given to op_hash_string() in dbmanage.c for opreport against x86.
- Once I¡¯ve done the above things, I got nfs synchronization problem, as a work around, I gave additional MS_INVALIDATE option in odb_sync() function in libdb/db_manage.c and added sfile_sync_files() right after complete_dump() in function opd_do_samples in daemon/init.c
It was an ugly hack to make it work and I don¡¯t have the sources now. The above was gotten from my note.
I used oprofile-0.9.3.
I hope I didn¡¯t miss anything needed,
[mailto:email@example.com] On Behalf Of Donak, John
Sent: Thursday, June 26, 2008
Subject: Running oprofile on embedded systems
I am trying to run oprofile 0.9.3 on a small embedded linux-ppc system, with some success.
I was able to cross-compile it on my host (linux-x86) and get it running on my target (linux-ppc).
Given that my arch (MPC6260) has no performance counters, I am simply running it in timer mode. I can get opreport output, but with no symbol info.
My big issue is that since I do not have a lot of memory, binaries are built with symbol information stripped.
My goal is to collect the data on the target and analyze it (via opreport) on the host. The oprofile manual suggests this is possible, but I am having trouble getting this to work. The manual does not provide much detailed help here.
So, is the above possible? I hope that if the samples (with PC info) are collected on the target, then I can transfer them to the host and run opreport (host version) there – using the same binaries recompiled with symbol information – to get a full report with symbols.
Has anyone gotten this to work for their environment?