Hi,
 
Thank you, Maynard.
It was really caused by the JFFS2 file system.
Currently I used the ramfs to work around. There is still problem when running the application because much ram is cost.
Is there any other way to work around this problem?
 
Besides the above issue, oprofile cannot analyze the source code and shows the module level performance.
I confirm the kernel module driver was compiled with "-g -O" options.
The image is mounted through NFS.
Could you give some suggestion about this?
 
The following is the output when running opreport.
 
 /work/myBinutils/bin/opreport -l
WARNING! The OProfile kernel driver reports sample buffer overflows.
Such overflows can result in incorrect sample attribution, invalid sample
files and other symptoms.  See the oprofiled.log for details.
You should adjust your sampling frequency to eliminate (or at least minimize)
these overflows.

warning: /linx could not be found.
warning: /linx_eth_cm could not be found.

warning: [vdso] (tgid:1692 range:0x100000-0x103000) could not be found.
CPU: e500, speed 600 MHz (estimated)
Counted CPU_CLK events (Cycles) with a unit mask of 0x00 (No unit mask) count 10000
samples  %        image name               app name                 symbol name
489691   92.4900  oprofiled                oprofiled                /work/myBinutils/bin/oprofiled
12442     2.3500  linx                     linx                     /linx
......
2742      0.5179  sigbenchall              sigbenchall              /home/quli/sigbenchall
2553      0.4822  libc-2.8.so              libc-2.8.so              /lib/libc-2.8.so
1849      0.3492  linx_eth_cm              linx_eth_cm              /linx_eth_cm
528       0.0997  ld-2.8.so                ld-2.8.so                /lib/ld-2.8.so
527       0.0995  busybox                  busybox                  /bin/busybox
330       0.0623  ophelp                   ophelp                   /work/myBinutils/bin/ophelp
11        0.0021  libm-2.8.so              libm-2.8.so              /lib/libm-2.8.so
4        7.6e-04  linxstat                 linxstat                 /home/quli/linxstat
1        1.9e-04  [vdso] (tgid:1692 range:0x100000-0x103000) sigbenchall              [vdso] (tgid:1692 range:0x100000-0x103000)
1        1.9e-04  libdl-2.8.so             libdl-2.8.so             /lib/libdl-2.8.so
1        1.9e-04  libnss_files-2.8.so      libnss_files-2.8.so      /lib/libnss_files-2.8.so
1        1.9e-04  mklink                   mklink                   /home/quli/mklink
......
 
 
/work/myBinutils/bin/opreport -l -p /mnt/
WARNING! The OProfile kernel driver reports sample buffer overflows.
Such overflows can result in incorrect sample attribution, invalid sample
files and other symptoms.  See the oprofiled.log for details.
You should adjust your sampling frequency to eliminate (or at least minimize)
these overflows.
warning: /linx could not be found.
warning: [vdso] (tgid:1692 range:0x100000-0x103000) could not be found.
CPU: e500, speed 600 MHz (estimated)
Counted CPU_CLK events (Cycles) with a unit mask of 0x00 (No unit mask) count 10000

warning: could not check that the binary file /mnt/linx_eth_cm.ko has not been modified since the profile was taken. Results may be inaccurate.

samples  %        image name               app name                 symbol name
489691   96.2381  oprofiled                oprofiled                /work/myBinutils/bin/oprofiled
12442     2.4452  linx                     linx                     /linx
2742      0.5389  sigbenchall              sigbenchall              /home/quli/sigbenchall
2553      0.5017  libc-2.8.so              libc-2.8.so              /lib/libc-2.8.so
528       0.1038  ld-2.8.so                ld-2.8.so                /lib/ld-2.8.so
527       0.1036  busybox                  busybox                  /bin/busybox
330       0.0649  ophelp                   ophelp                   /work/myBinutils/bin/ophelp
11        0.0022  libm-2.8.so              libm-2.8.so              /lib/libm-2.8.so
4        7.9e-04  linxstat                 linxstat                 /home/quli/linxstat
1        2.0e-04  [vdso] (tgid:1692 range:0x100000-0x103000) sigbenchall              [vdso] (tgid:1692 range:0x100000-0x103000)
1        2.0e-04  libdl-2.8.so             libdl-2.8.so             /lib/libdl-2.8.so
1        2.0e-04  libnss_files-2.8.so      libnss_files-2.8.so      /lib/libnss_files-2.8.so
1        2.0e-04  mklink                   mklink                   /home/quli/mklink

 
Thanks,
Ty
2010/5/20 Maynard Johnson <maynardj@us.ibm.com>
Ty wrote:
> Hi,
>
> I encoutered one problem when I tried to run oprofile on PowerPC (P2020)
> board.
> The information is "
> /work/myBinutils/bin/opreport

I presume you're running opreport on something other than your ppc board . . . Is the same version of oprofile installed there?

