* [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event
@ 2021-03-26 15:54 Georgi Djakov
2021-03-26 16:09 ` Minchan Kim
0 siblings, 1 reply; 2+ messages in thread
From: Georgi Djakov @ 2021-03-26 15:54 UTC (permalink / raw)
To: minchan; +Cc: rostedt, akpm, linux-mm, linux-kernel, georgi.djakov
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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event
2021-03-26 15:54 [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event Georgi Djakov
@ 2021-03-26 16:09 ` Minchan Kim
0 siblings, 0 replies; 2+ messages in thread
From: Minchan Kim @ 2021-03-26 16:09 UTC (permalink / raw)
To: Georgi Djakov; +Cc: rostedt, akpm, linux-mm, linux-kernel
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!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-26 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 15:54 [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event Georgi Djakov
2021-03-26 16:09 ` Minchan Kim
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).