From owner-freebsd-dtrace@freebsd.org Thu Aug 16 07:25:41 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C99C10803F1; Thu, 16 Aug 2018 07:25:41 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from kagate.punkt.de (kagate.punkt.de [217.29.33.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C29572016; Thu, 16 Aug 2018 07:25:40 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [217.29.44.10]) by gate1.intern.punkt.de with ESMTP id w7G7Pc0R046541; Thu, 16 Aug 2018 09:25:38 +0200 (CEST) Received: from [217.29.44.49] ([217.29.44.49]) by hugo10.ka.punkt.de (8.14.2/8.14.2) with ESMTP id w7G7PbWu069056; Thu, 16 Aug 2018 09:25:37 +0200 (CEST) (envelope-from hausen@punkt.de) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Why can't I dtrace processes running in a jail from the host? From: "Patrick M. Hausen" In-Reply-To: <20180810183419.GA52302@raichu> Date: Thu, 16 Aug 2018 09:25:37 +0200 Cc: David Powers via freebsd-virtualization , freebsd-dtrace@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5BD4792C-D8AB-4598-BE7A-9D63A5757392@punkt.de> References: <20180809145258.GA68459@raichu> <8B1BDE9F-BDAD-4CEB-B7A2-8052497F50EA@punkt.de> <20180810183419.GA52302@raichu> To: Mark Johnston X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.27 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, 16 Aug 2018 07:25:41 -0000 Good morning, I did some further investigation and with help from Mark was finally able to get it working. Took quite some effort - documentation on the PHP side - NULL :-/ BTW: has anyone ever successfully subscribed to one of the PHP mailing lists? Where is the community of the people developing that stuff? OK, back to topic, in fact I had two issues, one FreeBSD, one PHP related. 1. DTrace'ing jailed userland probes requires /dev/dtrace/* to be visible inside the jail. Hence: [devfsrules_proserver=3D100] add include $devfsrules_jail add path dtrace/* unhide iocage set devfs_ruleset=3D100 vpro0069 Voila - dtrace on the host, watch userland probes in the jail. 2. PHP > 5.6 needs the environment variable USE_ZEND_DTRACE to be set to register it's probes. Turned out that it was not sufficient to *configure* that into the PHP FPM worker but you need to set (and export) the variable on the shell before you start the FPM master daemon. Then everything works as = expected. What I regularly do in such a case is sh -x /usr/local/etc/rc.d/php-fpm start to find out what command is actually executed in the end. Then call that = directly after setting the environment. Result: setenv USE_ZEND_DTRACE 1 limits -C daemon /usr/local/sbin/php-fpm Bingo! Surprisingly enough it is *not* necessary to configure clear_env =3D no in PHP FPM ... DTrace is active as soon as the master daemon sees that environment variable. Kind regards Patrick --=20 punkt.de GmbH Internet - Dienstleistungen - Beratung Kaiserallee 13a Tel.: 0721 9109-0 Fax: -100 76133 Karlsruhe info@punkt.de http://punkt.de AG Mannheim 108285 Gf: Juergen Egeling From owner-freebsd-dtrace@freebsd.org Thu Aug 16 22:49:44 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3C3107907E for ; Thu, 16 Aug 2018 22:49:44 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37B3C7CAC1 for ; Thu, 16 Aug 2018 22:49:44 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-it0-x233.google.com with SMTP id p81-v6so9063643itp.1 for ; Thu, 16 Aug 2018 15:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=zKTWjLdu+mbkCWJNAfLPpPSNcXCtaWyQZc4N8LwogvQ=; b=CdAqxzFtsWv0sNqpZObJIKmqqmGheaI/8wk07gXJPU77AL2vaXIZrgIngy1O8bH+uk QydCY0BeFhCud1FwCwDu66IpC2aBNvyXBs36okLanNAtpdlGGCZ0olWE3qeqhvaLVZSK W1qFr6zJ5BKdF2G3Z/931ZxtHJflHrpXOKn3X2RKvhmdwyz53jbdL+KyQYHnhFFxhIo1 O0URuLMs9uwSggCgrd3VkY08weQUuXiB/kQiC+IfJCU6pDGWguLNl/Lod48qC4pSQYdW zLDDCFDFu0DD7umkhl2PA3w/R4MH1HxiiV+a3e1tVWwZDY7Cr5WTYcer/bD9q3IPICkI fSSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zKTWjLdu+mbkCWJNAfLPpPSNcXCtaWyQZc4N8LwogvQ=; b=ZfIn5hnzuCcG7uB+nsc6XC4XgOYaTIMRnDd2i3O4ti7qL17AYk1JWretLIk+SdeQYJ 0fxhALi7LKfBFETTYlptI1ZaMYMI3La8qVyBK4JBklIJmkAjlPp80pNe8QhTbmFdDa1X ftbxLKYRdmvF1U8Iq3KY4rzgosUefOSMSarVk8UKqvaYpGU8jyyxZtxauXOJGRepKwqK u7nV4CTCFv/a8DWNPh7+veX1wTGBiTd6v2eVpOhUU29/VzsJ3FjJ6hr/DxCBE9hEq8uJ No2mjt3DMR5FHuBrQgBuJnPr2VT72DFTX4kUlb6kVlbx2o3CBQT5Lpj4oMlL8XmzybvT +DPw== X-Gm-Message-State: AOUpUlFqFsoQEAbqDp73GlZi4ViFcTJvDgnvOyKNIIcQC+qwqm0Wfems Weqb4H6GVZUvK7UbB4tdyDTRkbV2AJ2vzTZ5NAoHiA4y X-Google-Smtp-Source: AA+uWPz5DIIDXBnZ0er9dETyXq+uAK1wo/234oH1OwdYJ3mZHg/xj0MHnrJfgjmqN5RzjnWeUHeZ/uckzsRfviSFO5E= X-Received: by 2002:a24:5e0b:: with SMTP id h11-v6mr23595687itb.80.1534459783279; Thu, 16 Aug 2018 15:49:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:8101:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 15:49:22 -0700 (PDT) From: Farhan Khan Date: Thu, 16 Aug 2018 18:49:22 -0400 Message-ID: Subject: Filter out dtrace(1) probes To: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.27 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, 16 Aug 2018 22:49:44 -0000 Hi all, Is it possible to filter out probes? For example, if I did: dtrace -n 'fbt:kernel::entry { something_here }' but I specifically do not want fbt:entry:SOMETHING:entry, is that possible? I know that I can run grep -v, but it still shows the output from "something_here". Thank you, -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE From owner-freebsd-dtrace@freebsd.org Thu Aug 16 23:01:47 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 779DF107969B for ; Thu, 16 Aug 2018 23:01:47 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E41237D1C4 for ; Thu, 16 Aug 2018 23:01:46 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: by mail-wr1-x432.google.com with SMTP id v90-v6so2344407wrc.0 for ; Thu, 16 Aug 2018 16:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=/tQmPLnV5UWto5nIUDxQ+YyBIQ1gr/zpy30gt8P+Yw0=; b=UPqPgp3Ld/2sTo0LOJU8CV9Yzj78qM+msideuA7Y4nDX8WBcFb0yJjyelQqZyhTIor W3C/MnbsQ4HC5KEkEjh0Mf+mh80S8DjL69RCq6O3agyDwKCtyKUjkirW6zJje/84fCpL hSzescpG5dDOX9pmk0E+T3xj0rcL2cZn3jfkxGEkReU/B7QVt3Os3A8uB2/oR3C5i1MQ P8dwtfLx2zxltnZo3doop5UjwAtQZeHSDc8w60+RREJxt8XzohruSc2ttS2TFr0Mudk2 s7Z3ZxNsyG8ZjVWpjOVZQ0YVmRP0mHd5yCH2bo/SWdrmhu/ClhfRsy47WB96no7z//OJ AdlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=/tQmPLnV5UWto5nIUDxQ+YyBIQ1gr/zpy30gt8P+Yw0=; b=tK5QcVz9+0aeNMMnkL/jzCF9syaABLGhkuVIhut0ySQASxzKUSl2MQ1Yr1nes+yD4c yWhu7mMSX5PtNUGrdSjPFtiARU4iZW9RS5joolJLE1Uqf0O74eSnyqav0kxyyGCcQ5iH Jb0NI1qo/KK5ngiu1sY0OCc3BjAbdI1bvhaB3LYadqNFqvQ+en6Fq7Vb3vUzd+kFTb/P 78wJgA9f88kG2ORiD7DJxByapqi4oefQ1CY9bDNM3wkbsqUQolzXIMEOrH0etxpMYw3w 1GUIIbN78gXhK5K0+8E91NSAO4grb9zST11p8tcdu2i8fggjV+QzmEfJ3kMzypyciAUe W2WQ== X-Gm-Message-State: AOUpUlEu1b/gSFOSW12jd7kyuTujGkEP6iAgMem+0+XcfKgHsoVs3QYb O2YvP0Qi5v09eRNmNV0XmPMCRl3/ X-Google-Smtp-Source: AA+uWPxLzbx7gwVmC+RsJP/dbgGjzfBWBxgdkGM7LTxEOTYvHKbac6HZtk9CFVHnY6ArTPyy49Lrxg== X-Received: by 2002:a5d:438d:: with SMTP id i13-v6mr21077229wrq.156.1534460505864; Thu, 16 Aug 2018 16:01:45 -0700 (PDT) Received: from [192.168.10.106] (141-136-229-210.dsl.iskon.hr. [141.136.229.210]) by smtp.gmail.com with ESMTPSA id c15-v6sm1353312wmb.2.2018.08.16.16.01.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 16:01:45 -0700 (PDT) From: Domagoj Stolfa Message-Id: <54B93C32-7672-4A54-9272-F3F0CF5B38BD@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_956A70CA-3F3A-4425-A522-8D6D192CD664"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Filter out dtrace(1) probes Date: Fri, 17 Aug 2018 01:01:43 +0200 In-Reply-To: Cc: freebsd-dtrace@freebsd.org To: Farhan Khan References: X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.27 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, 16 Aug 2018 23:01:47 -0000 --Apple-Mail=_956A70CA-3F3A-4425-A522-8D6D192CD664 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Farhan: I'm not sure what the question is, but by what I understood it sounds = like a predicate with probefunc should do? i.e.: prov:mod:func:name /probefunc !=3D "something_i_dont_care_about"/ { something_here } =E2=80=94 Domagoj > On 17 Aug 2018, at 00:49, Farhan Khan wrote: >=20 > Hi all, >=20 > Is it possible to filter out probes? > For example, if I did: >=20 > dtrace -n 'fbt:kernel::entry { something_here }' >=20 > but I specifically do not want fbt:entry:SOMETHING:entry, is that > possible? I know that I can run grep -v, but it still shows the output > from "something_here". >=20 > Thank you, > -- > Farhan Khan > PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to = "freebsd-dtrace-unsubscribe@freebsd.org" --Apple-Mail=_956A70CA-3F3A-4425-A522-8D6D192CD664 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE37fRcHC0Iwiz+ZVEg+gksMBgNd0FAlt2AlcACgkQg+gksMBg Nd37QQ//YKdSeZDGkzgaBj71/gWCPV1TrvY7nphCCcZk48Z0KLcXJhclOx0vLJWD 13ECVoe1ef4nRw3kkLgw90CZlVdG22uX+oGz06muDMrXk+gTFJ6sJTHf1Ra1YHYI eEJoYdIYQaAuERMKCaT3pSASeioEDONINHqUQZ+My7EVh8aNdhuS7V5z8TOmNs1r FchzoDJ2M6o7dghSjOMhzDjosi3QSAw8czF19+qPZ+QN4kRJiBxREE4C4/8jfjo8 3zKCR//IRsPUo2yRHmCiMbaQmlCMf6y7FCu0H/hBNc5VNRo+264xnkVKHDmmIgTp kqRswqOpRRgE/HgVoU4p9ACCx2Kg/96+lcx1jcHcO5XySE6KPgRR8kmuvAM/RaE8 D5OzttI354Ku7n4i8/RdcJiOsrhQHvhT7u0BZpYFo48qCPhnmCviX5a4QyVdUS0a z1HDa1xWOrB4ptTrPbOYHyEjuG0rRp8OFAGfiS9YGipJ/uCM1tBqUKg0heXNCS2J eTKO2ITgRUjTM3SYNeMwm+KpwAYCZ3yjF+VS49yvOOVCvMWT7CYknyEFdqKeO6Du 484C2d/gOb1fDldgJQ1ycc7MTooBbgzvbI56isUI9mSc3NUFg8pCtppg1VSjUEM7 w4xk7Fy2gAwzwKyxc1fiVLS4VzfzBBkMcMSy6sPaNgl4v7MpLE0= =PqeQ -----END PGP SIGNATURE----- --Apple-Mail=_956A70CA-3F3A-4425-A522-8D6D192CD664-- From owner-freebsd-dtrace@freebsd.org Fri Aug 17 13:35:29 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3272106F137 for ; Fri, 17 Aug 2018 13:35:28 +0000 (UTC) (envelope-from ashfixit@gmail.com) Received: from mail-yw1-xc36.google.com (mail-yw1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 580F17DCD1 for ; Fri, 17 Aug 2018 13:35:28 +0000 (UTC) (envelope-from ashfixit@gmail.com) Received: by mail-yw1-xc36.google.com with SMTP id y203-v6so4360980ywd.9 for ; Fri, 17 Aug 2018 06:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ieYzVP/u53WgM0gcdC2Ew30Ty9fVja8siKsd7msuX1w=; b=An0Dy6GOcPtIiPlQKcsmAxgV/F66PjpOUKx+fIoubTq5ekf8PRGCMo6hqC2fAQDYlm grqSGOEbLTrNpVRSsTFMT30MRlExcKppyZcsWXQVW/qkpmgsWQOVRT3tfZHOstDIuT2h sRQkVXVye5k7T4RQ9yDt2vbWgINcZjxPagiS11DOMyEzpkw4Mv1jevjvwkY5nokmzeNN XPLY6GjBvUTUNvketYG52s53tN/hWChG7bo9qILwPaTORPyLkpzF/EupnjuFPC0yb+cg nyCwPEPxVrhnwZqgn8ohYu0b2U+UecOjXK7TqcHUYJwhFnhWPbadgQq2kXAt/AMZqCyH vXkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ieYzVP/u53WgM0gcdC2Ew30Ty9fVja8siKsd7msuX1w=; b=KHibbeb35TopL4UO2O0BtEhRmpSK/KerEBlejPgnaKjwtkUbmfQK7G5uC3SBrwjvFK cclmEXnKvzJ0VOH9R4gCpuFTA3tvq8xlu8O0ZVbDCrdmytDiJUvwLCYk+G0DMDGJtSv2 hwa/3oYP5LtbqgRfuOXGuxYxfVbDb9iUZdhJ6njYr3RRCrZm9Po2hlDcNwCCIKPgvX2l 2LIk96mgujbhcdPzqduU61goYCTcnaFBrMvWVPwcMQFmDrRulGueeUX9E40GJzrgydfq fKafJM7FTik4PypiPUZtpWogiZlzC6J0JeRnHLv8e1rCLVsEQNuJ9kW/WGa92Etl9Fwp lrIA== X-Gm-Message-State: AOUpUlH/8cvIEkDD6FMmAKxIKQ4Cd/35PzPZxqs25QJg1Fl4YN/JhDZy GqnF25tnMZ89VSoxd5wBt/YVVDtRN4UcoiMtFvYwAk8G X-Google-Smtp-Source: AA+uWPwKvaIrrQf3iTTxd3xViXvedxrXO3Bj0icPyI4nMmMM6Af3EZogEArq9Eq3mGv1OOIFfs12nZtpBgPNL0R86ok= X-Received: by 2002:a81:430f:: with SMTP id q15-v6mr780495ywa.225.1534512927364; Fri, 17 Aug 2018 06:35:27 -0700 (PDT) MIME-Version: 1.0 References: <54B93C32-7672-4A54-9272-F3F0CF5B38BD@gmail.com> In-Reply-To: <54B93C32-7672-4A54-9272-F3F0CF5B38BD@gmail.com> From: Ash Gokhale Date: Fri, 17 Aug 2018 09:35:14 -0400 Message-ID: Subject: Re: Filter out dtrace(1) probes To: freebsd-dtrace@freebsd.org Cc: khanzf@gmail.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.27 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, 17 Aug 2018 13:35:29 -0000 > > > > On 17 Aug 2018, at 00:49, Farhan Khan wrote: > > > > Hi all, > > > > Is it possible to filter out probes? > > For example, if I did: > > > > dtrace -n 'fbt:kernel::entry { something_here }' > Sure, try extending this: dtrace -n 'fbt:kernel:read*:entry /probefunc != "read_cpu_time" && probefunc != "readdep"/ {@[probefunc]=count();}' Altough fbt::kernel::entry is going to mach a _lot_ of probes. Unless you are looking for a simple kernel function use count this is probably going to overload the data collection plumbing. You should probably narrow your probe list based on what you are hunting. Also fbt:kernel::entry is only going to get core freebsd calls, excluding all loadable modules (zfs.ko ..) . if you really want all kernel functions, use fbt:::entry, as blank entries are wildcards.