PM: Add debugging information for pm_qos.
authorWoosung Lee <wstar.lee@samsung.com>
Wed, 20 Aug 2014 05:53:14 +0000 (14:53 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:00 +0000 (17:09 +0900)
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 <wstar.lee@samsung.com>
include/linux/pm_qos.h
kernel/power/qos.c

index 97e0bf61c565c670286c077ccd11491410f288ac..7b729077347fee1437e1c70fd5ebe4a2fff391e9 100644 (file)
@@ -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);
index 02d95c9d9a1aa429f133507fb2ecae07755c5c72..26ffa3a02d06f201b72b5d65ec3c3724a6534fbe 100644 (file)
@@ -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;