From owner-freebsd-hackers@freebsd.org Mon Apr 9 10:01:48 2018 Return-Path: Delivered-To: freebsd-hackers@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 9559BF95674 for ; Mon, 9 Apr 2018 10:01:48 +0000 (UTC) (envelope-from dmilith@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 03AB768C52 for ; Mon, 9 Apr 2018 10:01:48 +0000 (UTC) (envelope-from dmilith@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id b127so17875453wmf.5 for ; Mon, 09 Apr 2018 03:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:date:references:to:message-id:mime-version; bh=soL/4R3UjjqBGR+sfcTILZvRR+jI/8fvkbdQlLxT8Fc=; b=otRBZIwq72b5E1AumZExCGdf53n0FxRYlkKgwX1gPdjoYxnBCdv3oeweZIfVFl6/+C WMsEFEGR8xlNeAepA6tOYuu7WJBOIsBpgEL+3CP2Tw834V5+zRyNIoiAtZrfO/lA9Uu3 b9uoQjlZfNyjYty1tqm5lWXsu7OCQi5Gp0sJ+llQUYxyg0SLaBSBxEz8vvGPs0hejAxN WQTxlH/9AtOy9/VU1nbvpIaol2GIQiQevsCWYwK6beaLcLAvPb2r/H9NAkSIM2yLfWAZ p+JWnKqDvsX1ifXCD+4n5Icp9VCPDfgvjXW1kFX0i/ySNasxpxLHpocJ9KHA9/iBJUxd 0zzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:date:references:to:message-id :mime-version; bh=soL/4R3UjjqBGR+sfcTILZvRR+jI/8fvkbdQlLxT8Fc=; b=I2SnFmIUI2ybwFFq/QfXdoRjCDqQpNAobMe4TJFrBBT6vJAIzmDw5V0uO24Xs07gME xHk75OC8XRgBhLDh3M+4qsGLOTmVgnrI1XDiyX7Rtr+CFIideWwVA/guoT/XVdyxbRBU CqAKTMiweurWPo88lMRLzyLWewjHSUvm9fzlnuLa8eeC4j94aMUZTXwqsTG/4lHtuojC ZrIhc2beV7OsPNfsmG5KhDTUUR0yUXXv1/kHMxXojYo6PWyS3uNdEkhM1amQAWxgGCwG l9wHA7EYr6C3gM8tpaLSxOtoSov4eD9URTlwdDRY6mWKZ0key4oJHg2nXhtyHWozO8Q4 Y1kw== X-Gm-Message-State: ALQs6tD/cRSK8Au6ctiqvbwXrUHYFL1CbreoVmkjljAcyO4oT9ePcoxF PfTXa/V74NHF8i2F9IdioUVHaAjo X-Google-Smtp-Source: AIpwx4/e2abbyGXcSVAQINsrnj3beM6X12ss6aSHkF+4Wzj1tkOpM0e+7DlNoZPkxLeJuzRPMlFRtA== X-Received: by 10.28.14.9 with SMTP id 9mr18127545wmo.127.1523268106712; Mon, 09 Apr 2018 03:01:46 -0700 (PDT) Received: from [100.64.1.2] (89-64-50-100.dynamic.chello.pl. [89.64.50.100]) by smtp.gmail.com with ESMTPSA id r82sm351946wme.31.2018.04.09.03.01.45 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 03:01:45 -0700 (PDT) From: Daniel Dettlaff Content-Type: multipart/signed; boundary="Apple-Mail=_83BA4A4D-3533-4C18-A6A3-E7B8BB571557"; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: Tracing with DTrace, when custom probe provider is running as regular user Date: Mon, 9 Apr 2018 12:01:44 +0200 References: To: freebsd-hackers@freebsd.org Message-Id: <1D449DD6-4D38-4561-8BD0-B6E581AB53A8@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 10:01:48 -0000 --Apple-Mail=_83BA4A4D-3533-4C18-A6A3-E7B8BB571557 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello FreeBSD hackers. I have question about real world Dtrace tracing = on our favourite platform. Yesterday did enable dtrace for my builds of Erlang*, Php*, Node and = Postgresql9x on my x86_64 11.1 system. It works very well in general, = with one exception - I'm unable to get probes from software running as = regular user. So for example - I can launch Erlang 19.3.x REPL as root (`erl`), and do = `dtrace -l | grep beam` - to see new provider with Erlang probes.. but = if I launch exactly same Erlang REPL as regular user ("www" in my case) = - I cannot see published probes when invoking `dtrace -l` (as root). I = also can't invoke `dtrace -l` as regular user obviously. Here's example on a single screenshot: http://s.verknowsys.com/38a22eb93f473a0bac43e5e56f3d7f35.png =E2=87=92 red lambda =E2=87=92 root, gray lambda =E2=87=92 = regular user. =E2=87=92 Erlang REPL running as root =E2=87=92 probes are = there.. but when as regular user =E2=87=92 nothing Issue is critical for tracing Postgresql which demands to run with NON = privileged user, but in general launching any server software as root = should be considered to be "harmful" / "a bad idea" right? So question is - is there a way to work around this? I wish to be able = to trace user software as root using dtrace. Is there a way to do it? I = build whole system from source so I can even do custom patch if I'd know = where to look :) Thanks in advance! -- Daniel (dmilith) Dettlaff --Apple-Mail=_83BA4A4D-3533-4C18-A6A3-E7B8BB571557 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iF0EARECAB0WIQTRxYhlHcH16So4S7KBOC9Vj5almgUCWss6CAAKCRCBOC9Vj5al msv6AJ0eOeEVZ1S5Fuik8hqsR7C+NMVD4QCdHNnk05HsfXpQ21Ub9rmh6daD5dQ= =IsEv -----END PGP SIGNATURE----- --Apple-Mail=_83BA4A4D-3533-4C18-A6A3-E7B8BB571557--