🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3491

Re: Logging library calls

#3491
From: vineeth
Date: Wed, 02 Nov 2005 14:39
20 lines
2074 bytes
hi Dan,
   try callgrind [http://kcachegrind.sourceforge.net].
   callgrind will give you the info about time spent for each
instruction/function , but you cannot log anything.
fedora has callgrind and valgrind  by default.
just compile your program with debug info (-ggdb) and run it with
callgrind. (or valgrind --tool=cachegrind).
do the following ::
1) compile with debug info,
2) callgrind --trace-jump=yes --dump-instr=yes <program_name> <args>
3)you will get a file in cur dir , something like  callgrind.out.<pid>
4)kcachegrind callgrind.out.<pid>

in kcachegrind , you can view the time that was spent in each function.
it will display the call graph as well , but for that you need the dot
utilty, which can be obtained from http://graphviz.org.

hope this helps,
cheers,
vineeth.
Technical Details
Message-ID: <1130942377.377091.247860@o13g2000cwo.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail
References: <1130933853.496034.275900@g14g2000cwa.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: fc89c,a014a748110dc6d4
X-Google-Thread: 11318c,a014a748110dc6d4
X-Google-Attributes: gidfc89c,gid11318c,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail
From: "vineeth" <nvineeth@gmail.com>
Newsgroups: comp.unix.programmer,gnu.gcc.help
Subject: Re: Logging library calls
Date: 2 Nov 2005 06:39:37 -0800
Organization: http://groups.google.com
Lines: 21
Message-ID: <1130942377.377091.247860@o13g2000cwo.googlegroups.com>
References: <1130933853.496034.275900@g14g2000cwa.googlegroups.com>
NNTP-Posting-Host: 59.92.149.174
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1130942383 11947 127.0.0.1 (2 Nov 2005 14:39:43 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 2 Nov 2005 14:39:43 +0000 (UTC)
In-Reply-To: <1130933853.496034.275900@g14g2000cwa.googlegroups.com>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: o13g2000cwo.googlegroups.com; posting-host=59.92.149.174;
   posting-account=8dWLgQ0AAACoWZvUNK1otGRiWS_AohaG