From owner-freebsd-dtrace@FreeBSD.ORG Tue Jun 16 18:01:28 2015 Return-Path: Delivered-To: freebsd-dtrace@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 388A1AFE for ; Tue, 16 Jun 2015 18:01:28 +0000 (UTC) (envelope-from abhya007@gmail.com) Received: from mail-pd0-x22e.google.com (mail-pd0-x22e.google.com [IPv6:2607:f8b0:400e:c02::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C9BF854 for ; Tue, 16 Jun 2015 18:01:28 +0000 (UTC) (envelope-from abhya007@gmail.com) Received: by pdjn11 with SMTP id n11so19480924pdj.0 for ; Tue, 16 Jun 2015 11:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=2ZgVOG0Dv0GeTHqD9QhsZhL9UAcE78Pz/fUyTy8lr30=; b=KsdsxbOnVcEUOCHr/1y64y3jtwdHOcWve50vxa+ZYKGh5IhWSvM9K5jFj8X2ODqqDB yp1zLF5GiGTxPd0izvSgYPM08pcVCewZug/E1XbpohxPeJNKSLLYf1lxuWWOyJqWAwrG d+mI0PyDsZfepFRwcemTOSDV+1tF7FIGbFGKv+NiPjE89m7l2Zpc48T0T6CiOnzyZHPv 2csbpNTi4xURFP1RNBjilSv52ZSO2bO/7K7FipdomAeK6vCPZb8EL/EEcCO4uzjPEUW4 vNc4bhiJewiZyW9ucRUTgGL5cm49fbhL54bRSAPsJYh1pb6ouyLRVK9bZX5PPSrAt091 DBcw== MIME-Version: 1.0 X-Received: by 10.70.47.9 with SMTP id z9mr2783110pdm.69.1434477687614; Tue, 16 Jun 2015 11:01:27 -0700 (PDT) Received: by 10.70.46.99 with HTTP; Tue, 16 Jun 2015 11:01:27 -0700 (PDT) Date: Tue, 16 Jun 2015 11:01:27 -0700 Message-ID: Subject: Regarding a Sched Dtrace Script for FreeBSD From: abhishek kulkarni To: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 18:01:28 -0000 Hello all, I am working on Dtrace and trying to implement a sched script for FreeBSD 10.0 The script uses the probes on-cpu and off-cpu. The purpose is to measure the time that a CPU spends on the current thread. I am trying to use the aggregation function =E2=80=9CSUM=E2=80=9D to captur= e the CPU time for the ping utility. I am doing it by opening a new putty terminal and running the ping utility in it, and then running the Dtrace script in another instance of the terminal. I am also using the time utility in order to verify the Kernel Time for a ping. The time given by the =E2=80=9CTime=E2=80=9D utility and the Dtrace s= cript do not match. Could you please help with this . The following is the Dtrace script we are trying out : sched:::on-cpu /curthread->td_name =3D=3D "ping"/ { self->ts =3D timestamp; } sched:::off-cpu /self->ts !=3D 0/ { @delta[curthread->td_name] =3D sum(timestamp - self->ts)/1000000; self->ts =3D0; } Looking forward to hear from you. Regards Abhishek kulkarni