Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

trace: events: add devfreq trace event file

The patch adds a new file for with trace events for devfreq
framework. They are used for performance analysis of the framework.
It also contains updates in MAINTAINERS file adding new entry for
devfreq maintainers.

Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>

authored by

Lukasz Luba and committed by
MyungJoo Ham
1be0730f 9173c5ce

+41
+1
MAINTAINERS
··· 4552 4552 F: drivers/devfreq/ 4553 4553 F: include/linux/devfreq.h 4554 4554 F: Documentation/devicetree/bindings/devfreq/ 4555 + F: include/trace/events/devfreq.h 4555 4556 4556 4557 DEVICE FREQUENCY EVENT (DEVFREQ-EVENT) 4557 4558 M: Chanwoo Choi <cw00.choi@samsung.com>
+40
include/trace/events/devfreq.h
··· 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>