Tracing with DTrace, when custom probe provider is running as regular user

Daniel Dettlaff dmilith at gmail.com
Mon Apr 9 10:01:48 UTC 2018


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

	⇒ red lambda ⇒ root, gray lambda ⇒ regular user.
	⇒ Erlang REPL running as root ⇒ probes are there.. but when as regular user ⇒ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20180409/43203de9/attachment.sig>


More information about the freebsd-hackers mailing list