Closed q-p closed 1 month ago
For context for those reading it, @q-p and I debugging this on Discord. I think the correct solution here is to add some option to tracebox to use the default system sockets. I was thinking a command line option like --system or similar.
Thanks for filing!
Yeah i'm supportive of --system-sockets or something similar. The reason why this is done this way is really android: in android there is no chance that the sideloaded traced can take over the default /dev/socket/traced-{consumer,producer} because that requires the union of root + complicated SELinux shenanigans. I wanted something that works out-of-the-box hence the abstract sockets being used.
https://r.android.com/3194924 should fix this.
If you run a system trace with an application that uses the perfetto SDK, it finds the separately started
traced
by default, since they pick the same names for the relevant sockets. Everything works fine. (On my RHEL8 system, these were/tmp/perfetto-producer
and/tmp/perfetto-producer
. I do not have write access to/run
.)But when running
tracebox
in the very convenient autostart mode (where it launchestraced
andtraced_probes
for you), then it picks distinct names, leading to the SDK-using application not being able to connect to thetraced
launched bytracebox
. (On my RHEL8 system,traced
reports@traced-p-NUMBER
and@traced-c-NUMBER
.)For my use case (essentially wanting to record SDK track_events as well as memory usage) it would be convenient to have an option for
tracebox
to pick the same defaults as a standalonetraced
invocation would, so it's easier to set up a matching pair.As a work-around, I can set
PERFETTO_CONSUMER_SOCK_NAME
/PERFETTO_PRODUCER_SOCK_NAME
environment variables as appropriate for either of the invocations so they can find each other.