I believe this error is occurring because  JFFS2, which I am using, only supports readonly mmap.  It does not support shared writable mmap.

Is there a workaround for oprofile using JFFS2?


On Nov 6, 2009, at 2:45 PM, jobhunts02@aol.com wrote:

Following a posting from last year "/etc/mtab not present on my busybox system,"  I was able to fix both the "Kernel support not available" and the "Device or resource busy" errors by replacing /etc/mtab with /proc/mounts.

 

I am still seeing:

 

oprofiled: open of /var/lib/oprofile/samples//current/{root}//root/freescale_test/{dep}/{root}//root/freescale_test/TIMER.0.0.all.all.all failed:  Invalid argument

 

repeated over and over in  oprofiled.log.   This happens because the call to mmap in odb_open in libdb/db_manage.c is returning MAP_FAILED. The arguments to mmap are start = 0, length = 2680, prot = 3, flags = MAP_SHARED, fd = 5,  offset = 0.  errno = 22 (Invalid argument)

 

What could cause any of these arguments to be invalid?




On Nov 6, 2009, at 12:00 PM, jobhunts02@aol.com wrote:

I must confess that I had previously altered check_version() to avoid a "Kernel support not available" error I was getting initially because my kernel should support oprofile.  So, I went back to the original version and this is what happens when I try to start oprofile after rebooting my board:

 

Eclipse # insmod oprofile.ko

Eclipse # /usr/bin/opcontrol --init

Kernel support not available, missing opcontrol --init as root ?

 

/etc/mtab is empty.  I am doing everything as root. 

 

I apologize for having bypassed this error.  Should "oprofilefs" appear in /etc/mtab after inmod'ing oprofile.ko and doing opcontrol --init?


Sent from my iPhone 3G

On Nov 6, 2009, at 10:19 AM, Maynard Johnson <maynardj@us.ibm.com> wrote:

Robert Richter wrote:
On 03.11.09 10:21:40, jobhunts02@aol.com wrote:
I tried that and am still seeing the "bad magic number" error when  running opreport and "Invalid argument" entries in oprofiled.log.


The commands I am using and part of oprofiled.log follow.  Any  suggestions?

Eclipse # rm /var/lib/oprofile/samples/oprofiled.log
Eclipse # rm -rf /var/lib/oprofile/samples/current/
Eclipse # cd /usr/bin/
Eclipse # ./opcontrol --init
mount: mounting nodev on /dev/oprofile failed: Device or resource busy
There is an error mounting oprofilefs, try the following steps to
debug this:
You need to figure out why the init is failing.  Any oprofile commands you do afterwards are useless until you fix this.  It sounds to me like you still have an oprofile daemon running.  Do 'ps awx |grep oprofiled' to see if the daemon is running.  If so, do:
 1. opcontrol --deinit
 2. rm /root/.oprofile/daemonrc
 3. opcontrol --init
 4. Execute your other opcontrol setup commands to specify profiling parameters
 5. 'opcontrol --start' and run your app.
 6. generate your report(s) with opreport

If the 'ps' command shows oprofiled is not running, you need to determine why you're getting "Device or resource busy".  Look at dmesg.  Are there any other perf tools on the system that might be using the performance monitoring hardware?


-Maynard
First, unmount /dev/oprofile if it is there.
The script tries to mount the oprofile filesystem that the kernel
should provide. It checks /proc/filesystems, you should get something
like this on your system:
# cat /proc/filesystems | grep oprofile
nodev  oprofilefs
If it is not there, the script tries then to load the oprofile module
and checks the filesystem again. oprofile should then be listed in
/proc/modules and also oprofilefs in /proc/filesystems. If not, the
script fails. Maybe /proc is disabled or not available? Not sure if
this is a config option.
You can also try to mount oprofile directly:
# mkdir /dev/oprofile
# mount -t oprofilefs nodev /dev/oprofile
Also, it seems you are using an own build of oprofile, which version
are you using. Did you use configure/make/make install to install the
package on your system? Which config did you use to compile your
kernel?
-Robert

=
------------------------------------------------------------------------------
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
=
=