Add function name to trace context
Allows enabling/disabling individual functions with --win32-trace.
Thinking about this more, I wonder if each function should just stash a tracing_enabled local unsafe static rather than this hash map, because each function will have its own separate tracing state (?).
Also I think this means we end up embedding the ddraw/SomeFunctionName strings in the binary for each function.
Together those make me wonder if there's some other way to set this up, hrmm.
This ends up adding an entry per function in
https://github.com/evmar/retrowin32/blob/692764792fe7a76d218cab751ec16cc85fde9c7f/win32/src/trace.rs#L65
. I'm trying to decide if it really matters though. It feels kind of wrong?
I think it's fine, personally. If performance ends up causing an issue there, we'd want to switch away from std::collections::HashMap and rethink the approach anyway.
I wonder if each function should just stash a tracing_enabled local unsafe static rather than this hash map, because each function will have its own separate tracing state (?).
I like the idea of having it local to the function, but I also think it's teetering on premature optimization...