diff --git a/src/XrdXrootd/XrdXrootdConfig.cc b/src/XrdXrootd/XrdXrootdConfig.cc index 1ec85bf746e..c5735efb9c1 100644 --- a/src/XrdXrootd/XrdXrootdConfig.cc +++ b/src/XrdXrootd/XrdXrootdConfig.cc @@ -1345,6 +1345,7 @@ int XrdXrootdProtocol::xlog(XrdOucStream &Config) Purpose: Parse directive: monitor [all] [auth] [flush [io] ] [fstat [lfn] [ops] [ssq] [xfr ] + [fbuff ] [ident ] [mbuff ] [rbuff ] [rnums ] [window ] dest [Events] @@ -1362,6 +1363,7 @@ int XrdXrootdProtocol::xlog(XrdOucStream &Config) ssq - computes the sum of squares for the ops rec xfr - inserts i/o stats for open files every *. Minimum is 1. + fbsz size of message buffer for file stream monitoring. ident time (seconds, M, H) between identification records. mbuff size of message buffer for event trace monitoring. rbuff size of message buffer for redirection monitoring. @@ -1389,7 +1391,7 @@ int XrdXrootdProtocol::xmon(XrdOucStream &Config) }; char *val = 0, *cp, *monDest[2] = {0, 0}; long long tempval; - int i, monFlash = 0, monFlush=0, monMBval=0, monRBval=0, monWWval=0; + int i, monFlash = 0, monFlush=0, monMBval=0, monRBval=0, monWWval=0, monFbsz=0; int monIdent = 3600, xmode=0, monMode[2] = {0, 0}, mrType, *flushDest; int monRnums = 0, monFSint = 0, monFSopt = 0, monFSion = 0; int haveWord = 0; @@ -1441,6 +1443,15 @@ int XrdXrootdProtocol::xmon(XrdOucStream &Config) if (mrType) monRBval = static_cast(tempval); else monMBval = static_cast(tempval); } + else if (!strcmp("fbsz", val)) + {if (!(val = Config.GetWord())) + {eDest.Emsg("Config", "monitor fbsz value not specified"); + return 1; + } + if (XrdOuca2x::a2sz(eDest,"monitor fbsz", val, + &tempval, 1024, 65472)) return 1; + monFbsz = static_cast(tempval); + } else if (!strcmp("ident", val)) {if (!(val = Config.GetWord())) {eDest.Emsg("Config", "monitor ident value not specified"); @@ -1528,7 +1539,7 @@ int XrdXrootdProtocol::xmon(XrdOucStream &Config) // Set the monitor defaults // XrdXrootdMonitor::Defaults(monMBval, monRBval, monWWval, - monFlush, monFlash, monIdent, monRnums, + monFlush, monFlash, monIdent, monRnums, monFbsz, monFSint, monFSopt, monFSion); if (monDest[0]) monMode[0] |= (monMode[0] ? xmode : XROOTD_MON_FILE|xmode); diff --git a/src/XrdXrootd/XrdXrootdMonFile.cc b/src/XrdXrootd/XrdXrootdMonFile.cc index dbe63106bf3..00d04e6c36c 100644 --- a/src/XrdXrootd/XrdXrootdMonFile.cc +++ b/src/XrdXrootd/XrdXrootdMonFile.cc @@ -71,6 +71,7 @@ int XrdXrootdMonFile::repTime = 0; int XrdXrootdMonFile::fmHWM =-1; int XrdXrootdMonFile::crecSize = 0; int XrdXrootdMonFile::xfrCnt = 0; +int XrdXrootdMonFile::fBsz = 65472; int XrdXrootdMonFile::xfrRem = 0; XrdXrootdMonFileXFR XrdXrootdMonFile::xfrRec; short XrdXrootdMonFile::crecNLen = 0; @@ -174,7 +175,7 @@ void XrdXrootdMonFile::Close(XrdXrootdFileStats *fsP, bool isDisc) /* D e f a u l t s */ /******************************************************************************/ -void XrdXrootdMonFile::Defaults(int intv, int opts, int xfrcnt) +void XrdXrootdMonFile::Defaults(int intv, int opts, int xfrcnt, int fbsz) { // Set the reporting interval and I/O counter @@ -182,6 +183,7 @@ void XrdXrootdMonFile::Defaults(int intv, int opts, int xfrcnt) repTime = intv; xfrCnt = xfrcnt; xfrRem = xfrcnt; + fBsz = (fbsz <= 0 ? 65472 : fbsz); // Expand out the options // @@ -319,15 +321,15 @@ void XrdXrootdMonFile::DoXFR(XrdXrootdFileStats *fsP) /* I n i t */ /******************************************************************************/ -bool XrdXrootdMonFile::Init(int bfsz) +bool XrdXrootdMonFile::Init() { XrdXrootdMonFile *mfP; int alignment, pagsz = getpagesize(); // Allocate a socket buffer // - alignment = (bfsz < pagsz ? 1024 : pagsz); - if (posix_memalign((void **)&repBuff, alignment, bfsz)) + alignment = (fBsz < pagsz ? 1024 : pagsz); + if (posix_memalign((void **)&repBuff, alignment, fBsz)) {XrdXrootdMonInfo::eDest->Emsg("MonFile", "Unable to allocate monitor buffer."); return false; } @@ -353,7 +355,7 @@ bool XrdXrootdMonFile::Init(int bfsz) // Calculate the end nut the next slot always starts with a null pointer // - repLast = repBuff+bfsz-1; + repLast = repBuff+fBsz-1; repNext = 0; // Calculate the close record size and the initial flags diff --git a/src/XrdXrootd/XrdXrootdMonFile.hh b/src/XrdXrootd/XrdXrootdMonFile.hh index 62ab8a5a8bf..fc5fad2e0f0 100644 --- a/src/XrdXrootd/XrdXrootdMonFile.hh +++ b/src/XrdXrootd/XrdXrootdMonFile.hh @@ -45,13 +45,13 @@ public: static void Close(XrdXrootdFileStats *fsP, bool isDisc=false); -static void Defaults(int intv, int opts, int iocnt); +static void Defaults(int intv, int opts, int iocnt, int fbsz); static void Disc(unsigned int usrID); void DoIt(); -static bool Init(int bfsz=65472); +static bool Init(); static void Open(XrdXrootdFileStats *fsP, const char *Path, unsigned int uDID, bool isRW); @@ -83,6 +83,7 @@ static int repTime; static int fmHWM; static int crecSize; static int xfrCnt; +static int fBsz; static int xfrRem; static XrdXrootdMonFileXFR xfrRec; static short crecNLen; diff --git a/src/XrdXrootd/XrdXrootdMonitor.cc b/src/XrdXrootd/XrdXrootdMonitor.cc index 66b859f1384..3f8d356383d 100644 --- a/src/XrdXrootd/XrdXrootdMonitor.cc +++ b/src/XrdXrootd/XrdXrootdMonitor.cc @@ -452,7 +452,7 @@ void XrdXrootdMonitor::Defaults(char *dest1, int mode1, char *dest2, int mode2) void XrdXrootdMonitor::Defaults(int msz, int rsz, int wsz, int flush, int flash, int idt, int rnm, - int fsint, int fsopt, int fsion) + int fbsz, int fsint, int fsopt, int fsion) { // Set default window size and flush time @@ -467,7 +467,7 @@ void XrdXrootdMonitor::Defaults(int msz, int rsz, int wsz, // Set the fstat defaults // - XrdXrootdMonFile::Defaults(fsint, fsopt, fsion); + XrdXrootdMonFile::Defaults(fsint, fsopt, fsion, fbsz); monFSTAT = fsint != 0; // Set default monitor buffer size diff --git a/src/XrdXrootd/XrdXrootdMonitor.hh b/src/XrdXrootd/XrdXrootdMonitor.hh index 04557960be8..7ba3a9883ab 100644 --- a/src/XrdXrootd/XrdXrootdMonitor.hh +++ b/src/XrdXrootd/XrdXrootdMonitor.hh @@ -114,7 +114,7 @@ inline void Add_wr(kXR_unt32 dictid, static void Defaults(char *dest1, int m1, char *dest2, int m2); static void Defaults(int msz, int rsz, int wsz, int flush, int flash, int iDent, int rnm, - int fsint=0, int fsopt=0, int fsion=0); + int fbsz, int fsint=0, int fsopt=0, int fsion=0); static int Flushing() {return autoFlush;}