diff --git a/src/perf_event/counting/group/fixed.rs b/src/perf_event/counting/group/fixed.rs index 04aebd3..e7a0901 100644 --- a/src/perf_event/counting/group/fixed.rs +++ b/src/perf_event/counting/group/fixed.rs @@ -28,8 +28,8 @@ impl FixedCounterGroup { self.inner().disable() } - pub fn reset_count(&self) -> io::Result<()> { - self.inner().reset_count() + pub fn reset(&self) -> io::Result<()> { + self.inner().reset() } pub fn stat(&mut self) -> io::Result { diff --git a/src/perf_event/counting/group/inner.rs b/src/perf_event/counting/group/inner.rs index 7ccd2b4..c8329c0 100644 --- a/src/perf_event/counting/group/inner.rs +++ b/src/perf_event/counting/group/inner.rs @@ -64,7 +64,7 @@ impl Inner { ) } - pub fn reset_count(&self) -> io::Result<()> { + pub fn reset(&self) -> io::Result<()> { self.leader().map_or_else( || Err(io::Error::new(ErrorKind::Other, "Group has no members")), |leader| { diff --git a/src/perf_event/counting/group/tests/mod.rs b/src/perf_event/counting/group/tests/mod.rs index 3ce2b42..63eea9b 100644 --- a/src/perf_event/counting/group/tests/mod.rs +++ b/src/perf_event/counting/group/tests/mod.rs @@ -12,7 +12,7 @@ where { test_stat(ev_1, ev_2, workload); test_enable_disable(ev_1, ev_2, workload); - test_reset_count(ev_1, ev_2, workload); + test_reset(ev_1, ev_2, workload); test_guard(ev_1, ev_2, workload); } @@ -99,7 +99,7 @@ where assert!(evs.member_count(&ev_2_guard).unwrap() > ev_2); } -fn test_reset_count(ev_1: &Event, ev_2: &Event, workload: &mut F) +fn test_reset(ev_1: &Event, ev_2: &Event, workload: &mut F) where F: FnMut(), { @@ -119,7 +119,7 @@ where assert!(ev_2 > 0); } - group.reset_count().unwrap(); + group.reset().unwrap(); { let evs = group.stat().unwrap(); diff --git a/src/perf_event/counting/single/mod.rs b/src/perf_event/counting/single/mod.rs index 46e48ab..1a4b15f 100644 --- a/src/perf_event/counting/single/mod.rs +++ b/src/perf_event/counting/single/mod.rs @@ -38,7 +38,7 @@ impl Counter { ioctl_wrapped::<()>(&self.file, PERF_EVENT_IOCTL_DISABLE, None) } - pub fn reset_count(&self) -> io::Result<()> { + pub fn reset(&self) -> io::Result<()> { ioctl_wrapped::<()>(&self.file, PERF_EVENT_IOCTL_RESET, None) } diff --git a/src/perf_event/counting/single/tests/mod.rs b/src/perf_event/counting/single/tests/mod.rs index b1f675a..bf37305 100644 --- a/src/perf_event/counting/single/tests/mod.rs +++ b/src/perf_event/counting/single/tests/mod.rs @@ -11,7 +11,7 @@ where { test_stat(ev, workload); test_enable_disable(ev, workload); - test_reset_count(ev, workload); + test_reset(ev, workload); } fn gen_counter(ev: &Event) -> Counter { @@ -58,7 +58,7 @@ where assert!(after < counter.stat().unwrap().event_count); } -fn test_reset_count(ev: &Event, workload: &mut F) +fn test_reset(ev: &Event, workload: &mut F) where F: FnMut(), { @@ -71,7 +71,7 @@ where assert!(count > 0); counter.disable().unwrap(); - counter.reset_count().unwrap(); + counter.reset().unwrap(); workload(); assert_eq!(counter.stat().unwrap().event_count, 0); }