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 <[email protected]>
Signed-off-by: Patrick Daly <[email protected]>
Signed-off-by: Sudarshan Rajagopalan <[email protected]>
Signed-off-by: Isaac J. Manjarres <[email protected]>
This commit is contained in:
Liam Mark 2015-11-25 14:37:54 -08:00 • committed by Gerrit - the friendly Code Review server
commit 485b41f036
4 changed files with 93 additions and 1 deletions

View file

@ -436,6 +436,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);
@ -477,6 +479,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;
}