aboutsummaryrefslogtreecommitdiff
path: root/src/modules/systemlib/perf_counter.h
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-01-07 18:19:23 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-01-11 11:03:56 +0100
commit172dbf37070e2dccadc8779d6e0926d3f8d60706 (patch)
tree3f95531b4bdc372c55c2e23d165a9bec8bb682e4 /src/modules/systemlib/perf_counter.h
parent4712c75dea935b5709c944b31ae670dd6879f2e9 (diff)
downloadpx4-firmware-172dbf37070e2dccadc8779d6e0926d3f8d60706.tar.gz
px4-firmware-172dbf37070e2dccadc8779d6e0926d3f8d60706.tar.bz2
px4-firmware-172dbf37070e2dccadc8779d6e0926d3f8d60706.zip
Performance counters: Add option to set otherwise estimated time interval
Diffstat (limited to 'src/modules/systemlib/perf_counter.h')
-rw-r--r--src/modules/systemlib/perf_counter.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/systemlib/perf_counter.h b/src/modules/systemlib/perf_counter.h
index 92f064d04..0c1243de3 100644
--- a/src/modules/systemlib/perf_counter.h
+++ b/src/modules/systemlib/perf_counter.h
@@ -112,6 +112,18 @@ __EXPORT extern void perf_begin(perf_counter_t handle);
__EXPORT extern void perf_end(perf_counter_t handle);
/**
+ * Register a measurement
+ *
+ * This call applies to counters that operate over ranges of time; PC_ELAPSED etc.
+ * If a call is made without a corresponding perf_begin call. It sets the
+ * value provided as argument as a new measurement.
+ *
+ * @param handle The handle returned from perf_alloc.
+ * @param elapsed The time elapsed. Negative values lead to incrementing the overrun counter.
+ */
+__EXPORT extern void perf_set(perf_counter_t handle, int64_t elapsed);
+
+/**
* Cancel a performance event.
*
* This call applies to counters that operate over ranges of time; PC_ELAPSED etc.