#!/usr/sbin/dtrace -s /* modified example originally taken from the dvm agent zip */ /* #pragma D option quiet */ dvm$target:::vm-init { printf(" vm-init"); } dvm$target:::vm-death { printf(" vm-death"); } dvm$target:::thread-start { printf(" tid=%d, thread-start: %s ", tid, copyinstr(arg0)); } dvm$target:::thread-end { printf(" tid=%d, thread-end ", tid); } dvm$target:::class-load { printf(" tid=%d, class-load: %s ", tid, copyinstr(arg0)); } dvm$target:::class-unload { printf(" tid=%d, class-unload: %s ", tid, copyinstr(arg0)); } dvm$target:::gc-start { printf(" tid=%d, gc-start ", tid); } dvm$target:::gc-finish { printf(" tid=%d, gc-finish ", tid); } dvm$target:::gc-stats { printf(" tid=%d, gc-stats: used objects: %d, used object space: %d ", tid, arg0, arg1); } dvm$target:::object-alloc { printf(" tid=%d, object-alloc: class name: %s, size: %d ", tid, copyinstr(arg0), arg1); } dvm$target:::object-free { printf(" tid=%d, object-free: class name: %s ", tid, copyinstr(arg0)); } dvm$target:::monitor-contended-enter { printf(" tid=%d, monitor-contended-enter: thread name: %s ", tid, copyinstr(arg0)); } dvm$target:::monitor-contended-entered { printf(" tid=%d, monitor-contended-entered: thread name: %s ", tid, copyinstr(arg0)); } dvm$target:::monitor-wait { printf(" tid=%d, monitor-wait: thread name: %s, time-out: %d ", tid, copyinstr(arg0), arg1); } dvm$target:::monitor-waited { printf(" tid=%d, monitor-waited: thread name: %s, time-out: %d ", tid, copyinstr(arg0), arg1); } dvm$target:::method-entry { printf(" tid=%d, method-entry: %s:%s %s ", tid, copyinstr(arg0), copyinstr(arg1), copyinstr(arg2)); } dvm$target:::method-return { printf(" tid=%d, method-return: %s:%s %s ", tid, copyinstr(arg0), copyinstr(arg1), copyinstr(arg2)); }