This page describes all problems, tasks and solution approaches regarding tracing of method invocations that can span over multiple threads.
...
The creator ID is injected in the new thread during the instantiation operation. Similar the starter ID can be injected during the start operation.
Alternatively the active thread (creater, starter) could aquire acquire the ID of the thread its working on and transmit it to the agent.
Assumption: The Thread class can be instrumented. (Research)
Questions / Possible Problems
- Not only the thread class specific methods should be considered for the trace, but also other inter-thread communication. For example a method thats change a boolean value which cause a thread to continue operating.
- How to access information about the current method?
- How to handle thread pools? Is there a universal solution for every thread pool implementation?
- An asynchronous method invocation has no fixed start and end point. Is possible, that a asynchronous methods is still running after its caller is already finished.
- How can i modify the start() method on Threads, to get the information about the Thread creator, caller and executor?
From brain dump
To build up an invocation sequence, each invoked method must know the method that was invoked before it
...