Skip to content

Commit

Permalink
Changes in log messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and abh3 committed Jun 30, 2016
1 parent 641ac44 commit 71ef3c0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/XrdFileCache/XrdFileCacheFile.cc
Expand Up @@ -96,7 +96,7 @@ m_prefetchCurrentCnt(0)

File::~File()
{
clLog()->Debug(XrdCl::AppMsg, "File::~File() %p %s", (void*)this, lPath());
clLog()->Debug(XrdCl::AppMsg, "File::~File() enter %p %s", (void*)this, lPath());

// assert if in debug mode
if (XrdCl::DefaultEnv::GetLog()->GetLevel() >= XrdCl::Log::DebugMsg ) {
Expand Down Expand Up @@ -172,7 +172,7 @@ File::~File()


// print just for curiosity
clLog()->Debug(XrdCl::AppMsg, "File::~File() ended, prefetch score ...%d/%d=%.2f", m_prefetchReadCnt, m_prefetchHitCnt, m_prefetchScore);
clLog()->Debug(XrdCl::AppMsg, "File::~File() ended, prefetch score ...%d/%d=%.2f", m_prefetchHitCnt, m_prefetchReadCnt, m_prefetchScore);
}

bool File::InitiateClose()
Expand Down Expand Up @@ -708,6 +708,7 @@ void File::Sync()
void File::inc_ref_count(Block* b)
{
// Method always called under lock
clLog()->Error(XrdCl::AppMsg, "File::inc_ref_count %d %s ",b->m_refcnt, lPath());
b->m_refcnt++;
}

Expand All @@ -717,7 +718,10 @@ void File::inc_ref_count(Block* b)
void File::dec_ref_count(Block* b)
{
// Method always called under lock
clLog()->Error(XrdCl::AppMsg, "File::dec_ref_count %d %s ",b->m_refcnt, lPath());
b-> m_refcnt--;
assert(b->m_refcnt >= 0);

if ( b->m_refcnt == 0) {
int i = b->m_offset/BufferSize();
delete m_block_map[i];
Expand All @@ -735,14 +739,14 @@ void File::dec_ref_count(Block* b)

void File::ProcessBlockResponse(Block* b, XrdCl::XRootDStatus *status)
{
clLog()->Debug(XrdCl::AppMsg, "File::ProcessBlockResponse %d ",(int)(b->m_offset/BufferSize()));
clLog()->Debug(XrdCl::AppMsg, "File::ProcessBlockResponse %d %s",(int)(b->m_offset/BufferSize()), lPath());

m_downloadCond.Lock();

if (status->IsOK())
{
b->m_downloaded = true;
clLog()->Debug(XrdCl::AppMsg, "File::ProcessBlockResponse %d finished %d",(int)(b->m_offset/BufferSize()), b->is_finished());
clLog()->Debug(XrdCl::AppMsg, "File::ProcessBlockResponse %d finished %d %s",(int)(b->m_offset/BufferSize()), b->is_finished(), lPath());
if (!m_stopping) { // AMT theoretically this should be under state lock, but then are double locks
inc_ref_count(b);
cache()->AddWriteTask(b, true);
Expand All @@ -752,7 +756,7 @@ void File::ProcessBlockResponse(Block* b, XrdCl::XRootDStatus *status)
{
// AMT how long to keep?
// when to retry?
clLog()->Error(XrdCl::AppMsg, "File::ProcessBlockResponse block %d error ",(int)(b->m_offset/BufferSize()));
clLog()->Error(XrdCl::AppMsg, "File::ProcessBlockResponse block %d error %s",(int)(b->m_offset/BufferSize()), lPath());
XrdPosixMap::Result(*status);

b->set_error_and_free(errno);
Expand Down Expand Up @@ -831,8 +835,8 @@ void File::Prefetch()

// clLog()->Dump(XrdCl::AppMsg, "File::Prefetch enter to check download status \n");
XrdSysCondVarHelper _lck(m_downloadCond);
// clLog()->Dump(XrdCl::AppMsg, "File::Prefetch enter to check download status BEGIN \n");
if (m_cfi.IsComplete() == false && m_block_map.size() < 1)
clLog()->Dump(XrdCl::AppMsg, "File::Prefetch enter to check download status BEGIN \n");
if (m_cfi.IsComplete() == false && m_block_map.size() < 3)
{

// check index not on disk and not in RAM
Expand Down

0 comments on commit 71ef3c0

Please sign in to comment.