ANDROID: vendor_hooks: add hooks in __alloc_pages_slowpath

Since android_vh_alloc_pages_slowpath is revert by
commit e09000ee19 ("Revert half of "ANDROID: vendor_hooks: Add hooks
for memory when debug""). re-add hooks here to measure the duration

Bug: 182443489
Signed-off-by: liuhailong <liuhailong@oppo.com>
Change-Id: Ie4534047105d8409623692cc3811b55d9ddbd17d
This commit is contained in:
liuhailong 2022-07-21 10:08:14 +08:00 committed by Treehugger Robot
parent d63c961c9d
commit 4536de1b70
3 changed files with 11 additions and 0 deletions

View File

@ -271,6 +271,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_mm);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_from_fragment_pool);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exclude_reserved_zone);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_include_reserved_zone);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_slowpath_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_slowpath_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_mem);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpci_override_toggling);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_typec_tcpci_chk_contaminant);

View File

@ -87,6 +87,12 @@ DECLARE_HOOK(android_vh_include_reserved_zone,
DECLARE_HOOK(android_vh_show_mem,
TP_PROTO(unsigned int filter, nodemask_t *nodemask),
TP_ARGS(filter, nodemask));
DECLARE_HOOK(android_vh_alloc_pages_slowpath_begin,
TP_PROTO(gfp_t gfp_mask, unsigned int order, unsigned long *pdata),
TP_ARGS(gfp_mask, order, pdata));
DECLARE_HOOK(android_vh_alloc_pages_slowpath_end,
TP_PROTO(gfp_t gfp_mask, unsigned int order, unsigned long data),
TP_ARGS(gfp_mask, order, data));
struct dirty_throttle_control;
DECLARE_HOOK(android_vh_mm_dirty_limits,
TP_PROTO(struct dirty_throttle_control *const gdtc, bool strictlimit,

View File

@ -4790,7 +4790,9 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
int no_progress_loops;
unsigned int cpuset_mems_cookie;
int reserve_flags;
unsigned long vh_record;
trace_android_vh_alloc_pages_slowpath_begin(gfp_mask, order, &vh_record);
/*
* We also sanity check to catch abuse of atomic reserves being used by
* callers that are not in atomic context.
@ -5032,6 +5034,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
warn_alloc(gfp_mask, ac->nodemask,
"page allocation failure: order:%u", order);
got_pg:
trace_android_vh_alloc_pages_slowpath_end(gfp_mask, order, vh_record);
return page;
}