Trouble profiling kernel module

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The driver that I want to profile (driver.ko) is in the /drivers directory.  I loaded the module using insmod.  Here are the commands I am using:

Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
Eclipse # /usr/bin/opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
Eclipse # /usr/bin/opcontrol --stop
Stopping profiling.
Eclipse # /usr/bin/opreport -p=/AAESystems/bin
Overflow stats not available
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
          TIMER:0|
  samples|      %|
------------------
     1145 93.6989 no-vmlinux
       26  2.1277 libc-2.6.so
       18  1.4730 EclipseMSW.elf.NOV8
       15  1.2275 ld-2.6.so
       10  0.8183 busybox
        4  0.3273 dropbearmulti
        4  0.3273 libpthread-2.6.so


As you can see, I am getting no information regarding driver.ko.  

I did specify the path where the driver.ko file is.  How do I get information regarding driver.ko?


Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

Correction..driver.ko is in the /AAESystems/bin diectory.


On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>  
wrote:

>
> I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The  
> driver
> that I want to profile (driver.ko) is in the /drivers directory.  I  
> loaded
> the module using insmod.  Here are the commands I am using:
>
> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
> Eclipse # /usr/bin/opcontrol --start
> Using 2.6+ OProfile kernel interface.
> Using log file /var/lib/oprofile/samples/oprofiled.log
> Daemon started.
> Profiler running.
> Eclipse # /usr/bin/opcontrol --stop
> Stopping profiling.
> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
> Overflow stats not available
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
>          TIMER:0|
>  samples|      %|
> ------------------
>     1145 93.6989 no-vmlinux
>       26  2.1277 libc-2.6.so
>       18  1.4730 EclipseMSW.elf.NOV8
>       15  1.2275 ld-2.6.so
>       10  0.8183 busybox
>        4  0.3273 dropbearmulti
>        4  0.3273 libpthread-2.6.so
>
>
> As you can see, I am getting no information regarding driver.ko.
>
> I did specify the path where the driver.ko file is.  How do I get
> information regarding driver.ko?
>
>
> --
> View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
> Sent from the oprofile-list mailing list archive at Nabble.com.
>
>
> ---
> ---
> ---
> ---------------------------------------------------------------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> Correction..driver.ko is in the /AAESystems/bin diectory.
>
>
> On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>  
> wrote:
>
>> I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The  
>> driver
>> that I want to profile (driver.ko) is in the /drivers directory.  I  
>> loaded
>> the module using insmod.  Here are the commands I am using:
>>
>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>> Eclipse # /usr/bin/opcontrol --start
>> Using 2.6+ OProfile kernel interface.
>> Using log file /var/lib/oprofile/samples/oprofiled.log
>> Daemon started.
>> Profiler running.
>> Eclipse # /usr/bin/opcontrol --stop
>> Stopping profiling.
>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
I presume this isn't *really* the way you specified the -p option, since you would get an error this way.  Assuming you actually used '-p /AAESystems/bin', then opreport should find your kernel module.  Are you sure the module was doing anything where it would actually generate samples?

-Maynard

>> Overflow stats not available
>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>> Profiling through timer interrupt
>>          TIMER:0|
>>  samples|      %|
>> ------------------
>>     1145 93.6989 no-vmlinux
>>       26  2.1277 libc-2.6.so
>>       18  1.4730 EclipseMSW.elf.NOV8
>>       15  1.2275 ld-2.6.so
>>       10  0.8183 busybox
>>        4  0.3273 dropbearmulti
>>        4  0.3273 libpthread-2.6.so
>>
>>
>> As you can see, I am getting no information regarding driver.ko.
>>
>> I did specify the path where the driver.ko file is.  How do I get
>> information regarding driver.ko?
>>
>>
>> --
>> View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>
>>
>> ---
>> ---
>> ---
>> ---------------------------------------------------------------------
>> 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@...
>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>
> ------------------------------------------------------------------------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>  
wrote:

> jobhunts02@... wrote:
>> Correction..driver.ko is in the /AAESystems/bin diectory.
>>
>>
>> On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
>> wrote:
>>
>>> I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The
>>> driver
>>> that I want to profile (driver.ko) is in the /drivers directory.  I
>>> loaded
>>> the module using insmod.  Here are the commands I am using:
>>>
>>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>>> Eclipse # /usr/bin/opcontrol --start
>>> Using 2.6+ OProfile kernel interface.
>>> Using log file /var/lib/oprofile/samples/oprofiled.log
>>> Daemon started.
>>> Profiler running.
>>> Eclipse # /usr/bin/opcontrol --stop
>>> Stopping profiling.
>>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
> I presume this isn't *really* the way you specified the -p option,  
> since you would get an error this way.  Assuming you actually used '-
> p /AAESystems/bin', then opreport should find your kernel module.  
> Are you sure the module was doing anything where it would actually  
> generate samples?
>
> -Maynard

I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
bin". No error either way.

The module is definitely running and several functions are being  
executed repeatedly.  What do you mean by a module "doing anything  
where it would actually generate samples?"

Am I using the correct commands to get profile information from a  
module?


>
>>> Overflow stats not available
>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>> Profiling through timer interrupt
>>>         TIMER:0|
>>> samples|      %|
>>> ------------------
>>>    1145 93.6989 no-vmlinux
>>>      26  2.1277 libc-2.6.so
>>>      18  1.4730 EclipseMSW.elf.NOV8
>>>      15  1.2275 ld-2.6.so
>>>      10  0.8183 busybox
>>>       4  0.3273 dropbearmulti
>>>       4  0.3273 libpthread-2.6.so
>>>
>>>
>>> As you can see, I am getting no information regarding driver.ko.
>>>
>>> I did specify the path where the driver.ko file is.  How do I get
>>> information regarding driver.ko?
>>>
>>>
>>> --
>>> View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
>>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>>
>>>
>>> ---
>>> ---
>>> ---
>>> ---
>>> ------------------------------------------------------------------
>>> 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@...
>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>
>> ---
>> ---
>> ---
>> ---------------------------------------------------------------------
>> 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@...
>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

RE: Trouble profiling kernel module

by Santos, Jose Renato G :: Rate this Message:

| View Threaded | Show Only this Message

Try specifying a kernel image with option --vmlinux=<image> instead of --no-vmlinux when you run opcontrol.
I am not sure oprofile can distinguish modules from kernel samples with no-vmlinux option, but worth it a try...

Renato

> -----Original Message-----
> From: Washington Ratso [mailto:JobHunts02@...]
> Sent: Tuesday, November 10, 2009 11:23 AM
> To: oprofile-list@...
> Subject: Trouble profiling kernel module
>
>
> I am running Linux 2.6.26 on an MPC8248 with busybox and
> JFFS2.  The driver that I want to profile (driver.ko) is in
> the /drivers directory.  I loaded the module using insmod.  
> Here are the commands I am using:
>
> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux Eclipse #
> /usr/bin/opcontrol --start Using 2.6+ OProfile kernel interface.
> Using log file /var/lib/oprofile/samples/oprofiled.log
> Daemon started.
> Profiler running.
> Eclipse # /usr/bin/opcontrol --stop
> Stopping profiling.
> Eclipse # /usr/bin/opreport -p=/AAESystems/bin Overflow stats
> not available
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
>           TIMER:0|
>   samples|      %|
> ------------------
>      1145 93.6989 no-vmlinux
>        26  2.1277 libc-2.6.so
>        18  1.4730 EclipseMSW.elf.NOV8
>        15  1.2275 ld-2.6.so
>        10  0.8183 busybox
>         4  0.3273 dropbearmulti
>         4  0.3273 libpthread-2.6.so
>
>
> As you can see, I am getting no information regarding driver.ko.  
>
> I did specify the path where the driver.ko file is.  How do I
> get information regarding driver.ko?
>
>
> --
> View this message in context:
> http://old.nabble.com/Trouble-profiling-kernel-module-tp262890
63p26289063.html

> Sent from the oprofile-list mailing list archive at Nabble.com.
>
>
> --------------------------------------------------------------
> ----------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 10, 2009, at 3:55 PM, "Santos, Jose Renato G" <joserenato.santos@...
 > wrote:

> Try specifying a kernel image with option --vmlinux=<image> instead  
> of --no-vmlinux when you run opcontrol.
> I am not sure oprofile can distinguish modules from kernel samples  
> with no-vmlinux option, but worth it a try...
>
> Renato

I tried that and now see sampling information regarding the kernel  
functions but still no information regarding the module I inserted,  
which I confirmed is running.


