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
Control arguments and return values at runtime #1647
base: master
Are you sure you want to change the base?
Conversation
Test 286 fails with optimizations enabled, because they interfere with the auto-args. Do you suggest a way to deal with this? |
Signed-off-by: Clément Guidi <cguidi@ciena.com>
Use the =-A/--argument= option from the client to collect new argument values in the trace, or change existing specifications. Example: $ uftrace --agent record my-program $ uftrace -p $(pidof my-program) -A func@arg1 $ uftrace -p $(pidof my-program) -A func@arg2 This will add the values of 'arg1' and then 'arg2' for function 'func' to the trace data. Signed-off-by: Clément Guidi <cguidi@ciena.com>
Use the =-R/--retval= option from the client to collect new return values in the trace, or change existing specifications. Example: $ uftrace --agent record my-program $ uftrace -p $(pidof my-program) -R func@retval This will add the value of the 'func' function's return value to the trace data. Signed-off-by: Clément Guidi <cguidi@ciena.com>
Start collecting all arguments and return values in trace data at runtime. Use automatic spec definitions. Signed-off-by: Clément Guidi <cguidi@ciena.com>
Argument and return value collection require specs to be defined so libmcount knows how to format them. The specs are usually defined at start-up. The definitions will be missing if they are not setup from the start. This commit allows to setup auto-args and prepare debug information at runtime. Signed-off-by: Clément Guidi <cguidi@ciena.com>
The parent uftrace instance is in charge of saving trace data and metadata. But it is now aware of the debug information that the agent saves inside libmcount at runtime. We fetch these data from the target process when libmcount exits. Signed-off-by: Clément Guidi <cguidi@ciena.com>
Test collecting new arguments and return values at runtime. Signed-off-by: Clément Guidi <cguidi@ciena.com>
2891a3a
to
e3c984b
Compare
I'll stop stop on this feature for now. Changing arg/retval spec at runtime requires a more elaborate data format. I plan to work on session control at runtime, i.e. initiating and finishing recording sessions without terminating the target process (e.g. if the target is a daemon). Then each session can have different arg/retval specs, which solves the problem in this particular use case (multiple sessions). |
These changes give the user full control over the argument and return value
collection at runtime.
We can use the
-A/--argument
option from the client to collect new argumentvalues in the trace, or change existing specifications. We can use the
-R/--retval
option from the client to collect new return values in the trace,or change existing specifications. And we can use the
-a/--auto-args
optionfrom the client to collect all arguments and return values.
Example:
Based on #1646.