1N/A * j_profile.d - sample stack traces with Java translations using DTrace. 1N/A * USAGE: j_profile.d { -p PID | -c cmd } # hit Ctrl-C to end 1N/A * $Id: j_profile.d 19 2007-09-12 07:47:59Z brendan $ 1N/A * This samples stack traces for the process specified. This stack trace 1N/A * will cross the JVM and system libraries, and insert translations for Java 1N/A * stack frames where appropriate. This is best explained with an example 1N/A * stack frame output, 1N/A * Func_loop.func_c()V 1N/A * Func_loop.func_b()V 1N/A * Func_loop.func_a()V 1N/A * libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHan 1N/A * libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmetho 1N/A * libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJ 1N/A * libjvm.so`__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_j 1N/A * java`JavaMain+0xd30 1N/A * The lines at the top are Java frames, followed by the JVM (libjvm.so). 1N/A * The JVM symbols may be translated by passing the output through c++filt. 1N/A * COPYRIGHT: Copyright (c) 2007 Brendan Gregg. 1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License, Version 1.0 only 1N/A * (the "License"). You may not use this file except in compliance 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * 09-Sep-2007 Brendan Gregg Created this. 1N/A#
define DEPTH 10 /* stack depth, frames */ 1N/A#
define RATE 101 /* sampling rate, Hertz */ 1N/A#
define TOP 25 /* number of stacks to output */ 1N/A printf(
"Sampling %d-level stacks at %d Hertz... Hit Ctrl-C to end.\n",