aws / s2n-quic

An implementation of the IETF QUIC protocol
https://crates.io/crates/s2n-quic
Apache License 2.0
1.16k stars 120 forks source link

events: Implement a Dtrace Event Subscriber #1201

Open WesleyRosenblum opened 2 years ago

WesleyRosenblum commented 2 years ago

Problem:

DTrace is a comprehensive dynamic tracing framework originally created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time.

s2n-quic does not currently support integration with DTrace

Solution:

Implement an Event Subscriber that integrates with DTrace, by implementing the event::Subscriber trait.

jon-chuang commented 1 year ago

Hi, this seems like something I'd like to work on.

camshaft commented 1 year ago

That would be awesome! You can see we started working on a BPF provider in https://github.com/aws/s2n-quic/pull/1324 but had issues with our MSRV at the time and got deprioritized for other things.

jon-chuang commented 1 year ago

Indeed, we probably only need to do it once, bpftrace should also consume KProbes and UProbes. We could add examples for both systemtap and bpftrace.

Incidentally, it is stated that debugging symbols need to be exposed by user programs that one desires to trace: https://lwn.net/Articles/852112/. I think this applies more to tracing arbitrary function calls in the userspace program via UProbes rather than via USDTs (static tracepoints) in the linked PR.

Further, according to the article, bpftrace cannot get a user back trace (it may be useful in our case to know where the s2n-quic events are originating). I suppose that systemtap would be used in this case.