diff options
| -rw-r--r-- | MAINTAINERS | 1 | ||||
| -rw-r--r-- | include/trace/events/devfreq.h | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 3671fdea5010..27ed10966c81 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -4552,6 +4552,7 @@ S: Maintained | |||
| 4552 | F: drivers/devfreq/ | 4552 | F: drivers/devfreq/ |
| 4553 | F: include/linux/devfreq.h | 4553 | F: include/linux/devfreq.h |
| 4554 | F: Documentation/devicetree/bindings/devfreq/ | 4554 | F: Documentation/devicetree/bindings/devfreq/ |
| 4555 | F: include/trace/events/devfreq.h | ||
| 4555 | 4556 | ||
| 4556 | DEVICE FREQUENCY EVENT (DEVFREQ-EVENT) | 4557 | DEVICE FREQUENCY EVENT (DEVFREQ-EVENT) |
| 4557 | M: Chanwoo Choi <cw00.choi@samsung.com> | 4558 | M: Chanwoo Choi <cw00.choi@samsung.com> |
diff --git a/include/trace/events/devfreq.h b/include/trace/events/devfreq.h new file mode 100644 index 000000000000..cf5b8772175d --- /dev/null +++ b/include/trace/events/devfreq.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #undef TRACE_SYSTEM | ||
| 3 | #define TRACE_SYSTEM devfreq | ||
| 4 | |||
| 5 | #if !defined(_TRACE_DEVFREQ_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 6 | #define _TRACE_DEVFREQ_H | ||
| 7 | |||
| 8 | #include <linux/devfreq.h> | ||
| 9 | #include <linux/tracepoint.h> | ||
| 10 | |||
| 11 | TRACE_EVENT(devfreq_monitor, | ||
| 12 | TP_PROTO(struct devfreq *devfreq), | ||
| 13 | |||
| 14 | TP_ARGS(devfreq), | ||
| 15 | |||
| 16 | TP_STRUCT__entry( | ||
| 17 | __field(unsigned long, freq) | ||
| 18 | __field(unsigned long, busy_time) | ||
| 19 | __field(unsigned long, total_time) | ||
| 20 | __field(unsigned int, polling_ms) | ||
| 21 | __string(dev_name, dev_name(&devfreq->dev)) | ||
| 22 | ), | ||
| 23 | |||
| 24 | TP_fast_assign( | ||
| 25 | __entry->freq = devfreq->previous_freq; | ||
| 26 | __entry->busy_time = devfreq->last_status.busy_time; | ||
| 27 | __entry->total_time = devfreq->last_status.total_time; | ||
| 28 | __entry->polling_ms = devfreq->profile->polling_ms; | ||
| 29 | __assign_str(dev_name, dev_name(&devfreq->dev)); | ||
| 30 | ), | ||
| 31 | |||
| 32 | TP_printk("dev_name=%s freq=%lu polling_ms=%u load=%lu", | ||
| 33 | __get_str(dev_name), __entry->freq, __entry->polling_ms, | ||
| 34 | __entry->total_time == 0 ? 0 : | ||
| 35 | (100 * __entry->busy_time) / __entry->total_time) | ||
| 36 | ); | ||
| 37 | #endif /* _TRACE_DEVFREQ_H */ | ||
| 38 | |||
| 39 | /* This part must be outside protection */ | ||
| 40 | #include <trace/define_trace.h> | ||
