Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multi-threaded process? #1

Open
DenizThatMenace opened this issue Aug 7, 2014 · 8 comments
Open

Support for multi-threaded process? #1

DenizThatMenace opened this issue Aug 7, 2014 · 8 comments

Comments

@DenizThatMenace
Copy link

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

@socketpair
Copy link
Owner

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... :(

@socketpair
Copy link
Owner

Also, cross-platform tracing is hard. Tracing file descriptors (to get known which descriptor is netlink socket actually) is hard task.

@DenizThatMenace
Copy link
Author

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).

@socketpair
Copy link
Owner

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 :)

@socketpair
Copy link
Owner

Maybe this will work for you:

$ LD_PRELOAD=<full_path_to>/preload.so ipset list

@socketpair
Copy link
Owner

@DenizThatMenace
Copy link
Author

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?

@socketpair
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants