From owner-freebsd-java@FreeBSD.ORG Thu Mar 26 20:42:58 2015 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51BD1BCD for ; Thu, 26 Mar 2015 20:42:58 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 0D83F2AFF; Thu, 26 Mar 2015 20:42:57 +0000 (UTC) Message-ID: <55146F51.3030404@FreeBSD.org> Date: Thu, 26 Mar 2015 16:42:57 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Johannes Dieterich , freebsd-java@freebsd.org Subject: Re: dtrace, jstack and lang/openjdk7 or 8 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2015 20:42:58 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 03/25/2015 19:02, Johannes Dieterich wrote: > Hi, > > I am currently trying to get dtrace to work with either > java/openjdk7 or java/openjdk8 (as per Brendan Gregg's howto: > http://www.brendangregg.com/blog/2014-06-12/java-flame-graphs.html). > > Unfortunately, I get exactly what he describes: I am missing > everything inside the JVM. I suspect this has to do with jstack() > not working. The bundled jstack executable (yes, I know that they > are only vaguely related) also seems to work only so-so. Basically, > I can get a working stack trace without a variable, with -l, but > not with -m, and not with -F. It causes exceptions like this: > > $ /usr/local/openjdk7/bin/jstack -m 84749 ... > So, what I am asking is: anybody out there got a working setup for > dtrace+openjdk on FreeBSD? If so, it would be fantastic if you > could post the necessary steps! jstack from java/openjdk8 works fine AFAICT. Unfortunately, dtrace is unimplemented for FreeBSD. BTW, 'jstack -m ' is invalid command, i.e., it does not work with a running process. You need to set '-F' option to force it. % /usr/local/openjdk8/bin/jstack Usage: jstack [-l] (to connect to running process) jstack -F [-m] [-l] (to connect to a hung process) jstack [-m] [-l] (to connect to a core file) jstack [-m] [-l] [server_id@] (to connect to a remote debug server) Options: -F to force a thread dump. Use when jstack does not respond (process is hung) -m to print both java and native frames (mixed mode) -l long listing. Prints additional information about locks -h or -help to print this help message Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVFG9MAAoJEHyflib82/FG4F0H/3Z+5fTXMzQYBCeWGMZicjMB 092HOaXctRZ5P+I5HZO199bfFLffV6Pu1pd2/jjguOqkmF4eVL6AXwQBglg19RPs BEwhSLRLhuWc11XyikE2RG3PvvDRvhXl6AeqtKkcUi4LedjS3BlqmlGpTorJzpO3 OqarnzGMyAHPS5QxPPUcASG4B+la6o1sVn94UiynUWnd3yXTe4uE4Ed4YeV2oBXh BGVLhTdsWoamNpMwX9JrOMNwRPahYpoDCjeC2jlKPGPCXQiTWthlupLidXuKUI/a OJi+VSAzNPMx5s1p2JSKwAp+tT6oX8BaFK0zA+J6cyBcBqqbWvA6LV+v9f8c/5A= =x1pC -----END PGP SIGNATURE-----