ANDROID: power: Add vendor hook to qos for GKI purpose.

Add the vendor hook to qos.c, because of some special cases related to
our feature. we add the hook at freq_qos_add_request and remove_request
to make sure we can go to our own qos process logic.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: I1fb8fd6134432ecfb44ad242c66ccd8280ab9b43
This commit is contained in:
heshuai1
2021-06-10 15:46:59 +08:00
committed by Todd Kjos
parent 9d55580966
commit 728626cb04
3 changed files with 26 additions and 0 deletions

View File

@@ -321,6 +321,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_pre);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_post); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_post);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_uid); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_uid);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_qos_add_request);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_qos_update_request);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_qos_remove_request);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_balance_anon_file_reclaim); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_balance_anon_file_reclaim);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_enter); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_enter);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_exit); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_exit);

View File

@@ -20,6 +20,23 @@ DECLARE_HOOK(android_vh_try_to_freeze_todo_unfrozen,
TP_PROTO(struct task_struct *p), TP_PROTO(struct task_struct *p),
TP_ARGS(p)); TP_ARGS(p));
enum freq_qos_req_type;
struct freq_qos_request;
struct freq_constraints;
DECLARE_HOOK(android_vh_freq_qos_add_request,
TP_PROTO(struct freq_constraints *qos, struct freq_qos_request *req,
enum freq_qos_req_type type, int value, int ret),
TP_ARGS(qos, req, type, value, ret));
DECLARE_HOOK(android_vh_freq_qos_update_request,
TP_PROTO(struct freq_qos_request *req, int value),
TP_ARGS(req, value));
DECLARE_HOOK(android_vh_freq_qos_remove_request,
TP_PROTO(struct freq_qos_request *req),
TP_ARGS(req));
/* macro versions of hooks are no longer required */ /* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_POWER_H */ #endif /* _TRACE_HOOK_POWER_H */

View File

@@ -38,6 +38,9 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/export.h> #include <linux/export.h>
#include <trace/events/power.h> #include <trace/events/power.h>
#undef CREATE_TRACE_POINT
#include <trace/hooks/power.h>
/* /*
* locking rule: all changes to constraints or notifiers lists * locking rule: all changes to constraints or notifiers lists
@@ -546,6 +549,7 @@ int freq_qos_add_request(struct freq_constraints *qos,
req->type = 0; req->type = 0;
} }
trace_android_vh_freq_qos_add_request(qos, req, type, value, ret);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(freq_qos_add_request); EXPORT_SYMBOL_GPL(freq_qos_add_request);
@@ -570,6 +574,7 @@ int freq_qos_update_request(struct freq_qos_request *req, s32 new_value)
"%s() called for unknown object\n", __func__)) "%s() called for unknown object\n", __func__))
return -EINVAL; return -EINVAL;
trace_android_vh_freq_qos_update_request(req, new_value);
if (req->pnode.prio == new_value) if (req->pnode.prio == new_value)
return 0; return 0;
@@ -598,6 +603,7 @@ int freq_qos_remove_request(struct freq_qos_request *req)
"%s() called for unknown object\n", __func__)) "%s() called for unknown object\n", __func__))
return -EINVAL; return -EINVAL;
trace_android_vh_freq_qos_remove_request(req);
ret = freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); ret = freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
req->qos = NULL; req->qos = NULL;
req->type = 0; req->type = 0;