uprobe_dup: new probe that duplicates an event to a second probe#1178
Open
funman wants to merge 1 commit into
Open
uprobe_dup: new probe that duplicates an event to a second probe#1178funman wants to merge 1 commit into
funman wants to merge 1 commit into
Conversation
Usage example:
+ FILE *f = fopen("log.txt", "w");
+ assert(f);
+ struct uprobe *uprobe_log = uprobe_stdio_alloc(NULL, f, loglevel);
+ uprobe_stdio_set_color(uprobe_log, true);
+ assert(uprobe_log != NULL);
+
uprobe_main = uprobe_stdio_alloc(NULL, stderr, loglevel);
assert(uprobe_main != NULL);
+ uprobe_main = uprobe_dup_alloc(uprobe_main, uprobe_log, UPROBE_LOG);
+ assert(uprobe_main != NULL);
+ uprobe_release(uprobe_log);
To get both terminal output and file output (with colors)
nto
requested changes
Jun 18, 2026
nto
left a comment
Collaborator
There was a problem hiding this comment.
- Can you add a test case?
- Please fix the coding style so that function parameters are correctly aligned
- Commit title should be in imperative style and comply with the 50/72 Rule (eg:
uprobe_dup: duplicate an event to a second probe) - You may remove error handling from the example and use more helpful variable names (eg:
file_outputandterm_outputfor each uprobe_stdio instance)
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.
Usage example:
assert(uprobe_main != NULL);
To get both terminal output and file output (with colors)