apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.53k stars 3.97k forks source link

heap和contention profiler显示出现错误 #2138

Open 17336 opened 1 year ago

17336 commented 1 year ago

cpu profiler 是可以正常使用的,heap profiler显示如下

[20230227.150700.heap] Using local file bin/asr_service. Argument "MSWin32" isn't numeric in numeric eq (==) at ./rpc_data/profiling/pprof.pl line 4898. Argument "linux" isn't numeric in numeric eq (==) at ./rpc_data/profiling/pprof.pl line 4898. Using local file ./rpc_data/profiling/f0a4ab390fd3f861ca4c4d1ae0a612ea/20230227.150700.heap. Adjusting heap profiles for 1-in-524288 sampling rate Heap version 2 No nodes to print

系统版本: Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster

17336 commented 1 year ago

我是将内置服务的代码插入到.a链接的,发现在本地跑heap和contention profiler可以正常使用,但是在服务器上跑就会出现上面的问题

lorinlee commented 1 year ago

服务器上的版本是链接了tcmalloc吗

17336 commented 1 year ago

服务器上的版本是链接了tcmalloc吗

@lorinlee 本地和服务器跑的是同一套代码,都链接了libtcmalloc_and_profiler.so.4,然后我发现还另外链接了libjemalloc.so.2这个库,是因为这个的原因吗(但是本地也链接了这个,却能看heap和contention)

lorinlee commented 1 year ago

@17336 可以去掉jemalloc的链接尝试下看看

17336 commented 1 year ago

@17336 可以去掉jemalloc的链接尝试下看看

去掉了也还是不行

17336 commented 1 year ago

@17336 可以去掉jemalloc的链接尝试下看看

可以问下出现Argument "MSWin32" isn't numeric这个的原因嘛,感觉出在这个地方挺奇怪的

17336 commented 1 year ago

@17336 可以去掉jemalloc的链接尝试下看看

@lorinlee 请问目前只有cpu profiler能用jemalloc,heap不能用对吧?因为tcmalloc有瓶颈,线上服务只考虑用jemalloc

17336 commented 1 year ago

heap profiler有可能支持jemalloc吗

lorinlee commented 1 year ago

@17336 jemalloc可以用jemalloc自带的jeprof的