>
>> -----Original Message-----
>> From: Washington Ratso [mailto:JobHunts02@...]
>> Sent: Tuesday, November 10, 2009 11:23 AM
>> To: oprofile-list@...
>> Subject: Trouble profiling kernel module
>>
>>
>> I am running Linux 2.6.26 on an MPC8248 with busybox and
>> JFFS2.  The driver that I want to profile (driver.ko) is in
>> the /drivers directory.  I loaded the module using insmod.
>> Here are the commands I am using:
>>
>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux Eclipse #
>> /usr/bin/opcontrol --start Using 2.6+ OProfile kernel interface.
>> Using log file /var/lib/oprofile/samples/oprofiled.log
>> Daemon started.
>> Profiler running.
>> Eclipse # /usr/bin/opcontrol --stop
>> Stopping profiling.
>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin Overflow stats
>> not available
>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>> Profiling through timer interrupt
>>          TIMER:0|
>>  samples|      %|
>> ------------------
>>     1145 93.6989 no-vmlinux
>>       26  2.1277 libc-2.6.so
>>       18  1.4730 EclipseMSW.elf.NOV8
>>       15  1.2275 ld-2.6.so
>>       10  0.8183 busybox
>>        4  0.3273 dropbearmulti
>>        4  0.3273 libpthread-2.6.so
>>
>>
>> As you can see, I am getting no information regarding driver.ko.
>>
>> I did specify the path where the driver.ko file is.  How do I
>> get information regarding driver.ko?
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Trouble-profiling-kernel-module-tp262890
> 63p26289063.html
>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>
>>
>> --------------------------------------------------------------
>> ----------------
>> 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@...
>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>
> ---
> ---
> ---
> ---------------------------------------------------------------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>  
> wrote:
>
>> jobhunts02@... wrote:
>>> Correction..driver.ko is in the /AAESystems/bin diectory.
>>>
>>>
>>> On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
>>> wrote:
>>>
>>>> I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The
>>>> driver
>>>> that I want to profile (driver.ko) is in the /drivers directory.  I
>>>> loaded
>>>> the module using insmod.  Here are the commands I am using:
>>>>
>>>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>>>> Eclipse # /usr/bin/opcontrol --start
>>>> Using 2.6+ OProfile kernel interface.
>>>> Using log file /var/lib/oprofile/samples/oprofiled.log
>>>> Daemon started.
>>>> Profiler running.
>>>> Eclipse # /usr/bin/opcontrol --stop
>>>> Stopping profiling.
>>>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
>> I presume this isn't *really* the way you specified the -p option,  
>> since you would get an error this way.  Assuming you actually used '-
>> p /AAESystems/bin', then opreport should find your kernel module.  
>> Are you sure the module was doing anything where it would actually  
>> generate samples?
>>
>> -Maynard
>
> I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
> bin". No error either way.
At least the last couple of releases do *not* support '-p=blah'.  What oprofile release are you using?
>
> The module is definitely running and several functions are being  
> executed repeatedly.  What do you mean by a module "doing anything  
> where it would actually generate samples?"
When the timer profiling timer pops, what's the likelihood that the driver is actively executing and, thus, be sampled by oprofile?  From the output below, it doesn't look like you're running oprofile very long -- only ~1200 samples.  Try running for lot longer period.  The sampling timer is not going to give you very fine-grained profile data, so you need to run much longer to get a valid profile.

-Maynard

>
> Am I using the correct commands to get profile information from a  
> module?
>
>
>>>> Overflow stats not available
>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>> Profiling through timer interrupt
>>>>         TIMER:0|
>>>> samples|      %|
>>>> ------------------
>>>>    1145 93.6989 no-vmlinux
>>>>      26  2.1277 libc-2.6.so
>>>>      18  1.4730 EclipseMSW.elf.NOV8
>>>>      15  1.2275 ld-2.6.so
>>>>      10  0.8183 busybox
>>>>       4  0.3273 dropbearmulti
>>>>       4  0.3273 libpthread-2.6.so
>>>>
>>>>
>>>> As you can see, I am getting no information regarding driver.ko.
>>>>
>>>> I did specify the path where the driver.ko file is.  How do I get
>>>> information regarding driver.ko?
>>>>
>>>>
>>>> --
>>>> View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
>>>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---
>>>> ---
>>>> ---
>>>> ---
>>>> ------------------------------------------------------------------
>>>> 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@...
>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>> ---
>>> ---
>>> ---
>>> ---------------------------------------------------------------------
>>> 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@...
>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 10, 2009, at 5:40 PM, Maynard Johnson <maynardj@...> wrote:

jobhunts02@... wrote:
On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>  
wrote:

jobhunts02@... wrote:
Correction..driver.ko is in the /AAESystems/bin diectory.


On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
wrote:

I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The
driver
that I want to profile (driver.ko) is in the /drivers directory.  I
loaded
the module using insmod.  Here are the commands I am using:

Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
Eclipse # /usr/bin/opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
Eclipse # /usr/bin/opcontrol --stop
Stopping profiling.
Eclipse # /usr/bin/opreport -p=/AAESystems/bin
I presume this isn't *really* the way you specified the -p option,  
since you would get an error this way.  Assuming you actually used '-
p /AAESystems/bin', then opreport should find your kernel module.   
Are you sure the module was doing anything where it would actually  
generate samples?

-Maynard

I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
bin". No error either way.
At least the last couple of releases do *not* support '-p=blah'.  What oprofile release are you using?

The module is definitely running and several functions are being  
executed repeatedly.  What do you mean by a module "doing anything  
where it would actually generate samples?"
When the timer profiling timer pops, what's the likelihood that the driver is actively executing and, thus, be sampled by oprofile?  From the output below, it doesn't look like you're running oprofile very long -- only ~1200 samples.  Try running for lot longer period.  The sampling timer is not going to give you very fine-grained profile data, so you need to run much longer to get a valid profile.

-Maynard

I ran it longer (see below) and there is still no sign of my inserted module.  I did not run it longer because putting vmlinux on my board uses up almost all the memory and I was concerned I might run out of memory.

Note, there is also no sign of the oprofile module in the report either.

I also ran a test module which had a loop with 100 billion iterations to insure it would be in the function awhile and sampled and there was no sign of that module in the report either.

What could cause there not being any samples for the inserted modules? 


Eclipse # /usr/bin/opreport

CPU: CPU with timer interrupt, speed 0 MHz (estimated)

Profiling through timer interrupt

          TIMER:0|

  samples|      %|

------------------

    93763 95.7127 vmlinux.PRO_MOD

     2141  2.1855 EclipseMSW.elf.NOV8

                  TIMER:0|

          samples|      %|

        ------------------

             2133 99.6263 EclipseMSW.elf.NOV8

                8  0.3737 [heap] (tgid:88 range:0x1011e000-0x104c1000)

     1251  1.2770 libc-2.6.so

      214  0.2184 libpthread-2.6.so

      132  0.1347 dropbearmulti

      123  0.1256 libEclipseSem.so

       83  0.0847 snmpd

       70  0.0715 libm-2.6.so

       50  0.0510 libEclipseLst.so

       43  0.0439 oprofiled

       39  0.0398 librt-2.6.so

       16  0.0163 libEclipseLog.so

       13  0.0133 ld-2.6.so

        9  0.0092 busybox

        8  0.0082 libEclipseHms.so

        4  0.0041 libEclipseMmap.so

        2  0.0020 libEclipsePai.so

        1  0.0010 gateway

        1  0.0010 libutil-2.6.so





Am I using the correct commands to get profile information from a  
module?


Overflow stats not available
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
       TIMER:0|
samples|      %|
------------------
  1145 93.6989 no-vmlinux
    26  2.1277 libc-2.6.so
    18  1.4730 EclipseMSW.elf.NOV8
    15  1.2275 ld-2.6.so
    10  0.8183 busybox
     4  0.3273 dropbearmulti
     4  0.3273 libpthread-2.6.so


As you can see, I am getting no information regarding driver.ko.

I did specify the path where the driver.ko file is.  How do I get
information regarding driver.ko?


--
View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
Sent from the oprofile-list mailing list archive at Nabble.com.


---
---
---
---
------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list
---
---
---
---------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> On Nov 10, 2009, at 5:40 PM, Maynard Johnson <maynardj@...> wrote:
>
>> jobhunts02@... wrote:
>>> On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>
>>> wrote:
>>>
>>>> jobhunts02@... wrote:
>>>>> Correction..driver.ko is in the /AAESystems/bin diectory.
>>>>>
>>>>>
>>>>> On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
>>>>> wrote:
>>>>>
>>>>>> I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The
>>>>>> driver
>>>>>> that I want to profile (driver.ko) is in the /drivers directory.  I
>>>>>> loaded
>>>>>> the module using insmod.  Here are the commands I am using:
>>>>>>
>>>>>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>>>>>> Eclipse # /usr/bin/opcontrol --start
>>>>>> Using 2.6+ OProfile kernel interface.
>>>>>> Using log file /var/lib/oprofile/samples/oprofiled.log
>>>>>> Daemon started.
>>>>>> Profiler running.
>>>>>> Eclipse # /usr/bin/opcontrol --stop
>>>>>> Stopping profiling.
>>>>>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
>>>> I presume this isn't *really* the way you specified the -p option,
>>>> since you would get an error this way.  Assuming you actually used '-
>>>> p /AAESystems/bin', then opreport should find your kernel module.
>>>> Are you sure the module was doing anything where it would actually
>>>> generate samples?
>>>>
>>>> -Maynard
>>>
>>> I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
>>> bin". No error either way.
>> At least the last couple of releases do *not* support '-p=blah'.  What
>> oprofile release are you using?
>>>
>>> The module is definitely running and several functions are being
>>> executed repeatedly.  What do you mean by a module "doing anything
>>> where it would actually generate samples?"
>> When the timer profiling timer pops, what's the likelihood that the
>> driver is actively executing and, thus, be sampled by oprofile?  From
>> the output below, it doesn't look like you're running oprofile very
>> long -- only ~1200 samples.  Try running for lot longer period.  The
>> sampling timer is not going to give you very fine-grained profile
>> data, so you need to run much longer to get a valid profile.
>>
>> -Maynard
>
> I ran it longer (see below) and there is still no sign of my inserted
> module.  I did not run it longer because putting vmlinux on my board
> uses up almost all the memory and I was concerned I might run out of
> memory.
>
> Note, there is also no sign of the oprofile module in the report either.
>
> I also ran a test module which had a loop with 100 billion iterations to
> insure it would be in the function awhile and sampled and there was no
> sign of that module in the report either.
>
> What could cause there not being any samples for the inserted modules?
>
>
> Eclipse # /usr/bin/opreport
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt

When using timer mode profiling, sampling is not possible when interrupts are
disabled.  OProfile sampling code is executed with interrupts disabled, so
that's why you see no samples for the oprofile module itself.  Likely the same
reason you're not seeing samples for your own kernel module.

-Maynard

