Skip to content
Draft
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
14 changes: 7 additions & 7 deletions .github/workflows/prof_correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
57 changes: 24 additions & 33 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions profiling/src/profiling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)) =
Expand Down
2 changes: 1 addition & 1 deletion profiling/src/profiling/uploader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
},
Expand Down
Loading