/ Published in: Java

Running a btrace script takes two separate steps by default:
1. Running jps to get the Java process ID.
2. Running btrace on the ID.
A simple awk script can merge the two into a single step.
1. Running jps to get the Java process ID.
2. Running btrace on the ID.
A simple awk script can merge the two into a single step.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# instead of running $ jps 18904 Main 18951 SpringMain 19055 Jps $ btrace 18951 jdftm/ReflecTracer.class # We issue (the traced application main class is SpringMain) $ jps | awk '/SpringMain/{system("btrace " $1 " jdftm/ReflecTracer.class")}'
Comments
