The logman tool can list all providers currently enabled for a running trace event session, e.g.:
logman query -ets SleepStudyTraceSession
How is that achieved in code using the TraceEvent library?
https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.TraceEvent/