From owner-freebsd-dtrace@FreeBSD.ORG Sun Aug 4 01:51:29 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 10347E32; Sun, 4 Aug 2013 01:51:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B22222662; Sun, 4 Aug 2013 01:51:28 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id bs12so365500qab.14 for ; Sat, 03 Aug 2013 18:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=8aYLIA64x5iYog879RCPpJQrNA6Eh01r8BNGLKySdHE=; b=mfAlG0duxRUexLXRi6Zcln3tpTC5APVag6OFV9F7vrLU74LKv4dMDl1gZ/Vsq3Fhgp O4uy/Ogy1VJiJ8FgBiGE3WVP2azRv9quxtn+oolN6bjUwzvLv/GdlOVqDsdxIZ5XGAWO h8VAfksGuu5Nco0IP35s0/TLmS+CC3M+/KVxRlQKEubsQiqQ+Y/lFUuspAY0e7/p0JJ0 x3BiW3juFz//qFkmY+doqLHo3TWHq6334ajbl4ABVqUfHs56lvUVwSiDRkns7RCt8XjK i4cw0QOvWqtv1TUe4MjT6OiNuFMvr35kvdyToeVg+zAC0PB7Zotfqow9/9hh81SHa1qW eGbA== X-Received: by 10.49.104.114 with SMTP id gd18mr17687787qeb.17.1375581087736; Sat, 03 Aug 2013 18:51:27 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id a2sm4465778qek.7.2013.08.03.18.51.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 03 Aug 2013 18:51:26 -0700 (PDT) Sender: Mark Johnston Date: Sat, 3 Aug 2013 21:51:22 -0400 From: Mark Johnston To: Andriy Gapon Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130804015122.GA3259@raichu> References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu> <20130714075634.GC2832@gmail.com> <20130722022811.GA14288@raichu> <51F14150.7000509@FreeBSD.org> <20130727022656.GB67227@raichu> <51F372C8.1000107@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F372C8.1000107@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-dtrace@FreeBSD.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 04 Aug 2013 01:51:29 -0000 On Sat, Jul 27, 2013 at 10:12:08AM +0300, Andriy Gapon wrote: > on 27/07/2013 05:26 Mark Johnston said the following: > > On Thu, Jul 25, 2013 at 06:16:32PM +0300, Andriy Gapon wrote: > >> on 22/07/2013 05:28 markj@freebsd.org said the following: > >>> http://people.freebsd.org/~markj/patches/sdt-module-info/20130721-sdt-module-info.diff > >> > >> Mark, > >> > >> this is a minor suggestion only partially related to your patch. > >> I think that it would be nice if module loading and unloading events were posted > >> via EVENTHANDLER(9) mechanism. Then instead of introducing yet more DTrace > >> related hooks in the kernel code, DTrace modules could just subscribe to those > >> events. Also, those events could be potentially useful to other consumers > >> beyond DTrace. > >> What do you think? > > > > Hm, now that I look at this, I'm not sure if it can work. The unload > > hooks need to be able to veto a module unload in the case that one of > > its probes is enabled. This is done by checking whether lf->nenabled > 0, > > and it needs to be done with the dtrace lock held to prevent races. > > > > I've done this by having the unload hooks return a non-zero value if > > there are probes enabled, but EVENTHANDLER(9) doesn't give me a way to > > look at a handler's return value. Do you see a way to get around this? > > Hmm, I didn't think about this problem in advance... > Having looked around I think that it should be possible to handle this situation > in a way similar to watchdog_list. watchdog(9) documents how that works. Of > course, all handlers will have to be careful to not override error if it's > already set. I implemented the module load/unload events a couple of days ago using EVENTHANDLER(9), and it looks like everything works properly. I copied the trick used for watchdog_list and just added an error pointer argument to the unload handlers. The revised patch is here: http://people.freebsd.org/~markj/patches/sdt-module-info/20130803-sdt-module-info.diff Thanks! -Mark From owner-freebsd-dtrace@FreeBSD.ORG Tue Aug 6 18:20:16 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55745ADB; Tue, 6 Aug 2013 18:20:16 +0000 (UTC) (envelope-from venture37@gmail.com) Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com [IPv6:2607:f8b0:400e:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1EE2DFF; Tue, 6 Aug 2013 18:20:16 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id x10so548764pdj.15 for ; Tue, 06 Aug 2013 11:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=YzPCaRizyq1nuQ/SvyZG3n4qRIHrnIN5LpsE45Q7GuU=; b=F9+k48biEjGBJrU0CnQ95BO34MdbGB6AUtNGexuofkc9xGiuOuDRbf27PifwyNvuu6 ZkUzE8TaTYoW8UCOKVni42YiY8Whnol95MteemcBnJXXi4l5/aoiYcqx/+pF0YMfCxS3 oGjGd7+nRNGe5O8p1S4iIGb8vGGFJMaDflsvyj/rcXxeMpk3GYaV6eLFns2aLyOJXQbz mc+ng7ihVH7DyOAOG22t1061UJwBSswlsm4Rr3WlMNj4J+M4ldJea8Tr5LZXgMt/nuPv fe+ri1l3EK9Koy+4W/0sZ7r1QlnqQQx+tItPgi6V4m0lgiZX+8fM02RatDvSp4XJarr1 /2rg== X-Received: by 10.68.228.201 with SMTP id sk9mr3075017pbc.4.1375813215694; Tue, 06 Aug 2013 11:20:15 -0700 (PDT) Received: from Sevans-MacBook-Air-11.local (adsl-69-226-40-234.dsl.irvnca.pacbell.net. [69.226.40.234]) by mx.google.com with ESMTPSA id ll5sm5450123pab.19.2013.08.06.11.20.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 11:20:14 -0700 (PDT) Message-ID: <52013E50.9020808@gmail.com> Date: Tue, 06 Aug 2013 11:20:00 -0700 From: Sevan / Venture37 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Mark Johnston Subject: Re: PostgreSQL+DTrace on FreeBSD References: <20130727235103.GA11294@charmander.uwaterloo.ca> <51F72CBC.8060502@gmail.com> <20130730143255.GA1757@charmander> In-Reply-To: <20130730143255.GA1757@charmander> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Aug 2013 18:20:16 -0000 On 30/07/2013 07:32, Mark Johnston wrote: > Sweet! Let me know if you have problems using them - I only did some > basic sanity testing. Hi Mark, I don't see the probes on r253997 again. Sevan From owner-freebsd-dtrace@FreeBSD.ORG Tue Aug 6 18:29:30 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40D31EB0 for ; Tue, 6 Aug 2013 18:29:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [IPv6:2607:f8b0:400c:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 023092E8E for ; Tue, 6 Aug 2013 18:29:29 +0000 (UTC) Received: by mail-vb0-f51.google.com with SMTP id x16so796686vbf.10 for ; Tue, 06 Aug 2013 11:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=06nsJXHAXPi3+I9L9LK/x8Wj5vg80WXcHfTEwZ0zqAo=; b=iQ+jKxO7DoFlonmCqSZ0Mq2W1bU6enuGg1I5weebQfCVqbUm4SP8yRV4umLLQfjTA/ 6DVuL2YoNDy/kQJo5yKI3JJKYtb0xxmqkr0ckr5lvIEk1u0IWPyKRXhRdsFLo24Ranf4 Eg7PIwpPOPlap6zfmua7k6CUwBZN80kvSqC+SFiDY+IFiZXDE/MfmXpZxc/P0ddHRX4q NTzSXrUfXjP4QphRAKQ9gd6GehwFvJQClN/veET0ChQRrGIktrRxc9a+RC9J1DeTInXI +tY9U1traNmYUenZ4O1AxSsG6WPnAUjU+G+TIdC6sw5i4u/6Dmcsa7rcsBOAq0FQjKMF J6Ow== MIME-Version: 1.0 X-Received: by 10.220.114.143 with SMTP id e15mr768048vcq.95.1375813769006; Tue, 06 Aug 2013 11:29:29 -0700 (PDT) Sender: markjdb@gmail.com Received: by 10.220.65.4 with HTTP; Tue, 6 Aug 2013 11:29:28 -0700 (PDT) In-Reply-To: <52013E50.9020808@gmail.com> References: <20130727235103.GA11294@charmander.uwaterloo.ca> <51F72CBC.8060502@gmail.com> <20130730143255.GA1757@charmander> <52013E50.9020808@gmail.com> Date: Tue, 6 Aug 2013 14:29:28 -0400 X-Google-Sender-Auth: OXbMVTdn3gDIiGC6C-kVWP3WLFY Message-ID: Subject: Re: PostgreSQL+DTrace on FreeBSD From: Mark Johnston To: "Sevan / Venture37" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Aug 2013 18:29:30 -0000 On Tue, Aug 6, 2013 at 2:20 PM, Sevan / Venture37 wrote: > On 30/07/2013 07:32, Mark Johnston wrote: >> >> Sweet! Let me know if you have problems using them - I only did some >> basic sanity testing. > > > Hi Mark, > I don't see the probes on r253997 again. What have you done since you last saw the probes? Reboot? Restart postgres? If you rebooted, you'll need to change the mode on /dev/dtrace/helper again, and the mode needs to be correct before postgres starts. You can set the mode in /etc/devfs.conf I guess, but ensure that the DTrace modules are already loaded when rc runs (i.e. by adding dtraceall_load="YES" to your loader.conf). From owner-freebsd-dtrace@FreeBSD.ORG Tue Aug 6 19:07:32 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 65D72856; Tue, 6 Aug 2013 19:07:32 +0000 (UTC) (envelope-from venture37@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 377BA2088; Tue, 6 Aug 2013 19:07:32 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id fb10so1127247pad.23 for ; Tue, 06 Aug 2013 12:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=daTdQYnqha4OEvGFroUU5ZAhQfPAnOxJFT0LDUxLaqU=; b=k9I+ov+oIObXkSJCVErGnwzQCgzgxg44NYxqsAVdjBMBDXy0yV65bGhIbdx82dlB4r HGQiU+aB9z9bUdLG9e0GGEg6kXsaX79NHrzZ6trGI5hxx3YYdHLz/LVhLYJX5CP4VTiW ouoyYxWtUSMytRCtH4+0l6HMMb5dc75FlPZSyDNBwTWzJQbk10LIHMy98QcrScWYtaMR SUqkNmqq5b6wSkfzjQ8cDFyUIcYn1YtGcUfuAkYtHuhdd71AUFnLrI8iKAJjuw9oLuV8 H0zBQbyLGj+r7MuaCOUoyTkPe8iw6Fw50rejG6AhmHPTTeYBQGqwUZ9u+A9x+M1IsCzE EMtQ== X-Received: by 10.67.23.36 with SMTP id hx4mr407784pad.54.1375816051840; Tue, 06 Aug 2013 12:07:31 -0700 (PDT) Received: from Sevans-MacBook-Air-11.local (adsl-69-226-40-234.dsl.irvnca.pacbell.net. [69.226.40.234]) by mx.google.com with ESMTPSA id tr10sm3510320pbc.22.2013.08.06.12.07.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 12:07:31 -0700 (PDT) Message-ID: <52014971.90700@gmail.com> Date: Tue, 06 Aug 2013 12:07:29 -0700 From: Sevan / Venture37 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Mark Johnston Subject: Re: PostgreSQL+DTrace on FreeBSD References: <20130727235103.GA11294@charmander.uwaterloo.ca> <51F72CBC.8060502@gmail.com> <20130730143255.GA1757@charmander> <52013E50.9020808@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Aug 2013 19:07:32 -0000 On 06/08/2013 11:29, Mark Johnston wrote: > What have you done since you last saw the probes? Reboot? Restart postgres? > > If you rebooted, you'll need to change the mode on /dev/dtrace/helper again, > and the mode needs to be correct before postgres starts. You can set the > mode in /etc/devfs.conf I guess Gah, yes, I'd rebooted, adjusted the permission on /dev/dtrace/helper & the probes started showing up again. Seavn From owner-freebsd-dtrace@FreeBSD.ORG Wed Aug 7 07:47:45 2013 Return-Path: Delivered-To: freebsd-dtrace@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A264E5B0; Wed, 7 Aug 2013 07:47:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C2D8C208A; Wed, 7 Aug 2013 07:47:44 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA20646; Wed, 07 Aug 2013 10:47:42 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1V6yT8-000O3v-Fh; Wed, 07 Aug 2013 10:47:42 +0300 Message-ID: <5201FB7A.4050106@FreeBSD.org> Date: Wed, 07 Aug 2013 10:47:06 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: Mark Johnston Subject: Re: [RFC] reworking FreeBSD's SDT implementation References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu> <20130714075634.GC2832@gmail.com> <20130722022811.GA14288@raichu> <51F14150.7000509@FreeBSD.org> <20130727022656.GB67227@raichu> <51F372C8.1000107@FreeBSD.org> <20130804015122.GA3259@raichu> In-Reply-To: <20130804015122.GA3259@raichu> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-dtrace@FreeBSD.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 07 Aug 2013 07:47:45 -0000 on 04/08/2013 04:51 Mark Johnston said the following: > I implemented the module load/unload events a couple of days ago using > EVENTHANDLER(9), and it looks like everything works properly. I copied > the trick used for watchdog_list and just added an error pointer > argument to the unload handlers. The revised patch is here: > > http://people.freebsd.org/~markj/patches/sdt-module-info/20130803-sdt-module-info.diff This looks good to me. Thank you very much! -- Andriy Gapon