简体   繁体   English

async-profiler 查看 jvm 支持的分析事件列表

[英]async-profiler viewing list of profiling events supported by jvm

I am trying to view list of profiling events supported by jvm.我正在尝试查看 jvm 支持的分析事件列表。 As mentioned in the doc I have used the list command as shown below -正如文档中提到的,我使用了list命令,如下所示 -

root@vrni-platform:/home/ubuntu/async-profiler-2.0-linux-x64# ./profiler.sh list 10208
Basic events:
  cpu
  alloc
  lock
  wall
  itimer
Java method calls:
  ClassName.methodName
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

I am not seeing the events as mentioned in this answer in the above output.我在上面的输出中没有看到这个答案中提到的事件。 But if I execute the above events as mentioned in that answer it seems to be working.但是,如果我执行该答案中提到的上述事件,它似乎正在起作用。

root@vrni-platform:/home/ubuntu/async-profiler-2.0-linux-x64# ./profiler.sh -e malloc -d 30 -f /tmp/flamegraph.html 10208
Profiling for 30 seconds
Done

在此处输入图片说明

Can someone let me know how can I view list of all events supported by aysnc-profiler for a particular jvm?有人可以让我知道如何查看特定 jvm 的 aysnc-profiler 支持的所有事件的列表吗? If list is the correct argument for profiler.sh then why malloc, etc are shown under list of all events?如果listprofiler.sh的正确参数,那么为什么 malloc 等显示在所有事件的列表下?

Environment环境

ubuntu@vrni-platform:~/async-profiler-2.0-linux-x64# ./profiler.sh --version
Async-profiler 2.0 built on Mar 14 2021
Copyright 2016-2021 Andrei Pangin
ubuntu@vrni-platform:~/async-profiler-2.0-linux-x64# uname -a
Linux vrni-platform 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@vrni-platform:~/async-profiler-2.0-linux-x64$ java -version
openjdk version "11.0.11" 2021-04-20 LTS
OpenJDK Runtime Environment Zulu11.48+22-SA (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.48+22-SA (build 11.0.11+9-LTS, mixed mode)

malloc here is not a separate event. malloc在这里不是一个单独的事件。 It's just an example of an execution breakpoint.这只是一个执行断点的例子。

async-profiler, with the assistance of the hardware breakpoints , can trace access to any memory location. async-profiler 在硬件断点的帮助下,可以跟踪对任何内存位置的访问。 Using the perf-like syntax for hardware breakpoints, you can choose to profile the execution of any given address in the code:对硬件断点使用类似 perf 的语法,您可以选择分析代码中任何给定地址的执行情况:

./profiler.sh -e mem:0x123450:x <pid>

Instead of the numerical address, it's possible to specify a native function name.可以指定本地函数名称而不是数字地址。 malloc is just a name of the function in the standard C library (libc): malloc只是标准 C 库 (libc) 中函数的名称:

./profiler.sh -e mem:malloc:x <pid>

And -e malloc is a shortcut for the above event descriptor.-e malloc是上述事件描述符的快捷方式。 If async-profiler finds that the given event name corresponds to some native function, it profiles the execution of this function.如果 async-profiler 发现给定的事件名称对应于某个本机函数,它会分析该函数的执行情况。

Instead of malloc , you can profile any other function as well.除了malloc ,您还可以分析任何其他函数。 For example,例如,

  • -e pthread_start to find who starts new threads (both Java and native threads); -e pthread_start查找谁启动了新线程(Java 和本地线程);
  • -e connect to profile new socket connections; -e connect到配置文件新的套接字连接;
  • -e JVM_GC to find callers of System.gc() ; -e JVM_GC来查找System.gc()调用者;
  • -e G1CollectedHeap::humongous_obj_allocate to profile G1 humongous allocations; -e G1CollectedHeap::humongous_obj_allocate来分析 G1 巨大的分配;
  • -e Deoptimization::uncommon_trap to find where the compiled code is deoptimized; -e Deoptimization::uncommon_trap查找编译后的代码去优化的位置;

and so on, and so forth.等等等等。 There are thousands of native functions in the JVM, in the standard class library, in libc.在 JVM 中,在标准类库中,在 libc 中,有数以千计的本机函数。 Obviously, it's not practically possible to list them all in async-profiler help.显然,在 async-profiler 帮助中列出所有这些实际上是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM