Skip to content

Instantly share code, notes, and snippets.

View DavidPoliakoff's full-sized avatar

David Poliakoff DavidPoliakoff

  • Chicago Trading Company
  • Chicago
View GitHub Profile
@DavidPoliakoff
DavidPoliakoff / cali_gotcha.cpp
Last active August 4, 2017 15:39
Gotcha Example
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(){
@DavidPoliakoff
DavidPoliakoff / gotcha_levels
Last active August 2, 2017 18:16 — forked from anonymous/gotcha_levels
Gotcha Switchboard
int init_my_tool(bool verbose){
if(verbose){
gotcha_wrap(a_few_functions);
}
else{
gotcha_wrap(all_the_functions);
}
}