Created
August 4, 2017 15:39
-
-
Save DavidPoliakoff/2246a82f2a5500d8e138ec9dcf1e2f2f to your computer and use it in GitHub Desktop.
Gotcha_tau
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
ssize_t (*orig_read)(int fildes, void *buf, size_t nbyte); | |
ssize_t read_wrapper(int fildes, void* buf, size_t nbyte){ | |
TAU_REGISTER_CONTEXT_EVENT(event, "Bytes read"); | |
TAU_CONTEXT_EVENT(event, nbyte); | |
return orig_read(fildes, buf, nbyte); | |
} | |
struct gotcha_binding_t wrap_actions[] = { | |
{ "read", read_wrapper, &orig_read } | |
}; | |
void init_bytecounter_tool(){ | |
gotcha_wrap(wrap_actions, 1, "tau_bytecounter_tool"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment