gpt4 book ai didi

java-8 - 如何使用uprobe追踪OpenJDK HotSpot源代码?

转载 作者:行者123 更新时间:2023-12-02 11:41:08 30 4
gpt4 key购买 nike

我尝试按照 link 的说明进行操作

在此example ,

Tracing func_abc() in my test program, and including user-level stacks:

# ./uprobe -s p:/root/func_abc:func_c
Tracing uprobe func_c (p:func_c /root/func_abc:0x4f4). Ctrl-C to end.
func_abc-25394 [000] d... 19603250.054040: func_c: (0x4004f4)
func_abc-25394 [000] d... 19603250.054056: <user stack trace>
=> <00000000004004f4>
=> <0000000000400527>
=> <0000000000400537>
=> <00007fca9f0e376d>
func_abc-25394 [000] d... 19603251.054250: func_c: (0x4004f4)
func_abc-25394 [000] d... 19603251.054266: <user stack trace>
=> <00000000004004f4>
=> <0000000000400527>
=> <0000000000400537>
=> <00007fca9f0e376d>
^C
Ending tracing...

我想探测函数minor_collection_begin但它显示错误:缺少符号

root@wxf:/home/wxf/perf-tool/perf-tools/bin# ./uprobe -s p:/home/wxf/9dev/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java:AdaptiveSizePolicy::minor_collection_begin
ERROR: missing symbol "minor_collection_begin" in /home/wxf/9dev/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java
root@wxf:/home/wxf/perf-tool/perf-tools/bin# ./uprobe -s p:/home/wxf/9dev/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java:minor_collection_begin
ERROR: missing symbol "minor_collection_begin" in /home/wxf/9dev/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java

我搜索了很多,发现它与libjvm.so有关。但是,我不知道下一步该做什么。

wxf@wxf:/home/wxf/adjustableMaxHeapSize_9jdk_prj/9dev$ find -name "libjvm.so"
./build/linux-x86_64-normal-server-slowdebug/support/modules_libs/java.base/server/libjvm.so
./build/linux-x86_64-normal-server-slowdebug/hotspot/variant-server/libjvm/gtest/libjvm.so
./build/linux-x86_64-normal-server-slowdebug/jdk/lib/server/libjvm.so

最佳答案

C++ 符号为 mangled在二进制对象中。您将找不到 minor_collection_beginvoid AdaptiveSizePolicy::minor_collection_begin() 的损坏符号名称为

_ZN18AdaptiveSizePolicy22minor_collection_beginEv

关于java-8 - 如何使用uprobe追踪OpenJDK HotSpot源代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48535366/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com