^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define TRACE_SYSTEM clk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _TRACE_CLK_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct clk_core;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) DECLARE_EVENT_CLASS(clk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) TP_ARGS(core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __string( name, core->name )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) __assign_str(name, core->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) TP_printk("%s", __get_str(name))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) DEFINE_EVENT(clk, clk_enable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) DEFINE_EVENT(clk, clk_enable_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) DEFINE_EVENT(clk, clk_disable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) DEFINE_EVENT(clk, clk_disable_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) DEFINE_EVENT(clk, clk_prepare,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) DEFINE_EVENT(clk, clk_prepare_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) DEFINE_EVENT(clk, clk_unprepare,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) DEFINE_EVENT(clk, clk_unprepare_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) TP_PROTO(struct clk_core *core),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) TP_ARGS(core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) DECLARE_EVENT_CLASS(clk_rate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) TP_PROTO(struct clk_core *core, unsigned long rate),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) TP_ARGS(core, rate),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) __string( name, core->name )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) __field(unsigned long, rate )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) __assign_str(name, core->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) __entry->rate = rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) DEFINE_EVENT(clk_rate, clk_set_rate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) TP_PROTO(struct clk_core *core, unsigned long rate),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) TP_ARGS(core, rate)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) DEFINE_EVENT(clk_rate, clk_set_rate_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) TP_PROTO(struct clk_core *core, unsigned long rate),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) TP_ARGS(core, rate)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) DECLARE_EVENT_CLASS(clk_parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) TP_PROTO(struct clk_core *core, struct clk_core *parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) TP_ARGS(core, parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) __string( name, core->name )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) __string( pname, parent ? parent->name : "none" )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) __assign_str(name, core->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) __assign_str(pname, parent ? parent->name : "none");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) TP_printk("%s %s", __get_str(name), __get_str(pname))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) DEFINE_EVENT(clk_parent, clk_set_parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) TP_PROTO(struct clk_core *core, struct clk_core *parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) TP_ARGS(core, parent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) DEFINE_EVENT(clk_parent, clk_set_parent_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) TP_PROTO(struct clk_core *core, struct clk_core *parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) TP_ARGS(core, parent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) DECLARE_EVENT_CLASS(clk_phase,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) TP_PROTO(struct clk_core *core, int phase),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) TP_ARGS(core, phase),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) __string( name, core->name )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) __field( int, phase )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) __assign_str(name, core->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) __entry->phase = phase;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) TP_printk("%s %d", __get_str(name), (int)__entry->phase)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) DEFINE_EVENT(clk_phase, clk_set_phase,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) TP_PROTO(struct clk_core *core, int phase),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) TP_ARGS(core, phase)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) DEFINE_EVENT(clk_phase, clk_set_phase_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) TP_PROTO(struct clk_core *core, int phase),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) TP_ARGS(core, phase)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) DECLARE_EVENT_CLASS(clk_duty_cycle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) TP_PROTO(struct clk_core *core, struct clk_duty *duty),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) TP_ARGS(core, duty),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) __string( name, core->name )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) __field( unsigned int, num )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) __field( unsigned int, den )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) __assign_str(name, core->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) __entry->num = duty->num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) __entry->den = duty->den;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) TP_printk("%s %u/%u", __get_str(name), (unsigned int)__entry->num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) (unsigned int)__entry->den)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) TP_PROTO(struct clk_core *core, struct clk_duty *duty),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) TP_ARGS(core, duty)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) TP_PROTO(struct clk_core *core, struct clk_duty *duty),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) TP_ARGS(core, duty)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) #endif /* _TRACE_CLK_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) #include <trace/define_trace.h>