#include <EvffedFillerRB.h>
Classes | |
union | Payload |
Public Member Functions | |
EvffedFillerRB (FUResourceBroker *rb) | |
unsigned int | fedId () const |
unsigned char *const | getPayload () |
uint32_t | getSize () |
void | putHeader (unsigned int l1id, unsigned int bxid) |
void | putTrailer () |
void | setEPProcessId (pid_t pid) |
void | setRBEventCount (uint32_t evtcnt) |
void | setRBTimeStamp (uint64_t ts) |
unsigned int | size () const |
Private Attributes | |
unsigned int | hostid_ |
Payload | payload_ |
Definition at line 29 of file EvffedFillerRB.h.
evf::EvffedFillerRB::EvffedFillerRB | ( | FUResourceBroker * | rb | ) | [inline] |
Definition at line 32 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asHWords, evf::EvffedFillerRB::Payload::asWords, evf::fedinterface::EVFFED_LENGTH, evf::fedinterface::EVFFED_RBIDENT_OFFSET, evf::fedinterface::EVFFED_RBINSTA_MASK, evf::fedinterface::EVFFED_RBINSTA_SHIFT, evf::fedinterface::EVFFED_RBPCIDE_MASK, evf::fedinterface::EVFFED_RBPCIDE_SHIFT, hostid_, i, evf::FUResourceBroker::instanceNumber(), AlCaHLTBitMon_ParallelJobs::p, and payload_.
{ for (unsigned int i = 0; i < fedinterface::EVFFED_LENGTH; i++) { *(payload_.asWords + i) = 0; } char hostname[32]; int retval = gethostname(hostname, 32); if (retval != 0) { hostid_ = 0xdead; } else { if (strtok(hostname, "-") == 0) hostid_ = 0xdead; char *p = strtok(0, "-"); // rack id long hostid = 0xdead; if (p != 0) hostid = strtol(p, 0, 16) << 8; p = strtok(0, "-"); // node id if (p == 0) hostid += 0xdead; else hostid += strtol(p, 0, 16); hostid_ = hostid; } *(payload_.asHWords + (fedinterface::EVFFED_RBIDENT_OFFSET/sizeof(uint32_t))) = ((hostid_ & fedinterface::EVFFED_RBPCIDE_MASK) << fedinterface::EVFFED_RBPCIDE_SHIFT) + ((rb->instanceNumber() & fedinterface::EVFFED_RBINSTA_MASK) << fedinterface::EVFFED_RBINSTA_SHIFT); }
unsigned int evf::EvffedFillerRB::fedId | ( | ) | const [inline] |
Definition at line 98 of file EvffedFillerRB.h.
References evf::fedinterface::EVFFED_ID.
Referenced by evf::FUResource::process().
{ return fedinterface::EVFFED_ID; }
unsigned char* const evf::EvffedFillerRB::getPayload | ( | ) | [inline] |
Definition at line 61 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asBytes, and payload_.
Referenced by evf::FUResource::process().
uint32_t evf::EvffedFillerRB::getSize | ( | ) | [inline] |
Definition at line 64 of file EvffedFillerRB.h.
References evf::fedinterface::EVFFED_TOTALSIZE.
{ return fedinterface::EVFFED_TOTALSIZE; }
void evf::EvffedFillerRB::putHeader | ( | unsigned int | l1id, |
unsigned int | bxid | ||
) | [inline] |
Definition at line 68 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asHWords, evf::fedinterface::EVFFED_ID, evf::fedinterface::EVFFED_VERSION, FED_BXID_INSERT, FED_EVTY_INSERT, FED_HCTRLID_INSERT, FED_LVL1_INSERT, FED_SOID_INSERT, FED_VERSION_INSERT, payload_, and evf::evtn::SLINK_HALFWORD_SIZE.
Referenced by evf::FUResource::process().
{ *(payload_.asHWords) = FED_SOID_INSERT(fedinterface::EVFFED_ID) + FED_VERSION_INSERT(fedinterface::EVFFED_VERSION); *(payload_.asHWords + (evtn::SLINK_HALFWORD_SIZE/sizeof(uint32_t))) = FED_HCTRLID_INSERT + FED_EVTY_INSERT(0x1) + FED_LVL1_INSERT(l1id) + FED_BXID_INSERT(bxid); }
void evf::EvffedFillerRB::putTrailer | ( | ) | [inline] |
Definition at line 77 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asBytes, evf::EvffedFillerRB::Payload::asHWords, evf::compute_crc(), evf::fedinterface::EVFFED_LENGTH, evf::fedinterface::EVFFED_TOTALSIZE, FED_CRCS_INSERT, FED_EVSZ_INSERT, FED_TCTRLID_INSERT, evf::evtn::FED_TRAILER_SIZE, payload_, and evf::evtn::SLINK_HALFWORD_SIZE.
Referenced by evf::FUResource::process().
{ uint32_t *fedtr_p = payload_.asHWords + ((fedinterface::EVFFED_TOTALSIZE - evtn::FED_TRAILER_SIZE)/sizeof(uint32_t)); *(fedtr_p + (evtn::SLINK_HALFWORD_SIZE/sizeof(uint32_t))) = FED_TCTRLID_INSERT + FED_EVSZ_INSERT(fedinterface::EVFFED_LENGTH); *(fedtr_p) = FED_CRCS_INSERT(compute_crc(payload_.asBytes,fedinterface::EVFFED_TOTALSIZE)); }
void evf::EvffedFillerRB::setEPProcessId | ( | pid_t | pid | ) | [inline] |
Definition at line 93 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asHWords, evf::fedinterface::EVFFED_EPIDENT_OFFSET, evf::fedinterface::EVFFED_EPPCIDE_MASK, evf::fedinterface::EVFFED_EPPCIDE_SHIFT, and payload_.
{ *(payload_.asHWords + (fedinterface::EVFFED_EPIDENT_OFFSET/sizeof(uint32_t))) = (pid & fedinterface::EVFFED_EPPCIDE_MASK) << fedinterface::EVFFED_EPPCIDE_SHIFT; }
void evf::EvffedFillerRB::setRBEventCount | ( | uint32_t | evtcnt | ) | [inline] |
Definition at line 88 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asHWords, evf::fedinterface::EVFFED_RBEVCNT_OFFSET, and payload_.
Referenced by evf::FUResourceQueue::buildResource().
{ *(payload_.asHWords + (fedinterface::EVFFED_RBEVCNT_OFFSET/sizeof(uint32_t))) = evtcnt; }
void evf::EvffedFillerRB::setRBTimeStamp | ( | uint64_t | ts | ) | [inline] |
Definition at line 84 of file EvffedFillerRB.h.
References evf::EvffedFillerRB::Payload::asWords, evf::fedinterface::EVFFED_RBWCTIM_OFFSET, and payload_.
Referenced by evf::FUResourceQueue::buildResource().
{ *(payload_.asWords + (fedinterface::EVFFED_RBWCTIM_OFFSET/sizeof(uint64_t))) = ts; }
unsigned int evf::EvffedFillerRB::size | ( | void | ) | const [inline] |
Definition at line 101 of file EvffedFillerRB.h.
References evf::fedinterface::EVFFED_TOTALSIZE.
Referenced by evf::FUResource::process().
{ return fedinterface::EVFFED_TOTALSIZE; }
unsigned int evf::EvffedFillerRB::hostid_ [private] |
Definition at line 111 of file EvffedFillerRB.h.
Referenced by EvffedFillerRB().
Payload evf::EvffedFillerRB::payload_ [private] |
Definition at line 110 of file EvffedFillerRB.h.
Referenced by EvffedFillerRB(), getPayload(), putHeader(), putTrailer(), setEPProcessId(), setRBEventCount(), and setRBTimeStamp().