aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/test
diff options
context:
space:
mode:
authorTom Jones <thj@freebsd.org>2024-01-25 10:28:16 +0000
committerDamjan Marion <dmarion@0xa5.net>2024-02-13 16:28:51 +0000
commit7ec62fb0cd8c4d794d6f22ccc2fe8dae672a63a6 (patch)
tree44c2f4c9c9369d18f05360390ca73365260280c3 /src/vppinfra/test
parenta0b85388377913118ee8437ee23ab3d1ff4bee99 (diff)
vppinfra: Put clib_perf* behind Linux checks and provide stubs for FreeBSD
As a placeholder stub out clib_perf functions on FreeBSD, the interface for performance counters on FreeBSD is different and will require its own implementation. Type: improvement Change-Id: I61511ebe5ee1fd6fe93d3179c7843c811f47a846 Signed-off-by: Tom Jones <thj@freebsd.org>
Diffstat (limited to 'src/vppinfra/test')
-rw-r--r--src/vppinfra/test/test.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vppinfra/test/test.h b/src/vppinfra/test/test.h
index a0e5f6db669..8d756366163 100644
--- a/src/vppinfra/test/test.h
+++ b/src/vppinfra/test/test.h
@@ -84,6 +84,7 @@ extern test_main_t test_main;
__VA_ARGS__, {} \
}
+#ifdef __linux__
static_always_inline void
test_perf_event_reset (test_perf_t *t)
{
@@ -99,6 +100,23 @@ test_perf_event_disable (test_perf_t *t)
{
clib_perfmon_ioctl (t->fd, PERF_EVENT_IOC_DISABLE);
}
+#elif __FreeBSD__
+static_always_inline void
+test_perf_event_reset (test_perf_t *t)
+{
+ /* TODO: Implement for FreeBSD */
+}
+static_always_inline void
+test_perf_event_enable (test_perf_t *t)
+{
+ /* TODO: Implement for FreeBSD */
+}
+static_always_inline void
+test_perf_event_disable (test_perf_t *t)
+{
+ /* TODO: Implement for FreeBSD */
+}
+#endif
void *test_mem_alloc (uword size);
void *test_mem_alloc_and_fill_inc_u8 (uword size, u8 start, u8 mask);