Skip to content

Commit

Permalink
drivers: clk: print clock tree with debug trace level
Browse files Browse the repository at this point in the history
Change clk_print_tree() to print the clock tree with debug trace
level instead of info trace level.

Add a test on TRACE_LEVEL >= TRACE_DEBUG in clk_print_tree()
to ensures no unless code is embedded when the trace level is too low.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
  • Loading branch information
etienne-lms authored and jforissier committed Nov 29, 2023
1 parent 4362d4f commit aac2c71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions core/drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ static void __maybe_unused print_clk(struct clk *clk, int indent)
if (!msg)
snprintf(msg_end - 4, 4, "...");

IMSG("%s", msg_buf);
DMSG("%s", msg_buf);
}

static void print_tree(void)
Expand All @@ -448,7 +448,7 @@ static void print_tree(void)

#ifdef CFG_DRIVERS_CLK_PRINT_TREE
if (SLIST_EMPTY(&clock_list)) {
IMSG("-- No registered clock");
DMSG("-- No registered clock");
return;
}
#endif
Expand Down Expand Up @@ -481,8 +481,9 @@ static void print_tree(void)

void clk_print_tree(void)
{
if (IS_ENABLED(CFG_DRIVERS_CLK_PRINT_TREE)) {
IMSG("Clock tree summary (informative):");
if (IS_ENABLED(CFG_DRIVERS_CLK_PRINT_TREE) &&
TRACE_LEVEL >= TRACE_DEBUG) {
DMSG("Clock tree summary (informative):");
print_tree();
}
}
2 changes: 1 addition & 1 deletion core/include/drivers/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ TEE_Result clk_set_parent(struct clk *clk, struct clk *parent);
TEE_Result clk_get_rates_array(struct clk *clk, size_t start_index,
unsigned long *rates, size_t *nb_elts);

/* Print current clock tree summary on output console (info trace level) */
/* Print current clock tree summary to output console with debug trace level */
#ifdef CFG_DRIVERS_CLK
void clk_print_tree(void);
#else
Expand Down

0 comments on commit aac2c71

Please sign in to comment.