ANDROID: sched: Add android_vh_set_task_comm

Vendor may have specific actions after task renamed.

Bug: 357956265
Change-Id: I78263dc023af6fd1ee2db03eee4ccb3ca3ebb278
Signed-off-by: Rick Yiu <rickyiu@google.com>
This commit is contained in:
Rick Yiu
2024-08-26 03:13:22 +00:00
committed by Treehugger Robot
parent 0f23336b97
commit 42515e9246
3 changed files with 7 additions and 0 deletions

View File

@@ -73,6 +73,7 @@
#include "internal.h"
#include <trace/events/sched.h>
#include <trace/hooks/sched.h>
static int bprm_creds_from_file(struct linux_binprm *bprm);
@@ -1238,6 +1239,7 @@ void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec)
task_lock(tsk);
trace_task_rename(tsk, buf);
strscpy_pad(tsk->comm, buf, sizeof(tsk->comm));
trace_android_vh_set_task_comm(tsk);
task_unlock(tsk);
perf_event_comm(tsk, exec);
}

View File

@@ -458,6 +458,10 @@ DECLARE_HOOK(android_vh_prio_restore,
TP_PROTO(int saved_prio),
TP_ARGS(saved_prio));
DECLARE_HOOK(android_vh_set_task_comm,
TP_PROTO(struct task_struct *p),
TP_ARGS(p));
#endif /* _TRACE_HOOK_SCHED_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@@ -115,3 +115,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_blocked_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rt_rq_load_avg);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_prio_inheritance);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_prio_restore);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_task_comm);