On Thu, Mar 13, 2008 at 12:40 AM, Brendan Gregg - Sun Microsystems
<brendan at sun.com> wrote:
> G'Day Nacho,
>
>  Thanks for writing this up and showing how DTrace and mdb can be useful.
>  Here are some comments.
>
>  * "Let's review execve(2) then ... since we know it's a system call"
>         - you start by discussing the libc execve() function (which
>           calls into the kernel via _syscall()).  I have the feeling
>           the libc execve() function may be best called execve(3C), which
>           then calls execve(2); it might be best to ask someone in
>           code-discuss about that distinction.

That is an interesting question, but I think it's OK as it is, let me explain:
execve(2) doesn't actually describe the system call but the libc
version of the function. That man page actually points to exec(2)
which also talks about execl, execle, execlp, execv and execvp

>
>  * "syscall::exece:entry ... printf("fd: %d", arg0);"
>         - arg0 is the filename, not a file descriptor.  You can try
>           trace(copyinstr(arg0));.

All I was trying to do is show the flow of the code, so I guess that
printf should not have been there in the first place, I do like what
your change does so I'll just go ahead and modify the text accordingly
some other script to show the path connecting the call to execve and
exece would be useful too I think, I'll look into that

>
>  * About the mdb usage:
>         - Why was "struct execsw" in quotes?
>         - Why was struct execsw specified at all? (try "execsw::print")
>         - Where did +0x50 come from? (eg, "execsw,3::print struct execsw")

I think the +0x50 came from the sizeof(struct execsw)

>
>  * Overall:
>         - it might help to put an enumerated list of events near the
>           end, to reinforce the order of events.
>         - good opportunity to include a:
>                 dtrace -n 'fbt::findexec_by_hdr:entry {
>                         printf("%.4S", stringof(arg0)); stack();
>                 }'
>           to show how it is called twice, the first on '#!', the second
>           on the ELF file.

I like it

>         - A reference section at the end to point users to:
>           http://www.opensolaris.org/os/community/dtrace
>           http://www.opensolaris.org/os/community/mdb
>           Solaris Internals, 2nd Ed.

I would like for this to be included in the curriculum tutorial, all
those references are there already

>
>  cheers,

Thank you very much for the time

nacho

Reply via email to