Search in sources :

Example 1 with BTraceProbe

use of com.sun.btrace.runtime.BTraceProbe in project btrace by btraceio.

the class ProbeLoadingBenchmark method testBTraceProbeNew.

@Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
public void testBTraceProbeNew(Blackhole bh) throws Exception {
    BTraceProbe bp = bpf.createProbe(classStream);
    if (bp == null) {
        throw new NullPointerException();
    }
    bh.consume(bp);
}
Also used : BTraceProbe(com.sun.btrace.runtime.BTraceProbe)

Example 2 with BTraceProbe

use of com.sun.btrace.runtime.BTraceProbe in project btrace by btraceio.

the class ProbeDump method main.

public static void main(String[] args) throws Exception {
    String path = args[0];
    BTraceProbeFactory bpf = new BTraceProbeFactory(SharedSettings.GLOBAL);
    BTraceProbe bp = bpf.createProbe(new FileInputStream(path));
    FileSystem fs = FileSystems.getDefault();
    Path p = fs.getPath(args[1]);
    Files.write(p.resolve(bp.getClassName().replace(".", "_") + "_full.class"), bp.getFullBytecode());
    Files.write(p.resolve(bp.getClassName().replace(".", "_") + "_dh.class"), bp.getDataHolderBytecode());
}
Also used : Path(java.nio.file.Path) BTraceProbe(com.sun.btrace.runtime.BTraceProbe) BTraceProbeFactory(com.sun.btrace.runtime.BTraceProbeFactory) FileSystem(java.nio.file.FileSystem) FileInputStream(java.io.FileInputStream)

Aggregations

BTraceProbe (com.sun.btrace.runtime.BTraceProbe)2 BTraceProbeFactory (com.sun.btrace.runtime.BTraceProbeFactory)1 FileInputStream (java.io.FileInputStream)1 FileSystem (java.nio.file.FileSystem)1 Path (java.nio.file.Path)1