From owner-freebsd-current@FreeBSD.ORG Thu Jul 9 18:19:05 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AE6F1065677; Thu, 9 Jul 2009 18:19:05 +0000 (UTC) (envelope-from hlh@restart.be) Received: from tignes.restart.be (tignes.restart.be [IPv6:2001:41d0:2:2d29:0:1::]) by mx1.freebsd.org (Postfix) with ESMTP id EDF6E8FC18; Thu, 9 Jul 2009 18:19:04 +0000 (UTC) (envelope-from hlh@restart.be) Received: from restart.be (avoriaz.tunnel.bel [IPv6:2001:41d0:2:2d29:1:ffff::]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "avoriaz.restart.be", Issuer "CA master" (verified OK)) by tignes.restart.be (Postfix) with ESMTPS id 24344443E; Thu, 9 Jul 2009 20:19:04 +0200 (CEST) Received: from morzine.restart.bel (morzine.restart.be [IPv6:2001:41d0:2:2d29:1:2::]) (authenticated bits=0) by restart.be (8.14.3/8.14.3) with ESMTP id n69IJ0jp060970; Thu, 9 Jul 2009 20:19:01 +0200 (CEST) (envelope-from hlh@restart.be) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=restart.be; s=avoriaz; t=1247163543; bh=CtDk7+AQbNTPjvrPITl9Gnrv0DInA0uNbGtcw2oghIM=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=fK95G1wz/Fb2+VMEGGY1KX4NMS26FZ5F1qWw/v3TIsri00p1u91QYtvx24i/y9qeX R5XEtvVd9/KdBwZTL2lPw== DomainKey-Signature: a=rsa-sha1; s=avoriaz; d=restart.be; c=nofws; q=dns; h=message-id:date:from:organization:user-agent:mime-version:to:cc: subject:references:in-reply-to:content-type: content-transfer-encoding:x-scanned-by; b=mxHH/ySiGvYp7azZGHZ3LJLofVVL2nxvPqCESc0FEBKWiGOpR+Dcma5kGJj8A/62f 8cS13rr1ScNnbpvIjd59A== Message-ID: <4A563494.1010209@restart.be> Date: Thu, 09 Jul 2009 20:19:00 +0200 From: Henri Hennebert Organization: RestartSoft User-Agent: Thunderbird 2.0.0.22 (X11/20090627) MIME-Version: 1.0 To: Andriy Gapon References: <4A562960.3010801@freebsd.org> In-Reply-To: <4A562960.3010801@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on IPv6:2001:41d0:2:2d29:1:1:: Cc: freebsd-current@freebsd.org Subject: Re: dtrace users opinion solicited (timestamps) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 18:19:05 -0000 Andriy Gapon wrote: > As you might be aware DTrace timestamps right now are derived from TSC value. > http://en.wikipedia.org/wiki/Time_Stamp_Counter > > DTrace timestamps are measured in nano-seconds and the formula similar to the > following is used for calculations: > rdtsc() * 1000000000 / tsc_freq > where rdtsc is a function that returns current TSC value and tsc_freq is a > frequency of TSC. > > This formula is supposed to produce proper results if tsc_freq stays constant. > But there are environment where this might not be the case. > If a CPU has a non-invariant TSC and processor's clock frequency changes (e.g. > because of powerd), then tsc_freq changes too. > As a result, the formula would produce wildly different values and, most > importantly, was values would non be monotonic. Timestamp values that jump back > and forth would not only be useless for a user, they would also confuse DTrace > internal logic. > > There are at least the following two alternatives: > > 1. Keep things as they are and warn users not to change CPU clock frequency when > they use DTrace and the CPU doesn't have invariant TSC. I think that this should > cause only minor inconveniences to a portion of DTrace users. Im absolutely for this solution with a warning in the doc. It seems to me that when you use dtrace, you don't try at the same time to be power efficient... except if you want to dtrace powerd, of course. henri