使用perf报告解释perf.data文件的输出
我的C ++应用程序正在消耗大量CPU周期。因此,我已经使用了Linux Profiler对我的应用程序进行了调查
。 。
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 43K of event 'cpu-clock:uhH'
# Event count (approx.): 10966500000
#
# Overhead Command Shared Object Symbol
# ........ ............... ......................... ....................................................................................................................................................................................
#
59.19% ZManager libc-2.23.so [.] __mcount_internal
14.15% ZManager libc-2.23.so [.] _mcount
1.41% ZManager ZManager [.] std::vector<unsigned int, std::allocator<unsigned int> >::~vector
1.17% ZManager ZManager [.] std::vector<unsigned int, std::allocator<unsigned int> >::size
1.16% ZManager ZManager [.] std::vector<unsigned int, std::allocator<unsigned int> >::vector
0.46% ZManager ZManager [.] std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::_Vector_impl
0.45% ZManager ZManager [.] std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned int*>
0.40% ZManager libpthread-2.23.so [.] pthread_mutex_lock
0.39% ZManager ZManager [.] std::__miter_base<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > > >
0.38% ZManager libc-2.23.so [.] _int_malloc
0.36% ZManager ZManager [.] std::__niter_base<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > > >
0.34% ZManager ZManager [.] std::allocator<unsigned int>::allocator
0.34% ZManager ZManager [.] std::allocator<unsigned int>::~allocator
从上面可以明显看出,大多数CPU是由LIBC中的某些指令所消耗的(我的程序正在调用),
这显示出
59.19% ZManager libc-2.23.so [.] __mcount_internal
14.15% ZManager libc-2.23.so [.] _mcount
显示什么__ mcount_internal
和_mcount
方法?
My C++ application was consuming a lot of CPU cycles. So I have profiled my application using the Linux profiler.The output of the profiler (perf.data
) file was generated, and I have run perf report
The report is given below.
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 43K of event 'cpu-clock:uhH'
# Event count (approx.): 10966500000
#
# Overhead Command Shared Object Symbol
# ........ ............... ......................... ....................................................................................................................................................................................
#
59.19% ZManager libc-2.23.so [.] __mcount_internal
14.15% ZManager libc-2.23.so [.] _mcount
1.41% ZManager ZManager [.] std::vector<unsigned int, std::allocator<unsigned int> >::~vector
1.17% ZManager ZManager [.] std::vector<unsigned int, std::allocator<unsigned int> >::size
1.16% ZManager ZManager [.] std::vector<unsigned int, std::allocator<unsigned int> >::vector
0.46% ZManager ZManager [.] std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::_Vector_impl
0.45% ZManager ZManager [.] std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned int*>
0.40% ZManager libpthread-2.23.so [.] pthread_mutex_lock
0.39% ZManager ZManager [.] std::__miter_base<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > > >
0.38% ZManager libc-2.23.so [.] _int_malloc
0.36% ZManager ZManager [.] std::__niter_base<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > > >
0.34% ZManager ZManager [.] std::allocator<unsigned int>::allocator
0.34% ZManager ZManager [.] std::allocator<unsigned int>::~allocator
From the above it is clear that majority of the CPU is consumed by some instruction in libc (which my program is calling)
It is shown as
59.19% ZManager libc-2.23.so [.] __mcount_internal
14.15% ZManager libc-2.23.so [.] _mcount
Does anyone know what __mcount_internal
and _mcount
means?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论