2020-06-08 14:56:03 +03:00
|
|
|
---
|
|
|
|
layout: developer-doc
|
|
|
|
title: Instruments
|
|
|
|
category: runtime
|
|
|
|
tags: [runtime, instruments]
|
2021-02-23 17:12:24 +03:00
|
|
|
order: 9
|
2020-06-08 14:56:03 +03:00
|
|
|
---
|
|
|
|
|
|
|
|
# Instruments
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-06-08 14:56:03 +03:00
|
|
|
Instruments are used to track runtime events to allow for profiling, debugging
|
|
|
|
and other kinds of behavior analysis at runtime.
|
|
|
|
|
|
|
|
<!-- MarkdownTOC levels="2,3" autolink="true" -->
|
|
|
|
|
|
|
|
- [Naming Conventions](#naming-conventions)
|
|
|
|
- [Fixing Compilation](#fixing-compilation)
|
|
|
|
|
|
|
|
<!-- /MarkdownTOC -->
|
|
|
|
|
|
|
|
## Naming Conventions
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-06-08 14:56:03 +03:00
|
|
|
Every Instrument must be implemented in Java and have name that ends with
|
2022-06-13 17:09:08 +03:00
|
|
|
`Instrument`.
|
2020-06-08 14:56:03 +03:00
|
|
|
|
|
|
|
## Fixing Compilation
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-06-08 14:56:03 +03:00
|
|
|
Annotations are used to register the implemented instruments with Graal. The
|
|
|
|
annotation processor is triggered when recompiling the Java files.
|
|
|
|
Unfortunately, when doing an incremental compilation, only the changed files are
|
|
|
|
recompiled and the annotation processor 'forgets' about other instruments that
|
|
|
|
haven't been recompiled, leading to runtime errors about missing instruments.
|
|
|
|
|
2022-06-13 17:09:08 +03:00
|
|
|
To fix that, individual services have to be placed in separate subprojects
|
|
|
|
depending on `runtime` and aggregated under `runtime-with-instruments`. Later
|
|
|
|
the META-INF registrations are concatenated in the final uber jar.
|