Skip to content

Commit

Permalink
xrdsut: add (default) option to dump only active buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
gganis committed Dec 21, 2018
1 parent 9ef99c6 commit 5e7a5e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions src/XrdSut/XrdSutBuffer.cc
Expand Up @@ -237,9 +237,10 @@ int XrdSutBuffer::UpdateBucket(XrdOucString s, int ty)
}

//_____________________________________________________________________________
void XrdSutBuffer::Dump(const char *stepstr)
void XrdSutBuffer::Dump(const char *stepstr, bool all)
{
// Dump content of buffer
// Dump content of buffer. If all is false, only active buckets are dumped;
// this is the default behaviour.
EPNAME("Buffer::Dump");

PRINT("//-----------------------------------------------------//");
Expand All @@ -262,18 +263,25 @@ void XrdSutBuffer::Dump(const char *stepstr)
} else {
PRINT("// Step : " <<fStep);
}
PRINT("// # of buckets : " <<nbuck);
if (!all) {
PRINT("// Dumping active buckets only ");
} else {
PRINT("// # of buckets : " <<nbuck);
}
PRINT("// ");

int kb = 0;
XrdSutBucket *bp = fBuckets.Begin();
while (bp) {
PRINT("// ");
PRINT("// buck: " <<kb++);
bp->Dump(0);
if (all || bp->type != kXRS_inactive) {
PRINT("// buck: " <<kb++);
bp->Dump(0);
}
// Get next
bp = fBuckets.Next();
}
if (!all) PRINT("// # active buckets found: " << kb);
PRINT("// //")
PRINT("//-----------------------------------------------------//");
}
Expand Down
2 changes: 1 addition & 1 deletion src/XrdSut/XrdSutBuffer.hh
Expand Up @@ -71,7 +71,7 @@ public:
// Remove from the list, to avoid destroy by ~XrdSutBuffer
void Remove(XrdSutBucket *b) { fBuckets.Remove(b); }

void Dump(const char *stepstr = 0);
void Dump(const char *stepstr = 0, bool all = false);
void Message(const char *prepose = 0);
int Serialized(char **buffer, char opt = 'n');

Expand Down

0 comments on commit 5e7a5e6

Please sign in to comment.