>           TIMER:0|
>   samples|      %|
> ------------------
>     93763 95.7127 vmlinux.PRO_MOD
>      2141  2.1855 EclipseMSW.elf.NOV8
>                   TIMER:0|
>           samples|      %|
>         ------------------
>              2133 99.6263 EclipseMSW.elf.NOV8
>                 8  0.3737 [heap] (tgid:88 range:0x1011e000-0x104c1000)
>      1251  1.2770 libc-2.6.so
>       214  0.2184 libpthread-2.6.so
>       132  0.1347 dropbearmulti
>       123  0.1256 libEclipseSem.so
>        83  0.0847 snmpd
>        70  0.0715 libm-2.6.so
>        50  0.0510 libEclipseLst.so
>        43  0.0439 oprofiled
>        39  0.0398 librt-2.6.so
>        16  0.0163 libEclipseLog.so
>        13  0.0133 ld-2.6.so
>         9  0.0092 busybox
>         8  0.0082 libEclipseHms.so
>         4  0.0041 libEclipseMmap.so
>         2  0.0020 libEclipsePai.so
>         1  0.0010 gateway
>         1  0.0010 libutil-2.6.so
>
>
>
>>>
>>> Am I using the correct commands to get profile information from a
>>> module?
>>>
>>>
>>>>>> Overflow stats not available
>>>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>>>> Profiling through timer interrupt
>>>>>>        TIMER:0|
>>>>>> samples|      %|
>>>>>> ------------------
>>>>>>   1145 93.6989 no-vmlinux
>>>>>>     26  2.1277 libc-2.6.so
>>>>>>     18  1.4730 EclipseMSW.elf.NOV8
>>>>>>     15  1.2275 ld-2.6.so
>>>>>>     10  0.8183 busybox
>>>>>>      4  0.3273 dropbearmulti
>>>>>>      4  0.3273 libpthread-2.6.so
>>>>>>
>>>>>>
>>>>>> As you can see, I am getting no information regarding driver.ko.
>>>>>>
>>>>>> I did specify the path where the driver.ko file is.  How do I get
>>>>>> information regarding driver.ko?
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html 
>>>>>>
>>>>>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---
>>>>>> ---
>>>>>> ---
>>>>>> ---
>>>>>> ------------------------------------------------------------------
>>>>>> 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@...
>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>> ---
>>>>> ---
>>>>> ---
>>>>> ---------------------------------------------------------------------
>>>>> 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@...
>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>
>


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

Sent from my iPhone 3G

On Nov 11, 2009, at 10:46 AM, Maynard Johnson <maynardj@...> wrote:

jobhunts02@... wrote:
On Nov 10, 2009, at 5:40 PM, Maynard Johnson <maynardj@...> wrote:
jobhunts02@... wrote:
On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>
wrote:

jobhunts02@... wrote:
Correction..driver.ko is in the /AAESystems/bin diectory.


On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
wrote:

I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The
driver
that I want to profile (driver.ko) is in the /drivers directory.  I
loaded
the module using insmod.  Here are the commands I am using:

Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
Eclipse # /usr/bin/opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
Eclipse # /usr/bin/opcontrol --stop
Stopping profiling.
Eclipse # /usr/bin/opreport -p=/AAESystems/bin
I presume this isn't *really* the way you specified the -p option,
since you would get an error this way.  Assuming you actually used '-
p /AAESystems/bin', then opreport should find your kernel module.
Are you sure the module was doing anything where it would actually
generate samples?

-Maynard

I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
bin". No error either way.
At least the last couple of releases do *not* support '-p=blah'.  What oprofile release are you using?

The module is definitely running and several functions are being
executed repeatedly.  What do you mean by a module "doing anything
where it would actually generate samples?"
When the timer profiling timer pops, what's the likelihood that the driver is actively executing and, thus, be sampled by oprofile?  From the output below, it doesn't look like you're running oprofile very long -- only ~1200 samples.  Try running for lot longer period.  The sampling timer is not going to give you very fine-grained profile data, so you need to run much longer to get a valid profile.

-Maynard
I ran it longer (see below) and there is still no sign of my inserted module.  I did not run it longer because putting vmlinux on my board uses up almost all the memory and I was concerned I might run out of memory.
Note, there is also no sign of the oprofile module in the report either.
I also ran a test module which had a loop with 100 billion iterations to insure it would be in the function awhile and sampled and there was no sign of that module in the report either.
What could cause there not being any samples for the inserted modules?
Eclipse # /usr/bin/opreport
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt

When using timer mode profiling, sampling is not possible when interrupts are disabled.  OProfile sampling code is executed with interrupts disabled, so that's why you see no samples for the oprofile module itself.  Likely the same reason you're not seeing samples for your own kernel module.

-Maynard

Below is the code for my test driver that I do not see samples for either.   As you can see, interrupts are not disabled.

#include <linux/module.h>

#include <linux/kernel.h>

 

int init_module(void)

{

    long long i=0;

    printk(KERN_WARNING "Hello world.  Before LOOP.\n");

 

    for(i=0; i< 10000000000; i++)

        ;

 

    printk(KERN_WARNING "Hello world.  After LOOP.\n");

    return 0;

}

 

void cleanup_module(void)

{

     printk(KERN_INFO "Goodbye world 1.\n");

}





         TIMER:0|
 samples|      %|
------------------
   93763 95.7127 vmlinux.PRO_MOD
    2141  2.1855 EclipseMSW.elf.NOV8
                 TIMER:0|
         samples|      %|
       ------------------
            2133 99.6263 EclipseMSW.elf.NOV8
               8  0.3737 [heap] (tgid:88 range:0x1011e000-0x104c1000)
    1251  1.2770 libc-2.6.so
     214  0.2184 libpthread-2.6.so
     132  0.1347 dropbearmulti
     123  0.1256 libEclipseSem.so
      83  0.0847 snmpd
      70  0.0715 libm-2.6.so
      50  0.0510 libEclipseLst.so
      43  0.0439 oprofiled
      39  0.0398 librt-2.6.so
      16  0.0163 libEclipseLog.so
      13  0.0133 ld-2.6.so
       9  0.0092 busybox
       8  0.0082 libEclipseHms.so
       4  0.0041 libEclipseMmap.so
       2  0.0020 libEclipsePai.so
       1  0.0010 gateway
       1  0.0010 libutil-2.6.so

Am I using the correct commands to get profile information from a
module?


Overflow stats not available
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
      TIMER:0|
samples|      %|
------------------
 1145 93.6989 no-vmlinux
   26  2.1277 libc-2.6.so
   18  1.4730 EclipseMSW.elf.NOV8
   15  1.2275 ld-2.6.so
   10  0.8183 busybox
    4  0.3273 dropbearmulti
    4  0.3273 libpthread-2.6.so


As you can see, I am getting no information regarding driver.ko.

I did specify the path where the driver.ko file is.  How do I get
information regarding driver.ko?


--
View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
Sent from the oprofile-list mailing list archive at Nabble.com.


---
---
---
---
------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list
---
---
---
---------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list


=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> Sent from my iPhone 3G
>
> On Nov 11, 2009, at 10:46 AM, Maynard Johnson <maynardj@...> wrote:
>
>> jobhunts02@... wrote:
>>> On Nov 10, 2009, at 5:40 PM, Maynard Johnson <maynardj@...>
>>> wrote:
>>>> jobhunts02@... wrote:
>>>>> On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>
>>>>> wrote:
>>>>>
>>>>>> jobhunts02@... wrote:
>>>>>>> Correction..driver.ko is in the /AAESystems/bin diectory.
>>>>>>>
>>>>>>>
>>>>>>> On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  
>>>>>>>> The
>>>>>>>> driver
>>>>>>>> that I want to profile (driver.ko) is in the /drivers directory.  I
>>>>>>>> loaded
>>>>>>>> the module using insmod.  Here are the commands I am using:
>>>>>>>>
>>>>>>>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>>>>>>>> Eclipse # /usr/bin/opcontrol --start
>>>>>>>> Using 2.6+ OProfile kernel interface.
>>>>>>>> Using log file /var/lib/oprofile/samples/oprofiled.log
>>>>>>>> Daemon started.
>>>>>>>> Profiler running.
>>>>>>>> Eclipse # /usr/bin/opcontrol --stop
>>>>>>>> Stopping profiling.
>>>>>>>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
>>>>>> I presume this isn't *really* the way you specified the -p option,
>>>>>> since you would get an error this way.  Assuming you actually used '-
>>>>>> p /AAESystems/bin', then opreport should find your kernel module.
>>>>>> Are you sure the module was doing anything where it would actually
>>>>>> generate samples?
>>>>>>
>>>>>> -Maynard
>>>>>
>>>>> I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
>>>>> bin". No error either way.
>>>> At least the last couple of releases do *not* support '-p=blah'.  
>>>> What oprofile release are you using?
>>>>>
>>>>> The module is definitely running and several functions are being
>>>>> executed repeatedly.  What do you mean by a module "doing anything
>>>>> where it would actually generate samples?"
>>>> When the timer profiling timer pops, what's the likelihood that the
>>>> driver is actively executing and, thus, be sampled by oprofile?  
>>>> From the output below, it doesn't look like you're running oprofile
>>>> very long -- only ~1200 samples.  Try running for lot longer
>>>> period.  The sampling timer is not going to give you very
>>>> fine-grained profile data, so you need to run much longer to get a
>>>> valid profile.
>>>>
>>>> -Maynard
>>> I ran it longer (see below) and there is still no sign of my inserted
>>> module.  I did not run it longer because putting vmlinux on my board
>>> uses up almost all the memory and I was concerned I might run out of
>>> memory.
>>> Note, there is also no sign of the oprofile module in the report either.
>>> I also ran a test module which had a loop with 100 billion iterations
>>> to insure it would be in the function awhile and sampled and there
>>> was no sign of that module in the report either.
>>> What could cause there not being any samples for the inserted modules?
>>> Eclipse # /usr/bin/opreport
>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>> Profiling through timer interrupt
>>
>> When using timer mode profiling, sampling is not possible when
>> interrupts are disabled.  OProfile sampling code is executed with
>> interrupts disabled, so that's why you see no samples for the oprofile
>> module itself.  Likely the same reason you're not seeing samples for
>> your own kernel module.
>>
>> -Maynard
>
> Below is the code for my test driver that I do not see samples for
> either.   As you can see, interrupts are not disabled.
>
> #include <linux/module.h>
> #include <linux/kernel.h>
>
> int init_module(void)
> {
>     long long i=0;
>     printk(KERN_WARNING "Hello world.  Before LOOP.\n");
>
>     for(i=0; i< 10000000000; i++)
>         ;
I plunked this piece of code into a module init and tried profiling it and
didn't get any samples either when using timer mode.  I had to switch back to
event-based profiling and took a sample every 10,000 cycles before I even saw 1
sample for my module load action.  The reason is that, typically, gcc will
optimize this kind of brain-dead code so that the processor does not really sit
and loop 10 billion times for nothing.  You have to trick gcc into not
optimizing.  For example, I called getnstimeofday() before and after the loop
(and also printed the sec and nsec values); then in the loop, I compared
i==timespec.tv_nsec and then just incremented i if they were equal.  A
meaningless action, but enough to fool gcc.  Switching back to timer-based
profiling, I see several thousand samples for my module init, which now took
several seconds to complete.  Your mileage may vary.

-Maynard

>
>     printk(KERN_WARNING "Hello world.  After LOOP.\n");
>     return 0;
> }
>
> void cleanup_module(void)
> {
>      printk(KERN_INFO "Goodbye world 1.\n");
> }
>
>
>
>>
>>>          TIMER:0|
>>>  samples|      %|
>>> ------------------
>>>    93763 95.7127 vmlinux.PRO_MOD
>>>     2141  2.1855 EclipseMSW.elf.NOV8
>>>                  TIMER:0|
>>>          samples|      %|
>>>        ------------------
>>>             2133 99.6263 EclipseMSW.elf.NOV8
>>>                8  0.3737 [heap] (tgid:88 range:0x1011e000-0x104c1000)
>>>     1251  1.2770 libc-2.6.so
>>>      214  0.2184 libpthread-2.6.so
>>>      132  0.1347 dropbearmulti
>>>      123  0.1256 libEclipseSem.so
>>>       83  0.0847 snmpd
>>>       70  0.0715 libm-2.6.so
>>>       50  0.0510 libEclipseLst.so
>>>       43  0.0439 oprofiled
>>>       39  0.0398 librt-2.6.so
>>>       16  0.0163 libEclipseLog.so
>>>       13  0.0133 ld-2.6.so
>>>        9  0.0092 busybox
>>>        8  0.0082 libEclipseHms.so
>>>        4  0.0041 libEclipseMmap.so
>>>        2  0.0020 libEclipsePai.so
>>>        1  0.0010 gateway
>>>        1  0.0010 libutil-2.6.so
>>>>>
>>>>> Am I using the correct commands to get profile information from a
>>>>> module?
>>>>>
>>>>>
>>>>>>>> Overflow stats not available
>>>>>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>>>>>> Profiling through timer interrupt
>>>>>>>>       TIMER:0|
>>>>>>>> samples|      %|
>>>>>>>> ------------------
>>>>>>>>  1145 93.6989 no-vmlinux
>>>>>>>>    26  2.1277 libc-2.6.so
>>>>>>>>    18  1.4730 EclipseMSW.elf.NOV8
>>>>>>>>    15  1.2275 ld-2.6.so
>>>>>>>>    10  0.8183 busybox
>>>>>>>>     4  0.3273 dropbearmulti
>>>>>>>>     4  0.3273 libpthread-2.6.so
>>>>>>>>
>>>>>>>>
>>>>>>>> As you can see, I am getting no information regarding driver.ko.
>>>>>>>>
>>>>>>>> I did specify the path where the driver.ko file is.  How do I get
>>>>>>>> information regarding driver.ko?
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html 
>>>>>>>>
>>>>>>>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>> ---
>>>>>>>> ---
>>>>>>>> ---
>>>>>>>> ---
>>>>>>>> ------------------------------------------------------------------
>>>>>>>> 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@...
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>>>> ---
>>>>>>> ---
>>>>>>> ---
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> 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@...
>>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>
>>
>


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 11, 2009, at 3:40 PM, Maynard Johnson <maynardj@...> wrote:

jobhunts02@... wrote:
Sent from my iPhone 3G
On Nov 11, 2009, at 10:46 AM, Maynard Johnson <maynardj@...> wrote:
jobhunts02@... wrote:
On Nov 10, 2009, at 5:40 PM, Maynard Johnson <maynardj@...> wrote:
jobhunts02@... wrote:
On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>
wrote:

jobhunts02@... wrote:
Correction..driver.ko is in the /AAESystems/bin diectory.


On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...>
wrote:

I am running Linux 2.6.26 on an MPC8248 with busybox and JFFS2.  The
driver
that I want to profile (driver.ko) is in the /drivers directory.  I
loaded
the module using insmod.  Here are the commands I am using:

Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
Eclipse # /usr/bin/opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
Eclipse # /usr/bin/opcontrol --stop
Stopping profiling.
Eclipse # /usr/bin/opreport -p=/AAESystems/bin
I presume this isn't *really* the way you specified the -p option,
since you would get an error this way.  Assuming you actually used '-
p /AAESystems/bin', then opreport should find your kernel module.
Are you sure the module was doing anything where it would actually
generate samples?

-Maynard

I get a report whether I use "-p=/AAESystems/bin" or "-p /AAESystems/
bin". No error either way.
At least the last couple of releases do *not* support '-p=blah'.  What oprofile release are you using?

The module is definitely running and several functions are being
executed repeatedly.  What do you mean by a module "doing anything
where it would actually generate samples?"
When the timer profiling timer pops, what's the likelihood that the driver is actively executing and, thus, be sampled by oprofile?  From the output below, it doesn't look like you're running oprofile very long -- only ~1200 samples.  Try running for lot longer period.  The sampling timer is not going to give you very fine-grained profile data, so you need to run much longer to get a valid profile.

-Maynard
I ran it longer (see below) and there is still no sign of my inserted module.  I did not run it longer because putting vmlinux on my board uses up almost all the memory and I was concerned I might run out of memory.
Note, there is also no sign of the oprofile module in the report either.
I also ran a test module which had a loop with 100 billion iterations to insure it would be in the function awhile and sampled and there was no sign of that module in the report either.
What could cause there not being any samples for the inserted modules?
Eclipse # /usr/bin/opreport
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt

When using timer mode profiling, sampling is not possible when interrupts are disabled.  OProfile sampling code is executed with interrupts disabled, so that's why you see no samples for the oprofile module itself.  Likely the same reason you're not seeing samples for your own kernel module.

-Maynard
Below is the code for my test driver that I do not see samples for either.   As you can see, interrupts are not disabled.
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
   long long i=0;
   printk(KERN_WARNING "Hello world.  Before LOOP.\n");
   for(i=0; i< 10000000000; i++)
       ;
I plunked this piece of code into a module init and tried profiling it and didn't get any samples either when using timer mode.  I had to switch back to event-based profiling and took a sample every 10,000 cycles before I even saw 1 sample for my module load action.  The reason is that, typically, gcc will optimize this kind of brain-dead code so that the processor does not really sit and loop 10 billion times for nothing.  You have to trick gcc into not optimizing.  For example, I called getnstimeofday() before and after the loop (and also printed the sec and nsec values); then in the loop, I compared i==timespec.tv_nsec and then just incremented i if they were equal.  A meaningless action, but enough to fool gcc.  Switching back to timer-based profiling, I see several thousand samples for my module init, which now took several seconds to complete.  Your mileage may vary.

-Maynard

Here is the code I ran.  I could not use getnstimeofday() because I got an "Unknown symbol getnstimeofday" error when I tried to insert the module on my board.

 

#include <linux/module.h> 

#include <linux/kernel.h> 

#include <linux/time.h>

 

int init_module(void)

{

    long long i=0;

    struct timeval tv;

 

    do_gettimeofday(&tv);

    printk(KERN_WARNING "Before loop, time is %d.%06d\n", tv.tv_sec, tv.tv_usec);

    for(i=0; i< 10000000000; i++)

    {   

        if(i == tv.tv_usec)

        {

            i++;

        }

    }

    do_gettimeofday(&tv);

    printk(KERN_WARNING "After loop, time is %d.%06d\n", tv.tv_sec, tv.tv_usec);

 

    return 0;

}

 

void cleanup_module(void)

{

     printk(KERN_INFO "Goodbye world 1.\n");

}

 

I saw the following in /var/log/messages:

 

Nov 12 00:47:13 (none) user.warn kernel: Before loop, time is 1257986833.433372

Nov 12 00:52:25 (none) user.warn kernel: After loop, time is 1257987145.384882

 

The module (hello4.ko) ran for 312 seconds, but there is no sign of it when I run the opreport command:

 

Eclipse # /usr/bin/opreport

CPU: CPU with timer interrupt, speed 0 MHz (estimated)

Profiling through timer interrupt

          TIMER:0|

  samples|      %|

------------------

   225523 99.3975 vmlinux.PRO_MOD

      494  0.2177EclipseMSW.elf.NOV8

      319  0.1406 dropbearmulti

      305  0.1344 libc-2.6.so

       88  0.0388 oprofiled

       68  0.0300 snmpd

                  TIMER:0|

          samples|      %|

        ------------------

               67 98.5294 snmpd

                1  1.4706 [heap] (tgid:87 range:0x1016d000-0x1022f000)

       24  0.0106libEclipsePai.so

       18  0.0079libEclipseLog.so

       18  0.0079 ld-2.6.so

       16  0.0071 busybox-1.15.2.mtab

       14  0.0062 libm-2.6.so

        1 4.4e-04 gateway

        1 4.4e-04 libEclipseMmap.so

        1 4.4e-04 libpthread-2.6.so

 

 

This is the instruction sequence I used:

 

/usr/bin/opcontrol --setup --kernel-range=0xc0000000,0xc9500000 --vmlinux=/root/vmlinux.PRO_MOD

/usr/bin/opcontrol --start

insmod hello4.ko

/usr/bin/opcontrol --shutdown

/usr/bin/opreport

 



   printk(KERN_WARNING "Hello world.  After LOOP.\n");
   return 0;
}
void cleanup_module(void)
{
    printk(KERN_INFO "Goodbye world 1.\n");
}

        TIMER:0|
samples|      %|
------------------
  93763 95.7127 vmlinux.PRO_MOD
   2141  2.1855 EclipseMSW.elf.NOV8
                TIMER:0|
        samples|      %|
      ------------------
           2133 99.6263 EclipseMSW.elf.NOV8
              8  0.3737 [heap] (tgid:88 range:0x1011e000-0x104c1000)
   1251  1.2770 libc-2.6.so
    214  0.2184 libpthread-2.6.so
    132  0.1347 dropbearmulti
    123  0.1256 libEclipseSem.so
     83  0.0847 snmpd
     70  0.0715 libm-2.6.so
     50  0.0510 libEclipseLst.so
     43  0.0439 oprofiled
     39  0.0398 librt-2.6.so
     16  0.0163 libEclipseLog.so
     13  0.0133 ld-2.6.so
      9  0.0092 busybox
      8  0.0082 libEclipseHms.so
      4  0.0041 libEclipseMmap.so
      2  0.0020 libEclipsePai.so
      1  0.0010 gateway
      1  0.0010 libutil-2.6.so

Am I using the correct commands to get profile information from a
module?


Overflow stats not available
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
     TIMER:0|
samples|      %|
------------------
1145 93.6989 no-vmlinux
  26  2.1277 libc-2.6.so
  18  1.4730 EclipseMSW.elf.NOV8
  15  1.2275 ld-2.6.so
  10  0.8183 busybox
   4  0.3273 dropbearmulti
   4  0.3273 libpthread-2.6.so


As you can see, I am getting no information regarding driver.ko.

I did specify the path where the driver.ko file is.  How do I get
information regarding driver.ko?


--
View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
Sent from the oprofile-list mailing list archive at Nabble.com.


---
---
---
---
------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list
---
---
---
---------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list



=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> On Nov 11, 2009, at 3:40 PM, Maynard Johnson <maynardj@...> wrote:
>
>> jobhunts02@... wrote:
>>> Sent from my iPhone 3G
>>> On Nov 11, 2009, at 10:46 AM, Maynard Johnson <maynardj@...>
>>> wrote:
>>>> jobhunts02@... wrote:
>>>>> On Nov 10, 2009, at 5:40 PM, Maynard Johnson <maynardj@...>
>>>>> wrote:
>>>>>> jobhunts02@... wrote:
>>>>>>> On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> jobhunts02@... wrote:
>>>>>>>>> Correction..driver.ko is in the /AAESystems/bin diectory.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Nov 10, 2009, at 11:23 AM, Washington Ratso
>>>>>>>>> <JobHunts02@...>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> I am running Linux 2.6.26 on an MPC8248 with busybox and
>>>>>>>>>> JFFS2.  The
>>>>>>>>>> driver
>>>>>>>>>> that I want to profile (driver.ko) is in the /drivers
>>>>>>>>>> directory.  I
>>>>>>>>>> loaded
>>>>>>>>>> the module using insmod.  Here are the commands I am using:
>>>>>>>>>>
>>>>>>>>>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>>>>>>>>>> Eclipse # /usr/bin/opcontrol --start
>>>>>>>>>> Using 2.6+ OProfile kernel interface.
>>>>>>>>>> Using log file /var/lib/oprofile/samples/oprofiled.log
>>>>>>>>>> Daemon started.
>>>>>>>>>> Profiler running.
>>>>>>>>>> Eclipse # /usr/bin/opcontrol --stop
>>>>>>>>>> Stopping profiling.
>>>>>>>>>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
>>>>>>>> I presume this isn't *really* the way you specified the -p option,
>>>>>>>> since you would get an error this way.  Assuming you actually
>>>>>>>> used '-
>>>>>>>> p /AAESystems/bin', then opreport should find your kernel module.
>>>>>>>> Are you sure the module was doing anything where it would actually
>>>>>>>> generate samples?
>>>>>>>>
>>>>>>>> -Maynard
>>>>>>>
>>>>>>> I get a report whether I use "-p=/AAESystems/bin" or "-p
>>>>>>> /AAESystems/
>>>>>>> bin". No error either way.
>>>>>> At least the last couple of releases do *not* support '-p=blah'.  
>>>>>> What oprofile release are you using?
>>>>>>>
>>>>>>> The module is definitely running and several functions are being
>>>>>>> executed repeatedly.  What do you mean by a module "doing anything
>>>>>>> where it would actually generate samples?"
>>>>>> When the timer profiling timer pops, what's the likelihood that
>>>>>> the driver is actively executing and, thus, be sampled by
>>>>>> oprofile?  From the output below, it doesn't look like you're
>>>>>> running oprofile very long -- only ~1200 samples.  Try running for
>>>>>> lot longer period.  The sampling timer is not going to give you
>>>>>> very fine-grained profile data, so you need to run much longer to
>>>>>> get a valid profile.
>>>>>>
>>>>>> -Maynard
>>>>> I ran it longer (see below) and there is still no sign of my
>>>>> inserted module.  I did not run it longer because putting vmlinux
>>>>> on my board uses up almost all the memory and I was concerned I
>>>>> might run out of memory.
>>>>> Note, there is also no sign of the oprofile module in the report
>>>>> either.
>>>>> I also ran a test module which had a loop with 100 billion
>>>>> iterations to insure it would be in the function awhile and sampled
>>>>> and there was no sign of that module in the report either.
>>>>> What could cause there not being any samples for the inserted modules?
>>>>> Eclipse # /usr/bin/opreport
>>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>>> Profiling through timer interrupt
>>>>
>>>> When using timer mode profiling, sampling is not possible when
>>>> interrupts are disabled.  OProfile sampling code is executed with
>>>> interrupts disabled, so that's why you see no samples for the
>>>> oprofile module itself.  Likely the same reason you're not seeing
>>>> samples for your own kernel module.
>>>>
>>>> -Maynard
>>> Below is the code for my test driver that I do not see samples for
>>> either.   As you can see, interrupts are not disabled.
>>> #include <linux/module.h>
>>> #include <linux/kernel.h>
>>> int init_module(void)
>>> {
>>>    long long i=0;
>>>    printk(KERN_WARNING "Hello world.  Before LOOP.\n");
>>>    for(i=0; i< 10000000000; i++)
>>>        ;
>> I plunked this piece of code into a module init and tried profiling it
>> and didn't get any samples either when using timer mode.  I had to
>> switch back to event-based profiling and took a sample every 10,000
>> cycles before I even saw 1 sample for my module load action.  The
>> reason is that, typically, gcc will optimize this kind of brain-dead
>> code so that the processor does not really sit and loop 10 billion
>> times for nothing.  You have to trick gcc into not optimizing.  For
>> example, I called getnstimeofday() before and after the loop (and also
>> printed the sec and nsec values); then in the loop, I compared
>> i==timespec.tv_nsec and then just incremented i if they were equal.  A
>> meaningless action, but enough to fool gcc.  Switching back to
>> timer-based profiling, I see several thousand samples for my module
>> init, which now took several seconds to complete.  Your mileage may vary.
>>
>> -Maynard
>
> Here is the code I ran.  I could not use getnstimeofday() because I got
> an "Unknown symbol getnstimeofday" error when I tried to insert the
> module on my board.
>
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/time.h>
>
> int init_module(void)
> {
>     long long i=0;
>     struct timeval tv;
>
>     do_gettimeofday(&tv);
>     printk(KERN_WARNING "Before loop, time is %d.%06d\n", tv.tv_sec,
> tv.tv_usec);
>     for(i=0; i< 10000000000; i++)
>     {
>         if(i == tv.tv_usec)
>         {
>             i++;
>         }
>     }
>     do_gettimeofday(&tv);
>     printk(KERN_WARNING "After loop, time is %d.%06d\n", tv.tv_sec,
> tv.tv_usec);
>
>     return 0;
> }
>
> void cleanup_module(void)
> {
>      printk(KERN_INFO "Goodbye world 1.\n");
> }
>
> I saw the following in /var/log/messages:
>
> Nov 12 00:47:13 (none) user.warn kernel: Before loop, time is
> 1257986833.433372
> Nov 12 00:52:25 (none) user.warn kernel: After loop, time is
> 1257987145.384882
>
> The module (hello4.ko) ran for 312 seconds, but there is no sign of it
> when I run the opreport command:
Try loading the module before starting oprofile, and then add '--verbose' to the
'opcontrol --start'.  This will print out all the modules oprofile finds loaded,
along with their start and end addresses.  Assuming you find find hello4 in the
verbose output, try adding '--verbose=all' to opreport and scan the resulting
verbose output for any mention of hello4.  You *should* see sample_filename
entries with 'hello4' as part of the pathname.  If you don't, then manually scan
the samples directory (/var/lib/oprofile/samples/current is the default dir) for
any pathname that includes 'hello4'.  If you find nothing, there were truly no
samples collected for that module.  Then you'll have to look at the oprofile
kernel driver for your system to find out why -- maybe add some debug printk's.

-Maynard

>
> Eclipse # /usr/bin/opreport
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
>           TIMER:0|
>   samples|      %|
> ------------------
>    225523 99.3975 vmlinux.PRO_MOD
>       494  0.2177EclipseMSW.elf.NOV8
>       319  0.1406 dropbearmulti
>       305  0.1344 libc-2.6.so
>        88  0.0388 oprofiled
>        68  0.0300 snmpd
>                   TIMER:0|
>           samples|      %|
>         ------------------
>                67 98.5294 snmpd
>                 1  1.4706 [heap] (tgid:87 range:0x1016d000-0x1022f000)
>        24  0.0106libEclipsePai.so
>        18  0.0079libEclipseLog.so
>        18  0.0079 ld-2.6.so
>        16  0.0071 busybox-1.15.2.mtab
>        14  0.0062 libm-2.6.so
>         1 4.4e-04 gateway
>         1 4.4e-04 libEclipseMmap.so
>         1 4.4e-04 libpthread-2.6.so
>
>
> This is the instruction sequence I used:
>
> /usr/bin/opcontrol --setup --kernel-range=0xc0000000,0xc9500000
> --vmlinux=/root/vmlinux.PRO_MOD
> /usr/bin/opcontrol --start
> insmod hello4.ko
> /usr/bin/opcontrol --shutdown
> /usr/bin/opreport
>
>
>
>>>    printk(KERN_WARNING "Hello world.  After LOOP.\n");
>>>    return 0;
>>> }
>>> void cleanup_module(void)
>>> {
>>>     printk(KERN_INFO "Goodbye world 1.\n");
>>> }
>>>>
>>>>>         TIMER:0|
>>>>> samples|      %|
>>>>> ------------------
>>>>>   93763 95.7127 vmlinux.PRO_MOD
>>>>>    2141  2.1855 EclipseMSW.elf.NOV8
>>>>>                 TIMER:0|
>>>>>         samples|      %|
>>>>>       ------------------
>>>>>            2133 99.6263 EclipseMSW.elf.NOV8
>>>>>               8  0.3737 [heap] (tgid:88 range:0x1011e000-0x104c1000)
>>>>>    1251  1.2770 libc-2.6.so
>>>>>     214  0.2184 libpthread-2.6.so
>>>>>     132  0.1347 dropbearmulti
>>>>>     123  0.1256 libEclipseSem.so
>>>>>      83  0.0847 snmpd
>>>>>      70  0.0715 libm-2.6.so
>>>>>      50  0.0510 libEclipseLst.so
>>>>>      43  0.0439 oprofiled
>>>>>      39  0.0398 librt-2.6.so
>>>>>      16  0.0163 libEclipseLog.so
>>>>>      13  0.0133 ld-2.6.so
>>>>>       9  0.0092 busybox
>>>>>       8  0.0082 libEclipseHms.so
>>>>>       4  0.0041 libEclipseMmap.so
>>>>>       2  0.0020 libEclipsePai.so
>>>>>       1  0.0010 gateway
>>>>>       1  0.0010 libutil-2.6.so
>>>>>>>
>>>>>>> Am I using the correct commands to get profile information from a
>>>>>>> module?
>>>>>>>
>>>>>>>
>>>>>>>>>> Overflow stats not available
>>>>>>>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>>>>>>>> Profiling through timer interrupt
>>>>>>>>>>      TIMER:0|
>>>>>>>>>> samples|      %|
>>>>>>>>>> ------------------
>>>>>>>>>> 1145 93.6989 no-vmlinux
>>>>>>>>>>   26  2.1277 libc-2.6.so
>>>>>>>>>>   18  1.4730 EclipseMSW.elf.NOV8
>>>>>>>>>>   15  1.2275 ld-2.6.so
>>>>>>>>>>   10  0.8183 busybox
>>>>>>>>>>    4  0.3273 dropbearmulti
>>>>>>>>>>    4  0.3273 libpthread-2.6.so
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> As you can see, I am getting no information regarding driver.ko.
>>>>>>>>>>
>>>>>>>>>> I did specify the path where the driver.ko file is.  How do I get
>>>>>>>>>> information regarding driver.ko?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html 
>>>>>>>>>>
>>>>>>>>>> Sent from the oprofile-list mailing list archive at Nabble.com.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 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@...
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>>>>>> ---
>>>>>>>>> ---
>>>>>>>>> ---
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> 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@...
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>>>
>>>>
>>
>


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 12, 2009, at 8:38 AM, Maynard Johnson <maynardj@...>  
wrote:

