summaryrefslogtreecommitdiff
path: root/mm/cma.c
diff options
context:
space:
mode:
authorLiam Mark <lmark@codeaurora.org>2015-11-25 14:37:54 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:14:00 -0700
commit5d871bae1b53964a507fe60874cefe8464eb9e02 (patch)
treeb92624b151959099646f45cd159a48635187f3bf /mm/cma.c
parentff76e3f64ed6d06ca53a81dbc42814aeecd14af2 (diff)
mm: cma: add trace events for CMA alloc perf testing
Add cma and migrate trace events to enable CMA allocation performance to be measured via ftrace. Change-Id: I1e471e9e21f1a14ce2ed167d8515ccb5f83eb88c Signed-off-by: Liam Mark <lmark@codeaurora.org>
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/cma.c b/mm/cma.c
index ea506eb18cd6..db890ac50cbd 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -379,6 +379,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)
if (!count)
return NULL;
+ trace_cma_alloc_start(count, align);
+
mask = cma_bitmap_aligned_mask(cma, align);
offset = cma_bitmap_aligned_offset(cma, align);
bitmap_maxno = cma_bitmap_maxno(cma);
@@ -416,6 +418,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)
pr_debug("%s(): memory range at %p is busy, retrying\n",
__func__, pfn_to_page(pfn));
+
+ trace_cma_alloc_busy_retry(pfn, pfn_to_page(pfn), count, align);
/* try again with a bit different memory target */
start = bitmap_no + mask + 1;
}