RFR: 8340363: User-specified default decorators for UnifiedLogging

Antón Seoane duke at openjdk.org
Wed Sep 18 10:04:41 UTC 2024


Hi all,

Currently, the Unified Logging framework defaults to three decorators (uptime, level, tags) whenever the user does not specify otherwise through `-Xlog`. This can result in cumbersome input whenever a specific user that relies on a particular tag(s) has some predefined needs. For example, C2 developers rarely need decorations, and having to manually specify this every time results inconvenient.

To address this, this PR enables the possibility of adding tag-specific default decorators to UL. These defaults are in no way overriding user input -- they will only act whenever `-Xlog` has no decorators supplied and there is a positive match with the pre-specified defaults. Such a match is based on the following:

- Inclusion: if `-Xlog:jit+compilation` is provided, a default for `jit` may be applied.
- Specificity: if, for the above line, there is a more specific default for `jit+compilation` the latter shall be applied. Upon equal specificity cases, both defaults will be applied.
- Additionally, defaults may target a specific log level.

Decorators are also associated with an output file, so an output device may only have one set of decorators. For this reason, if different `LogSelection`s trigger defaults, none is to be applied.

In summary, these defaults may be seen as a "tailored" or "flavoured" version of the existing "uptime-level-tags" current defaults.

Please consider this PR, and thanks!

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

Commit messages:
 - Removed trailing whitespace
 - Removed extra whitespace
 - Final test changes
 - Small changes as per compiler team feedback
 - Fixed test for linux-aarch64-debug where os* would dump /proc/cpuinfo with no decorators, making the test fail in a situation that is unrelated to our testing
 - End of tests
 - JTREG test
 - Test-based bugfixing and test implementation
 - Bugfix
 - Test-driven changes
 - ... and 14 more: https://git.openjdk.org/jdk/compare/92aafb43...5e0b45bc

Changes: https://git.openjdk.org/jdk/pull/20988/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20988&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8340363
  Stats: 347 lines in 10 files changed: 338 ins; 2 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/20988.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20988/head:pull/20988

PR: https://git.openjdk.org/jdk/pull/20988


More information about the hotspot-runtime-dev mailing list