🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50521

Profiling

#50521
From: Killian Murphy
Date: Mon, 20 Sep 1993 14:03
32 lines
2099 bytes
Hi,

I am trying to use the lower level profiling functions to get fine
control of profiling in Unix environments. I am using Sun4, SunOS
4.1.3, but am interested in portability.

I have been trying to use the monstartup(), moncontrol() and monitor()
functions, without much success. I have got gprof output files, when
using a call to _mcleanup() (I used a call to on_exit() to set this
up. Is this portable?). However, I have had to recompile gcc's gmon.c
file and link with this explicitly in order to get this to compile. Is
there something cleaner than this? (eg: a library to link with).

Basically, it would be very useful if someone could summarize for me
exactly what the gcc compiler inserts into the executable in order to
set up profiling when using the -p or -pg options. What functions are
used for each of the different profilers, prof and gprof? How can I
emulate all of this in my user code.

Reply by email, and I'll summarise to this group. If you do not wish
to be quoted in this summary, please indicate this in your mail.
Otherwise I'll assume it's OK.

Thanks for your help in advance,

Killian.
--
------------------------------------------------------------------------------
Killian Murphy        | "Romeo Rodriguez squares his shoulders, curses Jesus,
killian@epcc.ed.ac.uk |  runs a comb through his black pony-tail", Lou Reed
------------------------------------------------------------------------------
Technical Details
Message-ID: <KILLIAN.93Sep20150315@realgar.epcc.ed.ac.uk>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!agate!doc.ic.ac.uk!uknet!festival!dcs.ed.ac.uk!newshost.dcs.ed.ac.uk!killian

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,fa88c32caa7c523,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-09-20 08:14:27 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!agate!doc.ic.ac.uk!uknet!festival!dcs.ed.ac.uk!newshost.dcs.ed.ac.uk!killian
From: killian@realgar.epcc.ed.ac.uk (Killian Murphy)
Subject: Profiling
Message-ID: <KILLIAN.93Sep20150315@realgar.epcc.ed.ac.uk>
Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
Organization: Department of Computer Science, Edinburgh University
Date: Mon, 20 Sep 1993 14:03:15 GMT
Lines: 33