MCPcopy Create free account
hub / github.com/apache/brpc / DumpMemoryPoolInfo

Function DumpMemoryPoolInfo

src/brpc/rdma/block_pool.cpp:544–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542}
543
544void DumpMemoryPoolInfo(std::ostream& os) {
545 if (!g_dump_mutex) {
546 return;
547 }
548 g_dump_enable = true;
549 usleep(1000); // wait until all the threads read new g_dump_enable
550 BAIDU_SCOPED_LOCK(*g_dump_mutex);
551 os << "********************* Memory Pool Info Dump **********************\n";
552 os << "Region Info:\n";
553 for (int i = 0; i < g_region_num; ++i) {
554 os << "\tRegion " << i << ":\n"
555 << "\t\tBase Addr: " << g_regions[i].start << "\n"
556 << "\t\tSize: " << g_regions[i].size << "\n"
557 << "\t\tBlock Type: " << g_regions[i].block_type << "\n"
558 << "\t\tId: " << g_regions[i].id << "\n";
559 }
560 os << "Idle List Info:\n";
561 for (int i = 0; i < BLOCK_SIZE_COUNT; ++i) {
562 os << "\tFor block size " << GetBlockSize(i) << ":\n";
563 for (size_t j = 0; j < g_buckets; ++j) {
564 os << "\t\tBucket " << j << ": {" << g_info->idle_size[i][j]
565 << ", " << g_info->expansion_size[i][j] << "}\n";
566 }
567 }
568 os << "Thread Local Cache Info:\n";
569 for (size_t i = 0; i < g_tls_info_cnt; ++i) {
570 os << "\tThread " << i << ": " << *g_tls_info[i] * 8192 << "\n";
571 }
572 os << "******************************************************************\n";
573 g_dump_enable = false;
574}
575
576// Just for UT
577void DestroyBlockPool() {

Callers 2

TEST_FFunction · 0.85
TearDownMethod · 0.85

Calls 1

GetBlockSizeFunction · 0.85

Tested by 2

TEST_FFunction · 0.68
TearDownMethod · 0.68