Hi Martin,

> I'm using a fbt probe where I get a system call id as an argument, how do I 
> look up the name of it? At the moment I'm post-processing the output using 
> /etc/name/to_sysnum but that doesn't feel right :)

This may not be quite what you want for your particular issue but
a way to answer the initial question is to use the sysent[] array
to extract this information. An example using post_syscall():


fbt::post_syscall:entry
{
        this->call = curthread->t_sysnum;

        this->addr = (struct sysent *)((char *)&`sysent +
            this->call * sizeof(struct sysent));

        @calls[this->addr->sy_callc] = count();
}

END
{
        printa("[EMAIL PROTECTED]", @calls);
}

# ./sysent.d
^C
         genunix`lwp_cond_wait          1
            genunix`sigsuspend          2
           genunix`syslwp_park          3
                  genunix`read          4
         genunix`getsetcontext          7
           genunix`lwp_sigmask          19
               genunix`pollsys          44
              genunix`p_online          62
                 genunix`ioctl          125


Jon.

_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to