RFR(S): 8198554: Add fuzzy matching for log levels and tags when parsing -Xlog

harold seigel harold.seigel at oracle.com
Thu Feb 22 19:56:01 UTC 2018


Hi Marcus,

This patch will be very helpful!

Can you change code sequences like this in logSelection.cpp:

    79 errstream->print("Invalid level '%s' in log selection.", levelstr);
    80 LogLevelType match = LogLevel::fuzzy_match(levelstr);
    81 if (match != LogLevel::Invalid) {
    82 errstream->print(" Did you mean '%s'?", LogLevel::name(match));
    83 }
    84 errstream->cr();

To something like this to lessen the chance of other threads' print 
statements getting interspersed with this one?

    if (match != LogLevel::Invalid) {
        errstream->print_cr("Invalid level '%s' in log selection. Did
    you mean '%'s?, levelstr, LogLevel::name(match));
    } else {
       errstream->print_cr("Invalid level '%s' in log selection.",
    levelstr);
    }

The rest of the patch looks good.

Thanks, Harold

On 2/22/2018 8:11 AM, Marcus Larsson wrote:
> Hi,
>
> Please review the following patch to add some fuzzy matching to 
> improve -Xlog parsing error messages. The implementation of the fuzzy 
> -XX flag matching is moved out to StringUtils so it can be re-used here.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8198554
>
> Webrev:
> http://cr.openjdk.java.net/~mlarsson/8198554/webrev.00
>
> Tested with hs-tier 1-2.
>
> Thanks,
> Marcus
>



More information about the hotspot-runtime-dev mailing list