Library Function Tracer

From: George (greerga@circlemud.org)
Date: 02/24/99


If you've used Linux, you probably know about 'strace' to see all of the
kernel system calls a function does.  Well, there's a software package for
Linux now that will trace the _C_library_ function calls.  Obviously, this
is much handier.

For instance, here's the start of the CircleMUD bootup:

__libc_start_main(0x080497ac, 3, 0xbffffb64, 0x080491cc, 0x08091774
<unfinished ...>
fdopen(2, 0x080917c0, 0x4013c03c, 0xbffffb64, 3)  = 0x080c72d8
time(0, 1, 0xbffffb18, 0xbffffb18, 0x08049866)    = 0x36d4c3d4
localtime(0xbffffaf8, 0, 1, 0x36d4c3d4, 0xbffffb18) = 0x4013f9a0
asctime(0x4013f9a0, 0xbffffaf8, 0, 1, 0x36d4c3d4) = 0x4013daa0
fprintf(0x080c72d8, 0x080b3deb, 0x4013daa4, 0x4013f9a0, 0xbffffaf8) = 19
vfprintf(0x080c72d8, 0x080a4e20, 0xbffffb08, 0x080c72d8, 0x080b3deb) = 42
fprintf(0x080c72d8, 0x080b3df8, 1, 0x36d4c3d4, 0xbffffb18) = 1
fflush(0x080c72d8, 0x080c72d8, 0x080b3df8, 1, 0x36d4c3d4Feb 24 22:30:28 ::
CircleMUD, version 3.00 beta patchlevel 14
) = 0
chdir(0xbffffc88, 0x4013c03c, 0xbffffb64, 3, 4000) = 0
time(0, 3, 0x400f6be0, 0xbffffb18, 0x080499ef)    = 0x36d4c3d4
localtime(0xbffffaf4, 0, 3, 0x36d4c3d4, 0xbffffb18) = 0x4013f9a0
asctime(0x4013f9a0, 0xbffffaf4, 0, 3, 0x36d4c3d4) = 0x4013daa0
fprintf(0x080c72d8, 0x080b3deb, 0x4013daa4, 0x4013f9a0, 0xbffffaf4) = 19
vfprintf(0x080c72d8, 0x08091a2f, 0xbffffb04, 0x080c72d8, 0x080b3deb) = 54
fprintf(0x080c72d8, 0x080b3df8, 3, 0x36d4c3d4, 0xbffffb18) = 1
fflush(0x080c72d8, 0x080c72d8, 0x080b3df8, 3, 0x36d4c3d4Feb 24 22:30:28 ::
Using /home/g/mud/circle30bpl14/lib as data directory.


[...]

fprintf(0x080c72d8, 0x080b3df8, 4000, 0x36d4c3d4, 0xbffffaf4) = 1
fflush(0x080c72d8, 0x080c72d8, 0x080b3df8, 4000, 0x36d4c3d4Feb 24 22:30:28
:: Opening mother connection.
) = 0
socket(2, 1, 0, 4000, 0xbffffc88)                 = 3
setsockopt(3, 1, 2, 0xbffffabc, 4)                = 0
setsockopt(3, 1, 7, 0xbffffa9c, 4)                = 0
setsockopt(3, 1, 13, 0xbffffab4, 8)               = 0
__bzero(0xbffffac0, 16, 4000, 0xbffffc88, 0)      = 0
__bzero(0x080b6ae0, 4, 0xbffffac0, 0xbffffad0, 0x08049bc4) = 0

etc.

Important info:

"4. Where does it work
---------------------
At the time of writting, it works only with ELF32 executables. It only
works in Linux, and it only works on i386, m68k, and ARM processors."

For more information, see:

ftp://ftp.debian.org/debian/dists/unstable/main/source/utils/ltrace_*

--
George Greer
greerga@circlemud.org
http://www.van.m-l.org/CircleMUD/


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST