nltrace
nltrace copied to clipboard
Support for multi-threaded process?
Hi there, I just wanted to know if this project is still maintained and if it is planned to add support for multi-threaded processes?
Thanks, Deniz
Sorry, this project is not maintained anymore. Tracing unfortunatelly is impossible because there is no way to parse unknown netlink messages. To write complete parser I should write library like wireshark or strace, that know everything about (constantly changing!) protocols in netlink. It's too hard for me, especially when no documentation really exists (like ipset protocol).
It seems we should use libnl3 to parse messages, but I have no time to complete this. SORRY... :(
Also, cross-platform tracing is hard. Tracing file descriptors (to get known which descriptor is netlink socket actually) is hard task.
That's sad to hear. But thanks for the fast answer. And thanks for the current version, which helps me a lot (even though I have problems nl-tracing my multi-threaded applications).
OOOPS! I forgot that I already implement dumping via libnl3 :) shame on me. Will figure out how to trace multi-thread programs. It seems I should implement tracing clone() syscall as well as fork() and vfork(). (implement strace -f). It will be nice if you could help me :)
Maybe this will work for you:
$ LD_PRELOAD=<full_path_to>/preload.so ipset list
http://lwn.net/Articles/556183 + https://www.google.com/search?q=wireshark+netlink+dissector
The following both commands seem to work:
$LD_PRELOAD=<full_path_to>/preload.so ipset list
<full_path_to>/nltrace ipset list
They print some netlink-messages. However, I do neither know if this are all netlink messages sent by that command nor if this command is a multi-threaded program.
I just realized that in my (C++-)program nltrace works as long the netlink-communication takes place in the main-thread. If I start an additional thread, netlink-communication occuring in that thread is not visible via nltrace.
You meant, I could help you. How exactly could I help?
LD_PRELOAD-version can easily be patched to report thread-id in each message. But simultaneous access to netlink in different threads will garble output.
How you can help? make some pull-request!