This example demonstrates how to use the ExecutableUnit probe fragment.
In this example, a probe emits a trace line to System.out with the source file name, method names, and line tables for every class that loads, then emits a trace line for every executable unit that executes.
<?xml version="1.0" encoding="ASCII"?>
<probekit>
<probe>
<fragment type="staticInitializer">
<data type="className" name="cname" />
<data type="classSourceFile" name= "csource" />
<data type="methodNames" name="mnames" />
<data type="methodLineTables" name="mltables" />
<code>
System.out.println(" [ClassLoad: " + cname +
" source: " + csource +
" methods: " + mnames +
" linetables: " + mltables + "]");
</code>
</fragment>
<fragment type="executableUnit">
<data type="methodNumber" name="mnum" />
<data type="executableUnitNumber" name="eunum" />
<code>
System.out.println("[hit method " + mnum + " eu " + eunum + "]");
</code>
</fragment>
</probe>
</probekit>
Parent topic: Probekit Examples
Related reference
The executableUnit probe fragment