Skip to content
Open
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions libdd-library-config/src/otel_process_ctx.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
// Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

//! Implementation of the publisher part of the [OTEL process
Expand All @@ -8,7 +8,8 @@
//!
//! Process context sharing implies concurrently writing to a memory area that another process
//! might be actively reading. However, reading isn't done as direct memory accesses but goes
//! through the OS, so the Rust definition of race conditions doesn't really apply.
//! through the OS, so the Rust definition of race conditions doesn't really apply. We also use
//! atomics and fences, see MappingHeader's documentation.
#[cfg(target_os = "linux")]
#[cfg(target_has_atomic = "64")]
Expand Down
1 change: 1 addition & 0 deletions libdd-profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ strum = { version = "0.26", features = ["derive"] }
tempfile = "3"

[build-dependencies]
cc = "1.1.31"
cxx-build = { version = "1.0", optional = true }
16 changes: 16 additions & 0 deletions libdd-profiling/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,20 @@ fn main() {

println!("cargo:rerun-if-changed=src/cxx.rs");
}

// Only compile the TLS shim on Linux; the thread-level context feature is Linux-only.
#[cfg(target_os = "linux")]
{
let mut build = cc::Build::new();

// - On aarch64, TLSDESC is already the only dynamic TLS model so no flag is needed.
// - On x86-64, we use `-mtls-dialect=gnu2` (supported since GCC 4.4 and Clang 19+) to force
// the use of TLSDESC as mandated by the spec. If it's not supported, this build will
// fail.
#[cfg(target_arch = "x86_64")]
build.flag("-mtls-dialect=gnu2");

build.file("src/tls_shim.c").compile("tls_shim");
println!("cargo:rerun-if-changed=src/tls_shim.c");
}
}
1 change: 1 addition & 0 deletions libdd-profiling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ pub mod cxx;
pub mod exporter;
pub mod internal;
pub mod iter;
pub mod otel_thread_ctx;
pub mod pprof;
pub mod profiles;
Loading
Loading