Ram Chandrasekar | 02592fa | 2017-05-16 17:03:02 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2017 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 thermal_virtual |
| 15 | |
| 16 | #if !defined(_TRACE_VIRTUAL_H) || defined(TRACE_HEADER_MULTI_READ) |
| 17 | #define _TRACE_VIRTUAL_H |
| 18 | |
| 19 | #include <linux/thermal.h> |
| 20 | #include <linux/tracepoint.h> |
| 21 | |
| 22 | TRACE_EVENT(virtual_temperature, |
| 23 | |
| 24 | TP_PROTO(struct thermal_zone_device *virt_tz, |
| 25 | struct thermal_zone_device *tz, int sens_temp, |
| 26 | int est_temp), |
| 27 | |
| 28 | TP_ARGS(virt_tz, tz, sens_temp, est_temp), |
| 29 | |
| 30 | TP_STRUCT__entry( |
| 31 | __string(virt_zone, virt_tz->type) |
| 32 | __string(therm_zone, tz->type) |
| 33 | __field(int, sens_temp) |
| 34 | __field(int, est_temp) |
| 35 | ), |
| 36 | |
| 37 | TP_fast_assign( |
| 38 | __assign_str(virt_zone, virt_tz->type); |
| 39 | __assign_str(therm_zone, tz->type); |
| 40 | __entry->sens_temp = sens_temp; |
| 41 | __entry->est_temp = est_temp; |
| 42 | ), |
| 43 | |
| 44 | TP_printk("virt_zone=%s zone=%s temp=%d virtual zone estimated temp=%d", |
| 45 | __get_str(virt_zone), __get_str(therm_zone), |
| 46 | __entry->sens_temp, |
| 47 | __entry->est_temp) |
| 48 | ); |
| 49 | |
| 50 | #endif /* _TRACE_VIRTUAL_H */ |
| 51 | |
| 52 | /* This part must be outside protection */ |
| 53 | #include <trace/define_trace.h> |