diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-07 17:14:46 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-11 11:03:55 +0100 |
commit | a3bce71b97b6e958737d11414cce2609e5d4848d (patch) | |
tree | 25bf5c8c021a5dcf411359d2a5c7b27418526f86 /src/modules/systemlib/perf_counter.h | |
parent | 1507d479e099549a81c99fd9f702b4a278fa763d (diff) | |
download | px4-firmware-a3bce71b97b6e958737d11414cce2609e5d4848d.tar.gz px4-firmware-a3bce71b97b6e958737d11414cce2609e5d4848d.tar.bz2 px4-firmware-a3bce71b97b6e958737d11414cce2609e5d4848d.zip |
Performance counters: Estimate RMS for elapsed counters. Allow to use a perf counter across processes, deal with overruns and other resulting inconsistencies from cross-process use.
Diffstat (limited to 'src/modules/systemlib/perf_counter.h')
-rw-r--r-- | src/modules/systemlib/perf_counter.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/modules/systemlib/perf_counter.h b/src/modules/systemlib/perf_counter.h index d06606a5d..92f064d04 100644 --- a/src/modules/systemlib/perf_counter.h +++ b/src/modules/systemlib/perf_counter.h @@ -56,7 +56,7 @@ typedef struct perf_ctr_header *perf_counter_t; __BEGIN_DECLS /** - * Create a new counter. + * Create a new local counter. * * @param type The type of the new counter. * @param name The counter name. @@ -66,6 +66,16 @@ __BEGIN_DECLS __EXPORT extern perf_counter_t perf_alloc(enum perf_counter_type type, const char *name); /** + * Get the reference to an existing counter or create a new one if it does not exist. + * + * @param type The type of the counter. + * @param name The counter name. + * @return Handle for the counter, or NULL if a counter + * could not be allocated. + */ +__EXPORT extern perf_counter_t perf_alloc_once(enum perf_counter_type type, const char *name); + +/** * Free a counter. * * @param handle The performance counter's handle. |