diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java index 32715e0a9..de4ee4bcb 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java @@ -56,7 +56,7 @@ import one.profiler.Counter; + " profiler dumpFlat # Dump flat profile, i.e. the histogram of the hottest methods\n" + " profiler dumpCollapsed # Dump profile in 'collapsed stacktraces' format\n" + " profiler dumpTraces # Dump collected stack traces\n" - + " profiler execute 'start' # Execute an agent-compatible profiling command\n" + + " profiler execute 'start,framebuf=5000000' # Execute an agent-compatible profiling command\n" + " profiler execute 'stop,file=/tmp/result.svg' # Execute an agent-compatible profiling command\n" + Constants.WIKI + Constants.WIKI_HOME + "profiler") //@formatter:on @@ -79,6 +79,11 @@ public class ProfilerCommand extends AnnotatedCommand { */ private Long interval; + /** + * size of the buffer for stack frames (default: 1'000'000) + */ + private Long framebuf; + /** * profile different threads separately */ @@ -150,6 +155,13 @@ public class ProfilerCommand extends AnnotatedCommand { this.interval = interval; } + @Option(shortName = "b", longName = "framebuf") + @Description("size of the buffer for stack frames (default: 1'000'000)") + @DefaultValue("1000000") + public void setFramebuf(long framebuf) { + this.framebuf = framebuf; + } + @Option(shortName = "f", longName = "file") @Description("dump output to ") public void setFile(String file) { @@ -247,6 +259,9 @@ public class ProfilerCommand extends AnnotatedCommand { if (this.interval != null) { sb.append("interval=").append(this.interval).append(','); } + if (this.framebuf != null) { + sb.append("framebuf=").append(this.framebuf).append(','); + } if (this.threads) { sb.append("threads").append(','); }