diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index c447840b88f5..4d2442193033 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -496,3 +496,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_rwsem_reader_owned); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_writer_owned); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_rwsem_writer_owned); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_read_trylock_failed); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_compaction_exit); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_compaction_try_to_compact_exit); diff --git a/include/trace/hooks/compaction.h b/include/trace/hooks/compaction.h index 6b72d649fe35..c22b22386be8 100644 --- a/include/trace/hooks/compaction.h +++ b/include/trace/hooks/compaction.h @@ -12,6 +12,13 @@ DECLARE_HOOK(android_vh_proactive_compact_wmark_high, TP_PROTO(int *wmark_high), TP_ARGS(wmark_high)); +DECLARE_HOOK(android_vh_compaction_exit, + TP_PROTO(int node_id, int order, const int highest_zoneidx), + TP_ARGS(node_id, order, highest_zoneidx)); +enum compact_result; +DECLARE_HOOK(android_vh_compaction_try_to_compact_exit, + TP_PROTO(enum compact_result *compact_result), + TP_ARGS(compact_result)); #endif /* _TRACE_HOOK_COMPACTION_H */ /* This part must be outside protection */ #include diff --git a/mm/compaction.c b/mm/compaction.c index 66c29ed624fe..c6acec0b1a04 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2896,7 +2896,7 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order, || fatal_signal_pending(current)) break; } - + trace_android_vh_compaction_try_to_compact_exit(&rc); return rc; } @@ -3166,6 +3166,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) count_compact_events(KCOMPACTD_FREE_SCANNED, cc.total_free_scanned); } + trace_android_vh_compaction_exit(pgdat->node_id, cc.order, cc.highest_zoneidx); /* * Regardless of success, we are done until woken up next. But remember