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

Improve guid conversions #6

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benches/etw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tracing_subscriber::{self, prelude::*};
#[cfg(target_os = "windows")]
pub fn etw_benchmark(c: &mut Criterion) {
let builder = LayerBuilder::new("etw_bench");
let provider_id = builder.get_provider_id().to_u128();
let provider_id = builder.get_provider_id();
let _subscriber = tracing_subscriber::registry().with(builder.build()).init();

let etw_session = SessionBuilder::new_file_mode(
Expand Down Expand Up @@ -42,7 +42,7 @@ pub fn etw_benchmark(c: &mut Criterion) {
}

session
.enable_provider(&windows::core::GUID::from_u128(provider_id), 0xFF)
.enable_provider(&provider_id.into(), 0xFF)
.expect("can't enable provider to session");

// Spans
Expand Down
6 changes: 6 additions & 0 deletions src/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ impl From<GuidWrapper> for native_guid {
}
}

impl From<&GuidWrapper> for u128 {
fn from(value: &GuidWrapper) -> Self {
value.0
}
}

impl GuidWrapper {
pub fn from_name(name: &str) -> Self {
Self(native_guid::from_name(name).to_u128())
Expand Down
Loading