linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Georgi Djakov <georgi.djakov@linaro.org>
To: minchan@kernel.org
Cc: rostedt@goodmis.org, akpm@linux-foundation.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	georgi.djakov@linaro.org
Subject: [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event
Date: Fri, 26 Mar 2021 17:54:14 +0200	[thread overview]
Message-ID: <20210326155414.25006-1-georgi.djakov@linaro.org> (raw)

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(-)

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);


             reply	other threads:[~2021-03-26 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 15:54 Georgi Djakov [this message]
2021-03-26 16:09 ` [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210326155414.25006-1-georgi.djakov@linaro.org \
    --to=georgi.djakov@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).