Hi Monthadar,
 
I checked the script and found that it was not finding the "dirname" command.
When I checked our busybox configuration, I found dirname was not enabled,
so I enabled it, rebuilt, and tested again. Now, I get just:
 
    FATAL: Module oprofile not found.
    FATAL: Module oprofile not found.
    Kernel doesn't support oprofile.
 
I've appended my initial e-mail below, for clarity. If anyone has any feedback,
I'd appreciate it.
 
thanks,
John
=========================================================
Hi,
 
I'm trying to get Oprofile to work on an embedded system (Freescale MPC5200,
and Linux 2.6.11...). I added the following to the config file:
 
    CONFIG_PROFILING=y
    CONFIG_OPROFILE=y
.
.
.
    CONFIG_PKG_OPROFILE=y
 
On the first build, I got dependency errors, so I added the binutils and popt pkgs
to the config file.
 
Thereafter, it built correctly, but when the image is transferred to the target, and I
run any opcontrol command (for example: opcontrol --no-vmlinux), I get:
 
    /usr/bin/opcontrol: line 1: dirname: command not found
    FATAL: Module oprofile not found.
    FATAL: Module oprofile not found.
    Kernel doesn't support oprofile.
 
When I do an lsmod | grep oprof, oprofile doesn't show up.
 
In /usr/bin, I have op_help, opannotate, oparchive, opcontrol, opgprof, opreport,
oprofiled, and opstack. The directory /usr/share/oprofile is present, with all the arch
subdirs. Also, the docs are present in /usr/share/oprofile.
 
I got the same result building with CONFIG_OPROFILE=m.
 
Any idea why this is happening? To me it looks like the driver is not being built and
included correctly.
 
One caveat to our build method is that we specify the device directories during the
image build, by "mknod dev/watchdog c 10 130", etc., in the rootfs of the image that
gets installed on the target, and so udevd is not enabled on the target. Do I need to
add an entry for oprofile? Will building as a kernel module not work in this case, ie:
with CONFIG_OPROFILE=y?
 
Any help would be greatly appreciated.
 
regards,
John
=========================================================

 


From: Monthadar Al Jaberi <monthadar@gmail.com>
To: John Koshi <jkoshi@yahoo.com>
Cc: oprofile-list@lists.sourceforge.net
Sent: Saturday, April 18, 2009 2:11:06 AM
Subject: Re: Oprofile on an embedded system

>
> Thereafter, it built correctly, but when the image is transferred to the
> target, and I
> run any opcontrol command (for example: opcontrol --no-vmlinux), I get:
>
>     /usr/bin/opcontrol: line 1: dirname: command not found
>     FATAL: Module oprofile not found.
>     FATAL: Module oprofile not found.
>     Kernel doesn't support oprofile.
>

opcontrol is a script, and it is complaining that dirname command not
found. A quick search on the net and I found this, maybe it helps:

"3. Your problem is very likely related to a bogus value for PATH. If
dirname is not found, the bash_init.sh script, called when running
shell commands, will go into infinite recursion. Since dirname should
be on any system, I’d say we need to figure out why it is not found on
yours." (http://ticket.macromates.com/show?ticket_id=7E95016C)

You should fix this error first.

When I cross compiled oprofile to arm, I also got script problem, but
that was along time ago, I don't really remember, but I think I cross
compiled binutils and only used what opcontrol needed =)

br,

--
//Monthadar Al Jaberi