Skip to content

Instantly share code, notes, and snippets.

@uttampawar
Created February 15, 2023 22:13
Show Gist options
  • Save uttampawar/13c5f0c77125c9ac54cb0a406cf68967 to your computer and use it in GitHub Desktop.
Save uttampawar/13c5f0c77125c9ac54cb0a406cf68967 to your computer and use it in GitHub Desktop.
1-mongodb thread with 1-client thread
Samples: 41K of event 'cycles', Event count (approx.): 571106932626
Overhead Command Shared Object Symbol
9.69% swapper [kernel.vmlinux] [k] acpi_processor_ffh_cstate_
2.07% conn2 mongod [.] __wt_row_search
1.86% conn2 libc-2.31.so [.] __memmove_avx_unaligned_er
0.97% conn2 [kernel.vmlinux] [k] copy_user_enhanced_fast_st
0.94% conn2 mongod [.] __wt_lex_compare_short
0.89% conn2 mongod [.] __config_next
0.88% conn2 mongod [.] __wt_row_leaf_key.constpro
0.87% conn2 mongod [.] __wt_checksum_hw
0.69% conn2 mongod [.] __wt_page_in_func
0.69% conn2 mongod [.] operator new[]
0.60% conn2 mongod [.] tc_deletearray_sized
0.54% swapper [kernel.vmlinux] [k] set_next_entity
0.52% conn2 [kernel.vmlinux] [k] psi_task_change
0.51% conn2 libc-2.31.so [.] __strlen_avx2
0.51% Thread-1 [kernel.vmlinux] [k] psi_task_change
0.49% swapper [kernel.vmlinux] [k] menu_select
0.45% conn2 [kernel.vmlinux] [k] _raw_spin_lock
0.33% conn2 mongod [.] mongo::ServiceEntryPointCo
0.32% swapper [kernel.vmlinux] [k] do_idle
0.32% conn2 [kernel.vmlinux] [k] sync_regs
0.29% conn2 [kernel.vmlinux] [k] tcp_recvmsg
0.29% swapper [kernel.vmlinux] [k] update_sd_lb_stats
0.28% swapper [kernel.vmlinux] [k] nr_iowait_cpu
0.27% conn2 libpthread-2.31.so [.] __pthread_mutex_unlock
0.26% swapper [kernel.vmlinux] [k] __sched_text_start
0.26% conn2 mongod [.] mongo::runQuery
0.25% conn2 mongod [.] mongo::latch_detail::Mutex
0.25% conn2 mongod [.] tc_deletearray_aligned_not
0.25% conn2 [kernel.vmlinux] [k] _raw_spin_lock_bh
0.24% conn2 mongod [.] std::_Sp_counted_base<(__g
0.24% conn2 libpthread-2.31.so [.] __pthread_mutex_trylock
0.24% conn2 [kernel.vmlinux] [k] tcp_sendmsg_locked
0.23% conn2 libpthread-2.31.so [.] __pthread_mutex_lock
0.23% conn2 mongod [.] mongo::LockStats<long>::re
0.22% conn2 mongod [.] mongo::OperationContext::~
0.22% swapper [kernel.vmlinux] [k] cpuidle_enter_state
0.22% conn2 mongod [.] tc_malloc
Cannot load tips.txt file, please install perf!
==============================================================
With Call graph
Children Self Command Shared Object Symbol
+ 60.24% 0.00% conn2 libpthread-2.31.so [.] start_thread ◆
+ 60.24% 0.00% conn2 mongod [.] mongo::(anonymous namespace)::runFunc ▒
+ 60.24% 0.00% conn2 mongod [.] mongo::unique_function<void ()>::makeImpl<mongo::launchServiceWorkerThread(mongo::unique_function<void ()>)::{lambda()#4}>(mongo::launchS▒
+ 60.22% 0.09% conn2 mongod [.] mongo::unique_function<void ()>::makeImpl<mongo::transport::ServiceExecutorSynchronous::scheduleTask(mongo::unique_function<void ()>, mon▒
+ 60.09% 0.05% conn2 mongod [.] mongo::unique_function<void ()>::makeImpl<mongo::transport::ServiceExecutor::schedule(mongo::unique_function<void (mongo::Status)>)::{lam▒
+ 60.06% 0.04% conn2 mongod [.] mongo::unique_function<void (mongo::Status)>::makeImpl<mongo::transport::ServiceExecutorSynchronous::runOnDataAvailable(std::shared_ptr<m▒
+ 59.95% 0.03% conn2 mongod [.] mongo::unique_function<void (mongo::Status)>::makeImpl<mongo::transport::ServiceStateMachine::Impl::scheduleNewLoop(mongo::Status)::{lamb▒
+ 59.61% 0.09% conn2 mongod [.] mongo::transport::ServiceStateMachine::Impl::startNewLoop ▒
+ 42.35% 0.02% conn2 mongod [.] mongo::future_details::FutureImpl<mongo::future_details::FakeVoid>::then<mongo::transport::ServiceStateMachine::Impl::startNewLoop(mongo:▒
+ 42.22% 0.13% conn2 mongod [.] mongo::transport::ServiceStateMachine::Impl::processMessage ▒
+ 38.63% 0.04% conn2 mongod [.] mongo::ServiceEntryPointMongod::handleRequest ▒
+ 38.29% 0.29% conn2 mongod [.] mongo::ServiceEntryPointCommon::handleRequest ▒
+ 36.79% 0.07% conn2 mongod [.] mongo::(anonymous namespace)::SynchronousOpRunner::run ▒
+ 36.62% 0.08% conn2 mongod [.] mongo::(anonymous namespace)::QueryOpRunner::runSync ▒
+ 33.86% 0.31% conn2 mongod [.] mongo::runQuery ▒
+ 18.48% 0.04% conn2 mongod [.] mongo::PlanExecutorImpl::getNext ▒
+ 18.43% 0.01% conn2 mongod [.] mongo::PlanExecutorImpl::getNextDocument ▒
- 18.36% 0.10% conn2 mongod [.] mongo::PlanExecutorImpl::_getNextImpl ▒
+ 18.26% mongo::PlanExecutorImpl::_getNextImpl ▒
- 18.06% 0.07% conn2 mongod [.] mongo::IDHackStage::doWork ▒
- 17.99% mongo::IDHackStage::doWork ▒
- 10.89% mongo::WorkingSetCommon::fetch ▒
- 10.61% mongo::WiredTigerRecordStoreCursorBase::seekExact ▒
- 10.26% mongo::wiredTigerPrepareConflictRetry<mongo::WiredTigerRecordStoreCursorBase::seekExact(mongo::RecordId const&)::{lambda()#1}> ▒
- 10.23% __curfile_search ▒
- 10.11% __wt_btcur_search ▒
- 8.64% __wt_row_search ▒
- 7.32% __wt_page_in_func ▒
- 6.77% __page_read ▒
- 6.29% __wt_bt_read ▒
+ 3.17% __memmove_avx_unaligned_erms ▒
- 2.68% __wt_bm_read ▒
- 1.63% __wt_block_read_off ▒
- 1.58% __wt_read ▒
- __libc_pread64 ▒
+ entry_SYSCALL_64 ▒
0.98% __wt_checksum_hw ▒
1.27% __wt_lex_compare_short ▒
- 6.39% mongo::AbstractIndexAccessMethod::findSingle ▒
- 4.42% mongo::(anonymous namespace)::WiredTigerIndexCursorBase::seekExact ▒
- 4.33% mongo::(anonymous namespace)::WiredTigerIndexCursorBase::seekExactForKeyString ▒
- 3.60% mongo::(anonymous namespace)::WiredTigerIndexCursorBase::seekWTCursor ▒
- 3.47% mongo::wiredTigerPrepareConflictRetry<mongo::(anonymous namespace)::WiredTigerIndexCursorBase::seekWTCursor(mongo::KeyString::Value const&)::{lambda()#1}> ▒
- 3.44% __curfile_search_near ▒
- 3.26% __wt_btcur_search_near ▒
- 2.88% __wt_row_search ▒
0.80% __wt_row_leaf_key.constprop.0 ▒
- 0.98% mongo::WiredTigerIdIndex::newCursor ▒
- 0.95% mongo::(anonymous namespace)::WiredTigerIndexCursorBase::WiredTigerIndexCursorBase ▒
- 0.85% mongo::WiredTigerCursor::WiredTigerCursor ▒
- 0.73% mongo::WiredTigerSession::getNewCursor ▒
- 0.69% mongo::(anonymous namespace)::_openCursor ▒
0.62% __session_open_cursor ▒
Annotated top mongod function "__wt_row_search()".
2.07% conn2 mongod [.] __wt_row_search
│ for (; limit != 0; limit >>= 1) {
│ shr %ebx
│ c44: test %ebx,%ebx
│ ↓ je 116f
│ indx = base + (limit >> 1);
1.02 │ c4c: mov -0x48(%rbp),%eax
│ mov %ebx,%r14d
0.24 │ shr %r14d
0.51 │ lea (%r14,%rax,1),%edi
│ descent = pindex->index[indx];
│ mov 0x8(%r11),%rax
│ indx = base + (limit >> 1);
│ mov %rdi,%r13
│ descent = pindex->index[indx];
12.28 │ mov (%rax,%rdi,8),%r15
│ __wt_ref_key():
│ v = (uintptr_t)ref->ref_ikey;
22.12 │ mov 0x20(%r15),%rax
│ if (v & WT_IK_FLAG) {
│ test $0x1,%al
│ ↑ jne c00
│ *(void **)keyp = WT_IKEY_DATA(ref->ref_ikey);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment