Skip to content

Commit

Permalink
[VP] ADD_memory_NInja_counter_rtlog
Browse files Browse the repository at this point in the history
add ninja counter rt log
  • Loading branch information
jiafengy1 authored and intel-mediadev committed Sep 22, 2023
1 parent 45c3ce0 commit 8491d1f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
4 changes: 4 additions & 0 deletions media_common/agnostic/common/os/mos_os_trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ typedef enum _MT_LOG_ID
MT_ERR_CRITICAL_MESSAGE,
MT_MOS_ALLOCATE_MEMORY,
MT_MOS_DESTROY_MEMORY,
MT_MOS_MEMORY_NINJA_COUNTER,
MT_LOG_ID_CP_BASE = 0x01000000,
MT_CP_HAL_NOT_INITIALIZED,
MT_CP_HAL_FAIL,
Expand Down Expand Up @@ -874,6 +875,9 @@ typedef enum _MT_PARAM_ID
MT_MEMORY_PTR,
MT_MEMORY_SIZE,
MT_MEMORY_INDEX,
MT_MEMORY_NINJA_START_COUNTER,
MT_MEMORY_NINJA_END_COUNTER,
MT_MEMORY_NINJA_IS_START,
MT_PARAM_ID_MOS_BASE = 0x00001000,
MT_MOS_STATUS,
MT_MOS_GPU_NODE,
Expand Down
24 changes: 12 additions & 12 deletions media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,14 @@ MOS_STATUS VpAllocator::DestroyVpSurface(VP_SURFACE* &surface, bool deferredDest
MT_VP_HAL_SURF_ALLOC_PARAM_SIZE, static_cast<int64_t>(surface->osSurface->OsResource.pGmmResInfo ? surface->osSurface->OsResource.pGmmResInfo->GetSizeAllocation() : 0));
VP_PUBLIC_NORMALMESSAGE(
"VP_HAL_DESTROY_SURF. "
"VP_HAL_Surface: 0x%x, "
"VP_HAL_OsSurface: 0x%x, "
"VP_HAL_Surface: %p, "
"VP_HAL_OsSurface: %p, "
"VP_HAL_isResourceOwner: %d, "
"VP_HAL_Surface_Handle: 0x%x, "
"VP_HAL_Surface_Size: %d",
"VP_HAL_Surface_Handle: 0x%llx, "
"VP_HAL_Surface_Size: 0x%llx",
surface,
surface->osSurface,
surface->isResourceOwner,
surface->isResourceOwner ? 1 : 0,
surface->GetAllocationHandle(m_osInterface),
surface->osSurface->OsResource.pGmmResInfo ? surface->osSurface->OsResource.pGmmResInfo->GetSizeAllocation() : 0);

Expand Down Expand Up @@ -919,18 +919,18 @@ MOS_STATUS VpAllocator::ReAllocateSurface(
MT_VP_HAL_SURF_ALLOC_PARAM_NAME, surfaceName ? *((int64_t *)surfaceName) : 0);
VP_PUBLIC_NORMALMESSAGE(
"VP_HAL_REALLOC_SURF. "
"VP_HAL_Surface: 0x%x, "
"VP_HAL_OsSurface: 0x%x, "
"VP_HAL_Surface: %p, "
"VP_HAL_OsSurface: %p, "
"VP_HAL_isResourceOwner: %d, "
"VP_HAL_Surface_Handle: 0x%x, "
"VP_HAL_Surface_Size: %d, "
"VP_HAL_Surface_Name: %s ",
"VP_HAL_Surface_Handle: 0x%llx, "
"VP_HAL_Surface_Size: 0x%llx, "
"VP_HAL_Surface_Name: %s",
surface,
surface->osSurface,
surface->isResourceOwner,
surface->isResourceOwner ? 1 : 0,
surface->GetAllocationHandle(m_osInterface),
surface->osSurface->OsResource.pGmmResInfo ? surface->osSurface->OsResource.pGmmResInfo->GetSizeAllocation() : 0,
surfaceName);
surfaceName ? surfaceName : "");
int64_t currentSize = static_cast<int64_t>(surface->osSurface->OsResource.pGmmResInfo ? surface->osSurface->OsResource.pGmmResInfo->GetSizeAllocation() : 0);
m_totalSize = m_totalSize + currentSize;
m_peakSize = m_peakSize > m_totalSize ? m_peakSize : m_totalSize;
Expand Down
17 changes: 15 additions & 2 deletions media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,26 @@ MOS_STATUS VpPipeline::ReportIFNCC(bool bStart)
//INTER_FRAME_MEMORY_NINJA_START_COUNTER will be reported in Prepare function
//INTER_FRAME_MEMORY_NINJA_END_COUNTER will be reported in UserFeatureReport() function which runs in Execute()
VP_FUNC_CALL();
int32_t memninjaCounter = 0;
memninjaCounter = *MosUtilities::m_mosMemAllocCounter + *MosUtilities::m_mosMemAllocCounterGfx - *MosUtilities::m_mosMemAllocFakeCounter;
if (MOS_IS_MEMORY_FOOT_PRINT_ENABLED())
{
if (bStart)
{
MT_LOG2(MT_MOS_MEMORY_NINJA_COUNTER, MT_NORMAL, MT_MEMORY_NINJA_IS_START, bStart, MT_MEMORY_NINJA_START_COUNTER, memninjaCounter);
VP_PUBLIC_NORMALMESSAGE("MT_MOS_MEMORY_NINJA_COUNTER, MT_MEMORY_NINJA_IS_START :%d, MT_MEMORY_NINJA_START_COUNTER: %d", bStart, memninjaCounter);
}
else
{
MT_LOG2(MT_MOS_MEMORY_NINJA_COUNTER, MT_NORMAL, MT_MEMORY_NINJA_IS_START, bStart, MT_MEMORY_NINJA_END_COUNTER, memninjaCounter);
VP_PUBLIC_NORMALMESSAGE("MT_MOS_MEMORY_NINJA_COUNTER, MT_MEMORY_NINJA_IS_START :%d, MT_MEMORY_NINJA_END_COUNTER: %d", bStart, memninjaCounter);
}
}
if (m_userFeatureControl->EnableIFNCC() &&
MosUtilities::m_mosMemAllocCounter &&
MosUtilities::m_mosMemAllocCounterGfx &&
MosUtilities::m_mosMemAllocFakeCounter)
{
int32_t memninjaCounter = 0;
memninjaCounter = *MosUtilities::m_mosMemAllocCounter + *MosUtilities::m_mosMemAllocCounterGfx - *MosUtilities::m_mosMemAllocFakeCounter;
ReportUserSettingForDebug(
m_userSettingPtr,
bStart ? __MEDIA_USER_FEATURE_VALUE_INTER_FRAME_MEMORY_NINJA_START_COUNTER : __MEDIA_USER_FEATURE_VALUE_INTER_FRAME_MEMORY_NINJA_END_COUNTER,
Expand Down

0 comments on commit 8491d1f

Please sign in to comment.