if(((uint64_t)(address - regMemLeakInfo.regStartAddr[region]) & regMinBktSzInfo[region].minBktSzMins1) !=0)
{
- printf("address in InsertToT2kMemLeakInfo is %ld size = %d file is %s line is %d \n", address, size, fileName, lineNo);
+ DU_LOG("\nINFO --> address in InsertToT2kMemLeakInfo is %ld size = %d file is %s line is %d \n", address, size, fileName, lineNo);
}
leakInfo = (((T2kMeamLeakInfo*)(regMemLeakInfo.gMemLeakInfo[region])) + index1);
leakInfo->prevRemLineNo = 0;
leakInfo->prevRemFileName = '\0';
- //printf("InsertToT2kMemLeakInfo the adress from List Address = %x, index1 = %d from File=%s, line=%d \n",address,index1,fileName,lineNo);
+ //DU_LOG("\nINFO --> InsertToT2kMemLeakInfo the adress from List Address = %x, index1 = %d \
+ from File=%s, line=%d \n",address,index1,fileName,lineNo);
if(smallTick++ == 4096)
{
smallTick = 0;
}
else
{
- printf("Something is wrong, trying to insert %ld index1 = %d file is %s line is %d \n",address, index1, fileName, lineNo);
- printf("Address present :%ld, from File:%s, Line:%d, Size:%d, Age:%d",
+ DU_LOG("\nERROR --> Something is wrong, trying to insert %ld index1 = %d file is %s line is %d \n",address, index1, fileName, lineNo);
+ DU_LOG("\nINFO --> Address present :%ld, from File:%s, Line:%d, Size:%d, Age:%d",
leakInfo->address, leakInfo->fileName,
leakInfo->lineNo, leakInfo->size,
leakInfo->age);
if(index1 >= T2K_MEM_LEAK_INFO_TABLE_SIZE)
{
- printf("index1 out of range = %d address is %ld file = %s line = %d. We are going to crash!!!\n",
+ DU_LOG("\nERROR --> index1 out of range = %d address is %ld file = %s line = %d. We are going to crash!!!\n",
index1,
address,
file,
}
else
{
- printf("Something is wrong, trying to remove %ld index1 = %d from File=%s, line=%d address present is %ld region%d \n",address, index1, file,line,leakInfo->address,region);
+ DU_LOG("\nERROR --> Something is wrong, trying to remove %ld index1 = %d from File=%s, line=%d address present is %ld region%d \n",address, index1, file,line,leakInfo->address,region);
- printf("\n Last Del file %s line %d\n",leakInfo->lastDelFileName,
+ DU_LOG("\nINFO --> Last Del file %s line %d\n",leakInfo->lastDelFileName,
leakInfo->lastDelLineNum);
if(leakInfo->prevRemFileName != NULLP)
{
- printf("Previous File:%s, Previous Line:%d\n",
+ DU_LOG("\nINFO --> Previous File:%s, Previous Line:%d\n",
leakInfo->prevRemFileName, leakInfo->prevRemLineNo);
}
}
if(fp == NULL)
{
- printf("Could not open file for dumping mem leak info\n");
+ DU_LOG("\nERROR --> Could not open file for dumping mem leak info\n");
return;
}
for(reg=0; reg <regMemLeakInfo.numActvRegions; reg++)
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
/* Initialize the hast list to maintain the SSI memory information for Broadcom */
offset = (uint16_t)((PTR)(&ptrHdr.ent) - (PTR) &ptrHdr);
- printf("###########offset is %d region %d\n", offset, region);
+ DU_LOG("\nINFO --> offset is %d region %d\n", offset, region);
if(cmHashListInit(®Cb->brdcmSsiLstCp, 1000, offset, FALSE,
CM_HASH_KEYTYPE_UINT32_MOD, region, 0) != ROK)
{
/* Initialize the elements with 0xAB */
memset(*ptr, 0xAB, *size);
#endif
-// printf("Pointer allocated %8p size %d\n", *ptr, *size);
+// DU_LOG("\nINFO --> Pointer allocated %8p size %d\n", *ptr, *size);
/* Store this pointer in hash list */
if ((bkt->nextBlk) && *ptr)
#elif SS_LIGHT_MEM_LEAK_STS
if (g_overused[bktIdx] == 0 && OVERUSED(bkt))
{
g_overused[bktIdx] = 1;
- /*printf("cmAlloc: bktIdx %u overused %u numAlloc %u\n", bktIdx, g_overused[bktIdx], bkt->numAlloc); */
+ /*DU_LOG("\nINFO --> cmAlloc: bktIdx %u overused %u numAlloc %u\n", bktIdx, g_overused[bktIdx], bkt->numAlloc); */
}
}
#endif
size(%d) %8p, Bucket Id:%03d\n",
size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
#endif
- printf("Passed size (%d) does not match with allocated \
+ DU_LOG("\nERROR --> Passed size (%d) does not match with allocated \
size(%d) %8p, Bucket Id:%03d\n",
size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
abort();
}
/* Validate the tail part to see if there is any over run */
-// printf("Pointer free request %8p, size %d\n", ptr, size);
+// DU_LOG("\nINFO --> Pointer free request %8p, size %d\n", ptr, size);
#endif
/* validate the block to be freed for trampling */
return (RTRAMPLINGNOK);
}
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
- printf("Memory signature is invalid\n");
+ DU_LOG("\nERROR --> Memory signature is invalid\n");
abort();
#endif
}
(Void) SUnlock(&(bkt->bktLock));
#endif
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
- printf("Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
+ DU_LOG("\nERROR --> Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
size %u bytes \n", ptr, regCb->mapTbl[idx].bktIdx, bkt->size);
abort();
#endif
sprintf(dbgPrntBuf, "Passed size (%d) does not match with allocated size(%d):%8p, Bucket Id:%03d\n",
size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
#endif
- printf("Passed size (%d) does not match with allocated size(%d):%8p, Bucket Id:%03d\n",
+ DU_LOG("\nERROR --> Passed size (%d) does not match with allocated size(%d):%8p, Bucket Id:%03d\n",
size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
abort();
}
}
#endif
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
- printf("Memory signature is invalid\n");
+ DU_LOG("\nERROR --> Memory signature is invalid\n");
abort();
#endif
}
SDisplay(0, dbgPrntBuf);
#endif /* DEBUGP */
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
- printf("Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
+ DU_LOG("\nERROR --> Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
size %u bytes \n", ptr, regCb->mapTbl[idx].bktIdx, bkt->size);
abort();
#endif
{
if (FALSE == gmemLkCb.isStarted)
{
- printf("!!leak capturing started\n");
+ DU_LOG("\nINFO --> leak capturing started\n");
gmemLkCb.isStarted = TRUE;
}
else
{
gmemLkCb.isStarted = FALSE;
- printf("!!leak capturing stopped\n");
+ DU_LOG("\nINFO --> leak capturing stopped\n");
cmPrintLeakLog();
}
return;
static uint32_t leakCount =0;
- printf("---- START OF LEAK LOG ----");
+ DU_LOG("\nINFO --> START OF LEAK LOG ");
SLock(&gmemLkCb.memLock);
- printf("---- Lock Acquired ----");
+ DU_LOG("\nINFO --> Lock Acquired");
for(indx = 0; indx < CM_MAX_ALLOC_ENTERIES; indx++)
{
if(gmemLkCb.allocInfo[indx].used == TRUE)
{
leakCount++;
aBkt =(CmMmBlkHdr *)gmemLkCb.allocInfo[indx].memAddr;
- printf("LeakCnt(%ld)Addr(0x%p)RqSz(%ld)",
+ DU_LOG("LeakCnt(%ld)Addr(0x%p)RqSz(%ld)",
leakCount,gmemLkCb.allocInfo[indx].memAddr, aBkt->requestedSize);
- printf("LineNo(%ld)funcName(%s)\n",
+ DU_LOG("LineNo(%ld)funcName(%s)\n",
aBkt->lineNo, aBkt->currFuncName);
gmemLkCb.allocInfo[indx].used = FALSE;
cmPutFreeIndx(indx);
//if(leakCount % 10 == 0)
// sleep(1);
}
- printf("---- END OF LEAK LOG ----");
+ DU_LOG("\nINFO --> END OF LEAK LOG ");
SUnlock(&gmemLkCb.memLock);
- printf("---- Lock Released ----");
+ DU_LOG("\nINFO --> Lock Released");
leakCount =0;
return;
}
/* If hash list is full then print the error tna continue */
if(hashListCp->totalNumEntries == (CMM_HIST_MAX_MEM_BIN * CMM_HIST_MAX_MEM_ENTRY_PER_BIN))
{
- printf("No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN \n");
+ DU_LOG("\nERROR --> No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN \n");
return RFAILED;
} /* End of if */
if(hashListCp->totalNumEntries == (CMM_HIST_MAX_MEM_BIN * CMM_HIST_MAX_MEM_ENTRY_PER_BIN))
{
- printf("No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN\n");
+ DU_LOG("\nERROR --> No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN\n");
return RFAILED;
} /* End of if */
} /* End of if (numEnt) */
else
{
- printf ("Unable to find the entry in hash list\n");
+ DU_LOG("\nERROR --> Unable to find the entry in hash list\n");
return RFAILED;
}/* End of else (numEnt) */
}/* end of for (numBin = 0) */
- printf("Unable to find the entry in the hash list\n");
+ DU_LOG("\nERROR --> Unable to find the entry in the hash list\n");
return RFAILED;
} /* end of cmHstGrmFindEntry */