From 0f70c6b867619fd35cfa4a4683c8985657b80cc3 Mon Sep 17 00:00:00 2001 From: Amit Nischal Date: Mon, 6 Mar 2017 16:40:58 +0530 Subject: clk: Add support to dump state of all clocks into ftrace Add clk_state event to record the state of all the clocks into ftrace. The clock event could be triggered by using the "trace_clocks" debugfs entry and it would dump the current state of all clocks in ftrace logs. Change-Id: I28b6574fe1d96472833a93e7b251dbba6c6eae49 Signed-off-by: Amit Nischal --- include/trace/events/clk.h | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'include/trace') diff --git a/include/trace/events/clk.h b/include/trace/events/clk.h index 758607226bfd..ad19e73ecb5d 100644 --- a/include/trace/events/clk.h +++ b/include/trace/events/clk.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -192,6 +192,42 @@ DEFINE_EVENT(clk_phase, clk_set_phase_complete, TP_ARGS(core, phase) ); +DECLARE_EVENT_CLASS(clk_state_dump, + + TP_PROTO(const char *name, unsigned int prepare_count, + unsigned int enable_count, unsigned long rate, unsigned int vdd_level), + + TP_ARGS(name, prepare_count, enable_count, rate, vdd_level), + + TP_STRUCT__entry( + __string(name, name) + __field(unsigned int, prepare_count) + __field(unsigned int, enable_count) + __field(unsigned long, rate) + __field(unsigned int, vdd_level) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->prepare_count = prepare_count; + __entry->enable_count = enable_count; + __entry->rate = rate; + __entry->vdd_level = vdd_level; + ), + + TP_printk("%s\tprepare:enable cnt [%u:%u]\trate: vdd_level [%lu:%u]", + __get_str(name), __entry->prepare_count, __entry->enable_count, + __entry->rate, __entry->vdd_level) +); + +DEFINE_EVENT(clk_state_dump, clk_state, + + TP_PROTO(const char *name, unsigned int prepare_count, + unsigned int enable_count, unsigned long rate, unsigned int vdd_level), + + TP_ARGS(name, prepare_count, enable_count, rate, vdd_level) +); + #endif /* _TRACE_CLK_H */ /* This part must be outside protection */ -- cgit v1.2.3