mirror of https://github.com/alibaba/arthas.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
68 KiB
HTML
94 lines
68 KiB
HTML
3 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="en-US">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
<meta name="generator" content="VuePress 2.0.0-beta.49">
|
||
|
<style>
|
||
|
:root {
|
||
|
--c-bg: #fff;
|
||
|
}
|
||
|
html.dark {
|
||
|
--c-bg: #22272e;
|
||
|
}
|
||
|
html, body {
|
||
|
background-color: var(--c-bg);
|
||
|
}
|
||
|
</style>
|
||
|
<script>
|
||
|
const userMode = localStorage.getItem('vuepress-color-scheme');
|
||
|
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||
|
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||
|
document.documentElement.classList.toggle('dark', true);
|
||
|
}
|
||
|
</script>
|
||
|
<link rel="icon" href="/images/favicon.ico"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta property="og:title" content="Arthas"><meta property="og:image:alt" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - Fatpandac/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><meta property="og:image" content="/images/arthas_mate_image.png"><meta property="og:description" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - Fatpandac/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="600"><meta property="twitter:image:src" content="/images/arthas_mate_image.png"><meta property="twitter:image:alt" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - Fatpandac/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><script>
|
||
|
var _hmt = _hmt || [];
|
||
|
(function() {
|
||
|
var hm = document.createElement("script");
|
||
|
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
|
||
|
var s = document.getElementsByTagName("script")[0];
|
||
|
s.parentNode.insertBefore(hm, s);
|
||
|
})();
|
||
|
</script><title>profiler | arthas</title><meta name="description" content="arthas user document">
|
||
|
<link rel="modulepreload" href="/assets/app.b2be689e.js"><link rel="modulepreload" href="/assets/profiler.html.9ed7d95d.js"><link rel="modulepreload" href="/assets/arthas-output-svg.a3bef681.js"><link rel="modulepreload" href="/assets/profiler.html.5c15fc85.js"><link rel="prefetch" href="/assets/index.html.45b69b3a.js"><link rel="prefetch" href="/assets/index.html.76ea9ae7.js"><link rel="prefetch" href="/assets/index.html.f5d6a449.js"><link rel="prefetch" href="/assets/advanced-use.html.e598a294.js"><link rel="prefetch" href="/assets/advice-class.html.36067001.js"><link rel="prefetch" href="/assets/agent.html.9015da1d.js"><link rel="prefetch" href="/assets/arthas-properties.html.cee1ed6b.js"><link rel="prefetch" href="/assets/arthas3.html.acc26c6e.js"><link rel="prefetch" href="/assets/async.html.e27f256b.js"><link rel="prefetch" href="/assets/auth.html.32218e6b.js"><link rel="prefetch" href="/assets/base64.html.4047e29e.js"><link rel="prefetch" href="/assets/batch-support.html.7ecb82c6.js"><link rel="prefetch" href="/assets/cat.html.cc30c619.js"><link rel="prefetch" href="/assets/classloader.html.6c401b19.js"><link rel="prefetch" href="/assets/cls.html.5a559768.js"><link rel="prefetch" href="/assets/commands.html.fab4bb12.js"><link rel="prefetch" href="/assets/contact-us.html.edf149ad.js"><link rel="prefetch" href="/assets/dashboard.html.4eb977c5.js"><link rel="prefetch" href="/assets/docker.html.811af1aa.js"><link rel="prefetch" href="/assets/download.html.54eca683.js"><link rel="prefetch" href="/assets/dump.html.cecedbdc.js"><link rel="prefetch" href="/assets/echo.html.046fded9.js"><link rel="prefetch" href="/assets/faq.html.4b73f02d.js"><link rel="prefetch" href="/assets/getstatic.html.8b8918aa.js"><link rel="prefetch" href="/assets/grep.html.9589e767.js"><link rel="prefetch" href="/assets/groovy.html.a7b151ba.js"><link rel="prefetch" href="/assets/heapdump.html.3779c034.js"><link rel="prefetch" href="/assets/help.html.1ee751af.js"><link rel="prefetch" href="/assets/history.html.6d544ac4.js"><link rel="prefetch" href="/assets/http-api.html.1ee2ca01.js"><link rel="prefetch" href="/assets/idea-plugin.html.3d23f092.js"><link rel="prefetch" href="/assets/install-detail.html.e60cda0e.js"><link rel="prefetch" href="/assets/jad.html.7cc2f9ab.js"><link rel="prefetch" href="/assets/jvm.html.99f686c2.js"><link rel="prefetch" href="/assets/keymap.html.152983ec.js"><link rel="prefetch" href="/assets/logger.html.37652f5a.js"><link rel="prefetch" href="/assets/manual-install.html.ec6f137a.js"><link rel="prefetch" href="/assets/mbean.html.dd61851f.js"><link rel="prefetch" href="/assets/mc.html.4ad9c4ed.js"><link rel="prefetch" href="/assets/memory.html.987bdeb1.js"><link rel="prefetch" href="/assets/monitor.html.39213eeb.js"><link rel="prefetch" href="/assets/ognl.html.94fd12b2.js"><link rel="prefetch" href="/assets/options.html.ff8fe789.js"><link rel="prefetch" href="/assets/perfcounter.html.4ad1dec5.js"><link rel="prefetch" href="/assets/profiler.html.235e7cd3.js"><link rel="prefetch" href="/assets/pwd.html.31c88e07.js"><link rel="prefetch" href="/assets/quick-start.html.ecd924ae.js"><link rel="prefetch" href="/assets/quit.html.f082ff2d.js"><link rel="prefetch" href="/assets/redefine.html.9dc81560.js"><link rel="prefetch" href="/assets/release-notes.html.ceeefd88.js"><link rel="prefetch" href="/assets/reset.html.fb7a3c31.js"><link rel="prefetch" href="/assets/retransform.html.c3f8c24d.js"><link rel="prefetch" href="/assets/save-log.html.b8840842.js"><link rel="prefetch" href="/assets/sc.html.46898c95.js"><link rel="prefetch" href="/assets/session.html.e39a5ae5.js"><link rel="prefetch" href="/assets/sm.html.3335d118.js"><link rel="prefetch" href="/assets/spring-boot-starter.html.15a438ba.js"><link rel="prefetch" href="/assets/stack.html.6cf13a4b.js"><link rel="prefetch" href="/assets/start-arthas.html.073b53b8.js"><link rel="prefetch" href="/assets/stop.html.4353502b.js"><link rel="prefetch" href="/assets/sysenv.html.b3de9636.js"><link rel="prefetch" href="/assets/sysprop.html.bad87bbb.js"><link rel="prefetch" href="/assets/t
|
||
|
<link rel="stylesheet" href="/assets/style.eaa9a6b4.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/en/" class=""><!----><span class="site-name can-hide">arthas</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a href="/en/" class="" aria-label="HOME"><!--[--><!--]--> HOME <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="/doc/arthas-tutorials.html?language=en&id=arthas-basics" rel="noopener noreferrer" target="_blank" aria-label="ONLINE TUTORIALS"><!--[--><!--]--><span>ONLINE TUTORIALS</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/en/doc" class="router-link-active" aria-label="DOCS"><!--[--><!--]--> DOCS <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="SOLUTIONS"><span class="title">SOLUTIONS</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="SOLUTIONS"><span class="title">SOLUTIONS</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://cn.aliyun.com/product/aliware/mse?spm=arthas.topbar.0.0.0" rel="noopener noreferrer" target="_blank" aria-label="Microservice solutions"><!--[--><!--]--><span>Microservice solutions</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="https://www.aliyun.com/aliware/txc?spm=arthas.topbar.0.0.0" rel="noopener noreferrer" target="_blank" aria-label="Distributed transaction solutions"><!--[--><!--]--><span>Distributed transaction solutions</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="https://www.aliyun.com/product/ahas?spm=arthas.topbar.0.0.0" rel="noopener noreferrer" target="_blank" aria-label="High-availability solution"><!--[--><!--]--><span>High-availability solution</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M1
|
||
|
Started [cpu] profiling
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>By default, the sample event is <code>cpu</code>. Can be specified with the <code>--event</code> parameter.</p></div><h3 id="get-the-number-of-samples-collected" tabindex="-1"><a class="header-anchor" href="#get-the-number-of-samples-collected" aria-hidden="true">#</a> Get the number of samples collected</h3><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ profiler getSamples
|
||
|
23
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="view-profiler-status" tabindex="-1"><a class="header-anchor" href="#view-profiler-status" aria-hidden="true">#</a> View profiler status</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler status
|
||
|
<span class="token punctuation">[</span>cpu<span class="token punctuation">]</span> profiling is running <span class="token keyword">for</span> <span class="token number">4</span> seconds
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>Can view which <code>event</code> and sampling time.</p><h3 id="stop-profiler" tabindex="-1"><a class="header-anchor" href="#stop-profiler" aria-hidden="true">#</a> Stop profiler</h3><h4 id="generating-html-format-results" tabindex="-1"><a class="header-anchor" href="#generating-html-format-results" aria-hidden="true">#</a> Generating html format results</h4><p>By default, the result file is <code>html</code> format. You can also specify it with the <code>--format</code> parameter:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler stop --format html
|
||
|
profiler output file: /tmp/test/arthas-output/20211207-111550.html
|
||
|
OK
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Or use the file name name format in the <code>--file</code> parameter. For example, <code>--file /tmp/result.html</code>.</p><h3 id="view-profiler-results-under-arthas-output-via-browser" tabindex="-1"><a class="header-anchor" href="#view-profiler-results-under-arthas-output-via-browser" aria-hidden="true">#</a> View profiler results under arthas-output via browser</h3><p>By default, arthas uses port 3658, which can be opened: <a href="http://localhost:3658/arthas-output/" target="_blank" rel="noopener noreferrer">http://localhost:3658/arthas-output/<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> View the <code>arthas-output</code> directory below Profiler results:</p><p><img src="/images/arthas-output.jpg" alt=""></p><p>Click to view specific results:</p><p><img src="/images/arthas-output-svg.jpg" alt=""></p><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>If using the chrome browser, may need to be refreshed multiple times.</p></div><h3 id="profiler-supported-events" tabindex="-1"><a class="header-anchor" href="#profiler-supported-events" aria-hidden="true">#</a> Profiler supported events</h3><p>Under different platforms and different OSs, the supported events are different. For example, under macos:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler list
|
||
|
Basic events:
|
||
|
cpu
|
||
|
alloc
|
||
|
lock
|
||
|
wall
|
||
|
itimer
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Under linux</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler list
|
||
|
Basic events:
|
||
|
cpu
|
||
|
alloc
|
||
|
lock
|
||
|
wall
|
||
|
itimer
|
||
|
Perf events:
|
||
|
page-faults
|
||
|
context-switches
|
||
|
cycles
|
||
|
instructions
|
||
|
cache-references
|
||
|
cache-misses
|
||
|
branches
|
||
|
branch-misses
|
||
|
bus-cycles
|
||
|
L1-dcache-load-misses
|
||
|
LLC-load-misses
|
||
|
dTLB-load-misses
|
||
|
mem:breakpoint
|
||
|
trace:tracepoint
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If you encounter the permissions/configuration issues of the OS itself and then missing some events, you can refer to the <a href="https://github.com/jvm-profiling-tools/async-profiler" target="_blank" rel="noopener noreferrer">async-profiler<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> documentation.</p><p>You can use the <code>--event</code> parameter to specify the event to sample, such as sampling the <code>alloc</code> event:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler start --event alloc
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="resume-sampling" tabindex="-1"><a class="header-anchor" href="#resume-sampling" aria-hidden="true">#</a> Resume sampling</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler resume
|
||
|
Started <span class="token punctuation">[</span>cpu<span class="token punctuation">]</span> profiling
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>The difference between <code>start</code> and <code>resume</code> is: <code>start</code> is the new start sampling, <code>resume</code> will retain the data of the last <code>stop</code>.</p><p>You can verify the number of samples by executing <code>profiler getSamples</code>.</p><h3 id="use-execute-action-to-execute-complex-commands" tabindex="-1"><a class="header-anchor" href="#use-execute-action-to-execute-complex-commands" aria-hidden="true">#</a> Use <code>execute</code> action to execute complex commands</h3><p>For example, start sampling:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler execute <span class="token string">'start,framebuf=5000000'</span>
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Stop sampling and save to the specified file:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler execute <span class="token string">'stop,file=/tmp/result.html'</span>
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Specific format reference: <a href="https://github.com/jvm-profiling-tools/async-profiler/blob/v2.5/src/arguments.cpp#L50" target="_blank" rel="noopener noreferrer">arguments.cpp<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></p><h3 id="view-all-supported-actions" tabindex="-1"><a class="header-anchor" href="#view-all-supported-actions" aria-hidden="true">#</a> View all supported actions</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler actions
|
||
|
Supported Actions: <span class="token punctuation">[</span>resume, dumpCollapsed, getSamples, start, list, execute, version, stop, load, dumpFlat, actions, dumpTraces, status<span class="token punctuation">]</span>
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="view-version" tabindex="-1"><a class="header-anchor" href="#view-version" aria-hidden="true">#</a> View version</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler version
|
||
|
Async-profiler <span class="token number">1.6</span> built on Sep <span class="token number">9</span> <span class="token number">2019</span>
|
||
|
Copyright <span class="token number">2019</span> Andrei Pangin
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="configure-framebuf-option" tabindex="-1"><a class="header-anchor" href="#configure-framebuf-option" aria-hidden="true">#</a> Configure framebuf option</h3><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>you encounter <code>[frame_buffer_overflow]</code> in the generated result, you need to increase the framebuf (the default value is 1'000'000), which can be configured explicitly, such as:</p></div><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start --framebuf <span class="token number">5000000</span>
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="configure-include-exclude-to-filter-data" tabindex="-1"><a class="header-anchor" href="#configure-include-exclude-to-filter-data" aria-hidden="true">#</a> Configure include/exclude to filter data</h3><p>If the application is complex and generates a lot of content, and you want to focus on only part of the data, you can filter by include/exclude. such as</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start --include<span class="token string">'java/*'</span> --include<span class="token string">'demo/*'</span> --exclude<span class="token string">'*Unsafe.park*'</span>
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><blockquote><p>Both include/exclude support setting multiple values, but need to be configured at the end of the command line.</p></blockquote><h3 id="specify-execution-time" tabindex="-1"><a class="header-anchor" href="#specify-execution-time" aria-hidden="true">#</a> Specify execution time</h3><p>For example, if you want the profiler to automatically end after 300 seconds, you can specify it with the <code>-d</code>/<code>--duration</code> parameter:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start --duration <span class="token number">300</span>
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="generate-jfr-format-result" tabindex="-1"><a class="header-anchor" href="#generate-jfr-format-result" aria-hidden="true">#</a> Generate jfr format result</h3><blockquote><p>Note that jfr only supports configuration at <code>start</code>. If it is specified at <code>stop</code>, it will not take effect.</p></blockquote><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>profiler start --file /tmp/test.jfr
|
||
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>The <code>file</code> parameter supports some variables:</p><ul><li>Timestamp: <code>--file /tmp/test-%t.jfr</code></li><li>Process ID: <code>--file /tmp/test-%p.jfr</code></li></ul><p>The generated results can be viewed with tools that support the jfr format. such as:</p><ul><li>JDK Mission Control: https://github.com/openjdk/jmc</li><li>JProfiler: https://github.com/alibaba/arthas/issues/1416</li></ul><h3 id="the-unknown-in-profiler-result" tabindex="-1"><a class="header-anchor" href="#the-unknown-in-profiler-result" aria-hidden="true">#</a> The 'unknown' in profiler result</h3><ul><li>https://github.com/jvm-profiling-tools/async-profiler/discussions/409</li></ul></div><!--[--><!--]--></div><footer class="page-meta right-menu-padding" data-v-e0e60120><div class="meta-item edit-link"><a class="external-link meta-item-label" href="https://github.com/alibaba/arthas/edit/master/site/docs/en/doc/profiler.md" rel="noopener noreferrer" target="_blank" aria-label="Edit this page on GitHub"><!--[--><!--]--><span>Edit this page on GitHub</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: hengyunabc@gmail.com">hengyunabc</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: hollowman186@vip.qq.com">Hollow Man</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
||
|
<script type="module" src="/assets/app.b2be689e.js" defer></script>
|
||
|
</body>
|
||
|
</html>
|