John Levon | 1 Jun 2005 13:48
Favicon

[PATCH] oprofile: report anonymous region samples


The below patch passes samples from anonymous regions to userspace
instead of just dropping them. This provides the support needed for
reporting anonymous-region code samples (today: basic accumulated
results; later: Java and other dynamically compiled code).

As this changes the format, an upgrade to the just-released 0.9 release
of the userspace tools is required.

This patch is based upon an earlier one by Will Cohen <wcohen <at> redhat.com>

thanks,
john

Signed-off-by: John Levon <levon <at> movementarian.org>

Index: linux-cvs/drivers/oprofile/buffer_sync.c
===================================================================
RCS file: /home/moz/cvs//linux-2.5/drivers/oprofile/buffer_sync.c,v
retrieving revision 1.30
diff -u -a -p -u -r1.30 buffer_sync.c
--- linux-cvs/drivers/oprofile/buffer_sync.c	14 Mar 2005 00:32:33 -0000	1.30
+++ linux-cvs/drivers/oprofile/buffer_sync.c	26 Apr 2005 13:20:24 -0000
 <at>  <at>  -206,7 +206,7  <at>  <at>  static inline unsigned long fast_get_dco
  */
 static unsigned long get_exec_dcookie(struct mm_struct * mm)
 {
-	unsigned long cookie = 0;
+	unsigned long cookie = NO_COOKIE;
 	struct vm_area_struct * vma;
(Continue reading)

Jack Sparrow | 2 Jun 2005 10:08
Picon
Favicon

oprofile samples

Hi All

I would appreciate if someone could help me to find
out answers to few of my questions.

I'm using oprofile to profile an application. The
version of oprofile that I'm using is 0.8.2. The
machine is a x86 box running 2.6 kernel. I could
successfully profile the application and generate a
report containing a list of symbols(opreport -l). The
report gives me no. of samples collected in a
function/symbol by the profiler.

The question I have here is that can I convert these
samples to get the actual time of execution? I think
that it is possible if one could get the interval of
timer interrupt which is used by oprofile. Is this
value based on HZ? or Are there any special settings
done by oprofile?

Thanks in advance.

Best regards,
Jack

		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html
(Continue reading)

Philip Mucci | 2 Jun 2005 16:05
Picon

Profiling the boot process...

Hi Oprofilers,

I was asked a question the other day, by some folks building a new
machine based around Linux.

"Hey Phil, do you have any idea how much time Linux spends waiting for
devices/hardware/IO during the boot process vs how much time it actually
spends 'computing'?"

Now, I shot from the hip and guessed around 30% which others thought was
a reasonable estimate. But being a hardware performance counter guy, I
really don't like estimates as they're usually wrong. ;-)

So, and this is purely Gestalt at this point, has anyone thought about
hacking Oprofile to stand up really early in the boot process for such a
purpose?

Ok, so the data might not be actionable, but it would be reasonably
interesting/fun.

Regards,

Phil

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
(Continue reading)

John Levon | 2 Jun 2005 17:02
Favicon

Re: oprofile samples

On Thu, Jun 02, 2005 at 01:08:39AM -0700, Jack Sparrow wrote:

> I'm using oprofile to profile an application. The
> version of oprofile that I'm using is 0.8.2. The
> machine is a x86 box running 2.6 kernel. I could
> successfully profile the application and generate a
> report containing a list of symbols(opreport -l). The
> report gives me no. of samples collected in a
> function/symbol by the profiler.
> 
> The question I have here is that can I convert these
> samples to get the actual time of execution? I think
> that it is possible if one could get the interval of
> timer interrupt which is used by oprofile. Is this
> value based on HZ? or Are there any special settings
> done by oprofile?

For the "timer" mode, it's HZ. Otherwise, the default is worked as
roughly 2,000Hz. Please bear in mind that you're really twisting
OProfile here; it's a statistical profiler, and you really want an
interstitial one (such as using PAPI). Do not rely on the results.

regards
john

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
(Continue reading)

John Levon | 2 Jun 2005 17:11
Favicon

Re: Profiling the boot process...

On Thu, Jun 02, 2005 at 10:05:22AM -0400, Philip Mucci wrote:

> "Hey Phil, do you have any idea how much time Linux spends waiting for
> devices/hardware/IO during the boot process vs how much time it actually
> spends 'computing'?"

bootchart has gone some way to answering this question:

http://www.bootchart.org/

AFAIK nobody has tried to get oprofile running under it though.

regards
john

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
Philip Mucci | 2 Jun 2005 17:57
Picon

Re: Profiling the boot process...

Hi John,

