From owner-freebsd-dtrace@FreeBSD.ORG Mon Jul 22 02:28:34 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3279116D; Mon, 22 Jul 2013 02:28:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F19641D26; Mon, 22 Jul 2013 02:28:33 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id 9so14070238iec.33 for ; Sun, 21 Jul 2013 19:28:33 -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=a0rXZdXy3p2G/LQoaYZj2v+uu0jN3zrj9IgSnDWGzPg=; b=WbizQ/EeiwbQhs+fewlj/doRLpvDbnOML90k0NygCcWNBtdIfykJCM1Ey5AXaQP5PK Qpep4yqsv+twiUCkaGCEBfcR+c3HvCGyAXr5nO45WX/4dU8eTXZrhxziSyPpuumKhdiK PjLdPBr0yPxWYWZOOzuAg2hI/Lpo7bxsXe5kWkhulDbWRgEQHyWaXOzeIun2EB7QH0xC sul0EpNqeyZfLeq/BrXQ8dA48TNaK5k+USMylj/HUdw+KpcvcyQwdnplNlX/dzOR5jgk 3K+5YcsRg3LKZqsQ3IuNKs5aWitj2I1nSohEHkZqfS3n+Mg14uWb8XJag76AYyZ+2xQj HN3Q== X-Received: by 10.43.137.65 with SMTP id in1mr7875109icc.103.1374460113081; Sun, 21 Jul 2013 19:28:33 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id z15sm12440047igp.0.2013.07.21.19.28.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Jul 2013 19:28:32 -0700 (PDT) Sender: Mark Johnston Date: Sun, 21 Jul 2013 22:28:25 -0400 From: markj@freebsd.org To: Mikolaj Golub Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130722022811.GA14288@raichu> References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu> <20130714075634.GC2832@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130714075634.GC2832@gmail.com> 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: Mon, 22 Jul 2013 02:28:34 -0000 On Sun, Jul 14, 2013 at 10:56:34AM +0300, Mikolaj Golub wrote: > On Sat, Jul 13, 2013 at 07:42:00PM -0400, Mark Johnston wrote: > > > Thanks for pointing this out - I've fixed these problems in the > > following diff: > > > > http://people.freebsd.org/~markj/patches/sdt-module-info/20130713-sdt-module-info.diff > > > > It turns out that we typedef modctl_t to struct linker_file, so I don't > > need to have separate cases for defined(sun) and !defined(sun) in a few > > places. > > Then in dtrace.h: > > -extern void (*dtrace_modload)(modctl_t *); > -extern void (*dtrace_modunload)(modctl_t *); > +extern void (*dtrace_modload)(struct linker_file *); > +extern int (*dtrace_modunload)(struct linker_file *); > > you might also want to return modctl_t back? I suppose > dtrace_modunload also requires '#if defined(sun)' here. > > Also, is there some reason you choose to return 1 on modunload > failure? Usually we return -1 on error, it would be nice to follow the > convention. > > In sdt_disable(), before decreasing nenabled, it might be useful to > add an assertion that nenabled is not going to reach negative value. Thanks for the comments, and sorry for the slow reply. I uploaded a new patch containing changes for all the suggestions above: http://people.freebsd.org/~markj/patches/sdt-module-info/20130721-sdt-module-info.diff -Mark From owner-freebsd-dtrace@FreeBSD.ORG Tue Jul 23 09:12:58 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7911A50B; Tue, 23 Jul 2013 09:12:58 +0000 (UTC) (envelope-from jyoti.mickey@gmail.com) Received: from mail-ve0-x22b.google.com (mail-ve0-x22b.google.com [IPv6:2607:f8b0:400c:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBD7221E; Tue, 23 Jul 2013 09:12:58 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id b10so5939313vea.16 for ; Tue, 23 Jul 2013 02:12:57 -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=TRFGU/wmhI6hXANgB+P0tMfFYaPIBlJdU15iDtTLhf4=; b=vrobjmQt3t15l70dU0bWS/QqA328/0SXXO8zCgIrUuT3vSK4WPzFQRd5OKOlrVqACb kq/Hy4okSX8pOq+gC2/DygCgOylvcheGms51glRKIW74gpL/tQbVnAh+RfdJ0tsi8TY1 6c0VSQBzfUv0wNRf5lRJ/1sC8pFi8Y96ioxRhYZ4J9GkppT3Ah23pndWcHSl/5gfdhDu SS5Xb2nvylWOYo7cawDVcZQ2IJXTYW+Xapmt86efnyBepm5U3zIOLOYY1DK+/zCZxE2U M3e6VDjAzxwe+/z5OHz6NfMWmGC/bNo82EbShHXA+aNSYMeEQYwitsPdy8bpUwHvMJ2K G/Gg== MIME-Version: 1.0 X-Received: by 10.220.225.2 with SMTP id iq2mr10588563vcb.59.1374570777339; Tue, 23 Jul 2013 02:12:57 -0700 (PDT) Received: by 10.221.8.193 with HTTP; Tue, 23 Jul 2013 02:12:57 -0700 (PDT) Date: Tue, 23 Jul 2013 14:42:57 +0530 Message-ID: Subject: How to debug FreeBSD 8.2 booting problem on ESXi 5.1.0? From: Jyoti Sharma To: freebsd-drivers@freebsd.org, freebsd-dtrace@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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, 23 Jul 2013 09:12:58 -0000 I am booting from livecd and the booting process hangs at: Booting [/boot/kernel/kernel] What should I do to debug this? The vm has 2 gb ram assigned to it. Regards, Jyoti From owner-freebsd-dtrace@FreeBSD.ORG Thu Jul 25 15:17:20 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 73C9241E; Thu, 25 Jul 2013 15:17:20 +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 880ED2E54; Thu, 25 Jul 2013 15:17:16 +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 SAA10812; Thu, 25 Jul 2013 18:17:09 +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 1V2NHw-000DNP-UI; Thu, 25 Jul 2013 18:17:08 +0300 Message-ID: <51F14150.7000509@FreeBSD.org> Date: Thu, 25 Jul 2013 18:16:32 +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: markj@FreeBSD.org 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> In-Reply-To: <20130722022811.GA14288@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: Thu, 25 Jul 2013 15:17:20 -0000 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? -- Andriy Gapon From owner-freebsd-dtrace@FreeBSD.ORG Thu Jul 25 23:40:10 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 E02BE609; Thu, 25 Jul 2013 23:40:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2D32797; Thu, 25 Jul 2013 23:40:10 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id a1so1274756qcx.11 for ; Thu, 25 Jul 2013 16:40:09 -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=pNQYBW5tF0bnssTvDFlTNwJpNTSGAZGILqc7kX+kDIE=; b=M12TSOiW9xaYMq1q/Z5nl3fm5bBfZfISV3wTKlKVCPIHUX8fnyvNEqNssPvz+mWBsW ULzWIn56lgBx7zzE0rdWgLeR9Wl4P5H+VLHl39XreWjR5dXEXgKZZmdlDs7naRlHjw2N Pn6LgaP7KWW7LIo9WYEKWxelq35ewXisdbEFd+b85EvVX/5KgOjNJUP4GXBlaCmsH11k 4BE5e1aqewpATugYhMmrQrhT+Y94juyJQAUitZjnCB64JjOT5BOxAaAHOjqfUjx6qf6w BsRcSNbgkQRCaS8bydqVkTMD9yCNsZcMiGbKD4olOtwdf2xRSX4mdmXG0cCZxOCeE57J wEnQ== X-Received: by 10.49.36.8 with SMTP id m8mr7060616qej.57.1374795609709; Thu, 25 Jul 2013 16:40:09 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id i12sm36901952qej.1.2013.07.25.16.40.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 16:40:09 -0700 (PDT) Sender: Mark Johnston Date: Thu, 25 Jul 2013 19:40:04 -0400 From: markj@freebsd.org To: Andriy Gapon Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130725234004.GA78828@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F14150.7000509@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: Thu, 25 Jul 2013 23:40:10 -0000 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? I think that's nicer than what I did - I was mostly just following what illumos does. I did consider having some general mechanism for posting module load/unload events, but it's not clear that the hwpmc hooks could use it. The DTrace handlers need to be called with the linker lock exclusively held, and the unload handler needs to be called before linker_file_unload(), so this is at odds with the locations of the hwpmc hooks, and I decided not to bother with it. That said, I think it would be good to use EVENTHANDLER() even if hwpmc can't use it. Calling two DTrace hooks is ugly - originally I just had one, so it wasn't as bad. I'll post an updated patch soon. Thanks! -Mark From owner-freebsd-dtrace@FreeBSD.ORG Fri Jul 26 18:13:17 2013 Return-Path: Delivered-To: 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 41F69A9F for ; Fri, 26 Jul 2013 18:13:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm21-vm4.bullet.mail.ne1.yahoo.com (nm21-vm4.bullet.mail.ne1.yahoo.com [98.138.91.181]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ECC1B29BF for ; Fri, 26 Jul 2013 18:13:16 +0000 (UTC) Received: from [98.138.226.179] by nm21.bullet.mail.ne1.yahoo.com with NNFMP; 26 Jul 2013 18:13:09 -0000 Received: from [98.138.84.45] by tm14.bullet.mail.ne1.yahoo.com with NNFMP; 26 Jul 2013 18:13:09 -0000 Received: from [127.0.0.1] by smtp113.mail.ne1.yahoo.com with NNFMP; 26 Jul 2013 18:13:09 -0000 X-Yahoo-Newman-Id: 910635.45031.bm@smtp113.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: g04n6CAVM1kT7sjTMZLCs2ZmEH1GnkE8cPyIi5tvILNHd9m LyFUMU2e_3aDfBWXyD7W8jOqP08lBgoAoZTJD1wJJoa4P4gtOrGU6apnnaRg Cqci7i6t6_4HvZsW2i1cUOX36FEXf6e.Xu6KsxyQIqOAoPIfkJPpLRNlMPs_ JQgyR3LiBlZoRwpvTs9WRFMoHE9gD65ErH22XmUeEwH6A6Lyc216dT276BFK hUVPLsacGzrovRA7LAdVn2gy_dGGMpjOQbvzAGdukEvlI.YUKyht81vCtVRv 6lRI91c2uMhRKmagZ51f6udESQGso8FcR4LyGJAJgaT0uugWf8l1SlMYoSZD 0PuyrIC2GFu5IcehNFD21lV42.NWqSb6bWmPUYrUJbwWXzOR6hlonzKA2bu9 HVwJ09S_QqGtUPSXnNKFHYfjSY4K8OW6VlR_5o.NHOsrVgzHqZd8UFt0lG6r MMILc5hkmjaZPPCBzMkQXo0ggi38LeQ5RAUz3M8fWQ_eIRCvFJ98CzZCTdjk fO3YQ1xPTKxi2imrWzeTulrLn.mwIMKdTSRH6pebNeQYtZBkLtnF0ia0sIxs v3ma_jZ4PwYZxMagNAYoDyrXJOcV._yy9P_s7V2G9gQMKJ50IaAsOEkacVGU bPpNcKN5BxRiLOMUNoxs2fD3MDwnn5PTz X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp113.mail.ne1.yahoo.com with SMTP; 26 Jul 2013 11:13:09 -0700 PDT Message-ID: <51F2BC34.1040405@FreeBSD.org> Date: Fri, 26 Jul 2013 13:13:08 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130630 Thunderbird/17.0.7 MIME-Version: 1.0 To: dtrace@FreeBSD.org Subject: [CFT] Fixes from illumos Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 26 Jul 2013 18:13:17 -0000 Hello; I am trying to put together the last two patches that we need to be (mostly) up to date with illumos. This "svn diff" patch brings back the rest of a somewhat elusive revision 249367 that gave us trouble before and had to be reverted: http://people.freebsd.org/~pfg/patches/dtrace/libdtrace-r249367.diff It should take care of the following issues: 3022 DTrace: keys should not affect the sort order when sorting by value 3023 it should be possible to dereference dynamic variables 3024 D integer narrowing needs some work Ignore the attempts to get repo copies of the tests when applying the patch but do report any regression or secondary issue it may cause. After this, I would like to re-apply r249429, which should cover most of the remaining changes from Illumos. Still pending for review are some changes for Solaris zones support that very probably don't apply to our codebase at all. Thank you, Pedro. From owner-freebsd-dtrace@FreeBSD.ORG Sat Jul 27 02:27:00 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 86B1D417; Sat, 27 Jul 2013 02:27:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qa0-x232.google.com (mail-qa0-x232.google.com [IPv6:2607:f8b0:400d:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC352C2B; Sat, 27 Jul 2013 02:27:00 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id f14so730795qak.2 for ; Fri, 26 Jul 2013 19:26:59 -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=1vOJVEUDUW5wPKp/QAEbMr36pTzOgY8kryMwVGJk6cU=; b=rPykUw3cGSUuWA1AMCpcbTclab0lZjd17pPMg6/l4Xw5bzwwwzYzlTE0I+nNoJ8nb0 vJiYKmAff0MPaiSWjRD/VMEOCt620npyZlu7ICrAthB5Qr2QfnveADTa4Th6S0VfUj0o apInAlUI5BGPbTC34UgRIh3bn54gJStPHPZz5wNDz/D80rAZOZoRpJZHtc7Fze5ynNak oVRSipqpnFqeDoPhM1QVt4EsdHRjvkg7Z7EjBu916Z1KlGDCQtIas0j+QntIvnlF/4SU E14Tqz6YBaY4krnnJcQ2WLogte9gFiqre7QjXHlqNrps6CUmUZio0fmMRLUO0gwWhyaD Ncsg== X-Received: by 10.229.52.1 with SMTP id f1mr13540944qcg.100.1374892019286; Fri, 26 Jul 2013 19:26:59 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id a8sm4430374qae.11.2013.07.26.19.26.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 19:26:58 -0700 (PDT) Sender: Mark Johnston Date: Fri, 26 Jul 2013 22:26:56 -0400 From: Mark Johnston To: Andriy Gapon Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130727022656.GB67227@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F14150.7000509@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: Sat, 27 Jul 2013 02:27:00 -0000 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? Thanks, -Mark From owner-freebsd-dtrace@FreeBSD.ORG Sat Jul 27 07:12: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 E3E5CA2B; Sat, 27 Jul 2013 07:12: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 015E32A71; Sat, 27 Jul 2013 07:12: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 KAA05365; Sat, 27 Jul 2013 10:12: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 1V2ygD-000NBb-P6; Sat, 27 Jul 2013 10:12:41 +0300 Message-ID: <51F372C8.1000107@FreeBSD.org> Date: Sat, 27 Jul 2013 10:12:08 +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> In-Reply-To: <20130727022656.GB67227@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: Sat, 27 Jul 2013 07:12:46 -0000 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. -- Andriy Gapon From owner-freebsd-dtrace@FreeBSD.ORG Sat Jul 27 23:50: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 983D4848 for ; Sat, 27 Jul 2013 23:50:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qe0-x232.google.com (mail-qe0-x232.google.com [IPv6:2607:f8b0:400d:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5ABA42966 for ; Sat, 27 Jul 2013 23:50:16 +0000 (UTC) Received: by mail-qe0-f50.google.com with SMTP id q19so791090qeb.37 for ; Sat, 27 Jul 2013 16:50:15 -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:mime-version:content-type :content-disposition:user-agent; bh=OKgVNFbKuZgp8oNEIJSp2T+i+5xxD/WMbfdEEnOF4fQ=; b=tYzYjzmx1WSdHnxufhSK5PBBdbPxCXNA9zmXjmMGAfFTrUBD5S7YYE5LdwmzWUh1d0 HJ/nYNKxXiXOkWHt/u5g9OAKWgKkmP5ZQrZDbnEO0e7b8zm05aHQbvsZkGm81lpm/CXh Q/CqE9UeFTXNUkFNXfbIj1STdTl9kzEfdR6yJUIniu+5kzOhNWn5HKK5TUrNGjP3OZOf YIyNUn05XshWPKDYlCueR6EhQGvdriS8dCPueHm0B4Pv5Eu53pX0FLlVE+K8VsT5FTbC kj2NQheqgwzfWsTas8y6/46PG2pt+ZLepfdeoc4bsthFlByF9CpGtH3gNxv5bzZqrgje asqQ== X-Received: by 10.49.132.69 with SMTP id os5mr63110005qeb.48.1374969015499; Sat, 27 Jul 2013 16:50:15 -0700 (PDT) Received: from charmander.uwaterloo.ca (cn-nat2-uw-129-97-124-74.net.uwaterloo.ca. [129.97.124.74]) by mx.google.com with ESMTPSA id nh4sm11786489qeb.6.2013.07.27.16.50.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Jul 2013 16:50:14 -0700 (PDT) Sender: Mark Johnston Date: Sat, 27 Jul 2013 19:51:03 -0400 From: Mark Johnston To: freebsd-dtrace@freebsd.org Subject: PostgreSQL+DTrace on FreeBSD Message-ID: <20130727235103.GA11294@charmander.uwaterloo.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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: Sat, 27 Jul 2013 23:50:16 -0000 Hello, I saw that there were a couple of questions about postgres' DTrace support on FreeBSD (OP CC'ed): http://lists.freebsd.org/pipermail/freebsd-dtrace/2013-June/000007.html http://lists.freebsd.org/pipermail/freebsd-questions/2013-May/250843.html I've just spent a bit of time playing with postgres 9.3's USDT probes on CURRENT and managed to get them to work. Some troubleshooting was needed first though, so I thought I'd describe what I needed to do. First, the compile error reported in the posts above should be fixed by r247221, which I MFCed to stable/8 and 9 a month and a half ago. In particular, you'll need r251582 if you want to use the postgresql provider on stable/9: http://svnweb.freebsd.org/base?view=revision&revision=251582 I have some uncommitted changes to my local tree which may also be needed, but I suspect they aren't. I don't have a stable/9 system to test with though. Second, the permissions on /dev/dtrace/helper are too restrictive. On my system the defaults are 0660 with o=root,g=wheel. That happens to work out most of the time because my main user is in the wheel group, but postgres wants to run as pgsql and so the code which creates postgres' probes can't run. I'm not sure what the right solution to this problem is. For testing purposes I just changed the mode to 0666, but I guess that's not a great idea in general since it lets unprivileged users exhaust kernel memory by creating an unbounded number of probes. It'd be easy to add a sysctl limit on the number of probes allowed for a non-root process though, if such a thing doesn't already exist. Another solution is to just add pgsql to the wheel group; I don't really know what the security implications of this are though. Does anyone have any thoughts on this? Finally, it's probably a good idea to compile the postgres port with the DEBUG option on. When it's omitted I see the following warning as postgres starts: # service postgresql onestart WARNING: number of probes fixed does not match the number of defined probes (60 != 72, respectively) WARNING: some probes might not fire or your program might crash WARNING: number of probes fixed does not match the number of defined probes (60 != 72, respectively) WARNING: some probes might not fire or your program might crash I've seen this before with other programs. I'm not quite sure what it means or where it comes from, perhaps someone else on this list knows. Looking into it is on my todo list. :) -Mark