Hi,

On Thu, 7 Aug 2014 19:19:47 +0530, Zubin Mithra <[email protected]> wrote:
>>
>> System calls that adding and removing a socket from fd table of process are
>> enumerable. So you can cache the response from the netlink socket safely
>> if the target program is not multi-threaded.
>>
>> * adding
>>
>>   + socket
>>   + accept
>>   + passing
>>
>> * removing
>>
>>   + close
>>   + shutdown?
>>
>>
>> Could the technique I used in commit 1d78d22058da04eac7bf726c059d5c3fb193da08
>> help you?
> 
> I'll check this commit out and reply asap.

After thinking, you may not have to track the adding.
Not in a long span, we can use inode number of socket can be used as a
key for search information from cache. The inode number can be used as 
an identifier in system global. Nice.

close() and shutdown() must be tracked to avoid overflowing of cache
area. consider stracing following broken code:

   while (1)
   {
        n = socket (...);
        close(n);
   }

In the latest linux What  I checked are

linux/net/socket.c::sock_alloc

        inode->i_ino = get_next_ino();

fs/inode.c::get_next_ino

        *p = ++res;
        put_cpu_var(last_ino);
        return res;


Masatake YAMATO

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to