|LTRACE(1)||General Commands Manual||LTRACE(1)|
ltraceenables shared library function calls issued by the specified processes to be traced using the utrace(2) user tracing facility. By default, call trace data is logged to the file ktrace.out, unless overridden by the
-foption. Each function call is traced as a pair of
KTRFAC_USERentries; the first entry contains the shared library containing the symbol being called, and the second entry contains the symbol name.
Once tracing is enabled on a process, trace data will be logged until either the process exits or the trace point is cleared with ktrace(1). A traced process can generate enormous amounts of log data quickly; it is strongly suggested that users memorize how to disable tracing before attempting to trace a process. The following command is sufficient to disable tracing on all user owned processes and, if executed by root, all processes:
$ ktrace -C
The trace file is not human-readable; use kdump(1) to decode it.
The options are as follows:
u. The following table equates the letters with the trace points:
$ ltrace wc -lh /etc/motd
Trace only the shared library function calls in libutil.so:
$ ltrace -u libutil wc -lh /etc/motd
Trace all the shared library function calls but those in libc.so:
$ ltrace -u "!libc" wc -lh /etc/motd
Trace all the shared library function calls with names starting “fmt”:
$ ltrace -u ":fmt*" wc -lh /etc/motd
Trace all shared library function calls, as well as all system calls:
$ ltrace -t cu wc -lh /etc/motd
ltracecommand appeared in OpenBSD 5.4.
|July 18, 2016||OpenBSD-current|