aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-08-29 13:19:12 +0400
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-08-29 13:19:12 +0400
commit4c192001fcc925dd25613c660b03c3d681946fad (patch)
treeaaef51213a324f1ed5f509986167c280fc6e801e
parent1339e427e1d2fd87601214cfeb662cf4659546a9 (diff)
Debug: More real-time instrumentation.
-rw-r--r--Transceiver52M/DriveLoop.cpp1
-rw-r--r--Transceiver52M/UHDDevice.cpp25
-rw-r--r--Transceiver52M/multiTRX.cpp1
-rw-r--r--Transceiver52M/radioInterface.cpp17
-rw-r--r--Transceiver52M/radioVector.cpp1
5 files changed, 38 insertions, 7 deletions
diff --git a/Transceiver52M/DriveLoop.cpp b/Transceiver52M/DriveLoop.cpp
index 533de0c..b35810c 100644
--- a/Transceiver52M/DriveLoop.cpp
+++ b/Transceiver52M/DriveLoop.cpp
@@ -26,7 +26,6 @@
#include "DriveLoop.h"
#include <Logger.h>
#include "RTMD.h"
-#define WITH_RTMD
using namespace GSM;
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index fe865d2..6501804 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -28,6 +28,7 @@
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/msg.hpp>
+#include "RTMD.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -788,14 +789,19 @@ int uhd_device::readSamples(short **buf, int chans, int len,
ssize_t rc;
uhd::time_spec_t ts;
uhd::rx_metadata_t metadata;
+ RTMD_SET("readSamples");
if (skip_rx) {
LOG(INFO) << "Skipping Rx";
+ RTMD_VAL("readSamples", -1);
+ RTMD_CLEAR("readSamples");
return 0;
}
if (chans != NUM_RX_CHANS) {
LOG(ERR) << "Number of requested channels does not match build";
+ RTMD_VAL("readSamples", -2);
+ RTMD_CLEAR("readSamples");
return -1;
}
@@ -810,6 +816,8 @@ int uhd_device::readSamples(short **buf, int chans, int len,
if (rc < 0) {
LOG(ERR) << rx_smpl_buf[0]->str_code(rc);
LOG(ERR) << rx_smpl_buf[0]->str_status();
+ RTMD_VAL("readSamples", -3);
+ RTMD_CLEAR("readSamples");
return 0;
}
@@ -852,8 +860,11 @@ int uhd_device::readSamples(short **buf, int chans, int len,
if ((rc < 0)) {
LOG(ERR) << rx_smpl_buf[i]->str_code(rc);
LOG(ERR) << rx_smpl_buf[i]->str_status();
- if (rc != smpl_buf::ERROR_OVERFLOW)
+ if (rc != smpl_buf::ERROR_OVERFLOW) {
+ RTMD_VAL("readSamples", -4);
+ RTMD_CLEAR("readSamples");
return 0;
+ }
}
}
}
@@ -864,10 +875,14 @@ int uhd_device::readSamples(short **buf, int chans, int len,
if ((rc < 0) || (rc != len)) {
LOG(ERR) << rx_smpl_buf[i]->str_code(rc);
LOG(ERR) << rx_smpl_buf[i]->str_status();
+ RTMD_VAL("readSamples", -5);
+ RTMD_CLEAR("readSamples");
return 0;
}
}
+ RTMD_VAL("readSamples", len);
+ RTMD_CLEAR("readSamples");
return len;
}
@@ -875,6 +890,8 @@ int uhd_device::writeSamples(short **buf, int chans, int len,
TIMESTAMP timestamp, bool *underrun,
bool isControl)
{
+ RTMD_SET("writeSamples");
+
uhd::tx_metadata_t metadata;
metadata.has_time_spec = true;
metadata.start_of_burst = false;
@@ -884,6 +901,8 @@ int uhd_device::writeSamples(short **buf, int chans, int len,
// No control packets
if (isControl) {
LOG(ERR) << "Control packets not supported";
+ RTMD_VAL("writeSamples", -1);
+ RTMD_CLEAR("writeSamples");
return 0;
}
@@ -897,6 +916,8 @@ int uhd_device::writeSamples(short **buf, int chans, int len,
metadata.end_of_burst = true;
} else if (drop_cnt < 30) {
LOG(DEBUG) << "Aligning transmitter: packet advance";
+ RTMD_VAL("writeSamples", -2);
+ RTMD_CLEAR("writeSamples");
return len;
} else {
LOG(DEBUG) << "Aligning transmitter: start burst";
@@ -918,6 +939,8 @@ int uhd_device::writeSamples(short **buf, int chans, int len,
exit(-1);
}
+ RTMD_VAL("writeSamples", num_smpls);
+ RTMD_CLEAR("writeSamples");
return num_smpls;
}
diff --git a/Transceiver52M/multiTRX.cpp b/Transceiver52M/multiTRX.cpp
index 1a88ec2..5cbf426 100644
--- a/Transceiver52M/multiTRX.cpp
+++ b/Transceiver52M/multiTRX.cpp
@@ -26,7 +26,6 @@
#include "Transceiver.h"
#include "radioDevice.h"
#include "RTMD.h"
-#define WITH_RTMD
ConfigurationTable gConfig("/etc/OpenBTS/OpenBTS.db");
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index 31d67ce..4fcb28d 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -25,7 +25,6 @@
#include "radioInterface.h"
#include <Logger.h>
#include "RTMD.h"
-#define WITH_RTMD
bool started = false;
@@ -206,9 +205,13 @@ void RadioInterface::alignRadio() {
void RadioInterface::driveTransmitRadio(signalVector **radioBurst, bool *zeroBurst)
{
int i;
+ RTMD_SET("drvTxRadio");
- if (!mOn)
+ if (!mOn) {
+ RTMD_VAL("drvTxRadio", -1);
+ RTMD_CLEAR("drvTxRadio");
return;
+ }
for (i = 0; i < mChanM; i++) {
radioifyVector(*radioBurst[i], sendBuffer[i] + 2 * sendCursor,
@@ -222,6 +225,7 @@ void RadioInterface::driveTransmitRadio(signalVector **radioBurst, bool *zeroBur
sendCursor += radioBurst[0]->size();
pushBuffer();
+ RTMD_CLEAR("drvTxRadio");
}
static inline void shiftRxBuffers(float **buf, int offset, int len, int chanM)
@@ -329,6 +333,7 @@ void RadioInterface::close()
void RadioInterface::pullBuffer()
{
bool local_underrun;
+ RTMD_SET("RIPullBuff");
/* Read samples. Fail if we don't get what we want. */
int num_rd = mRadio->readSamples(rx_buf, mChanM, OUTCHUNK, readTimestamp);
@@ -343,13 +348,18 @@ void RadioInterface::pullBuffer()
shortToFloat(rcvBuffer[i] + 2 * rcvCursor, rx_buf[i], num_rd);
rcvCursor += num_rd;
+ RTMD_CLEAR("RIPullBuff");
}
/* Send timestamped chunk to the device with arbitrary size */
void RadioInterface::pushBuffer()
{
- if (sendCursor < INCHUNK)
+ RTMD_SET("RIPushBuff");
+ if (sendCursor < INCHUNK) {
+ RTMD_VAL("RIPushBuff", -1);
+ RTMD_CLEAR("RIPushBuff");
return;
+ }
for (int i = 0; i < mChanM; i++)
floatToShort(tx_buf[i], sendBuffer[i], sendCursor);
@@ -361,4 +371,5 @@ void RadioInterface::pushBuffer()
writeTimestamp += (TIMESTAMP) num_smpls;
sendCursor = 0;
+ RTMD_CLEAR("RIPushBuff");
}
diff --git a/Transceiver52M/radioVector.cpp b/Transceiver52M/radioVector.cpp
index 0e030be..56abccd 100644
--- a/Transceiver52M/radioVector.cpp
+++ b/Transceiver52M/radioVector.cpp
@@ -21,7 +21,6 @@
#include "radioVector.h"
#include "RTMD.h"
-#define WITH_RTMD
radioVector::radioVector(const signalVector& wVector, GSM::Time& wTime)
: signalVector(wVector), mTime(wTime)