Skip to content

Commit

Permalink
core: pta: stats: Explicit when nexus heap stats is not applicable
Browse files Browse the repository at this point in the history
Explicitly mention in the nexus heap statistics info when the
nexus heap is disabled. With this change, the information displayed
by `xtest --stats --alloc` better show why the printed values are all
0s for this pool.

Also force stats info to be 0 in case non-secure world did not clear
the passed shared buffer before invoking PTA stats.

Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Jan 16, 2025
1 parent 23d4d55 commit 6fd9e2f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/pta/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ static TEE_Result get_alloc_stats(uint32_t type, TEE_Param p[TEE_NUM_PARAMS])
sizeof(stats->desc));
break;

#ifdef CFG_NS_VIRTUALIZATION
case ALLOC_ID_NEXUS_HEAP:
#ifdef CFG_NS_VIRTUALIZATION
nex_malloc_get_stats(stats);
strlcpy(stats->desc, "KHeap", sizeof(stats->desc));
if (p[0].value.b)
nex_malloc_reset_stats();
break;
#else
memset(stats, 0, sizeof(*stats));
strlcpy(stats->desc, "KHeap (disabled)",
sizeof(stats->desc));
#endif
break;
case ALLOC_ID_RPMB:
if (rpmb_mem_stats(stats))
strlcpy(stats->desc,
Expand Down

0 comments on commit 6fd9e2f

Please sign in to comment.