oracle/graal · error · IllegalArgumentException

Unknown dump level: "<levelString>" expected basic, info, ve

Error message

Unknown dump level: "<levelString>" expected basic, info, verbose or an integer

What it means

DebugFilter parses the level part of Graal dump/filter specifications (the text after ':' in -Dgraal.Dump=MethodFilter:Level). A level must be an integer or one of the named levels basic, info, verbose; anything else throws this IllegalArgumentException naming the bad token and the accepted values.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/DebugFilter.java:92

                } else {
                    pattern = t.substring(0, idx);
                    if (idx + 1 < t.length()) {
                        String levelString = t.substring(idx + 1);
                        try {
                            level = Integer.parseInt(levelString);
                        } catch (NumberFormatException e) {
                            switch (levelString) {
                                case "basic":
                                    level = DebugContext.BASIC_LEVEL;
                                    break;
                                case "info":
                                    level = DebugContext.INFO_LEVEL;
                                    break;
                                case "verbose":
                                    level = DebugContext.VERBOSE_LEVEL;
                                    break;
                                default:
                                    throw new IllegalArgumentException("Unknown dump level: \"" + levelString + "\" expected basic, info, verbose or an integer");
                            }
                        }

                    } else {
                        level = DebugContext.BASIC_LEVEL;
                    }
                }

                this.terms[i] = new Term(pattern, level);
            }
        }
    }

    /**
     * Check whether {@link Scope#getQualifiedName()} is matched by this filter, and determine the
     * log level.
     */
    public int matchLevel(DebugContext.Scope scope) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Use one of the accepted spellings: basic, info, verbose, or a plain integer (0=basic, 1=info, 2=verbose levels as defined by DebugContext).
  2. Check for typos, trailing spaces, and quoting artifacts in the -Dgraal.Dump / -Dgraal.Filter value.
  3. Refer to the option's help text (mx graal-options or the Graal docs) for the current level vocabulary.

Example fix

# before
-Dgraal.Dump=Foo.Bar:detailed

# after
-Dgraal.Dump=Foo.Bar:verbose
Defensive patterns

Strategy: validation

Validate before calling

static int parseDumpLevel(String s) {
    switch (s) {
        case "basic": return 0;
        case "info": return 1;
        case "verbose": return 2;
        default:
            int lvl = Integer.parseInt(s); // NumberFormatException here gives a clearer error
            if (lvl < 0) throw new IllegalArgumentException("negative level");
            return lvl;
    }
}

Prevention

When it happens

Trigger: Passing -Dgraal.Dump=:detailed, -Dgraal.Dump=Foo:0x2, or a level string with a typo/case mismatch (e.g. 'VERBOSE ' with trailing space, 'Basic'). Integer parse fails first (NumberFormatException) and the named-level switch then also misses, producing the error.

Common situations: Copy-pasting dump flags from blog posts or older Graal docs whose level vocabulary differs; shell quoting mishaps that leave stray characters; using a debug level name from a different tool (e.g. HotSpot's LogLevel names like 'trace' or 'debug').

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/dce95adafb608df3. Report an issue: GitHub.