Skip to content

Commit

Permalink
[Server] Fixes #345 - add sid to TOD structure (ABI compliant).
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Apr 22, 2016
1 parent 4179c70 commit c950fa7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/XrdXrootd/XrdXrootdMonData.hh
Expand Up @@ -183,8 +183,10 @@ struct XrdXrootdMonFileTOD
XrdXrootdMonFileHdr Hdr; // 8
int tBeg; // time(0) of following record
int tEnd; // time(0) when packet was sent
kXR_int64 sID; // Server id in lower 48 bits
};


// The following variable length structure exists in XrdXrootdMonFileOPN if
// "lfn" has been specified. It exists only when recFlag & hasLFN is TRUE.
// The user's dictid will be zero (missing) if user monitoring is not enabled.
Expand Down
12 changes: 11 additions & 1 deletion src/XrdXrootd/XrdXrootdMonFile.cc
Expand Up @@ -38,6 +38,15 @@
#include "XrdXrootd/XrdXrootdMonFile.hh"
#include "XrdXrootd/XrdXrootdFileStats.hh"

/******************************************************************************/
/* G l o b a l s */
/******************************************************************************/

namespace XrdXrootdMonInfo
{
extern long long mySID;
}

/******************************************************************************/
/* S t a t i c M e m b e r s */
/******************************************************************************/
Expand Down Expand Up @@ -71,7 +80,7 @@ char XrdXrootdMonFile::fsOPS = 0;
char XrdXrootdMonFile::fsSSQ = 0;
char XrdXrootdMonFile::fsXFR = 0;
char XrdXrootdMonFile::crecFlag = 0;

/******************************************************************************/
/* C l o s e */
/******************************************************************************/
Expand Down Expand Up @@ -338,6 +347,7 @@ bool XrdXrootdMonFile::Init(XrdScheduler *sp, XrdSysError *errp, int bfsz)
repTOD->Hdr.recType = XrdXrootdMonFileHdr::isTime;
repTOD->Hdr.recFlag = 0;
repTOD->Hdr.recSize = htons(sizeof(XrdXrootdMonFileTOD));
repTOD->sID = static_cast<kXR_int64>(XrdXrootdMonInfo::mySID);

// Establish first real record in the buffer (always fixed)
//
Expand Down
8 changes: 7 additions & 1 deletion src/XrdXrootd/XrdXrootdMonitor.cc
Expand Up @@ -88,7 +88,6 @@ int XrdXrootdMonitor::rdrTOD = 0;
int XrdXrootdMonitor::rdrWin = 0;
int XrdXrootdMonitor::rdrNum = 3;
kXR_int32 XrdXrootdMonitor::sizeWindow = 60;
long long XrdXrootdMonitor::mySID = 0;
char XrdXrootdMonitor::sidName[16]= {0};
short XrdXrootdMonitor::sidSize = 0;
char XrdXrootdMonitor::monINFO = 0;
Expand All @@ -107,6 +106,13 @@ char XrdXrootdMonitor::monCLOCK = 0;

extern XrdOucTrace *XrdXrootdTrace;

namespace XrdXrootdMonInfo
{
long long mySID = 0;
}

using namespace XrdXrootdMonInfo;

/******************************************************************************/
/* L o c a l D e f i n e s */
/******************************************************************************/
Expand Down
1 change: 0 additions & 1 deletion src/XrdXrootd/XrdXrootdMonitor.hh
Expand Up @@ -256,7 +256,6 @@ static int isEnabled;
static int numMonitor;
static int monIdent;
static int monRlen;
static long long mySID;
static char sidName[16];
static short sidSize;
static char monIO;
Expand Down

0 comments on commit c950fa7

Please sign in to comment.