ion: tracing: add ftrace events for ion allocations
Add ftrace events for ion allocations to make it easier to profile
their performance.
Change-Id: I9f32e076cd50d7d3a145353dfcef74f0f6cdf8a0
Signed-off-by: Liam Mark <lmark@codeaurora.org>
diff --git a/mm/migrate.c b/mm/migrate.c
index ee026af..99ff32a 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -34,6 +34,7 @@
#include <linux/syscalls.h>
#include <linux/hugetlb.h>
#include <linux/gfp.h>
+#include <trace/events/kmem.h>
#include <asm/tlbflush.h>
@@ -988,6 +989,7 @@
int swapwrite = current->flags & PF_SWAPWRITE;
int rc;
+ trace_migrate_pages_start(mode);
if (!swapwrite)
current->flags |= PF_SWAPWRITE;
@@ -1006,6 +1008,7 @@
goto out;
case -EAGAIN:
retry++;
+ trace_migrate_retry(retry);
break;
case 0:
nr_succeeded++;
@@ -1026,6 +1029,7 @@
if (!swapwrite)
current->flags &= ~PF_SWAPWRITE;
+ trace_migrate_pages_end(mode);
if (rc)
return rc;