> jobhunts02@... wrote:
>> On Nov 11, 2009, at 3:40 PM, Maynard Johnson <maynardj@...>  
>> wrote:
>>> jobhunts02@... wrote:
>>>> Sent from my iPhone 3G
>>>> On Nov 11, 2009, at 10:46 AM, Maynard Johnson  
>>>> <maynardj@...> wrote:
>>>>> jobhunts02@... wrote:
>>>>>> On Nov 10, 2009, at 5:40 PM, Maynard Johnson  
>>>>>> <maynardj@...> wrote:
>>>>>>> jobhunts02@... wrote:
>>>>>>>> On Nov 10, 2009, at 2:16 PM, Maynard Johnson <maynardj@...
>>>>>>>> >
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> jobhunts02@... wrote:
>>>>>>>>>> Correction..driver.ko is in the /AAESystems/bin diectory.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Nov 10, 2009, at 11:23 AM, Washington Ratso <JobHunts02@...
>>>>>>>>>> >
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> I am running Linux 2.6.26 on an MPC8248 with busybox and  
>>>>>>>>>>> JFFS2.  The
>>>>>>>>>>> driver
>>>>>>>>>>> that I want to profile (driver.ko) is in the /drivers  
>>>>>>>>>>> directory.  I
>>>>>>>>>>> loaded
>>>>>>>>>>> the module using insmod.  Here are the commands I am using:
>>>>>>>>>>>
>>>>>>>>>>> Eclipse # /usr/bin/opcontrol --setup --no-vmlinux
>>>>>>>>>>> Eclipse # /usr/bin/opcontrol --start
>>>>>>>>>>> Using 2.6+ OProfile kernel interface.
>>>>>>>>>>> Using log file /var/lib/oprofile/samples/oprofiled.log
>>>>>>>>>>> Daemon started.
>>>>>>>>>>> Profiler running.
>>>>>>>>>>> Eclipse # /usr/bin/opcontrol --stop
>>>>>>>>>>> Stopping profiling.
>>>>>>>>>>> Eclipse # /usr/bin/opreport -p=/AAESystems/bin
>>>>>>>>> I presume this isn't *really* the way you specified the -p  
>>>>>>>>> option,
>>>>>>>>> since you would get an error this way.  Assuming you  
>>>>>>>>> actually used '-
>>>>>>>>> p /AAESystems/bin', then opreport should find your kernel  
>>>>>>>>> module.
>>>>>>>>> Are you sure the module was doing anything where it would  
>>>>>>>>> actually
>>>>>>>>> generate samples?
>>>>>>>>>
>>>>>>>>> -Maynard
>>>>>>>>
>>>>>>>> I get a report whether I use "-p=/AAESystems/bin" or "-p /
>>>>>>>> AAESystems/
>>>>>>>> bin". No error either way.
>>>>>>> At least the last couple of releases do *not* support '-
>>>>>>> p=blah'.  What oprofile release are you using?
>>>>>>>>
>>>>>>>> The module is definitely running and several functions are  
>>>>>>>> being
>>>>>>>> executed repeatedly.  What do you mean by a module "doing  
>>>>>>>> anything
>>>>>>>> where it would actually generate samples?"
>>>>>>> When the timer profiling timer pops, what's the likelihood  
>>>>>>> that the driver is actively executing and, thus, be sampled by  
>>>>>>> oprofile?  From the output below, it doesn't look like you're  
>>>>>>> running oprofile very long -- only ~1200 samples.  Try running  
>>>>>>> for lot longer period.  The sampling timer is not going to  
>>>>>>> give you very fine-grained profile data, so you need to run  
>>>>>>> much longer to get a valid profile.
>>>>>>>
>>>>>>> -Maynard
>>>>>> I ran it longer (see below) and there is still no sign of my  
>>>>>> inserted module.  I did not run it longer because putting  
>>>>>> vmlinux on my board uses up almost all the memory and I was  
>>>>>> concerned I might run out of memory.
>>>>>> Note, there is also no sign of the oprofile module in the  
>>>>>> report either.
>>>>>> I also ran a test module which had a loop with 100 billion  
>>>>>> iterations to insure it would be in the function awhile and  
>>>>>> sampled and there was no sign of that module in the report  
>>>>>> either.
>>>>>> What could cause there not being any samples for the inserted  
>>>>>> modules?
>>>>>> Eclipse # /usr/bin/opreport
>>>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>>>> Profiling through timer interrupt
>>>>>
>>>>> When using timer mode profiling, sampling is not possible when  
>>>>> interrupts are disabled.  OProfile sampling code is executed  
>>>>> with interrupts disabled, so that's why you see no samples for  
>>>>> the oprofile module itself.  Likely the same reason you're not  
>>>>> seeing samples for your own kernel module.
>>>>>
>>>>> -Maynard
>>>> Below is the code for my test driver that I do not see samples  
>>>> for either.   As you can see, interrupts are not disabled.
>>>> #include <linux/module.h>
>>>> #include <linux/kernel.h>
>>>> int init_module(void)
>>>> {
>>>>   long long i=0;
>>>>   printk(KERN_WARNING "Hello world.  Before LOOP.\n");
>>>>   for(i=0; i< 10000000000; i++)
>>>>       ;
>>> I plunked this piece of code into a module init and tried  
>>> profiling it and didn't get any samples either when using timer  
>>> mode.  I had to switch back to event-based profiling and took a  
>>> sample every 10,000 cycles before I even saw 1 sample for my  
>>> module load action.  The reason is that, typically, gcc will  
>>> optimize this kind of brain-dead code so that the processor does  
>>> not really sit and loop 10 billion times for nothing.  You have to  
>>> trick gcc into not optimizing.  For example, I called  
>>> getnstimeofday() before and after the loop (and also printed the  
>>> sec and nsec values); then in the loop, I compared  
>>> i==timespec.tv_nsec and then just incremented i if they were  
>>> equal.  A meaningless action, but enough to fool gcc.  Switching  
>>> back to timer-based profiling, I see several thousand samples for  
>>> my module init, which now took several seconds to complete.  Your  
>>> mileage may vary.
>>>
>>> -Maynard
>> Here is the code I ran.  I could not use getnstimeofday() because I  
>> got an "Unknown symbol getnstimeofday" error when I tried to insert  
>> the module on my board.
>> #include <linux/module.h>
>> #include <linux/kernel.h>
>> #include <linux/time.h>
>> int init_module(void)
>> {
>>    long long i=0;
>>    struct timeval tv;
>>    do_gettimeofday(&tv);
>>    printk(KERN_WARNING "Before loop, time is %d.%06d\n", tv.tv_sec,  
>> tv.tv_usec);
>>    for(i=0; i< 10000000000; i++)
>>    {
>>        if(i == tv.tv_usec)
>>        {
>>            i++;
>>        }
>>    }
>>    do_gettimeofday(&tv);
>>    printk(KERN_WARNING "After loop, time is %d.%06d\n", tv.tv_sec,  
>> tv.tv_usec);
>>    return 0;
>> }
>> void cleanup_module(void)
>> {
>>     printk(KERN_INFO "Goodbye world 1.\n");
>> }
>> I saw the following in /var/log/messages:
>> Nov 12 00:47:13 (none) user.warn kernel: Before loop, time is  
>> 1257986833.433372
>> Nov 12 00:52:25 (none) user.warn kernel: After loop, time is  
>> 1257987145.384882
>> The module (hello4.ko) ran for 312 seconds, but there is no sign of  
>> it when I run the opreport command:
> Try loading the module before starting oprofile, and then add '--
> verbose' to the 'opcontrol --start'.  This will print out all the  
> modules oprofile finds loaded, along with their start and end  
> addresses.  Assuming you find find hello4 in the verbose output, try  
> adding '--verbose=all' to opreport and scan the resulting verbose  
> output for any mention of hello4.  You *should* see sample_filename  
> entries with 'hello4' as part of the pathname.  If you don't, then  
> manually scan the samples directory (/var/lib/oprofile/samples/
> current is the default dir) for any pathname that includes  
> 'hello4'.  If you find nothing, there were truly no samples  
> collected for that module.  Then you'll have to look at the oprofile  
> kernel driver for your system to find out why -- maybe add some  
> debug printk's.
>
> -Maynard

Adding --verbose to opcontrol --start shows that oprofile does find my  
kernel modules, but they are not in the output of opreport when I add  
--verbose=all, nor are they anywhere in the samples directory.  Where  
in the oprofile kernel driver is the creation of samples initiated and  
would I be able to filter the samples to see if the process even  
starts for the kernel modules?

>> Eclipse # /usr/bin/opreport
>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>> Profiling through timer interrupt
>>          TIMER:0|
>>  samples|      %|
>> ------------------
>>   225523 99.3975 vmlinux.PRO_MOD
>>      494  0.2177EclipseMSW.elf.NOV8
>>      319  0.1406 dropbearmulti
>>      305  0.1344 libc-2.6.so
>>       88  0.0388 oprofiled
>>       68  0.0300 snmpd
>>                  TIMER:0|
>>          samples|      %|
>>        ------------------
>>               67 98.5294 snmpd
>>                1  1.4706 [heap] (tgid:87 range:0x1016d000-0x1022f000)
>>       24  0.0106libEclipsePai.so
>>       18  0.0079libEclipseLog.so
>>       18  0.0079 ld-2.6.so
>>       16  0.0071 busybox-1.15.2.mtab
>>       14  0.0062 libm-2.6.so
>>        1 4.4e-04 gateway
>>        1 4.4e-04 libEclipseMmap.so
>>        1 4.4e-04 libpthread-2.6.so
>> This is the instruction sequence I used:
>> /usr/bin/opcontrol --setup --kernel-range=0xc0000000,0xc9500000 --
>> vmlinux=/root/vmlinux.PRO_MOD
>> /usr/bin/opcontrol --start
>> insmod hello4.ko
>> /usr/bin/opcontrol --shutdown
>> /usr/bin/opreport
>>>>   printk(KERN_WARNING "Hello world.  After LOOP.\n");
>>>>   return 0;
>>>> }
>>>> void cleanup_module(void)
>>>> {
>>>>    printk(KERN_INFO "Goodbye world 1.\n");
>>>> }
>>>>>
>>>>>>        TIMER:0|
>>>>>> samples|      %|
>>>>>> ------------------
>>>>>>  93763 95.7127 vmlinux.PRO_MOD
>>>>>>   2141  2.1855 EclipseMSW.elf.NOV8
>>>>>>                TIMER:0|
>>>>>>        samples|      %|
>>>>>>      ------------------
>>>>>>           2133 99.6263 EclipseMSW.elf.NOV8
>>>>>>              8  0.3737 [heap] (tgid:88 range:
>>>>>> 0x1011e000-0x104c1000)
>>>>>>   1251  1.2770 libc-2.6.so
>>>>>>    214  0.2184 libpthread-2.6.so
>>>>>>    132  0.1347 dropbearmulti
>>>>>>    123  0.1256 libEclipseSem.so
>>>>>>     83  0.0847 snmpd
>>>>>>     70  0.0715 libm-2.6.so
>>>>>>     50  0.0510 libEclipseLst.so
>>>>>>     43  0.0439 oprofiled
>>>>>>     39  0.0398 librt-2.6.so
>>>>>>     16  0.0163 libEclipseLog.so
>>>>>>     13  0.0133 ld-2.6.so
>>>>>>      9  0.0092 busybox
>>>>>>      8  0.0082 libEclipseHms.so
>>>>>>      4  0.0041 libEclipseMmap.so
>>>>>>      2  0.0020 libEclipsePai.so
>>>>>>      1  0.0010 gateway
>>>>>>      1  0.0010 libutil-2.6.so
>>>>>>>>
>>>>>>>> Am I using the correct commands to get profile information  
>>>>>>>> from a
>>>>>>>> module?
>>>>>>>>
>>>>>>>>
>>>>>>>>>>> Overflow stats not available
>>>>>>>>>>> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
>>>>>>>>>>> Profiling through timer interrupt
>>>>>>>>>>>     TIMER:0|
>>>>>>>>>>> samples|      %|
>>>>>>>>>>> ------------------
>>>>>>>>>>> 1145 93.6989 no-vmlinux
>>>>>>>>>>>  26  2.1277 libc-2.6.so
>>>>>>>>>>>  18  1.4730 EclipseMSW.elf.NOV8
>>>>>>>>>>>  15  1.2275 ld-2.6.so
>>>>>>>>>>>  10  0.8183 busybox
>>>>>>>>>>>   4  0.3273 dropbearmulti
>>>>>>>>>>>   4  0.3273 libpthread-2.6.so
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> As you can see, I am getting no information regarding  
>>>>>>>>>>> driver.ko.
>>>>>>>>>>>
>>>>>>>>>>> I did specify the path where the driver.ko file is.  How  
>>>>>>>>>>> do I get
>>>>>>>>>>> information regarding driver.ko?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context: http://old.nabble.com/Trouble-profiling-kernel-module-tp26289063p26289063.html
>>>>>>>>>>> Sent from the oprofile-list mailing list archive at Nabble.com
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---
>>>>>>>>>>> ---
>>>>>>>>>>> ---
>>>>>>>>>>> ---
>>>>>>>>>>> ---
>>>>>>>>>>> ---
>>>>>>>>>>> ------------------------------------------------------------
>>>>>>>>>>> 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@...
>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ---
>>>>>>>>>> ------------------------------------------------------------
>>>>>>>>>> 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@...
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>>>>>>
>>>>>
>>>
>

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

