Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support enabling/disabling a provider on a running trace #54

Open
daladim opened this issue Oct 27, 2022 · 1 comment
Open

Support enabling/disabling a provider on a running trace #54

daladim opened this issue Oct 27, 2022 · 1 comment

Comments

@daladim
Copy link
Collaborator

daladim commented Oct 27, 2022

In ferrisetw 0.1, UserTrace::enable should be used to add a Provider to a trace. But, IIRC, this has no effect on a trace that has started already (the provider is pushed to a list, but EnableTraceEx2 is not called on this new trace).

To fix this problem, the next_major_version branch reworks this enable function and forces to define all Providers before the trace is started.

But the Windows API allows enabling/disabling providers when the trace is running (using EnableTraceEx2, so this could be worth supporting this in ferrisetw

@daladim
Copy link
Collaborator Author

daladim commented Oct 27, 2022

Note: trace_callback_thunk is currently safe (memory-safety-wise) because CallbackData is not mutated when a trace is running.
When resolving this issue, we will mutate the list of providers (which is a member of CallbackData) in one thread while another thread may run a callback (and read this list of Providers). We must synchrionize it in some way and make sure the Provider cannot be removed during a callback (wrapping the Vec<Provider> in a Mutex may or may not be sufficient, this must be carefully checked)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant