-
Notifications
You must be signed in to change notification settings - Fork 13
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
Open
r1viollet
wants to merge
8
commits into
main
Choose a base branch
from
r1viollet/libdatadog_28.0.2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+228
−274
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f7b071b
chore: upgrade libdatadog to v28.0.2
r1viollet 4326981
refactor: replace DDPROF_PWT_* enum with direct ddog_prof_SampleType …
r1viollet 2b90274
fix(profiling): several fixes for libdatadog v28 migration
r1viollet 5340a55
docs: rewrite profile sample type mapping for libdatadog v28
r1viollet 475e553
style: align sample_type_name() cases with static_assert order
r1viollet d0147c5
chore: upgrade libdatadog to v29.0.0, fix sample type sentinel
r1viollet 9b1872c
libdatadog 29: Add an include of libdatadog headers
r1viollet 18c4729
libdatadog 29 - remove documentation on profile types
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,45 @@ | ||
| // 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 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nsavoire this part looks OK ? wdyt ? |
||
| 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}}; | ||
| // clang-format on | ||
|
|
||
| } // 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could replace
pprof_activewith a dummy sample type (similarly to what was done before):