mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 05:34:13 -05:00
mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start
This makes cma info more intuitive during debugging. Show up in the trace as: 279.814717: cma_alloc_start: name=reserved request_count=4 available_count=8096 total_count=8192 align=0 309.790580: cma_alloc_start: name=reserved request_count=4 available_count=8092 total_count=8192 align=0 317.046609: cma_alloc_start: name=reserved request_count=4 available_count=8088 total_count=8192 align=0 Link: https://lkml.kernel.org/r/8a79284879c529f467478552825154b018076e95.1755729178.git.gaoxiang17@xiaomi.com Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com> Cc: David Hildenbrand <david@redhat.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
5d5d75ff64
commit
0cd01c4a5c
@@ -38,25 +38,32 @@ TRACE_EVENT(cma_release,
|
||||
|
||||
TRACE_EVENT(cma_alloc_start,
|
||||
|
||||
TP_PROTO(const char *name, unsigned long count, unsigned int align),
|
||||
TP_PROTO(const char *name, unsigned long request_count, unsigned long available_count,
|
||||
unsigned long total_count, unsigned int align),
|
||||
|
||||
TP_ARGS(name, count, align),
|
||||
TP_ARGS(name, request_count, available_count, total_count, align),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string(name, name)
|
||||
__field(unsigned long, count)
|
||||
__field(unsigned long, request_count)
|
||||
__field(unsigned long, available_count)
|
||||
__field(unsigned long, total_count)
|
||||
__field(unsigned int, align)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name);
|
||||
__entry->count = count;
|
||||
__entry->request_count = request_count;
|
||||
__entry->available_count = available_count;
|
||||
__entry->total_count = total_count;
|
||||
__entry->align = align;
|
||||
),
|
||||
|
||||
TP_printk("name=%s count=%lu align=%u",
|
||||
TP_printk("name=%s request_count=%lu available_count=%lu total_count=%lu align=%u",
|
||||
__get_str(name),
|
||||
__entry->count,
|
||||
__entry->request_count,
|
||||
__entry->available_count,
|
||||
__entry->total_count,
|
||||
__entry->align)
|
||||
);
|
||||
|
||||
|
||||
2
mm/cma.c
2
mm/cma.c
@@ -864,7 +864,7 @@ static struct page *__cma_alloc(struct cma *cma, unsigned long count,
|
||||
if (!count)
|
||||
return page;
|
||||
|
||||
trace_cma_alloc_start(name, count, align);
|
||||
trace_cma_alloc_start(name, count, cma->available_count, cma->count, align);
|
||||
|
||||
for (r = 0; r < cma->nranges; r++) {
|
||||
page = NULL;
|
||||
|
||||
Reference in New Issue
Block a user