Priyanka Mathur | 26b4a4b | 2012-11-05 13:45:45 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #undef TRACE_SYSTEM |
| 14 | #define TRACE_SYSTEM msm_low_power |
| 15 | |
| 16 | #if !defined(_TRACE_MSM_LOW_POWER_H_) || defined(TRACE_HEADER_MULTI_READ) |
| 17 | #define _TRACE_MSM_LOW_POWER_H_ |
| 18 | |
| 19 | #include <linux/tracepoint.h> |
| 20 | |
| 21 | DECLARE_EVENT_CLASS(msm_pm_enter, |
| 22 | |
| 23 | TP_PROTO(unsigned int cpu, uint32_t latency, |
| 24 | uint32_t sleep_us, uint32_t wake_up), |
| 25 | |
| 26 | TP_ARGS(cpu, latency, sleep_us, wake_up), |
| 27 | |
| 28 | TP_STRUCT__entry( |
| 29 | __field(unsigned int, cpu) |
| 30 | __field(uint32_t, latency) |
| 31 | __field(uint32_t, sleep_us) |
| 32 | __field(uint32_t, wake_up) |
| 33 | ), |
| 34 | |
| 35 | TP_fast_assign( |
| 36 | __entry->cpu = cpu; |
| 37 | __entry->latency = latency; |
| 38 | __entry->sleep_us = sleep_us; |
| 39 | __entry->wake_up = wake_up; |
| 40 | ), |
| 41 | |
| 42 | TP_printk("cpu: %u latency: %uus sleep: %uus wake_up: %u", |
| 43 | __entry->cpu, |
| 44 | __entry->latency, |
| 45 | __entry->sleep_us, |
| 46 | __entry->wake_up) |
| 47 | ); |
| 48 | |
| 49 | DEFINE_EVENT(msm_pm_enter, msm_pm_enter_pc, |
| 50 | |
| 51 | TP_PROTO(unsigned int cpu, uint32_t latency, |
| 52 | uint32_t sleep_us, uint32_t wake_up), |
| 53 | |
| 54 | TP_ARGS(cpu, latency, sleep_us, wake_up) |
| 55 | ); |
| 56 | |
| 57 | DEFINE_EVENT(msm_pm_enter, msm_pm_enter_ret, |
| 58 | |
| 59 | TP_PROTO(unsigned int cpu, uint32_t latency, |
| 60 | uint32_t sleep_us, uint32_t wake_up), |
| 61 | |
| 62 | TP_ARGS(cpu, latency, sleep_us, wake_up) |
| 63 | ); |
| 64 | |
| 65 | DEFINE_EVENT(msm_pm_enter, msm_pm_enter_spc, |
| 66 | |
| 67 | TP_PROTO(unsigned int cpu, uint32_t latency, |
| 68 | uint32_t sleep_us, uint32_t wake_up), |
| 69 | |
| 70 | TP_ARGS(cpu, latency, sleep_us, wake_up) |
| 71 | ); |
| 72 | |
| 73 | DEFINE_EVENT(msm_pm_enter, msm_pm_enter_wfi, |
| 74 | |
| 75 | TP_PROTO(unsigned int cpu, uint32_t latency, |
| 76 | uint32_t sleep_us, uint32_t wake_up), |
| 77 | |
| 78 | TP_ARGS(cpu, latency, sleep_us, wake_up) |
| 79 | ); |
| 80 | |
| 81 | DECLARE_EVENT_CLASS(msm_pm_exit, |
| 82 | |
| 83 | TP_PROTO(unsigned int cpu, bool success), |
| 84 | |
| 85 | TP_ARGS(cpu, success), |
| 86 | |
| 87 | TP_STRUCT__entry( |
| 88 | __field(unsigned int , cpu) |
| 89 | __field(int, success) |
| 90 | ), |
| 91 | |
| 92 | TP_fast_assign( |
| 93 | __entry->cpu = cpu; |
| 94 | __entry->success = success; |
| 95 | ), |
| 96 | |
| 97 | TP_printk("cpu:%u success:%d", |
| 98 | __entry->cpu, |
| 99 | __entry->success) |
| 100 | ); |
| 101 | |
| 102 | DEFINE_EVENT(msm_pm_exit, msm_pm_exit_pc, |
| 103 | |
| 104 | TP_PROTO(unsigned int cpu, bool success), |
| 105 | |
| 106 | TP_ARGS(cpu, success) |
| 107 | ); |
| 108 | |
| 109 | DEFINE_EVENT(msm_pm_exit, msm_pm_exit_ret, |
| 110 | |
| 111 | TP_PROTO(unsigned int cpu, bool success), |
| 112 | |
| 113 | TP_ARGS(cpu, success) |
| 114 | ); |
| 115 | |
| 116 | DEFINE_EVENT(msm_pm_exit, msm_pm_exit_spc, |
| 117 | |
| 118 | TP_PROTO(unsigned int cpu, bool success), |
| 119 | |
| 120 | TP_ARGS(cpu, success) |
| 121 | ); |
| 122 | |
| 123 | DEFINE_EVENT(msm_pm_exit, msm_pm_exit_wfi, |
| 124 | |
| 125 | TP_PROTO(unsigned int cpu, bool success), |
| 126 | |
| 127 | TP_ARGS(cpu, success) |
| 128 | ); |
Priyanka Mathur | b44bf57 | 2012-11-07 12:07:45 -0800 | [diff] [blame] | 129 | |
| 130 | TRACE_EVENT(lpm_resources, |
| 131 | |
| 132 | TP_PROTO(uint32_t sleep_value , char *name), |
| 133 | |
| 134 | TP_ARGS(sleep_value, name), |
| 135 | |
| 136 | TP_STRUCT__entry( |
| 137 | __field(uint32_t , sleep_value) |
| 138 | __string(name, name) |
| 139 | ), |
| 140 | |
| 141 | TP_fast_assign( |
| 142 | __entry->sleep_value = sleep_value; |
| 143 | __assign_str(name, name); |
| 144 | ), |
| 145 | |
| 146 | TP_printk("name:%s sleep_value:%d", |
| 147 | __get_str(name), |
| 148 | __entry->sleep_value) |
| 149 | ); |
Priyanka Mathur | 26b4a4b | 2012-11-05 13:45:45 -0800 | [diff] [blame] | 150 | #endif |
| 151 | #undef TRACE_INCLUDE_PATH |
| 152 | #define TRACE_INCLUDE_PATH . |
| 153 | #define TRACE_INCLUDE_FILE trace_msm_low_power |
| 154 | #include <trace/define_trace.h> |