Skip to content

Commit 0620ee1

Browse files
committed
[status,metrics,pkt-monitor] Suppres bad card state output
1 parent 47e1403 commit 0620ee1

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/CommandLineUtilities/ProgramMetrics.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class ProgramMetrics : public Program
9696
float localClock = bar2->getLocalClock() / 1e6;
9797
uint32_t totalPacketsPerSecond = bar2->getTotalPacketsPerSecond(bar0->getEndpointNumber());
9898

99+
if (card.serialId.getSerial() == 0x7fffffff || card.serialId.getSerial() == 0x0) {
100+
std::cout << "Bad serial reported, bad card state, exiting" << std::endl;
101+
return;
102+
}
103+
99104
if (mOptions.monitoring) {
100105
monitoring->send(Metric{ "card" }
101106
.addValue(card.pciAddress.toString(), "pciAddress")

src/CommandLineUtilities/ProgramPacketMonitor.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ class ProgramPacketMonitor : public Program
6969
monitoring = MonitoringFactory::Get(getMonitoringUri());
7070
}
7171

72+
if (card.serialId.getSerial() == 0x7fffffff || card.serialId.getSerial() == 0x0) {
73+
std::cout << "Bad serial reported, bad card state, exiting" << std::endl;
74+
return;
75+
}
76+
7277
if (cardType == CardType::type::Crorc) {
7378

7479
/* HEADER */

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ class ProgramStatus : public Program
103103
std::string offset = reportInfo.dynamicOffset ? "Dynamic" : "Fixed";
104104
std::string timeFrameDetectionEnabled = reportInfo.timeFrameDetectionEnabled ? "Enabled" : "Disabled";
105105

106+
if (card.serialId.getSerial() == 0x7fffffff || card.serialId.getSerial() == 0x0) {
107+
std::cout << "Bad serial reported, bad card state, exiting" << std::endl;
108+
return;
109+
}
110+
106111
/* GENERAL PARAMETERS */
107112
if (mOptions.monitoring) {
108113
monitoring->send(Metric{ "CRORC" }

0 commit comments

Comments
 (0)