From owner-freebsd-arch@freebsd.org Mon Dec 19 21:08:44 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 58948C88B10 for ; Mon, 19 Dec 2016 21:08:44 +0000 (UTC) (envelope-from hrs@FreeBSD.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 BD8081AA0 for ; Mon, 19 Dec 2016 21:08:43 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org (p2027-ipbf1605funabasi.chiba.ocn.ne.jp [123.225.191.27]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id uBJL8Jci087432 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Tue, 20 Dec 2016 06:08:39 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.allbsd.org (alph.allbsd.org [192.168.0.10]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id uBJL74ZV050421 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Dec 2016 06:07:04 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.15.2/8.15.2) with ESMTPA id uBJL72Ub050418; Tue, 20 Dec 2016 06:07:03 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 20 Dec 2016 06:05:42 +0900 (JST) Message-Id: <20161220.060542.16356944875657261.hrs@allbsd.org> To: domagoj.stolfa@gmail.com, adrian.chadd@gmail.com Cc: freebsd-arch@freebsd.org Reply-To: freebsd-arch@FreeBSD.org Subject: Re: RFC: DTrace probes for debugging or testing in userland programs From: Hiroki Sato In-Reply-To: <20161219204719.GE65993@freebsd-laptop> References: <20161220.043646.1181938468712455328.hrs@allbsd.org> <20161219204719.GE65993@freebsd-laptop> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Dec_20_06_05_42_2016_527)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.99 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [133.31.130.32]); Tue, 20 Dec 2016 06:08:40 +0900 (JST) X-Spam-Status: No, score=-99.9 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 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 21:08:44 -0000 ----Security_Multipart(Tue_Dec_20_06_05_42_2016_527)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Domagoj Stolfa wrote in <20161219204719.GE65993@freebsd-laptop>: do> Hello, do> do> > I'd love to see a unified-ish logging API for FreeBSD applications. I do> > always end up reusing some C code I have here that I based on some do> > Squid style logging API in ages past. I could always polish it up and do> > put it up for review. do> > do> > I'm not a big fan of requiring dtrace to use it though. On a lot of do> > the embedded systems dtrace varies from "it's very big" through to "we do> > don't have enough RAM/flash to do this". do> do> DTrace indeed is very heavyweight, this could be an opt-in kind of thing do> compile time, hidden somewhere in the logging system employed. do> Personally, I think that keeping the diffs in the actual daemons to the do> bare minimum(1-2 LoC) should be one of the priorities. Additionally, the do> logging system should by default be lightweight, with compile time do> options to change the actual logging method(a simple log, DTrace, ...). do> do> > So although I like the sentiment, I don't think using dtrace for do> > program logging is the right answer. I like what apple did to wrap do> > the program logging stuff so people didn't just write their own do> > libraries (hi!) and so there's a unified-ish way to interact with do> > apple programs. I think we could do with that. do> do> This sounds like a pretty clean solution, and the logging method could do> be hid somewhere deep in there. I would personally like to see an option do> where I could pick DTrace for logging, as it allows for some interesting do> scripts to be written, however I tend to agree that this should not be do> the default. 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. -- Hiroki ----Security_Multipart(Tue_Dec_20_06_05_42_2016_527)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlhYS6YACgkQTyzT2CeTzy3KLgCfXsd4GL/nxJKYODu14ZVjwnZ4 HwMAn1jx2MUxDq24hN0jJRoGOPu2j/3o =ducG -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Dec_20_06_05_42_2016_527)----