summaryrefslogtreecommitdiffstats
path: root/sys/cddl/dev/dtrace
diff options
context:
space:
mode:
authorzml <zml@FreeBSD.org>2012-06-04 16:04:01 +0000
committerzml <zml@FreeBSD.org>2012-06-04 16:04:01 +0000
commitaf0c1bd2f507f03ce71696fff76105d95285533a (patch)
tree3f7b5012961593e655e3f4bfd5da1b4a9963591e /sys/cddl/dev/dtrace
parentd351cdcdf9c9f7fac31717fabfd7259ba1e2e08c (diff)
downloadFreeBSD-src-af0c1bd2f507f03ce71696fff76105d95285533a.zip
FreeBSD-src-af0c1bd2f507f03ce71696fff76105d95285533a.tar.gz
Fix DTrace TSC skew calculation:
The skew calculation here is exactly backwards. We were able to repro it on a multi-package ESX server running a FreeBSD VM, where the TSCs can be pretty evil. MFC after: 1 week Submitted by: Jeff Ford <jeffrey.ford2@isilon.com> Reviewed by: avg, gnn
Diffstat (limited to 'sys/cddl/dev/dtrace')
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_subr.c2
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_subr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index d2a1cf1..d80287b 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -446,7 +446,7 @@ dtrace_gethrtime()
* (see nsec_scale calculations) taking into account 32-bit shift of
* the higher half and finally add.
*/
- tsc = rdtsc() + tsc_skew[curcpu];
+ tsc = rdtsc() - tsc_skew[curcpu];
lo = tsc;
hi = tsc >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index b52097b..e0e9750 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -447,7 +447,7 @@ dtrace_gethrtime()
* (see nsec_scale calculations) taking into account 32-bit shift of
* the higher half and finally add.
*/
- tsc = rdtsc() + tsc_skew[curcpu];
+ tsc = rdtsc() - tsc_skew[curcpu];
lo = tsc;
hi = tsc >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +
OpenPOWER on IntegriCloud