aboutsummaryrefslogtreecommitdiff
path: root/src/modules/systemlib/perf_counter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/systemlib/perf_counter.h')
-rw-r--r--src/modules/systemlib/perf_counter.h12
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.