> Overflow stats not available
> /work/myBinutils/bin/opreport error: Invalid sample file, bad magic number:
> /var/lib/oprofile/samples/current/{kern}/no-vmlinux/{dep}/{kern}/no-vmlinux/CPU_CLK.10000.0.0.0.0
> ".
>
> This is one part of the oprofile.log.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> oprofiled started Thu Jan  1 00:15:48 1970
> kernel pointer size: 4
> Read buffer of 109217 entries.
> CPU_SWITCH to 0
> CPU_SWITCH to 0
> ...
> KERNEL_ENTER_SWITCH to kernel
> CTX_SWITCH to tid 1463, tgid 1463, cookie df414440(/bin/busybox)
> Opening
> "/var/lib/oprofile/samples//current/{root}//bin/busybox/{dep}/{kern}/no-vmlinux/CPU_CLK.10000.0.1463.1463.0"
> oprofiled: open of
> /var/lib/oprofile/samples//current/{root}//bin/busybox/{dep}/{kern}/no-vmlinux/CPU_CLK.10000.0.1463.1463.0
> failed: Invalid argument

This looks suspiciously like the problem reported by jobhunts02 on Nov 3, 2009.  See oprofile-list, subject heading "Re: No sample file found".  For that person, they found the problem was due to using jffs2 filesystem for storing samples.  See http://wiki.laptop.org/go/Oprofile_setup.
[snip]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The following packages were used.
> 1) oprofile 0.9.6
> 2) binutils 2.19
> 3) popt     1.7
> They were cross-compiled for PowerPC on Host Ubuntu 8.04 running on VMWare
> 6.5.2.
>
> The following is the procedure I ran the oprofile.
> rm /var/lib/oprofile/samples/oprofiled.log
> rm -rf /var/oprofile/sameples/current/
> rm -f /etc/mtab
> opcontrol --init
> touch /etc/mtab
> echo "nodev /dev/oprofile oprofilefs rw 0 0" > /etc/mtab
> opcontrol --init
> opcontrol --setup --no-vmlinux --event=CPU_CLK:10000:0:1:1
> opcontrol --start-daemon -V
> opcontrol --start -V
Avoid the -V option except for debugging.
> opcontrol --dump
> opcontrol --stop
Use 'opcontrol --shutdown' instead of dump and stop.  That way, opreport will be able to show overflow stats, too.  Another good reason to do shutdown is that if you want to change profiling parameters for a subsequent run, the oprofiled won't pick the new parameters up until you shut it down and restart anyway.

> opreport
>
> There were some lines that showed on screen.
> Parameters used:
> SESSION_DIR /var/lib/oprofile
> LOCK_FILE /var/lib/oprofile/lock
> SAMPLES_DIR /var/lib/oprofile/samples
> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current
> CPUTYPE ppc/e500
> BUF_SIZE default value
> BUF_WATERSHED default value
> CPU_BUF_SIZE default value
> SEPARATE_LIB 1
> SEPARATE_KERNEL 1
> SEPARATE_THREAD 1
> SEPARATE_CPU 1
> CALLGRAPH 0
> VMLINUX none
> KERNEL_RANGE
> XENIMAGE none
> XEN_RANGE
> Detected stale lock file. Removing.
> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1
> --separate-kernel=1 --separate-thread=1 --separate-cpu=1
> --events=CPU_CLK:1:0:10000:0:1:1, --no-vmlinux --verbose=all
> Events: CPU_CLK:1:0:10000:0:1:1,
> Using 2.6+ OProfile kernel interface.
> Using log file /var/lib/oprofile/samples/oprofiled.log
> Daemon started.
> /////////////////////////
> Parameters used:
> SESSION_DIR /var/lib/oprofile
> LOCK_FILE /var/lib/oprofile/lock
> SAMPLES_DIR /var/lib/oprofile/samples
> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current
> CPUTYPE ppc/e500
> BUF_SIZE default value
> BUF_WATERSHED default value
> CPU_BUF_SIZE default value
> SEPARATE_LIB 1
> SEPARATE_KERNEL 1
> SEPARATE_THREAD 1
> SEPARATE_CPU 1

Do you really need everything separated?  opreport can't show all these levels of separation at a time unless you output to XML (and, presumably, have some sort of GUI you can import that xml file into).  opreport will force you to specify some merging in order for it to generate a non-xml report.  Separate kernel and lib are probably the most helpful, and no merging is required for that.

-Maynard

> CALLGRAPH 0
> VMLINUX none
> KERNEL_RANGE
> XENIMAGE none
> XEN_RANGE
> Profiler running.
>
> Any information is appreciated.
>
> Best regards
>
> Ty
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
>
> _______________________________________________
> oprofile-list mailing list
> https://lists.sourceforge.net/lists/listinfo/oprofile-list