Kernel monitor and performance tools

To attach strace to an already running process, you need to specify the -p with the
process ID (PID) of the process that you want to monitor:
strace -p `pidof mysqld`
To trace only network related system calls, use -e trace=network:
strace -e trace=network -p 26520

The -c calculates the time the kernel spent on each system call:
strace -c find /etc -name xorg.conf

To trace all child processes of a process, use -f:
strace -f rcapache2 status

If you need to analyze the output of strace and the output messages are too long to
be inspected directly in the console window, use -o. In that case, unnecessary messages,
such as information about attaching and detaching processes, are suppressed. You can
also suppress these messages (normally printed on the standard output) with -q. To
optionally prepend timestamps to each line with a system call, use -t:
strace -t -o strace_sleep.txt sleep 1; more strace_sleep.txt

ltrace traces dynamic library calls of a process. It is used in a similar way to strace,
and most of their parameters have a very similar or identical meaning. By default,
ltrace uses /etc/ltrace.conf or ~/.ltrace.conf configuration files. You
can, however, specify an alternative one with the -F config_file option.
ltrace -S -o ltrace_find.txt find /etc -name \

You can change the type of traced events with the -e option. The following example
prints library calls related to fnmatch and strlen functions:
ltrace -e fnmatch,strlen find /etc -name xorg.conf

kexec and kdump


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值