8067088: Suppress solaris-specific deprecation warnings in the jdk.crypto.ucrypto module
Reviewed-by: valeriep
<HTML><HEAD><TITLE>Using The HotSpot Serviceability Agent</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><H1>Using The HotSpot Serviceability Agent</H1><P><H2>Contents</H2></P><UL><LI> <A HREF = "#INTRODUCTION">Introduction</A><LI> <A HREF = "#SOURCES">Organization of the sources</A><LI> <A HREF = "#RUNNING">Running HSDB</A><LI> <A HREF = "#NOTES">Notes</A></UL><H2><A NAME="INTRODUCTION">Introduction</A></H2><P>The HotSpot Serviceability Agent (SA) is a set of Java APIs whichmirror the internal APIs of the HotSpot VM and which can be used toexamine the state of a HotSpot VM.</P><P>The system understands the layout of certain VM data structures and isable to traverse these structures in an examination-only fashion; thatis, it does not rely on being able to run code in the target VM. Forthis reason it transparently works with either a running VM or a corefile.</P><P>The system can reconstruct information about Java frames on the stackand objects in the heap. Many of the important data structures in theVM like the CodeCache, Universe, StubQueue, Frames, and VFrames havebeen exposed and have relatively complete (or at least useful)implementations.</P><P>A small graphical debugger called HSDB (the "HotSpot Debugger") hasbeen written using these APIs. It provides stack memory dumpsannotated with method invocations, compiled-code inlining (ifpresent), interpreted vs. compiled code, interpreter codelets (ifinterpreted), and live oops from oop-map information. It also providesa tree-based oop inspector. More information will be added asnecessary; please <A HREF = "mailto:kenneth.russell@eng">sendemail</A> with suggestions on what would be useful.</P><P>The SA currently only works on Solaris. It uses dbx to connect to theremote process or core file and communicates with a small piece ofcode (an "import module") loaded into the debugger.</P><H2><A NAME="SOURCES">Organization of the sources</A></H2><P>The Java-side source code, which is the bulk of the SA, is insrc/share/vm/agent. The organization of the sun.jvm.hotspot packagehierarchy mirrors the organization in the VM. This should allowengineers familiar with the HotSpot sources to quickly understand howthe SA works and to make modifications if necessary. To build thesesources, cd to src/share/vm/agent and type "make".</P><P>The SA on Solaris works by communicating with a small piece of code(an "import module") loaded into dbx. The source code for this importmodule is in src/os/solaris/agent. To build this library, cd tosrc/os/solaris/agent and type "make 32bit" or "make 64bit". Thedistinction is necessary because the SPARC version of dbx ships withtwo versions of its executable, and depending on which architecture(v8 or v9) the debugger is running on selects the appropriateexecutable. The SA tries the v8 version first, but if you are runningon a v9 machine you must provide both versions to the SA.</P><P>The system is currently hardwired to look on jano for its dbxexecutable and import module. The relevant directory structure lookslike this:<UL> <LI> .../hotspot/sa/ <UL> <LI> solaris/ <UL> <LI> sparc/ <UL> <LI> bin/ <UL> <LI> dbx: symlink to (v8) dbx 7.0 executable </UL> </UL> <UL> <LI> lib/ <UL> <LI> libsvc_agent_dbx.so: 32-bit version of import module </UL> </UL> <LI> sparcv9/ <UL> <LI> lib/ <UL> <LI> libsvc_agent_dbx.so: 32-bit version of import module </UL> </UL> </UL> </UL></UL></P><P>The code which builds up path names to these executables is containedin sun.jvm.hotspot.HotSpotAgent.java. There are hardcoded paths inthis file to jano, but the rest of the system is isolated from this.</P><P>(It would be nice to have a panel in the debugger allowingconfiguration of all of the known operating systems' options; rightnow Solaris is the only supported OS, making that easier.)</P><H2><A NAME="RUNNING">Running HSDB</A></H2><P>An installation of HSDB has been placed on jano. To access it, add thefollowing directory to your PATH:</P><P><PRE> /net/jano/export/disk05/hotspot/sa/bin/common</PRE></P><P>To start the debugger, type "hsdb".</P><P>Alternatively, you can start a local build of the debugger by buildingthe sources in src/share/vm/agent, cd'ing to that directory, andtyping "java sun.jvm.hotspot.HSDB".</P><P>There are three modes for the debugger: attaching to a local process,opening a core file, and attaching to a remote "debug server". Theremote case requires two programs to be running on the remote machine:the rmiregistry (see the script "start-rmiregistry" in this directory;run this in the background) and the debug server (see the script"start-debug-server"), in that order. start-rmiregistry takes noarguments; start-debug-server takes as argument the process ID or theexecutable and core file names to allow remote debugging of. Make sureyou do NOT have a CLASSPATH environment variable set when you runthese scripts. (The classes put into the rmiregistry are in sun.*, andthere are permissions problems if they aren't placed on the bootclasspath.)</P><P>NOTE that the SA currently only works against VMs on Solaris/SPARC.Remote debugging of Solaris/SPARC VMs on arbitrary platforms ispossible using the debug server; select "Connect to debug server..."in HSDB.</P><P>Once the debugger has been launched, the threads list is displayed.The current set of functionality allows:</P><UL><LI> Browsing of the annotated stack memory ("Stack Memory" button). It is currently annotated with the following information: <UL> <LI> Method names of the Java frames and their extents (supporting inlined compiled methods) <LI> Locations and types of oops, found using the oop map information from compiled methods (interpreter oop maps coming soon) <LI> If a Java frame was interrupted by a signal (e.g., because of a crash), annotates the frame with the signal name and number <LI> Interpreter codelet descriptions for interpreted frames </UL> <LI> Finding which thread or threads caused a crash (currently identified by the presence of a signal handler frame)<LI> Browsing of oops using the Oop Inspector.<LI> Browsing of the java.lang.Thread object's oop.<LI> Object histogram and inspection of objects therein.</UL></P><P>More functionality is planned. Please <A HREF ="mailto:kenneth.russell@eng">send email</A> with suggestions on whatwould be useful, with any questions or comments, or if the debuggercrashes.</P><H2><A NAME="NOTES">Notes</A></H2><P>HSDB does not suspend the system at a safepoint, but at an arbitrarypoint. This means that many of the invariants in the VM's code are notfollowed.</P><P>As it happens, most of the places where the code ported over from theVM has failed involve the topmost frame on the stack. Somemodifications have been made to allow the system to recognizeproblematic situations.</P><P>Certainly, not all of the failure modes of the debugger have beenfound. Please <A HREF = "mailto:kenneth.russell@eng">send email</A> ifHSDB throws an exception. The best debugging aid in these situationsis a core file since it is a static view of the VM to which we canthen adapt the debugger code, as opposed to having to try to suspendthe VM over and over to reproduce the failure. gcore (1) is a usefultool. (NOTE: do not try gcore with any application using the DGA Xserver extension (example: Java2Demo); the kernel will panic. See bug4343237.)</P></BODY></HTML>