Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM power |
| 3 | |
| 4 | #if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_POWER_H |
| 6 | |
| 7 | #include <linux/ktime.h> |
Sahara | 247e9ee | 2013-06-21 11:12:28 +0900 | [diff] [blame] | 8 | #include <linux/pm_qos.h> |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 9 | #include <linux/tracepoint.h> |
Steven Rostedt (Red Hat) | af658dc | 2015-04-29 14:36:05 -0400 | [diff] [blame] | 10 | #include <linux/trace_events.h> |
Todd E Brandt | bb3632c | 2014-06-06 05:40:17 -0700 | [diff] [blame] | 11 | |
| 12 | #define TPS(x) tracepoint_string(x) |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 13 | |
Thomas Renninger | 25e4193 | 2011-01-03 17:50:44 +0100 | [diff] [blame] | 14 | DECLARE_EVENT_CLASS(cpu, |
| 15 | |
| 16 | TP_PROTO(unsigned int state, unsigned int cpu_id), |
| 17 | |
| 18 | TP_ARGS(state, cpu_id), |
| 19 | |
| 20 | TP_STRUCT__entry( |
| 21 | __field( u32, state ) |
| 22 | __field( u32, cpu_id ) |
| 23 | ), |
| 24 | |
| 25 | TP_fast_assign( |
| 26 | __entry->state = state; |
| 27 | __entry->cpu_id = cpu_id; |
| 28 | ), |
| 29 | |
| 30 | TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state, |
| 31 | (unsigned long)__entry->cpu_id) |
| 32 | ); |
| 33 | |
| 34 | DEFINE_EVENT(cpu, cpu_idle, |
| 35 | |
| 36 | TP_PROTO(unsigned int state, unsigned int cpu_id), |
| 37 | |
| 38 | TP_ARGS(state, cpu_id) |
| 39 | ); |
| 40 | |
Shilpasri G Bhat | 0306e48 | 2016-02-03 01:11:40 +0530 | [diff] [blame] | 41 | TRACE_EVENT(powernv_throttle, |
| 42 | |
| 43 | TP_PROTO(int chip_id, const char *reason, int pmax), |
| 44 | |
| 45 | TP_ARGS(chip_id, reason, pmax), |
| 46 | |
| 47 | TP_STRUCT__entry( |
| 48 | __field(int, chip_id) |
| 49 | __string(reason, reason) |
| 50 | __field(int, pmax) |
| 51 | ), |
| 52 | |
| 53 | TP_fast_assign( |
| 54 | __entry->chip_id = chip_id; |
| 55 | __assign_str(reason, reason); |
| 56 | __entry->pmax = pmax; |
| 57 | ), |
| 58 | |
| 59 | TP_printk("Chip %d Pmax %d %s", __entry->chip_id, |
| 60 | __entry->pmax, __get_str(reason)) |
| 61 | ); |
| 62 | |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 63 | TRACE_EVENT(pstate_sample, |
| 64 | |
| 65 | TP_PROTO(u32 core_busy, |
| 66 | u32 scaled_busy, |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 67 | u32 from, |
| 68 | u32 to, |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 69 | u64 mperf, |
| 70 | u64 aperf, |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 71 | u64 tsc, |
Srinivas Pandruvada | 3ba7bca | 2016-09-13 17:41:33 -0700 | [diff] [blame] | 72 | u32 freq, |
| 73 | u32 io_boost |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 74 | ), |
| 75 | |
| 76 | TP_ARGS(core_busy, |
| 77 | scaled_busy, |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 78 | from, |
| 79 | to, |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 80 | mperf, |
| 81 | aperf, |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 82 | tsc, |
Srinivas Pandruvada | 3ba7bca | 2016-09-13 17:41:33 -0700 | [diff] [blame] | 83 | freq, |
| 84 | io_boost |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 85 | ), |
| 86 | |
| 87 | TP_STRUCT__entry( |
| 88 | __field(u32, core_busy) |
| 89 | __field(u32, scaled_busy) |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 90 | __field(u32, from) |
| 91 | __field(u32, to) |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 92 | __field(u64, mperf) |
| 93 | __field(u64, aperf) |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 94 | __field(u64, tsc) |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 95 | __field(u32, freq) |
Srinivas Pandruvada | 3ba7bca | 2016-09-13 17:41:33 -0700 | [diff] [blame] | 96 | __field(u32, io_boost) |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 97 | ), |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 98 | |
| 99 | TP_fast_assign( |
| 100 | __entry->core_busy = core_busy; |
| 101 | __entry->scaled_busy = scaled_busy; |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 102 | __entry->from = from; |
| 103 | __entry->to = to; |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 104 | __entry->mperf = mperf; |
| 105 | __entry->aperf = aperf; |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 106 | __entry->tsc = tsc; |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 107 | __entry->freq = freq; |
Srinivas Pandruvada | 3ba7bca | 2016-09-13 17:41:33 -0700 | [diff] [blame] | 108 | __entry->io_boost = io_boost; |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 109 | ), |
| 110 | |
Srinivas Pandruvada | 3ba7bca | 2016-09-13 17:41:33 -0700 | [diff] [blame] | 111 | TP_printk("core_busy=%lu scaled=%lu from=%lu to=%lu mperf=%llu aperf=%llu tsc=%llu freq=%lu io_boost=%lu", |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 112 | (unsigned long)__entry->core_busy, |
| 113 | (unsigned long)__entry->scaled_busy, |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 114 | (unsigned long)__entry->from, |
| 115 | (unsigned long)__entry->to, |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 116 | (unsigned long long)__entry->mperf, |
| 117 | (unsigned long long)__entry->aperf, |
Doug Smythies | 4055fad | 2015-04-11 21:10:26 -0700 | [diff] [blame] | 118 | (unsigned long long)__entry->tsc, |
Srinivas Pandruvada | 3ba7bca | 2016-09-13 17:41:33 -0700 | [diff] [blame] | 119 | (unsigned long)__entry->freq, |
| 120 | (unsigned long)__entry->io_boost |
Dirk Brandewie | b69880f | 2014-01-16 10:32:25 -0800 | [diff] [blame] | 121 | ) |
| 122 | |
| 123 | ); |
| 124 | |
Thomas Renninger | 25e4193 | 2011-01-03 17:50:44 +0100 | [diff] [blame] | 125 | /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ |
| 126 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING |
| 127 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING |
| 128 | |
| 129 | #define PWR_EVENT_EXIT -1 |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 130 | #endif |
| 131 | |
Todd E Brandt | e8bca47 | 2014-06-10 07:31:22 -0700 | [diff] [blame] | 132 | #define pm_verb_symbolic(event) \ |
| 133 | __print_symbolic(event, \ |
| 134 | { PM_EVENT_SUSPEND, "suspend" }, \ |
| 135 | { PM_EVENT_RESUME, "resume" }, \ |
| 136 | { PM_EVENT_FREEZE, "freeze" }, \ |
| 137 | { PM_EVENT_QUIESCE, "quiesce" }, \ |
| 138 | { PM_EVENT_HIBERNATE, "hibernate" }, \ |
| 139 | { PM_EVENT_THAW, "thaw" }, \ |
| 140 | { PM_EVENT_RESTORE, "restore" }, \ |
| 141 | { PM_EVENT_RECOVER, "recover" }) |
| 142 | |
Thomas Renninger | 25e4193 | 2011-01-03 17:50:44 +0100 | [diff] [blame] | 143 | DEFINE_EVENT(cpu, cpu_frequency, |
| 144 | |
| 145 | TP_PROTO(unsigned int frequency, unsigned int cpu_id), |
| 146 | |
| 147 | TP_ARGS(frequency, cpu_id) |
| 148 | ); |
| 149 | |
Todd E Brandt | e8bca47 | 2014-06-10 07:31:22 -0700 | [diff] [blame] | 150 | TRACE_EVENT(device_pm_callback_start, |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 151 | |
Todd E Brandt | e8bca47 | 2014-06-10 07:31:22 -0700 | [diff] [blame] | 152 | TP_PROTO(struct device *dev, const char *pm_ops, int event), |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 153 | |
Todd E Brandt | e8bca47 | 2014-06-10 07:31:22 -0700 | [diff] [blame] | 154 | TP_ARGS(dev, pm_ops, event), |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 155 | |
| 156 | TP_STRUCT__entry( |
| 157 | __string(device, dev_name(dev)) |
| 158 | __string(driver, dev_driver_string(dev)) |
| 159 | __string(parent, dev->parent ? dev_name(dev->parent) : "none") |
| 160 | __string(pm_ops, pm_ops ? pm_ops : "none ") |
Todd E Brandt | e8bca47 | 2014-06-10 07:31:22 -0700 | [diff] [blame] | 161 | __field(int, event) |
| 162 | ), |
| 163 | |
| 164 | TP_fast_assign( |
| 165 | __assign_str(device, dev_name(dev)); |
| 166 | __assign_str(driver, dev_driver_string(dev)); |
| 167 | __assign_str(parent, |
| 168 | dev->parent ? dev_name(dev->parent) : "none"); |
| 169 | __assign_str(pm_ops, pm_ops ? pm_ops : "none "); |
| 170 | __entry->event = event; |
| 171 | ), |
| 172 | |
| 173 | TP_printk("%s %s, parent: %s, %s[%s]", __get_str(driver), |
| 174 | __get_str(device), __get_str(parent), __get_str(pm_ops), |
| 175 | pm_verb_symbolic(__entry->event)) |
| 176 | ); |
| 177 | |
| 178 | TRACE_EVENT(device_pm_callback_end, |
| 179 | |
| 180 | TP_PROTO(struct device *dev, int error), |
| 181 | |
| 182 | TP_ARGS(dev, error), |
| 183 | |
| 184 | TP_STRUCT__entry( |
| 185 | __string(device, dev_name(dev)) |
| 186 | __string(driver, dev_driver_string(dev)) |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 187 | __field(int, error) |
| 188 | ), |
| 189 | |
| 190 | TP_fast_assign( |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 191 | __assign_str(device, dev_name(dev)); |
| 192 | __assign_str(driver, dev_driver_string(dev)); |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 193 | __entry->error = error; |
| 194 | ), |
| 195 | |
Todd E Brandt | e8bca47 | 2014-06-10 07:31:22 -0700 | [diff] [blame] | 196 | TP_printk("%s %s, err=%d", |
| 197 | __get_str(driver), __get_str(device), __entry->error) |
Shuah Khan | 5364467 | 2013-07-26 13:30:20 -0600 | [diff] [blame] | 198 | ); |
| 199 | |
Todd E Brandt | bb3632c | 2014-06-06 05:40:17 -0700 | [diff] [blame] | 200 | TRACE_EVENT(suspend_resume, |
| 201 | |
| 202 | TP_PROTO(const char *action, int val, bool start), |
| 203 | |
| 204 | TP_ARGS(action, val, start), |
| 205 | |
| 206 | TP_STRUCT__entry( |
| 207 | __field(const char *, action) |
| 208 | __field(int, val) |
| 209 | __field(bool, start) |
| 210 | ), |
| 211 | |
| 212 | TP_fast_assign( |
| 213 | __entry->action = action; |
| 214 | __entry->val = val; |
| 215 | __entry->start = start; |
| 216 | ), |
| 217 | |
| 218 | TP_printk("%s[%u] %s", __entry->action, (unsigned int)__entry->val, |
| 219 | (__entry->start)?"begin":"end") |
| 220 | ); |
| 221 | |
Arve Hjønnevåg | 6791e36 | 2012-04-29 22:53:02 +0200 | [diff] [blame] | 222 | DECLARE_EVENT_CLASS(wakeup_source, |
| 223 | |
| 224 | TP_PROTO(const char *name, unsigned int state), |
| 225 | |
| 226 | TP_ARGS(name, state), |
| 227 | |
| 228 | TP_STRUCT__entry( |
| 229 | __string( name, name ) |
| 230 | __field( u64, state ) |
| 231 | ), |
| 232 | |
| 233 | TP_fast_assign( |
| 234 | __assign_str(name, name); |
| 235 | __entry->state = state; |
| 236 | ), |
| 237 | |
| 238 | TP_printk("%s state=0x%lx", __get_str(name), |
| 239 | (unsigned long)__entry->state) |
| 240 | ); |
| 241 | |
| 242 | DEFINE_EVENT(wakeup_source, wakeup_source_activate, |
| 243 | |
| 244 | TP_PROTO(const char *name, unsigned int state), |
| 245 | |
| 246 | TP_ARGS(name, state) |
| 247 | ); |
| 248 | |
| 249 | DEFINE_EVENT(wakeup_source, wakeup_source_deactivate, |
| 250 | |
| 251 | TP_PROTO(const char *name, unsigned int state), |
| 252 | |
| 253 | TP_ARGS(name, state) |
| 254 | ); |
| 255 | |
Jean Pihet | 74704ac | 2010-09-07 09:21:32 +0200 | [diff] [blame] | 256 | /* |
| 257 | * The clock events are used for clock enable/disable and for |
| 258 | * clock rate change |
| 259 | */ |
| 260 | DECLARE_EVENT_CLASS(clock, |
| 261 | |
| 262 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), |
| 263 | |
| 264 | TP_ARGS(name, state, cpu_id), |
| 265 | |
| 266 | TP_STRUCT__entry( |
| 267 | __string( name, name ) |
| 268 | __field( u64, state ) |
| 269 | __field( u64, cpu_id ) |
| 270 | ), |
| 271 | |
| 272 | TP_fast_assign( |
| 273 | __assign_str(name, name); |
| 274 | __entry->state = state; |
| 275 | __entry->cpu_id = cpu_id; |
| 276 | ), |
| 277 | |
| 278 | TP_printk("%s state=%lu cpu_id=%lu", __get_str(name), |
| 279 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) |
| 280 | ); |
| 281 | |
| 282 | DEFINE_EVENT(clock, clock_enable, |
| 283 | |
| 284 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), |
| 285 | |
| 286 | TP_ARGS(name, state, cpu_id) |
| 287 | ); |
| 288 | |
| 289 | DEFINE_EVENT(clock, clock_disable, |
| 290 | |
| 291 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), |
| 292 | |
| 293 | TP_ARGS(name, state, cpu_id) |
| 294 | ); |
| 295 | |
| 296 | DEFINE_EVENT(clock, clock_set_rate, |
| 297 | |
| 298 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), |
| 299 | |
| 300 | TP_ARGS(name, state, cpu_id) |
| 301 | ); |
| 302 | |
| 303 | /* |
| 304 | * The power domain events are used for power domains transitions |
| 305 | */ |
| 306 | DECLARE_EVENT_CLASS(power_domain, |
| 307 | |
| 308 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), |
| 309 | |
| 310 | TP_ARGS(name, state, cpu_id), |
| 311 | |
| 312 | TP_STRUCT__entry( |
| 313 | __string( name, name ) |
| 314 | __field( u64, state ) |
| 315 | __field( u64, cpu_id ) |
| 316 | ), |
| 317 | |
| 318 | TP_fast_assign( |
| 319 | __assign_str(name, name); |
| 320 | __entry->state = state; |
| 321 | __entry->cpu_id = cpu_id; |
| 322 | ), |
| 323 | |
| 324 | TP_printk("%s state=%lu cpu_id=%lu", __get_str(name), |
| 325 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) |
| 326 | ); |
| 327 | |
| 328 | DEFINE_EVENT(power_domain, power_domain_target, |
| 329 | |
| 330 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), |
| 331 | |
| 332 | TP_ARGS(name, state, cpu_id) |
| 333 | ); |
Sahara | 247e9ee | 2013-06-21 11:12:28 +0900 | [diff] [blame] | 334 | |
| 335 | /* |
| 336 | * The pm qos events are used for pm qos update |
| 337 | */ |
Sahara | ae8822b | 2013-06-21 11:12:29 +0900 | [diff] [blame] | 338 | DECLARE_EVENT_CLASS(pm_qos_request, |
| 339 | |
| 340 | TP_PROTO(int pm_qos_class, s32 value), |
| 341 | |
| 342 | TP_ARGS(pm_qos_class, value), |
| 343 | |
| 344 | TP_STRUCT__entry( |
| 345 | __field( int, pm_qos_class ) |
| 346 | __field( s32, value ) |
| 347 | ), |
| 348 | |
| 349 | TP_fast_assign( |
| 350 | __entry->pm_qos_class = pm_qos_class; |
| 351 | __entry->value = value; |
| 352 | ), |
| 353 | |
| 354 | TP_printk("pm_qos_class=%s value=%d", |
| 355 | __print_symbolic(__entry->pm_qos_class, |
| 356 | { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, |
| 357 | { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, |
| 358 | { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), |
| 359 | __entry->value) |
| 360 | ); |
| 361 | |
| 362 | DEFINE_EVENT(pm_qos_request, pm_qos_add_request, |
| 363 | |
| 364 | TP_PROTO(int pm_qos_class, s32 value), |
| 365 | |
| 366 | TP_ARGS(pm_qos_class, value) |
| 367 | ); |
| 368 | |
| 369 | DEFINE_EVENT(pm_qos_request, pm_qos_update_request, |
| 370 | |
| 371 | TP_PROTO(int pm_qos_class, s32 value), |
| 372 | |
| 373 | TP_ARGS(pm_qos_class, value) |
| 374 | ); |
| 375 | |
| 376 | DEFINE_EVENT(pm_qos_request, pm_qos_remove_request, |
| 377 | |
| 378 | TP_PROTO(int pm_qos_class, s32 value), |
| 379 | |
| 380 | TP_ARGS(pm_qos_class, value) |
| 381 | ); |
| 382 | |
| 383 | TRACE_EVENT(pm_qos_update_request_timeout, |
| 384 | |
| 385 | TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us), |
| 386 | |
| 387 | TP_ARGS(pm_qos_class, value, timeout_us), |
| 388 | |
| 389 | TP_STRUCT__entry( |
| 390 | __field( int, pm_qos_class ) |
| 391 | __field( s32, value ) |
| 392 | __field( unsigned long, timeout_us ) |
| 393 | ), |
| 394 | |
| 395 | TP_fast_assign( |
| 396 | __entry->pm_qos_class = pm_qos_class; |
| 397 | __entry->value = value; |
| 398 | __entry->timeout_us = timeout_us; |
| 399 | ), |
| 400 | |
| 401 | TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld", |
| 402 | __print_symbolic(__entry->pm_qos_class, |
| 403 | { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, |
| 404 | { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, |
| 405 | { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), |
| 406 | __entry->value, __entry->timeout_us) |
| 407 | ); |
| 408 | |
Sahara | 247e9ee | 2013-06-21 11:12:28 +0900 | [diff] [blame] | 409 | DECLARE_EVENT_CLASS(pm_qos_update, |
| 410 | |
| 411 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), |
| 412 | |
| 413 | TP_ARGS(action, prev_value, curr_value), |
| 414 | |
| 415 | TP_STRUCT__entry( |
| 416 | __field( enum pm_qos_req_action, action ) |
| 417 | __field( int, prev_value ) |
| 418 | __field( int, curr_value ) |
| 419 | ), |
| 420 | |
| 421 | TP_fast_assign( |
| 422 | __entry->action = action; |
| 423 | __entry->prev_value = prev_value; |
| 424 | __entry->curr_value = curr_value; |
| 425 | ), |
| 426 | |
| 427 | TP_printk("action=%s prev_value=%d curr_value=%d", |
| 428 | __print_symbolic(__entry->action, |
| 429 | { PM_QOS_ADD_REQ, "ADD_REQ" }, |
| 430 | { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, |
| 431 | { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), |
| 432 | __entry->prev_value, __entry->curr_value) |
| 433 | ); |
| 434 | |
| 435 | DEFINE_EVENT(pm_qos_update, pm_qos_update_target, |
| 436 | |
| 437 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), |
| 438 | |
| 439 | TP_ARGS(action, prev_value, curr_value) |
| 440 | ); |
| 441 | |
| 442 | DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags, |
| 443 | |
| 444 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), |
| 445 | |
| 446 | TP_ARGS(action, prev_value, curr_value), |
| 447 | |
| 448 | TP_printk("action=%s prev_value=0x%x curr_value=0x%x", |
| 449 | __print_symbolic(__entry->action, |
| 450 | { PM_QOS_ADD_REQ, "ADD_REQ" }, |
| 451 | { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, |
| 452 | { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), |
| 453 | __entry->prev_value, __entry->curr_value) |
| 454 | ); |
Sahara | 96d9d0b | 2013-06-21 11:12:30 +0900 | [diff] [blame] | 455 | |
| 456 | DECLARE_EVENT_CLASS(dev_pm_qos_request, |
| 457 | |
| 458 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, |
| 459 | s32 new_value), |
| 460 | |
| 461 | TP_ARGS(name, type, new_value), |
| 462 | |
| 463 | TP_STRUCT__entry( |
| 464 | __string( name, name ) |
| 465 | __field( enum dev_pm_qos_req_type, type ) |
| 466 | __field( s32, new_value ) |
| 467 | ), |
| 468 | |
| 469 | TP_fast_assign( |
| 470 | __assign_str(name, name); |
| 471 | __entry->type = type; |
| 472 | __entry->new_value = new_value; |
| 473 | ), |
| 474 | |
| 475 | TP_printk("device=%s type=%s new_value=%d", |
| 476 | __get_str(name), |
| 477 | __print_symbolic(__entry->type, |
Rafael J. Wysocki | b02f669 | 2014-02-11 00:35:23 +0100 | [diff] [blame] | 478 | { DEV_PM_QOS_RESUME_LATENCY, "DEV_PM_QOS_RESUME_LATENCY" }, |
| 479 | { DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS" }), |
Sahara | 96d9d0b | 2013-06-21 11:12:30 +0900 | [diff] [blame] | 480 | __entry->new_value) |
| 481 | ); |
| 482 | |
| 483 | DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request, |
| 484 | |
| 485 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, |
| 486 | s32 new_value), |
| 487 | |
| 488 | TP_ARGS(name, type, new_value) |
| 489 | ); |
| 490 | |
| 491 | DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_update_request, |
| 492 | |
| 493 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, |
| 494 | s32 new_value), |
| 495 | |
| 496 | TP_ARGS(name, type, new_value) |
| 497 | ); |
| 498 | |
| 499 | DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request, |
| 500 | |
| 501 | TP_PROTO(const char *name, enum dev_pm_qos_req_type type, |
| 502 | s32 new_value), |
| 503 | |
| 504 | TP_ARGS(name, type, new_value) |
| 505 | ); |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 506 | #endif /* _TRACE_POWER_H */ |
| 507 | |
| 508 | /* This part must be outside protection */ |
| 509 | #include <trace/define_trace.h> |