To me the strategy seems good, but you can ripple it
right along and it's a lot of stuff to change. I would love to be able to 
selectively turn on messages from almost every subsystem/category. The current 
system is "nothing,some status,
some_more status,firehose" where to fix the tricky stuff, 
I have to devise external filters for the firehose mode.
Being able to say "looks like it's the target JTAG interface, show
me that stuff" and only get those messages added to my default
would help a lot when trying to bring up new boards.
-John

-----Original Message-----
From: R. Diez <[email protected]> 
Sent: Monday, August 11, 2025 12:08 PM
To: Antonio Borneo <[email protected]>
Cc: [email protected]
Subject: [EXTERNAL] Re: Replacing --enable-verbose-usb-comms in configure.ac

WARNING: External Email Alert

This email has been sent from outside of the Draper network.

Please treat the email with caution, especially if you are requested to click 
on a link, decrypt/open an attachment, or enable macros. For further 
information on how to spot phishing, access "Phishing Awareness Policy" on the 
Draper Portal and report phishing by clicking the "Report Suspicious" button on 
the Outlook toolbar

> Today we have in OpenOCD
> enum log_levels {
>          LOG_LVL_SILENT = -3,
>          LOG_LVL_OUTPUT = -2,
>          LOG_LVL_USER = -1,
>          LOG_LVL_ERROR = 0,
>          LOG_LVL_WARNING = 1,
>          LOG_LVL_INFO = 2,
>          LOG_LVL_DEBUG = 3,
>          LOG_LVL_DEBUG_IO = 4,
> };
> [...]
> My proposal is, as a first step, to simply add a new entry in
> "log_level": LOG_LVL_DEBUG_USB. Then convert current _DEBUG_USB_COMMS_ 
> code under this new category.

I think that should be doable. But before I delve into the details, I have 
another related question:

After converting --enable-verbose-usb-comms to this method, I wanted to do the 
same with --enable-malloc-logging / _DEBUG_FREE_SPACE_ .

Should I add a new LOG_LVL_DEBUG_MALLOC too? Like this:

[...]
LOG_LVL_DEBUG = 3,
LOG_LVL_DEBUG_IO = 4,
LOG_LVL_DEBUG_USB= 5,    // new
LOG_LVL_DEBUG_MALLOC= 6, // new

Best regards,
   rdiez



Reply via email to