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

Initial import #5

Merged
merged 11 commits into from
Jul 31, 2024
Merged

Initial import #5

merged 11 commits into from
Jul 31, 2024

Conversation

Robo210
Copy link
Collaborator

@Robo210 Robo210 commented Jul 27, 2024

Docs are still a work in progress. Will address comments from #4 in a new iteration on this PR.

@Robo210 Robo210 requested a review from idigdoug July 27, 2024 00:03
idigdoug
idigdoug previously approved these changes Jul 27, 2024
idigdoug
idigdoug previously approved these changes Jul 29, 2024
@idigdoug
Copy link
Contributor

Build failing because github still only has Rust 1.78. Might not be a bad idea to support 1.78 for a while, even though it requires depending on an extra external crate.

@Robo210
Copy link
Collaborator Author

Robo210 commented Jul 29, 2024

Build failing because github still only has Rust 1.78. Might not be a bad idea to support 1.78 for a while, even though it requires depending on an extra external crate.

Yep, I'm intending on doing that in a new iteration today.

Robo210 and others added 5 commits July 29, 2024 23:46
- Make the provider group type fixed per-platform rather than an enum (yes, it is still an Option enum)
- Make the guid type a common wrapper
- Make the platform crates only used on that platform
idigdoug
idigdoug previously approved these changes Jul 30, 2024
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
use crate::native::ProviderTypes;

// Public with public fields because the `etw_event!` macro needs to create it at invocation site.
#[doc(hidden)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't need another doc(hidden) since the whole module was marked hidden.


// This struct needs to be public as it implements the tracing_subscriber::Layer trait.
#[doc(hidden)]
pub struct EtwLayer<S, Mode: ProviderTypes>
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider: instead of defining this here, move it to layer.rs, then re-export it from here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I want to export it from here, then it needs to be public in layer.rs too - I can't increase the visibility of it through a use statement. And if it's public in layer.rs, then we're back where we started.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. But the layer module itself isn't pub. (Though this does mean you would need to stop using * to export items from layer.)

// This struct needs to be public as it implements the tracing_subscriber::Layer::Filter trait.
#[doc(hidden)]
#[cfg(not(feature = "global_filter"))]
pub struct EtwFilter<S, Mode: ProviderTypes>
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider: instead of defining this here, move it to layer.rs, then re-export it from here.


#[allow(non_camel_case_types)]
#[derive(Default, Clone)]
#[doc(hidden)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't need doc(hidden) since the module isn't pub.

src/layer.rs Show resolved Hide resolved
/// Get the current provider ID that will be used for the ETW provider.
/// This is a convenience function to help with tools that do not implement
/// the standard provider name to ID algorithm.
pub fn get_provider_id(&self) -> &GuidWrapper {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider returning a u128 here so caller doesn't need to know what a GuidWrapper is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I forgot that I wanted to come back to the guids.

@Robo210 Robo210 merged commit 80b33bc into main Jul 31, 2024
3 checks passed
@Robo210 Robo210 deleted the kw2 branch July 31, 2024 18:37
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