MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / prof_log_rep_check

Function prof_log_rep_check

deps/jemalloc/src/prof.c:2459–2508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2457}
2458
2459bool
2460prof_log_rep_check(void) {
2461 if (prof_logging_state == prof_logging_state_stopped
2462 && log_tables_initialized) {
2463 return true;
2464 }
2465
2466 if (log_bt_last != NULL && log_bt_last->next != NULL) {
2467 return true;
2468 }
2469 if (log_thr_last != NULL && log_thr_last->next != NULL) {
2470 return true;
2471 }
2472 if (log_alloc_last != NULL && log_alloc_last->next != NULL) {
2473 return true;
2474 }
2475
2476 size_t bt_count = prof_log_bt_count();
2477 size_t thr_count = prof_log_thr_count();
2478 size_t alloc_count = prof_log_alloc_count();
2479
2480
2481 if (prof_logging_state == prof_logging_state_stopped) {
2482 if (bt_count != 0 || thr_count != 0 || alloc_count || 0) {
2483 return true;
2484 }
2485 }
2486
2487 prof_alloc_node_t *node = log_alloc_first;
2488 while (node != NULL) {
2489 if (node->alloc_bt_ind >= bt_count) {
2490 return true;
2491 }
2492 if (node->free_bt_ind >= bt_count) {
2493 return true;
2494 }
2495 if (node->alloc_thr_ind >= thr_count) {
2496 return true;
2497 }
2498 if (node->free_thr_ind >= thr_count) {
2499 return true;
2500 }
2501 if (node->alloc_time_ns > node->free_time_ns) {
2502 return true;
2503 }
2504 node = node->next;
2505 }
2506
2507 return false;
2508}
2509
2510void
2511prof_log_dummy_set(bool new_value) {

Callers 1

assert_repFunction · 0.85

Calls 3

prof_log_bt_countFunction · 0.85
prof_log_thr_countFunction · 0.85
prof_log_alloc_countFunction · 0.85

Tested by 1

assert_repFunction · 0.68