LF-165 [#imx-1870] gputop counter test failed
Recover gpu kernel database printout format and add statictics of contiguous memory Signed-off-by: chingling wang <chingling.wang@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
bc240b1ee1
commit
9881fb7e5f
|
@ -1358,6 +1358,7 @@ _AllocateLinearMemory(
|
|||
gceVIDMEM_TYPE type = (Interface->u.AllocateLinearVideoMemory.type & 0xFF);
|
||||
gctUINT32 flag = Interface->u.AllocateLinearVideoMemory.flag;
|
||||
gctUINT64 mappingInOne = 1;
|
||||
gctBOOL isContiguous;
|
||||
|
||||
gcmkHEADER_ARG("Kernel=%p pool=%d bytes=%lu alignment=%lu type=%d",
|
||||
Kernel, pool, bytes, alignment, type);
|
||||
|
@ -1416,6 +1417,32 @@ _AllocateLinearMemory(
|
|||
gcvNULL,
|
||||
bytes));
|
||||
|
||||
gcmkONERROR(gckVIDMEM_NODE_IsContiguous(Kernel, nodeObject, &isContiguous));
|
||||
|
||||
if (isContiguous)
|
||||
{
|
||||
/* Record in process db. */
|
||||
gcmkONERROR(
|
||||
gckKERNEL_AddProcessDB(Kernel,
|
||||
ProcessID,
|
||||
gcvDB_CONTIGUOUS,
|
||||
gcmINT2PTR(handle),
|
||||
gcvNULL,
|
||||
bytes));
|
||||
}
|
||||
|
||||
if (type & gcvVIDMEM_TYPE_COMMAND)
|
||||
{
|
||||
/* Record in process db. */
|
||||
gcmkONERROR(
|
||||
gckKERNEL_AddProcessDB(Kernel,
|
||||
ProcessID,
|
||||
gcvDB_COMMAND_BUFFER,
|
||||
gcmINT2PTR(handle),
|
||||
gcvNULL,
|
||||
bytes));
|
||||
}
|
||||
|
||||
/* Return status. */
|
||||
gcmkFOOTER_ARG("pool=%d node=0x%x", pool, handle);
|
||||
return gcvSTATUS_OK;
|
||||
|
@ -1486,6 +1513,18 @@ _ReleaseVideoMemory(
|
|||
type,
|
||||
gcmINT2PTR(Handle)));
|
||||
|
||||
/* VIV: we don't care if gcvDB_CONTIGUOUS and gcvDB_COMMAND_BUFFER are exist, if so , delete them.
|
||||
don't need to check return value*/
|
||||
gckKERNEL_RemoveProcessDB(Kernel,
|
||||
ProcessID,
|
||||
gcvDB_CONTIGUOUS,
|
||||
gcmINT2PTR(Handle));
|
||||
|
||||
gckKERNEL_RemoveProcessDB(Kernel,
|
||||
ProcessID,
|
||||
gcvDB_COMMAND_BUFFER,
|
||||
gcmINT2PTR(Handle));
|
||||
|
||||
gckVIDMEM_HANDLE_Dereference(Kernel, ProcessID, Handle);
|
||||
|
||||
gckVIDMEM_NODE_Dereference(Kernel, nodeObject);
|
||||
|
@ -2091,6 +2130,14 @@ gckKERNEL_QueryDatabase(
|
|||
gcvDB_NON_PAGED,
|
||||
&Interface->u.Database.nonPaged));
|
||||
|
||||
/* Query contiguous memory. */
|
||||
gcmkONERROR(
|
||||
gckKERNEL_QueryProcessDB(Kernel,
|
||||
Interface->u.Database.processID,
|
||||
!Interface->u.Database.validProcessID,
|
||||
gcvDB_CONTIGUOUS,
|
||||
&Interface->u.Database.contiguous));
|
||||
|
||||
/* Query GPU idle time. */
|
||||
gcmkONERROR(
|
||||
gckKERNEL_QueryProcessDB(Kernel,
|
||||
|
|
|
@ -231,12 +231,15 @@ extern "C" {
|
|||
typedef enum _gceDATABASE_TYPE
|
||||
{
|
||||
gcvDB_VIDEO_MEMORY = 1, /* Video memory created. */
|
||||
gcvDB_COMMAND_BUFFER, /* Command Buffer. */
|
||||
gcvDB_NON_PAGED, /* Non paged memory. */
|
||||
gcvDB_CONTIGUOUS, /* Contiguous memory. */
|
||||
gcvDB_SIGNAL, /* Signal. */
|
||||
gcvDB_VIDEO_MEMORY_LOCKED, /* Video memory locked. */
|
||||
gcvDB_CONTEXT, /* Context */
|
||||
gcvDB_IDLE, /* GPU idle. */
|
||||
gcvDB_MAP_MEMORY, /* Map memory */
|
||||
gcvDB_MAP_USER_MEMORY, /* Map user memory */
|
||||
gcvDB_SHBUF, /* Shared buffer. */
|
||||
|
||||
gcvDB_NUM_TYPES,
|
||||
|
@ -288,6 +291,8 @@ typedef struct _gcsDATABASE
|
|||
/* Sizes to query. */
|
||||
gcsDATABASE_COUNTERS vidMem;
|
||||
gcsDATABASE_COUNTERS nonPaged;
|
||||
gcsDATABASE_COUNTERS contiguous;
|
||||
gcsDATABASE_COUNTERS mapUserMemory;
|
||||
gcsDATABASE_COUNTERS mapMemory;
|
||||
|
||||
gcsDATABASE_COUNTERS vidMemType[gcvVIDMEM_TYPE_COUNT];
|
||||
|
@ -1680,6 +1685,13 @@ gckVIDMEM_NODE_Find(
|
|||
OUT gctUINT32 * Offset
|
||||
);
|
||||
|
||||
gceSTATUS
|
||||
gckVIDMEM_NODE_IsContiguous(
|
||||
IN gckKERNEL Kernel,
|
||||
IN gckVIDMEM_NODE NodeObject,
|
||||
OUT gctBOOL * Contiguous
|
||||
);
|
||||
|
||||
typedef struct _gcsADDRESS_AREA * gcsADDRESS_AREA_PTR;
|
||||
typedef struct _gcsADDRESS_AREA
|
||||
{
|
||||
|
|
|
@ -822,10 +822,18 @@ gckKERNEL_AddProcessDB(
|
|||
count = &database->nonPaged;
|
||||
break;
|
||||
|
||||
case gcvDB_CONTIGUOUS:
|
||||
count = &database->contiguous;
|
||||
break;
|
||||
|
||||
case gcvDB_MAP_MEMORY:
|
||||
count = &database->mapMemory;
|
||||
break;
|
||||
|
||||
case gcvDB_MAP_USER_MEMORY:
|
||||
count = &database->mapUserMemory;
|
||||
break;
|
||||
|
||||
default:
|
||||
count = gcvNULL;
|
||||
break;
|
||||
|
@ -961,11 +969,21 @@ gckKERNEL_RemoveProcessDB(
|
|||
database->nonPaged.freeCount++;
|
||||
break;
|
||||
|
||||
case gcvDB_CONTIGUOUS:
|
||||
database->contiguous.bytes -= bytes;
|
||||
database->contiguous.freeCount++;
|
||||
break;
|
||||
|
||||
case gcvDB_MAP_MEMORY:
|
||||
database->mapMemory.bytes -= bytes;
|
||||
database->mapMemory.freeCount++;
|
||||
break;
|
||||
|
||||
case gcvDB_MAP_USER_MEMORY:
|
||||
database->mapUserMemory.bytes -= bytes;
|
||||
database->mapUserMemory.freeCount++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1468,6 +1486,12 @@ gckKERNEL_QueryProcessDB(
|
|||
gcmSIZEOF(database->vidMem));
|
||||
break;
|
||||
|
||||
case gcvDB_CONTIGUOUS:
|
||||
gckOS_MemCopy(&Info->counters,
|
||||
&database->contiguous,
|
||||
gcmSIZEOF(database->vidMem));
|
||||
break;
|
||||
|
||||
case gcvDB_IDLE:
|
||||
Info->time = Kernel->db->idleTime;
|
||||
Kernel->db->idleTime = 0;
|
||||
|
|
|
@ -4743,3 +4743,60 @@ gckVIDMEM_NODE_Find(
|
|||
|
||||
return status;
|
||||
}
|
||||
|
||||
gceSTATUS
|
||||
gckVIDMEM_NODE_IsContiguous(
|
||||
IN gckKERNEL Kernel,
|
||||
IN gckVIDMEM_NODE NodeObject,
|
||||
OUT gctBOOL * Contiguous
|
||||
)
|
||||
{
|
||||
gceSTATUS status;
|
||||
gckOS os = Kernel->os;
|
||||
gctBOOL acquired = gcvFALSE;
|
||||
gcuVIDMEM_NODE_PTR node = NodeObject->node;
|
||||
gckVIDMEM_BLOCK vidMemBlock = node->VirtualChunk.parent;
|
||||
|
||||
gcmkHEADER();
|
||||
|
||||
/* Grab the mutex. */
|
||||
gcmkONERROR(gckOS_AcquireMutex(os, NodeObject->mutex, gcvINFINITE));
|
||||
acquired = gcvTRUE;
|
||||
|
||||
*Contiguous = gcvFALSE;
|
||||
|
||||
if (node->VidMem.parent->object.type == gcvOBJ_VIDMEM)
|
||||
{
|
||||
*Contiguous = gcvTRUE;
|
||||
}
|
||||
else if (vidMemBlock && vidMemBlock->object.type == gcvOBJ_VIDMEM_BLOCK)
|
||||
{
|
||||
if (vidMemBlock->contiguous)
|
||||
{
|
||||
*Contiguous = gcvTRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node->Virtual.contiguous)
|
||||
{
|
||||
*Contiguous = gcvTRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gcmkVERIFY_OK(gckOS_ReleaseMutex(os, NodeObject->mutex));
|
||||
|
||||
gcmkFOOTER();
|
||||
return gcvSTATUS_OK;
|
||||
|
||||
OnError:
|
||||
if (acquired)
|
||||
{
|
||||
/* Release the mutex. */
|
||||
gcmkVERIFY_OK(gckOS_ReleaseMutex(os, NodeObject->mutex));
|
||||
}
|
||||
|
||||
/* Return the status. */
|
||||
gcmkFOOTER();
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -1084,6 +1084,7 @@ typedef struct _gcsHAL_DATABASE
|
|||
/* Information. */
|
||||
OUT gcuDATABASE_INFO vidMem;
|
||||
OUT gcuDATABASE_INFO nonPaged;
|
||||
OUT gcuDATABASE_INFO contiguous;
|
||||
OUT gcuDATABASE_INFO gpuIdle;
|
||||
|
||||
/* Detail information about video memory. */
|
||||
|
|
|
@ -270,8 +270,13 @@ static const char * poolStr[gcvPOOL_NUMBER_OF_POOLS] =
|
|||
"External",
|
||||
"Unified",
|
||||
"System",
|
||||
/* VIV: Abstract definition */
|
||||
"Sram",
|
||||
"Virtual",
|
||||
"User",
|
||||
/* VIV: internal SRAM, external SRAM */
|
||||
"Insram",
|
||||
"Exsram",
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -349,6 +354,15 @@ OnError:
|
|||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowCommandBufferRecord(
|
||||
IN struct seq_file *m,
|
||||
IN gcsDATABASE_PTR Database
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowNonPagedRecord(
|
||||
IN struct seq_file *m,
|
||||
|
@ -383,6 +397,15 @@ _ShowNonPagedRecord(
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowContiguousRecord(
|
||||
IN struct seq_file *m,
|
||||
IN gcsDATABASE_PTR Database
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowSignalRecord(
|
||||
IN struct seq_file *m,
|
||||
|
@ -526,6 +549,15 @@ _ShowMapMemoryRecord(
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowMapUserMemoryRecord(
|
||||
IN struct seq_file *m,
|
||||
IN gcsDATABASE_PTR Database
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowShbufRecord(
|
||||
IN struct seq_file *m,
|
||||
|
@ -555,6 +587,176 @@ _ShowShbufRecord(
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowCounters(
|
||||
struct seq_file *File,
|
||||
gcsDATABASE_PTR Database
|
||||
)
|
||||
{
|
||||
gctUINT i = 0;
|
||||
|
||||
static const char * otherCounterNames[] = {
|
||||
"AllocNonPaged",
|
||||
"AllocContiguous",
|
||||
"MapUserMemory",
|
||||
"MapMemory",
|
||||
};
|
||||
|
||||
gcsDATABASE_COUNTERS * otherCounters[] = {
|
||||
&Database->nonPaged,
|
||||
&Database->contiguous,
|
||||
&Database->mapUserMemory,
|
||||
&Database->mapMemory,
|
||||
};
|
||||
|
||||
seq_printf(File, "%-16s %16s %16s %16s\n", "", "Current", "Maximum", "Total");
|
||||
|
||||
/* Print surface type counters. */
|
||||
seq_printf(File, "%-16s %16lld %16lld %16lld\n",
|
||||
"All-Types",
|
||||
Database->vidMem.bytes,
|
||||
Database->vidMem.maxBytes,
|
||||
Database->vidMem.totalBytes);
|
||||
|
||||
for (i = 1; i < gcvVIDMEM_TYPE_COUNT; i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16lld %16lld %16lld\n",
|
||||
vidmemTypeStr[i],
|
||||
Database->vidMemType[i].bytes,
|
||||
Database->vidMemType[i].maxBytes,
|
||||
Database->vidMemType[i].totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
|
||||
/* Print surface pool counters. */
|
||||
seq_printf(File, "%-16s %16lld %16lld %16lld\n",
|
||||
"All-Pools",
|
||||
Database->vidMem.bytes,
|
||||
Database->vidMem.maxBytes,
|
||||
Database->vidMem.totalBytes);
|
||||
|
||||
for (i = 1; i < gcvPOOL_NUMBER_OF_POOLS; i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16lld %16lld %16lld\n",
|
||||
poolStr[i],
|
||||
Database->vidMemPool[i].bytes,
|
||||
Database->vidMemPool[i].maxBytes,
|
||||
Database->vidMemPool[i].totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
|
||||
/* Print other counters. */
|
||||
for (i = 0; i < gcmCOUNTOF(otherCounterNames); i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16lld %16lld %16lld\n",
|
||||
otherCounterNames[i],
|
||||
otherCounters[i]->bytes,
|
||||
otherCounters[i]->maxBytes,
|
||||
otherCounters[i]->totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
}
|
||||
|
||||
static int
|
||||
_ShowRecord(
|
||||
IN struct seq_file *File,
|
||||
IN gcsDATABASE_PTR Database,
|
||||
IN gcsDATABASE_RECORD_PTR Record
|
||||
)
|
||||
{
|
||||
gctUINT32 handle;
|
||||
gckVIDMEM_NODE nodeObject;
|
||||
gctPHYS_ADDR_T physical;
|
||||
gceSTATUS status;
|
||||
|
||||
static const char * recordTypes[gcvDB_NUM_TYPES] = {
|
||||
"Unknown",
|
||||
"VideoMemory",
|
||||
"CommandBuffer",
|
||||
"NonPaged",
|
||||
"Contiguous",
|
||||
"Signal",
|
||||
"VidMemLock",
|
||||
"Context",
|
||||
"Idel",
|
||||
"MapMemory",
|
||||
"MapUserMemory",
|
||||
"ShBuf",
|
||||
};
|
||||
|
||||
handle = gcmPTR2INT32(Record->data);
|
||||
|
||||
if (Record->type == gcvDB_VIDEO_MEMORY || Record->type == gcvDB_VIDEO_MEMORY_LOCKED)
|
||||
{
|
||||
status = gckVIDMEM_HANDLE_Lookup2(
|
||||
Record->kernel,
|
||||
Database,
|
||||
handle,
|
||||
&nodeObject
|
||||
);
|
||||
|
||||
if (gcmIS_ERROR(status))
|
||||
{
|
||||
seq_printf(File, "%6u Invalid Node\n", handle);
|
||||
gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT);
|
||||
}
|
||||
gcmkONERROR(gckVIDMEM_NODE_GetPhysical(Record->kernel, nodeObject, 0, &physical));
|
||||
}
|
||||
else
|
||||
{
|
||||
physical = (gctUINT64)Record->physical;
|
||||
}
|
||||
|
||||
seq_printf(File, "%-14s %3d %16x %16zx %16zu\n",
|
||||
recordTypes[Record->type],
|
||||
Record->kernel->core,
|
||||
gcmPTR2INT32(Record->data),
|
||||
(size_t) physical,
|
||||
Record->bytes
|
||||
);
|
||||
|
||||
OnError:
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowDataBaseOldFormat(
|
||||
IN struct seq_file *File,
|
||||
IN gcsDATABASE_PTR Database
|
||||
)
|
||||
{
|
||||
gctINT pid;
|
||||
gctUINT i;
|
||||
char name[24];
|
||||
|
||||
/* Process ID and name */
|
||||
pid = Database->processID;
|
||||
gcmkVERIFY_OK(gckOS_GetProcessNameByPid(pid, gcmSIZEOF(name), name));
|
||||
|
||||
seq_printf(File, "--------------------------------------------------------------------------------\n");
|
||||
seq_printf(File, "Process: %-8d %s\n", pid, name);
|
||||
|
||||
seq_printf(File, "Records:\n");
|
||||
|
||||
seq_printf(File, "%14s %3s %16s %16s %16s\n",
|
||||
"Type", "GPU", "Data/Node", "Physical/Node", "Bytes");
|
||||
|
||||
for (i = 0; i < gcmCOUNTOF(Database->list); i++)
|
||||
{
|
||||
gcsDATABASE_RECORD_PTR record = Database->list[i];
|
||||
|
||||
while (record != NULL)
|
||||
{
|
||||
_ShowRecord(File, Database, record);
|
||||
record = record->next;
|
||||
}
|
||||
}
|
||||
|
||||
seq_printf(File, "Counters:\n");
|
||||
|
||||
_ShowCounters(File, Database);
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowDatabase(
|
||||
IN struct seq_file *File,
|
||||
|
@ -569,12 +771,15 @@ _ShowDatabase(
|
|||
{
|
||||
_ShowDummyRecord,
|
||||
_ShowVideoMemoryRecord,
|
||||
_ShowCommandBufferRecord,
|
||||
_ShowNonPagedRecord,
|
||||
_ShowContiguousRecord,
|
||||
_ShowSignalRecord,
|
||||
_ShowLockRecord,
|
||||
_ShowContextRecord,
|
||||
_ShowDummyRecord,
|
||||
_ShowMapMemoryRecord,
|
||||
_ShowMapUserMemoryRecord,
|
||||
_ShowShbufRecord,
|
||||
};
|
||||
|
||||
|
@ -608,6 +813,50 @@ _ShowDatabase(
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
gc_db_show_old(struct seq_file *m, void *data)
|
||||
{
|
||||
gcsDATABASE_PTR database;
|
||||
gctINT i;
|
||||
static gctUINT64 idleTime = 0;
|
||||
gcsINFO_NODE *node = m->private;
|
||||
gckGALDEVICE device = node->device;
|
||||
gckKERNEL kernel = _GetValidKernel(device);
|
||||
|
||||
if (!kernel)
|
||||
return -ENXIO;
|
||||
|
||||
/* Acquire the database mutex. */
|
||||
gcmkVERIFY_OK(
|
||||
gckOS_AcquireMutex(kernel->os, kernel->db->dbMutex, gcvINFINITE));
|
||||
|
||||
if (kernel->db->idleTime)
|
||||
{
|
||||
/* Record idle time if DB upated. */
|
||||
idleTime = kernel->db->idleTime;
|
||||
kernel->db->idleTime = 0;
|
||||
}
|
||||
|
||||
/* Idle time since last call */
|
||||
seq_printf(m, "GPU Idle: %llu ns\n", idleTime);
|
||||
|
||||
/* Walk the databases. */
|
||||
for (i = 0; i < gcmCOUNTOF(kernel->db->db); ++i)
|
||||
{
|
||||
for (database = kernel->db->db[i];
|
||||
database != gcvNULL;
|
||||
database = database->next)
|
||||
{
|
||||
_ShowDataBaseOldFormat(m, database);
|
||||
}
|
||||
}
|
||||
|
||||
/* Release the database mutex. */
|
||||
gcmkVERIFY_OK(gckOS_ReleaseMutex(kernel->os, kernel->db->dbMutex));
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
static int
|
||||
gc_db_show(struct seq_file *m, void *data)
|
||||
{
|
||||
|
@ -806,6 +1055,92 @@ gc_dump_trigger_show(struct seq_file *m, void *data)
|
|||
|
||||
static int dumpProcess = 0;
|
||||
|
||||
static void
|
||||
_ShowVideoMemoryOldFormat(
|
||||
struct seq_file *File,
|
||||
gcsDATABASE_PTR Database
|
||||
)
|
||||
{
|
||||
gctUINT i = 0;
|
||||
|
||||
static const char * otherCounterNames[] = {
|
||||
"AllocNonPaged",
|
||||
"AllocContiguous",
|
||||
"MapUserMemory",
|
||||
"MapMemory",
|
||||
};
|
||||
|
||||
gcsDATABASE_COUNTERS * otherCounters[] = {
|
||||
&Database->nonPaged,
|
||||
&Database->contiguous,
|
||||
&Database->mapUserMemory,
|
||||
&Database->mapMemory,
|
||||
};
|
||||
|
||||
seq_printf(File, "%-16s %16s %16s %16s\n", "", "Current", "Maximum", "Total");
|
||||
|
||||
/* Print surface type counters. */
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
"All-Types",
|
||||
Database->vidMem.bytes,
|
||||
Database->vidMem.maxBytes,
|
||||
Database->vidMem.totalBytes);
|
||||
|
||||
for (i = 1; i < gcvVIDMEM_TYPE_COUNT; i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
vidmemTypeStr[i],
|
||||
Database->vidMemType[i].bytes,
|
||||
Database->vidMemType[i].maxBytes,
|
||||
Database->vidMemType[i].totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
"All-Types",
|
||||
Database->vidMem.bytes,
|
||||
Database->vidMem.maxBytes,
|
||||
Database->vidMem.totalBytes);
|
||||
|
||||
for (i = 1; i < gcvVIDMEM_TYPE_COUNT; i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
vidmemTypeStr[i],
|
||||
Database->vidMemType[i].bytes,
|
||||
Database->vidMemType[i].maxBytes,
|
||||
Database->vidMemType[i].totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
|
||||
/* Print surface pool counters. */
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
"All-Pools",
|
||||
Database->vidMem.bytes,
|
||||
Database->vidMem.maxBytes,
|
||||
Database->vidMem.totalBytes);
|
||||
|
||||
for (i = 1; i < gcvPOOL_NUMBER_OF_POOLS; i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
poolStr[i],
|
||||
Database->vidMemPool[i].bytes,
|
||||
Database->vidMemPool[i].maxBytes,
|
||||
Database->vidMemPool[i].totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
|
||||
/* Print other counters. */
|
||||
for (i = 0; i < gcmCOUNTOF(otherCounterNames); i++)
|
||||
{
|
||||
seq_printf(File, "%-16s %16llu %16llu %16llu\n",
|
||||
otherCounterNames[i],
|
||||
otherCounters[i]->bytes,
|
||||
otherCounters[i]->maxBytes,
|
||||
otherCounters[i]->totalBytes);
|
||||
}
|
||||
seq_puts(File, "\n");
|
||||
}
|
||||
|
||||
static void
|
||||
_ShowVideoMemory(
|
||||
struct seq_file *File,
|
||||
|
@ -872,6 +1207,61 @@ _ShowVideoMemory(
|
|||
seq_puts(File, "\n");
|
||||
}
|
||||
|
||||
static int gc_vidmem_show_old(struct seq_file *m, void *unused)
|
||||
{
|
||||
gceSTATUS status;
|
||||
gcsDATABASE_PTR database;
|
||||
gcsINFO_NODE *node = m->private;
|
||||
gckGALDEVICE device = node->device;
|
||||
char name[64];
|
||||
int i;
|
||||
|
||||
gckKERNEL kernel = _GetValidKernel(device);
|
||||
|
||||
if (!kernel)
|
||||
return -ENXIO;
|
||||
|
||||
if (dumpProcess == 0)
|
||||
{
|
||||
/* Acquire the database mutex. */
|
||||
gcmkVERIFY_OK(
|
||||
gckOS_AcquireMutex(kernel->os, kernel->db->dbMutex, gcvINFINITE));
|
||||
|
||||
for (i = 0; i < gcmCOUNTOF(kernel->db->db); i++)
|
||||
{
|
||||
for (database = kernel->db->db[i];
|
||||
database != gcvNULL;
|
||||
database = database->next)
|
||||
{
|
||||
gckOS_GetProcessNameByPid(database->processID, gcmSIZEOF(name), name);
|
||||
seq_printf(m, "VidMem Usage (Process %u: %s):\n", database->processID, name);
|
||||
_ShowVideoMemoryOldFormat(m, database);
|
||||
seq_puts(m, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Release the database mutex. */
|
||||
gcmkVERIFY_OK(gckOS_ReleaseMutex(kernel->os, kernel->db->dbMutex));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Find the database. */
|
||||
status = gckKERNEL_FindDatabase(kernel, dumpProcess, gcvFALSE, &database);
|
||||
|
||||
if (gcmIS_ERROR(status))
|
||||
{
|
||||
seq_printf(m, "ERROR: process %d not found\n", dumpProcess);
|
||||
return 0;
|
||||
}
|
||||
|
||||
gckOS_GetProcessNameByPid(dumpProcess, gcmSIZEOF(name), name);
|
||||
seq_printf(m, "VidMem Usage (Process %d: %s):\n", dumpProcess, name);
|
||||
_ShowVideoMemoryOldFormat(m, database);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gc_vidmem_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
gceSTATUS status;
|
||||
|
@ -899,7 +1289,7 @@ static int gc_vidmem_show(struct seq_file *m, void *unused)
|
|||
database = database->next)
|
||||
{
|
||||
gckOS_GetProcessNameByPid(database->processID, gcmSIZEOF(name), name);
|
||||
seq_printf(m, "Memory Usage (Process %u: %s):\n", database->processID, name);
|
||||
seq_printf(m, "VidMem Usage (Process %u: %s):\n", database->processID, name);
|
||||
_ShowVideoMemory(m, database);
|
||||
seq_puts(m, "\n");
|
||||
}
|
||||
|
@ -920,7 +1310,7 @@ static int gc_vidmem_show(struct seq_file *m, void *unused)
|
|||
}
|
||||
|
||||
gckOS_GetProcessNameByPid(dumpProcess, gcmSIZEOF(name), name);
|
||||
seq_printf(m, "Memory Usage (Process %d: %s):\n", dumpProcess, name);
|
||||
seq_printf(m, "VidMem Usage (Process %d: %s):\n", dumpProcess, name);
|
||||
_ShowVideoMemory(m, database);
|
||||
}
|
||||
|
||||
|
@ -1009,9 +1399,11 @@ static gcsINFO InfoList[] =
|
|||
{"clients", gc_clients_show},
|
||||
{"meminfo", gc_meminfo_show},
|
||||
{"idle", gc_idle_show},
|
||||
{"database", gc_db_show},
|
||||
{"database", gc_db_show_old},
|
||||
{"database64x", gc_db_show},
|
||||
{"version", gc_version_show},
|
||||
{"vidmem", gc_vidmem_show, gc_vidmem_write},
|
||||
{"vidmem", gc_vidmem_show_old, gc_vidmem_write},
|
||||
{"vidmem64x", gc_vidmem_show, gc_vidmem_write},
|
||||
{"dump_trigger", gc_dump_trigger_show, gc_dump_trigger_write},
|
||||
{"clk", gc_clk_show},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue