summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorAmit Nischal <anischal@codeaurora.org>2017-03-06 16:40:58 +0530
committerAmit Nischal <anischal@codeaurora.org>2017-05-02 09:21:47 +0530
commit0f70c6b867619fd35cfa4a4683c8985657b80cc3 (patch)
tree476fe99f9ae418dd75ec2d6a8339550675ebb926 /include/trace
parent1ccabf65ac2fe97fbd2f2ca3a06905f52c16e50c (diff)
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 <anischal@codeaurora.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/clk.h38
1 files changed, 37 insertions, 1 deletions
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 */