From: Woosung Lee Date: Wed, 20 Aug 2014 05:53:14 +0000 (+0900) Subject: PM: Add debugging information for pm_qos. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=779b80b993df82143ed55a0e01441426789aadc3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git PM: Add debugging information for pm_qos. During debugging or profiling, pm_qos list like below is useful information. device_throughput default value: 0 target value: 468000 requests: ffffffc0012896f8: 0 ffffffc06f2f0458: 0 But only pm_qos_request declared for global name space could find what it is. If pm_qos_request declared in local name space, its address doesn't appeared in System.map file. So add more information about pm_qos_request's position like below. device_throughput default value: 0 target value: 468000 requests: ffffffc0012896f8(lpass_probe:1027): 0 ffffffc06f2f0458(fimg2d_pm_qos_add_bus:170): 0 Change-Id: Iae92bcc261054a0818a4f349e15e450652b53d1a Signed-off-by: Woosung Lee --- diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 97e0bf61c565..7b729077347f 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -52,10 +52,16 @@ enum pm_qos_flags_status { #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) #define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1) +#define pm_qos_add_request(arg...) do { \ + pm_qos_add_request_trace((char *)__func__, __LINE__, ##arg); \ +} while(0) + struct pm_qos_request { struct plist_node node; int pm_qos_class; struct delayed_work work; /* for pm_qos_update_request_timeout */ + char *func; + unsigned int line; }; struct pm_qos_flags_request { @@ -131,7 +137,8 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, bool pm_qos_update_flags(struct pm_qos_flags *pqf, struct pm_qos_flags_request *req, enum pm_qos_req_action action, s32 val); -void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, +void pm_qos_add_request_trace(char *func, unsigned int line, + struct pm_qos_request *req, int pm_qos_class, s32 value); void pm_qos_update_request(struct pm_qos_request *req, s32 new_value); diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 02d95c9d9a1a..26ffa3a02d06 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -523,7 +523,8 @@ static void pm_qos_work_fn(struct work_struct *work) * removal. */ -void pm_qos_add_request(struct pm_qos_request *req, +void pm_qos_add_request_trace(char *func, unsigned int line, + struct pm_qos_request *req, int pm_qos_class, s32 value) { if (!req) /*guard against callers passing in null */ @@ -534,12 +535,14 @@ void pm_qos_add_request(struct pm_qos_request *req, return; } req->pm_qos_class = pm_qos_class; + req->func = func; + req->line = line; INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); trace_pm_qos_add_request(pm_qos_class, value); pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, &req->node, PM_QOS_ADD_REQ, value); } -EXPORT_SYMBOL_GPL(pm_qos_add_request); +EXPORT_SYMBOL_GPL(pm_qos_add_request_trace); /** * pm_qos_update_request - modifies an existing qos request @@ -765,7 +768,6 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, return count; } - static int __init pm_qos_power_init(void) { int ret = 0;