aboutsummaryrefslogtreecommitdiff
path: root/src/modules/systemlib/perf_counter.h
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-07-05 22:53:57 -0700
committerpx4dev <px4@purgatory.org>2013-07-05 22:53:57 -0700
commit6871d2909b5be7eb93bf23aea771a86aa1b0ae3f (patch)
treebcbc21d87ec3bcf020e27442e4c9110bf476fab1 /src/modules/systemlib/perf_counter.h
parent3c8c596ac7a2eacc3f4ac047a58bd5dceb36a203 (diff)
downloadpx4-firmware-6871d2909b5be7eb93bf23aea771a86aa1b0ae3f.tar.gz
px4-firmware-6871d2909b5be7eb93bf23aea771a86aa1b0ae3f.tar.bz2
px4-firmware-6871d2909b5be7eb93bf23aea771a86aa1b0ae3f.zip
Add a mechanism for cancelling begin/end perf counters.
Diffstat (limited to 'src/modules/systemlib/perf_counter.h')
-rw-r--r--src/modules/systemlib/perf_counter.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/modules/systemlib/perf_counter.h b/src/modules/systemlib/perf_counter.h
index 5c2cb15b2..4cd8b67a1 100644
--- a/src/modules/systemlib/perf_counter.h
+++ b/src/modules/systemlib/perf_counter.h
@@ -92,13 +92,25 @@ __EXPORT extern void perf_begin(perf_counter_t handle);
* End a performance event.
*
* This call applies to counters that operate over ranges of time; PC_ELAPSED etc.
+ * If a call is made without a corresopnding perf_begin call, or if perf_cancel
+ * has been called subsequently, no change is made to the counter.
*
* @param handle The handle returned from perf_alloc.
*/
__EXPORT extern void perf_end(perf_counter_t handle);
/**
- * Reset a performance event.
+ * Cancel a performance event.
+ *
+ * This call applies to counters that operate over ranges of time; PC_ELAPSED etc.
+ * It reverts the effect of a previous perf_begin.
+ *
+ * @param handle The handle returned from perf_alloc.
+ */
+__EXPORT extern void perf_cancel(perf_counter_t handle);
+
+/**
+ * Reset a performance counter.
*
* This call resets performance counter to initial state
*