On Thu, 24 Sep 2026 04:41:19 GMT, Yasumasa Suenaga <[email protected]> wrote:

> Native code in SA (libsaproc) currently has two functions for reporting 
> messages: `print_error()` for reporting errors, and `print_debug()` for 
> reporting debug messages when `LIBSAPROC_DEBUG` is set.
> 
> During the discussion of 
> [JDK-8391940](https://bugs.openjdk.org/browse/JDK-8391940), `print_warning()` 
> was proposed for reporting messages that are useful for users to see but do 
> not indicate an error. Currently, some messages are reported using 
> `print_debug()`. As a result, users have to set `LIBSAPROC_DEBUG=1` to see 
> them and then find the relevant messages among the noisy debug output.
> 
> Add a new `print_warning()` function that is always enabled and writes to 
> stdout, so that useful diagnostic messages can be reported without being 
> treated as errors. Migrate appropriate messages currently reported using 
> `print_error()` or `print_debug()` to use `print_warning()`. I replaced to 
> use `print_waring()` if the message is worth to notice, and the process 
> should be continued.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

I'm a bit concerned that we will suddenly see warnings popping up during 
testing that were previously hidden. Someone will have to run this through all 
the SA tests in our CI to see if there is any negative affect (@plummercj ?).

I'm also wondering whether the prefix should identify that it comes from the SA 
e.g. "Serviceability Agent Warning:" and "Serviceability Agent Error:" ?

-------------

PR Review: https://git.openjdk.org/jdk/pull/33047#pullrequestreview-5300105510

Reply via email to