offline_instru_t::offline_instru_t(void (*insert_load_buf)(void *, instrlist_t *, instr_t *, reg_id_t), ssize_t (*write_file)(file_t file, const void *data, size_t count), file_t module_file) : instru_t(insert_load_buf), write_file_func(write_file), modfile(module_file) { drcovlib_status_t res = drmodtrack_init(); DR_ASSERT(res == DRCOVLIB_SUCCESS); DR_ASSERT(write_file != NULL); // Ensure every compiler is packing our struct how we want: DR_ASSERT(sizeof(offline_entry_t) == 8); }
static drcovlib_status_t event_init(void) { drcovlib_status_t res; uint64 max_elide_jmp = 0; uint64 max_elide_call = 0; /* assuming no elision */ if (!dr_get_integer_option("max_elide_jmp", &max_elide_jmp) || !dr_get_integer_option("max_elide_call", &max_elide_jmp) || max_elide_jmp != 0 || max_elide_call != 0) return DRCOVLIB_ERROR_INVALID_SETUP; /* create module table */ res = drmodtrack_init(); if (res != DRCOVLIB_SUCCESS) return res; /* create process data if whole process bb coverage. */ if (!drcov_per_thread) global_data = global_data_create(); return DRCOVLIB_SUCCESS; }