how to find arguments mean in dtrace

余生颓废 提交于 2019-12-06 14:48:32

As the documentation explains, for the syscall provider's entry probes, arg0, arg1 etc. are the system call's arguments themselves. For syscall::read:entry, then, looking at the read(2) man page shows

 ssize_t read(int fildes, void *buf, size_t nbyte);

and so arg0 is the value of fildes.

Unfortunately, fds[] doesn't appear to be described in the official documentation. fds[] is something, similar to a subroutine, that DTrace provides to translate a file descriptor into a fileinfo_t. The fileinfo_t is a stable structure that provides useful information about a file without exposing the implementation details to the user.

The documentation for the io provider states that, for io:::start, args[0] is a pointer to a struct buf. This is another documentation bug: it's actually a pointer to a struct bufinfo, which is described on the same page.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!