adding pm_qos trace support "patch" discussion
RFC 1/1 adding pm_qos trace support "patch" discussion
The following is a start on a patch for turning on some basic debug state dumping support for PM_QOS. It feels week to me and I would like some discussion and ideas on what to trace, that I could use to make it better.
FWIW I did look closely at the statitsics gathering in the android wake lock patches used by android. But most of that tracing support was around timer and time out tracing. As pm_qos doesn't have fire and forget time-out requests most of that debug support doesn't really apply.
Also, I think looking into using f-trace somehow. I think it may have a natural fit but, any advice would be very much welcome.
Attached is a starter patch, it compiles but has not been booted.
I'm posting it early to get feed back and ideas for state, stats and tracing that could be helpful.
The user mode tracing ABI is to read from the misc device for the particular pm_qos request class of intrest to get a dump of all the requests currently in the list.
I think its not a very good design, but can't think of more that cosmetic changes to make it better. I'm also on the fence for making the tracing part of the API and not a compile time switch. Using the wake lock /proc interface I have found to be *realy* helpful in getting the android power mangement to start working on the moorestown and can't think of a good reason to turn it off at the moment. As the application of pm_qos is expected to evolve to include android suspend blocking it may make sence to have some debug tracing just there all the time.
Note: this patch applies to James Bottomly's plist version of pm_qos we are working on to provide equivelent (well mostly) infrastructure to implement suspend blockers on top of pm_qos with.
Design comments and advice welcome!
--mgross
Quoted 1 line
From
b9b135f39afca8f64e67e1babe4f93f45f81e891Mon Sep 17 00:00:00 2001
From: markgross <[email protected]>
Date: Sat, 19 Jun 2010 20:48:27 -0700
Subject: [PATCH] add pq_qos_trace support for getting the current collection of pm_qos
requests from the plists and dumping out via a read function for the misc device that is used by user mode to register its requests.
--- include/linux/pm_qos_params.h | 10 ++++- kernel/pm_qos_params.c | 74 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 78 insertions(+), 6 deletions(-)
include/linux/pm_qos_params.h +8 -2
@@ -15,13 +15,19 @@#define PM_QOS_NUM_CLASSES 4#define PM_QOS_DEFAULT_VALUE -1 - +#define PM_QOS_TRACING struct pm_qos_request_list {struct plist_node list;int pm_qos_class; +#ifdef PM_QOS_TRACING +#define ID_LEN 64 +char requester[ID_LEN ]; +struct timespec lastupdate; +#endif }; -void pm_qos_add_request (struct pm_qos_request_list *l,int pm_qos_class,s32 value); +void pm_qos_add_request (struct pm_qos_request_list *l,int pm_qos_class, +s32 value);void pm_qos_update_request (struct pm_qos_request_list *pm_qos_req,s32 new_value);void pm_qos_remove_request (struct pm_qos_request_list *pm_qos_req);
kernel/pm_qos_params.c +70 -4
126 lines not on this page · raw message
Signature · 1 line
1.6.3.3