in core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java [597:719]
private String executeArgs(ProfilerAction action) {
StringBuilder sb = new StringBuilder();
final char COMMA = ',';
// start - start profiling
// resume - start or resume profiling without resetting collected data
// stop - stop profiling
sb.append(action).append(COMMA);
if (this.event != null) {
sb.append("event=").append(this.event).append(COMMA);
}
if (this.alloc!= null) {
sb.append("alloc=").append(this.alloc).append(COMMA);
}
if (this.live) {
sb.append("live").append(COMMA);
}
if (this.lock!= null) {
sb.append("lock=").append(this.lock).append(COMMA);
}
if (this.jfrsync != null) {
this.format = "jfr";
sb.append("jfrsync=").append(this.jfrsync).append(COMMA);
}
if (this.file != null) {
sb.append("file=").append(this.file).append(COMMA);
}
if (this.format != null) {
sb.append(this.format).append(COMMA);
}
if (this.interval != null) {
sb.append("interval=").append(this.interval).append(COMMA);
}
if (this.features != null) {
sb.append("features=").append(this.features).append(COMMA);
}
if (this.signal != null) {
sb.append("signal=").append(this.signal).append(COMMA);
}
if (this.clock != null) {
sb.append("clock=").append(this.clock).append(COMMA);
}
if (this.jstackdepth != null) {
sb.append("jstackdepth=").append(this.jstackdepth).append(COMMA);
}
if (this.threads) {
sb.append("threads").append(COMMA);
}
if (this.sched) {
sb.append("sched").append(COMMA);
}
if (this.cstack != null) {
sb.append("cstack=").append(this.cstack).append(COMMA);
}
if (this.simple) {
sb.append("simple").append(COMMA);
}
if (this.sig) {
sb.append("sig").append(COMMA);
}
if (this.ann) {
sb.append("ann").append(COMMA);
}
if (this.lib) {
sb.append("lib").append(COMMA);
}
if (this.alluser) {
sb.append("alluser").append(COMMA);
}
if (this.norm) {
sb.append("norm").append(COMMA);
}
if (this.includes != null) {
for (String include : includes) {
sb.append("include=").append(include).append(COMMA);
}
}
if (this.excludes != null) {
for (String exclude : excludes) {
sb.append("exclude=").append(exclude).append(COMMA);
}
}
if (this.ttsp) {
this.begin = "SafepointSynchronize::begin";
this.end = "RuntimeService::record_safepoint_synchronized";
}
if (this.begin != null) {
sb.append("begin=").append(this.begin).append(COMMA);
}
if (this.end != null) {
sb.append("end=").append(this.end).append(COMMA);
}
if (this.wall != null) {
sb.append("wall=").append(this.wall).append(COMMA);
}
if (this.title != null) {
sb.append("title=").append(this.title).append(COMMA);
}
if (this.minwidth != null) {
sb.append("minwidth=").append(this.minwidth).append(COMMA);
}
if (this.reverse) {
sb.append("reverse").append(COMMA);
}
if (this.total) {
sb.append("total").append(COMMA);
}
if (this.chunksize != null) {
sb.append("chunksize=").append(this.chunksize).append(COMMA);
}
if (this.chunktime!= null) {
sb.append("chunktime=").append(this.chunktime).append(COMMA);
}
if (this.loop != null) {
sb.append("loop=").append(this.loop).append(COMMA);
}
if (this.timeout != null) {
sb.append("timeout=").append(this.timeout).append(COMMA);
}
return sb.toString();
}