From 882a86dbae8662f92512dd34f9d4e9a56329b78e Mon Sep 17 00:00:00 2001 From: Stefan Strogin Date: Wed, 8 Apr 2015 09:44:36 +1000 Subject: [PATCH] mm-cma-add-trace-events-for-cma-allocations-and-freeings-fix Trace 'align' too in cma_alloc trace event. Signed-off-by: Stefan Strogin Cc: Ingo Molnar Cc: Steven Rostedt Cc: Joonsoo Kim Cc: Michal Nazarewicz Cc: Marek Szyprowski Cc: Laurent Pinchart Cc: Thierry Reding Signed-off-by: Andrew Morton --- include/trace/events/cma.h | 11 +++++++---- mm/cma.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h index e01b35d4eda4..d7cd961720a7 100644 --- a/include/trace/events/cma.h +++ b/include/trace/events/cma.h @@ -10,26 +10,29 @@ TRACE_EVENT(cma_alloc, TP_PROTO(unsigned long pfn, const struct page *page, - unsigned int count), + unsigned int count, unsigned int align), - TP_ARGS(pfn, page, count), + TP_ARGS(pfn, page, count, align), TP_STRUCT__entry( __field(unsigned long, pfn) __field(const struct page *, page) __field(unsigned int, count) + __field(unsigned int, align) ), TP_fast_assign( __entry->pfn = pfn; __entry->page = page; __entry->count = count; + __entry->align = align; ), - TP_printk("pfn=%lx page=%p count=%u", + TP_printk("pfn=%lx page=%p count=%u align=%u", __entry->pfn, __entry->page, - __entry->count) + __entry->count, + __entry->align) ); TRACE_EVENT(cma_release, diff --git a/mm/cma.c b/mm/cma.c index e9410b7c34f2..3a7a67b93394 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -416,7 +416,7 @@ struct page *cma_alloc(struct cma *cma, unsigned int count, unsigned int align) start = bitmap_no + mask + 1; } - trace_cma_alloc(page ? pfn : -1UL, page, count); + trace_cma_alloc(page ? pfn : -1UL, page, count, align); pr_debug("%s(): returned %p\n", __func__, page); return page; -- 2.39.5