Example #1
0
static int RA_DumpSegs(char *page, char **start, off_t off, int count, int *eof,
		       void *data)
{
	struct BT *pBT = NULL;
	int len = 0;
	struct RA_ARENA *pArena = (struct RA_ARENA *)data;

	if (count < 80) {
		*start = (char *)0;
		return 0;
	}
	*eof = 0;
	*start = (char *)1;
	if (off == 0)
		return printAppend(page, count, 0,
			"Arena \"%s\"\nBase         Size Type Ref\n",
			pArena->name);
	for (pBT = pArena->pHeadSegment; --off && pBT;
	     pBT = pBT->pNextSegment)
		;
	if (pBT)
		len = printAppend(page, count, 0, "%08x %8x %4s %08x\n",
				  (unsigned)pBT->base, (unsigned)pBT->uSize,
				  _BTType(pBT->type), (unsigned)pBT->psMapping);
	else
		*eof = 1;
	return len;
}
Example #2
0
void RA_Dump(struct RA_ARENA *pArena)
{
	struct BT *pBT;
	PVR_ASSERT(pArena != NULL);
	PVR_DPF(PVR_DBG_MESSAGE, "Arena '%s':", pArena->name);
	PVR_DPF(PVR_DBG_MESSAGE,
		 "  alloc=%08X free=%08X handle=%08X quantum=%d",
		 pArena->pImportAlloc, pArena->pImportFree,
		 pArena->pImportHandle, pArena->uQuantum);
	PVR_DPF(PVR_DBG_MESSAGE, "  segment Chain:");
	if (pArena->pHeadSegment != NULL &&
	    pArena->pHeadSegment->pPrevSegment != NULL)
		PVR_DPF(PVR_DBG_MESSAGE,
			 "  error: head boundary tag has invalid pPrevSegment");
	if (pArena->pTailSegment != NULL &&
	    pArena->pTailSegment->pNextSegment != NULL)
		PVR_DPF(PVR_DBG_MESSAGE,
			 "  error: tail boundary tag has invalid pNextSegment");

	for (pBT = pArena->pHeadSegment; pBT != NULL; pBT = pBT->pNextSegment)
		PVR_DPF(PVR_DBG_MESSAGE,
			 "\tbase=0x%x size=0x%x type=%s ref=%08X",
			 (u32) pBT->base, pBT->uSize, _BTType(pBT->type),
			 pBT->pRef);

}
Example #3
0
IMG_VOID
RA_Dump (RA_ARENA *pArena)
{
	BT *pBT;
	PVR_ASSERT (pArena != IMG_NULL);
	PVR_DPF ((PVR_DBG_MESSAGE,"Arena '%s':", pArena->name));
	PVR_DPF ((PVR_DBG_MESSAGE,"  alloc=%08X free=%08X handle=%08X quantum=%d",
			 pArena->pImportAlloc, pArena->pImportFree, pArena->pImportHandle,
			 pArena->uQuantum));
	PVR_DPF ((PVR_DBG_MESSAGE,"  segment Chain:"));
	if (pArena->pHeadSegment != IMG_NULL &&
	    pArena->pHeadSegment->pPrevSegment != IMG_NULL)
		PVR_DPF ((PVR_DBG_MESSAGE,"  error: head boundary tag has invalid pPrevSegment"));
	if (pArena->pTailSegment != IMG_NULL &&
	    pArena->pTailSegment->pNextSegment != IMG_NULL)
		PVR_DPF ((PVR_DBG_MESSAGE,"  error: tail boundary tag has invalid pNextSegment"));

	for (pBT=pArena->pHeadSegment; pBT!=IMG_NULL; pBT=pBT->pNextSegment)
	{
		PVR_DPF ((PVR_DBG_MESSAGE,"\tbase=0x%x size=0x%x type=%s ref=%08X",
				 (IMG_UINT32) pBT->base, pBT->uSize, _BTType (pBT->type),
				 pBT->pRef));
	}

#ifdef HASH_TRACE
	HASH_Dump (pArena->pSegmentHash);
#endif
}
Example #4
0
enum PVRSRV_ERROR RA_GetStats(struct RA_ARENA *pArena, char **ppszStr,
			      u32 *pui32StrLen)
{
	char *pszStr = *ppszStr;
	u32 ui32StrLen = *pui32StrLen;
	s32 i32Count;
	struct BT *pBT;

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "\nArena '%s':\n", pArena->name);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100,
		       "  allocCB=%08X freeCB=%08X handle=%08X quantum=%d\n",
		       pArena->pImportAlloc, pArena->pImportFree,
		       pArena->pImportHandle, pArena->uQuantum);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "span count\t\t%lu\n",
		       pArena->sStatistics.uSpanCount);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "live segment count\t%lu\n",
		       pArena->sStatistics.uLiveSegmentCount);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "free segment count\t%lu\n",
		       pArena->sStatistics.uFreeSegmentCount);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "free resource count\t%lu (0x%x)\n",
			      pArena->sStatistics.uFreeResourceCount,
			      (unsigned)pArena->sStatistics.uFreeResourceCount);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "total allocs\t\t%lu\n",
		       pArena->sStatistics.uCumulativeAllocs);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "total frees\t\t%lu\n",
		       pArena->sStatistics.uCumulativeFrees);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "import count\t\t%lu\n",
		       pArena->sStatistics.uImportCount);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "export count\t\t%lu\n",
		       pArena->sStatistics.uExportCount);
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	CHECK_SPACE(ui32StrLen);
	i32Count = OSSNPrintf(pszStr, 100, "  segment Chain:\n");
	UPDATE_SPACE(pszStr, i32Count, ui32StrLen);

	if (pArena->pHeadSegment != NULL &&
	    pArena->pHeadSegment->pPrevSegment != NULL) {
		CHECK_SPACE(ui32StrLen);
		i32Count = OSSNPrintf(pszStr, 100,
		       "  error: head boundary tag has invalid pPrevSegment\n");
		UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
	}

	if (pArena->pTailSegment != NULL &&
	    pArena->pTailSegment->pNextSegment != NULL) {
		CHECK_SPACE(ui32StrLen);
		i32Count = OSSNPrintf(pszStr, 100,
		       "  error: tail boundary tag has invalid pNextSegment\n");
		UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
	}

	for (pBT = pArena->pHeadSegment; pBT != NULL;
	     pBT = pBT->pNextSegment) {
		CHECK_SPACE(ui32StrLen);
		i32Count = OSSNPrintf(pszStr, 100,
			       "\tbase=0x%x size=0x%x type=%s ref=%08X\n",
			       (u32) pBT->base, pBT->uSize, _BTType(pBT->type),
			       pBT->psMapping);
		UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
	}

	*ppszStr = pszStr;
	*pui32StrLen = ui32StrLen;

	return PVRSRV_OK;
}