From owner-freebsd-arch@freebsd.org Tue Dec 20 12:44:12 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 54555C88259 for ; Tue, 20 Dec 2016 12:44:12 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 D3E56671 for ; Tue, 20 Dec 2016 12:44:11 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id m203so24076431wma.3 for ; Tue, 20 Dec 2016 04:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MLGiRNqGmyy+v8GTIWhRcdUb75eAE0/wFr6xezh8Xoc=; b=qaiBDziigfnb15NFs8clSU4HADO0sL7Tf4ZyaWv4Qd+1YjboRMjvVeZ2ZQqUq8lBGy LZKk+On/RHowpvC0FIs65yTZaoahvdT/GuBOpVsItVOHMX8ynhn/flH7OZUzlgZ26caF aF6gnoGoYSZGWJjz6WDN5X1uexSivA0cEf5Ue847dm8lWp61FfSuYn4cf4pkrW5Y+mOg zioeMpzBI8OQ3wD9GfS4P6gjVmZuZxp+wE6Awx5ABdOlerVRkVi0GR+f1IbOd6CiENd5 D04BOA8QGw5vsIrmpAw76M00ITlnWvrVwfnYmmZbihSIh0FZZu54xIfGV5m7huFWR5LJ vTxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MLGiRNqGmyy+v8GTIWhRcdUb75eAE0/wFr6xezh8Xoc=; b=k5sS//vbCVPsq5IDMSaUcn6c2VJ9Y542u8QL6p0wIAVBT0gfbP9/jGqt87//70esd4 WcqSU15y7GO0m7ZIxTRWwmLVgA0CtWjnhhi77v7DS3bQKCEvwsFO0H/xMd0jI97Sc9VG bUC1xmiclhbaWBVodfEAApcWmmEuwef2i3uO7miQ5t5cg1xlAvd5B4w71dXTG1h9i5fz 40bDlPzbTy81Y5gY02gHMCzPKZjDelWty15+1L4t7s2Fmjj/4GDumLTKt/U58Z4Yb8hC mWlmo0p4mj00jESxXlg0ZcG50LyvFfltsuz/HtPNhVkv+2/o0p+Cnjyklk8eCo6GqRYL e7Kw== X-Gm-Message-State: AIkVDXI8/VetPx5QNPwwomX4jDqoKx3onxZAWUXbUGp0jnEp/PNf+gWe7/gFMq0clCDD7g== X-Received: by 10.28.4.199 with SMTP id 190mr1727720wme.11.1482237850366; Tue, 20 Dec 2016 04:44:10 -0800 (PST) Received: from freebsd-laptop ([31.217.98.238]) by smtp.gmail.com with ESMTPSA id w197sm21939773wmd.11.2016.12.20.04.44.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2016 04:44:09 -0800 (PST) Date: Tue, 20 Dec 2016 13:44:06 +0100 From: Domagoj Stolfa To: Hiroki Sato Cc: freebsd-arch@FreeBSD.org, adrian.chadd@gmail.com Subject: RFC: DTrace probes for debugging or testing in userland programs Message-ID: <20161220124406.GA1713@freebsd-laptop> References: <20161220.043646.1181938468712455328.hrs@allbsd.org> <20161219204719.GE65993@freebsd-laptop> <20161220.060542.16356944875657261.hrs@allbsd.org> <20161219215425.GB42198@freebsd-laptop> <9887B4D9-A336-498D-ADDE-E683B0DEC2E8@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <9887B4D9-A336-498D-ADDE-E683B0DEC2E8@allbsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) 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: Tue, 20 Dec 2016 12:44:12 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, > No. A single dtrace process can catch > fired probes of multiple processes if you want. >=20 > 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. I suppose this comes down to a way that you want to implement this. Using the SDT provider would require you to attach to the probes using a D script to perform simple logging, and additional scripts in order to do more complex operations(such as quantize certain arguments that you're getting in during that log and what not). Eventhough your original proposal doesn't cover using those probes, I'm still puzzled as to how you would actually attach to the probes, i.e. would you have a script for each daemon separately or would you create 1 big script, causing it to attach to all the probes created in the separate daemons? There doesn't seem to be a way around having atleast one script in order to make the probes actually fire(that is, call dtrace_probe()). This is one of the reasons why I've argued for a different provider as opposed to SDT. Another thing that could perhaps be done is implement the probes in the daemons and simply attach to them whenever the user needs to attach while leaving the actual logging functionality as is. That way the SDT provider would dynamically link the function call into the daemon whenever one would want to trace for more complex logging(there could be example scripts). The arguments could be documented, allowing for an easy way to write the scripts and have context of what the arguments are. In any case, I would very much like to have access to SDT probes in daemons in order to get full disclosure on what's happening in real time, instead of getting a pre-defined log that I would have to post-process, and would like to thank you for your efforts in doing this. --=20 Best regards, Domagoj Stolfa. --liOOAslEiF7prFVr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEHQB+y96lmmv+IXofwxT+ikb0YU4FAlhZJ5UACgkQwxT+ikb0 YU4KPwf/WQaTWF+RctK3X2dK3cVjhWT/v+qUgRxQZRB6tA0EG/u8aTrcYZdV7jjy aHRQBWWUbXCv5jRqLu6iztpNsiwchgFRfW39bVLyg5LsJihCT9QghTskvKUt0tvO lp8b9CvrbqQW5HdFAfHm18Zhu4xR+5BD0SFu7qMRwl7Hg1hVGwt34KAPTwl9mj8e bCvn+xCtQWolSCIfJEk1TMMUV90hkGX4iTNGTyusZPstzTcc2tpSORGWRnb8PJpZ 2y4R8xQt9Rv9X+u01FEbmIvofQaLpVSFya1QTJ0OyYuJ0x9xg2cWPRYoEwCn+uOb zNugFLwXx4rkR1JBgocZ3tRWuUxtGA== =pOaZ -----END PGP SIGNATURE----- --liOOAslEiF7prFVr--