From owner-p4-projects@FreeBSD.ORG Sat Mar 22 18:21:57 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BB3FD106566C; Sat, 22 Mar 2008 18:21:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 604AB106564A for ; Sat, 22 Mar 2008 18:21:57 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 587E18FC14 for ; Sat, 22 Mar 2008 18:21:57 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2MILvEk093054 for ; Sat, 22 Mar 2008 18:21:57 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2MILvWJ093052 for perforce@freebsd.org; Sat, 22 Mar 2008 18:21:57 GMT (envelope-from jb@freebsd.org) Date: Sat, 22 Mar 2008 18:21:57 GMT Message-Id: <200803221821.m2MILvWJ093052@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 138300 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2008 18:21:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=138300 Change 138300 by jb@jb_freebsd1 on 2008/03/22 18:21:39 Move the dtrace_gethrtime() functions back into DTrace central. These need to be expanded to be multi-cpu aware so that the time value takes into account skew between processes. Affected files ... .. //depot/projects/dtrace/src/sys/amd64/amd64/tsc.c#6 edit .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/amd64/dtrace_subr.c#9 edit .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/i386/dtrace_subr.c#12 edit .. //depot/projects/dtrace/src/sys/i386/i386/tsc.c#12 edit Differences ... ==== //depot/projects/dtrace/src/sys/amd64/amd64/tsc.c#6 (text+ko) ==== @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.208 2007/06/04 18:25:01 dwmalone Exp $"); #include "opt_clock.h" -#include "opt_kdtrace.h" #include #include @@ -45,10 +44,6 @@ #include #include -#ifdef KDTRACE_HOOKS -#include -#endif - #include "cpufreq_if.h" uint64_t tsc_freq; @@ -225,18 +220,3 @@ { return (rdtsc()); } - -#ifdef KDTRACE_HOOKS -/* - * DTrace needs a high resolution time function which can - * be called from a probe context and guaranteed not to have - * instrumented with probes itself. - * - * Returns nanoseconds since boot. - */ -uint64_t -dtrace_gethrtime() -{ - return (rdtsc() * (uint64_t) 1000000000 / tsc_freq); -} -#endif ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/amd64/dtrace_subr.c#9 (text+ko) ==== @@ -377,6 +377,19 @@ } #endif +/* + * DTrace needs a high resolution time function which can + * be called from a probe context and guaranteed not to have + * instrumented with probes itself. + * + * Returns nanoseconds since boot. + */ +uint64_t +dtrace_gethrtime() +{ + return (rdtsc() * (uint64_t) 1000000000 / tsc_freq); +} + uint64_t dtrace_gethrestime(void) { ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/i386/dtrace_subr.c#12 (text+ko) ==== @@ -376,6 +376,19 @@ } #endif +/* + * DTrace needs a high resolution time function which can + * be called from a probe context and guaranteed not to have + * instrumented with probes itself. + * + * Returns nanoseconds since boot. + */ +uint64_t +dtrace_gethrtime() +{ + return (rdtsc() * (uint64_t) 1000000000 / tsc_freq); +} + uint64_t dtrace_gethrestime(void) { ==== //depot/projects/dtrace/src/sys/i386/i386/tsc.c#12 (text+ko) ==== @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD: src/sys/i386/i386/tsc.c,v 1.208 2007/06/04 18:25:06 dwmalone Exp $"); #include "opt_clock.h" -#include "opt_kdtrace.h" #include #include @@ -45,10 +44,6 @@ #include #include -#ifdef KDTRACE_HOOKS -#include -#endif - #include "cpufreq_if.h" uint64_t tsc_freq; @@ -249,18 +244,3 @@ { return (rdtsc()); } - -#ifdef KDTRACE_HOOKS -/* - * DTrace needs a high resolution time function which can - * be called from a probe context and guaranteed not to have - * instrumented with probes itself. - * - * Returns nanoseconds since boot. - */ -uint64_t -dtrace_gethrtime() -{ - return (rdtsc() * (uint64_t) 1000000000 / tsc_freq); -} -#endif