From owner-p4-projects@FreeBSD.ORG Sun Nov 5 00:49:26 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8802C16A417; Sun, 5 Nov 2006 00:49:26 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30FA216A415 for ; Sun, 5 Nov 2006 00:49:26 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0038943D45 for ; Sun, 5 Nov 2006 00:49:25 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kA50nPdq000896 for ; Sun, 5 Nov 2006 00:49:25 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kA50nPwo000893 for perforce@freebsd.org; Sun, 5 Nov 2006 00:49:25 GMT (envelope-from jb@freebsd.org) Date: Sun, 5 Nov 2006 00:49:25 GMT Message-Id: <200611050049.kA50nPwo000893@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 109252 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: Sun, 05 Nov 2006 00:49:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=109252 Change 109252 by jb@jb_freebsd8 on 2006/11/05 00:49:02 Merge the DTrace code back in. This is an example of a DTrace support function required to allow the dtrace module to load. It is coded here so that it can be maintained with other similar code. The function is named with the dtrace_ prefix so that the DTrace FBT (function boundary trace) provider knows not to try to trace it because it is called from the DTrace probe context and tracing it would mean a recursive trap. Affected files ... .. //depot/projects/dtrace/src/sys/i386/i386/tsc.c#7 edit Differences ... ==== //depot/projects/dtrace/src/sys/i386/i386/tsc.c#7 (text+ko) ==== @@ -153,3 +153,18 @@ { return (rdtsc()); } + +/* + * 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. + */ +#ifdef KDTRACE +uint64_t +dtrace_gethrtime() +{ + return (rdtsc() * (uint64_t) 1000000000 / tsc_freq); +} +#endif