mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
ANDROID: cgroup: Add vendor hook to the cgroup
Add a vendor hook after attaching a task to a cgroup to recognize the group_id for performance tuning Bug: 181917687 Signed-off-by: Frankie Chang <frankie.chang@mediatek.com> Change-Id: I603afa3d893dd575a7dcb97f83bd9eacb8315bab (cherry picked from commit de089a37a3d248608a1d5855a4ae82ebad3ec2ab)
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <trace/hooks/iommu.h>
|
||||
#include <trace/hooks/thermal.h>
|
||||
#include <trace/hooks/ufshcd.h>
|
||||
#include <trace/hooks/cgroup.h>
|
||||
|
||||
/*
|
||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||
@@ -172,3 +173,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_wake_up_sync);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_wake_flags);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_eff_value);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_set_task);
|
||||
|
||||
17
include/trace/hooks/cgroup.h
Normal file
17
include/trace/hooks/cgroup.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM cgroup
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
#if !defined(_TRACE_HOOK_CGROUP_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_CGROUP_H
|
||||
#include <linux/tracepoint.h>
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
struct task_struct;
|
||||
DECLARE_HOOK(android_vh_cgroup_set_task,
|
||||
TP_PROTO(int ret, struct task_struct *task),
|
||||
TP_ARGS(ret, task));
|
||||
#endif
|
||||
|
||||
#include <trace/define_trace.h>
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/fs_parser.h>
|
||||
|
||||
#include <trace/events/cgroup.h>
|
||||
#include <trace/hooks/cgroup.h>
|
||||
|
||||
/*
|
||||
* pidlists linger the following amount before being destroyed. The goal
|
||||
@@ -518,6 +519,7 @@ static ssize_t __cgroup1_procs_write(struct kernfs_open_file *of,
|
||||
goto out_finish;
|
||||
|
||||
ret = cgroup_attach_task(cgrp, task, threadgroup);
|
||||
trace_android_vh_cgroup_set_task(ret, task);
|
||||
|
||||
out_finish:
|
||||
cgroup_procs_write_finish(task, locked);
|
||||
|
||||
Reference in New Issue
Block a user