diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2020-11-08 13:46:39 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2020-11-15 22:10:35 +0000 |
commit | a03ac1ba3087ffedb3064e926624eda6cda8f808 (patch) | |
tree | 2f0a9ae403003bad09218106e27b5ad137fffad6 /src/helper/command.c | |
parent | 61326940361b2242feb8adfefb9ca12727154693 (diff) | |
download | riscv-openocd-a03ac1ba3087ffedb3064e926624eda6cda8f808.zip riscv-openocd-a03ac1ba3087ffedb3064e926624eda6cda8f808.tar.gz riscv-openocd-a03ac1ba3087ffedb3064e926624eda6cda8f808.tar.bz2 |
helper/command: disable logging of registered commands [RFC]
Every debug log of OpenOCD contains approximately 130 lines like:
Debug: 264 147 command.c:354 register_command_handler(): registering 'flash'...
Because only root name of the command is logged, most of lines is not
too informative. E.g. registering 'flash' is repeated 14 times.
Karl Passon submitted the patch [1] changing the logged cmd name from
root to lowest level. It makes the log better. Unfortunately we also have
'reset_config' and 'cortex_m reset_config' and similar which looks
equal in the log after [1].
Moreover [1] has not been reviewed for 5 years.
So my guess is that nobody uses that crap in debug log.
Save more than 10 kbytes in any debug log and make log analyse easier
by blocking log command in #if 0 block.
If some developer eventually needs to debug cmd registering he can easily
enable logging again.
[1] http://openocd.zylin.com/2765
Change-Id: Ib7e528aadd692fd0da2e3c005b4c5a484551b728
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5928
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Christopher Head <chead@zaber.com>
Diffstat (limited to 'src/helper/command.c')
-rw-r--r-- | src/helper/command.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index 773195e..0a711e5 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -349,7 +349,9 @@ static int register_command_handler(struct command_context *cmd_ctx, { Jim_Interp *interp = cmd_ctx->interp; +#if 0 LOG_DEBUG("registering '%s'...", c->name); +#endif Jim_CmdProc *func = c->handler ? &script_command : &command_unknown; int retval = Jim_CreateCommand(interp, c->name, func, c, NULL); |