Last active
August 4, 2017 15:39
-
-
Save DavidPoliakoff/ceee3ac7857a0e4779c84e83791b318d to your computer and use it in GitHub Desktop.
Gotcha Example
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){ | |
cali::Annotation("bytes_read").set(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, "cali_bytecounter_tool"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment