/usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

View: New views
15 Messages — Rating Filter:   Alert me  

/usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
trying to run Oprofile on this.

I tried running Oprofile with both these options: opcontrol --no-
vmlinux and
opcontrol --vmlinux=vmlinux.

But after doing opcontrol --start , I get this error:
/usr/bin/opcontrol: line 1118: echo: write error: Invalid argument
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Reading module info.
Failed to open profile device: Operation not permitted
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and
kernel syslog


The logs basically don't exist.

I have built the Oprofile with kernel-support option and I do
opcontrol --reset before trying any of the above options.

Any pointers to solve this problem will be helpful.

Thanks in advance.

Nupur 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

/usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
trying to run Oprofile on this.

I tried running Oprofile with both these options: opcontrol --no-
vmlinux and
opcontrol --vmlinux=vmlinux.

But after doing opcontrol --start , I get this error:
/usr/bin/opcontrol: line 1118: echo: write error: Invalid argument
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Reading module info.
Failed to open profile device: Operation not permitted
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and
kernel syslog


The logs basically don't exist.

I have built the Oprofile with kernel-support option and I do
opcontrol --reset before trying any of the above options.

Any pointers to solve this problem will be helpful.

Thanks in advance.

Nupur 



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Maynard Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

nupur garg wrote:

> Hello,
> I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
> trying to run Oprofile on this.
>
> I tried running Oprofile with both these options: opcontrol --no-
> vmlinux and
> opcontrol --vmlinux=vmlinux.
>
> But after doing opcontrol --start , I get this error:
> /*usr/bin/opcontrol: line 1118: echo: write error: Invalid argument*
What version of oprofile are you using?  In your reply, please paste in line 1118 from opcontrol, including enough context before and after that line so we can tell where we are in the script.

Thanks.
-Maynard

> Using default event: CPU_CLK_UNHALTED:100000:0:1:1
> Using 2.6+ OProfile kernel interface.
> Reading module info.
> Failed to open profile device: Operation not permitted
> Couldn't start oprofiled.
> Check the log file "/var/lib/oprofile/samples/oprofiled.log" and
> kernel syslog
>
>
> The logs basically don't exist.
>
> I have built the Oprofile with kernel-support option and I do
> opcontrol --reset before trying any of the above options.
>
> Any pointers to solve this problem will be helpful.
>
> Thanks in advance.
>
> Nupur
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

The part of script is:

# set a sysctl/oprofilefs parameter
set_param()
{
        if test "$KERNEL_SUPPORT" = "yes"; then
                echo $2 >$MOUNT/$1
        else
                $SYSCTL -w dev.oprofile.$1=$2
        fi
}

The bold line in the above script is the line where the write error is coming. And am using oprofile-0.9.5. 

Thanks and Regards,
Nupur Garg


On Thu, Oct 15, 2009 at 2:17 AM, Maynard Johnson <maynardj@...> wrote:
nupur garg wrote:
> Hello,
> I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
> trying to run Oprofile on this.
>
> I tried running Oprofile with both these options: opcontrol --no-
> vmlinux and
> opcontrol --vmlinux=vmlinux.
>
> But after doing opcontrol --start , I get this error:
> /*usr/bin/opcontrol: line 1118: echo: write error: Invalid argument*
What version of oprofile are you using?  In your reply, please paste in line 1118 from opcontrol, including enough context before and after that line so we can tell where we are in the script.

Thanks.
-Maynard

> Using default event: CPU_CLK_UNHALTED:100000:0:1:1
> Using 2.6+ OProfile kernel interface.
> Reading module info.
> Failed to open profile device: Operation not permitted
> Couldn't start oprofiled.
> Check the log file "/var/lib/oprofile/samples/oprofiled.log" and
> kernel syslog
>
>
> The logs basically don't exist.
>
> I have built the Oprofile with kernel-support option and I do
> opcontrol --reset before trying any of the above options.
>
> Any pointers to solve this problem will be helpful.
>
> Thanks in advance.
>
> Nupur
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Maynard Johnson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

nupur garg wrote:
> Hello,
> The part of script is:
>
> # set a sysctl/oprofilefs parameter
> set_param()
> {
>         if test "$KERNEL_SUPPORT" = "yes"; then
>                 *echo $2 >$MOUNT/$1*
I believe the EINVAL is coming from your oprofile kernel driver, since we're writing to the oprofilefs, and the kernel driver has the read/write file operations defined to handle the files created within that file system.  Do you know who the maintainer of your oprofile kernel driver is?  If so, I suggest contacting them for help.

-Maynard

>         else
>                 $SYSCTL -w dev.oprofile.$1=$2
>         fi
> }
>
> The bold line in the above script is the line where the write error is
> coming. And am using oprofile-0.9.5.
>
> Thanks and Regards,
> Nupur Garg
>
>
> On Thu, Oct 15, 2009 at 2:17 AM, Maynard Johnson <maynardj@...>wrote:
>
>> nupur garg wrote:
>>> Hello,
>>> I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
>>> trying to run Oprofile on this.
>>>
>>> I tried running Oprofile with both these options: opcontrol --no-
>>> vmlinux and
>>> opcontrol --vmlinux=vmlinux.
>>>
>>> But after doing opcontrol --start , I get this error:
>>> /*usr/bin/opcontrol: line 1118: echo: write error: Invalid argument*
>> What version of oprofile are you using?  In your reply, please paste in
>> line 1118 from opcontrol, including enough context before and after that
>> line so we can tell where we are in the script.
>>
>> Thanks.
>> -Maynard
>>
>>> Using default event: CPU_CLK_UNHALTED:100000:0:1:1
>>> Using 2.6+ OProfile kernel interface.
>>> Reading module info.
>>> Failed to open profile device: Operation not permitted
>>> Couldn't start oprofiled.
>>> Check the log file "/var/lib/oprofile/samples/oprofiled.log" and
>>> kernel syslog
>>>
>>>
>>> The logs basically don't exist.
>>>
>>> I have built the Oprofile with kernel-support option and I do
>>> opcontrol --reset before trying any of the above options.
>>>
>>> Any pointers to solve this problem will be helpful.
>>>
>>> Thanks in advance.
>>>
>>> Nupur
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> oprofile-list mailing list
>>> oprofile-list@...
>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>
>



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Robert Richter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 15.10.09 08:04:13, Maynard Johnson wrote:

> nupur garg wrote:
> > Hello,
> > The part of script is:
> >
> > # set a sysctl/oprofilefs parameter
> > set_param()
> > {
> >         if test "$KERNEL_SUPPORT" = "yes"; then
> >                 *echo $2 >$MOUNT/$1*
> I believe the EINVAL is coming from your oprofile kernel driver, since we're writing to the oprofilefs, and the kernel driver has the read/write file operations defined to handle the files created within that file system.  Do you know who the maintainer of your oprofile kernel driver is?  If so, I suggest contacting them for help.
>
> -Maynard
> >         else
> >                 $SYSCTL -w dev.oprofile.$1=$2
> >         fi
> > }
> >
> > The bold line in the above script is the line where the write error is
> > coming. And am using oprofile-0.9.5.
> >
> > Thanks and Regards,
> > Nupur Garg
> >
> >
> > On Thu, Oct 15, 2009 at 2:17 AM, Maynard Johnson <maynardj@...>wrote:
> >
> >> nupur garg wrote:
> >>> Hello,
> >>> I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
> >>> trying to run Oprofile on this.

This is a fairly old kernel. Are you using virtualization and is this
dom0?

What prints the following?

 # modprobe -l | grep oprofile

Eventually load the module:

 # modprobe oprofile

Is oprofile available:

 # cat /proc/filesystems | grep oprofile
 nodev   oprofilefs

Mount manually:

 # mkdir /dev/oprofile
 # mount -t oprofilefs nodev /dev/oprofile
 # find /dev/oprofile

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

The oprofile device is mounted.
I had one xen image also, I tried on it and oprofile worked perfectly fine on it. The difference between the ec2 image and this image I found was that in /sys/devices/system/ directory oprofile directory was not there. Looking around more I found that while compiling the kernel, Oprofile has to be set. The steps for that are there at http://www.ibm.com/developerworks/linux/library/l-oprof.html.I do not have a config file of the kernel on this image. But can this be the reason behind the device driver of oprofile not being enabled or the error that I am getting?

Thanks and Regards,
Nupur Garg


On Thu, Oct 15, 2009 at 7:23 PM, Robert Richter <robert.richter@...> wrote:
On 15.10.09 08:04:13, Maynard Johnson wrote:
> nupur garg wrote:
> > Hello,
> > The part of script is:
> >
> > # set a sysctl/oprofilefs parameter
> > set_param()
> > {
> >         if test "$KERNEL_SUPPORT" = "yes"; then
> >                 *echo $2 >$MOUNT/$1*
> I believe the EINVAL is coming from your oprofile kernel driver, since we're writing to the oprofilefs, and the kernel driver has the read/write file operations defined to handle the files created within that file system.  Do you know who the maintainer of your oprofile kernel driver is?  If so, I suggest contacting them for help.
>
> -Maynard
> >         else
> >                 $SYSCTL -w dev.oprofile.$1=$2
> >         fi
> > }
> >
> > The bold line in the above script is the line where the write error is
> > coming. And am using oprofile-0.9.5.
> >
> > Thanks and Regards,
> > Nupur Garg
> >
> >
> > On Thu, Oct 15, 2009 at 2:17 AM, Maynard Johnson <maynardj@...>wrote:
> >
> >> nupur garg wrote:
> >>> Hello,
> >>> I have an ec2-instance running kernel linux-2.6.21.7-2.fc8xen. I am
> >>> trying to run Oprofile on this.

This is a fairly old kernel. Are you using virtualization and is this
dom0?

What prints the following?

 # modprobe -l | grep oprofile

Eventually load the module:

 # modprobe oprofile

Is oprofile available:

 # cat /proc/filesystems | grep oprofile
 nodev   oprofilefs

Mount manually:

 # mkdir /dev/oprofile
 # mount -t oprofilefs nodev /dev/oprofile
 # find /dev/oprofile

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Robert Richter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 15.10.09 23:21:36, nupur garg wrote:
> Hello,
> The oprofile device is mounted.

Nupur,

what gives the following on your system with oprofile mounted?

 # uname -a
 # zgrep -i oprofile /proc/config.gz
 # dmesg | grep -i oprofile
 # find /dev/oprofile/
 # echo $(cat /dev/oprofile/cpu_type)

> I had one xen image also, I tried on it and oprofile worked perfectly fine
> on it. The difference between the ec2 image and this image I found was that
> in /sys/devices/system/ directory oprofile directory was not there. Looking
> around more I found that while compiling the kernel, Oprofile has to be set.

This happens if CONFIG_PM is not set and is only needed for
suspend/resume.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Robert,

The answers are inline.

 # uname -a
Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64 GNU/Linux

 # zgrep -i oprofile /proc/config.gz
gzip: /proc/config.gz: No such file or directory

 # dmesg | grep -i oprofile
xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
 
# find /dev/oprofile/
/dev/oprofile/
/dev/oprofile/1
/dev/oprofile/1/user
/dev/oprofile/1/kernel
/dev/oprofile/1/unit_mask
/dev/oprofile/1/count
/dev/oprofile/1/event
/dev/oprofile/1/enabled
/dev/oprofile/0
/dev/oprofile/0/user
/dev/oprofile/0/kernel
/dev/oprofile/0/unit_mask
/dev/oprofile/0/count
/dev/oprofile/0/event
/dev/oprofile/0/enabled
/dev/oprofile/stats
/dev/oprofile/stats/bt_lost_no_mapping
/dev/oprofile/stats/event_lost_overflow
/dev/oprofile/stats/sample_lost_no_mapping
/dev/oprofile/stats/sample_lost_no_mm
/dev/oprofile/stats/cpu1
/dev/oprofile/stats/cpu1/backtrace_aborted
/dev/oprofile/stats/cpu1/sample_lost_overflow
/dev/oprofile/stats/cpu1/sample_received
/dev/oprofile/stats/cpu0
/dev/oprofile/stats/cpu0/backtrace_aborted
/dev/oprofile/stats/cpu0/sample_lost_overflow
/dev/oprofile/stats/cpu0/sample_received
/dev/oprofile/pointer_size
/dev/oprofile/backtrace_depth
/dev/oprofile/cpu_type
/dev/oprofile/cpu_buffer_size
/dev/oprofile/buffer_watershed
/dev/oprofile/buffer_size
/dev/oprofile/buffer
/dev/oprofile/passive_domains
/dev/oprofile/active_domains
/dev/oprofile/dump
/dev/oprofile/enable
 

# echo $(cat /dev/oprofile/cpu_type)
i386/piii

Thanks and Regards,
Nupur Garg



On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@...> wrote:
On 15.10.09 23:21:36, nupur garg wrote:
> Hello,
> The oprofile device is mounted.

Nupur,

what gives the following on your system with oprofile mounted?

 # uname -a
 # zgrep -i oprofile /proc/config.gz
 # dmesg | grep -i oprofile
 # find /dev/oprofile/
 # echo $(cat /dev/oprofile/cpu_type)

> I had one xen image also, I tried on it and oprofile worked perfectly fine
> on it. The difference between the ec2 image and this image I found was that
> in /sys/devices/system/ directory oprofile directory was not there. Looking
> around more I found that while compiling the kernel, Oprofile has to be set.

This happens if CONFIG_PM is not set and is only needed for
suspend/resume.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I wish to know that will compiling the kernel be of any use for this issue as I had pointed out in my previous post. 

Thanks for the help in advance.

Nupur Garg


On Fri, Oct 16, 2009 at 5:10 AM, nupur garg <nupurgarg@...> wrote:
Hello Robert,

The answers are inline.

 # uname -a
Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64 GNU/Linux

 # zgrep -i oprofile /proc/config.gz
gzip: /proc/config.gz: No such file or directory

 # dmesg | grep -i oprofile
xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
 
# find /dev/oprofile/
/dev/oprofile/
/dev/oprofile/1
/dev/oprofile/1/user
/dev/oprofile/1/kernel
/dev/oprofile/1/unit_mask
/dev/oprofile/1/count
/dev/oprofile/1/event
/dev/oprofile/1/enabled
/dev/oprofile/0
/dev/oprofile/0/user
/dev/oprofile/0/kernel
/dev/oprofile/0/unit_mask
/dev/oprofile/0/count
/dev/oprofile/0/event
/dev/oprofile/0/enabled
/dev/oprofile/stats
/dev/oprofile/stats/bt_lost_no_mapping
/dev/oprofile/stats/event_lost_overflow
/dev/oprofile/stats/sample_lost_no_mapping
/dev/oprofile/stats/sample_lost_no_mm
/dev/oprofile/stats/cpu1
/dev/oprofile/stats/cpu1/backtrace_aborted
/dev/oprofile/stats/cpu1/sample_lost_overflow
/dev/oprofile/stats/cpu1/sample_received
/dev/oprofile/stats/cpu0
/dev/oprofile/stats/cpu0/backtrace_aborted
/dev/oprofile/stats/cpu0/sample_lost_overflow
/dev/oprofile/stats/cpu0/sample_received
/dev/oprofile/pointer_size
/dev/oprofile/backtrace_depth
/dev/oprofile/cpu_type
/dev/oprofile/cpu_buffer_size
/dev/oprofile/buffer_watershed
/dev/oprofile/buffer_size
/dev/oprofile/buffer
/dev/oprofile/passive_domains
/dev/oprofile/active_domains
/dev/oprofile/dump
/dev/oprofile/enable
 

# echo $(cat /dev/oprofile/cpu_type)
i386/piii

Thanks and Regards,
Nupur Garg



On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@...> wrote:
On 15.10.09 23:21:36, nupur garg wrote:
> Hello,
> The oprofile device is mounted.

Nupur,

what gives the following on your system with oprofile mounted?

 # uname -a
 # zgrep -i oprofile /proc/config.gz
 # dmesg | grep -i oprofile
 # find /dev/oprofile/
 # echo $(cat /dev/oprofile/cpu_type)

> I had one xen image also, I tried on it and oprofile worked perfectly fine
> on it. The difference between the ec2 image and this image I found was that
> in /sys/devices/system/ directory oprofile directory was not there. Looking
> around more I found that while compiling the kernel, Oprofile has to be set.

This happens if CONFIG_PM is not set and is only needed for
suspend/resume.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Robert Richter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 16.10.09 10:37:30, nupur garg wrote:
> Hello,
> I wish to know that will compiling the kernel be of any use for this issue
> as I had pointed out in my previous post.

Could you send also the last lines of the following, I want to see
which parameters opcontrol tries to write:

 /bin/sh -x /usr/bin/opcontrol --start

It seems there is some incompatibility between oprofile userland and
the xendriver. Actually we do not support and test this, so there can
be some flaw with it.

-Robert

>
> Thanks for the help in advance.
>
> Nupur Garg
>
>
> On Fri, Oct 16, 2009 at 5:10 AM, nupur garg <nupurgarg@...> wrote:
>
> > Hello Robert,
> > The answers are inline.
> >
> >  # uname -a
> > Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28
> > EST 2008 x86_64 GNU/Linux
> >
> >  # zgrep -i oprofile /proc/config.gz
> > gzip: /proc/config.gz: No such file or directory
> >
> >  # dmesg | grep -i oprofile
> > xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
> >
> > # find /dev/oprofile/
> > /dev/oprofile/
> > /dev/oprofile/1
> > /dev/oprofile/1/user
> > /dev/oprofile/1/kernel
> > /dev/oprofile/1/unit_mask
> > /dev/oprofile/1/count
> >  /dev/oprofile/1/event
> > /dev/oprofile/1/enabled
> > /dev/oprofile/0
> > /dev/oprofile/0/user
> > /dev/oprofile/0/kernel
> > /dev/oprofile/0/unit_mask
> > /dev/oprofile/0/count
> > /dev/oprofile/0/event
> > /dev/oprofile/0/enabled
> > /dev/oprofile/stats
> > /dev/oprofile/stats/bt_lost_no_mapping
> > /dev/oprofile/stats/event_lost_overflow
> > /dev/oprofile/stats/sample_lost_no_mapping
> > /dev/oprofile/stats/sample_lost_no_mm
> > /dev/oprofile/stats/cpu1
> > /dev/oprofile/stats/cpu1/backtrace_aborted
> > /dev/oprofile/stats/cpu1/sample_lost_overflow
> > /dev/oprofile/stats/cpu1/sample_received
> > /dev/oprofile/stats/cpu0
> > /dev/oprofile/stats/cpu0/backtrace_aborted
> > /dev/oprofile/stats/cpu0/sample_lost_overflow
> > /dev/oprofile/stats/cpu0/sample_received
> > /dev/oprofile/pointer_size
> > /dev/oprofile/backtrace_depth
> > /dev/oprofile/cpu_type
> > /dev/oprofile/cpu_buffer_size
> > /dev/oprofile/buffer_watershed
> > /dev/oprofile/buffer_size
> > /dev/oprofile/buffer
> > /dev/oprofile/passive_domains
> > /dev/oprofile/active_domains
> > /dev/oprofile/dump
> > /dev/oprofile/enable
> >
> >
> > # echo $(cat /dev/oprofile/cpu_type)
> > i386/piii
> >
> > Thanks and Regards,
> > Nupur Garg
> >
> >
> >
> > On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@...>wrote:
> >
> >> On 15.10.09 23:21:36, nupur garg wrote:
> >> > Hello,
> >> > The oprofile device is mounted.
> >>
> >> Nupur,
> >>
> >> what gives the following on your system with oprofile mounted?
> >>
> >>  # uname -a
> >>  # zgrep -i oprofile /proc/config.gz
> >>  # dmesg | grep -i oprofile
> >>  # find /dev/oprofile/
> >>  # echo $(cat /dev/oprofile/cpu_type)
> >>
> >> > I had one xen image also, I tried on it and oprofile worked perfectly
> >> fine
> >> > on it. The difference between the ec2 image and this image I found was
> >> that
> >> > in /sys/devices/system/ directory oprofile directory was not there.
> >> Looking
> >> > around more I found that while compiling the kernel, Oprofile has to be
> >> set.
> >>
> >> This happens if CONFIG_PM is not set and is only needed for
> >> suspend/resume.
> >>
> >> -Robert
> >>
> >> --
> >> Advanced Micro Devices, Inc.
> >> Operating System Research Center
> >> email: robert.richter@...
> >>
> >>
> >

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Suthikulpanit, Suravee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

These two scripts might help gather more information about the daemon
and driver during runtime.

Suravee

On Fri, 2009-10-16 at 08:53 -0500, Robert Richter wrote:

> On 16.10.09 10:37:30, nupur garg wrote:
> > Hello,
> > I wish to know that will compiling the kernel be of any use for this issue
> > as I had pointed out in my previous post.
>
> Could you send also the last lines of the following, I want to see
> which parameters opcontrol tries to write:
>
>  /bin/sh -x /usr/bin/opcontrol --start
>
> It seems there is some incompatibility between oprofile userland and
> the xendriver. Actually we do not support and test this, so there can
> be some flaw with it.
>
> -Robert
>
> >
> > Thanks for the help in advance.
> >
> > Nupur Garg
> >
> >
> > On Fri, Oct 16, 2009 at 5:10 AM, nupur garg <nupurgarg@...> wrote:
> >
> > > Hello Robert,
> > > The answers are inline.
> > >
> > >  # uname -a
> > > Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28
> > > EST 2008 x86_64 GNU/Linux
> > >
> > >  # zgrep -i oprofile /proc/config.gz
> > > gzip: /proc/config.gz: No such file or directory
> > >
> > >  # dmesg | grep -i oprofile
> > > xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
> > >
> > > # find /dev/oprofile/
> > > /dev/oprofile/
> > > /dev/oprofile/1
> > > /dev/oprofile/1/user
> > > /dev/oprofile/1/kernel
> > > /dev/oprofile/1/unit_mask
> > > /dev/oprofile/1/count
> > >  /dev/oprofile/1/event
> > > /dev/oprofile/1/enabled
> > > /dev/oprofile/0
> > > /dev/oprofile/0/user
> > > /dev/oprofile/0/kernel
> > > /dev/oprofile/0/unit_mask
> > > /dev/oprofile/0/count
> > > /dev/oprofile/0/event
> > > /dev/oprofile/0/enabled
> > > /dev/oprofile/stats
> > > /dev/oprofile/stats/bt_lost_no_mapping
> > > /dev/oprofile/stats/event_lost_overflow
> > > /dev/oprofile/stats/sample_lost_no_mapping
> > > /dev/oprofile/stats/sample_lost_no_mm
> > > /dev/oprofile/stats/cpu1
> > > /dev/oprofile/stats/cpu1/backtrace_aborted
> > > /dev/oprofile/stats/cpu1/sample_lost_overflow
> > > /dev/oprofile/stats/cpu1/sample_received
> > > /dev/oprofile/stats/cpu0
> > > /dev/oprofile/stats/cpu0/backtrace_aborted
> > > /dev/oprofile/stats/cpu0/sample_lost_overflow
> > > /dev/oprofile/stats/cpu0/sample_received
> > > /dev/oprofile/pointer_size
> > > /dev/oprofile/backtrace_depth
> > > /dev/oprofile/cpu_type
> > > /dev/oprofile/cpu_buffer_size
> > > /dev/oprofile/buffer_watershed
> > > /dev/oprofile/buffer_size
> > > /dev/oprofile/buffer
> > > /dev/oprofile/passive_domains
> > > /dev/oprofile/active_domains
> > > /dev/oprofile/dump
> > > /dev/oprofile/enable
> > >
> > >
> > > # echo $(cat /dev/oprofile/cpu_type)
> > > i386/piii
> > >
> > > Thanks and Regards,
> > > Nupur Garg
> > >
> > >
> > >
> > > On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@...>wrote:
> > >
> > >> On 15.10.09 23:21:36, nupur garg wrote:
> > >> > Hello,
> > >> > The oprofile device is mounted.
> > >>
> > >> Nupur,
> > >>
> > >> what gives the following on your system with oprofile mounted?
> > >>
> > >>  # uname -a
> > >>  # zgrep -i oprofile /proc/config.gz
> > >>  # dmesg | grep -i oprofile
> > >>  # find /dev/oprofile/
> > >>  # echo $(cat /dev/oprofile/cpu_type)
> > >>
> > >> > I had one xen image also, I tried on it and oprofile worked perfectly
> > >> fine
> > >> > on it. The difference between the ec2 image and this image I found was
> > >> that
> > >> > in /sys/devices/system/ directory oprofile directory was not there.
> > >> Looking
> > >> > around more I found that while compiling the kernel, Oprofile has to be
> > >> set.
> > >>
> > >> This happens if CONFIG_PM is not set and is only needed for
> > >> suspend/resume.
> > >>
> > >> -Robert
> > >>
> > >> --
> > >> Advanced Micro Devices, Inc.
> > >> Operating System Research Center
> > >> email: robert.richter@...
> > >>
> > >>
> > >
>
> --
> Advanced Micro Devices, Inc.
> Operating System Research Center
> email: robert.richter@...
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

oprofiled_monitor.sh (1014 bytes) Download Attachment
oprofile_drv_monitor.sh (2K) Download Attachment

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

The output of  /bin/sh -x /usr/bin/opcontrol --start is as follows:

Using default event: CPU_CLK_UNHALTED:100000:0:1:1

Using 2.6+ OProfile kernel interface.

Reading module info.

+ SYSCTL=do_sysctl

+ OBJDUMP=objdump

+ test -z ''

+ BINDIR=/usr/bin

++ /usr/bin/which /usr/bin/opcontrol

+ OPCONTROL=/usr/bin/opcontrol

++ /usr/bin/dirname /usr/bin/opcontrol

+ OPDIR=/usr/bin

+ PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

+ check_options_early --start

+ OPHELP=/usr/bin/ophelp

+ for i in '$@'

++ printf %s --start

++ awk -F= '{print $1}'

+ arg=--start

++ printf %s --start

++ awk -F= '{print $2}'

+ val=

+ case "$arg" in

+ test -z --start

++ id -u

+ test 0 = 0

+ load_module

+ OPROFILE_AVAILABLE=no

+ load_module_26

+ grep oprofilefs /proc/filesystems

+ test 0 -ne 0

+ mkdir /dev/oprofile

+ grep oprofilefs /etc/mtab

+ test 0 -ne 0

+ KERNEL_SUPPORT=yes

+ OPROFILE_AVAILABLE=yes

+ test yes '!=' yes

+ test yes '!=' yes

+ check_version

+ OPROFILE_AVAILABLE=no

+ grep oprofilefs /etc/mtab

+ test 0 -eq 0

+ KERNEL_SUPPORT=yes

+ OPROFILE_AVAILABLE=yes

+ return

+ do_init

+ BUF_SIZE=0

+ BUF_WATERSHED=0

+ CPU_BUF_SIZE=0

+ NOTE_SIZE=0

+ VMLINUX=

+ XENIMAGE=none

+ VERBOSE=

+ SEPARATE_LIB=0

+ SEPARATE_KERNEL=0

+ SEPARATE_THREAD=0

+ SEPARATE_CPU=0

+ CALLGRAPH=0

+ OPROFILED=/usr/bin/oprofiled

+ SETUP_DIR=/etc/oprofile

+ SETUP_FILE=/etc/oprofile/daemonrc

+ decide_oprofile_device_mount

+ test yes = yes

+ MOUNT=/dev/oprofile

++ cat /dev/oprofile/cpu_type

+ CPUTYPE=i386/piii

++ ls /dev/oprofile/

++ grep '^[0-9]\+$'

++ tr '\n' ' '

+ OP_COUNTERS='0 1 '

+ NR_CHOSEN=0

+ do_init_daemon_vars

+ test -n ''

+ do_load_setup

+ test -f /etc/oprofile/daemonrc

+ . /etc/oprofile/daemonrc

++ SESSION_DIR=/var/lib/oprofile

++ NR_CHOSEN=0

++ SEPARATE_LIB=0

++ SEPARATE_KERNEL=0

++ SEPARATE_THREAD=0

++ SEPARATE_CPU=0

++ VMLINUX=vmlinux

++ IMAGE_FILTER=

++ CPU_BUF_SIZE=0

++ CALLGRAPH=0

++ KERNEL_RANGE=ffffffff80200000,ffffffff80266330

++ XENIMAGE=none

+ test -n ''

+ test -z /var/lib/oprofile

+ LOCK_FILE=/var/lib/oprofile/lock

+ SAMPLES_DIR=/var/lib/oprofile/samples

+ LOG_FILE=/var/lib/oprofile/samples/oprofiled.log

+ CURRENT_SAMPLES_DIR=/var/lib/oprofile/samples/current

+ decide_oprofile_device

+ test yes = yes

+ DEVICE_FILE=/dev/oprofile/buffer

++ /usr/bin/ophelp --get-default-event

+ DEFAULT_EVENT=CPU_CLK_UNHALTED:100000:0:1:1

+ IS_TIMER=0

+ IS_PERFMON=0

+ test i386/piii = timer

+ case "$CPUTYPE" in

+ vecho 'Parameters used:'

+ test -n ''

+ vecho 'SESSION_DIR /var/lib/oprofile'

+ test -n ''

+ vecho 'LOCK_FILE   /var/lib/oprofile/lock'

+ test -n ''

+ vecho 'SAMPLES_DIR /var/lib/oprofile/samples'

+ test -n ''

+ vecho 'CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current'

+ test -n ''

+ vecho 'CPUTYPE i386/piii'

+ test -n ''

+ test 0 '!=' 0

+ vecho 'BUF_SIZE default value'

+ test -n ''

+ test 0 '!=' 0

+ vecho 'BUF_WATERSHED default value'

+ test -n ''

+ test yes = yes

+ test 0 '!=' 0

+ vecho 'CPU_BUF_SIZE default value'

+ test -n ''

+ vecho 'SEPARATE_LIB 0'

+ test -n ''

+ vecho 'SEPARATE_KERNEL 0'

+ test -n ''

+ vecho 'SEPARATE_THREAD 0'

+ test -n ''

+ vecho 'SEPARATE_CPU 0'

+ test -n ''

+ vecho 'CALLGRAPH 0'

+ test -n ''

+ vecho 'VMLINUX vmlinux'

+ test -n ''

+ vecho 'KERNEL_RANGE ffffffff80200000,ffffffff80266330'

+ test -n ''

+ vecho 'XENIMAGE none'

+ test -n ''

+ vecho 'XEN_RANGE '

+ test -n ''

++ id -u

+ test 0 '!=' 0

+ do_options --start

+ EXCLUSIVE_ARGC=0

+ SETUP=no

+ NEED_SETUP=no

+ SEEN_EVENT=0

+ '[' 1 -ne 0 ']'

++ printf %s --start

++ awk -F= '{print $1}'

+ arg=--start

++ printf %s --start

++ awk -F= '{print $2}'

+ val=

+ shift

+ test -z ''

+ local possibleval=

+ printf %s ''

+ grep '^-'

+ test 1 '!=' 0

+ val=

+ '[' 0 -ge 1 ']'

+ case "$arg" in

+ START=yes

++ expr 0 + 1

+ EXCLUSIVE_ARGC=1

+ EXCLUSIVE_ARGV=--start

+ '[' 0 -ne 0 ']'

+ normalise_events

+ test 0 -le 0

+ return

+ verify_counters

+ test 0 = 1

+ OPHELP_ARGS=

+ test 0 '!=' 0

+ test 1 -gt 1

+ test no = yes -a '' '!=' yes

+ test -n ''

+ test '' = yes

+ test 1 -eq 1 -a no = yes

+ do_operations

+ test '' = yes

+ test no = yes

+ test '' = yes

+ test yes = yes

+ do_start_daemon

+ test -f /var/lib/oprofile/lock

+ do_setup

+ create_dir /var/lib/oprofile

+ test '!' -d /var/lib/oprofile

+ test yes '!=' yes

+ create_dir /var/lib/oprofile/samples/current

+ test '!' -d /var/lib/oprofile/samples/current

+ check_valid_args

+ test -z vmlinux

+ test -f vmlinux

+ return

+ get_image_range linux

+ test linux = xen

+ test '!' -z ffffffff80200000,ffffffff80266330

+ return

+ get_image_range xen

+ test xen = xen

+ test '!' -z ''

+ FILE_IMAGE=none

+ test none = none

+ return

+ do_param_setup

+ test 0 '!=' 0

+ test 0 '!=' 0

+ test 0 '!=' 0

+ test -n ''

+ test 0 '!=' 0

+ test yes = yes -a -f /dev/oprofile/backtrace_depth

+ set_param backtrace_depth 0

+ test yes = yes

+ echo 0

/usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

+ test 0 = 1

+ test 0 = 0

+ set_event 0 CPU_CLK_UNHALTED:100000:0:1:1

+ eval CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1

++ CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1

+ NR_CHOSEN=1

++ /usr/bin/ophelp --check-events CPU_CLK_UNHALTED:100000:0:1:1 --callgraph=0

+ HW_CTRS='0 '

+ echo 'Using default event: CPU_CLK_UNHALTED:100000:0:1:1'

Using default event: CPU_CLK_UNHALTED:100000:0:1:1

+ for f in '$OP_COUNTERS'

+ set_ctr_param 0 enabled 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 0 event 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 0 count 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ for f in '$OP_COUNTERS'

+ set_ctr_param 1 enabled 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 1 event 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 1 count 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ verify_counters

+ test 0 = 1

+ OPHELP_ARGS=

+ test 1 '!=' 0

++ seq 0 0

+ for f in '`seq 0 $(($NR_CHOSEN - 1))`'

+ get_event 0

++ eval 'echo $CHOSEN_EVENTS_0'

+++ echo CPU_CLK_UNHALTED:100000:0:1:1

+ GOTEVENT=CPU_CLK_UNHALTED:100000:0:1:1

+ test CPU_CLK_UNHALTED:100000:0:1:1 '!=' ''

+ OPHELP_ARGS=' CPU_CLK_UNHALTED:100000:0:1:1'

++ /usr/bin/ophelp --check-events CPU_CLK_UNHALTED:100000:0:1:1 --callgraph=0

+ HW_CTRS='0 '

+ test 0 '!=' 0

+ OPROFILED_EVENTS=

++ seq 0 0

+ for f in '`seq 0 $(($NR_CHOSEN - 1))`'

+ get_event 0

++ eval 'echo $CHOSEN_EVENTS_0'

+++ echo CPU_CLK_UNHALTED:100000:0:1:1

+ GOTEVENT=CPU_CLK_UNHALTED:100000:0:1:1

+ test CPU_CLK_UNHALTED:100000:0:1:1 '!=' ''

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $1}'

+ EVENT=CPU_CLK_UNHALTED

++ /usr/bin/ophelp CPU_CLK_UNHALTED

+ EVENT_STR=121

+ check_event_mapping_data

+ is_non_cell_ppc64_variant i386/piii

+ case "$1" in

+ return 0

+ test 0 -ne 0

+ '[' i386/piii = ppc64/cell-be ']'

++ echo 121

++ awk '{print $1}'

+ EVENT_VAL=121

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $2}'

+ COUNT=100000

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $3}'

+ UNIT_MASK=0

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $4}'

+ KERNEL=1

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $5}'

+ USER=1

++ echo 0

++ awk '{print $1}'

+ CTR=0

+ test CPU_CLK_UNHALTED = SPU_CYCLES

+ test CPU_CLK_UNHALTED = RTC_INTERRUPTS

+ set_ctr_param 0 enabled 1

+ test 0 = yes

+ test yes = yes

+ echo 1

+ set_ctr_param 0 event 121

+ test 0 = yes

+ test yes = yes

+ echo 121

+ loop_count=1

+ for i in '${EVENT_STR}'

+ test 1 -gt 1

+ loop_count=2

+ set_ctr_param 0 count 100000

+ test 0 = yes

+ test yes = yes

+ echo 100000

+ set_ctr_param 0 kernel 1

+ test 0 = yes

+ test yes = yes

+ echo 1

+ set_ctr_param 0 user 1

+ test 0 = yes

+ test yes = yes

+ echo 1

+ set_ctr_param 0 unit_mask 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ OPROFILED_EVENTS=CPU_CLK_UNHALTED:121:

+ OPROFILED_EVENTS=CPU_CLK_UNHALTED:121:0:100000:0:

+ OPROFILED_EVENTS=CPU_CLK_UNHALTED:121:0:100000:0:1:1,

+ OPD_ARGS='            --session-dir=/var/lib/oprofile           --separate-lib=0        --separate-kernel=0             --separate-thread=0           --separate-cpu=0'

+ OPD_ARGS='            --session-dir=/var/lib/oprofile           --separate-lib=0        --separate-kernel=0             --separate-thread=0           --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1,'

+ test vmlinux = none

+ OPD_ARGS='            --session-dir=/var/lib/oprofile           --separate-lib=0        --separate-kernel=0             --separate-thread=0           --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux --kernel-range=ffffffff80200000,ffffffff80266330'

+ test none = none

+ test -z ''

+ test -n ''

+ vecho 'executing oprofiled              --session-dir=/var/lib/oprofile           --separate-lib=0          --separate-kernel=0           --separate-thread=0           --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux --kernel-range=ffffffff80200000,ffffffff80266330'

+ test -n ''

+ /usr/bin/oprofiled --session-dir=/var/lib/oprofile --separate-lib=0 --separate-kernel=0 --separate-thread=0 --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux --kernel-range=ffffffff80200000,ffffffff80266330

Failed to open profile device: Operation not permitted

Using 2.6+ OProfile kernel interface.

Reading module info.

+ COUNT=0

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 0 + 1

+ COUNT=1

+ test 1 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 1 + 1

+ COUNT=2

+ test 2 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 2 + 1

+ COUNT=3

+ test 3 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 3 + 1

+ COUNT=4

+ test 4 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 4 + 1

+ COUNT=5

+ test 5 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 5 + 1

+ COUNT=6

+ test 6 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 6 + 1

+ COUNT=7

+ test 7 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 7 + 1

+ COUNT=8

+ test 8 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 8 + 1

+ COUNT=9

+ test 9 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 9 + 1

+ COUNT=10

+ test 10 -eq 10

+ echo 'Couldn'\''t start oprofiled.'

Couldn't start oprofiled.

+ echo 'Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog'

Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog

+ exit 1

Thanks and Regards,
Nupur Garg
Computer Science,Graduate Student, University of California, SantaBarbara
805 708 7593


On Fri, Oct 16, 2009 at 7:23 PM, Robert Richter <robert.richter@...> wrote:
On 16.10.09 10:37:30, nupur garg wrote:
> Hello,
> I wish to know that will compiling the kernel be of any use for this issue
> as I had pointed out in my previous post.

Could you send also the last lines of the following, I want to see
which parameters opcontrol tries to write:

 /bin/sh -x /usr/bin/opcontrol --start

It seems there is some incompatibility between oprofile userland and
the xendriver. Actually we do not support and test this, so there can
be some flaw with it.

-Robert

>
> Thanks for the help in advance.
>
> Nupur Garg
>
>
> On Fri, Oct 16, 2009 at 5:10 AM, nupur garg <nupurgarg@...> wrote:
>
> > Hello Robert,
> > The answers are inline.
> >
> >  # uname -a
> > Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28
> > EST 2008 x86_64 GNU/Linux
> >
> >  # zgrep -i oprofile /proc/config.gz
> > gzip: /proc/config.gz: No such file or directory
> >
> >  # dmesg | grep -i oprofile
> > xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
> >
> > # find /dev/oprofile/
> > /dev/oprofile/
> > /dev/oprofile/1
> > /dev/oprofile/1/user
> > /dev/oprofile/1/kernel
> > /dev/oprofile/1/unit_mask
> > /dev/oprofile/1/count
> >  /dev/oprofile/1/event
> > /dev/oprofile/1/enabled
> > /dev/oprofile/0
> > /dev/oprofile/0/user
> > /dev/oprofile/0/kernel
> > /dev/oprofile/0/unit_mask
> > /dev/oprofile/0/count
> > /dev/oprofile/0/event
> > /dev/oprofile/0/enabled
> > /dev/oprofile/stats
> > /dev/oprofile/stats/bt_lost_no_mapping
> > /dev/oprofile/stats/event_lost_overflow
> > /dev/oprofile/stats/sample_lost_no_mapping
> > /dev/oprofile/stats/sample_lost_no_mm
> > /dev/oprofile/stats/cpu1
> > /dev/oprofile/stats/cpu1/backtrace_aborted
> > /dev/oprofile/stats/cpu1/sample_lost_overflow
> > /dev/oprofile/stats/cpu1/sample_received
> > /dev/oprofile/stats/cpu0
> > /dev/oprofile/stats/cpu0/backtrace_aborted
> > /dev/oprofile/stats/cpu0/sample_lost_overflow
> > /dev/oprofile/stats/cpu0/sample_received
> > /dev/oprofile/pointer_size
> > /dev/oprofile/backtrace_depth
> > /dev/oprofile/cpu_type
> > /dev/oprofile/cpu_buffer_size
> > /dev/oprofile/buffer_watershed
> > /dev/oprofile/buffer_size
> > /dev/oprofile/buffer
> > /dev/oprofile/passive_domains
> > /dev/oprofile/active_domains
> > /dev/oprofile/dump
> > /dev/oprofile/enable
> >
> >
> > # echo $(cat /dev/oprofile/cpu_type)
> > i386/piii
> >
> > Thanks and Regards,
> > Nupur Garg
> >
> >
> >
> > On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@...>wrote:
> >
> >> On 15.10.09 23:21:36, nupur garg wrote:
> >> > Hello,
> >> > The oprofile device is mounted.
> >>
> >> Nupur,
> >>
> >> what gives the following on your system with oprofile mounted?
> >>
> >>  # uname -a
> >>  # zgrep -i oprofile /proc/config.gz
> >>  # dmesg | grep -i oprofile
> >>  # find /dev/oprofile/
> >>  # echo $(cat /dev/oprofile/cpu_type)
> >>
> >> > I had one xen image also, I tried on it and oprofile worked perfectly
> >> fine
> >> > on it. The difference between the ec2 image and this image I found was
> >> that
> >> > in /sys/devices/system/ directory oprofile directory was not there.
> >> Looking
> >> > around more I found that while compiling the kernel, Oprofile has to be
> >> set.
> >>
> >> This happens if CONFIG_PM is not set and is only needed for
> >> suspend/resume.
> >>
> >> -Robert
> >>
> >> --
> >> Advanced Micro Devices, Inc.
> >> Operating System Research Center
> >> email: robert.richter@...
> >>
> >>
> >

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by nupur garg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Suravee,

The daemon also does not start. The starting of the daemon gives the same error as opcontol --start as I had mentioned in my first post.

So, the following output's are just running the script and not during runtime of Oprofile.
The output of  script oprofile_drv_monitor.sh is:

+ test -f /dev/oprofile/enable
+ echo '---- General Info ----'
---- General Info ----
++ cat /dev/oprofile/enable
+ echo '/dev/oprofile/enable                       : 0'
/dev/oprofile/enable                       : 0
++ cat /dev/oprofile/cpu_type
+ echo '/dev/oprofile/cpu_type                     : i386/piii'
/dev/oprofile/cpu_type                     : i386/piii
++ cat /dev/oprofile/buffer_size
+ echo '/dev/oprofile/buffer_size                  : 131072'
/dev/oprofile/buffer_size                  : 131072
++ cat /dev/oprofile/buffer_watershed
+ echo '/dev/oprofile/buffer_watershed             : 32768'
/dev/oprofile/buffer_watershed             : 32768
++ cat /dev/oprofile/cpu_buffer_size
+ echo '/dev/oprofile/cpu_buffer_size              : 8192'
/dev/oprofile/cpu_buffer_size              : 8192
++ cat /dev/oprofile/backtrace_depth
+ echo '/dev/oprofile/backtrace_depth              : 0'
/dev/oprofile/backtrace_depth              : 0
++ cat /dev/oprofile/time_slice
+ echo '/dev/oprofile/time_slice                   : '
/dev/oprofile/time_slice                   :
+ echo ''

+ echo '---- Lost Info ----'
---- Lost Info ----
++ cat /dev/oprofile/stats/event_lost_overflow
+ echo '/dev/oprofile/stats/event_lost_overflow    : 0'
/dev/oprofile/stats/event_lost_overflow    : 0
++ cat /dev/oprofile/stats/bt_lost_no_mapping
+ echo '/dev/oprofile/stats/bt_lost_no_mapping     : 0'
/dev/oprofile/stats/bt_lost_no_mapping     : 0
++ cat /dev/oprofile/stats/sample_lost_no_mapping
+ echo '/dev/oprofile/stats/sample_lost_no_mapping : 0'
/dev/oprofile/stats/sample_lost_no_mapping : 0
++ cat /dev/oprofile/stats/sample_lost_no_mm
+ echo '/dev/oprofile/stats/sample_lost_no_mm      : 0'
/dev/oprofile/stats/sample_lost_no_mm      : 0
++ cat /dev/oprofile/stats/multiplex_counter
+ echo '/dev/oprofile/stats/multiplex_counter      : '
/dev/oprofile/stats/multiplex_counter      :
+ echo ''

+ echo '---- CPU ----'
---- CPU ----
+ echo '  CPU  | sample_lost_overflow | sample_received'
  CPU  | sample_lost_overflow | sample_received
++ ls /dev/oprofile/stats
++ grep cpu
++ sed s/cpu//g
++ sort -n
+ for i in '`ls /dev/oprofile/stats | grep cpu | sed "s/cpu//g" |  sort -n`'
++ cat /dev/oprofile/stats/cpu0/sample_lost_overflow
++ cat /dev/oprofile/stats/cpu0/sample_received
+ echo '  0 | 0 | 0'
  0 | 0 | 0
+ for i in '`ls /dev/oprofile/stats | grep cpu | sed "s/cpu//g" |  sort -n`'
++ cat /dev/oprofile/stats/cpu1/sample_lost_overflow
++ cat /dev/oprofile/stats/cpu1/sample_received
+ echo '  1 | 0 | 0'
  1 | 0 | 0
+ echo ''

+ test -d /dev/oprofile/ibs_fetch
+ echo ''

+ test -d /dev/oprofile/ibs_op
+ echo ''

+ echo '---- PMC ----'
---- PMC ----
+ echo ' Counter | enabled | event | unitmasks | count'
 Counter | enabled | event | unitmasks | count
++ ls /dev/oprofile
++ grep '[0-9]'
++ sort -n
+ for i in '`ls /dev/oprofile | grep [0-9] | sort -n`'
++ cat /dev/oprofile/0/enabled
++ cat /dev/oprofile/0/event
++ cat /dev/oprofile/0/unit_mask
++ cat /dev/oprofile/0/count
+ echo '    0    | 1 | 121 | 0 | 100000'
    0    | 1 | 121 | 0 | 100000
+ for i in '`ls /dev/oprofile | grep [0-9] | sort -n`'
++ cat /dev/oprofile/1/enabled
++ cat /dev/oprofile/1/event
++ cat /dev/oprofile/1/unit_mask
++ cat /dev/oprofile/1/count
+ echo '    1    | 0 | 0 | 0 | 0'
    1    | 0 | 0 | 0 | 0
+ echo ''

And the output oprofiled_monitor.sh of script is:

/usr/local/bin/opcontrol: line 1076: echo: write error: Invalid argument
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Failed to open profile device: Operation not permitted
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog
root@domU-12-31-39-07-7A-71:~# /bin/sh -x oprofiled_monitor.sh
++ which pidof
+ PIDOF=/bin/pidof
++ /bin/pidof oprofiled
+ OPROFILED_PID=
+ test
+ echo 'Daemon pid                   : N/A'
Daemon pid                   : N/A
+ echo ''

+ echo 'Daemon command line          : N/A'
Daemon command line          : N/A
+ echo ''

+ echo 'Daemon file descriptor count : N/A'
Daemon file descriptor count : N/A
+ echo ''

+ test -f /var/lib/oprofile/lock
+ echo '/var/lib/oprofile/lock       : N/A'
/var/lib/oprofile/lock       : N/A
+ echo ''

+ test -f /var/lib/oprofile/complete_dump
+ echo 'Daemon complete_dump time    : N/A'
Daemon complete_dump time    : N/A
+ echo ''

Thanks for help in advance.

Thanks and Regards,
Nupur Garg


On Fri, Oct 16, 2009 at 7:43 PM, Suravee Suthikulpanit <suravee.suthikulpanit@...> wrote:
These two scripts might help gather more information about the daemon
and driver during runtime.

Suravee

On Fri, 2009-10-16 at 08:53 -0500, Robert Richter wrote:
> On 16.10.09 10:37:30, nupur garg wrote:
> > Hello,
> > I wish to know that will compiling the kernel be of any use for this issue
> > as I had pointed out in my previous post.
>
> Could you send also the last lines of the following, I want to see
> which parameters opcontrol tries to write:
>
>  /bin/sh -x /usr/bin/opcontrol --start
>
> It seems there is some incompatibility between oprofile userland and
> the xendriver. Actually we do not support and test this, so there can
> be some flaw with it.
>
> -Robert
>
> >
> > Thanks for the help in advance.
> >
> > Nupur Garg
> >
> >
> > On Fri, Oct 16, 2009 at 5:10 AM, nupur garg <nupurgarg@...> wrote:
> >
> > > Hello Robert,
> > > The answers are inline.
> > >
> > >  # uname -a
> > > Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28
> > > EST 2008 x86_64 GNU/Linux
> > >
> > >  # zgrep -i oprofile /proc/config.gz
> > > gzip: /proc/config.gz: No such file or directory
> > >
> > >  # dmesg | grep -i oprofile
> > > xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
> > >
> > > # find /dev/oprofile/
> > > /dev/oprofile/
> > > /dev/oprofile/1
> > > /dev/oprofile/1/user
> > > /dev/oprofile/1/kernel
> > > /dev/oprofile/1/unit_mask
> > > /dev/oprofile/1/count
> > >  /dev/oprofile/1/event
> > > /dev/oprofile/1/enabled
> > > /dev/oprofile/0
> > > /dev/oprofile/0/user
> > > /dev/oprofile/0/kernel
> > > /dev/oprofile/0/unit_mask
> > > /dev/oprofile/0/count
> > > /dev/oprofile/0/event
> > > /dev/oprofile/0/enabled
> > > /dev/oprofile/stats
> > > /dev/oprofile/stats/bt_lost_no_mapping
> > > /dev/oprofile/stats/event_lost_overflow
> > > /dev/oprofile/stats/sample_lost_no_mapping
> > > /dev/oprofile/stats/sample_lost_no_mm
> > > /dev/oprofile/stats/cpu1
> > > /dev/oprofile/stats/cpu1/backtrace_aborted
> > > /dev/oprofile/stats/cpu1/sample_lost_overflow
> > > /dev/oprofile/stats/cpu1/sample_received
> > > /dev/oprofile/stats/cpu0
> > > /dev/oprofile/stats/cpu0/backtrace_aborted
> > > /dev/oprofile/stats/cpu0/sample_lost_overflow
> > > /dev/oprofile/stats/cpu0/sample_received
> > > /dev/oprofile/pointer_size
> > > /dev/oprofile/backtrace_depth
> > > /dev/oprofile/cpu_type
> > > /dev/oprofile/cpu_buffer_size
> > > /dev/oprofile/buffer_watershed
> > > /dev/oprofile/buffer_size
> > > /dev/oprofile/buffer
> > > /dev/oprofile/passive_domains
> > > /dev/oprofile/active_domains
> > > /dev/oprofile/dump
> > > /dev/oprofile/enable
> > >
> > >
> > > # echo $(cat /dev/oprofile/cpu_type)
> > > i386/piii
> > >
> > > Thanks and Regards,
> > > Nupur Garg
> > >
> > >
> > >
> > > On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@...>wrote:
> > >
> > >> On 15.10.09 23:21:36, nupur garg wrote:
> > >> > Hello,
> > >> > The oprofile device is mounted.
> > >>
> > >> Nupur,
> > >>
> > >> what gives the following on your system with oprofile mounted?
> > >>
> > >>  # uname -a
> > >>  # zgrep -i oprofile /proc/config.gz
> > >>  # dmesg | grep -i oprofile
> > >>  # find /dev/oprofile/
> > >>  # echo $(cat /dev/oprofile/cpu_type)
> > >>
> > >> > I had one xen image also, I tried on it and oprofile worked perfectly
> > >> fine
> > >> > on it. The difference between the ec2 image and this image I found was
> > >> that
> > >> > in /sys/devices/system/ directory oprofile directory was not there.
> > >> Looking
> > >> > around more I found that while compiling the kernel, Oprofile has to be
> > >> set.
> > >>
> > >> This happens if CONFIG_PM is not set and is only needed for
> > >> suspend/resume.
> > >>
> > >> -Robert
> > >>
> > >> --
> > >> Advanced Micro Devices, Inc.
> > >> Operating System Research Center
> > >> email: robert.richter@...
> > >>
> > >>
> > >
>
> --
> Advanced Micro Devices, Inc.
> Operating System Research Center
> email: robert.richter@...
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

by Robert Richter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 16.10.09 22:13:34, nupur garg wrote:
> Hello,
> The output of  /bin/sh -x /usr/bin/opcontrol --start is as follows:

opcontrol fails two times:

First writing the backtrace_depth paramenter:

> + do_param_setup
>
> + test 0 '!=' 0
>
> + test 0 '!=' 0
>
> + test 0 '!=' 0
>
> + test -n ''
>
> + test 0 '!=' 0
>
> + test yes = yes -a -f /dev/oprofile/backtrace_depth
>
> + set_param backtrace_depth 0
>
> + test yes = yes
>
> + echo 0
>
> /usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

and then during starting the daemon:

> + /usr/bin/oprofiled --session-dir=/var/lib/oprofile --separate-lib=0
> --separate-kernel=0 --separate-thread=0 --separate-cpu=0
> --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux
> --kernel-range=ffffffff80200000,ffffffff80266330
>
> Failed to open profile device: Operation not permitted

Writing to /dev/oprofile/backtrace_depth calls a kernel function that
returns EINVAL, you will have to look at the source of your kernel for
this.

The second fails when opening /dev/oprofile/buffer. This may only
happen if you are not root (in the upstream kernel), maybe this is
different in a xen kernel.

So, you have to look at the sources of your xen kernel, esp. the
implemented file operations in oprofile_files.c.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@...


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list