diff --git a/.github/workflows/prof_correctness.yml b/.github/workflows/prof_correctness.yml index a76c9ebcf7..8cc7db67a0 100644 --- a/.github/workflows/prof_correctness.yml +++ b/.github/workflows/prof_correctness.yml @@ -120,44 +120,44 @@ jobs: done - name: Check profiler correctness for allocations - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/allocations.json pprof_path: profiling/tests/correctness/allocations/ - name: Check profiler correctness for allocations with 1 byte sampling distance - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/allocations.json pprof_path: profiling/tests/correctness/allocations_1byte/ - name: Check profiler correctness for time - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/time.json pprof_path: profiling/tests/correctness/time/ - name: Check profiler correctness for strange frames - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/strange_frames.json pprof_path: profiling/tests/correctness/strange_frames/ - name: Check profiler correctness for timeline - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/timeline.json pprof_path: profiling/tests/correctness/timeline/ - name: Check profiler correctness for exceptions ZTS if: matrix.phpts == 'zts' - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/exceptions_zts.json pprof_path: profiling/tests/correctness/exceptions_zts/ - name: Check profiler correctness for exceptions - uses: Datadog/prof-correctness/analyze@main + uses: Datadog/prof-correctness/analyze@PROF-11832-Add-zstd-to-compression-configuration-to-libdatadog with: expected_json: profiling/tests/correctness/exceptions.json pprof_path: profiling/tests/correctness/exceptions/ diff --git a/Cargo.lock b/Cargo.lock index 7cc464f0ad..b999f83bc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -520,8 +520,8 @@ dependencies = [ [[package]] name = "build_common" -version = "21.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +version = "22.1.0" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "cbindgen 0.29.0", "serde", @@ -1136,8 +1136,8 @@ dependencies = [ [[package]] name = "datadog-alloc" -version = "21.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +version = "22.1.0" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "allocator-api2", "libc 0.2.173", @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "datadog-library-config" version = "0.0.2" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "anyhow", "memfd", @@ -1292,14 +1292,14 @@ dependencies = [ [[package]] name = "datadog-library-config-ffi" version = "0.0.2" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "anyhow", - "build_common 21.0.0", + "build_common 22.1.0", "constcat", - "datadog-library-config 0.0.2 (git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e)", - "ddcommon 21.0.0", - "ddcommon-ffi 21.0.0", + "datadog-library-config 0.0.2 (git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43)", + "ddcommon 22.1.0", + "ddcommon-ffi 22.1.0", ] [[package]] @@ -1354,10 +1354,10 @@ dependencies = [ "criterion-perf-events", "crossbeam-channel", "datadog-alloc", - "datadog-library-config-ffi 0.0.2 (git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e)", + "datadog-library-config-ffi 0.0.2 (git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43)", "datadog-php-profiling", "datadog-profiling", - "ddcommon 21.0.0", + "ddcommon 22.1.0", "env_logger 0.11.6", "lazy_static", "libc 0.2.173", @@ -1377,8 +1377,8 @@ dependencies = [ [[package]] name = "datadog-profiling" -version = "21.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +version = "22.1.0" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "anyhow", "bitmaps", @@ -1387,14 +1387,13 @@ dependencies = [ "chrono", "datadog-alloc", "datadog-profiling-protobuf", - "ddcommon 21.0.0", + "ddcommon 22.1.0", "futures", "http", "http-body-util", "hyper", "hyper-multipart-rfc7578", "indexmap 2.7.1", - "lz4_flex", "mime", "prost", "rustc-hash", @@ -1403,12 +1402,13 @@ dependencies = [ "target-triple", "tokio", "tokio-util", + "zstd", ] [[package]] name = "datadog-profiling-protobuf" -version = "21.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +version = "22.1.0" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "prost", ] @@ -1625,8 +1625,8 @@ dependencies = [ [[package]] name = "ddcommon" -version = "21.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +version = "22.1.0" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "anyhow", "cc", @@ -1672,14 +1672,14 @@ dependencies = [ [[package]] name = "ddcommon-ffi" -version = "21.0.0" -source = "git+https://github.com/DataDog/libdatadog?rev=0b59f64c4fc08105e5b73c5a0752ced3cf8f653e#0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" +version = "22.1.0" +source = "git+https://github.com/DataDog/libdatadog?rev=0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43#0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" dependencies = [ "anyhow", - "build_common 21.0.0", + "build_common 22.1.0", "chrono", "crossbeam-queue", - "ddcommon 21.0.0", + "ddcommon 22.1.0", "hyper", "serde", ] @@ -2911,15 +2911,6 @@ version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" -[[package]] -name = "lz4_flex" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a8cbbb2831780bc3b9c15a41f5b49222ef756b6730a95f3decfdd15903eb5a3" -dependencies = [ - "twox-hash", -] - [[package]] name = "manual_future" version = "0.1.1" diff --git a/profiling/Cargo.toml b/profiling/Cargo.toml index 8736792c0e..f5c8462598 100644 --- a/profiling/Cargo.toml +++ b/profiling/Cargo.toml @@ -22,10 +22,10 @@ crossbeam-channel = { version = "0.5", default-features = false, features = ["st # This libdatadog commit is to be compat with tracer for a given lib config # crash fix which is not yet on a release. -datadog-alloc = { git = "https://github.com/DataDog/libdatadog", rev = "0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" } -datadog-profiling = { git = "https://github.com/DataDog/libdatadog", rev = "0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" } -ddcommon = { git = "https://github.com/DataDog/libdatadog", rev = "0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" } -datadog-library-config-ffi = { git = "https://github.com/DataDog/libdatadog", rev = "0b59f64c4fc08105e5b73c5a0752ced3cf8f653e" } +datadog-alloc = { git = "https://github.com/DataDog/libdatadog", rev = "0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" } +datadog-profiling = { git = "https://github.com/DataDog/libdatadog", rev = "0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" } +ddcommon = { git = "https://github.com/DataDog/libdatadog", rev = "0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" } +datadog-library-config-ffi = { git = "https://github.com/DataDog/libdatadog", rev = "0f08a57083fd93ad15b3907a4b2b2a47b3b5cd43" } env_logger = { version = "0.11", default-features = false } lazy_static = { version = "1.4" } libc = "0.2" diff --git a/profiling/src/profiling/mod.rs b/profiling/src/profiling/mod.rs index 255c1bb976..d96d356539 100644 --- a/profiling/src/profiling/mod.rs +++ b/profiling/src/profiling/mod.rs @@ -333,7 +333,7 @@ impl TimeCollector { let exception_samples_offset = get_offset("exception-samples"); let period = WALL_TIME_PERIOD.as_nanos(); - let mut profile = InternalProfile::new( + let mut profile = InternalProfile::try_new( &sample_types, Some(Period { r#type: ApiValueType { @@ -342,7 +342,8 @@ impl TimeCollector { }, value: period.min(i64::MAX as u128) as i64, }), - ); + ) + .expect("failed to create internal profile"); let _ = profile.set_start_time(started_at); if let (Some(alloc_size_offset), Some(alloc_samples_offset)) = diff --git a/profiling/src/profiling/uploader.rs b/profiling/src/profiling/uploader.rs index eb41928c2c..26eed8a320 100644 --- a/profiling/src/profiling/uploader.rs +++ b/profiling/src/profiling/uploader.rs @@ -119,7 +119,7 @@ impl Uploader { let filename_prefix = filename.as_ref(); let r = request.profile.serialize_into_compressed_pprof(None, None).unwrap(); i += 1; - let name = format!("{filename_prefix}.{i}.lz4"); + let name = format!("{filename_prefix}.{i}.zst"); std::fs::write(&name, r.buffer).expect("write to succeed"); info!("Successfully wrote profile to {name}"); },