This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] - DRAFT - Easy access to IP address in struct sockaddr in syscall.bind probe (for now)


On Wed, Nov 13, 2013 at 05:18:35PM -0500, Frank Ch. Eigler wrote:

Hi Frank.

Thanks again for comments. I did some changes, but comments and changes
are still needed.
> 
> Hi, Robin -
> 
> rhack wrote:
> 
> > [...]  Then I decided to write this patch. Patch is only draft now
> > and comments are very welcome.
> 
> Nice.  A few code comments:
> 
> The use of TMP_STAP_RETVALUE / MAXLEN in the embedded-c function is a
> little clumsy.  Have you considered using ordinarily named variables
> to track the remainder base/length of STAP_RETVALUE,
It's fixed.
> and doing the
> RETVALUE_INC_SKIP dance inlined instead of as a macro?
I apologize here, but this part is not clear enought for me.

> What about delimiters between the data corresponding to multiple SA_* selections?
I changed approach. Now I export values direct to probes.
Delimiters will be good in tapset library.
> 
> 
> > Very easy example are attached too.
> 
> It might be even simpler if the related tapset functions all get this
> kind of stuff, but perhaps plopped into a macro for easier handling:
> 
> probe syscall.bind = ... {
> %( systemtap_v >= "2.5" %? 
>     if (_struct_sockaddr_u_sa_family(my_addr_uaddr, addrlen) =~ "AF_INET.*") {
>        uaddr_ip = _struct_sockaddr_u_ip_addr(my_addr_uaddr, addrlen)
>        uaddr_ip_port = ... 
>     }
> %)
> 
> where the whole %(  %)  block could be @defined in a macro, kind of like
> _nfs_data_timestamp in tapset/linux/nfs_proc.stpm.
> 
> 
> > What is not solved in this patch:
> >     * Error handling if wrong struct is passed - now it's just return empty ("") string. Maybe throw exception will be better.
I hope, that this will be part of tapset.
> >     * Expansion to syscall.connect probe.
Done :).
> >     * Write tapset shell for new internal functions.
In progress.
> 
> Yup, plus a test case (e.g., a testsuite/buildok file).
I added some tests.
> 
> Thanks!
> 
> - FChE

Attachment: uaddr_ip-v2.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]