ANDROID: power: Add vendor hook to qos for GKI purpose.
Add vendor hooks in add/update/remove frequency QoS request process to ensure that we can access the OEM's "frequency watchdog" logic for abnormal frequency monitoring. This is necessary for our power tuning policy. Bug: 187458531 Signed-off-by: shenshen mao <maoshenshen@oppo.com> Change-Id: I1fb8fd6134432ecfb44ad242c66ccd8280ab9b43 Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
This commit is contained in:
committed by
Treehugger Robot
parent
b4c03a5c24
commit
31e5697c39
@@ -6,6 +6,7 @@
|
||||
* Copyright 2020 Google LLC
|
||||
*/
|
||||
#include <linux/iova.h>
|
||||
#include <linux/pm_qos.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
@@ -144,6 +145,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_gic_v3_set_affinity);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sync_txn_recvd);
|
||||
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_show_max_freq);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_slab_alloc_node);
|
||||
|
||||
@@ -16,6 +16,23 @@ DECLARE_HOOK(android_vh_try_to_freeze_todo_unfrozen,
|
||||
TP_PROTO(struct task_struct *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));
|
||||
|
||||
#endif /* _TRACE_HOOK_POWER_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/export.h>
|
||||
#include <trace/events/power.h>
|
||||
#include <trace/hooks/power.h>
|
||||
|
||||
/*
|
||||
* locking rule: all changes to constraints or notifiers lists
|
||||
@@ -556,6 +557,7 @@ int freq_qos_add_request(struct freq_constraints *qos,
|
||||
req->type = 0;
|
||||
}
|
||||
|
||||
trace_android_vh_freq_qos_add_request(qos, req, type, value, ret);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(freq_qos_add_request);
|
||||
@@ -580,6 +582,7 @@ int freq_qos_update_request(struct freq_qos_request *req, s32 new_value)
|
||||
"%s() called for unknown object\n", __func__))
|
||||
return -EINVAL;
|
||||
|
||||
trace_android_vh_freq_qos_update_request(req, new_value);
|
||||
if (req->pnode.prio == new_value)
|
||||
return 0;
|
||||
|
||||
@@ -608,6 +611,7 @@ int freq_qos_remove_request(struct freq_qos_request *req)
|
||||
"%s() called for unknown object\n", __func__))
|
||||
return -EINVAL;
|
||||
|
||||
trace_android_vh_freq_qos_remove_request(req);
|
||||
ret = freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
|
||||
req->qos = NULL;
|
||||
req->type = 0;
|
||||
|
||||
Reference in New Issue
Block a user