On Tue, Sep 19, 2017 at 6:00 AM, Nayan Gadre <beejoy.na...@gmail.com> wrote:

> Hi,
>
> I am new to solaris dtrace debugging tool, but I have prior experience
> with Linux SystemTap.
>
> I need to debug my Solaris kernel module particularly extract the data
> in a structure passed by reference to my kernel function.
>
> msg_recv(struct sk_buff *skbp, uint_t link, uchar_t* src)
> {
>     pkt_hdr_t *pkt;
>     pkt = (pkt_hdr_t *)skbp->data;
>     port = pkt->port;
> }
>
> I have written a systemtap script in linux to access the argument and
> extract data.
>
> How can I do this using DTRACE for solaris modules.
>

I'm assuming you're talking about a kernel module, and reading a pointer to
kernel memory.  (But the other respondents on this thread seem to be
assuming otherwise, so maybe I've misunderstood).  Here are a few examples:

dtrace -n 'msg_recv:entry{print(*args[0])}'

or if you want a specific member:

dtrace -n 'msg_recv:entry{printf("a=%u", args[0]->a)}'

Or if you need to cast a member as the code does:

dtrace -n 'msg_recv:entry{print(*((pkt_hdr_t*)args[0]->data))}'

--matt




> 
> I tried looking into the system and trying few commands, but thats all
> i know about dtrace:
> 
> [root@vcssx247-ldm7 ~]#dtrace -l | grep msg_recv
>  7090        fbt               mymod                     msg_recv1 entry
>  7091        fbt               mymod                     msg_recv1 return
>  7548        fbt               mymod                     msg_recv entry
>  7549        fbt               mymod                     msg_recv return
> 
> Any pointers to correct, to the point documentation would be appreciated.
> 
> Thanks
> Nayan
> 



-------------------------------------------
dtrace-discuss
Archives: https://www.listbox.com/member/archive/184261/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184261/25769126-e243886f
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769126&id_secret=25769126-8d47a7b2
Powered by Listbox: http://www.listbox.com

Reply via email to