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(){ |
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
int init_my_tool(bool verbose){ | |
if(verbose){ | |
gotcha_wrap(a_few_functions); | |
} | |
else{ | |
gotcha_wrap(all_the_functions); | |
} | |
} |
NewerOlder