Hi,

Unfortunately using 'opcontrol --reset' does not solve the problem


I have tried using a clean flash of the target device (i.e. there are no previous samples files / directories) the first time I run use oprofile.
But alas it makes no difference.

It appears that oprofile is collecting data - it just fails to write anything apart from the value 0 to the sample file. After running my program and shutting down oprofile (opcontrol --stop; opcontrol --dump;) the output of the sample file when viewed with xxd looks like:


0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000080: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000090: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................

Regards

Mark




 




Maynard Johnson <maynardj@us.ibm.com>

07/08/2009 20:55
Please respond to
maynardj@us.ibm.com

To
Mark.Pashley@selex-comms.com
cc
oprofile-list@lists.sourceforge.net
Subject
Re: Problems running oprofiled on embedded arm - Invalid Argument in oprofiled





Mark.Pashley@selex-comms.com wrote:
> Hi All,
>
> I am trying to run oprofile on an embedded arm platform, the details are
> as follows:
> Kernel Version:          2.6.17 (it has been customised)
> OProfile version:        0.9.4
> Target Toolchain:       arm-xscale-linux-gnu
>
> The commands I am using to run oprofile are as follows:
> (Note: Italics indicates output / from oprofiled / opreport)
Italics?  heh -- not in my email client.
>
> Configure / start oprofile:
> ash opcontrol --init

The error you pasted in below from the oprofiled.log comes from the daemon
finding a file in the samples directory that's not of the expected format.  Did
you do 'opcontrol --reset' before starting to clear out the samples directory?

-Maynard

> using arm/xscale2
> ash opcontrol --no-vmlinux --image=/mnt/spa-terminal-test-stripped
> --event=CPU_CYCLES:10000:0:1:1
> Using 2.6+ OProfile kernel interface.
> Using log file /mnt/samples/oprofiled.log
> Daemon started.
> Profiler running.
> ash opcontrol --start
> Profiler running.
>
> Run my program
>
> Stop / Shutdown oprofile:
> ash opcontrol --stop
> ash opcontrol --dump
> ash opcontrol --shutdown
>
>
> Running opreport gives the following errors
> opreport --accumulated --callgraph --debug-info --symbols
>         Error: header.magic = [80 80 80 80], OPD_MAGIC = DAE
>
> opreport error: Invalid sample file, bad magic number:
> /mnt/samples/current/{root}/mnt/spa-terminal-test-stripped/{dep}/{
>  root}/mnt/spa-terminal-test-stripped/CPU_CYCLES.10000.0.all.all.all
>
> (Note: I added some extra code to display the expected magic number and
> the values held in header.magic)
>
> Further inspection revealed that the input file (
> CPU_CYCLES.10000.0.all.all.all) is filled with NULLs
>
> The file: oprofiled.log contains the following:
> oprofiled started Thu Aug  6 17:00:50 2009
> kernel pointer size: 4
> oprofiled: open of
> /mnt/samples//current/{root}//mnt/spa-terminal-test-stripped/
> CPU_CYCLES.10000.0.all.all.all failed: Invalid argument
> oprofiled: open of
> /mnt/samples//current/{root}//mnt/spa-terminal-test-stripped/
> CPU_CYCLES.10000.0.all.all.all failed: Invalid argument
> // --------------
> Repeats for most of the file, followed by....
> // ---------------
> Thu Aug  6 17:04:43 2009
>
> Nr. sample dumps: 41
> Nr. non-backtrace samples: 1245235
> Nr. kernel samples: 1025437
> Nr. lost samples (no kernel/user): 0
> Nr. lost kernel samples: 0
> Nr. incomplete code structs: 6
> Nr. samples lost due to sample file open failure: 6687
> Nr. samples lost due to no permanent mapping: 0
> Nr. event lost due to buffer overflow: 2081823
> Nr. samples lost due to no mapping: 4306
> Nr. backtraces skipped due to no file mapping: 0
> Nr. samples lost due to no mm: 0
> Nr. samples lost cpu buffer overflow: 67940
> Nr. samples received: 2334860
> Nr. backtrace aborted: 0
> oprofiled stopped Thu Aug  6 17:04:43 2009
>
> I am unsure of how to proceed  or where the problem may lie. Any
> suggestions would be greatly appreciated.
>
> Regards
>
> Mark
>
> ------------------------------------------------------------
> This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein.  If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies.  It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose.
>
> In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel.
> SELEX Communications Limited is a Private Limited Company registered in England and Wales under Company Number 964533 and whose Registered Office is Lambda House, Christopher Martin Rd, Basildon, SS14 3EL. England.
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oprofile-list



------------------------------------------------------------
This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein. If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies. It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel.
SELEX Communications Limited is a Private Limited Company registered in England and Wales under Company Number 964533 and whose Registered Office is Lambda House, Christopher Martin Rd, Basildon, SS14 3EL. England.