1dfc202eaSStephen Boyd /* 2dfc202eaSStephen Boyd * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. 3dfc202eaSStephen Boyd * 4dfc202eaSStephen Boyd * This software is licensed under the terms of the GNU General Public 5dfc202eaSStephen Boyd * License version 2, as published by the Free Software Foundation, and 6dfc202eaSStephen Boyd * may be copied, distributed, and modified under those terms. 7dfc202eaSStephen Boyd * 8dfc202eaSStephen Boyd * This program is distributed in the hope that it will be useful, 9dfc202eaSStephen Boyd * but WITHOUT ANY WARRANTY; without even the implied warranty of 10dfc202eaSStephen Boyd * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11dfc202eaSStephen Boyd * GNU General Public License for more details. 12dfc202eaSStephen Boyd */ 13dfc202eaSStephen Boyd #undef TRACE_SYSTEM 14dfc202eaSStephen Boyd #define TRACE_SYSTEM clk 15dfc202eaSStephen Boyd 16dfc202eaSStephen Boyd #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ) 17dfc202eaSStephen Boyd #define _TRACE_CLK_H 18dfc202eaSStephen Boyd 19dfc202eaSStephen Boyd #include <linux/tracepoint.h> 20dfc202eaSStephen Boyd 21dfc202eaSStephen Boyd struct clk_core; 22dfc202eaSStephen Boyd 23dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk, 24dfc202eaSStephen Boyd 25dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 26dfc202eaSStephen Boyd 27dfc202eaSStephen Boyd TP_ARGS(core), 28dfc202eaSStephen Boyd 29dfc202eaSStephen Boyd TP_STRUCT__entry( 30dfc202eaSStephen Boyd __string( name, core->name ) 31dfc202eaSStephen Boyd ), 32dfc202eaSStephen Boyd 33dfc202eaSStephen Boyd TP_fast_assign( 34dfc202eaSStephen Boyd __assign_str(name, core->name); 35dfc202eaSStephen Boyd ), 36dfc202eaSStephen Boyd 37dfc202eaSStephen Boyd TP_printk("%s", __get_str(name)) 38dfc202eaSStephen Boyd ); 39dfc202eaSStephen Boyd 40dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_enable, 41dfc202eaSStephen Boyd 42dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 43dfc202eaSStephen Boyd 44dfc202eaSStephen Boyd TP_ARGS(core) 45dfc202eaSStephen Boyd ); 46dfc202eaSStephen Boyd 47dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_enable_complete, 48dfc202eaSStephen Boyd 49dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 50dfc202eaSStephen Boyd 51dfc202eaSStephen Boyd TP_ARGS(core) 52dfc202eaSStephen Boyd ); 53dfc202eaSStephen Boyd 54dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_disable, 55dfc202eaSStephen Boyd 56dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 57dfc202eaSStephen Boyd 58dfc202eaSStephen Boyd TP_ARGS(core) 59dfc202eaSStephen Boyd ); 60dfc202eaSStephen Boyd 61dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_disable_complete, 62dfc202eaSStephen Boyd 63dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 64dfc202eaSStephen Boyd 65dfc202eaSStephen Boyd TP_ARGS(core) 66dfc202eaSStephen Boyd ); 67dfc202eaSStephen Boyd 68dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_prepare, 69dfc202eaSStephen Boyd 70dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 71dfc202eaSStephen Boyd 72dfc202eaSStephen Boyd TP_ARGS(core) 73dfc202eaSStephen Boyd ); 74dfc202eaSStephen Boyd 75dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_prepare_complete, 76dfc202eaSStephen Boyd 77dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 78dfc202eaSStephen Boyd 79dfc202eaSStephen Boyd TP_ARGS(core) 80dfc202eaSStephen Boyd ); 81dfc202eaSStephen Boyd 82dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_unprepare, 83dfc202eaSStephen Boyd 84dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 85dfc202eaSStephen Boyd 86dfc202eaSStephen Boyd TP_ARGS(core) 87dfc202eaSStephen Boyd ); 88dfc202eaSStephen Boyd 89dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_unprepare_complete, 90dfc202eaSStephen Boyd 91dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core), 92dfc202eaSStephen Boyd 93dfc202eaSStephen Boyd TP_ARGS(core) 94dfc202eaSStephen Boyd ); 95dfc202eaSStephen Boyd 96dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk_rate, 97dfc202eaSStephen Boyd 98dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, unsigned long rate), 99dfc202eaSStephen Boyd 100dfc202eaSStephen Boyd TP_ARGS(core, rate), 101dfc202eaSStephen Boyd 102dfc202eaSStephen Boyd TP_STRUCT__entry( 103dfc202eaSStephen Boyd __string( name, core->name ) 104dfc202eaSStephen Boyd __field(unsigned long, rate ) 105dfc202eaSStephen Boyd ), 106dfc202eaSStephen Boyd 107dfc202eaSStephen Boyd TP_fast_assign( 108dfc202eaSStephen Boyd __assign_str(name, core->name); 109dfc202eaSStephen Boyd __entry->rate = rate; 110dfc202eaSStephen Boyd ), 111dfc202eaSStephen Boyd 112dfc202eaSStephen Boyd TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate) 113dfc202eaSStephen Boyd ); 114dfc202eaSStephen Boyd 115dfc202eaSStephen Boyd DEFINE_EVENT(clk_rate, clk_set_rate, 116dfc202eaSStephen Boyd 117dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, unsigned long rate), 118dfc202eaSStephen Boyd 119dfc202eaSStephen Boyd TP_ARGS(core, rate) 120dfc202eaSStephen Boyd ); 121dfc202eaSStephen Boyd 122dfc202eaSStephen Boyd DEFINE_EVENT(clk_rate, clk_set_rate_complete, 123dfc202eaSStephen Boyd 124dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, unsigned long rate), 125dfc202eaSStephen Boyd 126dfc202eaSStephen Boyd TP_ARGS(core, rate) 127dfc202eaSStephen Boyd ); 128dfc202eaSStephen Boyd 129dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk_parent, 130dfc202eaSStephen Boyd 131dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, struct clk_core *parent), 132dfc202eaSStephen Boyd 133dfc202eaSStephen Boyd TP_ARGS(core, parent), 134dfc202eaSStephen Boyd 135dfc202eaSStephen Boyd TP_STRUCT__entry( 136dfc202eaSStephen Boyd __string( name, core->name ) 137*975b820bSCai Li __string( pname, parent ? parent->name : "none" ) 138dfc202eaSStephen Boyd ), 139dfc202eaSStephen Boyd 140dfc202eaSStephen Boyd TP_fast_assign( 141dfc202eaSStephen Boyd __assign_str(name, core->name); 142*975b820bSCai Li __assign_str(pname, parent ? parent->name : "none"); 143dfc202eaSStephen Boyd ), 144dfc202eaSStephen Boyd 145dfc202eaSStephen Boyd TP_printk("%s %s", __get_str(name), __get_str(pname)) 146dfc202eaSStephen Boyd ); 147dfc202eaSStephen Boyd 148dfc202eaSStephen Boyd DEFINE_EVENT(clk_parent, clk_set_parent, 149dfc202eaSStephen Boyd 150dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, struct clk_core *parent), 151dfc202eaSStephen Boyd 152dfc202eaSStephen Boyd TP_ARGS(core, parent) 153dfc202eaSStephen Boyd ); 154dfc202eaSStephen Boyd 155dfc202eaSStephen Boyd DEFINE_EVENT(clk_parent, clk_set_parent_complete, 156dfc202eaSStephen Boyd 157dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, struct clk_core *parent), 158dfc202eaSStephen Boyd 159dfc202eaSStephen Boyd TP_ARGS(core, parent) 160dfc202eaSStephen Boyd ); 161dfc202eaSStephen Boyd 162dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk_phase, 163dfc202eaSStephen Boyd 164dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, int phase), 165dfc202eaSStephen Boyd 166dfc202eaSStephen Boyd TP_ARGS(core, phase), 167dfc202eaSStephen Boyd 168dfc202eaSStephen Boyd TP_STRUCT__entry( 169dfc202eaSStephen Boyd __string( name, core->name ) 170dfc202eaSStephen Boyd __field( int, phase ) 171dfc202eaSStephen Boyd ), 172dfc202eaSStephen Boyd 173dfc202eaSStephen Boyd TP_fast_assign( 174dfc202eaSStephen Boyd __assign_str(name, core->name); 175dfc202eaSStephen Boyd __entry->phase = phase; 176dfc202eaSStephen Boyd ), 177dfc202eaSStephen Boyd 178dfc202eaSStephen Boyd TP_printk("%s %d", __get_str(name), (int)__entry->phase) 179dfc202eaSStephen Boyd ); 180dfc202eaSStephen Boyd 181dfc202eaSStephen Boyd DEFINE_EVENT(clk_phase, clk_set_phase, 182dfc202eaSStephen Boyd 183dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, int phase), 184dfc202eaSStephen Boyd 185dfc202eaSStephen Boyd TP_ARGS(core, phase) 186dfc202eaSStephen Boyd ); 187dfc202eaSStephen Boyd 188dfc202eaSStephen Boyd DEFINE_EVENT(clk_phase, clk_set_phase_complete, 189dfc202eaSStephen Boyd 190dfc202eaSStephen Boyd TP_PROTO(struct clk_core *core, int phase), 191dfc202eaSStephen Boyd 192dfc202eaSStephen Boyd TP_ARGS(core, phase) 193dfc202eaSStephen Boyd ); 194dfc202eaSStephen Boyd 195dfc202eaSStephen Boyd #endif /* _TRACE_CLK_H */ 196dfc202eaSStephen Boyd 197dfc202eaSStephen Boyd /* This part must be outside protection */ 198dfc202eaSStephen Boyd #include <trace/define_trace.h> 199