add 'uptr' function to mark userland pointer#97
Merged
Conversation
Add explicit markers '-- probe' and '-- ast' in dump output to improve readability. Signed-off-by: Ze Huang <zehuang@qti.qualcomm.com>
Add a uptr(x) function that can mark a value as a userland pointer, causing e.g. str(uptr(arg0)) to do the right thing and not try to read the value as kernel memory. Signed-off-by: Stefan Schake <stschake@gmail.com> Signed-off-by: Ze Huang <zehuang@qti.qualcomm.com>
Before this change, an invalid probe would cause an error message to be emitted, but execution still proceeded. Make sure that we abort the entire session if all requested probes can not be used.
Add start/stop hooks to providers, and run BEGIN/END probes from there, rather than having a bunch of special cases sprinkled throughout libply.c.
Intermittently, a command like `ply -c "sleep 1" '<some-probe>'` would not terminate after the sleep process terminated. This was because the old logic relied on SIGCHLD being delivered to ply while blocked on ply_loop(). In other cases, it would be lost and the ply process would hang until terminated with a SIGINT or similar. Fix this by letting the user of libply get a copy of the fds to poll and then calling ply_service() whenever an event comes in. This way, we can fold in the signal monitoring into the main loop using a signalfd, which libply does not have to be aware of.
Collaborator
|
Thank you @Sutter099, and @stschake! |
This was referenced Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce the uptr() function and 'user' hint from @stschake's work to enable explicit marking of userland pointers. This allows expressions like str(uptr(arg0)) to correctly read user memory, resolving the issue where kernel and user pointers could not be distinguished.
As discussed in issue #87, this change enables correct filename printing in probes such as: