Commit 03813d9b authored by Maxime Ripard's avatar Maxime Ripard Committed by Stephen Boyd
Browse files

clk: Trace clk_set_rate() "range" functions



The clk_set_rate "range" functions don't have any tracepoints even
though it might be useful. Add some.

Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20201207105050.2096917-1-maxime@cerno.tech


[sboyd@kernel.org: Reword commit text]
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 3650b228
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2314,6 +2314,8 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max)
	if (!clk)
		return 0;

	trace_clk_set_rate_range(clk->core, min, max);

	if (min > max) {
		pr_err("%s: clk %s dev %s con %s: invalid range [%lu, %lu]\n",
		       __func__, clk->core->name, clk->dev_id, clk->con_id,
@@ -2381,6 +2383,8 @@ int clk_set_min_rate(struct clk *clk, unsigned long rate)
	if (!clk)
		return 0;

	trace_clk_set_min_rate(clk->core, rate);

	return clk_set_rate_range(clk, rate, clk->max_rate);
}
EXPORT_SYMBOL_GPL(clk_set_min_rate);
@@ -2397,6 +2401,8 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate)
	if (!clk)
		return 0;

	trace_clk_set_max_rate(clk->core, rate);

	return clk_set_rate_range(clk, clk->min_rate, rate);
}
EXPORT_SYMBOL_GPL(clk_set_max_rate);
+44 −0
Original line number Diff line number Diff line
@@ -118,6 +118,50 @@ DEFINE_EVENT(clk_rate, clk_set_rate_complete,
	TP_ARGS(core, rate)
);

DEFINE_EVENT(clk_rate, clk_set_min_rate,

	TP_PROTO(struct clk_core *core, unsigned long rate),

	TP_ARGS(core, rate)
);

DEFINE_EVENT(clk_rate, clk_set_max_rate,

	TP_PROTO(struct clk_core *core, unsigned long rate),

	TP_ARGS(core, rate)
);

DECLARE_EVENT_CLASS(clk_rate_range,

	TP_PROTO(struct clk_core *core, unsigned long min, unsigned long max),

	TP_ARGS(core, min, max),

	TP_STRUCT__entry(
		__string(        name,           core->name                )
		__field(unsigned long,           min                       )
		__field(unsigned long,           max                       )
	),

	TP_fast_assign(
		__assign_str(name, core->name);
		__entry->min = min;
		__entry->max = max;
	),

	TP_printk("%s min %lu max %lu", __get_str(name),
		  (unsigned long)__entry->min,
		  (unsigned long)__entry->max)
);

DEFINE_EVENT(clk_rate_range, clk_set_rate_range,

	TP_PROTO(struct clk_core *core, unsigned long min, unsigned long max),

	TP_ARGS(core, min, max)
);

DECLARE_EVENT_CLASS(clk_parent,

	TP_PROTO(struct clk_core *core, struct clk_core *parent),