Skip to content

Conversation

encounter
Copy link
Contributor

Allows enabling/disabling individual functions with --win32-trace.

Allows enabling/disabling individual functions
Copy link
Owner

@evmar evmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends up adding an entry per function in

self.enabled.insert(context.as_ptr(), enabled);
.

I'm trying to decide if it really matters though. It feels kind of wrong?

@evmar
Copy link
Owner

evmar commented Jul 24, 2024

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.

@encounter
Copy link
Contributor Author

This ends up adding an entry per function in

self.enabled.insert(context.as_ptr(), enabled);

.
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...

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

Successfully merging this pull request may close these issues.

2 participants