Patch for Extend ktrace/kdump output

Andrew Li andrew2.li at citi.com
Mon Oct 22 18:13:11 PDT 2007


I'm working with Alexander Leidinger on the ktrace project mentioned on
the ideas page (http://www.freebsd.org/projects/ideas/#p-ktrace). The
patch attached is a continuance of David Kirchner's work (details here 
http://lists.freebsd.org/pipermail/freebsd-arch/2006-April/005107.html).

The attached patch modifies the kdump output for struct sockaddr and all
stat(2) calls to show a more readable output. 

For sockaddr, the new kdump shows:

  2345 telnet CALL connect(0x3,0xbfbfe600,0x1c)
  2345 telnet SOCK {AF_INET, 127.0.0.1:8000}
  2345 telnet RET connect 0

Where as the old one will show:

  2345 telnet CALL connect(0x3,0xbfbfe600,0x1c)
  2345 telnet RET connect 0

For stat(2),

  34534 stat CALL stat(0x8048614,0xbfbfe908)
  34534 stat STAT {dev=100, ino=383524, mode=-rw-r--r-- , nlink=1,
uid=1000, gid=1000, rdev=1528768, atime=1192715539, stime=1192471088,
ctime=1192471088, birthtime=1192471088, size=17898, blksize=4096,
blocks=36, flags=0x0}
  34534 stat RET stat 0

With the original ktrace/kdump, the above will be displayed like this:

  34536 stat CALL stat(0x8048614,0xbfbfe908)
  34536 stat RET stat 0

This is my first patch for FreeBSD, any feedback you may have is much
appreciated. 

$ uname -a
FreeBSD elmo 7.0-CURRENT FreeBSD 7.0-CURRENT #82: Fri Oct 19 16:34:25
EST 2007   root at elmo:/usr/obj_current/var/src_current/sys/GENERIC   i386

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ktrace.patch
Type: text/x-patch
Size: 18594 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20071023/e10c23f3/ktrace.bin


More information about the freebsd-current mailing list