LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 704|回复: 7

问:有没有跟踪系统调用时的函数调用链的工具?

[复制链接]
发表于 2004-7-23 11:36:46 | 显示全部楼层 |阅读模式
如题
发表于 2004-7-23 12:53:46 | 显示全部楼层
ltrace
 楼主| 发表于 2004-7-23 13:21:08 | 显示全部楼层
这好象是跟踪 到某个网站间的网络情况的,能满足我的需要?
发表于 2004-7-23 13:22:28 | 显示全部楼层
你保证?
ltrace --help
Usage: ltrace [option ...] [command [arg ...]]
Trace library calls of a given program.

  -d, --debug         print debugging info.
  -f                  follow forks.
  -i                  print instruction pointer at time of library call.
  -L                  do NOT display library calls.
  -S                  display system calls.
  -r                  print relative timestamps.
  -t, -tt, -ttt       print absolute timestamps.
  -C, --demangle      decode low-level symbol names into user-level names.
  -a, --align=COLUMN  align return values in a secific column.
  -s STRLEN           specify the maximum string size to print.
  -o, --output=FILE   write the trace output to that file.
  -u USERNAME         run command with the userid, groupid of username.
  -p PID              attach to the process with the process ID pid.
  -e expr             modify which events to trace.
  -h, --help          display this help and exit.
  -V, --version       output version information and exit.

Report bugs to Juan Cespedes <cespedes@debian.org>
 楼主| 发表于 2004-7-23 13:31:33 | 显示全部楼层
我在网上搜索了,大多是介绍网络应用,谢谢你

但是我的机器上(FC2,万全安装)没有这个工具,是要自己安装的吧,我先去找找有没有下载的
发表于 2004-7-23 14:03:44 | 显示全部楼层
以前rh7是自带的
anyway,这里http://packages.debian.org/unstable/utils/ltrace.html有原码
google的话,第一个就是了
 楼主| 发表于 2004-7-23 14:29:35 | 显示全部楼层
我的系统里有strace是跟踪系统调用的
# strace -help
usage: strace [-dffhiqrtttTvVxx] [-a column] [-e expr] ... [-o file]
              [-p pid] ... [-s strsize] [-u username] [-E var=val] ...
              [command [arg ...]]
   or: strace -c [-e expr] ... [-O overhead] [-S sortby] [-E var=val] ...
              [command [arg ...]]
-c -- count time, calls, and errors for each syscall and report summary
-f -- follow forks, -ff -- with output into separate files
-F -- attempt to follow vforks, -h -- print help message
-i -- print instruction pointer at time of syscall
-q -- suppress messages about attaching, detaching, etc.
-r -- print relative timestamp, -t -- absolute timestamp, -tt -- with usecs
-T -- print time spent in each syscall, -V -- print version
-v -- verbose mode: print unabbreviated argv, stat, termio, etc. args
-x -- print non-ascii strings in hex, -xx -- print all strings in hex
-a column -- alignment COLUMN for printing syscall results (default 40)
-e expr -- a qualifying expression: option=[!]all or option=[!]val1[,val2]...
   options: trace, abbrev, verbose, raw, signal, read, or write
-o file -- send trace output to FILE instead of stderr
-O overhead -- set overhead for tracing syscalls to OVERHEAD usecs
-p pid -- trace process with process id PID, may be repeated
-s strsize -- limit length of print strings to STRSIZE chars (default 32)
-S sortby -- sort syscall counts by: time, calls, name, nothing (default time)
-u username -- run command as username handling setuid and/or setgid
-E var=val -- put var=val in the environment for command
-E var -- remove var from the environment for command
 楼主| 发表于 2004-7-23 14:48:43 | 显示全部楼层

哦,sorry

我把ltrace用成itrace了, 系统里ltrace和strace都有,但感觉ltrace信息更简捷,明显
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表