Skip to content

Commit 9cf9a7c

Browse files
authored
Merge pull request #396 from sy-c/master
v0.40.0
2 parents 7522a90 + 08ddbf5 commit 9cf9a7c

File tree

14 files changed

+57
-36
lines changed

14 files changed

+57
-36
lines changed

doc/releaseNotes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ This file describes the main feature changes for released versions of ReadoutCar
1212

1313
## v0.39.1 - 16/11/2022
1414
- Fixed CRORC start-stop-start: fifo ready counters reset, emptying last page if unused, flush order on stop, release of unused pages in internal fifo.
15+
16+
## v0.40.0 - 08/12/2022
17+
- log messages level updated: moved all Ops messages to Devel. The calling layer is in charge to reporting high level operation messages.
18+
- superpage metadata: added link id.
19+
- added verbosity protection for "Empty counter of Superpage FIFO" warnings

include/ReadoutCard/Logger.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ constexpr auto endm = AliceO2::InfoLogger::InfoLogger::endm;
3030

3131
typedef AliceO2::InfoLogger::InfoLoggerContext ILContext;
3232
typedef AliceO2::InfoLogger::InfoLogger::InfoLoggerMessageOption ILMessageOption;
33+
typedef AliceO2::InfoLogger::InfoLogger::AutoMuteToken ILAutoMuteToken;
3334

3435
class Logger
3536
{

include/ReadoutCard/Superpage.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,23 @@ struct Superpage {
103103
mUserData = userData;
104104
}
105105

106+
/// Set the link id
107+
void setLink(int id = -1) {
108+
mLink = id;
109+
}
110+
111+
/// Get the link id
112+
int getLink() {
113+
return mLink;
114+
}
115+
106116
private:
107117
size_t mOffset = 0; ///< Offset from the start of the DMA buffer to the start of the superpage
108118
size_t mSize = 0; ///< Size of the superpage in bytes
109119
void* mUserData = nullptr; ///< Pointer that users can use for whatever, e.g. to associate data with the superpage
110120
size_t mReceived = 0; ///< Size of the received data in bytes
111121
bool mReady = false; ///< Indicates this superpage is ready
122+
int mLink = -1; ///< The link producing the data
112123
};
113124

114125
} // namespace roc

src/BarInterfaceBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class BarInterfaceBase : public BarInterface
129129
std::shared_ptr<Pda::PdaBar> mPdaBar;
130130

131131
/// Convenience function for InfoLogger
132-
void log(const std::string& logMessage, ILMessageOption = LogInfoOps);
132+
void log(const std::string& logMessage, ILMessageOption = LogInfoDevel);
133133

134134
private:
135135
/// Inheriting classes must implement this to check whether a given read is safe.

src/CommandLineUtilities/ProgramCleanup.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ProgramCleanup : public Program
8282
return {};
8383
};
8484

85-
Logger::get() << "`roc-cleanup` execution initiated by " << getUsername() << LogDebugOps_(4700) << endm;
85+
Logger::get() << "`roc-cleanup` execution initiated by " << getUsername() << LogDebugDevel_(4700) << endm;
8686

8787
// Take and hold DMA locks during cleanup
8888
std::vector<std::unique_ptr<Interprocess::Lock>> dmaLocks;
@@ -127,7 +127,7 @@ class ProgramCleanup : public Program
127127
sysCheckRet("modprobe uio_pci_dma");
128128
}
129129

130-
Logger::get() << "`roc-cleanup` execution finished" << LogDebugOps_(4710) << endm;
130+
Logger::get() << "`roc-cleanup` execution finished" << LogDebugDevel_(4710) << endm;
131131
return;
132132
}
133133

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class ProgramConfig : public Program
395395
std::stringstream ss;
396396
ss << report;
397397
while (std::getline(ss, line)) {
398-
theLog << LogInfoSupport_(4805) << line << InfoLogger::endm;
398+
theLog << LogInfoDevel_(4805) << line << InfoLogger::endm;
399399
}
400400
} else {
401401
FILE* fp = fopen(fileName.c_str(), fileMode);
@@ -419,10 +419,10 @@ class ProgramConfig : public Program
419419

420420
// Configure all cards found - Normally used during boot
421421
if (mOptions.configAll) {
422-
Logger::get() << "Running RoC Configuration for all cards" << LogInfoOps_(4600) << endm;
422+
Logger::get() << "Running RoC Configuration for all cards" << LogInfoDevel_(4600) << endm;
423423
std::vector<CardDescriptor> cardsFound;
424424
if (mOptions.configUri == "") {
425-
Logger::get() << "A configuration URI is necessary with the startup-config flag set" << LogErrorOps_(4600) << endm;
425+
Logger::get() << "A configuration URI is necessary with the startup-config flag set" << LogErrorDevel_(4600) << endm;
426426
return;
427427
}
428428

@@ -436,9 +436,9 @@ class ProgramConfig : public Program
436436
CardConfigurator(card.pciAddress, mOptions.configUri, mOptions.forceConfig);
437437
reportStatus(card.pciAddress);
438438
} catch (const std::runtime_error& e) {
439-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
439+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
440440
} catch (const Exception& e) {
441-
Logger::get() << boost::diagnostic_information(e) << LogErrorOps_(4600) << endm;
441+
Logger::get() << boost::diagnostic_information(e) << LogErrorDevel_(4600) << endm;
442442
}
443443
}
444444
}
@@ -451,7 +451,7 @@ class ProgramConfig : public Program
451451
try {
452452
FirmwareChecker().checkFirmwareCompatibility(cardId);
453453
} catch (const Exception& e) {
454-
Logger::get() << boost::diagnostic_information(e) << LogErrorOps_(4600) << endm;
454+
Logger::get() << boost::diagnostic_information(e) << LogErrorDevel_(4600) << endm;
455455
throw;
456456
}
457457
}
@@ -523,35 +523,35 @@ class ProgramConfig : public Program
523523
return;
524524
}
525525

526-
Logger::get() << "Configuring card " << cardId << " with command line arguments" << LogDebugOps_(4600) << endm;
526+
Logger::get() << "Configuring card " << cardId << " with command line arguments" << LogDebugDevel_(4600) << endm;
527527
if (mOptions.forceConfig) {
528-
Logger::get() << "`--force` enabled" << LogDebugOps_(4600) << endm;
528+
Logger::get() << "`--force` enabled" << LogDebugDevel_(4600) << endm;
529529
}
530530

531531
try {
532532
CardConfigurator(params, mOptions.forceConfig);
533533
reportStatus(cardId);
534534
} catch (const std::runtime_error& e) {
535-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
535+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
536536
throw;
537537
} catch (const Exception& e) {
538-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
538+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
539539
throw;
540540
}
541541
} else {
542-
Logger::get() << "Configuring card " << cardId << " with config uri: " << mOptions.configUri << LogDebugOps_(4600) << endm;
542+
Logger::get() << "Configuring card " << cardId << " with config uri: " << mOptions.configUri << LogDebugDevel_(4600) << endm;
543543
if (mOptions.forceConfig) {
544-
Logger::get() << "`--force` enabled" << LogDebugOps_(4600) << endm;
544+
Logger::get() << "`--force` enabled" << LogDebugDevel_(4600) << endm;
545545
}
546546

547547
try {
548548
CardConfigurator(cardId, mOptions.configUri, mOptions.forceConfig);
549549
reportStatus(cardId);
550550
} catch (const std::runtime_error& e) {
551-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
551+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
552552
throw;
553553
} catch (const Exception& e) {
554-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
554+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
555555
throw;
556556
}
557557
}

src/CommandLineUtilities/ProgramCtpEmulator.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ class ProgramCtpEmulator : public Program
8484

8585
CardType::type cardType = bar2->getCardType();
8686
if (cardType == CardType::type::Crorc) {
87-
Logger::get() << "CRORC not supported" << LogErrorOps_(4803) << endm;
87+
Logger::get() << "CRORC not supported" << LogErrorDevel_(4803) << endm;
8888
return;
8989
} else if (cardType != CardType::type::Cru) {
90-
Logger::get() << "Invalid card type" << LogErrorOps_(4804) << endm;
90+
Logger::get() << "Invalid card type" << LogErrorDevel_(4804) << endm;
9191
return;
9292
}
9393

src/CommandLineUtilities/ProgramLoopback.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ProgramLoopback : public Program
9999
auto cardType = card.cardType;
100100

101101
if (cardType == CardType::type::Crorc) {
102-
Logger::get() << "CRORC not supported" << LogErrorOps << endm;
102+
Logger::get() << "CRORC not supported" << LogErrorDevel << endm;
103103
} else if (cardType == CardType::type::Cru) {
104104
if (mOptions.expertView) {
105105
formatHeader = " %-9s %-10s %-19s %-16s %-12s %-21s %-17s\n";

src/Crorc/CrorcBar.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ int CrorcBar::getEndpointNumber()
106106

107107
void CrorcBar::configure(bool /*force*/)
108108
{
109-
log("Configuring...", LogInfoOps_(4650));
109+
log("Configuring...", LogInfoDevel_(4650));
110110

111111
// enable laser
112112
log("Enabling the laser", LogInfoDevel_(4651));
@@ -127,7 +127,7 @@ void CrorcBar::configure(bool /*force*/)
127127
log("Configuring Time Frame detection", LogInfoDevel_(4655));
128128
setTimeFrameDetectionEnabled(mTimeFrameDetectionEnabled);
129129

130-
log("CRORC configuration done", LogInfoOps_(4656));
130+
log("CRORC configuration done", LogInfoDevel_(4656));
131131
}
132132

133133
Crorc::ReportInfo CrorcBar::report(bool forConfig)

src/Crorc/CrorcDmaChannel.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void CrorcDmaChannel::deviceStartDma()
133133
// needed to wait a bit FEE
134134
std::this_thread::sleep_for(100ms);
135135

136-
log("DMA started", LogInfoOps_(4303));
136+
log("DMA started", LogInfoDevel_(4303));
137137
}
138138

139139
void CrorcDmaChannel::deviceStopDma()

0 commit comments

Comments
 (0)