Could the fact that I am following the instructions below be an issue as far as sampling inserted kernel modules?  Of course, samples for other than the kernel modules seem to be stored just fine. 

  • If running from an image in the internal jffs2 file system, you will need to mount another file system to store the samples. Below are examples of the commands to set that up. You will need to modify for local conditions.

mkdir /var/lib/oprofile

mount -t ramfs none /var/lib/oprofile

 

=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

By looking at EIP values, I can see that samples are being collected for my test module.  In the function get_file in daemon/opd_sfile.c which is called after issuing the opcontrol --shutdown command, I can see trans->pc values that correspond to the EIP values of samples collected for my test module but no new sample file is created for these samples.

Since I can see the samples are there for my test module, why isn't a sample file created for the test module samples?


On Nov 12, 2009, at 3:42 PM, jobhunts02@... wrote:

Could the fact that I am following the instructions below be an issue as far as sampling inserted kernel modules?  Of course, samples for other than the kernel modules seem to be stored just fine. 

  • If running from an image in the internal jffs2 file system, you will need to mount another file system to store the samples. Below are examples of the commands to set that up. You will need to modify for local conditions.

mkdir /var/lib/oprofile

mount -t ramfs none /var/lib/oprofile

 

=
=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 17, 2009, at 9:23 AM, jobhunts02@... wrote:

By looking at EIP values, I can see that samples are being collected for my test module.  In the function get_file in daemon/opd_sfile.c which is called after issuing the opcontrol --shutdown command, I can see trans->pc values that correspond to the EIP values of samples collected for my test module but no new sample file is created for these samples.

Since I can see the samples are there for my test module, why isn't a sample file created for the test module samples?

When get_file is called for the samples for my test module, the file it gets is /var/lib/oprofile/samples//current/{kern}/no-vmlinux/{dep}/{kern}/no-vmlinux/TIMER.0.0.all.all.all, which has a nonzero count.  Thus, no sample file is created for my test module.

 

Why would samples for my test module result in getting the sample file for no-vmlinux?




On Nov 12, 2009, at 3:42 PM, jobhunts02@... wrote:

Could the fact that I am following the instructions below be an issue as far as sampling inserted kernel modules?  Of course, samples for other than the kernel modules seem to be stored just fine. 

  • If running from an image in the internal jffs2 file system, you will need to mount another file system to store the samples. Below are examples of the commands to set that up. You will need to modify for local conditions.

mkdir /var/lib/oprofile

mount -t ramfs none /var/lib/oprofile

 

=
=
=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Washington Ratso :: Rate this Message:

| View Threaded | Show Only this Message

On Nov 17, 2009, at 4:43 PM, jobhunts02@... wrote:

On Nov 17, 2009, at 9:23 AM, jobhunts02@... wrote:

By looking at EIP values, I can see that samples are being collected for my test module.  In the function get_file in daemon/opd_sfile.c which is called after issuing the opcontrol --shutdown command, I can see trans->pc values that correspond to the EIP values of samples collected for my test module but no new sample file is created for these samples.

Since I can see the samples are there for my test module, why isn't a sample file created for the test module samples?

When get_file is called for the samples for my test module, the file it gets is /var/lib/oprofile/samples//current/{kern}/no-vmlinux/{dep}/{kern}/no-vmlinux/TIMER.0.0.all.all.all, which has a nonzero count.  Thus, no sample file is created for my test module.

 

Why would samples for my test module result in getting the sample file for no-vmlinux?



I put vmlinux.PRO_MOD on my board.  Looking at opreport output for the same sampling, the results look inconsistent.

 

Running /usr/bin/opreport gave:

 

Eclipse # /usr/bin/opreport

CPU: CPU with timer interrupt, speed 0 MHz (estimated)

Profiling through timer interrupt

          TIMER:0|

  samples|      %|

------------------

     7703 93.3923 vmlinux.PRO_MOD

      464  5.6256 libc-2.6.so

       26  0.3152 oprofiled

       19  0.2304EclipseMSW.elf.NOV8

       17  0.2061 busybox-1.15.2.mtab

       15  0.1819 ld-2.6.so

        3  0.0364 snmpd

        1  0.0121 libEclipsePai.so

 

 

If 7703 samples is 93.3923 %, then total samples = 8248.

 

 

My test module is in the /root directory.  Running /usr/bin/opreport -c --image-path=/root gave:

 

/usr/bin/opreport -c --image-path=/root

CPU: CPU with timer interrupt, speed 0 MHz (estimated)

Profiling through timer interrupt

samples  %        app name                 symbol name

-------------------------------------------------------------------------------

1343     38.0993  vmlinux.PRO_MOD          __delay

  1343     100.000  vmlinux.PRO_MOD          __delay [self]

-------------------------------------------------------------------------------

464      13.1631  libc-2.6.so              /lib/libc-2.6.so

  464      100.000  libc-2.6.so              /lib/libc-2.6.so [self]

-------------------------------------------------------------------------------

267       7.5745  vmlinux.PRO_MOD          memset

  267      100.000  vmlinux.PRO_MOD          memset [self]

-------------------------------------------------------------------------------

100       2.8369  vmlinux.PRO_MOD          memcpy

  100      100.000  vmlinux.PRO_MOD          memcpy [self]

-------------------------------------------------------------------------------

83        2.3546  vmlinux.PRO_MOD          cfi_amdstd_write_buffers

  83       100.000  vmlinux.PRO_MOD          cfi_amdstd_write_buffers [self]

-------------------------------------------------------------------------------

61        1.7305  vmlinux.PRO_MOD          deflate_fast

  61       100.000  vmlinux.PRO_MOD          deflate_fast [self]

-------------------------------------------------------------------------------

 

I DELETED THE REST OF THE OUTPUT.

 

 

If 1343 samples is 38.0993 %, then total samples = 3525.

 

 

Are these results inconsistent or am I mistaken?

 

 

 

 

 





On Nov 12, 2009, at 3:42 PM, jobhunts02@...jobhunts02@... wrote:

Could the fact that I am following the instructions below be an issue as far as sampling inserted kernel modules?  Of course, samples for other than the kernel modules seem to be stored just fine. 

  • If running from an image in the internal jffs2 file system, you will need to mount another file system to store the samples. Below are examples of the commands to set that up. You will need to modify for local conditions.

mkdir /var/lib/oprofile

mount -t ramfs none /var/lib/oprofile

 

=
=
=
=
------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> On Nov 17, 2009, at 4:43 PM, jobhunts02@... wrote:
>
>> On Nov 17, 2009, at 9:23 AM, jobhunts02@... wrote:
>>
>>> By looking at EIP values, I can see that samples are being  
>>> collected for my test module.  In the function get_file in daemon/
>>> opd_sfile.c which is called after issuing the opcontrol --shutdown  
>>> command, I can see trans->pc values that correspond to the EIP  
>>> values of samples collected for my test module but no new sample  
>>> file is created for these samples.
>>>
>>> Since I can see the samples are there for my test module, why isn't  
>>> a sample file created for the test module samples?
>> When get_file is called for the samples for my test module, the file  
>> it gets is /var/lib/oprofile/samples//current/{kern}/no-vmlinux/
>> {dep}/{kern}/no-vmlinux/TIMER.0.0.all.all.all, which has a nonzero  
>> count.  Thus, no sample file is created for my test module.
>>
>> Why would samples for my test module result in getting the sample  
>> file for no-vmlinux?
>>
>
> I put vmlinux.PRO_MOD on my board.  Looking at opreport output for the  
> same sampling, the results look inconsistent.
>
> Running /usr/bin/opreport gave:
>
> Eclipse # /usr/bin/opreport
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
>            TIMER:0|
>    samples|      %|
> ------------------
>       7703 93.3923 vmlinux.PRO_MOD
>        464  5.6256 libc-2.6.so
>         26  0.3152 oprofiled
>         19  0.2304EclipseMSW.elf.NOV8
>         17  0.2061 busybox-1.15.2.mtab
>         15  0.1819 ld-2.6.so
>          3  0.0364 snmpd
>          1  0.0121 libEclipsePai.so
>
>
> If 7703 samples is 93.3923 %, then total samples = 8248.
>
>
> My test module is in the /root directory.  Running /usr/bin/opreport -
> c --image-path=/root gave:
>
> /usr/bin/opreport -c --image-path=/root
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
> samples  %        app name                 symbol name
> ---
> ---
> ---
> ----------------------------------------------------------------------
> 1343     38.0993  vmlinux.PRO_MOD          __delay
>    1343     100.000  vmlinux.PRO_MOD          __delay [self]
> ---
> ---
> ---
> ----------------------------------------------------------------------
> 464      13.1631  libc-2.6.so              /lib/libc-2.6.so
>    464      100.000  libc-2.6.so              /lib/libc-2.6.so [self]
> ---
> ---
> ---
> ----------------------------------------------------------------------
> 267       7.5745  vmlinux.PRO_MOD          memset
>    267      100.000  vmlinux.PRO_MOD          memset [self]
> ---
> ---
> ---
> ----------------------------------------------------------------------
> 100       2.8369  vmlinux.PRO_MOD          memcpy
>    100      100.000  vmlinux.PRO_MOD          memcpy [self]
> ---
> ---
> ---
> ----------------------------------------------------------------------
> 83        2.3546  vmlinux.PRO_MOD          cfi_amdstd_write_buffers
>    83       100.000  vmlinux.PRO_MOD          cfi_amdstd_write_buffers  
> [self]
> ---
> ---
> ---
> ----------------------------------------------------------------------
> 61        1.7305  vmlinux.PRO_MOD          deflate_fast
>    61       100.000  vmlinux.PRO_MOD          deflate_fast [self]
> ---
> ---
> ---
> ----------------------------------------------------------------------
>
> I DELETED THE REST OF THE OUTPUT.
>
>
> If 1343 samples is 38.0993 %, then total samples = 3525.
>
>
> Are these results inconsistent or am I mistaken?
You're mistaken.  Please read section 4.2.3 in the oprofile manual on "Callgraph output".  As it states there, "The samples and percentage values here (in entries above the non-indented line) refer to the number of times we took a sample where this call was found in the stack; the percentage is relative to all other callers of the function we're focussing on."

-Maynard

>
>
>
>
>
>
>
>>>
>>> On Nov 12, 2009, at 3:42 PM, jobhunts02@... wrote:
>>>
>>>> Could the fact that I am following the instructions below be an  
>>>> issue as far as sampling inserted kernel modules?  Of course,  
>>>> samples for other than the kernel modules seem to be stored just  
>>>> fine.
>>>> If running from an image in the internal jffs2 file system, you  
>>>> will need to mount another file system to store the samples. Below  
>>>> are examples of the commands to set that up. You will need to  
>>>> modify for local conditions.
>>>> mkdir /var/lib/oprofile
>>>> mount -t ramfs none /var/lib/oprofile
>>>>
>>>> =
>>> =
>> =
>


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Re: Trouble profiling kernel module

by Maynard Johnson :: Rate this Message:

| View Threaded | Show Only this Message

jobhunts02@... wrote:

> On Nov 17, 2009, at 9:23 AM, jobhunts02@... wrote:
>
>> By looking at EIP values, I can see that samples are being collected  
>> for my test module.  In the function get_file in daemon/opd_sfile.c  
>> which is called after issuing the opcontrol --shutdown command, I  
>> can see trans->pc values that correspond to the EIP values of  
>> samples collected for my test module but no new sample file is  
>> created for these samples.
>>
>> Since I can see the samples are there for my test module, why isn't  
>> a sample file created for the test module samples?
>
> When get_file is called for the samples for my test module, the file  
> it gets is /var/lib/oprofile/samples//current/{kern}/no-vmlinux/{dep}/
> {kern}/no-vmlinux/TIMER.0.0.all.all.all, which has a nonzero count.  
> Thus, no sample file is created for my test module.
>
> Why would samples for my test module result in getting the sample file  
> for no-vmlinux?
Back on Nov 10, Jose Santos correctly told you that using the --no-vmlinux option will not work if you want to see samples for kernel modules.  When you use that option, oprofile throws all kernel samples (whether from base kernel or kernel modules) into the no-vmlinux sample file.

-Maynard

>
>>
>> On Nov 12, 2009, at 3:42 PM, jobhunts02@... wrote:
>>
>>> Could the fact that I am following the instructions below be an  
>>> issue as far as sampling inserted kernel modules?  Of course,  
>>> samples for other than the kernel modules seem to be stored just  
>>> fine.
>>> If running from an image in the internal jffs2 file system, you  
>>> will need to mount another file system to store the samples. Below  
>>> are examples of the commands to set that up. You will need to  
>>> modify for local conditions.
>>> mkdir /var/lib/oprofile
>>> mount -t ramfs none /var/lib/oprofile
>>>
>>> =
>> =
>


------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list
< Prev | 1 - 2 | Next >