diff mbox series

mm: cma: Add the CMA instance name to the cma_alloc_start trace event

Message ID 20210326155414.25006-1-georgi.djakov@linaro.org (mailing list archive)
State New, archived
Headers show
Series mm: cma: Add the CMA instance name to the cma_alloc_start trace event | expand

Commit Message

Georgi Djakov March 26, 2021, 3:54 p.m. UTC
During CMA allocation, print also the name to identify the CMA instance.

Suggested-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
---
 include/trace/events/cma.h | 9 ++++++---
 mm/cma.c                   | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Minchan Kim March 26, 2021, 4:09 p.m. UTC | #1
On Fri, Mar 26, 2021 at 05:54:14PM +0200, Georgi Djakov wrote:
> During CMA allocation, print also the name to identify the CMA instance.
> 
> Suggested-by: Minchan Kim <minchan@kernel.org>
> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>

Acked-by: Minchan Kim <minchan@kernel.org>

I guess Andrew will fold this one into original patch.

Thanks, Georgi!
diff mbox series

Patch

diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h
index cdfd06afb39a..be1525a10457 100644
--- a/include/trace/events/cma.h
+++ b/include/trace/events/cma.h
@@ -63,21 +63,24 @@  TRACE_EVENT(cma_release,
 
 TRACE_EVENT(cma_alloc_start,
 
-	TP_PROTO(unsigned int count, unsigned int align),
+	TP_PROTO(const char *name, unsigned int count, unsigned int align),
 
-	TP_ARGS(count, align),
+	TP_ARGS(name, count, align),
 
 	TP_STRUCT__entry(
+		__string(name, name)
 		__field(unsigned int, count)
 		__field(unsigned int, align)
 	),
 
 	TP_fast_assign(
+		__assign_str(name, name);
 		__entry->count = count;
 		__entry->align = align;
 	),
 
-	TP_printk("count=%u align=%u",
+	TP_printk("name=%s count=%u align=%u",
+		  __get_str(name),
 		  __entry->count,
 		  __entry->align)
 );
diff --git a/mm/cma.c b/mm/cma.c
index 984c85fd16ec..df5673d0b23d 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -443,7 +443,7 @@  struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
 	if (!count)
 		goto out;
 
-	trace_cma_alloc_start(count, align);
+	trace_cma_alloc_start(cma->name, count, align);
 
 	mask = cma_bitmap_aligned_mask(cma, align);
 	offset = cma_bitmap_aligned_offset(cma, align);