Mail Archives: djgpp/1997/02/10/19:24:05
In article <Pine DOT SUN DOT 3 DOT 91 DOT 970121092143 DOT 26269O-100000 AT is>, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> writes:
|>On Mon, 20 Jan 1997, Leendert Combee wrote:
|>
|>> 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)).
|>
|>AFAIK, gcc doesn't support that functionality. Could anybody who has gcc
|>sources installed look and see for sure? Thanks.
|>
A quick perusal of the sources I have leads me to believe that this
may work, but I must add the caveats that I am still running djgpp
1.12.m5 and I haven't actually tried this out. However, I believe
that the mechanism used depends on mcount and gprof only, and to some
extent on the behaviour of ld - specifically, whether it emits definitions
for defined but unreferenced global symbols to the final object file.
The macro would need to be recast in extended ASM format to prevent
the optimiser messing it up. This is its definition:
#ifndef MARK
#define MARK(K) {}
#else
#undef MARK
#define MARK(K) {\
asm(" .data"); \
asm(" .align 4"); \
asm("."#K".:"); \
asm(" .long 0"); \
asm(" .text"); \
asm("M."#K":"); \
asm(" movl $."#K"., %edx"); \
asm(" call _mcount"); \
}
#endif
------------------------------------------------------------------------------
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 -