async-profiler和jstack 结合,可以用于快速判断当前java 进程的瓶颈和可能导致问题的代码。
阿里arthas集成模式不如原生shell方便
跟踪指定函数貌似不起作用
./profiler.sh -e demo.MathGame.print -d 180 -i 5ms -f ~/maintest.svg 14203
-X 不用轻易使用,-X不是过滤显示,是must not occur in any of stack traces in the output,-I 可以,但时间短不一定能采集到。
-I include, -X exclude - filter stack traces by the given pattern(s). -I defines the name pattern that must be present in the stack traces, while -X is the pattern that must not occur in any of stack traces in the output. -I and -X options can be specified multiple times. A pattern may begin or end with a star * that denotes any (possibly empty) sequence of characters.
Example: ./profiler.sh -I ‘Primes.’ -I 'java/’ -X ‘Unsafe.park’ 8983
ps: 普通进程可以使用pref 进行类似跟踪。