diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-12-09 17:23:18 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-12-09 17:23:18 -0500 |
commit | 499838340aa7f0e7bcf6240570e74f5a6d217cc3 (patch) | |
tree | 3d63921b362779c322c6816900e2467940f76fa0 /runtime/time.c | |
parent | 30a77b443b2016212e731ee063e83e0b295c0f21 (diff) | |
download | systemtap-steved-499838340aa7f0e7bcf6240570e74f5a6d217cc3.tar.gz systemtap-steved-499838340aa7f0e7bcf6240570e74f5a6d217cc3.tar.xz systemtap-steved-499838340aa7f0e7bcf6240570e74f5a6d217cc3.zip |
add some more wallpaper protection against cpu frequency = 0 in gettimeofday_* internals
Diffstat (limited to 'runtime/time.c')
-rw-r--r-- | runtime/time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/time.c b/runtime/time.c index 6b01cebe..15e205dd 100644 --- a/runtime/time.c +++ b/runtime/time.c @@ -296,7 +296,6 @@ _stp_gettimeofday_ns(void) } delta = get_cycles() - last; - preempt_enable_no_resched(); #if defined (__s390__) || defined (__s390x__) @@ -317,6 +316,8 @@ _stp_gettimeofday_ns(void) // Verify units: // (D cycles) * (1E6 ns/ms) / (F cycles/ms [kHz]) = ns delta *= NSEC_PER_MSEC; + if (freq == 0) + return 0; do_div(delta, freq); #endif |