use of com.oracle.truffle.api.instrumentation.SourceSectionFilter in project graal by oracle.
the class DebuggerSessionSnippets method createBinding.
private EventBinding<? extends ExecutionEventNodeFactory> createBinding(boolean includeInternalCode, Predicate<Source> sFilter, ExecutionEventNodeFactory factory, boolean onInput, Class<?>... tags) {
Builder builder = SourceSectionFilter.newBuilder().tagIs(tags);
builder.includeInternal(includeInternalCode);
if (sFilter != null) {
builder.sourceIs(new SourceSectionFilter.SourcePredicate() {
@Override
public boolean test(Source source) {
return sFilter.test(source);
}
});
}
SourceSectionFilter ssf = builder.build();
if (onInput) {
return debugger.getInstrumenter().attachExecutionEventFactory(ssf, ssf, factory);
} else {
return debugger.getInstrumenter().attachExecutionEventFactory(ssf, factory);
}
}
use of com.oracle.truffle.api.instrumentation.SourceSectionFilter in project graal by oracle.
the class CPUTracerSnippets method resetTracer.
private synchronized void resetTracer() {
assert Thread.holdsLock(this);
if (activeBinding != null) {
activeBinding.dispose();
activeBinding = null;
}
if (!collecting || closed) {
return;
}
SourceSectionFilter f = this.filter;
if (f == null) {
f = DEFAULT_FILTER;
}
this.activeBinding = env.getInstrumenter().attachExecutionEventFactory(f, new ExecutionEventNodeFactory() {
@Override
public ExecutionEventNode create(EventContext context) {
return new CounterNode(getCounter(context));
}
});
}
Aggregations