mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 04:30:35 +08:00
Merge remote-tracking branch 'upstream/master' into ros
Conflicts: src/platforms/px4_middleware.h
This commit is contained in:
@@ -57,7 +57,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.
|
||||
*
|
||||
@@ -102,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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user