| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>com.ibm.jvm.trace.format.api (OpenJ9 JDK 11)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="keywords" content="com.ibm.jvm.trace.format.api package"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="com.ibm.jvm.trace.format.api (OpenJ9 JDK 11)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var pathtoroot = "../../../../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../../index.html">Overview</a></li> |
| <li><a href="../../../../../../module-summary.html">Module</a></li> |
| <li class="navBarCell1Rev">Package</li> |
| <li>Class</li> |
| <li><a href="package-use.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../../index-files/index-1.html">Index</a></li> |
| <li><a href="../../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><div style="margin-top: 9px;"><strong>OpenJ9 JDK 11</strong></div></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="moduleLabelInPackage">Module</span> <a href="../../../../../../module-summary.html">openj9.traceformat</a></div> |
| <h1 title="Package" class="title">Package com.ibm.jvm.trace.format.api</h1> |
| </div> |
| <div class="contentContainer"> |
| <section role="region"><a id="package.description"> |
| <!-- --> |
| </a> |
| <div class="block">This API is used to process trace buffers generated by the IBM JVM. These buffers are analogous to the |
| UtTraceRecord's used in the native VM and are referred to as 'records' in the source to differentiate them from |
| the UtTraceBuffer native type which wrap the UtTraceRecord type. However, in messages from the API they are |
| called buffers to keep the naming consistent across the information output of the formatter and the -Xtrace |
| options. |
| |
| A single buffer contains trace data for a single thread with one exception: |
| "0x0 Exception trace pseudo-thread" |
| This "thread" contains data from any threads that have written into the exception buffer interleaved in |
| chronological order. There is no mapping from a trace point to its source thread for trace points in the |
| exception buffer. |
| |
| An instance of a JVM corresponds to an instance of a TraceContext object within the API. It is |
| possible to have multiple TraceContext instances, each the accessor for trace data from a single JVM. |
| |
| The primary inputs for the API are metadata from a JVM and trace buffers. |
| |
| A TraceContext is constructed using metadata from the JVM that's generating the trace records needing |
| formatting. This metadata is either present as a file header at the start of a trace file or can |
| be acquired via a call to the JVMTI extension com.ibm.GetTraceMetadata. |
| Also required is a data file describing the format of trace points for that level of the JVM. At |
| least one data file is required to construct a trace context but additional files can be added later |
| and they will be searched for a trace point specification in the order they are added. |
| |
| Trace buffers must be passed to the context corresponding to the JVM that produced them; they are not |
| valid in another context and must be added in-order within a single thread. Detecting that a buffer |
| has been added to the wrong context is not always possible so don't depend on an error being produced |
| to deduce the correct context. Trace buffers from the same thread must be added in chronological order. |
| |
| Trace points are organised by thread, and iterators are provided that allow access: |
| a. chronologically across all threads (global) |
| b. chronologically within a single thread (thread) |
| |
| The global iterator uses the thread iterators meaning that once a trace point has |
| been returned via either type of iterator it will not be returned again via the other type. |
| The iterators may return null (without becoming invalid) when there are no more trace points available |
| but return data after a new trace buffer has been added. iterator.hasNext() indicates whether a call to |
| iterator.next() will return null and says nothing about whether more trace points can be expected for a given |
| context or thread. |
| |
| Trace points are kept sorted across threads when using the global iterator, however this optimisation invariant |
| is broken by use of a thread iterator. Consequently there is a performance hit when the global iterator is |
| next used, as the threads must be resorted. This can be significant with large numbers of threads. |
| |
| Example fragment parsing a single buffer via the API: |
| // metadata - byte[] either from the header in a trace file or via jvmti |
| // formatData - File containing the trace point specifications |
| |
| TraceContext context = TraceContext.getContext(metadata, formatData, System.out, System.err, System.err, null); |
| TraceThread thread = context.addData(buffer); |
| |
| Iterator global = context.getTracepoints(); |
| while (global.hasNext()) { |
| try { |
| TracePoint tracepoint = global.next(); |
| } catch (MissingDataException e) { |
| System.out.println("Discarded "+(e.getMissingBytes() / context.getRecordSize())+"bytes of trace data for thread "+thread.toString()); |
| continue; |
| } |
| |
| System.out.println(tracepoint.toString()); |
| }</div> |
| </section> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <table class="typeSummary"> |
| <caption><span>Interface Summary</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Interface</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tbody> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="TracePoint.html" title="interface in com.ibm.jvm.trace.format.api">TracePoint</a></th> |
| <td class="colLast"> |
| <div class="block">Class to represent a tracepoint produced by IBM JVM's trace engine.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </li> |
| <li class="blockList"> |
| <table class="typeSummary"> |
| <caption><span>Class Summary</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tbody> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="ActiveSection.html" title="class in com.ibm.jvm.trace.format.api">ActiveSection</a></th> |
| <td class="colLast"> |
| <div class="block">Active section of a file header.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="ByteStream.html" title="class in com.ibm.jvm.trace.format.api">ByteStream</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="Component.html" title="class in com.ibm.jvm.trace.format.api">Component</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="DataHeader.html" title="class in com.ibm.jvm.trace.format.api">DataHeader</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="Message.html" title="class in com.ibm.jvm.trace.format.api">Message</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="MessageFile.html" title="class in com.ibm.jvm.trace.format.api">MessageFile</a></th> |
| <td class="colLast"> |
| <div class="block">Acts as a template for mapping trace ids to messages.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="ProcessorSection.html" title="class in com.ibm.jvm.trace.format.api">ProcessorSection</a></th> |
| <td class="colLast"> |
| <div class="block">Processor section of a file header</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="ServiceSection.html" title="class in com.ibm.jvm.trace.format.api">ServiceSection</a></th> |
| <td class="colLast"> |
| <div class="block">Service section of a file header.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="StartupSection.html" title="class in com.ibm.jvm.trace.format.api">StartupSection</a></th> |
| <td class="colLast"> |
| <div class="block">Startup section of a file header.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="TraceContext.html" title="class in com.ibm.jvm.trace.format.api">TraceContext</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="TraceFileHeader.html" title="class in com.ibm.jvm.trace.format.api">TraceFileHeader</a></th> |
| <td class="colLast"> |
| <div class="block">Encapsulates the header for a trace file.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="TracePointDebugInfo.html" title="class in com.ibm.jvm.trace.format.api">TracePointDebugInfo</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="TracePointImpl.html" title="class in com.ibm.jvm.trace.format.api">TracePointImpl</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="TraceRecord.html" title="class in com.ibm.jvm.trace.format.api">TraceRecord</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="TraceSection.html" title="class in com.ibm.jvm.trace.format.api">TraceSection</a></th> |
| <td class="colLast"> |
| <div class="block">Trace section of a file header.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colFirst" scope="row"><a href="TraceThread.html" title="class in com.ibm.jvm.trace.format.api">TraceThread</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| </tbody> |
| </table> |
| </li> |
| <li class="blockList"> |
| <table class="typeSummary"> |
| <caption><span>Exception Summary</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Exception</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tbody> |
| <tr class="altColor"> |
| <th class="colFirst" scope="row"><a href="MissingDataException.html" title="class in com.ibm.jvm.trace.format.api">MissingDataException</a></th> |
| <td class="colLast"> </td> |
| </tr> |
| </tbody> |
| </table> |
| </li> |
| </ul> |
| </div> |
| </main> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../../index.html">Overview</a></li> |
| <li><a href="../../../../../../module-summary.html">Module</a></li> |
| <li class="navBarCell1Rev">Package</li> |
| <li>Class</li> |
| <li><a href="package-use.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../../index-files/index-1.html">Index</a></li> |
| <li><a href="../../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><div style="margin-top: 9px;"><strong>OpenJ9 JDK 11</strong></div></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small><a href="https://www.eclipse.org/openj9/" target="_blank">Eclipse OpenJ9 documentation.</a><br> To raise a bug report or suggest an improvement create an <a href="https://github.com/eclipse/openj9/issues" target="_blank">Eclipse Openj9 issue.</a><br> Copyright © 1998, 2020, IBM Corp. and others.</small></p> |
| </footer> |
| </body> |
| </html> |