ANDROID: psi: Add vendor hooks for PSI tracing

Add hooks to capture various per-zone memory stats when
a trigger threshold is hit.

Bug: 379593530

Change-Id: Ia748b9525da3996366802f536e66eaa35af4416e
Signed-off-by: Jing Wei <jing.wei5@transsion.com>
This commit is contained in:
Jing Wei
2024-11-19 19:22:41 +08:00
committed by Treehugger Robot
parent 4a105e4e1c
commit 516ca8799f

View File

@@ -551,6 +551,8 @@ static u64 update_triggers(struct psi_group *group, u64 now)
if (now < t->last_event_time + t->win.size) if (now < t->last_event_time + t->win.size)
continue; continue;
trace_android_vh_psi_event(t);
/* Generate an event */ /* Generate an event */
if (cmpxchg(&t->event, 0, 1) == 0) if (cmpxchg(&t->event, 0, 1) == 0)
wake_up_interruptible(&t->event_wait); wake_up_interruptible(&t->event_wait);
@@ -559,6 +561,8 @@ static u64 update_triggers(struct psi_group *group, u64 now)
t->pending_event = false; t->pending_event = false;
} }
trace_android_vh_psi_group(group);
if (update_total) if (update_total)
memcpy(group->polling_total, total, memcpy(group->polling_total, total,
sizeof(group->polling_total)); sizeof(group->polling_total));