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.

Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Nov 28, 2023
1 parent 70b35c4 commit 2894a59
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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
2 changes: 1 addition & 1 deletion mk/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ CFG_PREALLOC_RPC_CACHE ?= y
# CFG_DRIVERS_CLK_FIXED add support for "fixed-clock" compatible clocks
# CFG_DRIVERS_CLK_EARLY_PROBE makes clocks probed at early_init initcall level.
# CFG_DRIVERS_CLK_PRINT_TREE embeds a helper function to print the clock tree
# state on OP-TEE core console with the info trace level.
# state on OP-TEE core console with the debug trace level.
CFG_DRIVERS_CLK ?= n
CFG_DRIVERS_CLK_DT ?= $(call cfg-all-enabled,CFG_DRIVERS_CLK CFG_DT)
CFG_DRIVERS_CLK_FIXED ?= $(CFG_DRIVERS_CLK_DT)
Expand Down

0 comments on commit 2894a59

Please sign in to comment.