ANDROID: vendor_hooks: Add a hook for task tagging
Add a hook to tag task by its comm. Easy way to identity a task by its tag. Bug: 189352151 Signed-off-by: ted.lin <ted.lin@oneplus.com> Change-Id: I32f2f7cec6643f4bd48312b9cffa770c902cebf3
This commit is contained in:
@@ -297,3 +297,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_gpio_cd_irqt);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_vmalloc_stack);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_stack_hash);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_track_hash);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_task_comm);
|
||||
|
@@ -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);
|
||||
|
||||
@@ -1227,6 +1228,7 @@ void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec)
|
||||
strlcpy(tsk->comm, buf, sizeof(tsk->comm));
|
||||
task_unlock(tsk);
|
||||
perf_event_comm(tsk, exec);
|
||||
trace_android_vh_set_task_comm(tsk);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -362,6 +362,10 @@ DECLARE_HOOK(android_vh_dup_task_struct,
|
||||
TP_PROTO(struct task_struct *tsk, struct task_struct *orig),
|
||||
TP_ARGS(tsk, orig));
|
||||
|
||||
DECLARE_HOOK(android_vh_set_task_comm,
|
||||
TP_PROTO(struct task_struct *p),
|
||||
TP_ARGS(p));
|
||||
|
||||
/* macro versions of hooks are no longer required */
|
||||
|
||||
#endif /* _TRACE_HOOK_SCHED_H */
|
||||
|
Reference in New Issue
Block a user