使用pprof分析be的cpu profiler段错误

【StarRocks版本】2.5.3

$ pprof --text /home/starrocks/StarRocks/be/lib/starrocks_be http://192.168.164.130:28040/pprof/profile
Using local file /home/starrocks/StarRocks/be/lib/starrocks_be.
Gathering CPU profile from http://192.168.164.130:28040/pprof/profile?seconds=30 for 30 seconds to
  /root/pprof/starrocks_be.1689757217.192.168.164.130
Be patient...
Wrote profile to /root/pprof/starrocks_be.1689757217.192.168.164.130
sh: 行 1: 2709293 断开的管道         nm -n /home/starrocks/StarRocks-2.5.3/be/lib/starrocks_be 2> /dev/null
     2709294 段错误               (核心已转储)| 'c++filt'
sh: 行 1: 2709352 断开的管道         nm -n /home/starrocks/StarRocks-2.5.3/be/lib/starrocks_be 2> /dev/null
     2709353 段错误               (核心已转储)| 'c++filt'
Total: 38 samples
       7  18.4%  18.4%        7  18.4% starrocks::Tablet::tablet_footprint
       4  10.5%  28.9%        9  23.7% starrocks::TabletManager::_build_tablet_stat
       3   7.9%  36.8%        3   7.9% __pthread_cond_timedwait
       3   7.9%  44.7%        3   7.9% std::_Rb_tree::_M_copy
       2   5.3%  50.0%        2   5.3% __GI___pthread_rwlock_unlock
       2   5.3%  55.3%        2   5.3% __libc_send
       2   5.3%  60.5%        3   7.9% bvar::detail::AgentCombiner::reset_all_agents
       1   2.6%  63.2%        1   2.6% 0x00007fffa89f99a7
       1   2.6%  65.8%        1   2.6% 0x00007fffa89f99d0
       1   2.6%  68.4%        1   2.6% __GI___pthread_rwlock_rdlock
       1   2.6%  71.1%        1   2.6% __GI___pthread_rwlock_wrlock
       1   2.6%  73.7%        1   2.6% __pthread_enable_asynccancel
       1   2.6%  76.3%        1   2.6% __pthread_mutex_unlock_usercnt
       1   2.6%  78.9%        1   2.6% apache::thrift::transport::TVirtualTransport::write_virt
       1   2.6%  81.6%        1   2.6% bvar::detail::PercentileSamples::combine_of
       1   2.6%  84.2%        2   5.3% bvar::detail::combine
       1   2.6%  86.8%        1   2.6% jemalloc_usable_size
       1   2.6%  89.5%        1   2.6% pthread_mutex_lock
       1   2.6%  92.1%        1   2.6% sched_getcpu
       1   2.6%  94.7%        1   2.6% starrocks::TabletManager::find_best_tablet_to_do_update_compaction
       1   2.6%  97.4%        1   2.6% std::_Rb_tree_increment
       1   2.6% 100.0%        1   2.6% syscall
       0   0.0% 100.0%        1   2.6% 0x00000000112c392a
       0   0.0% 100.0%        1   2.6% 0x000000001ff58237
       0   0.0% 100.0%        1   2.6% 0x00007fffa89f9bd8
       0   0.0% 100.0%        1   2.6% __GI___clock_gettime
       0   0.0% 100.0%       14  36.8% apache::thrift::TDispatchProcessor::process
       0   0.0% 100.0%       14  36.8% apache::thrift::concurrency::Thread::threadMain
       0   0.0% 100.0%       14  36.8% apache::thrift::server::TConnectedClient::run
       0   0.0% 100.0%       14  36.8% apache::thrift::server::TThreadedServer::TConnectedClientRunner::run
       0   0.0% 100.0%        2   5.3% bvar::LatencyRecorder::latency_percentile
       0   0.0% 100.0%        4  10.5% bvar::PassiveStatus::SeriesSampler::take_sample
       0   0.0% 100.0%        3   7.9% bvar::detail::Percentile::reset
       0   0.0% 100.0%        3   7.9% bvar::detail::ReducerSampler::take_sample
       0   0.0% 100.0%        7  18.4% bvar::detail::SamplerCollector::run
       0   0.0% 100.0%        7  18.4% bvar::detail::SamplerCollector::sampling_thread
       0   0.0% 100.0%        1   2.6% bvar::detail::get_latencies
       0   0.0% 100.0%        1   2.6% bvar::print_fd_count
       0   0.0% 100.0%       21  55.3% execute_native_thread_routine
       0   0.0% 100.0%       14  36.8% starrocks::BackendServiceProcessor::dispatchCall
       0   0.0% 100.0%       14  36.8% starrocks::BackendServiceProcessor::process_get_tablet_stat
       0   0.0% 100.0%        2   5.3% starrocks::BackendService_get_tablet_stat_result::write
       0   0.0% 100.0%        4  10.5% starrocks::ReportDiskStateTaskWorkerPool::_worker_thread_callback
       0   0.0% 100.0%        1   2.6% starrocks::RuntimeFilterCache::_clean_thread_func
       0   0.0% 100.0%        1   2.6% starrocks::StorageEngine::_perform_update_compaction
       0   0.0% 100.0%        1   2.6% starrocks::StorageEngine::_update_compaction_thread_callback
       0   0.0% 100.0%        4  10.5% starrocks::StorageEngine::get_all_data_dir_info
       0   0.0% 100.0%        1   2.6% starrocks::TTabletStat::write
       0   0.0% 100.0%        1   2.6% starrocks::TTabletStatResult::write
       0   0.0% 100.0%        9  23.7% starrocks::TabletManager::get_tablet_stat
       0   0.0% 100.0%        4  10.5% starrocks::TabletManager::update_root_path_info
       0   0.0% 100.0%        7  18.4% start_thread
       0   0.0% 100.0%        1   2.6% std::_Rb_tree::_M_erase [clone .isra.0]
       0   0.0% 100.0%        3   7.9% std::_Rb_tree::operator= [clone .isra.0]
       0   0.0% 100.0%       14  36.8% std::thread::_State_impl::_M_run
$

请问,这种现象正常吗?

没有尝试过使用pprof进行分析,我这边后续演练下。starrocks_be是使用C++进行开发的,想要分析be进程的cpu使用情况,可以使用perf top -p pid

1赞

好的,麻烦演练后更新一下该帖子