void trc_hk(void *longterm_param, void *shortterm_param, int origin, int after) { (void)longterm_param; (void)origin; int before = !after; if (global.quirks.log_call_duration) { static __thread struct timespec start_ts = {0, 0}; if (before) { clock_gettime(CLOCK_MONOTONIC, &start_ts); } if (after) { struct timespec end_ts; clock_gettime(CLOCK_MONOTONIC, &end_ts); double diff = (end_ts.tv_sec - start_ts.tv_sec) + (end_ts.tv_nsec - start_ts.tv_nsec) / 1.0e9; printf("Duration %7.5f secs, %s, %s\n", diff, reverse_func_id(origin), reverse_status((VdpStatus)shortterm_param)); } } if (before && global.quirks.log_timestamp) { struct timespec now; clock_gettime(CLOCK_REALTIME, &now); printf("%d.%03d ", (int)now.tv_sec, (int)now.tv_nsec/1000000); } if (before && global.quirks.log_thread_id) { printf("[%5ld] ", (long)get_current_thread_id()); } }
static const char * vdpGetErrorString(VdpStatus status) { return reverse_status(status); }