Project
Loading...
Searching...
No Matches
ErrorCodes.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14namespace o2
15{
16namespace mch
17{
18namespace raw
19{
20
22{
23 return 16;
24}
25
26void append(const char* msg, std::string& to)
27{
28 std::string s = to.size() ? "& " + to : "";
29 s += msg;
30 if (to.size()) {
31 to += "& ";
32 }
33 to += msg;
34}
35
36std::string errorCodeAsString(uint32_t ec)
37{
38 std::string msg;
39
40 if (ec & ErrorParity) {
41 append("Parity", msg);
42 }
43 if (ec & ErrorHammingCorrectable) {
44 append("Hamming Correctable", msg);
45 }
47 append("Hamming Uncorrectable", msg);
48 }
49 if (ec & ErrorBadClusterSize) {
50 append("Cluster Size", msg);
51 }
52 if (ec & ErrorBadSyncPacket) {
53 append("Bad Sync Packet", msg);
54 }
56 append("Unexpected Sync", msg);
57 }
58 if (ec & ErrorBadHeartBeatPacket) {
59 append("Bad HB Packet", msg);
60 }
61 if (ec & ErrorBadDataPacket) {
62 append("Bad Data Packet", msg);
63 }
64 if (ec & ErrorBadIncompleteWord) {
65 append("Bad Incomplete Word", msg);
66 }
67 if (ec & ErrorTruncatedData) {
68 append("Truncated Data", msg);
69 }
70 if (ec & ErrorTruncatedDataUL) {
71 append("UL Truncated Data", msg);
72 }
73 if (ec & ErrorBadELinkID) {
74 append("Bad E-Link ID", msg);
75 }
76 if (ec & ErrorBadLinkID) {
77 append("Bad Link ID", msg);
78 }
79 if (ec & ErrorUnknownLinkID) {
80 append("Unknown Link ID", msg);
81 }
82 if (ec & ErrorBadHBTime) {
83 append("Bad HB Time", msg);
84 }
86 append("Non Recoverable", msg);
87 }
88 return msg;
89}
90
91} // namespace raw
92} // namespace mch
93} // namespace o2
uint32_t getErrorCodesSize()
@ ErrorHammingCorrectable
Definition ErrorCodes.h:27
@ ErrorHammingUncorrectable
Definition ErrorCodes.h:28
@ ErrorTruncatedDataUL
Definition ErrorCodes.h:35
@ ErrorBadHeartBeatPacket
Definition ErrorCodes.h:30
@ ErrorNonRecoverableDecodingError
Definition ErrorCodes.h:41
@ ErrorBadIncompleteWord
Definition ErrorCodes.h:33
@ ErrorBadClusterSize
Definition ErrorCodes.h:32
@ ErrorUnexpectedSyncPacket
Definition ErrorCodes.h:36
void append(const char *msg, std::string &to)
std::string errorCodeAsString(uint32_t code)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
uint64_t const void const *restrict const msg
Definition x9.h:153