Commit 8b88444f authored by Aurelio Colosimo's avatar Aurelio Colosimo

ppsi engine verbosity log optimized with new Kconfig PPSI_RUNTIME_VERBOSITY opt

This patch introduces a new Kconfig option, called PPSI_RUNTIME_VERBOSITY, which
disables runtime modification of ppsi verbosity, when it is not desired.
This brings a benefit in executable size, since all the
if (pp_diag_verbosity > ...) conditions can be evaluated at compile time (see
PP_PRINTF definition in ppsi).
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent c44c646d
......@@ -38,6 +38,15 @@ config PPSI_VERBOSITY
default 0
range 0 2
config PPSI_RUNTIME_VERBOSITY
depends on PPSI
boolean "Enable runtime verbosity setting"
default n
help
If set, this option permits to change the verbosity of PPSI engine
runtime. This causes a bigger RAM occupation, so it is suggested
to set it only for debugging purpose.
config STACKSIZE
int "Size of the stack area needed by this program"
default 3584 if PPSI
......
ppsi @ ce06ae90
Subproject commit f71a2b5a4fa40d0ab9f07565181efd99bee48c91
Subproject commit ce06ae90aaf6ae37ba7176f24426e9c91535e3f7
......@@ -61,7 +61,7 @@ static const struct shell_cmd cmds_list[] = {
#ifdef CONFIG_ETHERBONE
{"ip", cmd_ip},
#endif
#ifdef CONFIG_PPSI
#if (defined CONFIG_PPSI) && (defined CONFIG_PPSI_RUNTIME_VERBOSITY)
{"verbose", cmd_verbose},
#endif
{"mac", cmd_mac},
......
......@@ -15,4 +15,4 @@ obj-y += \
shell/cmd_init.o
obj-$(CONFIG_ETHERBONE) += shell/cmd_ip.o
obj-$(CONFIG_PPSI) += shell/cmd_verbose.o
obj-$(CONFIG_PPSI_RUNTIME_VERBOSITY) += shell/cmd_verbose.o
......@@ -25,7 +25,12 @@ static int ptp_enabled = 0, ptp_mode = WRC_MODE_UNKNOWN,
ptp_forced_stop = 0;
struct pp_instance ppi_static; /* FIXME: no more static, because used in
tests/measure_t24p.c */
#ifdef CONFIG_PPSI_RUNTIME_VERBOSITY
int pp_diag_verbosity = CONFIG_PPSI_VERBOSITY;
#else
const int pp_diag_verbosity = CONFIG_PPSI_VERBOSITY;
#endif
/*ppi fields*/
static UInteger16 sent_seq_id[16];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment