Debugging - Novell LINUX ENTERPRISE SERVER 10 SP2 - INSTALLATION AND ADMINISTRATION Installation Manual

Hide thumbs Also See for LINUX ENTERPRISE SERVER 10 SP2 - INSTALLATION AND ADMINISTRATION:
Table of Contents

Advertisement

17.1 Debugging

17.1.1 Specifying the Required Library: ldd
Use the command ldd to find out which libraries would load the dynamic executable
specified as argument.
tux@mercury:~> ldd /bin/ls
Static binaries do not need any dynamic libraries.
tux@mercury:~> ldd /bin/sash
tux@mercury:~> file /bin/sash
/bin/sash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.4, statically linked, for GNU/Linux 2.6.4, stripped
17.1.2 Library Calls of a Program Run: ltrace
The command ltrace enables you to trace the library calls of a process. This command
is used in a similar fashion to strace. The parameter -c outputs the number and du-
ration of the library calls that have occurred:
tux@mercury:~> ltrace -c find ~
% time
------ ----------- ----------- --------- --------------------
34.37
33.53
12.67
11.97
2.37
1.17
[...]
0.00
------ ----------- ----------- --------- --------------------
100.00
328
Installation and Administration
linux-gate.so.1 =>
librt.so.1 => /lib/librt.so.1 (0xb7f97000)
libacl.so.1 => /lib/libacl.so.1 (0xb7f91000)
libc.so.6 => /lib/libc.so.6 (0xb7e79000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7e67000)
/lib/ld-linux.so.2 (0xb7fb6000)
libattr.so.1 => /lib/libattr.so.1 (0xb7e63000)
not a dynamic executable
seconds
usecs/call
6.758937
6.593562
2.490392
2.353302
0.466754
0.230765
0.000036
19.662715
(0xffffe000)
calls
245
27554 __errno_location
788
8358 __fprintf_chk
144
17212 strlen
239
9845 readdir64
27
16716 __ctype_get_mb_cur_max
27
8358 memcpy
36
1 textdomain
105717 total
function

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10 sp3

Table of Contents