Skip to content

Cannot print info to console #416

@TheodoreSKong

Description

@TheodoreSKong

Btrace cannot print info msg on console when using btrace pid scripts.java.
but when using btrace -v pid scripts.java, the msg can be printed along with debug info.

the trace scripts:


import org.openjdk.btrace.core.annotations.BTrace;
import org.openjdk.btrace.core.annotations.Injected;
import org.openjdk.btrace.core.annotations.OnMethod;
import org.openjdk.btrace.core.annotations.ProbeClassName;
import org.openjdk.btrace.core.annotations.ProbeMethodName;
import org.openjdk.btrace.core.annotations.Self;
import org.openjdk.btrace.core.annotations.ServiceType;
import org.openjdk.btrace.services.impl.Printer;

import static org.openjdk.btrace.core.BTraceUtils.*;

@BTrace
public class AllMethods {
    @Injected(ServiceType.RUNTIME)
    private static Printer printer;
    @OnMethod(
        clazz="/voldemort\\.server\\..*/", 
        method="/.*/"//"${m}"
    )
    public static void m(@Self Object o, @ProbeClassName String probeClass, @ProbeMethodName String probeMethod) {
        printer.print("q");
        printer.print("entered " + probeClass);
        printer.println("." + probeMethod+"   TIME:"+ Time.millis());
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions