use of com.oracle.truffle.api.instrumentation.SourceSectionFilter.Builder in project graal by oracle.
the class Profiler method reset.
// Reconfigure what's being collected; does not affect collected data
private void reset() {
if (binding != null) {
binding.dispose();
binding = null;
}
if (isCollecting) {
final Builder filterBuilder = SourceSectionFilter.newBuilder();
if (mimeTypes != null) {
filterBuilder.mimeTypeIs(mimeTypes);
}
final SourceSectionFilter filter = filterBuilder.tagIs(StandardTags.RootTag.class).sourceIs(notInternal).build();
binding = instrumenter.attachExecutionEventFactory(filter, new ExecutionEventNodeFactory() {
public ExecutionEventNode create(EventContext context) {
return createCountingNode(context);
}
});
}
}
use of com.oracle.truffle.api.instrumentation.SourceSectionFilter.Builder 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);
}
}
Aggregations