Cool link. Thanks...Too bad the data starts at init...it's everything
before init that I'm really interested in. ;-)

Regards,

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
John Levon | 2 Jun 2005 18:10
Favicon

Re: Profiling the boot process...

On Thu, Jun 02, 2005 at 11:57:40AM -0400, Philip Mucci wrote:

> Cool link. Thanks...Too bad the data starts at init...it's everything
> before init that I'm really interested in. ;-)

Oh, right. Would certainly be feasible then. You'd just need to add some
code in startup to start oprofiling (and something to keep the buffer
open), then something at boot to empty the buffer out to oprofiled. I
encourage you to give it a try :)

I know the Solaris version of bootchart does that via DTrace's anonymous
feature

regards
john

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
Jason Lunz | 2 Jun 2005 18:16

oprofile 0.9 and g++ 2.95?

I've been using previous releases of oprofile since 0.6 on debian woody systems
with 2.4 kernels. These don't have gcc/g++ 3. Up until 0.8.2, this always
worked.

0.9 isn't compiling though:

make[3]: Entering directory `/home/lunz/oprofile-0.9/libutil++'
source='op_bfd.cpp' object='op_bfd.o' libtool=no \
depfile='.deps/op_bfd.Po' tmpdepfile='.deps/op_bfd.TPo' \
depmode=gcc /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I..  -I ../libutil -I ../libop  -W -Wall -fno-common -ftemplate-depth-50 -g
-O2 -c -o op_bfd.o `test -f 'op_bfd.cpp' || echo './'`op_bfd.cpp
op_bfd.cpp: In method `op_bfd::op_bfd(const string &, const string &, const string_filter &, bool &)':
op_bfd.cpp:96: aggregate `struct stat st' has incomplete type and cannot be initialized
op_bfd.cpp:118: confused by earlier errors, bailing out
make[3]: *** [op_bfd.o] Error 1
make[3]: Leaving directory `/home/lunz/oprofile-0.9/libutil++'

If I add #include <sys/stat.h> to op_bfd.cpp, I then get:

ake[3]: Entering directory `/home/lunz/oprofile-0.9/libutil++'
source='op_bfd.cpp' object='op_bfd.o' libtool=no \
depfile='.deps/op_bfd.Po' tmpdepfile='.deps/op_bfd.TPo' \
depmode=gcc /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I..  -I ../libutil -I ../libop  -W -Wall -fno-common -ftemplate-depth-50 -g
-O2 -c -o op_bfd.o `test -f 'op_bfd.cpp' || echo './'`op_bfd.cpp
op_bfd.cpp: In method `void op_bfd::add_symbols(list<op_bfd_symbol,allocator<op_bfd_symbol> > &,
const string_filter &)':
op_bfd.cpp:265: implicit declaration of function `int remove_if(...)'
op_bfd.cpp:265: warning: cannot pass objects of type `_List_iterator<op_bfd_symbol,op_bfd_symbol
(Continue reading)

Jack Sparrow | 2 Jun 2005 19:01
Picon
Favicon

Re: oprofile samples

Hi John,

--- John Levon <levon <at> movementarian.org> wrote:
> > The question I have here is that can I convert
> these
> > samples to get the actual time of execution? I
> think
> > that it is possible if one could get the interval
> of
> > timer interrupt which is used by oprofile. Is this
> > value based on HZ? or Are there any special
> settings
> > done by oprofile?
> 
> For the "timer" mode, it's HZ. Otherwise, the
> default is worked as
> roughly 2,000Hz. 
Thanks for letting me know these internal details of
OProfile.
> Please bear in mind that you're
> really twisting
> OProfile here; it's a statistical profiler, and you
> really want an
> interstitial one (such as using PAPI). Do not rely
> on the results.
Ok. I agree that OProfile, being a statistical
profiler, won't give me the exact results. But it can
give me approximate time of execution, if the value of
the interval of a sample is correct. right?

(Continue reading)

John Levon | 2 Jun 2005 19:16
Favicon

Re: oprofile 0.9 and g++ 2.95?

On Thu, Jun 02, 2005 at 04:16:38PM +0000, Jason Lunz wrote:

> 0.9 isn't compiling though:

Sigh :)

> op_bfd.cpp:96: aggregate `struct stat st' has incomplete type and cannot be initialized

Try #include <sys/stat.h>

> op_bfd.cpp:265: implicit declaration of function `int remove_if(...)'

Try #include <algorithm>

> Is g++ 2.95.4 still supported by oprofile?

In theory yes, but I've not personally got it for testing. I probably
should have...

regards
john

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005

Gmane