From owner-freebsd-arch@freebsd.org Mon Dec 19 23:08:20 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DCA9C88439 for ; Mon, 19 Dec 2016 23:08:20 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AACE0125F for ; Mon, 19 Dec 2016 23:08:19 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from [10.155.117.172] ([1.66.104.193]) (authenticated bits=0) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPA id uBJN859H096380; Tue, 20 Dec 2016 08:08:16 +0900 (JST) (envelope-from hrs@allbsd.org) Content-Type: text/plain; charset=iso-2022-jp Mime-Version: 1.0 (1.0) Subject: Re: RFC: DTrace probes for debugging or testing in userland programs From: Hiroki Sato X-Mailer: iPhone Mail (14C92) In-Reply-To: <20161219215425.GB42198@freebsd-laptop> Date: Tue, 20 Dec 2016 08:08:05 +0900 Cc: freebsd-arch@FreeBSD.org, adrian.chadd@gmail.com Content-Transfer-Encoding: quoted-printable Message-Id: <9887B4D9-A336-498D-ADDE-E683B0DEC2E8@allbsd.org> References: <20161220.043646.1181938468712455328.hrs@allbsd.org> <20161219204719.GE65993@freebsd-laptop> <20161220.060542.16356944875657261.hrs@allbsd.org> <20161219215425.GB42198@freebsd-laptop> To: Domagoj Stolfa X-Virus-Scanned: clamav-milter 0.99 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [133.31.130.32]); Tue, 20 Dec 2016 08:08:16 +0900 (JST) X-Spam-Status: No, score=1.3 required=13.0 tests=CONTENT_TYPE_PRESENT, FORGED_RCVD_IP,ISO2022JP_BODY,ISO2022JP_CHARSET,MIMEQENC,QENCPTR1,QENCPTR2 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on gatekeeper.allbsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 23:08:20 -0000 2016/12/20 6:54=1B$B!"=1B(BDomagoj Stolfa =1B$B$N= %a%C%;!<%8=1B(B: > Hello, >=20 >> To be clear: my proposal is to replace only debug logging (i.e. for >> developers), not the other logging in general, as the subject line >> says. Although I agree that DTrace is not lightweight, I think >> impact of just adding tracing probes is small. >>=20 >> -- Hiroki >=20 > I believe this would indeed be beneficial for debugging. My main concern > is the way that we would have to attach to probes should we use SDT > provider as it works now. If we were to create probes for each of the > daemons, which we would then run individually, and if I'm not mistaken, > that would spawn 2 times the amount of processes than are currently=20 > spawned due to each ``dtrace'' call from the command line spawns a process= . No. A single dtrace process can catch fired probes of multiple processes if you want. Filtering probes or the results from probes is things which should be done in the D script level, not in the target binary, in the case of DTrace. My proposal does not cover how to use the probes. It just provides probes and a sample script to reproduce the (almost) same results with printf() debug logging. The big difference is that a developer can use these probes for a more complex debug script and/or regression test script because the probes can carry data structures in question, not just a string. -- Hiroki=