ANDROID: vendor_hooks: add vendor hoook to report acr_info in cma_alloc()

Add android_vh_cma_alloc_busy_info vh after EBUSY not only useful
for profiling but also pinned page handling.

Bug: 234498088
Signed-off-by: Edward Wu <edwardwu@realtek.com>
Change-Id: If1de7b63c431a79889e932ff3363314199175cce
This commit is contained in:
Edward Wu
2022-06-21 07:43:07 +08:00
parent 45d8a7d082
commit 45cb58e134
3 changed files with 6 additions and 0 deletions

View File

@@ -214,6 +214,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_busy_info);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue);

View File

@@ -14,6 +14,7 @@
#include <trace/hooks/vendor_hooks.h>
struct cma;
struct acr_info;
struct compact_control;
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
@@ -32,6 +33,9 @@ DECLARE_HOOK(android_vh_cma_alloc_finish,
TP_PROTO(struct cma *cma, struct page *page, unsigned long count,
unsigned int align, gfp_t gfp_mask, s64 ts),
TP_ARGS(cma, page, count, align, gfp_mask, ts));
DECLARE_HOOK(android_vh_cma_alloc_busy_info,
TP_PROTO(struct acr_info *info),
TP_ARGS(info));
DECLARE_HOOK(android_vh_mm_compaction_begin,
TP_PROTO(struct compact_control *cc, long *vendor_ret),
TP_ARGS(cc, vendor_ret));

View File

@@ -532,6 +532,7 @@ 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_android_vh_cma_alloc_busy_info(&info);
trace_cma_alloc_busy_retry(cma->name, pfn, pfn_to_page(pfn),
count, align);