TruffleInstrument.Registration registration = info.type.getAnnotation(TruffleInstrument.Registration.class); if (registration != null) { groupPrefixStrings = new String[]{registration.id()}; if (groupPrefixStrings[0].isEmpty()) { error(element, elementAnnotation, "%s must specify an id such that Truffle options can infer their prefix.", TruffleInstrument.Registration.class.getSimpleName());
int instNum = findInstrument(annotation.id(), p); if (instNum == 0) { // not found numInstruments += 1; String className = processingEnv.getElementUtils().getBinaryName(l).toString(); p.setProperty(prefix + "id", annotation.id()); p.setProperty(prefix + "name", annotation.name()); p.setProperty(prefix + "version", annotation.version()); p.setProperty(prefix + "className", className); p.setProperty(prefix + "internal", Boolean.toString(annotation.internal()));
@TruffleInstrument.Registration(id = CPUTracerInstrument.ID, name = "CPU Tracer", version = CPUTracerInstrument.VERSION, services = {CPUTracer.class}) public class CPUTracerInstrument extends TruffleInstrument {
@TruffleInstrument.Registration(id = MemoryTracerInstrument.ID, name = "Memory Tracer", version = "0.2", services = {MemoryTracer.class}) public class MemoryTracerInstrument extends TruffleInstrument {
@TruffleInstrument.Registration(id = HeapMonitorInstrument.ID, name = "Heap Allocation Monitor", version = HeapMonitorInstrument.VERSION, services = {HeapMonitor.class}) public class HeapMonitorInstrument extends TruffleInstrument {
@TruffleInstrument.Registration(id = CPUSamplerInstrument.ID, name = "CPU Sampler", version = CPUSamplerInstrument.VERSION, services = {CPUSampler.class}) public class CPUSamplerInstrument extends TruffleInstrument {
@Registration(name = "Debugger", id = DebuggerInstrument.ID, services = Debugger.class) public final class DebuggerInstrument extends TruffleInstrument {
@Registration(name = "Debugger", id = DebuggerInstrument.ID, services = Debugger.class) public final class DebuggerInstrument extends TruffleInstrument {
@Registration(id = ProfilerInstrument.ID, services = Profiler.class) public class ProfilerInstrument extends TruffleInstrument { static final String ID = "profiler"; private Profiler profiler; @Override protected void onCreate(Env env) { this.profiler = new Profiler(env.getInstrumenter()); env.registerService(this.profiler); } @Override protected void onDispose(Env env) { if (profiler != null) { profiler.dispose(); } } }