From c6ed26fca3dc6d4db1d596c2734a85aba4067552 Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Wed, 19 Feb 2025 11:30:47 +0100 Subject: [PATCH] Add a metric for rfsimulator channel emulator performance Add a print and method to calculate rfsimulators channel emulation performance. The counter unit is Megasample/second (Msps). --- radio/rfsimulator/simulator.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index ecf278ffd9..c733f4c8a2 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -1003,6 +1003,11 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest } while (have_to_wait); } + + struct timespec start_time; + int ret = clock_gettime(CLOCK_REALTIME, &start_time); + AssertFatal(ret == 0, "clock_gettime() failed: errno %d, %s\n", errno, strerror(errno)); + // Clear the output buffer for (int a=0; asample_rate / 1e6); + } + *ptimestamp = t->nextRxTstamp; // return the time of the first sample t->nextRxTstamp+=nsamps; LOG_D(HW,