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
7 changes: 7 additions & 0 deletions libdd-profiling/src/api/sample_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ pub enum SampleType {
/// Legacy: Use `WallTime` instead for consistency with naming scheme
WallLegacy,

OffCpuSamples,
OffCpuTime,

// Experimental sample types for testing and development.
ExperimentalCount,
ExperimentalNanoseconds,
Expand Down Expand Up @@ -160,6 +163,8 @@ impl From<SampleType> for ValueType<'static> {
SampleType::WallSamples => ValueType::new("wall-samples", "count"),
SampleType::WallTime => ValueType::new("wall-time", "nanoseconds"),
SampleType::WallLegacy => ValueType::new("wall", "nanoseconds"),
SampleType::OffCpuSamples => ValueType::new("off-cpu-samples", "count"),
SampleType::OffCpuTime => ValueType::new("off-cpu-time", "nanoseconds"),
SampleType::ExperimentalCount => ValueType::new("experimental-count", "count"),
SampleType::ExperimentalNanoseconds => {
ValueType::new("experimental-nanoseconds", "nanoseconds")
Expand Down Expand Up @@ -226,6 +231,8 @@ impl<'a> TryFrom<ValueType<'a>> for SampleType {
("wall-samples", "count") => SampleType::WallSamples,
("wall-time", "nanoseconds") => SampleType::WallTime,
("wall", "nanoseconds") => SampleType::WallLegacy,
("off-cpu-samples", "count") => SampleType::OffCpuSamples,
("off-cpu-time", "nanoseconds") => SampleType::OffCpuTime,
("experimental-count", "count") => SampleType::ExperimentalCount,
("experimental-nanoseconds", "nanoseconds") => SampleType::ExperimentalNanoseconds,
("experimental-bytes", "bytes") => SampleType::ExperimentalBytes,
Expand Down
4 changes: 4 additions & 0 deletions libdd-profiling/src/cxx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ pub mod ffi {
WallSamples,
WallTime,
WallLegacy, // LEGACY: Use WallTime instead
OffCpuSamples,
OffCpuTime,
ExperimentalCount,
ExperimentalNanoseconds,
ExperimentalBytes,
Expand Down Expand Up @@ -391,6 +393,8 @@ impl TryFrom<ffi::SampleType> for api::SampleType {
ffi::SampleType::WallSamples => api::SampleType::WallSamples,
ffi::SampleType::WallTime => api::SampleType::WallTime,
ffi::SampleType::WallLegacy => api::SampleType::WallLegacy,
ffi::SampleType::OffCpuSamples => api::SampleType::OffCpuSamples,
ffi::SampleType::OffCpuTime => api::SampleType::OffCpuTime,
ffi::SampleType::ExperimentalCount => api::SampleType::ExperimentalCount,
ffi::SampleType::ExperimentalNanoseconds => api::SampleType::ExperimentalNanoseconds,
ffi::SampleType::ExperimentalBytes => api::SampleType::ExperimentalBytes,
Expand Down
Loading