X-Git-Url: https://git.saurik.com/apple/system_cmds.git/blobdiff_plain/b51d5b5f06948960f0bfd4ad974e625ca2350936..0e393d5044d1e68e17d91385b70d5cd6b27f8438:/latency.tproj/latency.c diff --git a/latency.tproj/latency.c b/latency.tproj/latency.c index f9bb800..42a9155 100644 --- a/latency.tproj/latency.c +++ b/latency.tproj/latency.c @@ -433,6 +433,7 @@ void sigintr() set_enable(0); set_pidexclude(getpid(), 0); screen_update(log_fp); + endwin(); set_rtcdec(0); set_remove(); @@ -443,6 +444,7 @@ void leave() /* exit under normal conditions -- signal handler */ { set_enable(0); set_pidexclude(getpid(), 0); + endwin(); set_rtcdec(0); set_remove(); @@ -1252,8 +1254,7 @@ void sample_sc(uint64_t start, uint64_t stop) if (type == DECR_TRAP) i_latency = handle_decrementer(kd); - now = (((uint64_t)kd->timestamp.tv_sec) << 32) | - (uint64_t)((unsigned int)(kd->timestamp.tv_nsec)); + now = kd->timestamp; timestamp = ((double)now) / divisor; @@ -1780,8 +1781,7 @@ kd_buf *log_decrementer(kd_buf *kd_beg, kd_buf *kd_end, kd_buf *end_of_sample, d if (kd_stop >= end_of_sample) kd_stop = end_of_sample - 1; - now = (((uint64_t)kd_start->timestamp.tv_sec) << 32) | - (uint64_t)((unsigned int)(kd_start->timestamp.tv_nsec)); + now = kd_start->timestamp; timestamp = ((double)now) / divisor; for (kd = kd_start; kd <= kd_stop; kd++) { @@ -1800,8 +1800,7 @@ kd_buf *log_decrementer(kd_buf *kd_beg, kd_buf *kd_end, kd_buf *end_of_sample, d debugid = kd->debugid; type = kd->debugid & DBG_FUNC_MASK; - now = (((uint64_t)kd->timestamp.tv_sec) << 32) | - (uint64_t)((unsigned int)(kd->timestamp.tv_nsec)); + now = kd->timestamp; timestamp = ((double)now) / divisor;