nvmap: Add traces for big pages in page pool

There are no traces present for allocating big pages from page pool,
this is limiting the debug ability for some of the memory leak bugs.
Hence add traces for such operations.

Change-Id: I6cece3fd796c5c3e37f87647a1635274a654d727
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2820607
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ketan Patil
2022-12-02 09:52:28 +00:00
committed by Laxman Dewangan
parent ad02c6afa5
commit ec9ee786c4
2 changed files with 44 additions and 0 deletions

View File

@@ -102,6 +102,8 @@ static inline struct page *get_page_list_page_bp(struct nvmap_page_pool *pool)
{
struct page *page;
trace_get_page_list_page_bp(pool->big_page_count);
if (list_empty(&pool->page_list_bp))
return NULL;
@@ -359,6 +361,7 @@ int nvmap_page_pool_alloc_lots_bp(struct nvmap_page_pool *pool,
}
rt_mutex_unlock(&pool->lock);
trace_nvmap_pp_alloc_lots_bp(ind, nr);
return ind;
}

View File

@@ -683,6 +683,22 @@ DECLARE_EVENT_CLASS(nvmap_get_list_page,
TP_printk("pages left in list=%u", __entry->count)
);
DECLARE_EVENT_CLASS(nvmap_get_list_page_bp,
TP_PROTO(u32 count),
TP_ARGS(count),
TP_STRUCT__entry(
__field(u32, count)
),
TP_fast_assign(
__entry->count = count;
),
TP_printk("pages left in big page list=%u", __entry->count)
);
DEFINE_EVENT(nvmap_get_list_page, get_zero_list_page,
TP_PROTO(u32 count),
TP_ARGS(count)
@@ -693,6 +709,11 @@ DEFINE_EVENT(nvmap_get_list_page, get_page_list_page,
TP_ARGS(count)
);
DEFINE_EVENT(nvmap_get_list_page_bp, get_page_list_page_bp,
TP_PROTO(u32 count),
TP_ARGS(count)
);
TRACE_EVENT(nvmap_pp_zero_pages,
TP_PROTO(u32 count),
@@ -763,6 +784,26 @@ TRACE_EVENT(nvmap_pp_alloc_lots,
__entry->requested, __entry->alloced)
);
TRACE_EVENT(nvmap_pp_alloc_lots_bp,
TP_PROTO(u32 alloced, u32 requested),
TP_ARGS(alloced, requested),
TP_STRUCT__entry(
__field(u32, alloced)
__field(u32, requested)
),
TP_fast_assign(
__entry->alloced = alloced;
__entry->requested = requested;
),
TP_printk("requested:%u alloced:%u\n",
__entry->requested, __entry->alloced)
);
TRACE_EVENT(nvmap_pp_fill_zero_lots,
TP_PROTO(u32 save_to_zero,
u32 to_zero,