📄 index.html
字号:
</td>
</tr>
<tr>
<td>__PROFILER_WAIT_FRONTEND_CONNECT</td>
<td>1, if you need to wait, until frontend (plugin) will connect. (0 by default).<br/>
</td>
</tr>
</table>
<!-- CPU -->
<h2>CPU profiling</h2>
<p>
Profiler supports CPU profiling and basic function for heap profiling.
The profiler collects invocation count and direct time statistics for every method.
Direct time is the amount of time used by selected method for execute.
Also a total time value displayed in calling tree for selected thread.
The total time means a time used by selected method and by all the methods it had called.
</p>
<p>
Only instrumentation profiling method is supported because of its precise.
The overhead expenses reflects at speed decreasing app. 5 times to normal.
<h2>How it works</h2>
The profiler subscribes for JVPMI event JVMPI_EVENT_CLASS_LOAD_HOOK which
called during every class loading. The profiler modifies loading byte-code
by adding profiler's method call "enter" in the beginning of the every method of loading class
and at the end of it - "leave". "Enter" profiler's method notes the time of entering
to profiling method. "Leave" makes method leaving timestamp and calculates
a difference between enter and leave timestamps. This difference means total time
for this method call. Direct time calculates as total time of this method minus
total time of the all methods called by it. The profiles makes some time
corrections for the time spent by profiler.
<p>
The profiler implemented as an Eclipse perspective with following views:
Threads, Packages, Classes, Methods, Thread methods, Thread call tree, Heap.<br>
<p><b>Threads.</b><br> Shows a list with all threads (alive or dead) in the current process.
Here you can pause/resume refreshing of statistics in views,
pause/resume all threads in profilied program, clear all statistics or run GC in
profiled JVM.
<center>
<img border="0" src="threads.gif">
<br><b>Fig. 3. Threads View.</b><br>
</center>
</p>
<p><b>Call graph.</b><br>
Profiler uses Draw2D for displaying call graph of thread. All methods shown in
several columns, column depends on level, on which this method was called. Inside
one column methods sorted by direct time used. Each node in graph has color from red
to dark gray, depending on direct time. Methods with maximum time use have red color, and
methods, which almost don't use time, have grey color. Each method has hint with detailed information.
You can double click on method to open it in editor.<br/>Lines between method present call from
source method to target. Lines from one level to directly next have black color, to next - blue,
inside one level - red, and from backward calls - green. Width of line depeneds on how much of
time use in this call.
<center>
<img border="0" src="graph_full.gif">
<br><b>Fig. 3.1. Call graph.</b><br>
</center>
You can also see hit for call.
<center>
<img border="0" src="graph_call_hint.gif">
<br><b>Fig. 3.2. Call hint.</b><br>
</center>
As you can see, full graph looks fairly complex, but you can select part of it.
Press mouse on some method and select then button "Show callers", "Show calles" or
"Show caller and callees". You can see something like this:
<center>
<img border="0" src="graph_callers.gif">
<br><b>Fig. 3.3. Callers.</b><br>
</center>
<center>
<img border="0" src="graph_callees.gif">
<br><b>Fig. 3.4. Callees.</b><br>
</center>
<center>
<img border="0" src="graph_callers_callees.gif">
<br><b>Fig. 3.5. Callers and callees.</b><br>
</center>
You can double click on call line for opening editor with source method with
highlighting places, where it calls target method.
<center>
<img border="0" src="graph_show_calls.gif">
<br><b>Fig. 3.6. Show calls.</b><br>
</center>
</p>
<p><b>Packages.</b><br> Shows a list with all methods with class hierarchy from package.
This allows to determine packages which used the most of CPU time.
In this view (and in Classes and Methods views also) the user can see in gray color
the methods with unmodified parameters since last update. The user can hide such kind
of methods by applying appropriate filters.<br/>
Here:<br/>
Name - name of package/class/method<br/>
Inv. - invocation count<br/>
% - percent of all invocations<br/>
Time - direct time used<br/>
% - percent of total time<br/>
Time/Inv. - average time used for one invocation<br/>
Total time - total time used directly by method and by all methods it calls<br/>
Inst. time - time used for instrumentation of class<br/>
<center>
<img border="0" src="packages.gif">
<br><b>Fig. 4. Packages View.</b><br>
</center>
</p>
<p>You can add package or class to filter by pressing right mose button on
element in table and selecting menu item. Filter can be added to launch configuration
filter (will be used in next profiling, if you will active it) or to view filters
(will be activated right now).
<center>
<img border="0" src="filter_add.gif">
<br><b>Fig. 4.1. Add filter.</b><br>
</center>
</p>
<p><b>Classes.</b><br> Shows a list of all class methods with method hierarchy from class.
This allows to determine classes with the most CPU time usage.
<center>
<img border="0" src="classes.gif">
<br><b>Fig. 5. Classes View.</b><br>
</center>
</p>
<p><b>Filters.</b><br>Allows to define which kind of methods can be shown.
<center>
<img border="0" src="filter.gif">
<br><b>Fig. 6. Filters.</b><br>
</center>
You can save configured name patterns (inclusive or exalusive) with some name and
description, then you will able to select them in check list box.
<center>
<img border="0" src="filter_new.gif">
<br><b>Fig. 6.1. New filter.</b><br>
</center>
Later you can change this user defined filter.
<center>
<img border="0" src="filter_edit.gif">
<br><b>Fig. 6.2. Edit filter.</b><br>
</center>
</p>
<p><b>Methods.</b><br>Shows the statistics for all methods of the current process.
<center>
<img border="0" src="all_methods.gif">
<br><b>Fig. 7. All Methods View.</b><br>
</center>
</p>
<p><b>Thread methods.</b><br>Shows methods statictics for thread selected in Threads View.
<center>
<img border="0" src="thread_methods.gif">
<br><b>Fig. 8. Thread Methods View.</b><br>
</center>
</p>
<p><b>
Thread tree.</b><br> Shows a methods invocation tree for thread selected in Threads View.
Here red square used for highlighted methods (from thread methods context menu) and
green dot used for all other methods.
<center>
<img border="0" src="thread_tree.gif">
<br><b>Fig. 9. Thread Tree View.</b><br>
</center>
</p>
<p><b>
Inverted thread tree.</b><br> Shows a methods invocation tree for thread selected in Threads View starting from leaves.
This allows you fastly detect, that some leaf method uses much of total time and see, what methods it is called.
<center>
<img border="0" src="thread_tree_inverted.gif">
<br><b>Fig. 9.1. Inverted thread Tree View.</b><br>
</center>
</p>
<p><b>
Heap.</b><br>Shows heap usage graph: total (green), used (blue) and free (yellow) heap.
<center>
<img border="0" src="heap.gif" alt="Heap View." >
<br><b>Fig. 10. Heap View.</b><br>
</center>
</p>
<p>
Here is an overall view of the profiler perspective. You can see
a method HashMap.put opened in source code editor with highlighted lines of code
which has the maximum hit count (size of annotation depends on hit count).
You can open source code editor by choosing menu item "Open method in editor"
in context menu.
<center>
<img border="0" src="perspective.gif">
<br><b>Fig. 11. Perspective.</b><br>
</center>
</p> </p>
<a href="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=68851&type=5"
width="210" height="62" border="0" alt="SourceForge Logo">
</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -