ANDROID: vendor_hooks: add waiting information for blocked tasks

- Add the hook to get mutex/rwsem information that the tasks
   are waiting for.

 - Add the hook to print messages for sched_show_task.

 - ANDROID_VENDOR_DATA_ARRAY added to task_struct

Bug: 162776704

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: Ib436fbd8d0ad509c3b5a73ea8f5170e0761a13fd
(cherry picked from commit b519ac4237)
This commit is contained in:
Sangmoon Kim
2020-08-05 22:13:43 +09:00
committed by Todd Kjos
parent 10278602dc
commit 9ad8ff902e
6 changed files with 77 additions and 0 deletions

View File

@@ -36,6 +36,8 @@
# include "mutex.h"
#endif
#include <trace/hooks/dtask.h>
void
__mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key)
{
@@ -1002,6 +1004,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
waiter.task = current;
trace_android_vh_mutex_wait_start(lock);
set_current_state(state);
for (;;) {
/*
@@ -1057,6 +1060,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
spin_lock(&lock->wait_lock);
acquired:
__set_current_state(TASK_RUNNING);
trace_android_vh_mutex_wait_finish(lock);
if (use_ww_ctx && ww_ctx) {
/*
@@ -1087,6 +1091,7 @@ skip_wait:
err:
__set_current_state(TASK_RUNNING);
trace_android_vh_mutex_wait_finish(lock);
mutex_remove_waiter(lock, &waiter, current);
err_early_kill:
spin_unlock(&lock->wait_lock);