Error with jeprof Command: The first profile should be a remote form to use /pprof/symbol

Translation wujiuye 395 1 2024-01-22

This article is a translation of the original text, which can be found at the following link: https://www.wujiuye.com/article/94b58d50b39943189fd7b34ced3ab73d

Author: wujiuye
Link: https://www.wujiuye.com/article/94b58d50b39943189fd7b34ced3ab73d
Source: 吴就业的网络日记
This article is an original work by the blogger and is not allowed to be reproduced without the blogger's permission.

The jeprof command is encountering an error: The first profile should be a remote form to use /pprof/symbol, as shown below:

Using local file 2.heap.
The first profile should be a remote form to use /pprof/symbol

This is because the command necessitates the original binary files of the program.

For Java projects, the following command can be used:

jeprof --show_bytes --gif /usr/bin/java --base=1.heap 2.heap > ./3.gif

For Go projects, the executable file after compilation is required:

jeprof --show_bytes --gif /usr/local/xxx/yyy/zzz --base=1.heap 2.heap > ./3.gif

Error: dot -Tgif: No such file or directory

Dropping nodes with <= 5107 B; edges with <= 1021 abs(B)
Can't exec "dot": No such file or directory at /usr/local/bin/jeprof line 2096.
| dot -Tgif: No such file or directory

This may be due to a missing dependency command, which is why it does not output a PDF. Instead, opt for text or image output.

jeprof --show_bytes --text /usr/local/xxx/yyy/zzz 2.heap

Output:

Total: 1021521 B
984192  96.3%  96.3%   984192  96.3% ceph::buffer::v14_2_0::create_aligned_in_mempool
22537   2.2%  98.6%    32489   3.2% ceph_mount_info::init
8224   0.8%  99.4%     8224   0.8% ceph::buffer::v14_2_0::list::refill_append_space@7a310
4128   0.4%  99.8%     4128   0.4% ceph::buffer::v14_2_0::list::refill_append_space@5c3a60
672   0.1%  99.8%      672   0.1% std::string::_Rep::_S_create@2f5e0
576   0.1%  99.9%   993096  97.2% EventCenter::process_events
416   0.0%  99.9%      416   0.0% rados_conf_read_file
384   0.0% 100.0%      384   0.0% ceph::buffer::v14_2_0::list::substr_of
288   0.0% 100.0%      432   0.0% std::basic_string::basic_string
64   0.0% 100.0%       64   0.0% prof_backtrace_impl
48   0.0% 100.0%       48   0.0% std::_Rb_tree::_M_emplace_hint_unique
32   0.0% 100.0%    12512   1.2% ProtocolV2::write_event
32   0.0% 100.0%       32   0.0% ceph::buffer::v14_2_0::ptr_node::cloner::operator@5c4f80
32   0.0% 100.0%       32   0.0% ceph::buffer::v14_2_0::ptr_node::cloner::operator@7b830

Visitors 2024-07-15

执行下面的命令,仍然报这个错误,我使用的 jemalloc 版本是 5.1.0,是此版本有 bug 吗?

吴就业 2024-07-15

执行下面的命令,仍然报这个错误,我使用的 jemalloc 版本是 5.1.0,是此版本有 bug 吗?

我当时使用的是jemalloc-5.3.0这个版本。

比如你指定的二进制程序是使用arm64 cpu架构构建的(本地mac构建的),然后真正运行的二进制程序(线上运行)是amd64 cpu架构构建的。(go语言)

又或者安装的JDK版本不一样(Java语言)。

Visitors 2024-07-17

java 语言,安装的 jdk 版本也是一样的。。