-
Notifications
You must be signed in to change notification settings - Fork 14
libdatadog 29.0.0: integrate libdatadog sample types #504
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
Merged
gh-worker-dd-mergequeue-cf854d
merged 10 commits into
main
from
r1viollet/libdatadog_28.0.2
Mar 20, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1fa16ce
chore: upgrade libdatadog to v28.0.2
r1viollet a4dd92b
refactor: replace DDPROF_PWT_* enum with direct ddog_prof_SampleType …
r1viollet db0ab25
fix(profiling): several fixes for libdatadog v28 migration
r1viollet 49b3b09
docs: rewrite profile sample type mapping for libdatadog v28
r1viollet b9fff3a
style: align sample_type_name() cases with static_assert order
r1viollet 5ed39eb
chore: upgrade libdatadog to v29.0.0, fix sample type sentinel
r1viollet 45a6e5c
libdatadog 29: Add an include of libdatadog headers
r1viollet 8f8bdc4
libdatadog 29 - remove documentation on profile types
r1viollet 4b5a65a
profile types: use the dummy type and clean up the extra boolean
r1viollet 9e1166b
perf_watcher: reorder PerfWatcher fields to eliminate padding
r1viollet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // Unless explicitly stated otherwise all files in this repository are licensed | ||
| // under the Apache License Version 2.0. This product includes software | ||
| // developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present | ||
| // Datadog, Inc. | ||
|
|
||
| #pragma once | ||
|
|
||
| // Maps a watcher's event to pprof sample types for each aggregation mode. | ||
| // k_stype_none signals "no sample/count type for this aggregation mode". | ||
| // Fields are uint32_t (not the enum) to allow k_stype_none = UINT32_MAX, | ||
| // which lies outside the valid enum range. | ||
|
|
||
| #include "event_config.hpp" | ||
|
|
||
| #include <cstdint> | ||
| #include <datadog/common.h> | ||
|
|
||
| namespace ddprof { | ||
|
|
||
| struct WatcherSampleTypes { | ||
| uint32_t sample_types[kNbEventAggregationModes]; // [kSumPos, kLiveSumPos] | ||
| uint32_t count_types[kNbEventAggregationModes]; // companion counts | ||
| }; | ||
|
|
||
| // Sentinel: slot is unused for this aggregation mode. | ||
| inline constexpr uint32_t k_stype_none = UINT32_MAX; | ||
|
|
||
| // Tracepoints: one event = one sample, no count companion, no live mode. | ||
| // clang-format off | ||
| inline constexpr WatcherSampleTypes k_stype_tracepoint = { | ||
| {DDOG_PROF_SAMPLE_TYPE_TRACEPOINT, k_stype_none}, | ||
| {k_stype_none, k_stype_none}}; | ||
|
|
||
| // CPU: nanoseconds in sum mode only — no live profile for CPU. | ||
| inline constexpr WatcherSampleTypes k_stype_cpu = { | ||
| {DDOG_PROF_SAMPLE_TYPE_CPU_TIME, k_stype_none}, | ||
| {DDOG_PROF_SAMPLE_TYPE_CPU_SAMPLES, k_stype_none}}; | ||
|
|
||
| // Allocation: bytes allocated / live bytes, with object-count companions. | ||
| inline constexpr WatcherSampleTypes k_stype_alloc = { | ||
| {DDOG_PROF_SAMPLE_TYPE_ALLOC_SPACE, DDOG_PROF_SAMPLE_TYPE_INUSE_SPACE}, | ||
| {DDOG_PROF_SAMPLE_TYPE_ALLOC_SAMPLES, DDOG_PROF_SAMPLE_TYPE_INUSE_OBJECTS}}; | ||
|
|
||
| // Dummy: watcher does not contribute to pprof (e.g., sDUM). | ||
| inline constexpr WatcherSampleTypes k_stype_dummy = { | ||
| {k_stype_none, k_stype_none}, | ||
| {k_stype_none, k_stype_none}}; | ||
| // clang-format on | ||
|
|
||
| constexpr bool is_pprof_active(const WatcherSampleTypes &st) { | ||
| return st.sample_types[0] != k_stype_none; | ||
| } | ||
|
|
||
| } // namespace ddprof | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.