Skip to content

Commit

Permalink
add into_fixed fn for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Mar 20, 2024
1 parent 1682462 commit 76322b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/perf_event/counting/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ impl CounterGroup {
pub fn stat(&mut self) -> io::Result<CounterGroupStat> {
self.inner_mut().stat()
}

pub fn into_fixed(self) -> io::Result<FixedCounterGroup> {
FixedCounterGroup::new(self.inner).wrap_ok()
}
}
4 changes: 4 additions & 0 deletions src/perf_event/sampling/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ impl SamplerGroup {
pub fn stat(&mut self) -> io::Result<SamplerGroupStat> {
self.inner_mut().stat()
}

pub fn into_fixed(self) -> io::Result<FixedSamplerGroup> {
FixedSamplerGroup::new(self.inner).wrap_ok()
}
}

0 comments on commit 76322b2

Please sign in to comment.