Am completely new to dtrace. I am stuck with an issue related to streams and need to figure out the problem with dtrace. I am developing a packet filter based on PFIL. PFIL sits below IP and there i intercept the v4 packets and reinject a new v6 pkt. I don''t see this packet going out of the bge0 interface. Am not sure what happens to the packet once it passes PFIL. Is there a way to trace this issue down with the help of Dtrace ? Please get me some pointers. -- This message posted from opensolaris.org
Hi. I would first check using mdb that the streams stack that you have built is correct. A simple way to do this is: # mdb -k ::log streams # output into file named "streams" ::walk stream_head_cache | ::stream # this will show a synopsis of all? the streams in the system c # continue (the output will go to your screen and to the "streams" file !vi streams # or use a decent editor... search for your module and check plumbing (your module name should be in this output) $q If the plumbing is correct, any message coming into your module should come in via the read or write side put function. Since you are concerned about packets going out, you want to look at the write side. The following will trace what happens with a message once it enters your module write side put routine (or at least a little of what happens). If you don''t see output, your put routine is not getting called. If you don''t see putnext or putq, your module is either freeing the message, or doing ??? Or, there is a bug in my script... max #!/usr/sbin/dtrace -s foo_wput:entry /* or whatever you call your write side put function */ { self->in = 1; /* you''re in, arg1 is the message (mblk_t, etc.) passed to your routine */ } putnext:entry /* generally, your module put function will either pass the message to the next module */ /self->in/ /* only trace when called as a result of foo_wput */ { } putq:entry /* or enqueue the message for later processing by the service routine */ /self->in/ /* only trace when called as a result of foo_wput */ { } foo_wput:return /self->in/ { self->in = 0; } Lenin wrote:> Am completely new to dtrace. I am stuck with an issue related to streams and need to figure out the problem with dtrace. I am developing a packet filter based on PFIL. PFIL sits below IP and there i intercept the v4 packets and reinject a new v6 pkt. I don''t see this packet going out of the bge0 interface. Am not sure what happens to the packet once it passes PFIL. > > Is there a way to trace this issue down with the help of Dtrace ? Please get me some pointers. > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org > >
Hi. I would first check using mdb that the streams stack that you have built is correct. A simple way to do this is: # mdb -k ::log streams # output into file named "streams" ::walk stream_head_cache | ::stream # this will show a synopsis of all? the streams in the system c # continue (the output will go to your screen and to the "streams" file !vi streams # or use a decent editor... search for your module and check plumbing (your module name should be in this output) $q If the plumbing is correct, any message coming into your module should come in via the read or write side put function. Since you are concerned about packets going out, you want to look at the write side. The following will trace what happens with a message once it enters your module write side put routine (or at least a little of what happens). If you don''t see output, your put routine is not getting called. If you don''t see putnext or putq, your module is either freeing the message, or doing ??? Or, there is a bug in my script... max #!/usr/sbin/dtrace -s foo_wput:entry /* or whatever you call your write side put function */ { self->in = 1; /* you''re in, arg1 is the message (mblk_t, etc.) passed to your routine */ } putnext:entry /* generally, your module put function will either pass the message to the next module */ /self->in/ /* only trace when called as a result of foo_wput */ { } putq:entry /* or enqueue the message for later processing by the service routine */ /self->in/ /* only trace when called as a result of foo_wput */ { } foo_wput:return /self->in/ { self->in = 0; } Lenin wrote:> Am completely new to dtrace. I am stuck with an issue related to streams and need to figure out the problem with dtrace. I am developing a packet filter based on PFIL. PFIL sits below IP and there i intercept the v4 packets and reinject a new v6 pkt. I don''t see this packet going out of the bge0 interface. Am not sure what happens to the packet once it passes PFIL. > > Is there a way to trace this issue down with the help of Dtrace ? Please get me some pointers. > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org > >