diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/pm_runtime.h | 2 | ||||
| -rw-r--r-- | include/linux/suspend.h | 1 | ||||
| -rw-r--r-- | include/trace/events/power.h | 173 |
3 files changed, 174 insertions, 2 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 7d7e09efff9b..6fa7cea25da9 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -37,7 +37,6 @@ extern void pm_runtime_enable(struct device *dev); | |||
| 37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
| 38 | extern void pm_runtime_allow(struct device *dev); | 38 | extern void pm_runtime_allow(struct device *dev); |
| 39 | extern void pm_runtime_forbid(struct device *dev); | 39 | extern void pm_runtime_forbid(struct device *dev); |
| 40 | extern int pm_generic_runtime_idle(struct device *dev); | ||
| 41 | extern int pm_generic_runtime_suspend(struct device *dev); | 40 | extern int pm_generic_runtime_suspend(struct device *dev); |
| 42 | extern int pm_generic_runtime_resume(struct device *dev); | 41 | extern int pm_generic_runtime_resume(struct device *dev); |
| 43 | extern void pm_runtime_no_callbacks(struct device *dev); | 42 | extern void pm_runtime_no_callbacks(struct device *dev); |
| @@ -143,7 +142,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; } | |||
| 143 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 142 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
| 144 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 143 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
| 145 | 144 | ||
| 146 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } | ||
| 147 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | 145 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } |
| 148 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | 146 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } |
| 149 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 147 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index d4e3f16d5e89..f73cabf59012 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -363,6 +363,7 @@ extern bool pm_wakeup_pending(void); | |||
| 363 | extern bool pm_get_wakeup_count(unsigned int *count, bool block); | 363 | extern bool pm_get_wakeup_count(unsigned int *count, bool block); |
| 364 | extern bool pm_save_wakeup_count(unsigned int count); | 364 | extern bool pm_save_wakeup_count(unsigned int count); |
| 365 | extern void pm_wakep_autosleep_enabled(bool set); | 365 | extern void pm_wakep_autosleep_enabled(bool set); |
| 366 | extern void pm_print_active_wakeup_sources(void); | ||
| 366 | 367 | ||
| 367 | static inline void lock_system_sleep(void) | 368 | static inline void lock_system_sleep(void) |
| 368 | { | 369 | { |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 427acab5d69a..8e42410bd159 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define _TRACE_POWER_H | 5 | #define _TRACE_POWER_H |
| 6 | 6 | ||
| 7 | #include <linux/ktime.h> | 7 | #include <linux/ktime.h> |
| 8 | #include <linux/pm_qos.h> | ||
| 8 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
| 9 | 10 | ||
| 10 | DECLARE_EVENT_CLASS(cpu, | 11 | DECLARE_EVENT_CLASS(cpu, |
| @@ -177,6 +178,178 @@ DEFINE_EVENT(power_domain, power_domain_target, | |||
| 177 | 178 | ||
| 178 | TP_ARGS(name, state, cpu_id) | 179 | TP_ARGS(name, state, cpu_id) |
| 179 | ); | 180 | ); |
| 181 | |||
| 182 | /* | ||
| 183 | * The pm qos events are used for pm qos update | ||
| 184 | */ | ||
| 185 | DECLARE_EVENT_CLASS(pm_qos_request, | ||
| 186 | |||
| 187 | TP_PROTO(int pm_qos_class, s32 value), | ||
| 188 | |||
| 189 | TP_ARGS(pm_qos_class, value), | ||
| 190 | |||
| 191 | TP_STRUCT__entry( | ||
| 192 | __field( int, pm_qos_class ) | ||
| 193 | __field( s32, value ) | ||
| 194 | ), | ||
| 195 | |||
| 196 | TP_fast_assign( | ||
| 197 | __entry->pm_qos_class = pm_qos_class; | ||
| 198 | __entry->value = value; | ||
| 199 | ), | ||
| 200 | |||
| 201 | TP_printk("pm_qos_class=%s value=%d", | ||
| 202 | __print_symbolic(__entry->pm_qos_class, | ||
| 203 | { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, | ||
| 204 | { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, | ||
| 205 | { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), | ||
| 206 | __entry->value) | ||
| 207 | ); | ||
| 208 | |||
| 209 | DEFINE_EVENT(pm_qos_request, pm_qos_add_request, | ||
| 210 | |||
| 211 | TP_PROTO(int pm_qos_class, s32 value), | ||
| 212 | |||
| 213 | TP_ARGS(pm_qos_class, value) | ||
| 214 | ); | ||
| 215 | |||
| 216 | DEFINE_EVENT(pm_qos_request, pm_qos_update_request, | ||
| 217 | |||
| 218 | TP_PROTO(int pm_qos_class, s32 value), | ||
| 219 | |||
| 220 | TP_ARGS(pm_qos_class, value) | ||
| 221 | ); | ||
| 222 | |||
| 223 | DEFINE_EVENT(pm_qos_request, pm_qos_remove_request, | ||
| 224 | |||
| 225 | TP_PROTO(int pm_qos_class, s32 value), | ||
| 226 | |||
| 227 | TP_ARGS(pm_qos_class, value) | ||
| 228 | ); | ||
| 229 | |||
| 230 | TRACE_EVENT(pm_qos_update_request_timeout, | ||
| 231 | |||
| 232 | TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us), | ||
| 233 | |||
| 234 | TP_ARGS(pm_qos_class, value, timeout_us), | ||
| 235 | |||
| 236 | TP_STRUCT__entry( | ||
| 237 | __field( int, pm_qos_class ) | ||
| 238 | __field( s32, value ) | ||
| 239 | __field( unsigned long, timeout_us ) | ||
| 240 | ), | ||
| 241 | |||
| 242 | TP_fast_assign( | ||
| 243 | __entry->pm_qos_class = pm_qos_class; | ||
| 244 | __entry->value = value; | ||
| 245 | __entry->timeout_us = timeout_us; | ||
| 246 | ), | ||
| 247 | |||
| 248 | TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld", | ||
| 249 | __print_symbolic(__entry->pm_qos_class, | ||
| 250 | { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, | ||
| 251 | { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, | ||
| 252 | { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), | ||
| 253 | __entry->value, __entry->timeout_us) | ||
| 254 | ); | ||
| 255 | |||
| 256 | DECLARE_EVENT_CLASS(pm_qos_update, | ||
| 257 | |||
| 258 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), | ||
| 259 | |||
| 260 | TP_ARGS(action, prev_value, curr_value), | ||
| 261 | |||
| 262 | TP_STRUCT__entry( | ||
| 263 | __field( enum pm_qos_req_action, action ) | ||
| 264 | __field( int, prev_value ) | ||
| 265 | __field( int, curr_value ) | ||
| 266 | ), | ||
| 267 | |||
| 268 | TP_fast_assign( | ||
| 269 | __entry->action = action; | ||
| 270 | __entry->prev_value = prev_value; | ||
| 271 | __entry->curr_value = curr_value; | ||
| 272 | ), | ||
| 273 | |||
| 274 | TP_printk("action=%s prev_value=%d curr_value=%d", | ||
| 275 | __print_symbolic(__entry->action, | ||
| 276 | { PM_QOS_ADD_REQ, "ADD_REQ" }, | ||
| 277 | { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, | ||
| 278 | { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), | ||
| 279 | __entry->prev_value, __entry->curr_value) | ||
| 280 | ); | ||
| 281 | |||
| 282 | DEFINE_EVENT(pm_qos_update, pm_qos_update_target, | ||
| 283 | |||
| 284 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), | ||
| 285 | |||
| 286 | TP_ARGS(action, prev_value, curr_value) | ||
| 287 | ); | ||
| 288 | |||
| 289 | DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags, | ||
| 290 | |||
| 291 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), | ||
| 292 | |||
| 293 | TP_ARGS(action, prev_value, curr_value), | ||
| 294 | |||
| 295 | TP_printk("action=%s prev_value=0x%x curr_value=0x%x", | ||
| 296 | __print_symbolic(__entry->action, | ||
| 297 | { PM_QOS_ADD_REQ, "ADD_REQ" }, | ||
| 298 | { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, | ||
| 299 | { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), | ||
| 300 | __entry->prev_value, __entry->curr_value) | ||
| 301 | ); | ||
| 302 | |||
| 303 | DECLARE_EVENT_CLASS(dev_pm_qos_request, | ||
| 304 | |||
| 305 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, | ||
| 306 | s32 new_value), | ||
| 307 | |||
| 308 | TP_ARGS(name, type, new_value), | ||
| 309 | |||
| 310 | TP_STRUCT__entry( | ||
| 311 | __string( name, name ) | ||
| 312 | __field( enum dev_pm_qos_req_type, type ) | ||
| 313 | __field( s32, new_value ) | ||
| 314 | ), | ||
| 315 | |||
| 316 | TP_fast_assign( | ||
| 317 | __assign_str(name, name); | ||
| 318 | __entry->type = type; | ||
| 319 | __entry->new_value = new_value; | ||
| 320 | ), | ||
| 321 | |||
| 322 | TP_printk("device=%s type=%s new_value=%d", | ||
| 323 | __get_str(name), | ||
| 324 | __print_symbolic(__entry->type, | ||
| 325 | { DEV_PM_QOS_LATENCY, "DEV_PM_QOS_LATENCY" }, | ||
| 326 | { DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS" }), | ||
| 327 | __entry->new_value) | ||
| 328 | ); | ||
| 329 | |||
| 330 | DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request, | ||
| 331 | |||
| 332 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, | ||
| 333 | s32 new_value), | ||
| 334 | |||
| 335 | TP_ARGS(name, type, new_value) | ||
| 336 | ); | ||
| 337 | |||
| 338 | DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_update_request, | ||
| 339 | |||
| 340 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, | ||
| 341 | s32 new_value), | ||
| 342 | |||
| 343 | TP_ARGS(name, type, new_value) | ||
| 344 | ); | ||
| 345 | |||
| 346 | DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request, | ||
| 347 | |||
| 348 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, | ||
| 349 | s32 new_value), | ||
| 350 | |||
| 351 | TP_ARGS(name, type, new_value) | ||
| 352 | ); | ||
| 180 | #endif /* _TRACE_POWER_H */ | 353 | #endif /* _TRACE_POWER_H */ |
| 181 | 354 | ||
| 182 | /* This part must be outside protection */ | 355 | /* This part must be outside protection */ |
