static inline struct exit_event * create_exit(uint_t exit_code) {
struct exit_event * evt = V3_Malloc(sizeof(struct exit_event));
+ if (!evt) {
+ PrintError("Cannot allocate in createing exit in telemetry\n");
+ return NULL;
+ }
+
evt->exit_code = exit_code;
evt->cnt = 0;
evt->handler_time = 0;
struct v3_telemetry_state * telemetry = &(vm->telemetry);
struct telemetry_cb * cb = (struct telemetry_cb *)V3_Malloc(sizeof(struct telemetry_cb));
+ if (!cb) {
+ PrintError("Cannot allocate in adding a telemtry callback\n");
+ return ;
+ }
+
cb->private_data = private_data;
cb->telemetry_fn = telemetry_fn;
struct v3_telemetry_state * telemetry = &(vm->telemetry);
uint64_t invoke_tsc = 0;
rdtscll(invoke_tsc);
- V3_Print("%stelemetry window tsc cnt: %d\n", hdr_buf, (uint32_t)(invoke_tsc - telemetry->prev_tsc));
+ V3_Print("%stelemetry window tsc cnt: %u\n", hdr_buf, (uint32_t)(invoke_tsc - telemetry->prev_tsc));
telemetry->prev_tsc = invoke_tsc;
}