39 #ifndef _SYSTEMLIB_PERF_COUNTER_H 40 #define _SYSTEMLIB_PERF_COUNTER_H value 43 #include <px4_platform_common/defines.h> 45 #define LATENCY_BUCKET_COUNT 8 73 #ifndef perf_alloc // perf_alloc might be defined to be NULL in src/modules/px4iofirmware/px4io.h #define LATENCY_BUCKET_COUNT
measure the time elapsed performing an event
__EXPORT void perf_print_counter_fd(int fd, perf_counter_t handle)
Print one performance counter to a fd.
__EXPORT void perf_print_latency(int fd)
Print hrt latency counters.
__EXPORT void perf_set_count(perf_counter_t handle, uint64_t count)
Set a counter.
perf_counter_type
Counter types.
__EXPORT void perf_end(perf_counter_t handle)
End a performance event.
__EXPORT void perf_print_counter(perf_counter_t handle)
Print one performance counter to stdout.
count the number of times an event occurs
const uint16_t latency_bucket_count
__EXPORT void perf_reset_all(void)
Reset all of the performance counters.
void(* perf_callback)(perf_counter_t handle, void *user)
__EXPORT void perf_iterate_all(perf_callback cb, void *user)
Iterate over all performance counters using a callback.
uint32_t latency_counters[LATENCY_BUCKET_COUNT+1]
__EXPORT uint64_t perf_event_count(perf_counter_t handle)
Return current event_count.
__EXPORT int perf_print_counter_buffer(char *buffer, int length, perf_counter_t handle)
Print one performance counter to a buffer.
__EXPORT void perf_cancel(perf_counter_t handle)
Cancel a performance event.
__EXPORT void perf_begin(perf_counter_t handle)
Begin a performance event.
struct perf_ctr_header * perf_counter_t
__BEGIN_DECLS __EXPORT perf_counter_t perf_alloc(enum perf_counter_type type, const char *name)
Create a new local counter.
__EXPORT perf_counter_t perf_alloc_once(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.
__EXPORT void perf_set_elapsed(perf_counter_t handle, int64_t elapsed)
Register a measurement.
__EXPORT void perf_count(perf_counter_t handle)
Count a performance event.
__EXPORT void perf_print_all(int fd)
Print all of the performance counters.
__EXPORT void perf_reset(perf_counter_t handle)
Reset a performance counter.
measure the interval between instances of an event
__EXPORT void perf_free(perf_counter_t handle)
Free a counter.
const uint16_t latency_buckets[LATENCY_BUCKET_COUNT]