Skip to content

Commit

Permalink
Have verbose print for version 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja committed Aug 30, 2016
1 parent 072c2cf commit 54400ca
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/XrdFileCache/XrdFileCachePrint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ void Print::printFile(const std::string& path)
}

if (cfi.GetVersion() < 0) {
// Top level info file for file block mode
printf("version == %d, fileSize %lld, bufferSize %lld \n",
abs(cfi.GetVersion()), cfi.GetFileSize(),cfi.GetBufferSize());
// Top level info file for file block mode
printf("version == %d, fileSize %lld, bufferSize %lld \n",
abs(cfi.GetVersion()), cfi.GetFileSize(),cfi.GetBufferSize());
}
else {
int cntd = 0;
Expand All @@ -92,24 +92,25 @@ void Print::printFile(const std::string& path)
printf("version == %d, fileSize %lld, bufferSize %lld nBlocks %d nDownloaded %d %s\n",
cfi.GetVersion(), cfi.GetFileSize(),cfi.GetBufferSize(), cfi.GetSizeInBits(), cntd,
(cfi.GetSizeInBits() == cntd) ? "complete" : "");
}

if (m_verbose)
if (m_verbose)
{
int n_db = 0;
{ int x = cfi.GetSizeInBits(); while (x) { x /= 10; ++n_db; } }
static const char *nums = "0123456789";
printf("printing %d blocks:\n", cfi.GetSizeInBits());
printf("%*s %10d%10d%10d%10d%10d%10d\n", n_db, "", 1, 2, 3, 4, 5, 6);
printf("%*s %s%s%s%s%s%s0123", n_db, "", nums, nums, nums, nums, nums, nums);
for (int i = 0; i < cfi.GetSizeInBits(); ++i)
{
int n_db = 0;
{ int x = cfi.GetSizeInBits(); while (x) { x /= 10; ++n_db; } }
static const char *nums = "0123456789";
printf("printing %d blocks:\n", cfi.GetSizeInBits());
printf("%*s %10d%10d%10d%10d%10d%10d\n", n_db, "", 1, 2, 3, 4, 5, 6);
printf("%*s %s%s%s%s%s%s0123", n_db, "", nums, nums, nums, nums, nums, nums);
for (int i = 0; i < cfi.GetSizeInBits(); ++i)
{
if (i % 64 == 0)
printf("\n%*d ", n_db, i);
printf("%c", cfi.TestBit(i) ? 'x' : '.');
}
printf("\n");
if (i % 64 == 0)
printf("\n%*d ", n_db, i);
printf("%c", cfi.TestBit(i) ? 'x' : '.');
}
printf("\n");
}

int n_da = 0;
{ int x = cfi.GetAccessCnt(); while (x) { x /= 10; ++n_da; } }
for (int i = 0; i < cfi.GetAccessCnt(); ++i)
Expand Down

0 comments on commit 54400ca

Please sign in to comment.