基本使用方法:
ktrace 可执行文件名
ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]
ktrace [-adi] [-f trfile] [-t trstr] command生成krace.out ,类似于gdb 生成的core文件
kdump -f krace.out |more 查看找出出错位置
ktrace用来查找存在系统调用和动态链接库调用的可执行程序错误。GDB主要用来调试模块内部。GNU
binutil 工具可用来辅助调试。
DESCRIPTION
The ktrace command enables kernel trace logging for the specified pro-
cesses. Kernel trace data is logged to the file ktrace.out. The kernel
operations that are traced include system calls, namei translations, sig-
nal processing, and I/O.
Once tracing is enabled on a process, trace data will be logged until
either the process exits or the trace point is cleared. A traced process
can generate enormous amounts of log data quickly; It is strongly sug-
gested that users memorize how to disable tracing before attempting to
trace a process. The following c