delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/21/07:03:42

From: cziwkga AT ulcc DOT ac DOT uk (Kevin Ashley)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: profiling under djgpp
Date: 21 Jan 1997 10:58:44 GMT
Organization: University of London Computer Centre
Lines: 37
Distribution: world
Message-ID: <5c27h4$c2c@calypso.ulcc.ac.uk>
References: <9701201125 DOT AA08187 AT cambridge DOT scr DOT slb DOT com> <5c05d0$5k2 AT lyra DOT csx DOT cam DOT ac DOT uk>
Reply-To: k DOT ashley AT ulcc DOT ac DOT uk
NNTP-Posting-Host: silver-e.ulcc.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <5c05d0$5k2 AT lyra DOT csx DOT cam DOT ac DOT uk>, gpt20 AT thor DOT cam DOT ac DOT uk (G.P. Tootell) writes:
|>i just did man gprof under linux, having sworn i'd read the thing thru and not
|>found anything. and i couldn't find this section :( grep didn't find it either :(
|>maybe it's sunos specific? you're right of course, it's exactly what i want :)
|>
|>nik
|>
|>In article <9701201125 DOT AA08187 AT cambridge DOT scr DOT slb DOT com>, combee AT cambridge DOT scr DOT slb DOT com (Leendert Combee) writes:

 [Snipped]

>|> 
|>|>   From "man gprof" under SunOS/UNIX I quote:
|>|> 
|>|>      A single function may be split into subfunctions for profil-
|>|>      ing by means of the MARK macro (see prof(3)).
|>|>  
|>|> 
|>|>   Unfortunately, I don't know yet how to use this macro nor whether it is supported by
|>|>   gcc/djgpp. However, it seems to do what you want....

The definition of the MARK macro in /usr/include/prof.h on Solaris 2
turns into a set of asm statements, conditionalised on the processor
type (i386 or sparc). In that respect, it is Sunos specific. However,
the technique it uses may well be applicable to GNU gprof - it merely
calls mcount after setting up a pseudo function entry point. Without
looking at the source for the profiling modules, I don't know if this
would work, but my guess is that it would. The inline asm would need
to be rewritten using gnu c's extended asm - as it stands there would
be a risk of the statements being reordered and/or registers being clobbered.

-----------------------------------------------------------------------------
Kevin Ashley                              K DOT Ashley AT Ulcc DOT ac DOT uk
Development Manager                   http://www.ulcc.ac.uk/staff/Kevin+Ashley
University of London Computer Centre.      ...ukc!ncdlab!K.Ashley
                      This is not a signature

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019