platforms: consolidate latency_buckets

These symbols were duplicated all over the place.
This commit is contained in:
Julian Oes
2018-12-22 10:32:18 +01:00
parent b13600ed1a
commit d75389b2e4
7 changed files with 13 additions and 39 deletions
+5 -5
View File
@@ -48,6 +48,11 @@
#include "perf_counter.h"
/* latency histogram */
__EXPORT const uint16_t latency_bucket_count = LATENCY_BUCKET_COUNT;
__EXPORT const uint16_t latency_buckets[LATENCY_BUCKET_COUNT] = { 1, 2, 5, 10, 20, 50, 100, 1000 };
__EXPORT uint32_t latency_counters[LATENCY_BUCKET_COUNT + 1];
#ifdef __PX4_QURT
// There is presumably no dprintf on QURT. Therefore use the usual output to mini-dm.
@@ -597,11 +602,6 @@ perf_print_all(int fd)
pthread_mutex_unlock(&perf_counters_mutex);
}
// these are defined in drv_hrt.c
extern const uint16_t latency_bucket_count;
extern uint32_t latency_counters[];
extern const uint16_t latency_buckets[];
void
perf_print_latency(int fd)
{
+6
View File
@@ -42,6 +42,12 @@
#include <stdint.h>
#include <px4_defines.h>
#define LATENCY_BUCKET_COUNT 8
extern const uint16_t latency_bucket_count;
extern const uint16_t latency_buckets[LATENCY_BUCKET_COUNT];
extern uint32_t latency_counters[LATENCY_BUCKET_COUNT + 1];
/**
* Counter types.
*/