_ZN11addressbook6Person25internal_default_instanceEv:
  322|      2|  static inline const Person* internal_default_instance() {
  323|      2|    return reinterpret_cast<const Person*>(
  324|      2|               &_Person_default_instance_);
  325|      2|  }
_ZN11addressbook6Person16default_instanceEv:
  319|      2|  static const Person& default_instance() {
  320|      2|    return *internal_default_instance();
  321|      2|  }

_ZN4brpc22AdaptiveMaxConcurrencyC2Ei:
   34|      2|    : _max_concurrency(0) {
   35|      2|    if (max_concurrency <= 0) {
  ------------------
  |  Branch (35:9): [True: 2, False: 0]
  ------------------
   36|      2|        _value = UNLIMITED();
   37|      2|        _max_concurrency = 0;
   38|      2|    } else {
   39|      0|        _value = butil::string_printf("%d", max_concurrency);
   40|      0|        _max_concurrency = max_concurrency;
   41|      0|    }
   42|      2|}

_ZN4brpc22AdaptiveMaxConcurrency9UNLIMITEDB5cxx11Ev:
   71|      2|    static const std::string& UNLIMITED() {
   72|      2|        static const std::string s_unlimited = "unlimited";
   73|      2|        return s_unlimited;
   74|      2|    }

_ZN4brpc10SerializerC2Ev:
   36|      2|    Serializer() :Serializer(NULL) {}
_ZN4brpc10SerializerC2ESt8functionIFbPN6google8protobuf2io20ZeroCopyOutputStreamEEE:
   39|      2|        :_callback(std::move(callback)) {
   40|      2|        SharedCtor();
   41|      2|    }
_ZN4brpc10Serializer10SharedCtorEv:
   90|      2|    void SharedCtor() {}
_ZN4brpc12DeserializerC2Ev:
  103|      2|    Deserializer() :Deserializer(NULL) {}
_ZN4brpc12DeserializerC2ESt8functionIFbPN6google8protobuf2io19ZeroCopyInputStreamEEE:
  105|      2|    explicit Deserializer(Callback callback) : _callback(std::move(callback)) {
  106|      2|        SharedCtor();
  107|      2|    }
_ZN4brpc12Deserializer10SharedCtorEv:
  155|      2|    void SharedCtor() {}

_ZN4brpc19CouchbaseOperations16CouchbaseRequest10sharedCtorEv:
  403|      2|void CouchbaseOperations::CouchbaseRequest::sharedCtor() {
  404|      2|  _pipelined_count = 0;
  405|      2|  _cached_size_ = 0;
  406|      2|}
_ZN4brpc19CouchbaseOperations17CouchbaseResponse10sharedCtorEv:
  623|      2|void CouchbaseOperations::CouchbaseResponse::sharedCtor() { _cached_size_ = 0; }

_ZN4brpc24CouchbaseManifestManagerC2Ev:
  134|      4|  CouchbaseManifestManager() {}
_ZN4brpc16ReaderWriterLockC2Ev:
   60|      4|      : reader_count_(0), writer_active_(false), waiting_writers_(0) {}
_ZN4brpc19CouchbaseOperations17CouchbaseResponseC2Ev:
  382|      2|    CouchbaseResponse() : NonreflectableMessage<CouchbaseResponse>() {
  383|      2|      sharedCtor();
  384|      2|    }
_ZN4brpc19CouchbaseOperations16CouchbaseRequestC2Ev:
  268|      2|    CouchbaseRequest() : NonreflectableMessage<CouchbaseRequest>() {
  269|      2|      metadata_tracking = &common_metadata_tracking;
  270|      2|      sharedCtor();
  271|      2|    }

_ZN4brpc10EspMessageC2Ev:
   26|      2|    : NonreflectableMessage<EspMessage>() {
   27|      2|    SharedCtor();
   28|      2|}
_ZN4brpc10EspMessage10SharedCtorEv:
   30|      2|void EspMessage::SharedCtor() {
   31|      2|    memset(&head, 0, sizeof(head));
   32|      2|}

_ZN4brpc11IOEventData9OnCreatedERKNS_18IOEventDataOptionsE:
   88|      1|int IOEventData::OnCreated(const IOEventDataOptions& options) {
   89|      1|    if (!options.input_cb) {
  ------------------
  |  Branch (89:9): [True: 0, False: 1]
  ------------------
   90|      0|        LOG(ERROR) << "Invalid input_cb=NULL";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      0|        return -1;
   92|      0|    }
   93|      1|    if (!options.output_cb) {
  ------------------
  |  Branch (93:9): [True: 0, False: 1]
  ------------------
   94|      0|        LOG(ERROR) << "Invalid output_cb=NULL";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|      0|        return -1;
   96|      0|    }
   97|       |
   98|      1|    _options = options;
   99|      1|    return 0;
  100|      1|}

_ZN4brpc11IOEventDataC2ENS_18VersionedRefWithIdIS0_E9ForbiddenE:
   65|      1|        : VersionedRefWithId<IOEventData>(f)
   66|      1|        , _options{ NULL, NULL, NULL } {}
_ZN4brpc7IOEventINS_6SocketEEC2Ev:
  209|      1|        : _init(false)
  210|      1|        , _event_data_id(INVALID_IO_EVENT_DATA_ID)
  211|      1|        , _bthread_tag(bthread_self_tag()) {}
_ZN4brpc7IOEventINS_6SocketEE4InitEPv:
  217|      1|    int Init(void* user_data) {
  218|      1|        if (_init) {
  ------------------
  |  Branch (218:13): [True: 0, False: 1]
  ------------------
  219|      0|            LOG(WARNING) << "IOEvent has been initialized";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|      0|            return 0;
  221|      0|        }
  222|      1|        IOEventDataOptions options{ OnInputEvent, OnOutputEvent, user_data };
  223|      1|        if (IOEventData::Create(&_event_data_id, options) != 0) {
  ------------------
  |  Branch (223:13): [True: 0, False: 1]
  ------------------
  224|      0|            LOG(ERROR) << "Fail to create EventData";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|      0|            return -1;
  226|      0|        }
  227|      1|        _init = true;
  228|      1|        return 0;
  229|      1|    }
_ZN4brpc7IOEventINS_6SocketEE15set_bthread_tagEi:
  277|      1|    void set_bthread_tag(bthread_tag_t bthread_tag) {
  278|      1|        _bthread_tag = bthread_tag;
  279|      1|    }

_ZN4brpc15MemcacheRequestC2Ev:
   31|      2|    : NonreflectableMessage<MemcacheRequest>() {
   32|      2|    SharedCtor();
   33|      2|}
_ZN4brpc15MemcacheRequest10SharedCtorEv:
   41|      2|void MemcacheRequest::SharedCtor() {
   42|      2|    _pipelined_count = 0;
   43|      2|    _cached_size_ = 0;
   44|      2|}
_ZN4brpc16MemcacheResponseC2Ev:
  142|      2|    : NonreflectableMessage<MemcacheResponse>() {
  143|      2|    SharedCtor();
  144|      2|}
_ZN4brpc16MemcacheResponse10SharedCtorEv:
  152|      2|void MemcacheResponse::SharedCtor() {
  153|      2|    _cached_size_ = 0;
  154|      2|}

_ZN4brpc21NonreflectableMessageINS_13NsheadMessageEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_10SerializerEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_12DeserializerEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_12RedisRequestEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_13RedisResponseEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_17SerializedRequestEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_18SerializedResponseEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_19CouchbaseOperations17CouchbaseResponseEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_19CouchbaseOperations16CouchbaseRequestEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_10EspMessageEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_15MemcacheRequestEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;
_ZN4brpc21NonreflectableMessageINS_16MemcacheResponseEEC2Ev:
   43|      2|    inline NonreflectableMessage() = default;

_ZN4brpc13NsheadMessageC2Ev:
   26|      2|    : NonreflectableMessage<NsheadMessage>() {
   27|      2|    SharedCtor();
   28|      2|}
_ZN4brpc13NsheadMessage10SharedCtorEv:
   36|      2|void NsheadMessage::SharedCtor() {
   37|      2|    memset(&head, 0, sizeof(head));
   38|      2|}

_ZN4brpc11ParseResultC2ENS_10ParseErrorE:
   53|    191|        : _msg(NULL), _err(err), _user_desc(NULL) {}
_ZN4brpc11ParseResultC2EPNS_16InputMessageBaseE:
   59|    108|        : _msg(msg), _err(PARSE_OK), _user_desc(NULL) {}
_ZN4brpc14MakeParseErrorENS_10ParseErrorE:
   78|    191|inline ParseResult MakeParseError(ParseError err) {
   79|    191|    return ParseResult(err);
   80|    191|}
_ZN4brpc11MakeMessageEPNS_16InputMessageBaseE:
   85|    108|inline ParseResult MakeMessage(InputMessageBase* msg) {
   86|    108|    return ParseResult(msg);
   87|    108|}

_ZN4brpc6policy13CommonStringsC2Ev:
  120|      2|    : ACCEPT("accept")
  121|      2|    , DEFAULT_ACCEPT("*/*")
  122|      2|    , USER_AGENT("user-agent")
  123|      2|    , DEFAULT_USER_AGENT("brpc/1.0 curl/7.0")
  124|      2|    , CONTENT_TYPE("content-type")
  125|      2|    , CONTENT_TYPE_TEXT("text/plain")
  126|      2|    , CONTENT_TYPE_JSON("application/json")
  127|      2|    , CONTENT_TYPE_PROTO("application/proto")
  128|      2|    , CONTENT_TYPE_SPRING_PROTO("application/x-protobuf")
  129|      2|    , ERROR_CODE("x-bd-error-code")
  130|      2|    , AUTHORIZATION("authorization")
  131|      2|    , ACCEPT_ENCODING("accept-encoding")
  132|      2|    , CONTENT_ENCODING("content-encoding")
  133|      2|    , CONTENT_LENGTH("content_length")
  134|      2|    , EXPECT("expect")
  135|      2|    , CONTINUE_100("100-continue")
  136|      2|    , GZIP("gzip")
  137|      2|    , CONNECTION("connection")
  138|      2|    , KEEP_ALIVE("keep-alive")
  139|      2|    , CLOSE("close")
  140|      2|    , LOG_ID("log-id")
  141|      2|    , DEFAULT_METHOD("default_method")
  142|      2|    , NO_METHOD("no_method")
  143|      2|    , H2_SCHEME(":scheme")
  144|      2|    , H2_SCHEME_HTTP("http")
  145|      2|    , H2_SCHEME_HTTPS("https")
  146|      2|    , H2_AUTHORITY(":authority")
  147|      2|    , H2_PATH(":path")
  148|      2|    , H2_STATUS(":status")
  149|      2|    , STATUS_200("200")
  150|      2|    , H2_METHOD(":method")
  151|      2|    , METHOD_GET("GET")
  152|      2|    , METHOD_POST("POST")
  153|      2|    , TE("te")
  154|      2|    , TRAILERS("trailers")
  155|      2|    , GRPC_ENCODING("grpc-encoding")
  156|      2|    , GRPC_ACCEPT_ENCODING("grpc-accept-encoding")
  157|      2|    , GRPC_ACCEPT_ENCODING_VALUE("identity,gzip")
  158|      2|    , GRPC_STATUS("grpc-status")
  159|      2|    , GRPC_MESSAGE("grpc-message")
  160|      2|    , GRPC_TIMEOUT("grpc-timeout")
  161|      2|    , DEFAULT_PATH("/")
  162|      2|{}
_ZN4brpc6policy17InitCommonStringsEv:
  170|      2|int InitCommonStrings() {
  171|      2|    return pthread_once(&g_common_strings_once, CreateCommonStrings);
  172|      2|}
http_rpc_protocol.cpp:_ZN4brpc6policyL19CreateCommonStringsEv:
  166|      2|static void CreateCommonStrings() {
  167|      2|    common = new CommonStrings;
  168|      2|}

_ZN4brpc6policy17MostCommonMessage3GetEv:
   38|    108|    inline static MostCommonMessage* Get() {
   39|    108|        return butil::get_object<MostCommonMessage>();
   40|    108|    }

_ZN4brpc6policy18ParseNsheadMessageEPN5butil5IOBufEPNS_6SocketEbPKv:
  155|    299|                               Socket*, bool /*read_eof*/, const void* /*arg*/) {
  156|    299|    char header_buf[sizeof(nshead_t)];
  157|    299|    const size_t n = source->copy_to(header_buf, sizeof(header_buf));
  158|    299|    if (n < offsetof(nshead_t, magic_num) + 4) {
  ------------------
  |  Branch (158:9): [True: 50, False: 249]
  ------------------
  159|     50|        return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA);
  160|     50|    }
  161|    249|    const void* dummy = header_buf + offsetof(nshead_t, magic_num);
  162|    249|    const unsigned int magic_num = *(unsigned int*)dummy;
  163|    249|    if (magic_num != NSHEAD_MAGICNUM) {
  ------------------
  |  Branch (163:9): [True: 69, False: 180]
  ------------------
  164|     69|        RPC_VLOG << "magic_num=" << magic_num
  ------------------
  |  |   26|      0|#define RPC_VLOG           VLOG(RPC_VLOG_LEVEL)
  |  |  ------------------
  |  |  |  |  533|     69|    BAIDU_LAZY_STREAM(VLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level))
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|    210|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (472:5): [True: 69, False: 0]
  |  |  |  |  |  |  |  Branch (472:7): [True: 69, Folded]
  |  |  |  |  |  |  |  Branch (472:7): [True: 1, False: 68]
  |  |  |  |  |  |  |  Branch (472:7): [True: 0, False: 1]
  |  |  |  |  |  |  |  Branch (472:7): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|      0|                 << " doesn't match NSHEAD_MAGICNUM=" << NSHEAD_MAGICNUM;
  166|     69|        return MakeParseError(PARSE_ERROR_TRY_OTHERS);
  167|     69|    }
  168|    180|    if (n < sizeof(nshead_t)) {
  ------------------
  |  Branch (168:9): [True: 5, False: 175]
  ------------------
  169|      5|        return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA);
  170|      5|    }
  171|    175|    const nshead_t* nshead = (const nshead_t *)header_buf;
  172|    175|    uint32_t body_len = nshead->body_len;
  173|    175|    if (body_len > FLAGS_max_body_size) {
  ------------------
  |  Branch (173:9): [True: 11, False: 164]
  ------------------
  174|     11|        return MakeParseError(PARSE_ERROR_TOO_BIG_DATA);
  175|    164|    } else if (source->length() < sizeof(header_buf) + body_len) {
  ------------------
  |  Branch (175:16): [True: 56, False: 108]
  ------------------
  176|     56|        return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA);
  177|     56|    }
  178|       |
  179|    108|    policy::MostCommonMessage* msg = policy::MostCommonMessage::Get();
  180|    108|    source->cutn(&msg->meta, sizeof(header_buf));
  181|    108|    source->cutn(&msg->payload, body_len);
  182|    108|    return MakeMessage(msg);
  183|    175|}

_ZN4brpc12RedisRequestC2Ev:
   33|      2|    : NonreflectableMessage<RedisRequest>() {
   34|      2|    SharedCtor();
   35|      2|}
_ZN4brpc12RedisRequest10SharedCtorEv:
   43|      2|void RedisRequest::SharedCtor() {
   44|      2|    _ncommand = 0;
   45|      2|    _has_error = false;
   46|      2|    _cached_size_ = 0;
   47|      2|}
_ZN4brpc13RedisResponseC2Ev:
  198|      2|    : NonreflectableMessage<RedisResponse>()
  199|      2|    , _first_reply(&_arena) {
  200|      2|    SharedCtor();
  201|      2|}
_ZN4brpc13RedisResponse10SharedCtorEv:
  209|      2|void RedisResponse::SharedCtor() {
  210|       |    _other_replies = NULL;
  211|      2|    _cached_size_ = 0;
  212|      2|    _nreply = 0;
  213|      2|}

_ZN4brpc10RedisReply5ResetEv:
  175|      2|inline void RedisReply::Reset() {
  176|      2|    _type = REDIS_REPLY_NIL;
  177|      2|    _length = 0;
  178|      2|    _data.array.last_index = -1;
  179|      2|    _data.array.replies = NULL;
  180|       |    // _arena should not be reset because further memory allocation needs it.
  181|      2|}
_ZN4brpc10RedisReplyC2EPN5butil5ArenaE:
  184|      2|    : _arena(arena) {
  185|      2|    Reset();
  186|      2|}

_ZN4brpc17SerializedRequestC2Ev:
   26|      2|    : NonreflectableMessage<SerializedRequest>() {
   27|      2|    SharedCtor();
   28|      2|}
_ZN4brpc17SerializedRequest10SharedCtorEv:
   36|      2|void SerializedRequest::SharedCtor() {
   37|      2|}

_ZN4brpc18SerializedResponseC2Ev:
   26|      2|    : NonreflectableMessage<SerializedResponse>() {
   27|      2|    SharedCtor();
   28|      2|}
_ZN4brpc18SerializedResponse10SharedCtorEv:
   36|      2|void SerializedResponse::SharedCtor() {
   37|      2|}

_ZN4brpc6Socket14CreateVarsOnceEv:
  294|      1|void Socket::CreateVarsOnce() {
  295|      1|    CHECK_EQ(0, pthread_once(&s_create_vars_once, CreateVars));
  ------------------
  |  |  692|      1|#define CHECK_EQ(val1, val2) BAIDU_CHECK_OP(EQ, ==, val1, val2)
  |  |  ------------------
  |  |  |  |  630|      1|    if (std::string* _result =                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (630:22): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  631|      1|        ::logging::Check##name##Impl((val1), (val2),                    \
  |  |  |  |  632|      1|                                     #val1 " " #op " " #val2))          \
  |  |  |  |  633|      1|        ::logging::LogMessage(__FILE__, __LINE__, __func__, _result).stream().SetCheck()
  |  |  ------------------
  ------------------
  296|      1|}
_ZN4brpc6SocketC2ENS_18VersionedRefWithIdIS0_E9ForbiddenE:
  457|      1|    : VersionedRefWithId<Socket>(f)
  458|      1|    , _shared_part(NULL)
  459|      1|    , _nevent(0)
  460|      1|    , _keytable_pool(NULL)
  461|      1|    , _fd(-1)
  462|      1|    , _tos(0)
  463|      1|    , _reset_fd_real_us(-1)
  464|      1|    , _on_edge_triggered_events(NULL)
  465|      1|    , _need_on_edge_trigger(false)
  466|      1|    , _user(NULL)
  467|      1|    , _conn(NULL)
  468|      1|    , _preferred_index(-1)
  469|      1|    , _hc_count(0)
  470|      1|    , _last_msg_size(0)
  471|      1|    , _avg_msg_size(0)
  472|      1|    , _last_readtime_us(0)
  473|      1|    , _parsing_context(NULL)
  474|      1|    , _correlation_id(0)
  475|      1|    , _health_check_interval_s(-1)
  476|      1|    , _is_hc_related_ref_held(false)
  477|      1|    , _ninprocess(1)
  478|      1|    , _auth_flag_error(0)
  479|      1|    , _auth_id(INVALID_BTHREAD_ID)
  480|      1|    , _auth_context(NULL)
  481|      1|    , _ssl_state(SSL_UNKNOWN)
  482|      1|    , _ssl_session(NULL)
  483|      1|    , _socket_mode(SOCKET_MODE_TCP)
  484|      1|    , _connection_type_for_progressive_read(CONNECTION_TYPE_UNKNOWN)
  485|      1|    , _controller_released_socket(false)
  486|      1|    , _overcrowded(false)
  487|      1|    , _fail_me_at_server_stop(false)
  488|      1|    , _logoff_flag(false)
  489|      1|    , _error_code(0)
  490|      1|    , _pipeline_q(NULL)
  491|      1|    , _last_writetime_us(0)
  492|      1|    , _unwritten_bytes(0)
  493|      1|    , _epollout_butex(NULL)
  494|      1|    , _write_head(NULL)
  495|      1|    , _is_write_shutdown(false)
  496|      1|    , _stream_set(NULL)
  497|      1|    , _total_streams_unconsumed_size(0)
  498|      1|    , _ninflight_app_health_check(0)
  499|      1|    , _tcp_user_timeout_ms(-1)
  500|      1|    , _http_request_method(HTTP_METHOD_GET) {
  501|      1|    CreateVarsOnce();
  502|       |    pthread_mutex_init(&_id_wait_list_mutex, NULL);
  503|      1|    _epollout_butex = bthread::butex_create_checked<butil::atomic<int> >();
  504|      1|}
_ZN4brpc6Socket19ResetFileDescriptorEi:
  575|      1|int Socket::ResetFileDescriptor(int fd) {
  576|       |    // Reset message sizes when fd is changed.
  577|      1|    _last_msg_size = 0;
  578|      1|    _avg_msg_size = 0;
  579|       |    // MUST store `_fd' before adding itself into epoll device to avoid
  580|       |    // race conditions with the callback function inside epoll
  581|      1|    _fd.store(fd, butil::memory_order_release);
  582|      1|    _reset_fd_real_us = butil::cpuwide_time_us();
  583|      1|    if (!ValidFileDescriptor(fd)) {
  ------------------
  |  Branch (583:9): [True: 1, False: 0]
  ------------------
  584|      1|        return 0;
  585|      1|    }
  586|      0|    if (_remote_side == butil::EndPoint()) {
  ------------------
  |  Branch (586:9): [True: 0, False: 0]
  ------------------
  587|       |        // OK to fail, non-socket fd does not support this.
  588|      0|        butil::get_remote_side(fd, &_remote_side);
  589|      0|    }
  590|       |    // OK to fail, non-socket fd does not support this.
  591|      0|    butil::get_local_side(fd, &_local_side);
  592|       |
  593|       |    // FIXME : close-on-exec should be set by new syscalls or worse: set right
  594|       |    // after fd-creation syscall. Setting at here has higher probabilities of
  595|       |    // race condition.
  596|      0|    butil::make_close_on_exec(fd);
  597|       |
  598|       |    // Make the fd non-blocking.
  599|      0|    if (butil::make_non_blocking(fd) != 0) {
  ------------------
  |  Branch (599:9): [True: 0, False: 0]
  ------------------
  600|      0|        PLOG(ERROR) << "Fail to set fd=" << fd << " to non-blocking";
  ------------------
  |  |  584|      0|    BAIDU_LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|      0|        _fd.store(-1, butil::memory_order_release);
  602|      0|        return -1;
  603|      0|    }
  604|       |    // turn off nagling.
  605|       |    // OK to fail, namely unix domain socket does not support this.
  606|      0|    butil::make_no_delay(fd);
  607|       |
  608|      0|    SetSocketOptions(fd);
  609|       |
  610|      0|    if (_transport->HasOnEdgeTrigger()) {
  ------------------
  |  Branch (610:9): [True: 0, False: 0]
  ------------------
  611|      0|        if (_io_event.AddConsumer(fd) != 0) {
  ------------------
  |  Branch (611:13): [True: 0, False: 0]
  ------------------
  612|      0|            PLOG(ERROR) << "Fail to add SocketId=" << id() 
  ------------------
  |  |  584|      0|    BAIDU_LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|      0|                        << " into EventDispatcher";
  614|      0|            _fd.store(-1, butil::memory_order_release);
  615|      0|            return -1;
  616|      0|        }
  617|      0|    }
  618|      0|    return 0;
  619|      0|}
_ZN4brpc6Socket6CreateERKNS_13SocketOptionsEPm:
  716|      1|int Socket::Create(const SocketOptions& options, SocketId* id) {
  717|      1|    return VersionedRefWithId<Socket>::Create(id, options);
  718|      1|}
_ZN4brpc6Socket9OnCreatedERKNS_13SocketOptionsE:
  720|      1|int Socket::OnCreated(const SocketOptions& options) {
  721|      1|    if (_io_event.Init((void*)id()) != 0) {
  ------------------
  |  Branch (721:9): [True: 0, False: 1]
  ------------------
  722|      0|        LOG(ERROR) << "Fail to init IOEvent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|      0|        SetFailed(ENOMEM, "%s", "Fail to init IOEvent");
  724|      0|        return -1;
  725|      0|    }
  726|      1|    _io_event.set_bthread_tag(options.bthread_tag);
  727|      1|    auto guard = butil::MakeScopeGuard([this] {
  728|      1|        _io_event.Reset();
  729|      1|    });
  730|       |    // start build the transport
  731|      1|    _socket_mode = options.socket_mode;
  732|      1|    _transport = TransportFactory::CreateTransport(options.socket_mode);
  733|      1|    CHECK(NULL != _transport);
  ------------------
  |  |  617|      1|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      1|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  734|      1|    _transport->Init(this, options);
  735|       |
  736|      1|    g_vars->nsocket << 1;
  737|      1|    CHECK(NULL == _shared_part.load(butil::memory_order_relaxed));
  ------------------
  |  |  617|      1|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      1|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  738|      1|    _nevent.store(0, butil::memory_order_relaxed);
  739|      1|    _keytable_pool = options.keytable_pool;
  740|      1|    _tos = 0;
  741|      1|    _remote_side = options.remote_side;
  742|      1|    _local_side = options.local_side;
  743|      1|    _device_name = options.device_name;
  744|      1|    _on_edge_triggered_events = options.on_edge_triggered_events;
  745|      1|    _need_on_edge_trigger = options.need_on_edge_trigger;
  746|      1|    _user = options.user;
  747|      1|    _conn = options.conn;
  748|      1|    _app_connect = _transport->Connect();
  749|      1|    _preferred_index = -1;
  750|      1|    _hc_count = 0;
  751|      1|    CHECK(_read_buf.empty());
  ------------------
  |  |  617|      1|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      1|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  752|      1|    const int64_t cpuwide_now = butil::cpuwide_time_us();
  753|      1|    _last_readtime_us.store(cpuwide_now, butil::memory_order_relaxed);
  754|      1|    reset_parsing_context(options.initial_parsing_context);
  755|      1|    _correlation_id = 0;
  756|      1|    _health_check_interval_s = options.health_check_interval_s;
  757|      1|    _hc_option = options.hc_option;
  758|      1|    _is_hc_related_ref_held = false;
  759|      1|    _ninprocess.store(1, butil::memory_order_relaxed);
  760|      1|    _auth_flag_error.store(0, butil::memory_order_relaxed);
  761|      1|    const int rc2 = bthread_id_create(&_auth_id, NULL, NULL);
  762|      1|    if (rc2) {
  ------------------
  |  Branch (762:9): [True: 0, False: 1]
  ------------------
  763|      0|        LOG(ERROR) << "Fail to create auth_id: " << berror(rc2);
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  764|      0|        SetFailed(rc2, "Fail to create auth_id: %s", berror(rc2));
  765|      0|        return -1;
  766|      0|    }
  767|      1|    _force_ssl = options.force_ssl;
  768|       |    // Disable SSL check if there is no SSL context
  769|      1|    _ssl_state = (options.initial_ssl_ctx == NULL ? SSL_OFF : SSL_UNKNOWN);
  ------------------
  |  Branch (769:19): [True: 1, False: 0]
  ------------------
  770|      1|    _ssl_session = NULL;
  771|      1|    _ssl_ctx = options.initial_ssl_ctx;
  772|      1|    _connection_type_for_progressive_read = CONNECTION_TYPE_UNKNOWN;
  773|      1|    _controller_released_socket.store(false, butil::memory_order_relaxed);
  774|      1|    _overcrowded = false;
  775|       |    // Maybe non-zero for RTMP connections.
  776|      1|    _fail_me_at_server_stop = false;
  777|      1|    _logoff_flag.store(false, butil::memory_order_relaxed);
  778|      1|    _error_code = 0;
  779|      1|    _agent_socket_id.store(INVALID_SOCKET_ID, butil::memory_order_relaxed);
  780|      1|    _total_streams_unconsumed_size.store(0, butil::memory_order_relaxed);
  781|      1|    _ninflight_app_health_check.store(0, butil::memory_order_relaxed);
  782|       |    // NOTE: last two params are useless in bthread > r32787
  783|      1|    const int rc = bthread_id_list_init(&_id_wait_list, 512, 512);
  784|      1|    if (rc) {
  ------------------
  |  Branch (784:9): [True: 0, False: 1]
  ------------------
  785|      0|        LOG(ERROR) << "Fail to init _id_wait_list: " << berror(rc);
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  786|      0|        SetFailed(rc, "Fail to init _id_wait_list: %s", berror(rc));
  787|      0|        return -1;
  788|      0|    }
  789|      1|    _last_writetime_us.store(cpuwide_now, butil::memory_order_relaxed);
  790|      1|    _unwritten_bytes.store(0, butil::memory_order_relaxed);
  791|      1|    _keepalive_options = options.keepalive_options;
  792|      1|    _tcp_user_timeout_ms = options.tcp_user_timeout_ms;
  793|      1|    CHECK(NULL == _write_head.load(butil::memory_order_relaxed));
  ------------------
  |  |  617|      1|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      1|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  794|      1|    _is_write_shutdown = false;
  795|      1|    int fd = options.fd;
  796|      1|    if (!ValidFileDescriptor(fd) && options.connect_on_create) {
  ------------------
  |  Branch (796:9): [True: 1, False: 0]
  |  Branch (796:37): [True: 0, False: 1]
  ------------------
  797|       |        // Connect on create.
  798|      0|        fd = DoConnect(options.connect_abstime, NULL, NULL);
  799|      0|        if (fd < 0) {
  ------------------
  |  Branch (799:13): [True: 0, False: 0]
  ------------------
  800|      0|            PLOG(ERROR) << "Fail to connect to " << options.remote_side;
  ------------------
  |  |  584|      0|    BAIDU_LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|      0|            int error_code = errno != 0 ? errno : EHOSTDOWN;
  ------------------
  |  |   34|      0|#define errno *bthread_errno_location()
  ------------------
                          int error_code = errno != 0 ? errno : EHOSTDOWN;
  ------------------
  |  |   34|      0|#define errno *bthread_errno_location()
  ------------------
  |  Branch (801:30): [True: 0, False: 0]
  ------------------
  802|      0|            SetFailed(error_code, "Fail to connect to %s: %s",
  803|      0|                      butil::endpoint2str(options.remote_side).c_str(),
  804|      0|                      berror(error_code));
  805|      0|            return -1;
  806|      0|        }
  807|      0|    }
  808|       |    // Must be the last one! Internal fields of this Socket may be accessed
  809|       |    // just after calling ResetFileDescriptor.
  810|      1|    if (ResetFileDescriptor(fd) != 0) {
  ------------------
  |  Branch (810:9): [True: 0, False: 1]
  ------------------
  811|      0|        const int saved_errno = errno;
  ------------------
  |  |   34|      0|#define errno *bthread_errno_location()
  ------------------
  812|      0|        PLOG(ERROR) << "Fail to ResetFileDescriptor";
  ------------------
  |  |  584|      0|    BAIDU_LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  813|      0|        SetFailed(saved_errno, "Fail to ResetFileDescriptor: %s",
  814|      0|                     berror(saved_errno));
  815|      0|        return -1;
  816|      0|    }
  817|      1|    HoldHCRelatedRef();
  818|      1|    guard.dismiss();
  819|       |
  820|      1|    return 0;
  821|      1|}
_ZN4brpc6Socket16HoldHCRelatedRefEv:
  952|      1|void Socket::HoldHCRelatedRef() {
  953|      1|    if (_health_check_interval_s > 0) {
  ------------------
  |  Branch (953:9): [True: 0, False: 1]
  ------------------
  954|      0|        _is_hc_related_ref_held = true;
  955|      0|        AddReference();
  956|      0|    }
  957|      1|}
_ZN4brpc17DereferenceSocketEPNS_6SocketE:
 2263|      1|void DereferenceSocket(Socket* s) {
 2264|      1|    if (s) {
  ------------------
  |  Branch (2264:9): [True: 1, False: 0]
  ------------------
 2265|      1|        s->Dereference();
 2266|      1|    }
 2267|      1|}
socket.cpp:_ZN4brpcL10CreateVarsEv:
  290|      1|static void CreateVars() {
  291|      1|    g_vars = new SocketVarsCollector;
  292|      1|}

_ZN4brpc19SocketVarsCollectorC2Ev:
  146|      1|        : nsocket("rpc_socket_count")
  147|      1|        , channel_conn("rpc_channel_connection_count")
  148|      1|        , neventthread_second("rpc_event_thread_second", &neventthread)
  149|      1|        , nhealthcheck("rpc_health_check_count")
  150|      1|        , nkeepwrite_second("rpc_keepwrite_second", &nkeepwrite)
  151|      1|        , nwaitepollout("rpc_waitepollout_count")
  152|      1|        , nwaitepollout_second("rpc_waitepollout_second", &nwaitepollout)
  153|      1|    {}
_ZN4brpc13PipelinedInfoC2Ev:
  167|    108|    PipelinedInfo() { reset(); }
_ZN4brpc13PipelinedInfo5resetEv:
  168|    108|    void reset() {
  169|    108|        count = 0;
  170|    108|        auth_flags = 0;
  171|    108|        id_wait = INVALID_BTHREAD_ID;
  172|    108|    }

_ZNK4brpc25VersionedRefWithIdDeleterINS_6SocketEEclEPS1_:
   45|      1|    void operator()(Socket* m) const {
   46|      1|        DereferenceSocket(m);
   47|      1|    }

_ZN4brpc6Socket21reset_parsing_contextEPNS_11DestroyableE:
   82|      1|inline void Socket::reset_parsing_context(Destroyable* new_context) {
   83|      1|    Destroyable* old_ctx = _parsing_context.exchange(
   84|      1|        new_context, butil::memory_order_acq_rel);
   85|      1|    if (old_ctx) {
  ------------------
  |  Branch (85:9): [True: 0, False: 1]
  ------------------
   86|      0|        old_ctx->Destroy();
   87|      0|    }
   88|      1|}
_ZN4brpc6Socket19ValidFileDescriptorEi:
  134|      2|inline bool Socket::ValidFileDescriptor(int fd) {
  135|      2|    return fd >= 0 && fd != STREAM_FAKE_FD;
  ------------------
  |  Branch (135:12): [True: 0, False: 2]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|      2|}

_ZN4brpc12TcpTransport4InitEPNS_6SocketERKNS_13SocketOptionsE:
   27|      1|void TcpTransport::Init(Socket* socket, const SocketOptions& options) {
   28|      1|    _socket = socket;
   29|      1|    _default_connect = options.app_connect;
   30|      1|    _on_edge_trigger = options.on_edge_triggered_events;
   31|      1|    if (options.need_on_edge_trigger && _on_edge_trigger == NULL) {
  ------------------
  |  Branch (31:9): [True: 0, False: 1]
  |  Branch (31:41): [True: 0, False: 0]
  ------------------
   32|      0|        _on_edge_trigger = InputMessenger::OnNewMessages;
   33|      0|    }
   34|      1|}
_ZN4brpc12TcpTransport7ConnectEv:
   46|      1|std::shared_ptr<AppConnect> TcpTransport::Connect() {
   47|      1|    return _default_connect;
   48|      1|}

_ZN4brpc16TransportFactory15CreateTransportENS_10SocketModeE:
   38|      1|std::unique_ptr<Transport> TransportFactory::CreateTransport(SocketMode mode) {
   39|      1|    if (mode == SOCKET_MODE_TCP) {
  ------------------
  |  Branch (39:9): [True: 1, False: 0]
  ------------------
   40|      1|        return std::unique_ptr<TcpTransport>(new TcpTransport());
   41|      1|    }
   42|       |#if BRPC_WITH_RDMA
   43|       |    else if (mode == SOCKET_MODE_RDMA) {
   44|       |        return std::unique_ptr<RdmaTransport>(new RdmaTransport());
   45|       |    }
   46|       |#endif
   47|      0|    else {
   48|      0|        LOG(ERROR) << "socket_mode set error";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|      0|        return nullptr;
   50|      0|    }
   51|      1|}

_ZN4brpc18VersionedRefWithIdINS_6SocketEE7AddressEmPSt10unique_ptrIS1_NS_25VersionedRefWithIdDeleterIS1_EEE:
  387|      1|    VRefId id, VersionedRefWithIdUniquePtr<T>* ptr) {
  388|      1|    return AddressImpl(id, false, ptr);
  389|      1|}
_ZN4brpc18VersionedRefWithIdINS_6SocketEE11AddressImplEmbPSt10unique_ptrIS1_NS_25VersionedRefWithIdDeleterIS1_EEE:
  399|      1|    VRefId id, bool failed_as_well, VersionedRefWithIdUniquePtr<T>* ptr) {
  400|      1|    const resource_id_t slot = SlotOfVRefId<T>(id);
  401|      1|    T* const t = address_resource(slot);
  402|      1|    if (__builtin_expect(t != NULL, 1)) {
  ------------------
  |  Branch (402:9): [True: 1, False: 0]
  ------------------
  403|       |        // acquire fence makes sure this thread sees latest changes before
  404|       |        // Dereference() or Revive().
  405|      1|        VersionedRefWithId<T>* const vref_with_id = t;
  406|      1|        const uint64_t vref1 = vref_with_id->_versioned_ref.fetch_add(
  407|      1|            1, butil::memory_order_acquire);
  408|      1|        const uint32_t ver1 = VersionOfVRef(vref1);
  409|      1|        if (ver1 == VersionOfVRefId(id)) {
  ------------------
  |  Branch (409:13): [True: 1, False: 0]
  ------------------
  410|      1|            ptr->reset(t);
  411|      1|            return 0;
  412|      1|        }
  413|      0|        if (failed_as_well && ver1 == VersionOfVRefId(id) + 1) {
  ------------------
  |  Branch (413:13): [True: 0, False: 0]
  |  Branch (413:31): [True: 0, False: 0]
  ------------------
  414|      0|            ptr->reset(t);
  415|      0|            return 1;
  416|      0|        }
  417|       |
  418|      0|        const uint64_t vref2 = vref_with_id->_versioned_ref.fetch_sub(
  419|      0|            1, butil::memory_order_release);
  420|      0|        const int32_t nref = NRefOfVRef(vref2);
  421|      0|        if (nref > 1) {
  ------------------
  |  Branch (421:13): [True: 0, False: 0]
  ------------------
  422|      0|            return -1;
  423|      0|        } else if (__builtin_expect(nref == 1, 1)) {
  ------------------
  |  Branch (423:20): [True: 0, False: 0]
  ------------------
  424|      0|            const uint32_t ver2 = VersionOfVRef(vref2);
  425|      0|            if ((ver2 & 1)) {
  ------------------
  |  Branch (425:17): [True: 0, False: 0]
  ------------------
  426|      0|                if (ver1 == ver2 || ver1 + 1 == ver2) {
  ------------------
  |  Branch (426:21): [True: 0, False: 0]
  |  Branch (426:37): [True: 0, False: 0]
  ------------------
  427|      0|                    uint64_t expected_vref = vref2 - 1;
  428|      0|                    if (vref_with_id->_versioned_ref.compare_exchange_strong(
  ------------------
  |  Branch (428:25): [True: 0, False: 0]
  ------------------
  429|      0|                            expected_vref, MakeVRef(ver2 + 1, 0),
  430|      0|                            butil::memory_order_acquire,
  431|      0|                            butil::memory_order_relaxed)) {
  432|      0|                        BAIDU_CASSERT((butil::is_result_void<
  ------------------
  |  |  196|      0|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  ------------------
  433|      0|                                          decltype(&T::BeforeRecycled), T>::value),
  434|      0|                                      "T::BeforeRecycled must accept Args params"
  435|      0|                                      " and return void");
  436|      0|                        t->BeforeRecycled();
  437|      0|                        return_resource(slot);
  438|      0|                    }
  439|      0|                } else {
  440|      0|                    CHECK(false) << "ref-version=" << ver1
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  441|      0|                                 << " unref-version=" << ver2;
  442|      0|                }
  443|      0|            } else {
  444|       |                // Addressed a free slot.
  445|      0|            }
  446|      0|        } else {
  447|      0|            CHECK(false) << "Over dereferenced SocketId=" << id;
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  448|      0|        }
  449|      0|    }
  450|      0|    return -1;
  451|      1|}
_ZN4brpc12SlotOfVRefIdINS_6SocketEEEN5butil10ResourceIdIT_EEm:
   61|      1|BUTIL_FORCE_INLINE butil::ResourceId<T> SlotOfVRefId(VRefId vref_id) {
   62|      1|    return { (vref_id & 0xFFFFFFFFul) };
   63|      1|}
_ZN4brpc13VersionOfVRefEm:
   70|      3|BUTIL_FORCE_INLINE uint32_t VersionOfVRef(uint64_t vref) {
   71|      3|    return (uint32_t)(vref >> 32);
   72|      3|}
_ZN4brpc15VersionOfVRefIdEm:
   65|      1|BUTIL_FORCE_INLINE uint32_t VersionOfVRefId(VRefId vref_id) {
   66|      1|    return (uint32_t)(vref_id >> 32);
   67|      1|}
_ZN4brpc10NRefOfVRefEm:
   74|      1|BUTIL_FORCE_INLINE int32_t NRefOfVRef(uint64_t vref) {
   75|      1|    return (int32_t)(vref & 0xFFFFFFFFul);
   76|      1|}
_ZNK4brpc18VersionedRefWithIdINS_6SocketEE2idEv:
  264|      1|    VRefId id() const { return _this_id; }
_ZN4brpc18VersionedRefWithIdINS_6SocketEEC2ENS2_9ForbiddenE:
  204|      1|        : _versioned_ref(0)
  205|      1|        , _this_id(0)
  206|      1|        , _additional_ref_status(ADDITIONAL_REF_USING) {}
_ZN4brpc18VersionedRefWithIdINS_6SocketEE6CreateIJRKNS_13SocketOptionsEEEEiPmDpOT_:
  354|      1|int VersionedRefWithId<T>::Create(VRefId* id, Args&&... args) {
  355|      1|    resource_id_t slot;
  356|      1|    T* const t = butil::get_resource(&slot, Forbidden());
  357|      1|    if (t == NULL) {
  ------------------
  |  Branch (357:9): [True: 0, False: 1]
  ------------------
  358|      0|        LOG(FATAL) << "Fail to get_resource<"
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  359|      0|                   << butil::class_name<T>() << ">";
  360|      0|        return -1;
  361|      0|    }
  362|       |    // nref can be non-zero due to concurrent Address().
  363|       |    // _this_id will only be used in destructor/Destroy of referenced
  364|       |    // slots, which is safe and properly fenced. Although it's better
  365|       |    // to put the id into VersionedRefWithIdUniquePtr.
  366|      1|    VersionedRefWithId<T>* const vref_with_id = t;
  367|      1|    vref_with_id->_this_id = MakeVRefId<T>(
  368|      1|        VersionOfVRef(vref_with_id->_versioned_ref.fetch_add(
  369|      1|            1, butil::memory_order_release)), slot);
  370|      1|    vref_with_id->_additional_ref_status.store(
  371|      1|        ADDITIONAL_REF_USING, butil::memory_order_relaxed);
  372|      1|    BAIDU_CASSERT((butil::is_result_int<decltype(&T::OnCreated), T, Args...>::value),
  ------------------
  |  |  196|      1|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  ------------------
  373|      1|                  "T::OnCreated must accept Args params and return int");
  374|       |    // At last, call T::OnCreated() to initialize the T object.
  375|      1|    if (t->OnCreated(std::forward<Args>(args)...) != 0) {
  ------------------
  |  Branch (375:9): [True: 0, False: 1]
  ------------------
  376|      0|        vref_with_id->SetFailed();
  377|       |        // NOTE: This object may be recycled at this point,
  378|       |        // don't touch anything.
  379|      0|        return -1;
  380|      0|    }
  381|      1|    *id = vref_with_id->_this_id;
  382|      1|    return 0;
  383|      1|}
_ZN4brpc10MakeVRefIdINS_6SocketEEEmjN5butil10ResourceIdIT_EE:
   56|      1|                                     butil::ResourceId<T> slot) {
   57|      1|    return VRefId((((uint64_t)version) << 32) | slot.value);
   58|      1|}
_ZN4brpc18VersionedRefWithIdINS_11IOEventDataEE6CreateIJRNS_18IOEventDataOptionsEEEEiPmDpOT_:
  354|      1|int VersionedRefWithId<T>::Create(VRefId* id, Args&&... args) {
  355|      1|    resource_id_t slot;
  356|      1|    T* const t = butil::get_resource(&slot, Forbidden());
  357|      1|    if (t == NULL) {
  ------------------
  |  Branch (357:9): [True: 0, False: 1]
  ------------------
  358|      0|        LOG(FATAL) << "Fail to get_resource<"
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  359|      0|                   << butil::class_name<T>() << ">";
  360|      0|        return -1;
  361|      0|    }
  362|       |    // nref can be non-zero due to concurrent Address().
  363|       |    // _this_id will only be used in destructor/Destroy of referenced
  364|       |    // slots, which is safe and properly fenced. Although it's better
  365|       |    // to put the id into VersionedRefWithIdUniquePtr.
  366|      1|    VersionedRefWithId<T>* const vref_with_id = t;
  367|      1|    vref_with_id->_this_id = MakeVRefId<T>(
  368|      1|        VersionOfVRef(vref_with_id->_versioned_ref.fetch_add(
  369|      1|            1, butil::memory_order_release)), slot);
  370|      1|    vref_with_id->_additional_ref_status.store(
  371|      1|        ADDITIONAL_REF_USING, butil::memory_order_relaxed);
  372|      1|    BAIDU_CASSERT((butil::is_result_int<decltype(&T::OnCreated), T, Args...>::value),
  ------------------
  |  |  196|      1|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  ------------------
  373|      1|                  "T::OnCreated must accept Args params and return int");
  374|       |    // At last, call T::OnCreated() to initialize the T object.
  375|      1|    if (t->OnCreated(std::forward<Args>(args)...) != 0) {
  ------------------
  |  Branch (375:9): [True: 0, False: 1]
  ------------------
  376|      0|        vref_with_id->SetFailed();
  377|       |        // NOTE: This object may be recycled at this point,
  378|       |        // don't touch anything.
  379|      0|        return -1;
  380|      0|    }
  381|      1|    *id = vref_with_id->_this_id;
  382|      1|    return 0;
  383|      1|}
_ZN4brpc18VersionedRefWithIdINS_11IOEventDataEEC2ENS2_9ForbiddenE:
  204|      1|        : _versioned_ref(0)
  205|      1|        , _this_id(0)
  206|      1|        , _additional_ref_status(ADDITIONAL_REF_USING) {}
_ZN4brpc10MakeVRefIdINS_11IOEventDataEEEmjN5butil10ResourceIdIT_EE:
   56|      1|                                     butil::ResourceId<T> slot) {
   57|      1|    return VRefId((((uint64_t)version) << 32) | slot.value);
   58|      1|}
_ZN4brpc18VersionedRefWithIdINS_6SocketEE11DereferenceEv:
  524|      1|int VersionedRefWithId<T>::Dereference() {
  525|      1|    const VRefId id = _this_id;
  526|      1|    const uint64_t vref = _versioned_ref.fetch_sub(
  527|      1|        1, butil::memory_order_release);
  528|      1|    const int32_t nref = NRefOfVRef(vref);
  529|      1|    if (nref > 1) {
  ------------------
  |  Branch (529:9): [True: 1, False: 0]
  ------------------
  530|      1|        return 0;
  531|      1|    }
  532|      0|    if (__builtin_expect(nref == 1, 1)) {
  ------------------
  |  Branch (532:9): [True: 0, False: 0]
  ------------------
  533|      0|        const uint32_t ver = VersionOfVRef(vref);
  534|      0|        const uint32_t id_ver = VersionOfVRefId(id);
  535|       |        // Besides first successful SetFailed() adds 1 to version, one of
  536|       |        // those dereferencing nref from 1->0 adds another 1 to version.
  537|       |        // Notice "one of those": The wait-free Address() may make ref of a
  538|       |        // version-unmatched slot change from 1 to 0 for mutiple times, we
  539|       |        // have to use version as a guard variable to prevent returning the
  540|       |        // VersionedRefWithId to pool more than once.
  541|       |        //
  542|       |        // Note: `ver == id_ver' means this VersionedRefWithId has been `SetRecycle'
  543|       |        // before rather than `SetFailed'; `ver == ide_ver+1' means we
  544|       |        // had `SetFailed' this socket before. We should destroy the
  545|       |        // socket under both situation
  546|      0|        if (__builtin_expect(ver == id_ver || ver == id_ver + 1, 1)) {
  ------------------
  |  Branch (546:13): [True: 0, False: 0]
  |  Branch (546:30): [True: 0, False: 0]
  |  Branch (546:47): [True: 0, False: 0]
  ------------------
  547|       |            // sees nref:1->0, try to set version=id_ver+2,--nref.
  548|       |            // No retry: if version changes, the slot is already returned by
  549|       |            // another one who sees nref:1->0 concurrently; if nref changes,
  550|       |            // which must be non-zero, the slot will be returned when
  551|       |            // nref changes from 1->0 again.
  552|       |            // Example:
  553|       |            //   SetFailed(): --nref, sees nref:1->0           (1)
  554|       |            //                try to set version=id_ver+2      (2)
  555|       |            //    Address():  ++nref, unmatched version        (3)
  556|       |            //                --nref, sees nref:1->0           (4)
  557|       |            //                try to set version=id_ver+2      (5)
  558|       |            // 1,2,3,4,5 or 1,3,4,2,5:
  559|       |            //            SetFailed() succeeds, Address() fails at (5).
  560|       |            // 1,3,2,4,5: SetFailed() fails with (2), the slot will be
  561|       |            //            returned by (5) of Address()
  562|       |            // 1,3,4,5,2: SetFailed() fails with (2), the slot is already
  563|       |            //            returned by (5) of Address().
  564|      0|            uint64_t expected_vref = vref - 1;
  565|      0|            if (_versioned_ref.compare_exchange_strong(
  ------------------
  |  Branch (565:17): [True: 0, False: 0]
  ------------------
  566|      0|                    expected_vref, MakeVRef(id_ver + 2, 0),
  567|      0|                    butil::memory_order_acquire,
  568|      0|                    butil::memory_order_relaxed)) {
  569|      0|                static_cast<T*>(this)->BeforeRecycled();
  570|      0|                return_resource(SlotOfVRefId<T>(id));
  571|      0|                return 1;
  572|      0|            }
  573|      0|            return 0;
  574|      0|        }
  575|      0|        LOG(FATAL) << "Invalid VRefId=" << id;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  576|      0|        return -1;
  577|      0|    }
  578|      0|    LOG(FATAL) << "Over dereferenced VRefId=" << id;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|      0|    return -1;
  580|      0|}

bthread_self_tag:
  642|      2|bthread_tag_t bthread_self_tag(void) {
  643|      2|    bthread::TaskGroup* g = bthread::BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group);
  ------------------
  |  |   69|      2|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  ------------------
  644|      2|    return g != NULL ? g->tag() : BTHREAD_TAG_DEFAULT;
  ------------------
  |  Branch (644:12): [True: 0, False: 2]
  ------------------
  645|      2|}

_ZN7bthread12butex_createEv:
  264|      3|void* butex_create() {
  265|      3|    Butex* b = butil::get_object<Butex>();
  266|      3|    if (b) {
  ------------------
  |  Branch (266:9): [True: 3, False: 0]
  ------------------
  267|      3|        return &b->value;
  268|      3|    }
  269|      0|    return NULL;
  270|      3|}
_ZN7bthread5ButexC2Ev:
  113|      3|    Butex() {}

_ZN7bthread20butex_create_checkedIjEEPT_v:
   44|      2|template <typename T> T* butex_create_checked() {
   45|      2|    BAIDU_CASSERT(sizeof(T) == sizeof(int), sizeof_T_must_equal_int);
  ------------------
  |  |  196|      2|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  ------------------
   46|      2|    return static_cast<T*>(butex_create());
   47|      2|}
_ZN7bthread20butex_create_checkedIN5butil6atomicIiEEEEPT_v:
   44|      1|template <typename T> T* butex_create_checked() {
   45|      1|    BAIDU_CASSERT(sizeof(T) == sizeof(int), sizeof_T_must_equal_int);
  ------------------
  |  |  196|      1|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  ------------------
   46|      1|    return static_cast<T*>(butex_create());
   47|      1|}

_ZN7bthread11TaskOptionsC2Ebb:
  441|     36|    : high_priority(high_priority)
  442|     36|    , in_place_if_possible(in_place_if_possible)
  443|     36|{}

_ZN7bthread11EpollThreadC2Ev:
  119|      2|        : _epfd(-1)
  120|      2|        , _stop(false)
  121|      2|        , _tid(0) {
  122|      2|    }
_ZN7bthread9LazyArrayIPN5butil6atomicIiEELm262144ELm256EEC2Ev:
   56|      2|    LazyArray() {
   57|      2|        memset(static_cast<void*>(_blocks), 0, sizeof(butil::atomic<Block*>) * NBLOCK);
   58|      2|    }

bthread_id_create:
  390|      1|    int (*on_error)(bthread_id_t, void*, int)) {
  391|      1|    return bthread::id_create_impl(
  392|      1|        id, data,
  393|      1|        (on_error ? on_error : bthread::default_bthread_id_on_error), NULL);
  ------------------
  |  Branch (393:10): [True: 0, False: 1]
  ------------------
  394|      1|}
bthread_id_list_init:
  644|      1|                         unsigned /*conflict_size*/) {
  645|      1|    list->impl = NULL;  // create on demand.
  646|       |    // Set unused fields to zero as well.
  647|      1|    list->head = 0;
  648|      1|    list->size = 0;
  649|      1|    list->conflict_head = 0;
  650|      1|    list->conflict_size = 0;
  651|      1|    return 0;
  652|      1|}
_ZN7bthread12PendingErrorC2Ev:
  107|      2|    PendingError() : id(INVALID_BTHREAD_ID), error_code(0), location(NULL) {}
_ZN7bthread7make_idEjN5butil10ResourceIdINS_2IdEEE:
  155|      1|inline bthread_id_t make_id(uint32_t version, IdResourceId slot) {
  156|      1|    const bthread_id_t tmp =
  157|      1|        { (((uint64_t)slot.value) << 32) | (uint64_t)version };
  158|      1|    return tmp;
  159|      1|}
id.cpp:_ZN7bthreadL14id_create_implEP12bthread_id_tPvPFiS0_S2_iEPFiS0_S2_iRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE:
  328|      1|    int (*on_error2)(bthread_id_t, void*, int, const std::string&)) {
  329|      1|    IdResourceId slot;
  330|      1|    Id* const meta = get_resource(&slot);
  331|      1|    if (meta) {
  ------------------
  |  Branch (331:9): [True: 1, False: 0]
  ------------------
  332|      1|        meta->data = data;
  333|      1|        meta->on_error = on_error;
  334|      1|        meta->on_error2 = on_error2;
  335|      1|        CHECK(meta->pending_q.empty());
  ------------------
  |  |  617|      1|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      1|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  336|      1|        uint32_t* butex = meta->butex;
  337|      1|        if (0 == *butex || *butex + ID_MAX_RANGE + 2 < *butex) {
  ------------------
  |  Branch (337:13): [True: 1, False: 0]
  |  Branch (337:28): [True: 0, False: 0]
  ------------------
  338|       |            // Skip 0 so that bthread_id_t is never 0
  339|       |            // avoid overflow to make comparisons simpler.
  340|      1|            *butex = 1;
  341|      1|        }
  342|      1|        *meta->join_butex = *butex;
  343|      1|        meta->first_ver = *butex;
  344|      1|        meta->locked_ver = *butex + 1;
  345|      1|        *id = make_id(*butex, slot);
  346|      1|        return 0;
  347|      1|    }
  348|      0|    return ENOMEM;
  349|      1|}
_ZN7bthread2IdC2Ev:
  126|      1|    Id() {
  127|       |        // Although value of the butex(as version part of bthread_id_t)
  128|       |        // does not matter, we set it to 0 to make program more deterministic.
  129|      1|        butex = bthread::butex_create_checked<uint32_t>();
  130|      1|        join_butex = bthread::butex_create_checked<uint32_t>();
  131|      1|        *butex = 0;
  132|      1|        *join_butex = 0;
  133|      1|    }
_ZN7bthread10SmallQueueINS_12PendingErrorELi2EEC2Ev:
   36|      1|    SmallQueue() : _begin(0), _size(0), _full(NULL) {}
_ZNK7bthread10SmallQueueINS_12PendingErrorELi2EE5emptyEv:
   71|      1|    bool empty() const {
   72|      1|        return _size == 0 && (_full == NULL || _full->empty());
  ------------------
  |  Branch (72:16): [True: 1, False: 0]
  |  Branch (72:31): [True: 1, False: 0]
  |  Branch (72:48): [True: 0, False: 0]
  ------------------
   73|      1|    }

key.cpp:_ZN7bthreadL13get_key_countEPv:
  417|      2|static int get_key_count(void*) {
  418|      2|    BAIDU_SCOPED_LOCK(bthread::s_key_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  419|      2|    return (int)nkey - (int)nfreekey;
  420|      2|}
key.cpp:_ZN7bthreadL18get_keytable_countEPv:
  421|      2|static size_t get_keytable_count(void*) {
  422|      2|    return nkeytable.load(butil::memory_order_relaxed);
  423|      2|}
key.cpp:_ZN7bthreadL19get_keytable_memoryEPv:
  424|      2|static size_t get_keytable_memory(void*) {
  425|      2|    const size_t n = nkeytable.load(butil::memory_order_relaxed);
  426|      2|    const size_t nsub = nsubkeytable.load(butil::memory_order_relaxed);
  427|      2|    return n * sizeof(KeyTable) + nsub * sizeof(SubKeyTable);
  428|      2|}

_ZN7bthread28first_sys_pthread_mutex_lockEP15pthread_mutex_t:
  496|      2|int first_sys_pthread_mutex_lock(pthread_mutex_t* mutex) {
  497|      2|    pthread_once(&init_sys_mutex_lock_once, init_sys_mutex_lock);
  498|      2|    return sys_pthread_mutex_lock(mutex);
  499|      2|}
_ZN7bthread8internal16FastPthreadMutexC2Ev:
 1094|      4|FastPthreadMutex::FastPthreadMutex() : _futex(0) {
 1095|      4|    MUTEX_RESET_OWNER_COMMON(_owner);
  ------------------
  |  |  683|      4|#define MUTEX_RESET_OWNER_COMMON(owner) ((void)owner)
  ------------------
 1096|      4|}
pthread_mutex_init:
 1299|    226|                       const pthread_mutexattr_t* __restrict mutexattr) {
 1300|    226|    INIT_MUTEX_OWNER_MAP_ENTRY(mutex, mutexattr);
  ------------------
  |  |  787|    226|#define INIT_MUTEX_OWNER_MAP_ENTRY(mutex, mutexattr) ((void)0)
  ------------------
 1301|    226|    return bthread::sys_pthread_mutex_init(mutex, mutexattr);
 1302|    226|}
pthread_mutex_lock:
 1309|    333|int pthread_mutex_lock(pthread_mutex_t* mutex) {
 1310|    333|    return bthread::pthread_mutex_lock_impl(mutex);
 1311|    333|}
pthread_mutex_unlock:
 1324|    333|int pthread_mutex_unlock(pthread_mutex_t* mutex) {
 1325|    333|    return bthread::pthread_mutex_unlock_impl(mutex);
 1326|    333|}
mutex.cpp:_ZN7bthreadL19init_sys_mutex_lockEv:
  439|      2|static void init_sys_mutex_lock() {
  440|       |// When bRPC library is linked as a shared library, need to make sure bRPC
  441|       |// shared library is loaded before the pthread shared library. Otherwise,
  442|       |// it may cause runtime error: undefined symbol: pthread_mutex_xxx.
  443|       |// Alternatively, static linking can also avoid this problem.
  444|      2|#if defined(OS_LINUX)
  445|       |    // TODO: may need dlvsym when GLIBC has multiple versions of a same symbol.
  446|       |    // http://blog.fesnel.com/blog/2009/08/25/preloading-with-multiple-symbol-versions
  447|      2|    if (_dl_sym) {
  ------------------
  |  Branch (447:9): [True: 0, False: 2]
  ------------------
  448|      0|        sys_pthread_mutex_init = (MutexInitOp)_dl_sym(
  449|      0|            RTLD_NEXT, "pthread_mutex_init", (void*)init_sys_mutex_lock);
  450|      0|        sys_pthread_mutex_destroy = (MutexOp)_dl_sym(
  451|      0|            RTLD_NEXT, "pthread_mutex_destroy", (void*)init_sys_mutex_lock);
  452|      0|        sys_pthread_mutex_lock = (MutexOp)_dl_sym(
  453|      0|            RTLD_NEXT, "pthread_mutex_lock", (void*)init_sys_mutex_lock);
  454|      0|        sys_pthread_mutex_unlock = (MutexOp)_dl_sym(
  455|      0|            RTLD_NEXT, "pthread_mutex_unlock", (void*)init_sys_mutex_lock);
  456|      0|        sys_pthread_mutex_trylock = (MutexOp)_dl_sym(
  457|      0|            RTLD_NEXT, "pthread_mutex_trylock", (void*)init_sys_mutex_lock);
  458|      0|#if HAS_PTHREAD_MUTEX_TIMEDLOCK
  459|      0|        sys_pthread_mutex_timedlock = (TimedMutexOp)_dl_sym(
  460|      0|            RTLD_NEXT, "pthread_mutex_timedlock", (void*)init_sys_mutex_lock);
  461|      0|#endif // HAS_PTHREAD_MUTEX_TIMEDLOCK
  462|      2|    } else {
  463|       |        // _dl_sym may be undefined reference in some system, fallback to dlsym
  464|      2|        sys_pthread_mutex_init = (MutexInitOp)dlsym(RTLD_NEXT, "pthread_mutex_init");
  465|      2|        sys_pthread_mutex_destroy = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_destroy");
  466|      2|        sys_pthread_mutex_lock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_lock");
  467|      2|        sys_pthread_mutex_unlock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_unlock");
  468|      2|        sys_pthread_mutex_trylock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_trylock");
  469|      2|#if HAS_PTHREAD_MUTEX_TIMEDLOCK
  470|      2|        sys_pthread_mutex_timedlock = (TimedMutexOp)dlsym(RTLD_NEXT, "pthread_mutex_timedlock");
  471|      2|#endif // HAS_PTHREAD_MUTEX_TIMEDLOCK
  472|      2|    }
  473|       |#elif defined(OS_MACOSX)
  474|       |    // TODO: look workaround for dlsym on mac
  475|       |    sys_pthread_mutex_init = (MutexInitOp)dlsym(RTLD_NEXT, "pthread_mutex_init");
  476|       |    sys_pthread_mutex_destroy = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_destroy");
  477|       |    sys_pthread_mutex_lock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_lock");
  478|       |    sys_pthread_mutex_trylock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_trylock");
  479|       |    sys_pthread_mutex_unlock = (MutexOp)dlsym(RTLD_NEXT, "pthread_mutex_unlock");
  480|       |#endif
  481|      2|}
_ZN7bthread23pthread_mutex_lock_implEP15pthread_mutex_t:
  973|    333|BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(pthread_mutex_t* mutex) {
  974|       |    return internal::pthread_mutex_lock_impl(mutex, NULL);
  975|    333|}
_ZN7bthread8internal23pthread_mutex_lock_implI15pthread_mutex_tEEiPT_PK8timespec:
  870|    333|BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(Mutex* mutex, const struct timespec* abstime) {
  871|       |    // Don't change behavior of lock when profiler is off.
  872|    333|    if (!g_cp ||
  ------------------
  |  Branch (872:9): [True: 333, False: 0]
  ------------------
  873|       |        // collecting code including backtrace() and submit() may call
  874|       |        // pthread_mutex_lock and cause deadlock. Don't sample.
  875|    333|        tls_inside_lock) {
  ------------------
  |  Branch (875:9): [True: 0, False: 0]
  ------------------
  876|    333|        return pthread_mutex_lock_internal(mutex, abstime);
  877|    333|    }
  878|       |    // Don't slow down non-contended locks.
  879|      0|    int rc = pthread_mutex_trylock_internal(mutex);
  880|      0|    if (rc != EBUSY) {
  ------------------
  |  Branch (880:9): [True: 0, False: 0]
  ------------------
  881|      0|        return rc;
  882|      0|    }
  883|       |    // Ask bvar::Collector if this (contended) locking should be sampled
  884|      0|    const size_t sampling_range = bvar::is_collectable(&g_cp_sl);
  885|       |
  886|      0|    bthread_contention_site_t* csite = NULL;
  887|      0|#ifndef DONT_SPEEDUP_PTHREAD_CONTENTION_PROFILER_WITH_TLS
  888|      0|    TLSPthreadContentionSites& fast_alt = tls_csites;
  889|      0|    if (fast_alt.cp_version != g_cp_version) {
  ------------------
  |  Branch (889:9): [True: 0, False: 0]
  ------------------
  890|      0|        fast_alt.cp_version = g_cp_version;
  891|      0|        fast_alt.count = 0;
  892|      0|    }
  893|      0|    if (fast_alt.count < TLS_MAX_COUNT) {
  ------------------
  |  Branch (893:9): [True: 0, False: 0]
  ------------------
  894|      0|        MutexAndContentionSite& entry = fast_alt.list[fast_alt.count++];
  895|      0|        entry.mutex = mutex;
  896|      0|        csite = &entry.csite;
  897|      0|        if (!bvar::is_sampling_range_valid(sampling_range)) {
  ------------------
  |  Branch (897:13): [True: 0, False: 0]
  ------------------
  898|      0|            make_contention_site_invalid(&entry.csite);
  899|      0|            return pthread_mutex_lock_internal(mutex, abstime);
  900|      0|        }
  901|      0|    }
  902|      0|#endif
  903|      0|    if (!bvar::is_sampling_range_valid(sampling_range)) {  // don't sample
  ------------------
  |  Branch (903:9): [True: 0, False: 0]
  ------------------
  904|      0|        return pthread_mutex_lock_internal(mutex, abstime);
  905|      0|    }
  906|       |    // Lock and monitor the waiting time.
  907|      0|    const int64_t start_ns = butil::cpuwide_time_ns();
  908|      0|    rc = pthread_mutex_lock_internal(mutex, abstime);
  909|      0|    if (!rc) { // Inside lock
  ------------------
  |  Branch (909:9): [True: 0, False: 0]
  ------------------
  910|      0|        if (!csite) {
  ------------------
  |  Branch (910:13): [True: 0, False: 0]
  ------------------
  911|      0|            csite = add_pthread_contention_site(mutex);
  912|      0|            if (csite == NULL) {
  ------------------
  |  Branch (912:17): [True: 0, False: 0]
  ------------------
  913|      0|                return rc;
  914|      0|            }
  915|      0|        }
  916|      0|        csite->duration_ns = butil::cpuwide_time_ns() - start_ns;
  917|      0|        csite->sampling_range = sampling_range;
  918|      0|    } // else rare
  919|      0|    return rc;
  920|      0|}
_ZN7bthread8internal27pthread_mutex_lock_internalEP15pthread_mutex_tPK8timespec:
  798|    333|                                                   const struct timespec* abstime) {
  799|    333|    int rc = 0;
  800|    333|    if (NULL == abstime) {
  ------------------
  |  Branch (800:9): [True: 333, False: 0]
  ------------------
  801|    333|        FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex);
  ------------------
  |  |  789|    333|#define FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex) ((void)0)
  ------------------
  802|    333|        SYS_PTHREAD_MUTEX_CHECK_OWNER;
  ------------------
  |  |  790|    333|#define SYS_PTHREAD_MUTEX_CHECK_OWNER ((void)0)
  ------------------
  803|    333|        rc = sys_pthread_mutex_lock(mutex);
  804|    333|        if (0 == rc) {
  ------------------
  |  Branch (804:13): [True: 333, False: 0]
  ------------------
  805|    333|            SYS_PTHREAD_MUTEX_SET_OWNER;
  ------------------
  |  |  791|    333|#define SYS_PTHREAD_MUTEX_SET_OWNER ((void)0)
  ------------------
  806|    333|        }
  807|    333|    } else {
  808|      0|        rc = sys_pthread_mutex_timedlock(mutex, abstime);
  809|      0|        if (0 == rc) {
  ------------------
  |  Branch (809:13): [True: 0, False: 0]
  ------------------
  810|      0|            FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex);
  ------------------
  |  |  789|      0|#define FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex) ((void)0)
  ------------------
  811|      0|            SYS_PTHREAD_MUTEX_SET_OWNER;
  ------------------
  |  |  791|      0|#define SYS_PTHREAD_MUTEX_SET_OWNER ((void)0)
  ------------------
  812|      0|        }
  813|      0|    }
  814|    333|    if (0 == rc) {
  ------------------
  |  Branch (814:9): [True: 333, False: 0]
  ------------------
  815|    333|        ADD_TLS_PTHREAD_LOCK_COUNT;
  ------------------
  |  |  554|    333|#define ADD_TLS_PTHREAD_LOCK_COUNT ((void)0)
  ------------------
  816|    333|    }
  817|    333|    return rc;
  818|    333|}
_ZN7bthread25pthread_mutex_unlock_implEP15pthread_mutex_t:
  988|    333|BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(pthread_mutex_t* mutex) {
  989|    333|    return internal::pthread_mutex_unlock_impl(mutex);
  990|    333|}
_ZN7bthread8internal25pthread_mutex_unlock_implI15pthread_mutex_tEEiPT_:
  928|    333|BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(Mutex* mutex) {
  929|       |    // Don't change behavior of unlock when profiler is off.
  930|    333|    if (!g_cp || tls_inside_lock) {
  ------------------
  |  Branch (930:9): [True: 333, False: 0]
  |  Branch (930:18): [True: 0, False: 0]
  ------------------
  931|       |        // This branch brings an issue that an entry created by
  932|       |        // add_pthread_contention_site may not be cleared. Thus we add a
  933|       |        // 16-bit rolling version in the entry to find out such entry.
  934|    333|        return pthread_mutex_unlock_internal(mutex);
  935|    333|    }
  936|      0|    int64_t unlock_start_ns = 0;
  937|      0|    bool miss_in_tls = true;
  938|      0|    bthread_contention_site_t saved_csite = {0,0};
  939|      0|#ifndef DONT_SPEEDUP_PTHREAD_CONTENTION_PROFILER_WITH_TLS
  940|      0|    TLSPthreadContentionSites& fast_alt = tls_csites;
  941|      0|    for (int i = fast_alt.count - 1; i >= 0; --i) {
  ------------------
  |  Branch (941:38): [True: 0, False: 0]
  ------------------
  942|      0|        if (fast_alt.list[i].mutex == mutex) {
  ------------------
  |  Branch (942:13): [True: 0, False: 0]
  ------------------
  943|      0|            if (is_contention_site_valid(fast_alt.list[i].csite)) {
  ------------------
  |  Branch (943:17): [True: 0, False: 0]
  ------------------
  944|      0|                saved_csite = fast_alt.list[i].csite;
  945|      0|                unlock_start_ns = butil::cpuwide_time_ns();
  946|      0|            }
  947|      0|            fast_alt.list[i] = fast_alt.list[--fast_alt.count];
  948|      0|            miss_in_tls = false;
  949|      0|            break;
  950|      0|        }
  951|      0|    }
  952|      0|#endif
  953|       |    // Check the map to see if the lock is sampled. Notice that we're still
  954|       |    // inside critical section.
  955|      0|    if (miss_in_tls) {
  ------------------
  |  Branch (955:9): [True: 0, False: 0]
  ------------------
  956|      0|        if (remove_pthread_contention_site(mutex, &saved_csite)) {
  ------------------
  |  Branch (956:13): [True: 0, False: 0]
  ------------------
  957|      0|            unlock_start_ns = butil::cpuwide_time_ns();
  958|      0|        }
  959|      0|    }
  960|      0|    const int rc = pthread_mutex_unlock_internal(mutex);
  961|       |    // [Outside lock]
  962|      0|    if (unlock_start_ns) {
  ------------------
  |  Branch (962:9): [True: 0, False: 0]
  ------------------
  963|      0|        const int64_t unlock_end_ns = butil::cpuwide_time_ns();
  964|      0|        saved_csite.duration_ns += unlock_end_ns - unlock_start_ns;
  965|      0|        submit_contention(saved_csite, unlock_end_ns);
  966|      0|    }
  967|      0|    return rc;
  968|    333|}
_ZN7bthread8internal29pthread_mutex_unlock_internalEP15pthread_mutex_t:
  843|    333|BUTIL_FORCE_INLINE int pthread_mutex_unlock_internal(pthread_mutex_t* mutex) {
  844|    333|    SYS_PTHREAD_MUTEX_RESET_OWNER(mutex);
  ------------------
  |  |  792|    333|#define SYS_PTHREAD_MUTEX_RESET_OWNER(mutex) ((void)0)
  ------------------
  845|    333|    SUB_TLS_PTHREAD_LOCK_COUNT;
  ------------------
  |  |  555|    333|#define SUB_TLS_PTHREAD_LOCK_COUNT ((void)0)
  ------------------
  846|    333|    return sys_pthread_mutex_unlock(mutex);
  847|    333|}

_ZN7bthread16FastPthreadMutexC2Ev:
  102|      4|    FastPthreadMutex() = default;

stack.cpp:_ZN7bthreadL15get_stack_countEPv:
   50|      2|static int64_t get_stack_count(void*) {
   51|      2|    return s_stack_count.load(butil::memory_order_relaxed);
   52|      2|}

_ZN5butil12ArenaOptionsC2Ev:
   27|      2|    : initial_block_size(64)
   28|      2|    , max_block_size(8192)
   29|      2|{}
_ZN5butil5ArenaC2ERKNS_12ArenaOptionsE:
   32|      2|    : _cur_block(NULL)
   33|      2|    , _isolated_blocks(NULL)
   34|      2|    , _block_size(options.initial_block_size)
   35|      2|    , _options(options) {
   36|      2|}

_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc6SocketEE10BlockGroupEE4loadESt12memory_order:
  293|      2|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc6SocketEE10BlockGroupEE3refEv:
  316|      3|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      3|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      3|        return *p;
  320|      3|    }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc6SocketEEEE4loadESt12memory_order:
  293|      2|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc6SocketEEEE3refEv:
  316|      3|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      3|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      3|        return *p;
  320|      3|    }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc6SocketEEEE5storeES5_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicIlE3refEv:
  316|      7|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      7|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      7|        return *p;
  320|      7|    }
_ZN5butil13static_atomicIlE9fetch_addElSt12memory_order:
  304|      5|    T fetch_add(T v, memory_order o) { return ref().fetch_add(v, o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEEEE4loadESt12memory_order:
  293|      2|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEEEE3refEv:
  316|      3|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      3|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      3|        return *p;
  320|      3|    }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEEEE5storeES5_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEE10BlockGroupEE4loadESt12memory_order:
  293|      1|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEE10BlockGroupEE3refEv:
  316|      2|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      2|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      2|        return *p;
  320|      2|    }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEEEE4loadESt12memory_order:
  293|    109|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEEEE3refEv:
  316|    110|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|    110|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|    110|        return *p;
  320|    110|    }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEEEE5storeES6_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicImE4loadESt12memory_order:
  293|     21|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicImE3refEv:
  316|     38|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|     38|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|     38|        return *p;
  320|     38|    }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEE10BlockGroupEE4loadESt12memory_order:
  293|      1|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEE10BlockGroupEE3refEv:
  316|      2|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      2|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      2|        return *p;
  320|      2|    }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEE10BlockGroupEE5storeES7_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicImE5storeEmSt12memory_order:
  294|      5|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil6atomicIbEC2Eb:
  235|      2|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIiEC2Ev:
  234|      3|    atomic() {}
_ZN5butil6atomicImEC2Em:
  235|      8|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIiEC2Ei:
  235|      8|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIlEC2Ev:
  234|    103|    atomic() {}
_ZN5butil13static_atomicImE9fetch_addEmSt12memory_order:
  304|     12|    T fetch_add(T v, memory_order o) { return ref().fetch_add(v, o); }
_ZN5butil13static_atomicIlE4loadESt12memory_order:
  293|      2|    T load(memory_order o) { return ref().load(o); }
_ZN5butil6atomicImEC2Ev:
  234|      1|    atomic() {}
_ZN5butil6atomicIjEC2Ej:
  235|      1|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIPNS_10ObjectPoolIN4brpc6policy17MostCommonMessageEE5BlockEEC2Ev:
  234|  65.5k|    atomic() {}
_ZN5butil6atomicIlEC2El:
  235|      5|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIN4brpc18VersionedRefWithIdINS1_6SocketEE19AdditionalRefStatusEEC2ES5_:
  235|      1|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIPN4brpc6Socket10SharedPartEEC2ES4_:
  235|      1|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIPN4brpc11DestroyableEEC2ES3_:
  235|      1|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIPN4brpc6Socket12WriteRequestEEC2ES4_:
  235|      1|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIPNS_12ResourcePoolIN4brpc6SocketEE5BlockEEC2Ev:
  234|  65.5k|    atomic() {}
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc6SocketEE10BlockGroupEE5storeES6_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil6atomicIN4brpc18VersionedRefWithIdINS1_11IOEventDataEE19AdditionalRefStatusEEC2ES5_:
  235|      1|    atomic(T v) : ::std::atomic<T>(v) {}
_ZN5butil6atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEE5BlockEEC2Ev:
  234|  65.5k|    atomic() {}
_ZN5butil13static_atomicIPNS_12ResourcePoolIN4brpc11IOEventDataEE10BlockGroupEE5storeES6_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN7bthread5ButexEEEE4loadESt12memory_order:
  293|      4|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN7bthread5ButexEEEE3refEv:
  316|      5|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      5|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      5|        return *p;
  320|      5|    }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN7bthread5ButexEEEE5storeES5_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN7bthread5ButexEE10BlockGroupEE4loadESt12memory_order:
  293|      1|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_10ObjectPoolIN7bthread5ButexEE10BlockGroupEE3refEv:
  316|      2|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      2|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      2|        return *p;
  320|      2|    }
_ZN5butil6atomicIPNS_10ObjectPoolIN7bthread5ButexEE5BlockEEC2Ev:
  234|  65.5k|    atomic() {}
_ZN5butil13static_atomicIPNS_10ObjectPoolIN7bthread5ButexEE10BlockGroupEE5storeES6_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil6atomicIPN7bthread9LazyArrayIPNS0_IiEELm262144ELm256EE5BlockEEC2Ev:
  234|   524k|    atomic() {}
_ZN5butil13static_atomicIPNS_12ResourcePoolIN7bthread2IdEEEE4loadESt12memory_order:
  293|      2|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN7bthread2IdEEEE3refEv:
  316|      3|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      3|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      3|        return *p;
  320|      3|    }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN7bthread2IdEEEE5storeES5_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN7bthread2IdEE10BlockGroupEE4loadESt12memory_order:
  293|      1|    T load(memory_order o) { return ref().load(o); }
_ZN5butil13static_atomicIPNS_12ResourcePoolIN7bthread2IdEE10BlockGroupEE3refEv:
  316|      2|    atomic<T>& ref() {
  317|       |        // Suppress strict-alias warnings.
  318|      2|        atomic<T>* p = reinterpret_cast<atomic<T>*>(&val);
  319|      2|        return *p;
  320|      2|    }
_ZN5butil6atomicIPNS_12ResourcePoolIN7bthread2IdEE5BlockEEC2Ev:
  234|  65.5k|    atomic() {}
_ZN5butil13static_atomicIPNS_12ResourcePoolIN7bthread2IdEE10BlockGroupEE5storeES6_St12memory_order:
  294|      1|    void store(T v, memory_order o) { return ref().store(v, o); }

atomicops_internals_x86_gcc.cc:_ZN12_GLOBAL__N_123AtomicOpsx86InitializerC2Ev:
   88|      2|  AtomicOpsx86Initializer() {
   89|      2|    AtomicOps_Internalx86CPUFeaturesInit();
   90|      2|  }
atomicops_internals_x86_gcc.cc:_ZN12_GLOBAL__N_136AtomicOps_Internalx86CPUFeaturesInitEv:
   48|      2|void AtomicOps_Internalx86CPUFeaturesInit() {
   49|      2|  uint32_t eax;
   50|      2|  uint32_t ebx;
   51|      2|  uint32_t ecx;
   52|      2|  uint32_t edx;
   53|       |
   54|       |  // Get vendor string (issue CPUID with eax = 0)
   55|      2|  cpuid(eax, ebx, ecx, edx, 0);
  ------------------
  |  |   30|      2|  asm("mov %%rbx, %%rdi\n"     \
  |  |   31|      2|      "cpuid\n"                \
  |  |   32|      2|      "xchg %%rdi, %%rbx\n"    \
  |  |   33|      2|      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
  ------------------
   56|      2|  char vendor[13];
   57|      2|  memcpy(vendor, &ebx, 4);
   58|      2|  memcpy(vendor + 4, &edx, 4);
   59|      2|  memcpy(vendor + 8, &ecx, 4);
   60|      2|  vendor[12] = 0;
   61|       |
   62|       |  // get feature flags in ecx/edx, and family/model in eax
   63|      2|  cpuid(eax, ebx, ecx, edx, 1);
  ------------------
  |  |   30|      2|  asm("mov %%rbx, %%rdi\n"     \
  |  |   31|      2|      "cpuid\n"                \
  |  |   32|      2|      "xchg %%rdi, %%rbx\n"    \
  |  |   33|      2|      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
  ------------------
   64|       |
   65|      2|  int family = (eax >> 8) & 0xf;        // family and model fields
   66|      2|  int model = (eax >> 4) & 0xf;
   67|      2|  if (family == 0xf) {                  // use extended family and model fields
  ------------------
  |  Branch (67:7): [True: 2, False: 0]
  ------------------
   68|      2|    family += (eax >> 20) & 0xff;
   69|      2|    model += ((eax >> 16) & 0xf) << 4;
   70|      2|  }
   71|       |
   72|       |  // Opteron Rev E has a bug in which on very rare occasions a locked
   73|       |  // instruction doesn't act as a read-acquire barrier if followed by a
   74|       |  // non-locked read-modify-write instruction.  Rev F has this bug in
   75|       |  // pre-release versions, but not in versions released to customers,
   76|       |  // so we test only for Rev E, which is family 15, model 32..63 inclusive.
   77|      2|  if (strcmp(vendor, "AuthenticAMD") == 0 &&       // AMD
  ------------------
  |  Branch (77:7): [True: 2, False: 0]
  ------------------
   78|      2|      family == 15 &&
  ------------------
  |  Branch (78:7): [True: 0, False: 2]
  ------------------
   79|      0|      32 <= model && model <= 63) {
  ------------------
  |  Branch (79:7): [True: 0, False: 0]
  |  Branch (79:22): [True: 0, False: 0]
  ------------------
   80|      0|    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = true;
   81|      2|  } else {
   82|      2|    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false;
   83|      2|  }
   84|      2|}

_ZN5butil6subtle13Release_StoreEPVll:
  181|      3|inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
  182|      3|  ATOMICOPS_COMPILER_BARRIER();
  ------------------
  |  |   24|      3|#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
  ------------------
  183|       |
  184|      3|  *ptr = value; // An x86 store acts as a release barrier
  185|       |                // for current AMD/Intel chips as of Jan 2008.
  186|       |                // See also Acquire_Load(), below.
  187|       |
  188|       |  // When new chips come out, check:
  189|       |  //  IA-32 Intel Architecture Software Developer's Manual, Volume 3:
  190|       |  //  System Programming Guide, Chatper 7: Multiple-processor management,
  191|       |  //  Section 7.2, Memory Ordering.
  192|       |  // Last seen at:
  193|       |  //   http://developer.intel.com/design/pentium4/manuals/index_new.htm
  194|       |  //
  195|       |  // x86 stores/loads fail to act as barriers for a few instructions (clflush
  196|       |  // maskmovdqu maskmovq movntdq movnti movntpd movntps movntq) but these are
  197|       |  // not generated by the compiler, and are rare.  Users of these instructions
  198|       |  // need to know about cache behaviour in any case since all of these involve
  199|       |  // either flushing cache lines or non-temporal cache hints.
  200|      3|}
_ZN5butil6subtle12Acquire_LoadEPVKl:
  206|     20|inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
  207|     20|  Atomic64 value = *ptr; // An x86 load acts as a acquire barrier,
  208|       |                         // for current AMD/Intel chips as of Jan 2008.
  209|       |                         // See also Release_Store(), above.
  210|     20|  ATOMICOPS_COMPILER_BARRIER();
  ------------------
  |  |   24|     20|#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
  ------------------
  211|     20|  return value;
  212|     20|}

_ZN5butil8demangleB5cxx11EPKc:
   30|    916|std::string demangle(const char* name) {
   31|       |    // mangled_name
   32|       |    //   A NULL-terminated character string containing the name to
   33|       |    //   be demangled.
   34|       |    // output_buffer:
   35|       |    //   A region of memory, allocated with malloc, of *length bytes,
   36|       |    //   into which the demangled name is stored. If output_buffer is
   37|       |    //   not long enough, it is expanded using realloc. output_buffer
   38|       |    //   may instead be NULL; in that case, the demangled name is placed
   39|       |    //   in a region of memory allocated with malloc.
   40|       |    // length
   41|       |    //   If length is non-NULL, the length of the buffer containing the
   42|       |    //   demangled name is placed in *length.
   43|       |    // status
   44|       |    //   *status is set to one of the following values:
   45|       |    //    0: The demangling operation succeeded.
   46|       |    //   -1: A memory allocation failure occurred.
   47|       |    //   -2: mangled_name is not a valid name under the C++ ABI
   48|       |    //       mangling rules.
   49|       |    //   -3: One of the arguments is invalid.
   50|    916|    int status = 0;
   51|    916|    char* buf = abi::__cxa_demangle(name, NULL, NULL, &status);
   52|    916|    if (status == 0 && buf) {
  ------------------
  |  Branch (52:9): [True: 916, False: 0]
  |  Branch (52:24): [True: 916, False: 0]
  ------------------
   53|    916|        std::string s(buf);
   54|    916|        free(buf);
   55|    916|        return s;
   56|    916|    }
   57|      0|    return std::string(name);
   58|    916|}

_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE5clearEv:
  204|      2|    void clear() {
  205|      2|        for (uint32_t i = 0; i < _count; ++i) {
  ------------------
  |  Branch (205:30): [True: 0, False: 2]
  ------------------
  206|      0|            ((T*)_items + _mod(_start + i, _cap))->~T();
  207|      0|        }
  208|      2|        _count = 0;
  209|      2|        _start = 0;
  210|      2|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE4_modEjj:
  291|      6|    static uint32_t _mod(uint32_t off, uint32_t cap) {
  292|      6|        while (off >= cap) {
  ------------------
  |  Branch (292:16): [True: 0, False: 6]
  ------------------
  293|      0|            off -= cap;
  294|      0|        }
  295|      6|        return off;
  296|      6|    }
_ZNK5butil12BoundedQueueIN4bvar6detail6SampleIiEEE8capacityEv:
  267|      4|    size_t capacity() const { return _cap; }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE3popEPS4_:
  167|      3|    bool pop(T* item) {
  168|      3|        if (_count) {
  ------------------
  |  Branch (168:13): [True: 1, False: 2]
  ------------------
  169|      1|            --_count;
  170|      1|            T* const p = (T*)_items + _start;
  171|      1|            *item = *p;
  172|      1|            p->~T();
  173|      1|            _start = _mod(_start + 1, _cap);
  174|      1|            return true;
  175|      1|        }
  176|      2|        return false;
  177|      3|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE4pushERKS4_:
  100|      1|    bool push(const T& item) {
  101|      1|        if (_count < _cap) {
  ------------------
  |  Branch (101:13): [True: 1, False: 0]
  ------------------
  102|      1|            new ((T*)_items + _mod(_start + _count, _cap)) T(item);
  103|      1|            ++_count;
  104|      1|            return true;
  105|      1|        }
  106|      0|        return false;
  107|      1|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE4swapERS5_:
  276|      2|    void swap(BoundedQueue& rhs) {
  277|      2|        std::swap(_count, rhs._count);
  278|      2|        std::swap(_cap, rhs._cap);
  279|      2|        std::swap(_start, rhs._start);
  280|      2|        std::swap(_ownership, rhs._ownership);
  281|      2|        std::swap(_items, rhs._items);
  282|      2|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE9elim_pushERKS4_:
  111|      2|    void elim_push(const T& item) {
  112|      2|        if (_count < _cap) {
  ------------------
  |  Branch (112:13): [True: 2, False: 0]
  ------------------
  113|      2|            new ((T*)_items + _mod(_start + _count, _cap)) T(item);
  114|      2|            ++_count;
  115|      2|        } else {
  116|      0|            ((T*)_items)[_start] = item;
  117|      0|            _start = _mod(_start + 1, _cap);
  118|      0|        }
  119|      2|    }
_ZNK5butil12BoundedQueueIN4bvar6detail6SampleIiEEE4sizeEv:
  264|      1|    size_t size() const { return _count; }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE6bottomEm:
  247|      1|    T* bottom(size_t index) {
  248|      1|        if (index < _count) {
  ------------------
  |  Branch (248:13): [True: 1, False: 0]
  ------------------
  249|      1|            return (T*)_items + _mod(_start + _count - index - 1, _cap);
  250|      1|        }
  251|      0|        return NULL;  // including _count == 0
  252|      1|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEE6bottomEv:
  237|      1|    T* bottom() { 
  238|      1|        return _count ? ((T*)_items + _mod(_start + _count - 1, _cap)) : NULL; 
  ------------------
  |  Branch (238:16): [True: 1, False: 0]
  ------------------
  239|      1|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE5clearEv:
  204|      4|    void clear() {
  205|      4|        for (uint32_t i = 0; i < _count; ++i) {
  ------------------
  |  Branch (205:30): [True: 0, False: 4]
  ------------------
  206|      0|            ((T*)_items + _mod(_start + i, _cap))->~T();
  207|      0|        }
  208|      4|        _count = 0;
  209|      4|        _start = 0;
  210|      4|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE4_modEjj:
  291|     12|    static uint32_t _mod(uint32_t off, uint32_t cap) {
  292|     12|        while (off >= cap) {
  ------------------
  |  Branch (292:16): [True: 0, False: 12]
  ------------------
  293|      0|            off -= cap;
  294|      0|        }
  295|     12|        return off;
  296|     12|    }
_ZNK5butil12BoundedQueueIN4bvar6detail6SampleIlEEE8capacityEv:
  267|      8|    size_t capacity() const { return _cap; }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE3popEPS4_:
  167|      6|    bool pop(T* item) {
  168|      6|        if (_count) {
  ------------------
  |  Branch (168:13): [True: 2, False: 4]
  ------------------
  169|      2|            --_count;
  170|      2|            T* const p = (T*)_items + _start;
  171|      2|            *item = *p;
  172|      2|            p->~T();
  173|      2|            _start = _mod(_start + 1, _cap);
  174|      2|            return true;
  175|      2|        }
  176|      4|        return false;
  177|      6|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE4pushERKS4_:
  100|      2|    bool push(const T& item) {
  101|      2|        if (_count < _cap) {
  ------------------
  |  Branch (101:13): [True: 2, False: 0]
  ------------------
  102|      2|            new ((T*)_items + _mod(_start + _count, _cap)) T(item);
  103|      2|            ++_count;
  104|      2|            return true;
  105|      2|        }
  106|      0|        return false;
  107|      2|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE4swapERS5_:
  276|      4|    void swap(BoundedQueue& rhs) {
  277|      4|        std::swap(_count, rhs._count);
  278|      4|        std::swap(_cap, rhs._cap);
  279|      4|        std::swap(_start, rhs._start);
  280|      4|        std::swap(_ownership, rhs._ownership);
  281|      4|        std::swap(_items, rhs._items);
  282|      4|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE9elim_pushERKS4_:
  111|      4|    void elim_push(const T& item) {
  112|      4|        if (_count < _cap) {
  ------------------
  |  Branch (112:13): [True: 4, False: 0]
  ------------------
  113|      4|            new ((T*)_items + _mod(_start + _count, _cap)) T(item);
  114|      4|            ++_count;
  115|      4|        } else {
  116|      0|            ((T*)_items)[_start] = item;
  117|      0|            _start = _mod(_start + 1, _cap);
  118|      0|        }
  119|      4|    }
_ZNK5butil12BoundedQueueIN4bvar6detail6SampleIlEEE4sizeEv:
  264|      2|    size_t size() const { return _count; }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE6bottomEm:
  247|      2|    T* bottom(size_t index) {
  248|      2|        if (index < _count) {
  ------------------
  |  Branch (248:13): [True: 2, False: 0]
  ------------------
  249|      2|            return (T*)_items + _mod(_start + _count - index - 1, _cap);
  250|      2|        }
  251|      0|        return NULL;  // including _count == 0
  252|      2|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEE6bottomEv:
  237|      2|    T* bottom() { 
  238|      2|        return _count ? ((T*)_items + _mod(_start + _count - 1, _cap)) : NULL; 
  ------------------
  |  Branch (238:16): [True: 2, False: 0]
  ------------------
  239|      2|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEEC2Ev:
   83|      2|        : _count(0)
   84|      2|        , _cap(0)
   85|      2|        , _start(0)
   86|      2|        , _ownership(NOT_OWN_STORAGE)
   87|      2|        , _items(NULL) {
   88|      2|    };
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEED2Ev:
   90|      4|    ~BoundedQueue() {
   91|      4|        clear();
   92|      4|        if (_ownership == OWNS_STORAGE) {
  ------------------
  |  Branch (92:13): [True: 2, False: 2]
  ------------------
   93|      2|            free(_items);
   94|       |            _items = NULL;
   95|      2|        }
   96|      4|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIlEEEC2EPvmNS_16StorageOwnershipE:
   62|      4|        : _count(0)
   63|      4|        , _cap(memsize / sizeof(T))
   64|      4|        , _start(0)
   65|      4|        , _ownership(ownership)
   66|      4|        , _items(mem) {
   67|      4|        DCHECK(_items);
  ------------------
  |  |  846|      4|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  ------------------
  |  |  |  |  472|      8|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 4, Folded]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  847|      0|    << "Check failed: " #condition ". "
  ------------------
   68|      4|    };
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEEC2Ev:
   83|      1|        : _count(0)
   84|      1|        , _cap(0)
   85|      1|        , _start(0)
   86|      1|        , _ownership(NOT_OWN_STORAGE)
   87|      1|        , _items(NULL) {
   88|      1|    };
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEED2Ev:
   90|      2|    ~BoundedQueue() {
   91|      2|        clear();
   92|      2|        if (_ownership == OWNS_STORAGE) {
  ------------------
  |  Branch (92:13): [True: 1, False: 1]
  ------------------
   93|      1|            free(_items);
   94|       |            _items = NULL;
   95|      1|        }
   96|      2|    }
_ZN5butil12BoundedQueueIN4bvar6detail6SampleIiEEEC2EPvmNS_16StorageOwnershipE:
   62|      2|        : _count(0)
   63|      2|        , _cap(memsize / sizeof(T))
   64|      2|        , _start(0)
   65|      2|        , _ownership(ownership)
   66|      2|        , _items(mem) {
   67|      2|        DCHECK(_items);
  ------------------
  |  |  846|      2|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  ------------------
  |  |  |  |  472|      4|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 2, Folded]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  847|      0|    << "Check failed: " #condition ". "
  ------------------
   68|      2|    };

_ZNK5butil13DefaultHasherINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEclERKS6_:
  562|     62|    std::size_t operator()(const std::string& s) const {
  563|     62|        std::size_t result = 0;
  564|  1.17k|        for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) {
  ------------------
  |  Branch (564:57): [True: 1.11k, False: 62]
  ------------------
  565|  1.11k|            result = result * 101 + *i;
  566|  1.11k|        }
  567|     62|        return result;        
  568|     62|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6BucketC2Ev:
  283|  1.08k|        Bucket() : next((Bucket*)-1UL) {}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE26init_buckets_and_thumbnailEPNSE_6BucketEPmm:
  369|    128|                                           size_t nbucket) {
  370|  66.6k|        for (size_t i = 0; i < nbucket; ++i) {
  ------------------
  |  Branch (370:28): [True: 66.5k, False: 128]
  ------------------
  371|  66.5k|            buckets[i].set_invalid();
  372|  66.5k|        }
  373|    128|        buckets[nbucket].next = NULL;
  374|    128|        if (_Sparse) {
  ------------------
  |  Branch (374:13): [Folded, False: 128]
  ------------------
  375|      0|            bit_array_clear(thumbnail, nbucket);
  376|      0|        }
  377|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6Bucket11set_invalidEv:
  292|  66.5k|        void set_invalid() { next = (Bucket*)-1UL; }
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE5emptyEv:
  274|     64|    bool empty() const { return _size == 0; }
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE18is_default_bucketsEv:
  363|    128|    bool is_default_buckets() const {
  364|    128|        return _buckets == (Bucket*)(&_default_buckets);
  365|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE16init_load_factorEj:
  355|     64|    void init_load_factor(u_int load_factor) {
  356|     64|        if (_is_default_load_factor) {
  ------------------
  |  Branch (356:13): [True: 64, False: 0]
  ------------------
  357|     64|            _is_default_load_factor = false;
  358|     64|            _load_factor = load_factor;
  359|     64|        }
  360|     64|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE14is_too_crowdedEmmj:
  351|     64|    static bool is_too_crowded(size_t size, size_t nbucket, u_int load_factor) {
  352|     64|        return size * 100 >= nbucket * load_factor;
  353|     64|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoC2EPNSE_6BucketEPmm:
  327|     64|            : buckets(b), thumbnail(t), nbucket(n) {}
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6Bucket8is_validEv:
  291|  1.21k|        bool is_valid() const { return next != (const Bucket*)-1UL; }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6BucketC2ERKS6_:
  284|     31|        explicit Bucket(const _K& k) : next(NULL) {
  285|     31|            element_space_.Init(k);
  286|     31|        }
_ZN5butil14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEC2ERKS6_:
  486|     31|    explicit FlatMapElement(const K& k) : _key(k), _value(T()) {}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6Bucket7elementEv:
  294|     31|        Element& element() { return *element_space_; }
_ZN5butil14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEE10second_refEv:
  496|     31|    T& second_ref() { return _value; }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE13get_allocatorEv:
  344|     64|    allocator_type& get_allocator() { return _pool.get_allocator(); }

_ZN5butil11find_power2Em:
   45|     64|inline uint64_t find_power2(uint64_t b) {
   46|     64|    b -= 1;
   47|     64|    b |= (b >> 1);
   48|     64|    b |= (b >> 2);
   49|     64|    b |= (b >> 4);
   50|     64|    b |= (b >> 8);
   51|     64|    b |= (b >> 16);
   52|     64|    b |= (b >> 32);
   53|     64|    return b + 1;
   54|     64|}
_ZN5butil13flatmap_roundEm:
   61|     64|inline size_t flatmap_round(size_t nbucket) {
   62|       |#ifdef FLAT_MAP_ROUND_BUCKET_BY_USE_NEXT_PRIME    
   63|       |    return find_next_prime(nbucket);
   64|       |#else
   65|       |    // the lowerbound fixes the corner case of nbucket=0 which results in coredump during seeking the map.
   66|     64|    return nbucket <= 8 ? 8 : find_power2(nbucket);
  ------------------
  |  Branch (66:12): [True: 0, False: 64]
  ------------------
   67|     64|#endif
   68|     64|}
_ZN5butil11flatmap_modEmm:
   70|     62|inline size_t flatmap_mod(size_t hash_code, size_t nbucket) {
   71|       |#ifdef FLAT_MAP_ROUND_BUCKET_BY_USE_NEXT_PRIME
   72|       |    return hash_code % nbucket;
   73|       |#else
   74|     62|    return hash_code & (nbucket - 1);
   75|     62|#endif
   76|     62|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EEC2ERKSA_RKSC_RKSD_:
  221|     64|    : _size(0)
  222|     64|    , _nbucket(DEFAULT_NBUCKET)
  223|     64|    , _buckets((Bucket*)(&_default_buckets))
  224|     64|    , _thumbnail(_S ? _default_thumbnail : NULL)
  ------------------
  |  Branch (224:18): [Folded, False: 64]
  ------------------
  225|     64|    , _load_factor(80)
  226|     64|    , _is_default_load_factor(true)
  227|     64|    , _hashfn(hashfn)
  228|     64|    , _eql(eql)
  229|     64|    , _pool(alloc) {
  230|     64|    init_buckets_and_thumbnail(_buckets, _thumbnail, _nbucket);
  231|     64|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE4initEmj:
  320|     64|int FlatMap<_K, _T, _H, _E, _S, _A, _M>::init(size_t nbucket, u_int load_factor) {
  321|     64|    if (nbucket <= _nbucket || load_factor < 10 || load_factor > 100 ||
  ------------------
  |  Branch (321:9): [True: 0, False: 64]
  |  Branch (321:32): [True: 0, False: 64]
  |  Branch (321:52): [True: 0, False: 64]
  ------------------
  322|     64|        !_is_default_load_factor || !empty() || !is_default_buckets()) {
  ------------------
  |  Branch (322:9): [True: 0, False: 64]
  |  Branch (322:37): [True: 0, False: 64]
  |  Branch (322:49): [True: 0, False: 64]
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |
  326|     64|    init_load_factor(load_factor);
  327|     64|    return resize(nbucket) ? 0 : -1;
  ------------------
  |  Branch (327:12): [True: 64, False: 0]
  ------------------
  328|     64|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE6resizeEm:
  755|     64|bool FlatMap<_K, _T, _H, _E, _S, _A, _M>::resize(size_t nbucket) {
  756|     64|    optional<NewBucketsInfo> info = new_buckets_and_thumbnail(_size, nbucket);
  757|     64|    if (!info.has_value()) {
  ------------------
  |  Branch (757:9): [True: 0, False: 64]
  ------------------
  758|      0|        return false;
  759|      0|    }
  760|       |
  761|     64|    for (iterator it = begin(); it != end(); ++it) {
  ------------------
  |  Branch (761:33): [True: 0, False: 64]
  ------------------
  762|      0|        const key_type& key = Element::first_ref_from_value(*it);
  763|      0|        const size_t index = flatmap_mod(_hashfn(key), info->nbucket);
  764|      0|        Bucket& first_node = info->buckets[index];
  765|      0|        if (!first_node.is_valid()) {
  ------------------
  |  Branch (765:13): [True: 0, False: 0]
  ------------------
  766|      0|            if (_S) {
  ------------------
  |  Branch (766:17): [Folded, False: 0]
  ------------------
  767|      0|                bit_array_set(info->thumbnail, index);
  768|      0|            }
  769|      0|            new (&first_node) Bucket(key);
  770|      0|            first_node.element().second_ref() =
  771|      0|                Element::second_movable_ref_from_value(*it);
  772|      0|        } else {
  773|      0|            Bucket* newp = new (_pool.get()) Bucket(key);
  774|      0|            newp->element().second_ref() =
  775|      0|                Element::second_movable_ref_from_value(*it);
  776|      0|            newp->next = first_node.next;
  777|      0|            first_node.next = newp;
  778|      0|        }
  779|      0|    }
  780|     64|    size_t saved_size = _size;
  781|     64|    clear();
  782|     64|    if (!is_default_buckets()) {
  ------------------
  |  Branch (782:9): [True: 0, False: 64]
  ------------------
  783|      0|        get_allocator().Free(_buckets);
  784|      0|        if (_S) {
  ------------------
  |  Branch (784:13): [Folded, False: 0]
  ------------------
  785|      0|            bit_array_free(_thumbnail);
  786|      0|        }
  787|      0|    }
  788|     64|    _nbucket = info->nbucket;
  789|     64|    _buckets = info->buckets;
  790|     64|    _thumbnail = info->thumbnail;
  791|     64|    _size = saved_size;
  792|       |
  793|     64|    return true;
  794|     64|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmm:
  716|     64|                                                               size_t new_nbucket) {
  717|     64|    size_t bump = 0;
  718|     64|    do {
  719|       |        // The first iteration uses 'new_nbucket + 0' ensures that when new_nbucket is a power
  720|       |        // of 2 and is already sufficient to accommodate `size`, it does not need to be doubled.
  721|       |        // Subsequent use of 'new_nbucket + 1' avoids an infinite loop.
  722|     64|        new_nbucket = flatmap_round(new_nbucket + bump);
  723|     64|        bump = 1;
  724|     64|    } while (is_too_crowded(size, new_nbucket, _load_factor));
  ------------------
  |  Branch (724:14): [True: 0, False: 64]
  ------------------
  725|     64|    if (_nbucket == new_nbucket) {
  ------------------
  |  Branch (725:9): [True: 0, False: 64]
  ------------------
  726|      0|        return nullopt;
  727|      0|    }
  728|       |    // Note: need an extra bucket to let iterator know where buckets end.
  729|     64|    auto buckets = (Bucket*)get_allocator().Alloc(
  730|     64|        sizeof(Bucket) * (new_nbucket + 1/*note*/));
  731|     64|    auto guard = MakeScopeGuard([buckets, this]() {
  732|     64|        get_allocator().Free(buckets);
  733|     64|    });
  734|     64|    if (NULL == buckets) {
  ------------------
  |  Branch (734:9): [True: 0, False: 64]
  ------------------
  735|      0|        LOG(FATAL) << "Fail to new Buckets";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|      0|        return nullopt;
  737|      0|    }
  738|       |
  739|     64|    uint64_t* thumbnail = NULL;
  740|     64|    if (_S) {
  ------------------
  |  Branch (740:9): [Folded, False: 64]
  ------------------
  741|      0|        thumbnail = bit_array_malloc(new_nbucket);
  742|      0|        if (NULL == thumbnail) {
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      0|            LOG(FATAL) << "Fail to new thumbnail";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|            return nullopt;
  745|      0|        }
  746|      0|    }
  747|       |
  748|     64|    guard.dismiss();
  749|     64|    init_buckets_and_thumbnail(buckets, thumbnail, new_nbucket);
  750|     64|    return NewBucketsInfo{buckets, thumbnail, new_nbucket};
  751|     64|}
_ZNK5butil15FlatMapIteratorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EEESt4pairIKS7_S9_EEneERKSJ_:
  106|     64|    { return _node != rhs._node; }
_ZN5butil15FlatMapIteratorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EEESt4pairIKS7_S9_EE23find_and_set_valid_nodeEv:
  137|    128|    void find_and_set_valid_node() {
  138|  1.15k|        for (; !_entry->is_valid(); ++_entry);
  ------------------
  |  Branch (138:16): [True: 1.02k, False: 128]
  ------------------
  139|    128|        _node = _entry;
  140|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE5clearEv:
  512|     64|void FlatMap<_K, _T, _H, _E, _S, _A, _M>::clear() {
  513|     64|    if (0 == _size) {
  ------------------
  |  Branch (513:9): [True: 64, False: 0]
  ------------------
  514|     64|        return;
  515|     64|    }
  516|      0|    _size = 0;
  517|      0|    if (NULL != _buckets) {
  ------------------
  |  Branch (517:9): [True: 0, False: 0]
  ------------------
  518|      0|        for (size_t i = 0; i < _nbucket; ++i) {
  ------------------
  |  Branch (518:28): [True: 0, False: 0]
  ------------------
  519|      0|            Bucket& first_node = _buckets[i];
  520|      0|            if (first_node.is_valid()) {
  ------------------
  |  Branch (520:17): [True: 0, False: 0]
  ------------------
  521|      0|                first_node.destroy_element();
  522|      0|                Bucket* p = first_node.next;
  523|      0|                while (p) {
  ------------------
  |  Branch (523:24): [True: 0, False: 0]
  ------------------
  524|      0|                    Bucket* next_p = p->next;
  525|      0|                    p->destroy_element();
  526|      0|                    _pool.back(p);
  527|      0|                    p = next_p;
  528|      0|                }
  529|      0|                first_node.set_invalid();
  530|      0|            }
  531|      0|        }
  532|      0|    }
  533|      0|    if (NULL != _thumbnail) {
  ------------------
  |  Branch (533:9): [True: 0, False: 0]
  ------------------
  534|      0|        bit_array_clear(_thumbnail, _nbucket);
  535|      0|    }
  536|      0|}
_ZNK5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE4seekIS6_EEPS8_RKT_:
  548|     31|_T* FlatMap<_K, _T, _H, _E, _S, _A, _M>::seek(const K2& key) const {
  549|     31|    Bucket& first_node = _buckets[flatmap_mod(_hashfn(key), _nbucket)];
  550|     31|    if (!first_node.is_valid()) {
  ------------------
  |  Branch (550:9): [True: 31, False: 0]
  ------------------
  551|     31|        return NULL;
  552|     31|    }
  553|      0|    if (_eql(first_node.element().first_ref(), key)) {
  ------------------
  |  Branch (553:9): [True: 0, False: 0]
  ------------------
  554|      0|        return &first_node.element().second_ref();
  555|      0|    }
  556|      0|    Bucket *p = first_node.next;
  557|      0|    while (p) {
  ------------------
  |  Branch (557:12): [True: 0, False: 0]
  ------------------
  558|      0|        if (_eql(p->element().first_ref(), key)) {
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|            return &p->element().second_ref();
  560|      0|        }
  561|      0|        p = p->next;
  562|      0|    }
  563|      0|    return NULL;
  564|      0|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EEixILb0EEENSt9enable_ifIXntT_ERS8_E4typeERKS6_:
  592|     31|FlatMap<_K, _T, _H, _E, _S, _A, _M>::operator[](const key_type& key) {
  593|     31|    const size_t index = flatmap_mod(_hashfn(key), _nbucket);
  594|     31|    Bucket& first_node = _buckets[index];
  595|     31|    if (!first_node.is_valid()) {
  ------------------
  |  Branch (595:9): [True: 31, False: 0]
  ------------------
  596|     31|        ++_size;
  597|     31|        if (_S) {
  ------------------
  |  Branch (597:13): [Folded, False: 31]
  ------------------
  598|      0|            bit_array_set(_thumbnail, index);
  599|      0|        }
  600|     31|        new (&first_node) Bucket(key);
  601|     31|        return first_node.element().second_ref();
  602|     31|    }
  603|      0|    Bucket *p = &first_node;
  604|      0|    while (true) {
  ------------------
  |  Branch (604:12): [True: 0, Folded]
  ------------------
  605|      0|        if (_eql(p->element().first_ref(), key)) {
  ------------------
  |  Branch (605:13): [True: 0, False: 0]
  ------------------
  606|      0|            return p->element().second_ref();
  607|      0|        }
  608|      0|        if (NULL == p->next) {
  ------------------
  |  Branch (608:13): [True: 0, False: 0]
  ------------------
  609|      0|            if (is_too_crowded(_size) && resize(_nbucket + 1)) {
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  |  Branch (609:42): [True: 0, False: 0]
  ------------------
  610|      0|                return operator[](key);
  611|      0|            }
  612|       |            // Fail to resize is OK.
  613|      0|            ++_size;
  614|      0|            Bucket* newp = new (_pool.get()) Bucket(key);
  615|      0|            p->next = newp;
  616|      0|            return newp->element().second_ref();
  617|      0|        }
  618|      0|        p = p->next;
  619|      0|    }
  620|      0|}
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE5beginEv:
  820|     64|FlatMap<_K, _T, _H, _E, _S, _A, _M>::begin() {
  821|     64|    return iterator(this, 0);
  822|     64|}
_ZN5butil15FlatMapIteratorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EEESt4pairIKS7_S9_EEC2EPKSF_m:
   92|    128|    FlatMapIterator(const Map* map, size_t pos) {
   93|    128|        _entry = map->_buckets + pos;
   94|    128|        find_and_set_valid_node();
   95|    128|    }
_ZN5butil7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS6_EENS_14DefaultEqualToIS6_EELb0ENS_11PtAllocatorELb0EE3endEv:
  827|     64|FlatMap<_K, _T, _H, _E, _S, _A, _M>::end() {
  828|     64|    return iterator(this, _nbucket);
  829|     64|}

_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEE4headEv:
  179|      8|  LinkNode<T>* head() const {
  180|      8|    return root_.next();
  181|      8|  }
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEE3endEv:
  187|      9|  const LinkNode<T>* end() const {
  188|      9|    return &root_;
  189|      9|  }
_ZNK5butil8LinkNodeIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEE4nextEv:
  141|      9|  LinkNode<T>* next() const {
  142|      9|    return next_;
  143|      9|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEE5valueEv:
  150|      1|  T* value() {
  151|      1|    return static_cast<T*>(this);
  152|      1|  }
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIiiNS2_5AddToIiEEE5AgentEE4headEv:
  179|      2|  LinkNode<T>* head() const {
  180|      2|    return root_.next();
  181|      2|  }
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIiiNS2_5AddToIiEEE5AgentEE3endEv:
  187|      2|  const LinkNode<T>* end() const {
  188|      2|    return &root_;
  189|      2|  }
_ZNK5butil8LinkNodeIN4bvar6detail13AgentCombinerIiiNS2_5AddToIiEEE5AgentEE4nextEv:
  141|      2|  LinkNode<T>* next() const {
  142|      2|    return next_;
  143|      2|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEEC2Ev:
   88|    108|  LinkNode() : previous_(this), next_(this) {}
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEE6AppendEPNS_8LinkNodeIS7_EE:
  170|      1|  void Append(LinkNode<T>* e) {
  171|      1|    e->InsertBefore(&root_);
  172|      1|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEE12InsertBeforeEPS8_:
   94|      1|  void InsertBefore(LinkNode<T>* e) {
   95|      1|    this->next_ = e;
   96|      1|    this->previous_ = e->previous_;
   97|      1|    e->previous_->next_ = this;
   98|      1|    e->previous_ = this;
   99|      1|  }
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIllNS2_5AddToIlEEE5AgentEEC2Ev:
  167|      5|  LinkedList() {}
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIiiNS2_5AddToIiEEE5AgentEEC2Ev:
  167|      1|  LinkedList() {}
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIiiNS2_5AddToIiEEE5AgentEEC2Ev:
   88|      1|  LinkNode() : previous_(this), next_(this) {}
_ZN5butil8LinkNodeIN4bvar6detail7SamplerEE18InsertBeforeAsListEPS4_:
  102|     20|  void InsertBeforeAsList(LinkNode<T>* e) {
  103|     20|    LinkNode<T>* prev = this->previous_;
  104|     20|    prev->next_ = e;
  105|     20|    this->previous_ = e->previous_;
  106|     20|    e->previous_->next_ = this;
  107|     20|    e->previous_ = prev;
  108|     20|  }
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEEC2Ev:
  167|      2|  LinkedList() {}
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEEC2Ev:
   88|    106|  LinkNode() : previous_(this), next_(this) {}
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE4headEv:
  179|      2|  LinkNode<T>* head() const {
  180|      2|    return root_.next();
  181|      2|  }
_ZNK5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE3endEv:
  187|      4|  const LinkNode<T>* end() const {
  188|      4|    return &root_;
  189|      4|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE5valueEv:
  150|      2|  T* value() {
  151|      2|    return static_cast<T*>(this);
  152|      2|  }
_ZNK5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE4nextEv:
  141|      4|  LinkNode<T>* next() const {
  142|      4|    return next_;
  143|      4|  }
_ZN5butil8LinkNodeIN4bvar6detail7SamplerEEC2Ev:
   88|     22|  LinkNode() : previous_(this), next_(this) {}
_ZNK5butil8LinkNodeIN4bvar6detail7SamplerEE4nextEv:
  141|     22|  LinkNode<T>* next() const {
  142|     22|    return next_;
  143|     22|  }
_ZN5butil8LinkNodeIN4bvar6detail7SamplerEE5valueEv:
  150|     20|  T* value() {
  151|     20|    return static_cast<T*>(this);
  152|     20|  }
_ZN5butil10LinkedListIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE6AppendEPNS_8LinkNodeIS8_EE:
  170|      2|  void Append(LinkNode<T>* e) {
  171|      2|    e->InsertBefore(&root_);
  172|      2|  }
_ZN5butil8LinkNodeIN4bvar6detail13AgentCombinerIPNS2_7SamplerES5_NS2_14CombineSamplerEE5AgentEE12InsertBeforeEPS9_:
   94|      2|  void InsertBefore(LinkNode<T>* e) {
   95|      2|    this->next_ = e;
   96|      2|    this->previous_ = e->previous_;
   97|      2|    e->previous_->next_ = this;
   98|      2|    e->previous_ = this;
   99|      2|  }
_ZN5butil8LinkNodeIN7bthread11ButexWaiterEEC2Ev:
   88|      3|  LinkNode() : previous_(this), next_(this) {}
_ZN5butil10LinkedListIN7bthread11ButexWaiterEEC2Ev:
  167|      3|  LinkedList() {}

_ZN5butil9nullopt_tC2ENS_8internal20optional_forbidden_tE:
   59|    218|    explicit nullopt_t(internal::optional_forbidden_t) noexcept {}
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEEC2EOSG_:
  198|     64|    optional(T&& value) : _engaged(true) {
  199|     64|        _storage.Init(std::move(value));
  200|     64|    }
_ZNK5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE9has_valueEv:
  309|     64|    bool has_value() const { return _engaged; }
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEEptEv:
  300|    192|    T* operator->() {
  301|    192|        return _storage.get();
  302|    192|    }
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEED2Ev:
  233|     64|    ~optional() {
  234|     64|        reset();
  235|     64|    }
_ZN5butil8optionalINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE5resetEv:
  377|     64|    void reset() {
  378|     64|        if (_engaged) {
  ------------------
  |  Branch (378:13): [True: 64, False: 0]
  ------------------
  379|     64|            _storage.Destroy();
  380|     64|            _engaged = false;
  381|     64|        }
  382|     64|    }

_ZN5butil5debug10StackTraceC2Eb:
  766|      2|StackTrace::StackTrace(bool exclude_self) {
  767|       |  // NOTE: This code MUST be async-signal safe (it's used by in-process
  768|       |  // stack dumping signal handler). NO malloc or stdio is allowed here.
  769|       |
  770|      2|  if (GetStackTrace) {
  ------------------
  |  Branch (770:7): [True: 0, False: 2]
  ------------------
  771|      0|    count_ = GetStackTrace(trace_, arraysize(trace_), exclude_self ? 1 : 0);
  ------------------
  |  |  122|      0|#define arraysize(array) (sizeof(::butil::ArraySizeHelper(array)))
  ------------------
  |  Branch (771:55): [True: 0, False: 0]
  ------------------
  772|      2|  } else {
  773|      2|#if !defined(__UCLIBC__)
  774|       |    // Though the backtrace API man page does not list any possible negative
  775|       |    // return values, we take no chance.
  776|      2|    count_ = butil::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
  ------------------
  |  |  122|      2|#define arraysize(array) (sizeof(::butil::ArraySizeHelper(array)))
  ------------------
  777|      2|    if (exclude_self && count_ > 1) {
  ------------------
  |  Branch (777:9): [True: 0, False: 2]
  |  Branch (777:25): [True: 0, False: 0]
  ------------------
  778|       |      // Skip the top frame.
  779|      0|      memmove(trace_, trace_ + 1, (count_ - 1) * sizeof(void*));
  780|      0|      count_--;
  781|      0|    }
  782|       |#else
  783|       |    count_ = 0;
  784|       |#endif
  785|      2|  }
  786|      2|}

_ZN5butil7details16ExtendedEndPoint11is_extendedERKNS_8EndPointE:
  224|     10|    static bool is_extended(const butil::EndPoint& ep) {
  225|     10|        return ep.port == EXTENDED_ENDPOINT_PORT;
  226|     10|    }

_ZN5butil8EndPoint5resetEv:
   84|      6|void EndPoint::reset(void) {
   85|      6|    if (ExtendedEndPoint::is_extended(*this)) {
  ------------------
  |  Branch (85:9): [True: 0, False: 6]
  ------------------
   86|      0|        ExtendedEndPoint* eep = ExtendedEndPoint::address(*this);
   87|      0|        if (eep) {
  ------------------
  |  Branch (87:13): [True: 0, False: 0]
  ------------------
   88|      0|            eep->dec_ref();
   89|      0|        }
   90|      0|    }
   91|      6|    ip = IP_ANY;
   92|      6|    port = 0;
   93|      6|}
_ZN5butil8EndPointC2E7in_addri:
   95|      1|EndPoint::EndPoint(ip_t ip2, int port2) : ip(ip2), port(port2) {
   96|       |    // Should never construct an extended endpoint by this way
   97|      1|    if (ExtendedEndPoint::is_extended(*this)) {
  ------------------
  |  Branch (97:9): [True: 0, False: 1]
  ------------------
   98|      0|        CHECK(0) << "EndPoint construct with value that points to an extended EndPoint";
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
   99|      0|        ip = IP_ANY;
  100|      0|        port = 0;
  101|      0|    }
  102|      1|}
_ZN5butil8EndPointD2Ev:
  108|      3|EndPoint::~EndPoint() {
  109|      3|    reset();
  110|      3|}
_ZN5butil8EndPointaSERKS0_:
  112|      3|void EndPoint::operator=(const EndPoint& rhs) {
  113|      3|    reset();
  114|      3|    set_endpoint(this, rhs.ip, rhs.port);
  115|      3|}
_ZN5butil6str2ipEPKcP7in_addr:
  117|      2|int str2ip(const char* ip_str, ip_t* ip) {
  118|       |    // ip_str can be NULL when called by EndPoint(0, ...)
  119|      2|    if (ip_str != NULL) {
  ------------------
  |  Branch (119:9): [True: 2, False: 0]
  ------------------
  120|      2|        for (; isspace(*ip_str); ++ip_str);
  ------------------
  |  Branch (120:16): [True: 0, False: 2]
  ------------------
  121|      2|        int rc = inet_pton(AF_INET, ip_str, ip);
  122|      2|        if (rc > 0) {
  ------------------
  |  Branch (122:13): [True: 2, False: 0]
  ------------------
  123|      2|            return 0;
  124|      2|        }
  125|      2|    }
  126|      0|    return -1;
  127|      2|}
endpoint.cpp:_ZN5butilL12set_endpointEPNS_8EndPointE7in_addri:
   70|      3|static void set_endpoint(EndPoint* ep, ip_t ip, int port) {
   71|      3|    ep->ip = ip;
   72|      3|    ep->port = port;
   73|      3|    if (ExtendedEndPoint::is_extended(*ep)) {
  ------------------
  |  Branch (73:9): [True: 0, False: 3]
  ------------------
   74|      0|        ExtendedEndPoint* eep = ExtendedEndPoint::address(*ep);
   75|      0|        if (eep) {
  ------------------
  |  Branch (75:13): [True: 0, False: 0]
  ------------------
   76|      0|            eep->inc_ref();
   77|      0|        } else {
   78|      0|            ep->ip = IP_ANY;
   79|      0|            ep->port = 0;
   80|      0|        }
   81|      0|    }
   82|      3|}

_ZN5butil8EndPointC2Ev:
   88|      4|    EndPoint() : ip(IP_ANY), port(0) {}

_ZN5butil23DescribeCustomizedErrnoEiPKcS1_:
   40|     50|    int error_code, const char* error_name, const char* description) {
   41|     50|    BAIDU_SCOPED_LOCK(modify_desc_mutex);
  ------------------
  |  |   47|     50|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|     50|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|     50|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|     50|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|     50|    if (error_code < ERRNO_BEGIN || error_code >= ERRNO_END) {
  ------------------
  |  Branch (42:9): [True: 0, False: 50]
  |  Branch (42:37): [True: 0, False: 50]
  ------------------
   43|       |        // error() is a non-portable GNU extension that should not be used.
   44|      0|        fprintf(stderr, "Fail to define %s(%d) which is out of range, abort.",
   45|      0|              error_name, error_code);
   46|      0|        _exit(1);
   47|      0|    }
   48|     50|    const char* desc = errno_desc[error_code - ERRNO_BEGIN];
   49|     50|    if (desc) {
  ------------------
  |  Branch (49:9): [True: 0, False: 50]
  ------------------
   50|      0|        if (strcmp(desc, description) == 0) {
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|            fprintf(stderr, "WARNING: Detected shared library loading\n");
   52|      0|            return -1;
   53|      0|        }
   54|     50|    } else {
   55|       |#if defined(OS_MACOSX)
   56|       |        const int rc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE);
   57|       |        if (rc != EINVAL)
   58|       |#else
   59|     50|        desc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE);
   60|     50|        if (desc && strncmp(desc, "Unknown error", 13) != 0)
  ------------------
  |  Branch (60:13): [True: 50, False: 0]
  |  Branch (60:21): [True: 0, False: 50]
  ------------------
   61|      0|#endif
   62|      0|        {
   63|      0|            fprintf(stderr, "WARNING: Fail to define %s(%d) which is already defined as `%s'",
   64|      0|                    error_name, error_code, desc);
   65|      0|        }
   66|     50|    }
   67|     50|    errno_desc[error_code - ERRNO_BEGIN] = description;
   68|     50|    return 0;  // must
   69|     50|}

_ZN5butil5IOBuf35_push_or_move_back_ref_to_smallviewILb1EEEvRKNS0_8BlockRefE:
  472|     55|void IOBuf::_push_or_move_back_ref_to_smallview(const BlockRef& r) {
  473|     55|    BlockRef* const refs = _sv.refs;
  474|     55|    if (NULL == refs[0].block) {
  ------------------
  |  Branch (474:9): [True: 54, False: 1]
  ------------------
  475|     54|        refs[0] = r;
  476|     54|        if (!MOVE) {
  ------------------
  |  Branch (476:13): [Folded, False: 54]
  ------------------
  477|      0|            r.block->inc_ref();
  478|      0|        }
  479|     54|        return;
  480|     54|    }
  481|      1|    if (NULL == refs[1].block) {
  ------------------
  |  Branch (481:9): [True: 1, False: 0]
  ------------------
  482|      1|        if (refs[0].block == r.block &&
  ------------------
  |  Branch (482:13): [True: 0, False: 1]
  ------------------
  483|      0|            refs[0].offset + refs[0].length == r.offset) { // Merge ref
  ------------------
  |  Branch (483:13): [True: 0, False: 0]
  ------------------
  484|      0|            refs[0].length += r.length;
  485|      0|            if (MOVE) {
  ------------------
  |  Branch (485:17): [True: 0, Folded]
  ------------------
  486|      0|                r.block->dec_ref();
  487|      0|            }
  488|      0|            return;
  489|      0|        }
  490|      1|        refs[1] = r;
  491|      1|        if (!MOVE) {
  ------------------
  |  Branch (491:13): [Folded, False: 1]
  ------------------
  492|      0|            r.block->inc_ref();
  493|      0|        }
  494|      1|        return;
  495|      1|    }
  496|      0|    if (refs[1].block == r.block &&
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|        refs[1].offset + refs[1].length == r.offset) { // Merge ref
  ------------------
  |  Branch (497:9): [True: 0, False: 0]
  ------------------
  498|      0|        refs[1].length += r.length;
  499|      0|        if (MOVE) {
  ------------------
  |  Branch (499:13): [True: 0, Folded]
  ------------------
  500|      0|            r.block->dec_ref();
  501|      0|        }
  502|      0|        return;
  503|      0|    }
  504|       |    // Convert to BigView
  505|      0|    BlockRef* new_refs = iobuf::acquire_blockref_array();
  506|      0|    new_refs[0] = refs[0];
  507|      0|    new_refs[1] = refs[1];
  508|      0|    new_refs[2] = r;
  509|      0|    const size_t new_nbytes = refs[0].length + refs[1].length + r.length;
  510|      0|    if (!MOVE) {
  ------------------
  |  Branch (510:9): [Folded, False: 0]
  ------------------
  511|      0|        r.block->inc_ref();
  512|      0|    }
  513|      0|    _bv.magic = -1;
  514|      0|    _bv.start = 0;
  515|      0|    _bv.refs = new_refs;
  516|      0|    _bv.nref = 3;
  517|      0|    _bv.cap_mask = INITIAL_CAP - 1;
  518|      0|    _bv.nbytes = new_nbytes;
  519|      0|}
_ZN5butil5IOBuf35_push_or_move_back_ref_to_smallviewILb0EEEvRKNS0_8BlockRefE:
  472|    422|void IOBuf::_push_or_move_back_ref_to_smallview(const BlockRef& r) {
  473|    422|    BlockRef* const refs = _sv.refs;
  474|    422|    if (NULL == refs[0].block) {
  ------------------
  |  Branch (474:9): [True: 415, False: 7]
  ------------------
  475|    415|        refs[0] = r;
  476|    415|        if (!MOVE) {
  ------------------
  |  Branch (476:13): [True: 415, Folded]
  ------------------
  477|    415|            r.block->inc_ref();
  478|    415|        }
  479|    415|        return;
  480|    415|    }
  481|      7|    if (NULL == refs[1].block) {
  ------------------
  |  Branch (481:9): [True: 7, False: 0]
  ------------------
  482|      7|        if (refs[0].block == r.block &&
  ------------------
  |  Branch (482:13): [True: 0, False: 7]
  ------------------
  483|      0|            refs[0].offset + refs[0].length == r.offset) { // Merge ref
  ------------------
  |  Branch (483:13): [True: 0, False: 0]
  ------------------
  484|      0|            refs[0].length += r.length;
  485|      0|            if (MOVE) {
  ------------------
  |  Branch (485:17): [Folded, False: 0]
  ------------------
  486|      0|                r.block->dec_ref();
  487|      0|            }
  488|      0|            return;
  489|      0|        }
  490|      7|        refs[1] = r;
  491|      7|        if (!MOVE) {
  ------------------
  |  Branch (491:13): [True: 7, Folded]
  ------------------
  492|      7|            r.block->inc_ref();
  493|      7|        }
  494|      7|        return;
  495|      7|    }
  496|      0|    if (refs[1].block == r.block &&
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|        refs[1].offset + refs[1].length == r.offset) { // Merge ref
  ------------------
  |  Branch (497:9): [True: 0, False: 0]
  ------------------
  498|      0|        refs[1].length += r.length;
  499|      0|        if (MOVE) {
  ------------------
  |  Branch (499:13): [Folded, False: 0]
  ------------------
  500|      0|            r.block->dec_ref();
  501|      0|        }
  502|      0|        return;
  503|      0|    }
  504|       |    // Convert to BigView
  505|      0|    BlockRef* new_refs = iobuf::acquire_blockref_array();
  506|      0|    new_refs[0] = refs[0];
  507|      0|    new_refs[1] = refs[1];
  508|      0|    new_refs[2] = r;
  509|      0|    const size_t new_nbytes = refs[0].length + refs[1].length + r.length;
  510|      0|    if (!MOVE) {
  ------------------
  |  Branch (510:9): [True: 0, Folded]
  ------------------
  511|      0|        r.block->inc_ref();
  512|      0|    }
  513|      0|    _bv.magic = -1;
  514|      0|    _bv.start = 0;
  515|      0|    _bv.refs = new_refs;
  516|      0|    _bv.nref = 3;
  517|      0|    _bv.cap_mask = INITIAL_CAP - 1;
  518|      0|    _bv.nbytes = new_nbytes;
  519|      0|}
_ZN5butil5IOBuf25_pop_or_moveout_front_refILb1EEEiv:
  568|     55|int IOBuf::_pop_or_moveout_front_ref() {
  569|     55|    if (_small()) {
  ------------------
  |  Branch (569:9): [True: 55, False: 0]
  ------------------
  570|     55|        if (_sv.refs[0].block != NULL) {
  ------------------
  |  Branch (570:13): [True: 55, False: 0]
  ------------------
  571|     55|            if (!MOVEOUT) {
  ------------------
  |  Branch (571:17): [Folded, False: 55]
  ------------------
  572|      0|                _sv.refs[0].block->dec_ref();
  573|      0|            }
  574|     55|            _sv.refs[0] = _sv.refs[1];
  575|     55|            reset_block_ref(_sv.refs[1]);
  576|     55|            return 0;
  577|     55|        }
  578|      0|        return -1;
  579|     55|    } else {
  580|       |        // _bv.nref must be greater than 2
  581|      0|        const uint32_t start = _bv.start;
  582|      0|        if (!MOVEOUT) {
  ------------------
  |  Branch (582:13): [Folded, False: 0]
  ------------------
  583|      0|            _bv.refs[start].block->dec_ref();
  584|      0|        }
  585|      0|        if (--_bv.nref > 2) {
  ------------------
  |  Branch (585:13): [True: 0, False: 0]
  ------------------
  586|      0|            _bv.start = (start + 1) & _bv.cap_mask;
  587|      0|            _bv.nbytes -= _bv.refs[start].length;
  588|      0|        } else {  // count==2, fall back to SmallView
  589|      0|            BlockRef* const saved_refs = _bv.refs;
  590|      0|            const uint32_t saved_cap_mask = _bv.cap_mask;
  591|      0|            _sv.refs[0] = saved_refs[(start + 1) & saved_cap_mask];
  592|      0|            _sv.refs[1] = saved_refs[(start + 2) & saved_cap_mask];
  593|      0|            iobuf::release_blockref_array(saved_refs, saved_cap_mask + 1);
  594|      0|        }
  595|      0|        return 0;
  596|      0|    }
  597|     55|}
_ZN5butil19GetDefaultBlockSizeEv:
   49|      6|size_t GetDefaultBlockSize() {
   50|      6|    return default_block_size;
   51|      6|}
_ZN5butil5iobuf2cpEPvPKvm:
  182|    604|void* cp(void *__restrict dest, const void *__restrict src, size_t n) {
  183|       |    // memcpy in gcc 4.8 seems to be faster enough.
  184|    604|    return memcpy(dest, src, n);
  185|    604|}
_ZN5butil5iobuf12inc_g_nblockEv:
  206|      6|void inc_g_nblock() {
  207|      6|    g_nblock.fetch_add(1, butil::memory_order_relaxed);
  208|      6|}
_ZN5butil5iobuf14inc_g_blockmemEv:
  213|      6|void inc_g_blockmem() {
  214|      6|    g_blockmem.fetch_add(1, butil::memory_order_relaxed);
  215|      6|}
_ZN5butil5iobuf15share_tls_blockEv:
  312|    304|IOBuf::Block* share_tls_block() {
  313|    304|    TLSData& tls_data = g_tls_data;
  314|    304|    IOBuf::Block* const b = tls_data.block_head;
  315|    304|    if (b != NULL && !b->full()) {
  ------------------
  |  Branch (315:9): [True: 303, False: 1]
  |  Branch (315:22): [True: 298, False: 5]
  ------------------
  316|    298|        return b;
  317|    298|    }
  318|      6|    IOBuf::Block* new_block = NULL;
  319|      6|    if (b) {
  ------------------
  |  Branch (319:9): [True: 5, False: 1]
  ------------------
  320|      5|        new_block = b;
  321|     10|        while (new_block && new_block->full()) {
  ------------------
  |  Branch (321:16): [True: 5, False: 5]
  |  Branch (321:29): [True: 5, False: 0]
  ------------------
  322|      5|            IOBuf::Block* const saved_next = new_block->u.portal_next;
  323|      5|            new_block->dec_ref();
  324|      5|            --tls_data.num_blocks;
  325|      5|            new_block = saved_next;
  326|      5|        }
  327|      5|    } else if (!tls_data.registered) {
  ------------------
  |  Branch (327:16): [True: 1, False: 0]
  ------------------
  328|      1|        tls_data.registered = true;
  329|       |        // Only register atexit at the first time
  330|      1|        butil::thread_atexit(remove_tls_block_chain);
  331|      1|    }
  332|      6|    if (!new_block) {
  ------------------
  |  Branch (332:9): [True: 6, False: 0]
  ------------------
  333|      6|        new_block = create_block(); // may be NULL
  334|      6|        if (new_block) {
  ------------------
  |  Branch (334:13): [True: 6, False: 0]
  ------------------
  335|      6|            ++tls_data.num_blocks;
  336|      6|        }
  337|      6|    }
  338|      6|    tls_data.block_head = new_block;
  339|      6|    return new_block;
  340|    304|}
_ZN5butil5IOBuf5clearEv:
  632|    299|void IOBuf::clear() {
  633|    299|    if (_small()) {
  ------------------
  |  Branch (633:9): [True: 299, False: 0]
  ------------------
  634|    299|        if (_sv.refs[0].block != NULL) {
  ------------------
  |  Branch (634:13): [True: 247, False: 52]
  ------------------
  635|    247|            _sv.refs[0].block->dec_ref();
  636|    247|            reset_block_ref(_sv.refs[0]);
  637|       |                        
  638|    247|            if (_sv.refs[1].block != NULL) {
  ------------------
  |  Branch (638:17): [True: 2, False: 245]
  ------------------
  639|      2|                _sv.refs[1].block->dec_ref();
  640|      2|                reset_block_ref(_sv.refs[1]);
  641|      2|            }
  642|    247|        }
  643|    299|    } else {
  644|      0|        for (uint32_t i = 0; i < _bv.nref; ++i) { 
  ------------------
  |  Branch (644:30): [True: 0, False: 0]
  ------------------
  645|      0|            _bv.ref_at(i).block->dec_ref();
  646|      0|        }
  647|      0|        iobuf::release_blockref_array(_bv.refs, _bv.capacity());
  648|      0|        new (this) IOBuf;
  649|      0|    }
  650|    299|}
_ZN5butil5IOBuf4cutnEPS0_m:
  715|    216|size_t IOBuf::cutn(IOBuf* out, size_t n) {
  716|    216|    const size_t len = length();
  717|    216|    if (n > len) {
  ------------------
  |  Branch (717:9): [True: 0, False: 216]
  ------------------
  718|      0|        n = len;
  719|      0|    }
  720|    216|    const size_t saved_n = n;
  721|    271|    while (n) {   // length() == 0 does not enter
  ------------------
  |  Branch (721:12): [True: 173, False: 98]
  ------------------
  722|    173|        IOBuf::BlockRef &r = _front_ref();
  723|    173|        if (r.length <= n) {
  ------------------
  |  Branch (723:13): [True: 55, False: 118]
  ------------------
  724|     55|            n -= r.length;
  725|     55|            out->_move_back_ref(r);
  726|     55|            _moveout_front_ref();
  727|    118|        } else {
  728|    118|            const IOBuf::BlockRef cr = { r.offset, (uint32_t)n, r.block };
  729|    118|            out->_push_back_ref(cr);
  730|       |            
  731|    118|            r.offset += n;
  732|    118|            r.length -= n;
  733|    118|            if (!_small()) {
  ------------------
  |  Branch (733:17): [True: 0, False: 118]
  ------------------
  734|      0|                _bv.nbytes -= n;
  735|      0|            }
  736|    118|            return saved_n;
  737|    118|        }
  738|    173|    }
  739|     98|    return saved_n;
  740|    216|}
_ZN5butil5IOBuf6appendEPKvm:
 1088|    299|int IOBuf::append(void const* data, size_t count) {
 1089|    299|    if (BAIDU_UNLIKELY(!data)) {
  ------------------
  |  |  272|    299|#    define BAIDU_UNLIKELY(expr) (__builtin_expect((bool)(expr), false))
  |  |  ------------------
  |  |  |  Branch (272:34): [True: 0, False: 299]
  |  |  ------------------
  ------------------
 1090|      0|        return -1;
 1091|      0|    }
 1092|    299|    if (count == 1) {
  ------------------
  |  Branch (1092:9): [True: 0, False: 299]
  ------------------
 1093|      0|        return push_back(*((char const*)data));
 1094|      0|    }
 1095|    299|    size_t total_nc = 0;
 1096|    603|    while (total_nc < count) {  // excluded count == 0
  ------------------
  |  Branch (1096:12): [True: 304, False: 299]
  ------------------
 1097|    304|        IOBuf::Block* b = iobuf::share_tls_block();
 1098|    304|        if (BAIDU_UNLIKELY(!b)) {
  ------------------
  |  |  272|    304|#    define BAIDU_UNLIKELY(expr) (__builtin_expect((bool)(expr), false))
  |  |  ------------------
  |  |  |  Branch (272:34): [True: 0, False: 304]
  |  |  ------------------
  ------------------
 1099|      0|            return -1;
 1100|      0|        }
 1101|    304|        const size_t nc = std::min(count - total_nc, b->left_space());
 1102|    304|        iobuf::cp(b->data + b->size, (char*)data + total_nc, nc);
 1103|       |        
 1104|    304|        const IOBuf::BlockRef r = { (uint32_t)b->size, (uint32_t)nc, b };
 1105|    304|        _push_back_ref(r);
 1106|    304|        b->size += nc;
 1107|    304|        total_nc += nc;
 1108|    304|    }
 1109|    299|    return 0;
 1110|    299|}
_ZNK5butil5IOBuf7copy_toEPvmm:
 1312|    299|size_t IOBuf::copy_to(void* d, size_t n, size_t pos) const {
 1313|    299|    const size_t nref = _ref_num();
 1314|       |    // Skip `pos' bytes. `offset' is the starting position in starting BlockRef.
 1315|    299|    size_t offset = pos;
 1316|    299|    size_t i = 0;
 1317|    299|    for (; offset != 0 && i < nref; ++i) {
  ------------------
  |  Branch (1317:12): [True: 0, False: 299]
  |  Branch (1317:27): [True: 0, False: 0]
  ------------------
 1318|      0|        IOBuf::BlockRef const& r = _ref_at(i);
 1319|      0|        if (offset < (size_t)r.length) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 0]
  ------------------
 1320|      0|            break;
 1321|      0|        }
 1322|      0|        offset -= r.length;
 1323|      0|    }
 1324|    299|    size_t m = n;
 1325|    599|    for (; m != 0 && i < nref; ++i) {
  ------------------
  |  Branch (1325:12): [True: 414, False: 185]
  |  Branch (1325:22): [True: 300, False: 114]
  ------------------
 1326|    300|        IOBuf::BlockRef const& r = _ref_at(i);
 1327|    300|        const size_t nc = std::min(m, (size_t)r.length - offset);
 1328|    300|        iobuf::cp(d, r.block->data + r.offset + offset, nc);
 1329|    300|        offset = 0;
 1330|    300|        d = (char*)d + nc;
 1331|    300|        m -= nc;
 1332|    300|    }
 1333|       |    // If nref == 0, here returns 0 correctly
 1334|    299|    return n - m;
 1335|    299|}

_ZN5butil5IOBufD2Ev:
  124|    299|    ~IOBuf() { clear(); }
_ZN5butil5IOBuf18_moveout_front_refEv:
  402|     55|    int _moveout_front_ref() { return _pop_or_moveout_front_ref<true>(); }
_ZN5butil8IOPortalC2Ev:
  457|      1|    IOPortal() : _block(NULL) { }

_ZN5butil5IOBufC2Ev:
   77|    534|inline IOBuf::IOBuf() {
   78|    534|    reset_block_ref(_sv.refs[0]);
   79|    534|    reset_block_ref(_sv.refs[1]);
   80|    534|}
_ZN5butil15reset_block_refERNS_5IOBuf8BlockRefE:
   71|  1.37k|inline void reset_block_ref(IOBuf::BlockRef& ref) {
   72|  1.37k|    ref.offset = 0;
   73|  1.37k|    ref.length = 0;
   74|       |    ref.block = NULL;
   75|  1.37k|}
_ZN5butil5IOBuf6appendERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  130|    299|inline int IOBuf::append(const std::string& s) {
  131|    299|    return append(s.data(), s.length());
  132|    299|}
_ZN5butil5IOBuf5BlockC2EPcj:
  481|      6|        : nshared(1)
  482|      6|        , flags(0)
  483|      6|        , abi_check(0)
  484|      6|        , size(0)
  485|      6|        , cap(data_size)
  486|      6|        , u({NULL})
  487|      6|        , data(data_in) {
  488|      6|        iobuf::inc_g_nblock();
  489|      6|        iobuf::inc_g_blockmem();
  490|      6|        if (is_samplable()) {
  ------------------
  |  Branch (490:13): [True: 0, False: 6]
  ------------------
  491|      0|            SubmitIOBufSample(this, 1);
  492|      0|        }
  493|      6|    }
_ZN5butil5IOBuf5Block9check_abiEv:
  516|    676|    inline void check_abi() {
  517|    676|#ifndef NDEBUG
  518|    676|    if (abi_check != 0) {
  ------------------
  |  Branch (518:9): [True: 0, False: 676]
  ------------------
  519|      0|        LOG(FATAL) << "Your program seems to wrongly contain two "
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|      0|            "ABI-incompatible implementations of IOBuf";
  521|      0|    }
  522|    676|#endif
  523|    676|}
_ZN5butil5IOBuf5Block7inc_refEv:
  525|    422|    void inc_ref() {
  526|    422|        check_abi();
  527|    422|        nshared.fetch_add(1, butil::memory_order_relaxed);
  528|    422|        if (sampled()) {
  ------------------
  |  Branch (528:13): [True: 0, False: 422]
  ------------------
  529|      0|            SubmitIOBufSample(this, 1);
  530|      0|        }
  531|    422|    }
_ZN5butil5IOBuf5Block7dec_refEv:
  533|    254|    void dec_ref() {
  534|    254|        check_abi();
  535|    254|        if (sampled()) {
  ------------------
  |  Branch (535:13): [True: 0, False: 254]
  ------------------
  536|      0|            SubmitIOBufSample(this, -1);
  537|      0|        }
  538|    254|        if (nshared.fetch_sub(1, butil::memory_order_release) == 1) {
  ------------------
  |  Branch (538:13): [True: 0, False: 254]
  ------------------
  539|      0|            butil::atomic_thread_fence(butil::memory_order_acquire);
  540|      0|            if (!is_user_data()) {
  ------------------
  |  Branch (540:17): [True: 0, False: 0]
  ------------------
  541|      0|                iobuf::dec_g_nblock();
  542|      0|                iobuf::dec_g_blockmem();
  543|      0|                this->~Block();
  544|      0|                iobuf::blockmem_deallocate(this);
  545|      0|            } else if (flags & IOBUF_BLOCK_FLAGS_USER_DATA) {
  ------------------
  |  Branch (545:24): [True: 0, False: 0]
  ------------------
  546|      0|                auto ext = get_user_data_extension();
  547|      0|                ext->deleter(data);
  548|      0|                ext->~UserDataExtension();
  549|      0|                this->~Block();
  550|      0|                free(this);
  551|      0|            }
  552|      0|        }
  553|    254|    }
_ZNK5butil5IOBuf5Block4fullEv:
  559|    308|    bool full() const { return size >= cap; }
_ZNK5butil5IOBuf5Block10left_spaceEv:
  560|    304|    size_t left_space() const { return cap - size; }
_ZN5butil5IOBuf5Block12is_samplableEv:
  563|      6|    bool is_samplable() {
  564|      6|        if (IsIOBufProfilerSamplable()) {
  ------------------
  |  Branch (564:13): [True: 0, False: 6]
  ------------------
  565|      0|            flags |= IOBUF_BLOCK_FLAGS_SAMPLED;
  566|      0|            return true;
  567|      0|        }
  568|      6|        return false;
  569|      6|    }
_ZNK5butil5IOBuf5Block7sampledEv:
  571|    676|    bool sampled() const {
  572|    676|        return flags & IOBUF_BLOCK_FLAGS_SAMPLED;
  573|    676|    }
_ZNK5butil5IOBuf5emptyEv:
  140|      1|inline bool IOBuf::empty() const {
  141|      1|    return _small() ? !_sv.refs[0].block : !_bv.nbytes;
  ------------------
  |  Branch (141:12): [True: 1, False: 0]
  ------------------
  142|      1|}
_ZNK5butil5IOBuf6lengthEv:
  144|    380|inline size_t IOBuf::length() const {
  145|    380|    return _small() ?
  ------------------
  |  Branch (145:12): [True: 380, False: 0]
  ------------------
  146|    380|        (_sv.refs[0].length + _sv.refs[1].length) : _bv.nbytes;
  147|    380|}
_ZNK5butil5IOBuf6_smallEv:
  149|  2.10k|inline bool IOBuf::_small() const {
  150|  2.10k|    return _bv.magic >= 0;
  151|  2.10k|}
_ZNK5butil5IOBuf8_ref_numEv:
  153|    299|inline size_t IOBuf::_ref_num() const {
  154|    299|    return _small()
  ------------------
  |  Branch (154:12): [True: 299, False: 0]
  ------------------
  155|    299|        ? (!!_sv.refs[0].block + !!_sv.refs[1].block) : _bv.nref;
  156|    299|}
_ZN5butil5IOBuf10_front_refEv:
  158|    173|inline IOBuf::BlockRef& IOBuf::_front_ref() {
  159|    173|    return _small() ? _sv.refs[0] : _bv.refs[_bv.start];
  ------------------
  |  Branch (159:12): [True: 173, False: 0]
  ------------------
  160|    173|}
_ZNK5butil5IOBuf7_ref_atEm:
  178|    300|inline const IOBuf::BlockRef& IOBuf::_ref_at(size_t i) const {
  179|    300|    return _small() ? _sv.refs[i] : _bv.ref_at(i);
  ------------------
  |  Branch (179:12): [True: 300, False: 0]
  ------------------
  180|    300|}
_ZN5butil5IOBuf14_push_back_refERKNS0_8BlockRefE:
  199|    422|inline void IOBuf::_push_back_ref(const BlockRef& r) {
  200|    422|    if (_small()) {
  ------------------
  |  Branch (200:9): [True: 422, False: 0]
  ------------------
  201|    422|        return _push_or_move_back_ref_to_smallview<false>(r);
  202|    422|    } else {
  203|      0|        return _push_or_move_back_ref_to_bigview<false>(r);
  204|      0|    }
  205|    422|}
_ZN5butil5IOBuf14_move_back_refERKNS0_8BlockRefE:
  207|     55|inline void IOBuf::_move_back_ref(const BlockRef& r) {
  208|     55|    if (_small()) {
  ------------------
  |  Branch (208:9): [True: 55, False: 0]
  ------------------
  209|     55|        return _push_or_move_back_ref_to_smallview<true>(r);
  210|     55|    } else {
  211|      0|        return _push_or_move_back_ref_to_bigview<true>(r);
  212|      0|    }
  213|     55|}
_ZN5butil5iobuf12create_blockEm:
  629|      6|inline IOBuf::Block* create_block(const size_t block_size) {
  630|      6|    if (block_size > 0xFFFFFFFFULL) {
  ------------------
  |  Branch (630:9): [True: 0, False: 6]
  ------------------
  631|      0|        LOG(FATAL) << "block_size=" << block_size << " is too large";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|      0|        return NULL;
  633|      0|    }
  634|      6|    char* mem = (char*)iobuf::blockmem_allocate(block_size);
  635|      6|    if (mem == NULL) {
  ------------------
  |  Branch (635:9): [True: 0, False: 6]
  ------------------
  636|      0|        return NULL;
  637|      0|    }
  638|      6|    return new (mem) IOBuf::Block(mem + sizeof(IOBuf::Block),
  639|      6|                                  block_size - sizeof(IOBuf::Block));
  640|      6|}
_ZN5butil5iobuf12create_blockEv:
  642|      6|inline IOBuf::Block* create_block() {
  643|      6|    return create_block(butil::GetDefaultBlockSize());
  644|      6|}

_ZN5butil22IsIOBufProfilerEnabledEv:
   70|      6|bool IsIOBufProfilerEnabled() {
   71|      6|    pthread_once(&g_iobuf_profiler_info_once, InitGlobalIOBufProfilerInfo);
   72|      6|    return g_iobuf_profiler_enabled;
   73|      6|}
_ZN5butil24IsIOBufProfilerSamplableEv:
   75|      6|bool IsIOBufProfilerSamplable() {
   76|      6|    if (!IsIOBufProfilerEnabled()) {
  ------------------
  |  Branch (76:9): [True: 6, False: 0]
  ------------------
   77|      6|        return false;
   78|      6|    }
   79|      0|    if (g_iobuf_profiler_sample_rate == 100) {
  ------------------
  |  Branch (79:9): [True: 0, False: 0]
  ------------------
   80|      0|        return true;
   81|      0|    }
   82|      0|    return fast_rand_less_than(100) + 1 <= g_iobuf_profiler_sample_rate;
   83|      0|}
iobuf_profiler.cpp:_ZN5butilL27InitGlobalIOBufProfilerInfoEv:
   47|      1|static void InitGlobalIOBufProfilerInfo() {
   48|      1|    const char* enabled = getenv("ENABLE_IOBUF_PROFILER");
   49|      1|    g_iobuf_profiler_enabled = enabled && strcmp("1", enabled) == 0 && ::GetStackTrace != NULL;
  ------------------
  |  Branch (49:32): [True: 0, False: 1]
  |  Branch (49:43): [True: 0, False: 0]
  |  Branch (49:72): [True: 0, False: 0]
  ------------------
   50|      1|    if (!g_iobuf_profiler_enabled) {
  ------------------
  |  Branch (50:9): [True: 1, False: 0]
  ------------------
   51|      1|        return;
   52|      1|    }
   53|       |
   54|      0|    char* rate = getenv("IOBUF_PROFILER_SAMPLE_RATE");
   55|      0|    if (rate) {
  ------------------
  |  Branch (55:9): [True: 0, False: 0]
  ------------------
   56|      0|        int tmp = 0;
   57|      0|        if (butil::StringToInt(rate, &tmp)) {
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  ------------------
   58|      0|            if (tmp > 0 && tmp <= 100) {
  ------------------
  |  Branch (58:17): [True: 0, False: 0]
  |  Branch (58:28): [True: 0, False: 0]
  ------------------
   59|      0|                g_iobuf_profiler_sample_rate = tmp;
   60|      0|            } else {
   61|      0|                LOG(ERROR) << "IOBUF_PROFILER_SAMPLE_RATE should be in (0, 100], but get " << rate;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|      0|            }
   63|      0|        } else {
   64|      0|            LOG(ERROR) << "IOBUF_PROFILER_SAMPLE_RATE should be a number, but get " << rate;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|      0|        }
   66|      0|    }
   67|      0|    LOG(INFO) << "g_iobuf_profiler_sample_rate=" << g_iobuf_profiler_sample_rate;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   68|      0|}

_ZN7logging13add_vlog_siteEPPKiPKcii:
 1849|      1|                   int required_v) {
 1850|      1|    VLogSite* site = new (std::nothrow) VLogSite(filename, required_v, line_no);
 1851|      1|    if (site == NULL) {
  ------------------
  |  Branch (1851:9): [True: 0, False: 1]
  ------------------
 1852|      0|        return false;
 1853|      0|    }
 1854|      1|    VModuleList* module_list = vmodule_list;
 1855|      1|    int default_v = FLAGS_v;
 1856|      1|    do {
 1857|      1|        site->v() = default_v;
 1858|      1|        if (module_list) {
  ------------------
  |  Branch (1858:13): [True: 0, False: 1]
  ------------------
 1859|      0|            module_list->find_verbose_level(
 1860|      0|                site->module(), site->full_module(), &site->v());
 1861|      0|        }
 1862|      1|    } while (vlog_site_list_add(site, &module_list, &default_v) != 0);
  ------------------
  |  Branch (1862:14): [True: 0, False: 1]
  ------------------
 1863|      1|    *v = &site->v();
 1864|      1|    return site->v() >= required_v;
 1865|      1|}
_ZN7logging8VLogSiteC2EPKcii:
 1633|      1|        : _next(0), _v(0), _required_v(required_v), _line_no(line_no) {
 1634|       |        // Remove dirname/extname.
 1635|      1|        butil::StringPiece s(filename);
 1636|      1|        size_t pos = s.find_last_of("./");
 1637|      1|        if (pos != butil::StringPiece::npos) {
  ------------------
  |  Branch (1637:13): [True: 1, False: 0]
  ------------------
 1638|      1|            if (s[pos] == '.') {
  ------------------
  |  Branch (1638:17): [True: 1, False: 0]
  ------------------
 1639|      1|                s.remove_suffix(s.size() - pos);
 1640|      1|                _full_module.assign(s.data(), s.size());
 1641|      1|                size_t pos2 = s.find_last_of('/');
 1642|      1|                if (pos2 != butil::StringPiece::npos) {
  ------------------
  |  Branch (1642:21): [True: 1, False: 0]
  ------------------
 1643|      1|                    s.remove_prefix(pos2 + 1);
 1644|      1|                }
 1645|      1|            } else {
 1646|      0|                _full_module.assign(s.data(), s.size());
 1647|      0|                s.remove_prefix(pos + 1);
 1648|      0|            }
 1649|      1|        } // else keep _full_module empty when it equals _module
 1650|      1|        _module.assign(s.data(), s.size());
 1651|      1|        std::transform(_module.begin(), _module.end(),
 1652|      1|                       _module.begin(), ::tolower);
 1653|      1|        if (!_full_module.empty()) {
  ------------------
  |  Branch (1653:13): [True: 1, False: 0]
  ------------------
 1654|      1|            std::transform(_full_module.begin(), _full_module.end(),
 1655|      1|                           _full_module.begin(), ::tolower);
 1656|      1|        }
 1657|      1|    }
_ZN7logging8VLogSite1vEv:
 1668|      3|    int& v() { return _v; }
logging.cc:_ZN7loggingL18vlog_site_list_addEPNS_8VLogSiteEPPNS_11VModuleListEPi:
 1833|      1|                              int* expected_default_v) {
 1834|      1|    BAIDU_SCOPED_LOCK(vlog_site_list_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1835|      1|    if (vmodule_list != *expected_module_list) {
  ------------------
  |  Branch (1835:9): [True: 0, False: 1]
  ------------------
 1836|      0|        *expected_module_list = vmodule_list;
 1837|      0|        return -1;
 1838|      0|    }
 1839|      1|    if (*expected_default_v != FLAGS_v) {
  ------------------
  |  Branch (1839:9): [True: 0, False: 1]
  ------------------
 1840|      0|        *expected_default_v = FLAGS_v;
 1841|      0|        return -1;
 1842|      0|    }
 1843|      1|    site->set_next(vlog_site_list);
 1844|      1|    vlog_site_list = site;
 1845|      1|    return 0;
 1846|      1|}
_ZN7logging8VLogSite8set_nextEPS0_:
 1665|      1|    { butil::subtle::Release_Store(&_next, (butil::subtle::AtomicWord)next); }

_ZN5butil13AlignedMemoryILm24ELm8EE9void_dataEv:
   71|    320|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm128ELm64EE9void_dataEv:
   71|    109|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm48ELm8EE9void_dataEv:
   71|     62|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm64ELm64EE9void_dataEv:
   71|      3|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm832ELm64EE9void_dataEv:
   71|      1|      void* void_data() { return static_cast<void*>(data_); }     \
_ZN5butil13AlignedMemoryILm24ELm8EE7data_asINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS9_EENS_14DefaultEqualToIS9_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEEEPT_v:
   76|    256|      Type* data_as() { return static_cast<Type*>(void_data()); } \
_ZN5butil13AlignedMemoryILm48ELm8EE7data_asINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEEEPT_v:
   76|     31|      Type* data_as() { return static_cast<Type*>(void_data()); } \
_ZN5butil13AlignedMemoryILm256ELm64EE9void_dataEv:
   71|      1|      void* void_data() { return static_cast<void*>(data_); }     \

_ZN5butil17ManualConstructorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE4InitIJSG_EEEvDpOT_:
   62|     64|    void Init(Args&&... args) {
   63|     64|        new (_space.void_data()) Type(std::forward<Args>(args)...);
   64|     64|    }
_ZN5butil17ManualConstructorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE3getEv:
   47|    256|    Type* get() {
   48|    256|        return _space.template data_as<Type>();
   49|    256|    }
_ZN5butil17ManualConstructorINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEE4InitIJRKS7_EEEvDpOT_:
   62|     31|    void Init(Args&&... args) {
   63|     31|        new (_space.void_data()) Type(std::forward<Args>(args)...);
   64|     31|    }
_ZN5butil17ManualConstructorINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEEdeEv:
   58|     31|    Type& operator*() { return *get(); }
_ZN5butil17ManualConstructorINS_14FlatMapElementINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryEEEE3getEv:
   47|     31|    Type* get() {
   48|     31|        return _space.template data_as<Type>();
   49|     31|    }
_ZN5butil17ManualConstructorINS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE14NewBucketsInfoEE7DestroyEv:
   66|     64|     void Destroy() { get()->~Type(); }

socket.cpp:_ZN5butil14MakeScopeGuardIZN4brpc6Socket9OnCreatedERKNS1_13SocketOptionsEE3$_0EENS_10ScopeGuardIT_St9enable_ifIXsr14is_result_voidIS8_EE5valueEvEEEOS8_:
   76|      1|ScopeGuard<Callback> MakeScopeGuard(Callback&& callback) noexcept {
   77|      1|    return ScopeGuard<Callback>{ std::forward<Callback>(callback)};
   78|      1|}
socket.cpp:_ZN5butil10ScopeGuardIZN4brpc6Socket9OnCreatedERKNS1_13SocketOptionsEE3$_0St9enable_ifILb1EvEEC2EOS6_:
   64|      1|        :_callback(std::forward<Callback>(callback))
   65|      1|        , _dismiss(false) {}
socket.cpp:_ZN5butil10ScopeGuardIZN4brpc6Socket9OnCreatedERKNS1_13SocketOptionsEE3$_0St9enable_ifILb1EvEED2Ev:
   44|      1|    ~ScopeGuard() noexcept {
   45|      1|        if(!_dismiss) {
  ------------------
  |  Branch (45:12): [True: 0, False: 1]
  ------------------
   46|      0|            _callback();
   47|      0|        }
   48|      1|    }
socket.cpp:_ZN5butil10ScopeGuardIZN4brpc6Socket9OnCreatedERKNS1_13SocketOptionsEE3$_0St9enable_ifILb1EvEE7dismissEv:
   50|      1|    void dismiss() noexcept {
   51|      1|        _dismiss = true;
   52|      1|    }
_ZN5butil14MakeScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_EENS_10ScopeGuardIT_St9enable_ifIXsr14is_result_voidISI_EE5valueEvEEEOSI_:
   76|     64|ScopeGuard<Callback> MakeScopeGuard(Callback&& callback) noexcept {
   77|     64|    return ScopeGuard<Callback>{ std::forward<Callback>(callback)};
   78|     64|}
_ZN5butil10ScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_St9enable_ifILb1EvEEC2EOSG_:
   64|     64|        :_callback(std::forward<Callback>(callback))
   65|     64|        , _dismiss(false) {}
_ZN5butil10ScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_St9enable_ifILb1EvEE7dismissEv:
   50|     64|    void dismiss() noexcept {
   51|     64|        _dismiss = true;
   52|     64|    }
_ZN5butil10ScopeGuardIZNS_7FlatMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN4bvar8VarEntryENS_13DefaultHasherIS7_EENS_14DefaultEqualToIS7_EELb0ENS_11PtAllocatorELb0EE25new_buckets_and_thumbnailEmmEUlvE_St9enable_ifILb1EvEED2Ev:
   44|     64|    ~ScopeGuard() noexcept {
   45|     64|        if(!_dismiss) {
  ------------------
  |  Branch (45:12): [True: 0, False: 64]
  ------------------
   46|      0|            _callback();
   47|      0|        }
   48|     64|    }

_ZN5butil19get_leaky_singletonIN4bvar6detail16SamplerCollectorEEEPT_v:
   60|     20|inline T* get_leaky_singleton() {
   61|     20|    const butil::subtle::AtomicWord value = butil::subtle::Acquire_Load(
   62|     20|        &GetLeakySingleton<T>::g_leaky_singleton_untyped);
   63|     20|    if (value) {
  ------------------
  |  Branch (63:9): [True: 18, False: 2]
  ------------------
   64|     18|        return reinterpret_cast<T*>(value);
   65|     18|    }
   66|      2|    pthread_once(&GetLeakySingleton<T>::g_create_leaky_singleton_once,
   67|      2|                 GetLeakySingleton<T>::create_leaky_singleton);
   68|      2|    return reinterpret_cast<T*>(
   69|      2|        GetLeakySingleton<T>::g_leaky_singleton_untyped);
   70|     20|}
_ZN5butil17GetLeakySingletonIN4bvar6detail16SamplerCollectorEE22create_leaky_singletonEv:
   47|      2|void GetLeakySingleton<T>::create_leaky_singleton() {
   48|      2|    T* obj = create_leaky_singleton_obj<T>();
   49|      2|    butil::subtle::Release_Store(
   50|      2|        &g_leaky_singleton_untyped,
   51|      2|        reinterpret_cast<butil::subtle::AtomicWord>(obj));
   52|      2|}
_ZN5butil26create_leaky_singleton_objIN4bvar6detail16SamplerCollectorEEEPT_v:
   29|      2|T* create_leaky_singleton_obj() {
   30|      2|    return new T();
   31|      2|}

_ZN5butil14saturated_castImiEET_T0_:
   36|      2|inline Dst saturated_cast(Src value) {
   37|       |  // Optimization for floating point values, which already saturate.
   38|      2|  if (std::numeric_limits<Dst>::is_iec559)
  ------------------
  |  Branch (38:7): [Folded, False: 2]
  ------------------
   39|      0|    return static_cast<Dst>(value);
   40|       |
   41|      2|  switch (internal::DstRangeRelationToSrcRange<Dst>(value)) {
  ------------------
  |  Branch (41:11): [True: 2, False: 0]
  ------------------
   42|      2|    case internal::RANGE_VALID:
  ------------------
  |  Branch (42:5): [True: 2, False: 0]
  ------------------
   43|      2|      return static_cast<Dst>(value);
   44|       |
   45|      0|    case internal::RANGE_UNDERFLOW:
  ------------------
  |  Branch (45:5): [True: 0, False: 2]
  ------------------
   46|      0|      return std::numeric_limits<Dst>::min();
   47|       |
   48|      0|    case internal::RANGE_OVERFLOW:
  ------------------
  |  Branch (48:5): [True: 0, False: 2]
  ------------------
   49|      0|      return std::numeric_limits<Dst>::max();
   50|       |
   51|       |    // Should fail only on attempting to assign NaN to a saturated integer.
   52|      0|    case internal::RANGE_INVALID:
  ------------------
  |  Branch (52:5): [True: 0, False: 2]
  ------------------
   53|      0|      CHECK(false);
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
   54|      0|      return std::numeric_limits<Dst>::max();
   55|      2|  }
   56|       |
   57|      0|  NOTREACHED();
  ------------------
  |  | 1224|      2|#define NOTREACHED() DCHECK(false)
  |  |  ------------------
  |  |  |  |  846|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (472:7): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (472:7): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  847|      0|    << "Check failed: " #condition ". "
  |  |  ------------------
  ------------------
   58|      0|  return static_cast<Dst>(value);
   59|      2|}

_ZN5butil8internal26DstRangeRelationToSrcRangeImiEENS0_15RangeConstraintET0_:
  205|      2|inline RangeConstraint DstRangeRelationToSrcRange(Src value) {
  206|      2|  COMPILE_ASSERT(std::numeric_limits<Src>::is_specialized,
  ------------------
  |  |  241|      2|#define COMPILE_ASSERT(expr, msg)  BAIDU_CASSERT(expr, msg)
  |  |  ------------------
  |  |  |  |  196|      2|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  |  |  ------------------
  ------------------
  207|      2|                 argument_must_be_numeric);
  208|      2|  COMPILE_ASSERT(std::numeric_limits<Dst>::is_specialized,
  ------------------
  |  |  241|      2|#define COMPILE_ASSERT(expr, msg)  BAIDU_CASSERT(expr, msg)
  |  |  ------------------
  |  |  |  |  196|      2|#define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
  |  |  ------------------
  ------------------
  209|      2|                 result_must_be_numeric);
  210|      2|  return DstRangeRelationToSrcRangeImpl<Dst, Src>::Check(value);
  211|      2|}
_ZN5butil8internal30DstRangeRelationToSrcRangeImplImiLNS0_21IntegerRepresentationE0ELS2_1ELNS0_26NumericRangeRepresentationE0EE5CheckEi:
  195|      2|  static RangeConstraint Check(Src value) {
  196|      2|    return (MaxExponent<Dst>::value >= MaxExponent<Src>::value)
  ------------------
  |  Branch (196:12): [True: 2, Folded]
  ------------------
  197|      2|               ? GetRangeConstraint(true, value >= static_cast<Src>(0))
  198|      2|               : GetRangeConstraint(
  199|      0|                     value <= static_cast<Src>(std::numeric_limits<Dst>::max()),
  200|      0|                     value >= static_cast<Src>(0));
  201|      2|  }
_ZN5butil8internal18GetRangeConstraintEbb:
  107|      2|                                   bool is_in_lower_bound) {
  108|      2|  return GetRangeConstraint((is_in_upper_bound ? 0 : RANGE_OVERFLOW) |
  ------------------
  |  Branch (108:30): [True: 2, False: 0]
  ------------------
  109|      2|                            (is_in_lower_bound ? 0 : RANGE_UNDERFLOW));
  ------------------
  |  Branch (109:30): [True: 2, False: 0]
  ------------------
  110|      2|}
_ZN5butil8internal18GetRangeConstraintEi:
   97|      2|inline RangeConstraint GetRangeConstraint(int integer_range_constraint) {
   98|      2|  DCHECK(integer_range_constraint >= RANGE_VALID &&
  ------------------
  |  |  846|      2|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  ------------------
  |  |  |  |  472|      8|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 2, False: 0]
  |  |  |  |  |  Branch (472:7): [True: 2, False: 0]
  |  |  |  |  |  Branch (472:7): [True: 2, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  847|      0|    << "Check failed: " #condition ". "
  ------------------
   99|      2|         integer_range_constraint <= RANGE_INVALID);
  100|      2|  return static_cast<RangeConstraint>(integer_range_constraint);
  101|      2|}

_ZN5butil10get_objectIN4brpc6policy17MostCommonMessageEJEEEPT_DpOT0_:
   85|    108|inline T* get_object(Args&&... args) {
   86|    108|    return ObjectPool<T>::singleton()->get_object(std::forward<Args>(args)...);
   87|    108|}
_ZN5butil19ObjectPoolValidatorIN4brpc6policy17MostCommonMessageEE8validateEPKS3_:
   64|    108|    static bool validate(const T*) { return true; }
_ZN5butil10get_objectIN7bthread5ButexEJEEEPT_DpOT0_:
   85|      3|inline T* get_object(Args&&... args) {
   86|      3|    return ObjectPool<T>::singleton()->get_object(std::forward<Args>(args)...);
   87|      3|}
_ZN5butil19ObjectPoolValidatorIN7bthread5ButexEE8validateEPKS2_:
   64|      3|    static bool validate(const T*) { return true; }

_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE9singletonEv:
  341|    108|    static inline ObjectPool* singleton() {
  342|    108|        ObjectPool* p = _singleton.load(butil::memory_order_consume);
  343|    108|        if (p) {
  ------------------
  |  Branch (343:13): [True: 107, False: 1]
  ------------------
  344|    107|            return p;
  345|    107|        }
  346|      1|        pthread_mutex_lock(&_singleton_mutex);
  347|      1|        p = _singleton.load(butil::memory_order_consume);
  348|      1|        if (!p) {
  ------------------
  |  Branch (348:13): [True: 1, False: 0]
  ------------------
  349|      1|            p = new ObjectPool();
  350|      1|            _singleton.store(p, butil::memory_order_release);
  351|      1|        }
  352|      1|        pthread_mutex_unlock(&_singleton_mutex);
  353|      1|        return p;
  354|    108|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE10get_objectIJEEEPS3_DpOT_:
  277|    108|    inline T* get_object(Args&&... args) {
  278|    108|        LocalPool* lp = get_or_new_local_pool();
  279|    108|        T* ptr = NULL;
  280|    108|        if (BAIDU_LIKELY(lp != NULL)) {
  ------------------
  |  |  271|    108|#    define BAIDU_LIKELY(expr) (__builtin_expect((bool)(expr), true))
  |  |  ------------------
  |  |  |  Branch (271:32): [True: 108, False: 0]
  |  |  ------------------
  ------------------
  281|    108|            ptr = lp->get(std::forward<Args>(args)...);
  282|    108|            OBJECT_POOL_ASAN_UNPOISON_MEMORY_REGION(ptr);
  ------------------
  |  |  109|    108|#define OBJECT_POOL_ASAN_UNPOISON_MEMORY_REGION(ptr) ((void)(ptr))
  ------------------
  283|    108|        }
  284|    108|        return ptr;
  285|    108|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE21get_or_new_local_poolEv:
  417|    108|    inline LocalPool* get_or_new_local_pool() {
  418|    108|	    LocalPool* lp = BAIDU_GET_VOLATILE_THREAD_LOCAL(_local_pool);
  ------------------
  |  |   69|    108|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  ------------------
  419|    108|        if (BAIDU_LIKELY(lp != NULL)) {
  ------------------
  |  |  271|    108|#    define BAIDU_LIKELY(expr) (__builtin_expect((bool)(expr), true))
  |  |  ------------------
  |  |  |  Branch (271:32): [True: 107, False: 1]
  |  |  ------------------
  ------------------
  420|    107|            return lp;
  421|    107|        }
  422|      1|        lp = new(std::nothrow) LocalPool(this);
  423|      1|        if (NULL == lp) {
  ------------------
  |  Branch (423:13): [True: 0, False: 1]
  ------------------
  424|      0|            return NULL;
  425|      0|        }
  426|      1|        BAIDU_SCOPED_LOCK(_change_thread_mutex); //avoid race with clear()
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|      1|	    BAIDU_SET_VOLATILE_THREAD_LOCAL(_local_pool, lp);
  ------------------
  |  |   71|      1|#define BAIDU_SET_VOLATILE_THREAD_LOCAL(var_name, value) set_##var_name(value)
  ------------------
  428|      1|        butil::thread_atexit(LocalPool::delete_local_pool, lp);
  429|      1|        _nlocal.fetch_add(1, butil::memory_order_relaxed);
  430|      1|        return lp;
  431|      1|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE9LocalPool3getEv:
  225|    108|        inline T* get() {
  226|    217|            BAIDU_OBJECT_POOL_GET();
  ------------------
  |  |  183|    108|        if (_cur_free.nfree) {                                          \
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 108]
  |  |  ------------------
  |  |  184|      0|            BAIDU_OBJECT_POOL_FREE_ITEM_NUM_SUB1;                       \
  |  |  185|      0|            return _cur_free.ptrs[--_cur_free.nfree];                   \
  |  |  186|      0|        }                                                               \
  |  |  187|      0|        /* Fetch a FreeChunk from global.                               \
  |  |  188|      0|           TODO: Popping from _free needs to copy a FreeChunk which is  \
  |  |  189|      0|           costly, but hardly impacts amortized performance. */         \
  |  |  190|    108|        if (_pool->pop_free_chunk(_cur_free)) {                         \
  |  |  ------------------
  |  |  |  Branch (190:13): [True: 0, False: 108]
  |  |  ------------------
  |  |  191|      0|            BAIDU_OBJECT_POOL_FREE_ITEM_NUM_SUB1;                       \
  |  |  192|      0|            return _cur_free.ptrs[--_cur_free.nfree];                   \
  |  |  193|      0|        }                                                               \
  |  |  194|    108|        T* obj = NULL;                                                  \
  |  |  195|    108|        /* Fetch memory from local block */                             \
  |  |  196|    108|        if (_cur_block && _cur_block->nitem < BLOCK_NITEM) {            \
  |  |  ------------------
  |  |  |  Branch (196:13): [True: 107, False: 1]
  |  |  |  Branch (196:27): [True: 107, False: 0]
  |  |  ------------------
  |  |  197|    107|            auto item = _cur_block->items + _cur_block->nitem;          \
  |  |  198|    107|            obj = new (item->void_data()) T CTOR_ARGS;                  \
  |  |  199|    107|            if (!ObjectPoolValidator<T>::validate(obj)) {               \
  |  |  ------------------
  |  |  |  Branch (199:17): [True: 0, False: 107]
  |  |  ------------------
  |  |  200|      0|                obj->~T();                                              \
  |  |  201|      0|                return NULL;                                            \
  |  |  202|      0|            }                                                           \
  |  |  203|    107|            /* It's poisoned prior to use. */                           \
  |  |  204|    107|            OBJECT_POOL_ASAN_POISON_MEMORY_REGION(obj);                 \
  |  |  ------------------
  |  |  |  |  108|    107|#define OBJECT_POOL_ASAN_POISON_MEMORY_REGION(ptr) ((void)(ptr))
  |  |  ------------------
  |  |  205|    107|            ++_cur_block->nitem;                                        \
  |  |  206|    107|            return obj;                                                 \
  |  |  207|    107|        }                                                               \
  |  |  208|    108|        /* Fetch a Block from global */                                 \
  |  |  209|    108|        _cur_block = add_block(&_cur_block_index);                      \
  |  |  210|      1|        if (_cur_block != NULL) {                                       \
  |  |  ------------------
  |  |  |  Branch (210:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  211|      1|            auto item = _cur_block->items + _cur_block->nitem;          \
  |  |  212|      1|            obj = new (item->void_data()) T CTOR_ARGS;                  \
  |  |  213|      1|            if (!ObjectPoolValidator<T>::validate(obj)) {               \
  |  |  ------------------
  |  |  |  Branch (213:17): [True: 0, False: 1]
  |  |  ------------------
  |  |  214|      0|                obj->~T();                                              \
  |  |  215|      0|                return NULL;                                            \
  |  |  216|      0|            }                                                           \
  |  |  217|      1|            /* It's poisoned prior to use. */                           \
  |  |  218|      1|            OBJECT_POOL_ASAN_POISON_MEMORY_REGION(obj);                 \
  |  |  ------------------
  |  |  |  |  108|      1|#define OBJECT_POOL_ASAN_POISON_MEMORY_REGION(ptr) ((void)(ptr))
  |  |  ------------------
  |  |  219|      1|            ++_cur_block->nitem;                                        \
  |  |  220|      1|            return obj;                                                 \
  |  |  221|      1|        }                                                               \
  |  |  222|      1|        return NULL;                                                    \
  ------------------
  227|      0|        }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE14pop_free_chunkERNS_19ObjectPoolFreeChunkIS3_Lm256EEE:
  490|    108|    bool pop_free_chunk(FreeChunk& c) {
  491|       |        // Critical for the case that most return_object are called in
  492|       |        // different threads of get_object.
  493|    108|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (493:13): [True: 108, False: 0]
  ------------------
  494|    108|            return false;
  495|    108|        }
  496|      0|        pthread_mutex_lock(&_free_chunks_mutex);
  497|      0|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            pthread_mutex_unlock(&_free_chunks_mutex);
  499|      0|            return false;
  500|      0|        }
  501|      0|        DynamicFreeChunk* p = _free_chunks.back();
  502|      0|        _free_chunks.pop_back();
  503|      0|        pthread_mutex_unlock(&_free_chunks_mutex);
  504|      0|        c.nfree = p->nfree;
  505|      0|        memcpy(c.ptrs, p->ptrs, sizeof(*p->ptrs) * p->nfree);
  506|      0|        free(p);
  507|      0|        return true;
  508|      0|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE9add_blockEPm:
  367|      1|    static Block* add_block(size_t* index) {
  368|      1|        Block* const new_block = new(std::nothrow) Block;
  369|      1|        if (NULL == new_block) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1]
  ------------------
  370|      0|            return NULL;
  371|      0|        }
  372|      1|        size_t ngroup;
  373|      2|        do {
  374|      2|            ngroup = _ngroup.load(butil::memory_order_acquire);
  375|      2|            if (ngroup >= 1) {
  ------------------
  |  Branch (375:17): [True: 1, False: 1]
  ------------------
  376|      1|                BlockGroup* const g =
  377|      1|                    _block_groups[ngroup - 1].load(butil::memory_order_consume);
  378|      1|                const size_t block_index =
  379|      1|                    g->nblock.fetch_add(1, butil::memory_order_relaxed);
  380|      1|                if (block_index < OP_GROUP_NBLOCK) {
  ------------------
  |  Branch (380:21): [True: 1, False: 0]
  ------------------
  381|      1|                    g->blocks[block_index].store(
  382|      1|                        new_block, butil::memory_order_release);
  383|      1|                    *index = (ngroup - 1) * OP_GROUP_NBLOCK + block_index;
  384|      1|                    return new_block;
  385|      1|                }
  386|      0|                g->nblock.fetch_sub(1, butil::memory_order_relaxed);
  387|      0|            }
  388|      2|        } while (add_block_group(ngroup));
  ------------------
  |  Branch (388:18): [True: 1, False: 0]
  ------------------
  389|       |
  390|       |        // Fail to add_block_group.
  391|      0|        delete new_block;
  392|       |        return NULL;
  393|      1|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE15add_block_groupEm:
  397|      1|    static bool add_block_group(size_t old_ngroup) {
  398|      1|        BlockGroup* bg = NULL;
  399|      1|        BAIDU_SCOPED_LOCK(_block_group_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|      1|        const size_t ngroup = _ngroup.load(butil::memory_order_acquire);
  401|      1|        if (ngroup != old_ngroup) {
  ------------------
  |  Branch (401:13): [True: 0, False: 1]
  ------------------
  402|       |            // Other thread got lock and added group before this thread.
  403|      0|            return true;
  404|      0|        }
  405|      1|        if (ngroup < OP_MAX_BLOCK_NGROUP) {
  ------------------
  |  Branch (405:13): [True: 1, False: 0]
  ------------------
  406|      1|            bg = new(std::nothrow) BlockGroup;
  407|      1|            if (NULL != bg) {
  ------------------
  |  Branch (407:17): [True: 1, False: 0]
  ------------------
  408|       |                // Release fence is paired with consume fence in add_block()
  409|       |                // to avoid un-constructed bg to be seen by other threads.
  410|      1|                _block_groups[ngroup].store(bg, butil::memory_order_release);
  411|      1|                _ngroup.store(ngroup + 1, butil::memory_order_release);
  412|      1|            }
  413|      1|        }
  414|       |        return bg != NULL;
  415|      1|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEEC2Ev:
  357|      1|    ObjectPool() {
  358|      1|        _free_chunks.reserve(OP_INITIAL_FREE_LIST_SIZE);
  359|       |        pthread_mutex_init(&_free_chunks_mutex, NULL);
  360|      1|    }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE9LocalPoolC2EPS4_:
  158|      1|            : _pool(pool)
  159|      1|            , _cur_block(NULL)
  160|      1|            , _cur_block_index(0) {
  161|      1|            _cur_free.nfree = 0;
  162|      1|        }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE5BlockC2Ev:
  136|      1|        Block() : nitem(0) {}
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE10BlockGroupC2Ev:
  146|      1|        BlockGroup() : nblock(0) {
  147|       |            // We fetch_add nblock in add_block() before setting the entry,
  148|       |            // thus address_resource() may sees the unset entry. Initialize
  149|       |            // all entries to NULL makes such address_resource() return NULL.
  150|      1|            memset(static_cast<void*>(blocks), 0, sizeof(butil::atomic<Block*>) * OP_GROUP_NBLOCK);
  151|      1|        }
_ZN5butil10ObjectPoolIN7bthread5ButexEE9singletonEv:
  341|      3|    static inline ObjectPool* singleton() {
  342|      3|        ObjectPool* p = _singleton.load(butil::memory_order_consume);
  343|      3|        if (p) {
  ------------------
  |  Branch (343:13): [True: 2, False: 1]
  ------------------
  344|      2|            return p;
  345|      2|        }
  346|      1|        pthread_mutex_lock(&_singleton_mutex);
  347|      1|        p = _singleton.load(butil::memory_order_consume);
  348|      1|        if (!p) {
  ------------------
  |  Branch (348:13): [True: 1, False: 0]
  ------------------
  349|      1|            p = new ObjectPool();
  350|      1|            _singleton.store(p, butil::memory_order_release);
  351|      1|        }
  352|      1|        pthread_mutex_unlock(&_singleton_mutex);
  353|      1|        return p;
  354|      3|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEEC2Ev:
  357|      1|    ObjectPool() {
  358|      1|        _free_chunks.reserve(OP_INITIAL_FREE_LIST_SIZE);
  359|       |        pthread_mutex_init(&_free_chunks_mutex, NULL);
  360|      1|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEE10get_objectIJEEEPS2_DpOT_:
  277|      3|    inline T* get_object(Args&&... args) {
  278|      3|        LocalPool* lp = get_or_new_local_pool();
  279|      3|        T* ptr = NULL;
  280|      3|        if (BAIDU_LIKELY(lp != NULL)) {
  ------------------
  |  |  271|      3|#    define BAIDU_LIKELY(expr) (__builtin_expect((bool)(expr), true))
  |  |  ------------------
  |  |  |  Branch (271:32): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  281|      3|            ptr = lp->get(std::forward<Args>(args)...);
  282|      3|            OBJECT_POOL_ASAN_UNPOISON_MEMORY_REGION(ptr);
  ------------------
  |  |  109|      3|#define OBJECT_POOL_ASAN_UNPOISON_MEMORY_REGION(ptr) ((void)(ptr))
  ------------------
  283|      3|        }
  284|      3|        return ptr;
  285|      3|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEE21get_or_new_local_poolEv:
  417|      3|    inline LocalPool* get_or_new_local_pool() {
  418|      3|	    LocalPool* lp = BAIDU_GET_VOLATILE_THREAD_LOCAL(_local_pool);
  ------------------
  |  |   69|      3|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  ------------------
  419|      3|        if (BAIDU_LIKELY(lp != NULL)) {
  ------------------
  |  |  271|      3|#    define BAIDU_LIKELY(expr) (__builtin_expect((bool)(expr), true))
  |  |  ------------------
  |  |  |  Branch (271:32): [True: 2, False: 1]
  |  |  ------------------
  ------------------
  420|      2|            return lp;
  421|      2|        }
  422|      1|        lp = new(std::nothrow) LocalPool(this);
  423|      1|        if (NULL == lp) {
  ------------------
  |  Branch (423:13): [True: 0, False: 1]
  ------------------
  424|      0|            return NULL;
  425|      0|        }
  426|      1|        BAIDU_SCOPED_LOCK(_change_thread_mutex); //avoid race with clear()
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|      1|	    BAIDU_SET_VOLATILE_THREAD_LOCAL(_local_pool, lp);
  ------------------
  |  |   71|      1|#define BAIDU_SET_VOLATILE_THREAD_LOCAL(var_name, value) set_##var_name(value)
  ------------------
  428|      1|        butil::thread_atexit(LocalPool::delete_local_pool, lp);
  429|      1|        _nlocal.fetch_add(1, butil::memory_order_relaxed);
  430|      1|        return lp;
  431|      1|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEE9LocalPoolC2EPS3_:
  158|      1|            : _pool(pool)
  159|      1|            , _cur_block(NULL)
  160|      1|            , _cur_block_index(0) {
  161|      1|            _cur_free.nfree = 0;
  162|      1|        }
_ZN5butil10ObjectPoolIN7bthread5ButexEE9LocalPool3getEv:
  225|      3|        inline T* get() {
  226|      7|            BAIDU_OBJECT_POOL_GET();
  ------------------
  |  |  183|      3|        if (_cur_free.nfree) {                                          \
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 3]
  |  |  ------------------
  |  |  184|      0|            BAIDU_OBJECT_POOL_FREE_ITEM_NUM_SUB1;                       \
  |  |  185|      0|            return _cur_free.ptrs[--_cur_free.nfree];                   \
  |  |  186|      0|        }                                                               \
  |  |  187|      0|        /* Fetch a FreeChunk from global.                               \
  |  |  188|      0|           TODO: Popping from _free needs to copy a FreeChunk which is  \
  |  |  189|      0|           costly, but hardly impacts amortized performance. */         \
  |  |  190|      3|        if (_pool->pop_free_chunk(_cur_free)) {                         \
  |  |  ------------------
  |  |  |  Branch (190:13): [True: 0, False: 3]
  |  |  ------------------
  |  |  191|      0|            BAIDU_OBJECT_POOL_FREE_ITEM_NUM_SUB1;                       \
  |  |  192|      0|            return _cur_free.ptrs[--_cur_free.nfree];                   \
  |  |  193|      0|        }                                                               \
  |  |  194|      3|        T* obj = NULL;                                                  \
  |  |  195|      3|        /* Fetch memory from local block */                             \
  |  |  196|      3|        if (_cur_block && _cur_block->nitem < BLOCK_NITEM) {            \
  |  |  ------------------
  |  |  |  Branch (196:13): [True: 2, False: 1]
  |  |  |  Branch (196:27): [True: 2, False: 0]
  |  |  ------------------
  |  |  197|      2|            auto item = _cur_block->items + _cur_block->nitem;          \
  |  |  198|      2|            obj = new (item->void_data()) T CTOR_ARGS;                  \
  |  |  199|      2|            if (!ObjectPoolValidator<T>::validate(obj)) {               \
  |  |  ------------------
  |  |  |  Branch (199:17): [True: 0, False: 2]
  |  |  ------------------
  |  |  200|      0|                obj->~T();                                              \
  |  |  201|      0|                return NULL;                                            \
  |  |  202|      0|            }                                                           \
  |  |  203|      2|            /* It's poisoned prior to use. */                           \
  |  |  204|      2|            OBJECT_POOL_ASAN_POISON_MEMORY_REGION(obj);                 \
  |  |  ------------------
  |  |  |  |  108|      2|#define OBJECT_POOL_ASAN_POISON_MEMORY_REGION(ptr) ((void)(ptr))
  |  |  ------------------
  |  |  205|      2|            ++_cur_block->nitem;                                        \
  |  |  206|      2|            return obj;                                                 \
  |  |  207|      2|        }                                                               \
  |  |  208|      3|        /* Fetch a Block from global */                                 \
  |  |  209|      3|        _cur_block = add_block(&_cur_block_index);                      \
  |  |  210|      1|        if (_cur_block != NULL) {                                       \
  |  |  ------------------
  |  |  |  Branch (210:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  211|      1|            auto item = _cur_block->items + _cur_block->nitem;          \
  |  |  212|      1|            obj = new (item->void_data()) T CTOR_ARGS;                  \
  |  |  213|      1|            if (!ObjectPoolValidator<T>::validate(obj)) {               \
  |  |  ------------------
  |  |  |  Branch (213:17): [True: 0, False: 1]
  |  |  ------------------
  |  |  214|      0|                obj->~T();                                              \
  |  |  215|      0|                return NULL;                                            \
  |  |  216|      0|            }                                                           \
  |  |  217|      1|            /* It's poisoned prior to use. */                           \
  |  |  218|      1|            OBJECT_POOL_ASAN_POISON_MEMORY_REGION(obj);                 \
  |  |  ------------------
  |  |  |  |  108|      1|#define OBJECT_POOL_ASAN_POISON_MEMORY_REGION(ptr) ((void)(ptr))
  |  |  ------------------
  |  |  219|      1|            ++_cur_block->nitem;                                        \
  |  |  220|      1|            return obj;                                                 \
  |  |  221|      1|        }                                                               \
  |  |  222|      1|        return NULL;                                                    \
  ------------------
  227|      0|        }
_ZN5butil10ObjectPoolIN7bthread5ButexEE14pop_free_chunkERNS_19ObjectPoolFreeChunkIS2_Lm128EEE:
  490|      3|    bool pop_free_chunk(FreeChunk& c) {
  491|       |        // Critical for the case that most return_object are called in
  492|       |        // different threads of get_object.
  493|      3|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (493:13): [True: 3, False: 0]
  ------------------
  494|      3|            return false;
  495|      3|        }
  496|      0|        pthread_mutex_lock(&_free_chunks_mutex);
  497|      0|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            pthread_mutex_unlock(&_free_chunks_mutex);
  499|      0|            return false;
  500|      0|        }
  501|      0|        DynamicFreeChunk* p = _free_chunks.back();
  502|      0|        _free_chunks.pop_back();
  503|      0|        pthread_mutex_unlock(&_free_chunks_mutex);
  504|      0|        c.nfree = p->nfree;
  505|      0|        memcpy(c.ptrs, p->ptrs, sizeof(*p->ptrs) * p->nfree);
  506|      0|        free(p);
  507|      0|        return true;
  508|      0|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEE9add_blockEPm:
  367|      1|    static Block* add_block(size_t* index) {
  368|      1|        Block* const new_block = new(std::nothrow) Block;
  369|      1|        if (NULL == new_block) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1]
  ------------------
  370|      0|            return NULL;
  371|      0|        }
  372|      1|        size_t ngroup;
  373|      2|        do {
  374|      2|            ngroup = _ngroup.load(butil::memory_order_acquire);
  375|      2|            if (ngroup >= 1) {
  ------------------
  |  Branch (375:17): [True: 1, False: 1]
  ------------------
  376|      1|                BlockGroup* const g =
  377|      1|                    _block_groups[ngroup - 1].load(butil::memory_order_consume);
  378|      1|                const size_t block_index =
  379|      1|                    g->nblock.fetch_add(1, butil::memory_order_relaxed);
  380|      1|                if (block_index < OP_GROUP_NBLOCK) {
  ------------------
  |  Branch (380:21): [True: 1, False: 0]
  ------------------
  381|      1|                    g->blocks[block_index].store(
  382|      1|                        new_block, butil::memory_order_release);
  383|      1|                    *index = (ngroup - 1) * OP_GROUP_NBLOCK + block_index;
  384|      1|                    return new_block;
  385|      1|                }
  386|      0|                g->nblock.fetch_sub(1, butil::memory_order_relaxed);
  387|      0|            }
  388|      2|        } while (add_block_group(ngroup));
  ------------------
  |  Branch (388:18): [True: 1, False: 0]
  ------------------
  389|       |
  390|       |        // Fail to add_block_group.
  391|      0|        delete new_block;
  392|       |        return NULL;
  393|      1|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEE5BlockC2Ev:
  136|      1|        Block() : nitem(0) {}
_ZN5butil10ObjectPoolIN7bthread5ButexEE15add_block_groupEm:
  397|      1|    static bool add_block_group(size_t old_ngroup) {
  398|      1|        BlockGroup* bg = NULL;
  399|      1|        BAIDU_SCOPED_LOCK(_block_group_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|      1|        const size_t ngroup = _ngroup.load(butil::memory_order_acquire);
  401|      1|        if (ngroup != old_ngroup) {
  ------------------
  |  Branch (401:13): [True: 0, False: 1]
  ------------------
  402|       |            // Other thread got lock and added group before this thread.
  403|      0|            return true;
  404|      0|        }
  405|      1|        if (ngroup < OP_MAX_BLOCK_NGROUP) {
  ------------------
  |  Branch (405:13): [True: 1, False: 0]
  ------------------
  406|      1|            bg = new(std::nothrow) BlockGroup;
  407|      1|            if (NULL != bg) {
  ------------------
  |  Branch (407:17): [True: 1, False: 0]
  ------------------
  408|       |                // Release fence is paired with consume fence in add_block()
  409|       |                // to avoid un-constructed bg to be seen by other threads.
  410|      1|                _block_groups[ngroup].store(bg, butil::memory_order_release);
  411|      1|                _ngroup.store(ngroup + 1, butil::memory_order_release);
  412|      1|            }
  413|      1|        }
  414|       |        return bg != NULL;
  415|      1|    }
_ZN5butil10ObjectPoolIN7bthread5ButexEE10BlockGroupC2Ev:
  146|      1|        BlockGroup() : nblock(0) {
  147|       |            // We fetch_add nblock in add_block() before setting the entry,
  148|       |            // thus address_resource() may sees the unset entry. Initialize
  149|       |            // all entries to NULL makes such address_resource() return NULL.
  150|      1|            memset(static_cast<void*>(blocks), 0, sizeof(butil::atomic<Block*>) * OP_GROUP_NBLOCK);
  151|      1|        }

_ZN5butil30RegisterFlagValidatorOrDieImplIbEEbPKT_PFbPKcS1_E:
   64|     42|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|     42|    static_assert(!butil::is_same<std::string, T>::value,
   66|     42|                  "Not support string flags");
   67|     42|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 42, False: 0]
  ------------------
   68|     42|        return true;
   69|     42|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|     42|}
_ZN5butil30RegisterFlagValidatorOrDieImplIiEEbPKT_PFbPKcS1_E:
   64|     66|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|     66|    static_assert(!butil::is_same<std::string, T>::value,
   66|     66|                  "Not support string flags");
   67|     66|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 66, False: 0]
  ------------------
   68|     66|        return true;
   69|     66|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|     66|}
_ZN5butil30RegisterFlagValidatorOrDieImplIjEEbPKT_PFbPKcS1_E:
   64|      2|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|      2|    static_assert(!butil::is_same<std::string, T>::value,
   66|      2|                  "Not support string flags");
   67|      2|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        return true;
   69|      2|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|      2|}
_ZN5butil30RegisterFlagValidatorOrDieImplIlEEbPKT_PFbPKcS1_E:
   64|      2|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|      2|    static_assert(!butil::is_same<std::string, T>::value,
   66|      2|                  "Not support string flags");
   67|      2|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        return true;
   69|      2|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|      2|}
_ZN5butil30RegisterFlagValidatorOrDieImplImEEbPKT_PFbPKcS1_E:
   64|      2|    const T* flag, bool (*validate_fn)(const char*, T val)) {
   65|      2|    static_assert(!butil::is_same<std::string, T>::value,
   66|      2|                  "Not support string flags");
   67|      2|    if (::GFLAGS_NAMESPACE::RegisterFlagValidator(flag, validate_fn)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        return true;
   69|      2|    }
   70|       |    // Error printed by gflags does not have newline. Add one to it.
   71|      0|    char newline = '\n';
   72|      0|    butil::ignore_result(write(2, &newline, 1));
   73|      0|    _exit(1);
   74|      2|}

_ZN5butil16address_resourceIN4brpc6SocketEEEPT_NS_10ResourceIdIS3_EE:
  117|      1|template <typename T> inline T* address_resource(ResourceId<T> id) {
  118|      1|    return ResourcePool<T>::address_resource(id);
  119|      1|}
_ZN5butil12get_resourceIN4brpc6SocketEJNS1_18VersionedRefWithIdIS2_E9ForbiddenEEEEPT_PNS_10ResourceIdIS6_EEDpOT0_:
   97|      1|inline T* get_resource(ResourceId<T>* id, Args&&... args) {
   98|      1|    return ResourcePool<T>::singleton()->get_resource(id, std::forward<Args>(args)...);
   99|      1|}
_ZN5butil21ResourcePoolValidatorIN4brpc6SocketEE8validateEPKS2_:
   84|      1|    static bool validate(const T*) { return true; }
_ZN5butil12get_resourceIN4brpc11IOEventDataEJNS1_18VersionedRefWithIdIS2_E9ForbiddenEEEEPT_PNS_10ResourceIdIS6_EEDpOT0_:
   97|      1|inline T* get_resource(ResourceId<T>* id, Args&&... args) {
   98|      1|    return ResourcePool<T>::singleton()->get_resource(id, std::forward<Args>(args)...);
   99|      1|}
_ZN5butil21ResourcePoolValidatorIN4brpc11IOEventDataEE8validateEPKS2_:
   84|      1|    static bool validate(const T*) { return true; }
_ZN5butil12get_resourceIN7bthread2IdEJEEEPT_PNS_10ResourceIdIS3_EEDpOT0_:
   97|      1|inline T* get_resource(ResourceId<T>* id, Args&&... args) {
   98|      1|    return ResourcePool<T>::singleton()->get_resource(id, std::forward<Args>(args)...);
   99|      1|}
_ZN5butil21ResourcePoolValidatorIN7bthread2IdEE8validateEPKS2_:
   84|      1|    static bool validate(const T*) { return true; }

_ZN5butil12ResourcePoolIN4brpc6SocketEE16address_resourceENS_10ResourceIdIS2_EE:
  259|      1|    static inline T* address_resource(ResourceId<T> id) {
  260|      1|        const size_t block_index = id.value / BLOCK_NITEM;
  261|      1|        const size_t group_index = (block_index >> RP_GROUP_NBLOCK_NBIT);
  262|      1|        if (__builtin_expect(group_index < RP_MAX_BLOCK_NGROUP, 1)) {
  ------------------
  |  Branch (262:13): [True: 1, False: 0]
  ------------------
  263|      1|            BlockGroup* bg =
  264|      1|                _block_groups[group_index].load(butil::memory_order_consume);
  265|      1|            if (__builtin_expect(bg != NULL, 1)) {
  ------------------
  |  Branch (265:17): [True: 1, False: 0]
  ------------------
  266|      1|                Block* b = bg->blocks[block_index & (RP_GROUP_NBLOCK - 1)]
  267|      1|                           .load(butil::memory_order_consume);
  268|      1|                if (__builtin_expect(b != NULL, 1)) {
  ------------------
  |  Branch (268:21): [True: 1, False: 0]
  ------------------
  269|      1|                    const size_t offset = id.value - block_index * BLOCK_NITEM;
  270|      1|                    if (__builtin_expect(offset < b->nitem, 1)) {
  ------------------
  |  Branch (270:25): [True: 1, False: 0]
  ------------------
  271|      1|                        return (T*)b->items + offset;
  272|      1|                    }
  273|      1|                }
  274|      1|            }
  275|      1|        }
  276|       |
  277|      0|        return NULL;
  278|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE9singletonEv:
  365|      1|    static inline ResourcePool* singleton() {
  366|      1|        ResourcePool* p = _singleton.load(butil::memory_order_consume);
  367|      1|        if (p) {
  ------------------
  |  Branch (367:13): [True: 0, False: 1]
  ------------------
  368|      0|            return p;
  369|      0|        }
  370|      1|        pthread_mutex_lock(&_singleton_mutex);
  371|      1|        p = _singleton.load(butil::memory_order_consume);
  372|      1|        if (!p) {
  ------------------
  |  Branch (372:13): [True: 1, False: 0]
  ------------------
  373|      1|            p = new ResourcePool();
  374|      1|            _singleton.store(p, butil::memory_order_release);
  375|      1|        } 
  376|      1|        pthread_mutex_unlock(&_singleton_mutex);
  377|      1|        return p;
  378|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEEC2Ev:
  381|      1|    ResourcePool() {
  382|      1|        _free_chunks.reserve(RP_INITIAL_FREE_LIST_SIZE);
  383|       |        pthread_mutex_init(&_free_chunks_mutex, NULL);
  384|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE21get_or_new_local_poolEv:
  443|      1|    inline LocalPool* get_or_new_local_pool() {
  444|      1|	    LocalPool* lp = BAIDU_GET_VOLATILE_THREAD_LOCAL(_local_pool);
  ------------------
  |  |   69|      1|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  ------------------
  445|      1|        if (lp != NULL) {
  ------------------
  |  Branch (445:13): [True: 0, False: 1]
  ------------------
  446|      0|            return lp;
  447|      0|        }
  448|      1|        lp = new(std::nothrow) LocalPool(this);
  449|      1|        if (NULL == lp) {
  ------------------
  |  Branch (449:13): [True: 0, False: 1]
  ------------------
  450|      0|            return NULL;
  451|      0|        }
  452|      1|        BAIDU_SCOPED_LOCK(_change_thread_mutex); //avoid race with clear()
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|      1|	    BAIDU_SET_VOLATILE_THREAD_LOCAL(_local_pool, lp);
  ------------------
  |  |   71|      1|#define BAIDU_SET_VOLATILE_THREAD_LOCAL(var_name, value) set_##var_name(value)
  ------------------
  454|      1|        butil::thread_atexit(LocalPool::delete_local_pool, lp);
  455|      1|        _nlocal.fetch_add(1, butil::memory_order_relaxed);
  456|      1|        return lp;
  457|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE9LocalPoolC2EPS3_:
  144|      1|            : _pool(pool)
  145|      1|            , _cur_block(NULL)
  146|      1|            , _cur_block_index(0) {
  147|      1|            _cur_free.nfree = 0;
  148|      1|        }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE9singletonEv:
  365|      1|    static inline ResourcePool* singleton() {
  366|      1|        ResourcePool* p = _singleton.load(butil::memory_order_consume);
  367|      1|        if (p) {
  ------------------
  |  Branch (367:13): [True: 0, False: 1]
  ------------------
  368|      0|            return p;
  369|      0|        }
  370|      1|        pthread_mutex_lock(&_singleton_mutex);
  371|      1|        p = _singleton.load(butil::memory_order_consume);
  372|      1|        if (!p) {
  ------------------
  |  Branch (372:13): [True: 1, False: 0]
  ------------------
  373|      1|            p = new ResourcePool();
  374|      1|            _singleton.store(p, butil::memory_order_release);
  375|      1|        } 
  376|      1|        pthread_mutex_unlock(&_singleton_mutex);
  377|      1|        return p;
  378|      1|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE21get_or_new_local_poolEv:
  443|      1|    inline LocalPool* get_or_new_local_pool() {
  444|      1|	    LocalPool* lp = BAIDU_GET_VOLATILE_THREAD_LOCAL(_local_pool);
  ------------------
  |  |   69|      1|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  ------------------
  445|      1|        if (lp != NULL) {
  ------------------
  |  Branch (445:13): [True: 0, False: 1]
  ------------------
  446|      0|            return lp;
  447|      0|        }
  448|      1|        lp = new(std::nothrow) LocalPool(this);
  449|      1|        if (NULL == lp) {
  ------------------
  |  Branch (449:13): [True: 0, False: 1]
  ------------------
  450|      0|            return NULL;
  451|      0|        }
  452|      1|        BAIDU_SCOPED_LOCK(_change_thread_mutex); //avoid race with clear()
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|      1|	    BAIDU_SET_VOLATILE_THREAD_LOCAL(_local_pool, lp);
  ------------------
  |  |   71|      1|#define BAIDU_SET_VOLATILE_THREAD_LOCAL(var_name, value) set_##var_name(value)
  ------------------
  454|      1|        butil::thread_atexit(LocalPool::delete_local_pool, lp);
  455|      1|        _nlocal.fetch_add(1, butil::memory_order_relaxed);
  456|      1|        return lp;
  457|      1|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEEC2Ev:
  381|      1|    ResourcePool() {
  382|      1|        _free_chunks.reserve(RP_INITIAL_FREE_LIST_SIZE);
  383|       |        pthread_mutex_init(&_free_chunks_mutex, NULL);
  384|      1|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE9LocalPoolC2EPS3_:
  144|      1|            : _pool(pool)
  145|      1|            , _cur_block(NULL)
  146|      1|            , _cur_block_index(0) {
  147|      1|            _cur_free.nfree = 0;
  148|      1|        }
_ZN5butil12ResourcePoolIN4brpc6SocketEE12get_resourceIJNS1_18VersionedRefWithIdIS2_E9ForbiddenEEEEPS2_PNS_10ResourceIdIS2_EEDpOT_:
  281|      1|    inline T* get_resource(ResourceId<T>* id, Args&&... args) {
  282|      1|        LocalPool* lp = get_or_new_local_pool();
  283|      1|        if (__builtin_expect(lp != NULL, 1)) {
  ------------------
  |  Branch (283:13): [True: 1, False: 0]
  ------------------
  284|      1|            return lp->get(id, std::forward<Args>(args)...);
  285|      1|        }
  286|      0|        return NULL;
  287|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE9LocalPool3getIJNS1_18VersionedRefWithIdIS2_E9ForbiddenEEEEPS2_PNS_10ResourceIdIS2_EEDpOT_:
  219|      1|        inline T* get(ResourceId<T>* id, Args&&... args) {
  220|      3|            BAIDU_RESOURCE_POOL_GET((std::forward<Args>(args)...));
  ------------------
  |  |  169|      1|        if (_cur_free.nfree) {                                              \
  |  |  ------------------
  |  |  |  Branch (169:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  170|      0|            const ResourceId<T> free_id = _cur_free.ids[--_cur_free.nfree]; \
  |  |  171|      0|            *id = free_id;                                                  \
  |  |  172|      0|            BAIDU_RESOURCE_POOL_FREE_ITEM_NUM_SUB1;                         \
  |  |  173|      0|            return unsafe_address_resource(free_id);                        \
  |  |  174|      0|        }                                                                   \
  |  |  175|      0|        /* Fetch a FreeChunk from global.                                   \
  |  |  176|      0|           TODO: Popping from _free needs to copy a FreeChunk which is      \
  |  |  177|      0|           costly, but hardly impacts amortized performance. */             \
  |  |  178|      1|        if (_pool->pop_free_chunk(_cur_free)) {                             \
  |  |  ------------------
  |  |  |  Branch (178:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  179|      0|            --_cur_free.nfree;                                              \
  |  |  180|      0|            const ResourceId<T> free_id =  _cur_free.ids[_cur_free.nfree];  \
  |  |  181|      0|            *id = free_id;                                                  \
  |  |  182|      0|            BAIDU_RESOURCE_POOL_FREE_ITEM_NUM_SUB1;                         \
  |  |  183|      0|            return unsafe_address_resource(free_id);                        \
  |  |  184|      0|        }                                                                   \
  |  |  185|      1|        T* p = NULL;                                                        \
  |  |  186|      1|        /* Fetch memory from local block */                                 \
  |  |  187|      1|        if (_cur_block && _cur_block->nitem < BLOCK_NITEM) {                \
  |  |  ------------------
  |  |  |  Branch (187:13): [True: 0, False: 1]
  |  |  |  Branch (187:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  188|      0|            id->value = _cur_block_index * BLOCK_NITEM + _cur_block->nitem; \
  |  |  189|      0|            auto item = _cur_block->items + _cur_block->nitem;              \
  |  |  190|      0|            p = new (item->void_data()) T CTOR_ARGS;                        \
  |  |  191|      0|            if (!ResourcePoolValidator<T>::validate(p)) {                   \
  |  |  ------------------
  |  |  |  Branch (191:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  192|      0|                p->~T();                                                    \
  |  |  193|      0|                return NULL;                                                \
  |  |  194|      0|            }                                                               \
  |  |  195|      0|            ++_cur_block->nitem;                                            \
  |  |  196|      0|            return p;                                                       \
  |  |  197|      0|        }                                                                   \
  |  |  198|      1|        /* Fetch a Block from global */                                     \
  |  |  199|      1|        _cur_block = add_block(&_cur_block_index);                          \
  |  |  200|      1|        if (_cur_block != NULL) {                                           \
  |  |  ------------------
  |  |  |  Branch (200:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  201|      1|            id->value = _cur_block_index * BLOCK_NITEM + _cur_block->nitem; \
  |  |  202|      1|            auto item = _cur_block->items + _cur_block->nitem;              \
  |  |  203|      1|            p = new (item->void_data()) T CTOR_ARGS;                        \
  |  |  204|      1|            if (!ResourcePoolValidator<T>::validate(p)) {                   \
  |  |  ------------------
  |  |  |  Branch (204:17): [True: 0, False: 1]
  |  |  ------------------
  |  |  205|      0|                p->~T();                                                    \
  |  |  206|      0|                return NULL;                                                \
  |  |  207|      0|            }                                                               \
  |  |  208|      1|            ++_cur_block->nitem;                                            \
  |  |  209|      1|            return p;                                                       \
  |  |  210|      1|        }                                                                   \
  |  |  211|      1|        return NULL;                                                        \
  ------------------
  221|      0|        }
_ZN5butil12ResourcePoolIN4brpc6SocketEE14pop_free_chunkERNS_21ResourcePoolFreeChunkIS2_Lm78EEE:
  513|      1|    bool pop_free_chunk(FreeChunk& c) {
  514|       |        // Critical for the case that most return_object are called in
  515|       |        // different threads of get_object.
  516|      1|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (516:13): [True: 1, False: 0]
  ------------------
  517|      1|            return false;
  518|      1|        }
  519|      0|        pthread_mutex_lock(&_free_chunks_mutex);
  520|      0|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (520:13): [True: 0, False: 0]
  ------------------
  521|      0|            pthread_mutex_unlock(&_free_chunks_mutex);
  522|      0|            return false;
  523|      0|        }
  524|      0|        DynamicFreeChunk* p = _free_chunks.back();
  525|      0|        _free_chunks.pop_back();
  526|      0|        pthread_mutex_unlock(&_free_chunks_mutex);
  527|      0|        c.nfree = p->nfree;
  528|      0|        memcpy(c.ids, p->ids, sizeof(*p->ids) * p->nfree);
  529|      0|        free(p);
  530|      0|        return true;
  531|      0|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE9add_blockEPm:
  391|      1|    static Block* add_block(size_t* index) {
  392|      1|        Block* const new_block = new (std::nothrow) Block;
  393|      1|        if (NULL == new_block) {
  ------------------
  |  Branch (393:13): [True: 0, False: 1]
  ------------------
  394|      0|            return NULL;
  395|      0|        }
  396|       |
  397|      1|        size_t ngroup;
  398|      2|        do {
  399|      2|            ngroup = _ngroup.load(butil::memory_order_acquire);
  400|      2|            if (ngroup >= 1) {
  ------------------
  |  Branch (400:17): [True: 1, False: 1]
  ------------------
  401|      1|                BlockGroup* const g =
  402|      1|                    _block_groups[ngroup - 1].load(butil::memory_order_consume);
  403|      1|                const size_t block_index =
  404|      1|                    g->nblock.fetch_add(1, butil::memory_order_relaxed);
  405|      1|                if (block_index < RP_GROUP_NBLOCK) {
  ------------------
  |  Branch (405:21): [True: 1, False: 0]
  ------------------
  406|      1|                    g->blocks[block_index].store(
  407|      1|                        new_block, butil::memory_order_release);
  408|      1|                    *index = (ngroup - 1) * RP_GROUP_NBLOCK + block_index;
  409|      1|                    return new_block;
  410|      1|                }
  411|      0|                g->nblock.fetch_sub(1, butil::memory_order_relaxed);
  412|      0|            }
  413|      2|        } while (add_block_group(ngroup));
  ------------------
  |  Branch (413:18): [True: 1, False: 0]
  ------------------
  414|       |
  415|       |        // Fail to add_block_group.
  416|      0|        delete new_block;
  417|       |        return NULL;
  418|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE5BlockC2Ev:
  121|      1|        Block() : nitem(0) {}
_ZN5butil12ResourcePoolIN4brpc6SocketEE15add_block_groupEm:
  422|      1|    static bool add_block_group(size_t old_ngroup) {
  423|      1|        BlockGroup* bg = NULL;
  424|      1|        BAIDU_SCOPED_LOCK(_block_group_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|      1|        const size_t ngroup = _ngroup.load(butil::memory_order_acquire);
  426|      1|        if (ngroup != old_ngroup) {
  ------------------
  |  Branch (426:13): [True: 0, False: 1]
  ------------------
  427|       |            // Other thread got lock and added group before this thread.
  428|      0|            return true;
  429|      0|        }
  430|      1|        if (ngroup < RP_MAX_BLOCK_NGROUP) {
  ------------------
  |  Branch (430:13): [True: 1, False: 0]
  ------------------
  431|      1|            bg = new(std::nothrow) BlockGroup;
  432|      1|            if (NULL != bg) {
  ------------------
  |  Branch (432:17): [True: 1, False: 0]
  ------------------
  433|       |                // Release fence is paired with consume fence in address() and
  434|       |                // add_block() to avoid un-constructed bg to be seen by other
  435|       |                // threads.
  436|      1|                _block_groups[ngroup].store(bg, butil::memory_order_release);
  437|      1|                _ngroup.store(ngroup + 1, butil::memory_order_release);
  438|      1|            }
  439|      1|        }
  440|       |        return bg != NULL;
  441|      1|    }
_ZN5butil12ResourcePoolIN4brpc6SocketEE10BlockGroupC2Ev:
  131|      1|        BlockGroup() : nblock(0) {
  132|       |            // We fetch_add nblock in add_block() before setting the entry,
  133|       |            // thus address_resource() may sees the unset entry. Initialize
  134|       |            // all entries to NULL makes such address_resource() return NULL.
  135|      1|            memset(static_cast<void*>(blocks), 0, sizeof(butil::atomic<Block*>) * RP_GROUP_NBLOCK);
  136|      1|        }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE12get_resourceIJNS1_18VersionedRefWithIdIS2_E9ForbiddenEEEEPS2_PNS_10ResourceIdIS2_EEDpOT_:
  281|      1|    inline T* get_resource(ResourceId<T>* id, Args&&... args) {
  282|      1|        LocalPool* lp = get_or_new_local_pool();
  283|      1|        if (__builtin_expect(lp != NULL, 1)) {
  ------------------
  |  Branch (283:13): [True: 1, False: 0]
  ------------------
  284|      1|            return lp->get(id, std::forward<Args>(args)...);
  285|      1|        }
  286|      0|        return NULL;
  287|      1|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE9LocalPool3getIJNS1_18VersionedRefWithIdIS2_E9ForbiddenEEEEPS2_PNS_10ResourceIdIS2_EEDpOT_:
  219|      1|        inline T* get(ResourceId<T>* id, Args&&... args) {
  220|      3|            BAIDU_RESOURCE_POOL_GET((std::forward<Args>(args)...));
  ------------------
  |  |  169|      1|        if (_cur_free.nfree) {                                              \
  |  |  ------------------
  |  |  |  Branch (169:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  170|      0|            const ResourceId<T> free_id = _cur_free.ids[--_cur_free.nfree]; \
  |  |  171|      0|            *id = free_id;                                                  \
  |  |  172|      0|            BAIDU_RESOURCE_POOL_FREE_ITEM_NUM_SUB1;                         \
  |  |  173|      0|            return unsafe_address_resource(free_id);                        \
  |  |  174|      0|        }                                                                   \
  |  |  175|      0|        /* Fetch a FreeChunk from global.                                   \
  |  |  176|      0|           TODO: Popping from _free needs to copy a FreeChunk which is      \
  |  |  177|      0|           costly, but hardly impacts amortized performance. */             \
  |  |  178|      1|        if (_pool->pop_free_chunk(_cur_free)) {                             \
  |  |  ------------------
  |  |  |  Branch (178:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  179|      0|            --_cur_free.nfree;                                              \
  |  |  180|      0|            const ResourceId<T> free_id =  _cur_free.ids[_cur_free.nfree];  \
  |  |  181|      0|            *id = free_id;                                                  \
  |  |  182|      0|            BAIDU_RESOURCE_POOL_FREE_ITEM_NUM_SUB1;                         \
  |  |  183|      0|            return unsafe_address_resource(free_id);                        \
  |  |  184|      0|        }                                                                   \
  |  |  185|      1|        T* p = NULL;                                                        \
  |  |  186|      1|        /* Fetch memory from local block */                                 \
  |  |  187|      1|        if (_cur_block && _cur_block->nitem < BLOCK_NITEM) {                \
  |  |  ------------------
  |  |  |  Branch (187:13): [True: 0, False: 1]
  |  |  |  Branch (187:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  188|      0|            id->value = _cur_block_index * BLOCK_NITEM + _cur_block->nitem; \
  |  |  189|      0|            auto item = _cur_block->items + _cur_block->nitem;              \
  |  |  190|      0|            p = new (item->void_data()) T CTOR_ARGS;                        \
  |  |  191|      0|            if (!ResourcePoolValidator<T>::validate(p)) {                   \
  |  |  ------------------
  |  |  |  Branch (191:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  192|      0|                p->~T();                                                    \
  |  |  193|      0|                return NULL;                                                \
  |  |  194|      0|            }                                                               \
  |  |  195|      0|            ++_cur_block->nitem;                                            \
  |  |  196|      0|            return p;                                                       \
  |  |  197|      0|        }                                                                   \
  |  |  198|      1|        /* Fetch a Block from global */                                     \
  |  |  199|      1|        _cur_block = add_block(&_cur_block_index);                          \
  |  |  200|      1|        if (_cur_block != NULL) {                                           \
  |  |  ------------------
  |  |  |  Branch (200:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  201|      1|            id->value = _cur_block_index * BLOCK_NITEM + _cur_block->nitem; \
  |  |  202|      1|            auto item = _cur_block->items + _cur_block->nitem;              \
  |  |  203|      1|            p = new (item->void_data()) T CTOR_ARGS;                        \
  |  |  204|      1|            if (!ResourcePoolValidator<T>::validate(p)) {                   \
  |  |  ------------------
  |  |  |  Branch (204:17): [True: 0, False: 1]
  |  |  ------------------
  |  |  205|      0|                p->~T();                                                    \
  |  |  206|      0|                return NULL;                                                \
  |  |  207|      0|            }                                                               \
  |  |  208|      1|            ++_cur_block->nitem;                                            \
  |  |  209|      1|            return p;                                                       \
  |  |  210|      1|        }                                                                   \
  |  |  211|      1|        return NULL;                                                        \
  ------------------
  221|      0|        }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE14pop_free_chunkERNS_21ResourcePoolFreeChunkIS2_Lm256EEE:
  513|      1|    bool pop_free_chunk(FreeChunk& c) {
  514|       |        // Critical for the case that most return_object are called in
  515|       |        // different threads of get_object.
  516|      1|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (516:13): [True: 1, False: 0]
  ------------------
  517|      1|            return false;
  518|      1|        }
  519|      0|        pthread_mutex_lock(&_free_chunks_mutex);
  520|      0|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (520:13): [True: 0, False: 0]
  ------------------
  521|      0|            pthread_mutex_unlock(&_free_chunks_mutex);
  522|      0|            return false;
  523|      0|        }
  524|      0|        DynamicFreeChunk* p = _free_chunks.back();
  525|      0|        _free_chunks.pop_back();
  526|      0|        pthread_mutex_unlock(&_free_chunks_mutex);
  527|      0|        c.nfree = p->nfree;
  528|      0|        memcpy(c.ids, p->ids, sizeof(*p->ids) * p->nfree);
  529|      0|        free(p);
  530|      0|        return true;
  531|      0|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE9add_blockEPm:
  391|      1|    static Block* add_block(size_t* index) {
  392|      1|        Block* const new_block = new (std::nothrow) Block;
  393|      1|        if (NULL == new_block) {
  ------------------
  |  Branch (393:13): [True: 0, False: 1]
  ------------------
  394|      0|            return NULL;
  395|      0|        }
  396|       |
  397|      1|        size_t ngroup;
  398|      2|        do {
  399|      2|            ngroup = _ngroup.load(butil::memory_order_acquire);
  400|      2|            if (ngroup >= 1) {
  ------------------
  |  Branch (400:17): [True: 1, False: 1]
  ------------------
  401|      1|                BlockGroup* const g =
  402|      1|                    _block_groups[ngroup - 1].load(butil::memory_order_consume);
  403|      1|                const size_t block_index =
  404|      1|                    g->nblock.fetch_add(1, butil::memory_order_relaxed);
  405|      1|                if (block_index < RP_GROUP_NBLOCK) {
  ------------------
  |  Branch (405:21): [True: 1, False: 0]
  ------------------
  406|      1|                    g->blocks[block_index].store(
  407|      1|                        new_block, butil::memory_order_release);
  408|      1|                    *index = (ngroup - 1) * RP_GROUP_NBLOCK + block_index;
  409|      1|                    return new_block;
  410|      1|                }
  411|      0|                g->nblock.fetch_sub(1, butil::memory_order_relaxed);
  412|      0|            }
  413|      2|        } while (add_block_group(ngroup));
  ------------------
  |  Branch (413:18): [True: 1, False: 0]
  ------------------
  414|       |
  415|       |        // Fail to add_block_group.
  416|      0|        delete new_block;
  417|       |        return NULL;
  418|      1|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE5BlockC2Ev:
  121|      1|        Block() : nitem(0) {}
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE15add_block_groupEm:
  422|      1|    static bool add_block_group(size_t old_ngroup) {
  423|      1|        BlockGroup* bg = NULL;
  424|      1|        BAIDU_SCOPED_LOCK(_block_group_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|      1|        const size_t ngroup = _ngroup.load(butil::memory_order_acquire);
  426|      1|        if (ngroup != old_ngroup) {
  ------------------
  |  Branch (426:13): [True: 0, False: 1]
  ------------------
  427|       |            // Other thread got lock and added group before this thread.
  428|      0|            return true;
  429|      0|        }
  430|      1|        if (ngroup < RP_MAX_BLOCK_NGROUP) {
  ------------------
  |  Branch (430:13): [True: 1, False: 0]
  ------------------
  431|      1|            bg = new(std::nothrow) BlockGroup;
  432|      1|            if (NULL != bg) {
  ------------------
  |  Branch (432:17): [True: 1, False: 0]
  ------------------
  433|       |                // Release fence is paired with consume fence in address() and
  434|       |                // add_block() to avoid un-constructed bg to be seen by other
  435|       |                // threads.
  436|      1|                _block_groups[ngroup].store(bg, butil::memory_order_release);
  437|      1|                _ngroup.store(ngroup + 1, butil::memory_order_release);
  438|      1|            }
  439|      1|        }
  440|       |        return bg != NULL;
  441|      1|    }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE10BlockGroupC2Ev:
  131|      1|        BlockGroup() : nblock(0) {
  132|       |            // We fetch_add nblock in add_block() before setting the entry,
  133|       |            // thus address_resource() may sees the unset entry. Initialize
  134|       |            // all entries to NULL makes such address_resource() return NULL.
  135|      1|            memset(static_cast<void*>(blocks), 0, sizeof(butil::atomic<Block*>) * RP_GROUP_NBLOCK);
  136|      1|        }
_ZN5butil12ResourcePoolIN7bthread2IdEE9singletonEv:
  365|      1|    static inline ResourcePool* singleton() {
  366|      1|        ResourcePool* p = _singleton.load(butil::memory_order_consume);
  367|      1|        if (p) {
  ------------------
  |  Branch (367:13): [True: 0, False: 1]
  ------------------
  368|      0|            return p;
  369|      0|        }
  370|      1|        pthread_mutex_lock(&_singleton_mutex);
  371|      1|        p = _singleton.load(butil::memory_order_consume);
  372|      1|        if (!p) {
  ------------------
  |  Branch (372:13): [True: 1, False: 0]
  ------------------
  373|      1|            p = new ResourcePool();
  374|      1|            _singleton.store(p, butil::memory_order_release);
  375|      1|        } 
  376|      1|        pthread_mutex_unlock(&_singleton_mutex);
  377|      1|        return p;
  378|      1|    }
_ZN5butil12ResourcePoolIN7bthread2IdEEC2Ev:
  381|      1|    ResourcePool() {
  382|      1|        _free_chunks.reserve(RP_INITIAL_FREE_LIST_SIZE);
  383|       |        pthread_mutex_init(&_free_chunks_mutex, NULL);
  384|      1|    }
_ZN5butil12ResourcePoolIN7bthread2IdEE12get_resourceIJEEEPS2_PNS_10ResourceIdIS2_EEDpOT_:
  281|      1|    inline T* get_resource(ResourceId<T>* id, Args&&... args) {
  282|      1|        LocalPool* lp = get_or_new_local_pool();
  283|      1|        if (__builtin_expect(lp != NULL, 1)) {
  ------------------
  |  Branch (283:13): [True: 1, False: 0]
  ------------------
  284|      1|            return lp->get(id, std::forward<Args>(args)...);
  285|      1|        }
  286|      0|        return NULL;
  287|      1|    }
_ZN5butil12ResourcePoolIN7bthread2IdEE21get_or_new_local_poolEv:
  443|      1|    inline LocalPool* get_or_new_local_pool() {
  444|      1|	    LocalPool* lp = BAIDU_GET_VOLATILE_THREAD_LOCAL(_local_pool);
  ------------------
  |  |   69|      1|#define BAIDU_GET_VOLATILE_THREAD_LOCAL(var_name) get_##var_name()
  ------------------
  445|      1|        if (lp != NULL) {
  ------------------
  |  Branch (445:13): [True: 0, False: 1]
  ------------------
  446|      0|            return lp;
  447|      0|        }
  448|      1|        lp = new(std::nothrow) LocalPool(this);
  449|      1|        if (NULL == lp) {
  ------------------
  |  Branch (449:13): [True: 0, False: 1]
  ------------------
  450|      0|            return NULL;
  451|      0|        }
  452|      1|        BAIDU_SCOPED_LOCK(_change_thread_mutex); //avoid race with clear()
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|      1|	    BAIDU_SET_VOLATILE_THREAD_LOCAL(_local_pool, lp);
  ------------------
  |  |   71|      1|#define BAIDU_SET_VOLATILE_THREAD_LOCAL(var_name, value) set_##var_name(value)
  ------------------
  454|      1|        butil::thread_atexit(LocalPool::delete_local_pool, lp);
  455|      1|        _nlocal.fetch_add(1, butil::memory_order_relaxed);
  456|      1|        return lp;
  457|      1|    }
_ZN5butil12ResourcePoolIN7bthread2IdEE9LocalPoolC2EPS3_:
  144|      1|            : _pool(pool)
  145|      1|            , _cur_block(NULL)
  146|      1|            , _cur_block_index(0) {
  147|      1|            _cur_free.nfree = 0;
  148|      1|        }
_ZN5butil12ResourcePoolIN7bthread2IdEE9LocalPool3getEPNS_10ResourceIdIS2_EE:
  214|      1|        inline T* get(ResourceId<T>* id) {
  215|      3|            BAIDU_RESOURCE_POOL_GET();
  ------------------
  |  |  169|      1|        if (_cur_free.nfree) {                                              \
  |  |  ------------------
  |  |  |  Branch (169:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  170|      0|            const ResourceId<T> free_id = _cur_free.ids[--_cur_free.nfree]; \
  |  |  171|      0|            *id = free_id;                                                  \
  |  |  172|      0|            BAIDU_RESOURCE_POOL_FREE_ITEM_NUM_SUB1;                         \
  |  |  173|      0|            return unsafe_address_resource(free_id);                        \
  |  |  174|      0|        }                                                                   \
  |  |  175|      0|        /* Fetch a FreeChunk from global.                                   \
  |  |  176|      0|           TODO: Popping from _free needs to copy a FreeChunk which is      \
  |  |  177|      0|           costly, but hardly impacts amortized performance. */             \
  |  |  178|      1|        if (_pool->pop_free_chunk(_cur_free)) {                             \
  |  |  ------------------
  |  |  |  Branch (178:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  179|      0|            --_cur_free.nfree;                                              \
  |  |  180|      0|            const ResourceId<T> free_id =  _cur_free.ids[_cur_free.nfree];  \
  |  |  181|      0|            *id = free_id;                                                  \
  |  |  182|      0|            BAIDU_RESOURCE_POOL_FREE_ITEM_NUM_SUB1;                         \
  |  |  183|      0|            return unsafe_address_resource(free_id);                        \
  |  |  184|      0|        }                                                                   \
  |  |  185|      1|        T* p = NULL;                                                        \
  |  |  186|      1|        /* Fetch memory from local block */                                 \
  |  |  187|      1|        if (_cur_block && _cur_block->nitem < BLOCK_NITEM) {                \
  |  |  ------------------
  |  |  |  Branch (187:13): [True: 0, False: 1]
  |  |  |  Branch (187:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  188|      0|            id->value = _cur_block_index * BLOCK_NITEM + _cur_block->nitem; \
  |  |  189|      0|            auto item = _cur_block->items + _cur_block->nitem;              \
  |  |  190|      0|            p = new (item->void_data()) T CTOR_ARGS;                        \
  |  |  191|      0|            if (!ResourcePoolValidator<T>::validate(p)) {                   \
  |  |  ------------------
  |  |  |  Branch (191:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  192|      0|                p->~T();                                                    \
  |  |  193|      0|                return NULL;                                                \
  |  |  194|      0|            }                                                               \
  |  |  195|      0|            ++_cur_block->nitem;                                            \
  |  |  196|      0|            return p;                                                       \
  |  |  197|      0|        }                                                                   \
  |  |  198|      1|        /* Fetch a Block from global */                                     \
  |  |  199|      1|        _cur_block = add_block(&_cur_block_index);                          \
  |  |  200|      1|        if (_cur_block != NULL) {                                           \
  |  |  ------------------
  |  |  |  Branch (200:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  201|      1|            id->value = _cur_block_index * BLOCK_NITEM + _cur_block->nitem; \
  |  |  202|      1|            auto item = _cur_block->items + _cur_block->nitem;              \
  |  |  203|      1|            p = new (item->void_data()) T CTOR_ARGS;                        \
  |  |  204|      1|            if (!ResourcePoolValidator<T>::validate(p)) {                   \
  |  |  ------------------
  |  |  |  Branch (204:17): [True: 0, False: 1]
  |  |  ------------------
  |  |  205|      0|                p->~T();                                                    \
  |  |  206|      0|                return NULL;                                                \
  |  |  207|      0|            }                                                               \
  |  |  208|      1|            ++_cur_block->nitem;                                            \
  |  |  209|      1|            return p;                                                       \
  |  |  210|      1|        }                                                                   \
  |  |  211|      1|        return NULL;                                                        \
  ------------------
  216|      0|        }
_ZN5butil12ResourcePoolIN7bthread2IdEE14pop_free_chunkERNS_21ResourcePoolFreeChunkIS2_Lm256EEE:
  513|      1|    bool pop_free_chunk(FreeChunk& c) {
  514|       |        // Critical for the case that most return_object are called in
  515|       |        // different threads of get_object.
  516|      1|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (516:13): [True: 1, False: 0]
  ------------------
  517|      1|            return false;
  518|      1|        }
  519|      0|        pthread_mutex_lock(&_free_chunks_mutex);
  520|      0|        if (_free_chunks.empty()) {
  ------------------
  |  Branch (520:13): [True: 0, False: 0]
  ------------------
  521|      0|            pthread_mutex_unlock(&_free_chunks_mutex);
  522|      0|            return false;
  523|      0|        }
  524|      0|        DynamicFreeChunk* p = _free_chunks.back();
  525|      0|        _free_chunks.pop_back();
  526|      0|        pthread_mutex_unlock(&_free_chunks_mutex);
  527|      0|        c.nfree = p->nfree;
  528|      0|        memcpy(c.ids, p->ids, sizeof(*p->ids) * p->nfree);
  529|      0|        free(p);
  530|      0|        return true;
  531|      0|    }
_ZN5butil12ResourcePoolIN7bthread2IdEE9add_blockEPm:
  391|      1|    static Block* add_block(size_t* index) {
  392|      1|        Block* const new_block = new (std::nothrow) Block;
  393|      1|        if (NULL == new_block) {
  ------------------
  |  Branch (393:13): [True: 0, False: 1]
  ------------------
  394|      0|            return NULL;
  395|      0|        }
  396|       |
  397|      1|        size_t ngroup;
  398|      2|        do {
  399|      2|            ngroup = _ngroup.load(butil::memory_order_acquire);
  400|      2|            if (ngroup >= 1) {
  ------------------
  |  Branch (400:17): [True: 1, False: 1]
  ------------------
  401|      1|                BlockGroup* const g =
  402|      1|                    _block_groups[ngroup - 1].load(butil::memory_order_consume);
  403|      1|                const size_t block_index =
  404|      1|                    g->nblock.fetch_add(1, butil::memory_order_relaxed);
  405|      1|                if (block_index < RP_GROUP_NBLOCK) {
  ------------------
  |  Branch (405:21): [True: 1, False: 0]
  ------------------
  406|      1|                    g->blocks[block_index].store(
  407|      1|                        new_block, butil::memory_order_release);
  408|      1|                    *index = (ngroup - 1) * RP_GROUP_NBLOCK + block_index;
  409|      1|                    return new_block;
  410|      1|                }
  411|      0|                g->nblock.fetch_sub(1, butil::memory_order_relaxed);
  412|      0|            }
  413|      2|        } while (add_block_group(ngroup));
  ------------------
  |  Branch (413:18): [True: 1, False: 0]
  ------------------
  414|       |
  415|       |        // Fail to add_block_group.
  416|      0|        delete new_block;
  417|       |        return NULL;
  418|      1|    }
_ZN5butil12ResourcePoolIN7bthread2IdEE5BlockC2Ev:
  121|      1|        Block() : nitem(0) {}
_ZN5butil12ResourcePoolIN7bthread2IdEE15add_block_groupEm:
  422|      1|    static bool add_block_group(size_t old_ngroup) {
  423|      1|        BlockGroup* bg = NULL;
  424|      1|        BAIDU_SCOPED_LOCK(_block_group_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|      1|        const size_t ngroup = _ngroup.load(butil::memory_order_acquire);
  426|      1|        if (ngroup != old_ngroup) {
  ------------------
  |  Branch (426:13): [True: 0, False: 1]
  ------------------
  427|       |            // Other thread got lock and added group before this thread.
  428|      0|            return true;
  429|      0|        }
  430|      1|        if (ngroup < RP_MAX_BLOCK_NGROUP) {
  ------------------
  |  Branch (430:13): [True: 1, False: 0]
  ------------------
  431|      1|            bg = new(std::nothrow) BlockGroup;
  432|      1|            if (NULL != bg) {
  ------------------
  |  Branch (432:17): [True: 1, False: 0]
  ------------------
  433|       |                // Release fence is paired with consume fence in address() and
  434|       |                // add_block() to avoid un-constructed bg to be seen by other
  435|       |                // threads.
  436|      1|                _block_groups[ngroup].store(bg, butil::memory_order_release);
  437|      1|                _ngroup.store(ngroup + 1, butil::memory_order_release);
  438|      1|            }
  439|      1|        }
  440|       |        return bg != NULL;
  441|      1|    }
_ZN5butil12ResourcePoolIN7bthread2IdEE10BlockGroupC2Ev:
  131|      1|        BlockGroup() : nblock(0) {
  132|       |            // We fetch_add nblock in add_block() before setting the entry,
  133|       |            // thus address_resource() may sees the unset entry. Initialize
  134|       |            // all entries to NULL makes such address_resource() return NULL.
  135|      1|            memset(static_cast<void*>(blocks), 0, sizeof(butil::atomic<Block*>) * RP_GROUP_NBLOCK);
  136|      1|        }

_ZNSt10lock_guardI15pthread_mutex_tEC2ERS0_:
  155|    119|    explicit lock_guard(pthread_mutex_t & mutex) : _pmutex(&mutex) {
  156|    119|#if !defined(NDEBUG)
  157|    119|        const int rc = pthread_mutex_lock(_pmutex);
  158|    119|        if (rc) {
  ------------------
  |  Branch (158:13): [True: 0, False: 119]
  ------------------
  159|      0|            LOG(FATAL) << "Fail to lock pthread_mutex_t=" << _pmutex << ", " << berror(rc);
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|      0|            _pmutex = NULL;
  161|      0|        }
  162|       |#else
  163|       |        pthread_mutex_lock(_pmutex);
  164|       |#endif  // NDEBUG
  165|    119|    }
_ZNSt10lock_guardI15pthread_mutex_tED2Ev:
  167|    119|    ~lock_guard() {
  168|    119|#ifndef NDEBUG
  169|    119|        if (_pmutex) {
  ------------------
  |  Branch (169:13): [True: 119, False: 0]
  ------------------
  170|    119|            pthread_mutex_unlock(_pmutex);
  171|    119|        }
  172|       |#else
  173|       |        pthread_mutex_unlock(_pmutex);
  174|       |#endif
  175|    119|    }

_ZN5butil11PtAllocator5AllocEm:
   35|     64|    void* Alloc(size_t n) { return malloc(n); }
_ZN5butil18SingleThreadedPoolILm56ELm1024ELm16ENS_11PtAllocatorEEC2ERKS1_:
   65|     64|        : _free_nodes(NULL), _blocks(NULL), _allocator(alloc) {}
_ZN5butil18SingleThreadedPoolILm56ELm1024ELm16ENS_11PtAllocatorEE13get_allocatorEv:
  136|     64|    Allocator& get_allocator() { return _allocator; }

_ZN5butil8internal5rfindERKNS_16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcm:
  187|      1|size_t rfind(const StringPiece& self, char c, size_t pos) {
  188|      1|  return rfindT(self, c, pos);
  189|      1|}
_ZN5butil8internal12find_last_ofERKNS_16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESA_m:
  300|      1|size_t find_last_of(const StringPiece& self, const StringPiece& s, size_t pos) {
  301|      1|  if (self.size() == 0 || s.size() == 0)
  ------------------
  |  Branch (301:7): [True: 0, False: 1]
  |  Branch (301:27): [True: 0, False: 1]
  ------------------
  302|      0|    return StringPiece::npos;
  303|       |
  304|       |  // Avoid the cost of BuildLookupTable() for a single-character search.
  305|      1|  if (s.size() == 1)
  ------------------
  |  Branch (305:7): [True: 0, False: 1]
  ------------------
  306|      0|    return rfind(self, s.data()[0], pos);
  307|       |
  308|      1|  bool lookup[UCHAR_MAX + 1] = { false };
  309|      1|  BuildLookupTable(s, lookup);
  310|      4|  for (size_t i = std::min(pos, self.size() - 1); ; --i) {
  311|      4|    if (lookup[static_cast<unsigned char>(self.data()[i])])
  ------------------
  |  Branch (311:9): [True: 1, False: 3]
  ------------------
  312|      1|      return i;
  313|      3|    if (i == 0)
  ------------------
  |  Branch (313:9): [True: 0, False: 3]
  ------------------
  314|      0|      break;
  315|      3|  }
  316|      0|  return StringPiece::npos;
  317|      1|}
string_piece.cc:_ZN5butil12_GLOBAL__N_116BuildLookupTableERKNS_16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPb:
   23|      1|                             bool* table) {
   24|      1|  const size_t length = characters_wanted.length();
   25|      1|  const char* const data = characters_wanted.data();
   26|      3|  for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (26:22): [True: 2, False: 1]
  ------------------
   27|      2|    table[static_cast<unsigned char>(data[i])] = true;
   28|      2|  }
   29|      1|}
_ZN5butil8internal6rfindTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEmRKNS_16BasicStringPieceIT_EENS9_10value_typeEm:
  173|      1|              size_t pos) {
  174|      1|  if (self.size() == 0)
  ------------------
  |  Branch (174:7): [True: 0, False: 1]
  ------------------
  175|      0|    return BasicStringPiece<STR>::npos;
  176|       |
  177|      1|  for (size_t i = std::min(pos, self.size() - 1); ;
  178|     16|       --i) {
  179|     16|    if (self.data()[i] == c)
  ------------------
  |  Branch (179:9): [True: 1, False: 15]
  ------------------
  180|      1|      return i;
  181|     15|    if (i == 0)
  ------------------
  |  Branch (181:9): [True: 0, False: 15]
  ------------------
  182|      0|      break;
  183|     15|  }
  184|      0|  return BasicStringPiece<STR>::npos;
  185|      1|}

_ZN5butil9back_charERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  468|     55|inline char back_char(const std::string& s) { return s[s.size() - 1]; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4dataEv:
  208|    643|  const value_type* data() const { return ptr_; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4sizeEv:
  209|    691|  size_type size() const { return length_; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE6lengthEv:
  210|      1|  size_type length() const { return length_; }
_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE13remove_suffixEm:
  238|      1|  void remove_suffix(size_type n) {
  239|      1|    length_ -= n;
  240|      1|  }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5emptyEv:
  211|     62|  bool empty() const { return length_ == 0; }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE12find_last_ofERKS7_m:
  357|      1|                         size_type pos = BasicStringPiece::npos) const {
  358|      1|    return internal::find_last_of(*this, s, pos);
  359|      1|  }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE12find_last_ofEcm:
  361|      1|                         size_type pos = BasicStringPiece::npos) const {
  362|      1|    return rfind(c, pos);
  363|      1|  }
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5rfindEcm:
  333|      1|  size_type rfind(value_type c, size_type pos = BasicStringPiece::npos) const {
  334|      1|    return internal::rfind(*this, c, pos);
  335|      1|  }
_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE13remove_prefixEm:
  233|      1|  void remove_prefix(size_type n) {
  234|      1|    ptr_ += n;
  235|      1|    length_ -= n;
  236|      1|  }
_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2EPKc:
  186|     33|      : ptr_(str),
  187|     33|        length_((str == NULL) ? 0 : STRING_TYPE::traits_type::length(str)) {}
  ------------------
  |  Branch (187:17): [True: 0, False: 33]
  ------------------
_ZNK5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEixEm:
  231|      1|  value_type operator[](size_type i) const { return ptr_[i]; }
_ZN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Ev:
  184|     31|  BasicStringPiece() : ptr_(NULL), length_(0) {}

_ZN5butil5MutexC2Ev:
   50|    137|    Mutex() {
   51|       |#if defined(OS_WIN)
   52|       |    // The second parameter is the spin count, for short-held locks it avoid the
   53|       |    // contending thread from going to sleep which helps performance greatly.
   54|       |        ::InitializeCriticalSectionAndSpinCount(&_native_handle, 2000);
   55|       |#elif defined(OS_POSIX)
   56|       |        pthread_mutex_init(&_native_handle, NULL);
   57|    137|#endif
   58|    137|    }
_ZN5butil5Mutex4lockEv:
   70|     65|    void lock() {
   71|       |#if defined(OS_WIN)
   72|       |        ::EnterCriticalSection(&_native_handle);
   73|       |#elif defined(OS_POSIX)
   74|       |        pthread_mutex_lock(&_native_handle);
   75|     65|#endif
   76|     65|    }
_ZN5butil5Mutex6unlockEv:
   80|     65|    void unlock() {
   81|       |#if defined(OS_WIN)
   82|       |        ::LeaveCriticalSection(&_native_handle);
   83|       |#elif defined(OS_POSIX)
   84|       |        pthread_mutex_unlock(&_native_handle);
   85|     65|#endif
   86|     65|    }
_ZN5butil4LockC2Ev:
  126|    112|    Lock() {}
_ZN5butil4Lock7AcquireEv:
  128|     39|    void Acquire() { lock(); }
_ZN5butil4Lock7ReleaseEv:
  129|     39|    void Release() { unlock(); }
_ZNK5butil4Lock14AssertAcquiredEv:
  131|     39|    void AssertAcquired() const {}
_ZN5butil8AutoLockC2ERNS_4LockE:
  139|     39|    explicit AutoLock(Lock& lock) : lock_(lock) {
  140|     39|        lock_.Acquire();
  141|     39|    }
_ZN5butil8AutoLockD2Ev:
  147|     39|    ~AutoLock() {
  148|     39|        lock_.AssertAcquired();
  149|     39|        lock_.Release();
  150|     39|    }

_ZN5butil6detail29get_or_new_thread_exit_helperEv:
   99|      9|detail::ThreadExitHelper* get_or_new_thread_exit_helper() {
  100|      9|    pthread_once(&detail::thread_atexit_once, detail::make_thread_atexit_key);
  101|       |
  102|      9|    detail::ThreadExitHelper* h =
  103|      9|        (detail::ThreadExitHelper*)pthread_getspecific(detail::thread_atexit_key);
  104|      9|    if (NULL == h) {
  ------------------
  |  Branch (104:9): [True: 2, False: 7]
  ------------------
  105|      2|        h = new (std::nothrow) detail::ThreadExitHelper;
  106|      2|        if (NULL != h) {
  ------------------
  |  Branch (106:13): [True: 2, False: 0]
  ------------------
  107|      2|            pthread_setspecific(detail::thread_atexit_key, h);
  108|      2|        }
  109|      2|    }
  110|      9|    return h;
  111|      9|}
_ZN5butil13thread_atexitEPFvPvES0_:
  124|      9|int thread_atexit(void (*fn)(void*), void* arg) {
  125|      9|    if (NULL == fn) {
  ------------------
  |  Branch (125:9): [True: 0, False: 9]
  ------------------
  126|      0|        errno = EINVAL;
  127|      0|        return -1;
  128|      0|    }
  129|      9|    detail::ThreadExitHelper* h = detail::get_or_new_thread_exit_helper();
  130|      9|    if (h) {
  ------------------
  |  Branch (130:9): [True: 9, False: 0]
  ------------------
  131|      9|        return h->add(fn, arg);
  132|      9|    }
  133|      9|    errno = ENOMEM;
  134|      0|    return -1;
  135|      9|}
_ZN5butil13thread_atexitEPFvvE:
  137|      4|int thread_atexit(void (*fn)()) {
  138|      4|    if (NULL == fn) {
  ------------------
  |  Branch (138:9): [True: 0, False: 4]
  ------------------
  139|      0|        errno = EINVAL;
  140|      0|        return -1;
  141|      0|    }
  142|      4|    return thread_atexit(detail::call_single_arg_fn, (void*)fn);
  143|      4|}
thread_local.cpp:_ZN5butil6detailL22make_thread_atexit_keyEv:
   89|      2|static void make_thread_atexit_key() {
   90|      2|    if (pthread_key_create(&thread_atexit_key, delete_thread_exit_helper) != 0) {
  ------------------
  |  Branch (90:9): [True: 0, False: 2]
  ------------------
   91|      0|        fprintf(stderr, "Fail to create thread_atexit_key, abort\n");
   92|      0|        abort();
   93|      0|    }
   94|       |    // If caller is not pthread, delete_thread_exit_helper will not be called.
   95|       |    // We have to rely on atexit().
   96|      2|    atexit(helper_exit_global);
   97|      2|}
_ZN5butil6detail16ThreadExitHelper3addEPFvPvES2_:
   45|      9|    int add(Fn fn, void* arg) {
   46|      9|        try {
   47|      9|            if (_fns.capacity() < 16) {
  ------------------
  |  Branch (47:17): [True: 2, False: 7]
  ------------------
   48|      2|                _fns.reserve(16);
   49|      2|            }
   50|      9|            _fns.emplace_back(fn, arg);
   51|      9|        } catch (...) {
   52|      0|            errno = ENOMEM;
   53|      0|            return -1;
   54|      0|        }
   55|      9|        return 0;
   56|      9|    }

_ZN5butil12ResourcePoolIN4brpc6SocketEE15get__local_poolEv:
   51|      1|   static __attribute__((noinline, unused)) type get_##var_name(void) {         \
   52|      1|     asm volatile("");                                                          \
   53|      1|     return var_name;                                                           \
   54|      1|   }                                                                            \
_ZN5butil12ResourcePoolIN4brpc6SocketEE15set__local_poolEPNS3_9LocalPoolE:
   60|      1|   static __attribute__((noinline, unused)) void set_##var_name(type v) {       \
   61|      1|     asm volatile("");                                                          \
   62|      1|     var_name = v;                                                              \
   63|      1|   }
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE15get__local_poolEv:
   51|      1|   static __attribute__((noinline, unused)) type get_##var_name(void) {         \
   52|      1|     asm volatile("");                                                          \
   53|      1|     return var_name;                                                           \
   54|      1|   }                                                                            \
_ZN5butil12ResourcePoolIN4brpc11IOEventDataEE15set__local_poolEPNS3_9LocalPoolE:
   60|      1|   static __attribute__((noinline, unused)) void set_##var_name(type v) {       \
   61|      1|     asm volatile("");                                                          \
   62|      1|     var_name = v;                                                              \
   63|      1|   }
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE15get__local_poolEv:
   51|    108|   static __attribute__((noinline, unused)) type get_##var_name(void) {         \
   52|    108|     asm volatile("");                                                          \
   53|    108|     return var_name;                                                           \
   54|    108|   }                                                                            \
_ZN5butil10ObjectPoolIN4brpc6policy17MostCommonMessageEE15set__local_poolEPNS4_9LocalPoolE:
   60|      1|   static __attribute__((noinline, unused)) void set_##var_name(type v) {       \
   61|      1|     asm volatile("");                                                          \
   62|      1|     var_name = v;                                                              \
   63|      1|   }
_ZN7bthread18get_tls_task_groupEv:
   35|      2|  __attribute__((noinline, unused)) type get_##var_name(void) {                \
   36|      2|    asm volatile("");                                                          \
   37|      2|    return var_name;                                                           \
   38|      2|  }                                                                            \
_ZN5butil10ObjectPoolIN7bthread5ButexEE15get__local_poolEv:
   51|      3|   static __attribute__((noinline, unused)) type get_##var_name(void) {         \
   52|      3|     asm volatile("");                                                          \
   53|      3|     return var_name;                                                           \
   54|      3|   }                                                                            \
_ZN5butil10ObjectPoolIN7bthread5ButexEE15set__local_poolEPNS3_9LocalPoolE:
   60|      1|   static __attribute__((noinline, unused)) void set_##var_name(type v) {       \
   61|      1|     asm volatile("");                                                          \
   62|      1|     var_name = v;                                                              \
   63|      1|   }
_ZN5butil12ResourcePoolIN7bthread2IdEE15get__local_poolEv:
   51|      1|   static __attribute__((noinline, unused)) type get_##var_name(void) {         \
   52|      1|     asm volatile("");                                                          \
   53|      1|     return var_name;                                                           \
   54|      1|   }                                                                            \
_ZN5butil12ResourcePoolIN7bthread2IdEE15set__local_poolEPNS3_9LocalPoolE:
   60|      1|   static __attribute__((noinline, unused)) void set_##var_name(type v) {       \
   61|      1|     asm volatile("");                                                          \
   62|      1|     var_name = v;                                                              \
   63|      1|   }

_ZN5butil14PlatformThread13SetNameSimpleEPKc:
   60|      2|void PlatformThread::SetNameSimple(const char* name) {
   61|      2|#if !defined(OS_NACL)
   62|       |  // On linux we can get the thread names to show up in the debugger by setting
   63|       |  // the process name for the LWP.  We don't want to do this for the main
   64|       |  // thread because that would rename the process, causing tools like killall
   65|       |  // to stop working.
   66|      2|  if (PlatformThread::CurrentId() == getpid())
  ------------------
  |  Branch (66:7): [True: 0, False: 2]
  ------------------
   67|      0|    return;
   68|       |
   69|       |  // http://0pointer.de/blog/projects/name-your-threads.html
   70|       |  // Set the name for the LWP (which gets truncated to 15 characters).
   71|       |  // Note that glibc also has a 'pthread_setname_np' api, but it may not be
   72|       |  // available everywhere and it's only benefit over using prctl directly is
   73|       |  // that it can set the name of threads other than the current thread.
   74|      2|  int err = prctl(PR_SET_NAME, name);
   75|       |  // We expect EPERM failures in sandboxed processes, just ignore those.
   76|      2|  if (err < 0 && errno != EPERM)
  ------------------
  |  Branch (76:7): [True: 0, False: 2]
  |  Branch (76:18): [True: 0, False: 0]
  ------------------
   77|      0|    DPLOG(ERROR) << "prctl(PR_SET_NAME)";
  ------------------
  |  |  749|      0|    BAIDU_LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|      2|#endif  //  !defined(OS_NACL)
   79|      2|}

_ZN5butil14PlatformThread9CurrentIdEv:
  145|      2|PlatformThreadId PlatformThread::CurrentId() {
  146|       |  // Pthreads doesn't have the concept of a thread ID, so we have to reach down
  147|       |  // into the kernel.
  148|       |#if defined(OS_MACOSX)
  149|       |  return pthread_mach_thread_np(pthread_self());
  150|       |#elif defined(OS_LINUX)
  151|      2|  return syscall(__NR_gettid);
  152|       |#elif defined(OS_ANDROID)
  153|       |  return gettid();
  154|       |#elif defined(OS_SOLARIS) || defined(OS_QNX)
  155|       |  return pthread_self();
  156|       |#elif defined(OS_NACL) && defined(__GLIBC__)
  157|       |  return pthread_self();
  158|       |#elif defined(OS_NACL) && !defined(__GLIBC__)
  159|       |  // Pointers are 32-bits in NaCl.
  160|       |  return reinterpret_cast<int32_t>(pthread_self());
  161|       |#elif defined(OS_POSIX)
  162|       |  return reinterpret_cast<int64_t>(pthread_self());
  163|       |#endif
  164|      2|}

_ZN5butil15cpuwide_time_nsEv:
  281|     12|inline int64_t cpuwide_time_ns() {
  282|     12|#if !defined(BAIDU_INTERNAL)
  283|       |    // nearly impossible to get the correct invariant cpu frequency on
  284|       |    // different CPU and machines. CPU-ID rarely works and frequencies
  285|       |    // in "model name" and "cpu Mhz" are both unreliable.
  286|       |    // Since clock_gettime() in newer glibc/kernel is much faster(~30ns)
  287|       |    // which is closer to the previous impl. of cpuwide_time(~10ns), we
  288|       |    // simply use the monotonic time to get rid of all related issues.
  289|     12|    timespec now;
  290|     12|    clock_gettime(CLOCK_MONOTONIC, &now);
  291|     12|    return now.tv_sec * 1000000000L + now.tv_nsec;
  292|       |#else
  293|       |    int64_t cpu_freq = detail::invariant_cpu_freq;
  294|       |    if (cpu_freq > 0) {
  295|       |        const uint64_t tsc = detail::clock_cycles();
  296|       |        //Try to avoid overflow
  297|       |        const uint64_t sec = tsc / cpu_freq;
  298|       |        const uint64_t remain = tsc % cpu_freq;
  299|       |        // TODO: should be OK until CPU's frequency exceeds 16GHz.
  300|       |        return remain * 1000000000L / cpu_freq + sec * 1000000000L;
  301|       |    } else if (!cpu_freq) {
  302|       |        // Lack of necessary features, return system-wide monotonic time instead.
  303|       |        return monotonic_time_ns();
  304|       |    } else {
  305|       |        // Use a thread-unsafe method(OK to us) to initialize the freq
  306|       |        // to save a "if" test comparing to using a local static variable
  307|       |        detail::invariant_cpu_freq = detail::read_invariant_cpu_frequency();
  308|       |        return cpuwide_time_ns();
  309|       |    }
  310|       |#endif // defined(BAIDU_INTERNAL)
  311|     12|}
_ZN5butil15cpuwide_time_usEv:
  321|     12|inline int64_t cpuwide_time_us() {
  322|     12|    return cpuwide_time_ns() / 1000L;
  323|     12|}

_ZN4bvar20DisplaySamplingRatioC2EPKcPKNS_19CollectorSpeedLimitE:
  439|      2|    : _var(name, get_sampling_ratio, (void*)sl) {
  440|      2|}
collector.cpp:_ZN4bvarL18get_sampling_ratioEPv:
  432|      2|static double get_sampling_ratio(void* arg) {
  433|      2|    return ((const CollectorSpeedLimit*)arg)->sampling_range /
  434|      2|        (double)COLLECTOR_SAMPLING_BASE;
  435|      2|}

_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIllNS0_5AddToIlEEE5AgentEE16create_new_agentEv:
   89|      5|    inline static AgentId create_new_agent() {
   90|      5|        BAIDU_SCOPED_LOCK(_s_mutex);
  ------------------
  |  |   47|      5|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      5|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      5|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      5|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      5|        AgentId agent_id = 0;
   92|      5|        if (!_get_free_ids().empty()) {
  ------------------
  |  Branch (92:13): [True: 0, False: 5]
  ------------------
   93|      0|            agent_id = _get_free_ids().back();
   94|      0|            _get_free_ids().pop_back();
   95|      5|        } else {
   96|      5|            agent_id = _s_agent_kinds++;
   97|      5|        }
   98|      5|        return agent_id;
   99|      5|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIllNS0_5AddToIlEEE5AgentEE13_get_free_idsEv:
  172|      5|    inline static std::deque<AgentId> &_get_free_ids() {
  173|      5|        if (__builtin_expect(!_s_free_ids, 0)) {
  ------------------
  |  Branch (173:13): [True: 1, False: 4]
  ------------------
  174|      1|            _s_free_ids = new (std::nothrow) std::deque<AgentId>();
  175|      1|            RELEASE_ASSERT(_s_free_ids);
  ------------------
  |  |  476|      1|    do {                            \
  |  |  477|      1|        if (!(condition)) {         \
  |  |  ------------------
  |  |  |  Branch (477:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  478|      0|            ::abort();              \
  |  |  479|      0|        }                           \
  |  |  480|      1|    } while (false)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  176|      1|        }
  177|      5|        return *_s_free_ids;
  178|      5|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIiiNS0_5AddToIiEEE5AgentEE16create_new_agentEv:
   89|      1|    inline static AgentId create_new_agent() {
   90|      1|        BAIDU_SCOPED_LOCK(_s_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      1|        AgentId agent_id = 0;
   92|      1|        if (!_get_free_ids().empty()) {
  ------------------
  |  Branch (92:13): [True: 0, False: 1]
  ------------------
   93|      0|            agent_id = _get_free_ids().back();
   94|      0|            _get_free_ids().pop_back();
   95|      1|        } else {
   96|      1|            agent_id = _s_agent_kinds++;
   97|      1|        }
   98|      1|        return agent_id;
   99|      1|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIiiNS0_5AddToIiEEE5AgentEE13_get_free_idsEv:
  172|      1|    inline static std::deque<AgentId> &_get_free_ids() {
  173|      1|        if (__builtin_expect(!_s_free_ids, 0)) {
  ------------------
  |  Branch (173:13): [True: 1, False: 0]
  ------------------
  174|      1|            _s_free_ids = new (std::nothrow) std::deque<AgentId>();
  175|      1|            RELEASE_ASSERT(_s_free_ids);
  ------------------
  |  |  476|      1|    do {                            \
  |  |  477|      1|        if (!(condition)) {         \
  |  |  ------------------
  |  |  |  Branch (477:13): [True: 0, False: 1]
  |  |  ------------------
  |  |  478|      0|            ::abort();              \
  |  |  479|      0|        }                           \
  |  |  480|      1|    } while (false)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  176|      1|        }
  177|      1|        return *_s_free_ids;
  178|      1|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIllNS0_5AddToIlEEE5AgentEE13get_tls_agentEi:
  114|      1|    inline static Agent* get_tls_agent(AgentId id) {
  115|      1|        if (__builtin_expect(id >= 0, 1)) {
  ------------------
  |  Branch (115:13): [True: 1, False: 0]
  ------------------
  116|      1|            if (_s_tls_blocks) {
  ------------------
  |  Branch (116:17): [True: 0, False: 1]
  ------------------
  117|      0|                const size_t block_id = (size_t)id / ELEMENTS_PER_BLOCK;
  118|      0|                if (block_id < _s_tls_blocks->size()) {
  ------------------
  |  Branch (118:21): [True: 0, False: 0]
  ------------------
  119|      0|                    ThreadBlock* const tb = (*_s_tls_blocks)[block_id];
  120|      0|                    if (tb) {
  ------------------
  |  Branch (120:25): [True: 0, False: 0]
  ------------------
  121|      0|                        return tb->at(id - block_id * ELEMENTS_PER_BLOCK);
  122|      0|                    }
  123|      0|                }
  124|      0|            }
  125|      1|        }
  126|      1|        return NULL;
  127|      1|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIllNS0_5AddToIlEEE5AgentEE11ThreadBlock2atEm:
   83|      1|        inline Agent* at(size_t offset) { return _agents + offset; };
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIllNS0_5AddToIlEEE5AgentEE23get_or_create_tls_agentEi:
  130|      1|    inline static Agent* get_or_create_tls_agent(AgentId id) {
  131|      1|        if (__builtin_expect(id < 0, 0)) {
  ------------------
  |  Branch (131:13): [True: 0, False: 1]
  ------------------
  132|      0|            CHECK(false) << "Invalid id=" << id;
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  133|      0|            return NULL;
  134|      0|        }
  135|      1|        if (_s_tls_blocks == NULL) {
  ------------------
  |  Branch (135:13): [True: 1, False: 0]
  ------------------
  136|      1|            _s_tls_blocks = new (std::nothrow) std::vector<ThreadBlock *>;
  137|      1|            if (__builtin_expect(_s_tls_blocks == NULL, 0)) {
  ------------------
  |  Branch (137:17): [True: 0, False: 1]
  ------------------
  138|      0|                LOG(FATAL) << "Fail to create vector, " << berror();
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|      0|                return NULL;
  140|      0|            }
  141|      1|            butil::thread_atexit(_destroy_tls_blocks);
  142|      1|        }
  143|      1|        const size_t block_id = (size_t)id / ELEMENTS_PER_BLOCK; 
  144|      1|        if (block_id >= _s_tls_blocks->size()) {
  ------------------
  |  Branch (144:13): [True: 1, False: 0]
  ------------------
  145|       |            // The 32ul avoid pointless small resizes.
  146|      1|            _s_tls_blocks->resize(std::max(block_id + 1, 32ul));
  147|      1|        }
  148|      1|        ThreadBlock* tb = (*_s_tls_blocks)[block_id];
  149|      1|        if (tb == NULL) {
  ------------------
  |  Branch (149:13): [True: 1, False: 0]
  ------------------
  150|      1|            ThreadBlock *new_block = new (std::nothrow) ThreadBlock;
  151|      1|            if (__builtin_expect(new_block == NULL, 0)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 1]
  ------------------
  152|      0|                return NULL;
  153|      0|            }
  154|      1|            tb = new_block;
  155|      1|            (*_s_tls_blocks)[block_id] = new_block;
  156|      1|        }
  157|      1|        return tb->at(id - block_id * ELEMENTS_PER_BLOCK);
  158|      1|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE16create_new_agentEv:
   89|      2|    inline static AgentId create_new_agent() {
   90|      2|        BAIDU_SCOPED_LOCK(_s_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      2|        AgentId agent_id = 0;
   92|      2|        if (!_get_free_ids().empty()) {
  ------------------
  |  Branch (92:13): [True: 0, False: 2]
  ------------------
   93|      0|            agent_id = _get_free_ids().back();
   94|      0|            _get_free_ids().pop_back();
   95|      2|        } else {
   96|      2|            agent_id = _s_agent_kinds++;
   97|      2|        }
   98|      2|        return agent_id;
   99|      2|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE13_get_free_idsEv:
  172|      2|    inline static std::deque<AgentId> &_get_free_ids() {
  173|      2|        if (__builtin_expect(!_s_free_ids, 0)) {
  ------------------
  |  Branch (173:13): [True: 2, False: 0]
  ------------------
  174|      2|            _s_free_ids = new (std::nothrow) std::deque<AgentId>();
  175|      2|            RELEASE_ASSERT(_s_free_ids);
  ------------------
  |  |  476|      2|    do {                            \
  |  |  477|      2|        if (!(condition)) {         \
  |  |  ------------------
  |  |  |  Branch (477:13): [True: 0, False: 2]
  |  |  ------------------
  |  |  478|      0|            ::abort();              \
  |  |  479|      0|        }                           \
  |  |  480|      2|    } while (false)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  176|      2|        }
  177|      2|        return *_s_free_ids;
  178|      2|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE13get_tls_agentEi:
  114|     20|    inline static Agent* get_tls_agent(AgentId id) {
  115|     20|        if (__builtin_expect(id >= 0, 1)) {
  ------------------
  |  Branch (115:13): [True: 20, False: 0]
  ------------------
  116|     20|            if (_s_tls_blocks) {
  ------------------
  |  Branch (116:17): [True: 18, False: 2]
  ------------------
  117|     18|                const size_t block_id = (size_t)id / ELEMENTS_PER_BLOCK;
  118|     18|                if (block_id < _s_tls_blocks->size()) {
  ------------------
  |  Branch (118:21): [True: 18, False: 0]
  ------------------
  119|     18|                    ThreadBlock* const tb = (*_s_tls_blocks)[block_id];
  120|     18|                    if (tb) {
  ------------------
  |  Branch (120:25): [True: 18, False: 0]
  ------------------
  121|     18|                        return tb->at(id - block_id * ELEMENTS_PER_BLOCK);
  122|     18|                    }
  123|     18|                }
  124|     18|            }
  125|     20|        }
  126|      2|        return NULL;
  127|     20|    }
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE11ThreadBlock2atEm:
   83|     20|        inline Agent* at(size_t offset) { return _agents + offset; };
_ZN4bvar6detail10AgentGroupINS0_13AgentCombinerIPNS0_7SamplerES4_NS0_14CombineSamplerEE5AgentEE23get_or_create_tls_agentEi:
  130|      2|    inline static Agent* get_or_create_tls_agent(AgentId id) {
  131|      2|        if (__builtin_expect(id < 0, 0)) {
  ------------------
  |  Branch (131:13): [True: 0, False: 2]
  ------------------
  132|      0|            CHECK(false) << "Invalid id=" << id;
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  133|      0|            return NULL;
  134|      0|        }
  135|      2|        if (_s_tls_blocks == NULL) {
  ------------------
  |  Branch (135:13): [True: 2, False: 0]
  ------------------
  136|      2|            _s_tls_blocks = new (std::nothrow) std::vector<ThreadBlock *>;
  137|      2|            if (__builtin_expect(_s_tls_blocks == NULL, 0)) {
  ------------------
  |  Branch (137:17): [True: 0, False: 2]
  ------------------
  138|      0|                LOG(FATAL) << "Fail to create vector, " << berror();
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|      0|                return NULL;
  140|      0|            }
  141|      2|            butil::thread_atexit(_destroy_tls_blocks);
  142|      2|        }
  143|      2|        const size_t block_id = (size_t)id / ELEMENTS_PER_BLOCK; 
  144|      2|        if (block_id >= _s_tls_blocks->size()) {
  ------------------
  |  Branch (144:13): [True: 2, False: 0]
  ------------------
  145|       |            // The 32ul avoid pointless small resizes.
  146|      2|            _s_tls_blocks->resize(std::max(block_id + 1, 32ul));
  147|      2|        }
  148|      2|        ThreadBlock* tb = (*_s_tls_blocks)[block_id];
  149|      2|        if (tb == NULL) {
  ------------------
  |  Branch (149:13): [True: 2, False: 0]
  ------------------
  150|      2|            ThreadBlock *new_block = new (std::nothrow) ThreadBlock;
  151|      2|            if (__builtin_expect(new_block == NULL, 0)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 2]
  ------------------
  152|      0|                return NULL;
  153|      0|            }
  154|      2|            tb = new_block;
  155|      2|            (*_s_tls_blocks)[block_id] = new_block;
  156|      2|        }
  157|      2|        return tb->at(id - block_id * ELEMENTS_PER_BLOCK);
  158|      2|    }

_ZN4bvar6detail22call_op_returning_voidINS0_5AddToIlEEllEEvRKT_RT0_RKT1_:
   28|      2|    const Op& op, T1& v1, const T2& v2) {
   29|      2|    return op(v1, v2);
   30|      2|}
_ZN4bvar6detail22call_op_returning_voidINS0_14CombineSamplerEPNS0_7SamplerES4_EEvRKT_RT0_RKT1_:
   28|     22|    const Op& op, T1& v1, const T2& v2) {
   29|     22|    return op(v1, v2);
   30|     22|}

_ZN4bvar6detail16ElementContainerIlvE4loadEPl:
  117|      1|    inline void load(T* out) {
  118|      1|        *out = _value.load(butil::memory_order_relaxed);
  119|      1|    }
_ZNK4bvar6detail13AgentCombinerIllNS0_5AddToIlEEE14combine_agentsEv:
  274|      8|    ResultTp combine_agents() const {
  275|      8|        ElementTp tls_value;
  276|      8|        butil::AutoLock guard(_lock);
  277|      8|        ResultTp ret = _global_result;
  278|      8|        for (butil::LinkNode<Agent>* node = _agents.head();
  279|      9|             node != _agents.end(); node = node->next()) {
  ------------------
  |  Branch (279:14): [True: 1, False: 8]
  ------------------
  280|      1|            node->value()->element.load(&tls_value);
  281|      1|            call_op_returning_void(_op, ret, tls_value);
  282|      1|        }
  283|      8|        return ret;
  284|      8|    }
_ZNK4bvar6detail13AgentCombinerIllNS0_5AddToIlEEE2opEv:
  379|      5|    const BinaryOp& op() const { return _op; }
_ZNK4bvar6detail13AgentCombinerIiiNS0_5AddToIiEEE14combine_agentsEv:
  274|      2|    ResultTp combine_agents() const {
  275|      2|        ElementTp tls_value;
  276|      2|        butil::AutoLock guard(_lock);
  277|      2|        ResultTp ret = _global_result;
  278|      2|        for (butil::LinkNode<Agent>* node = _agents.head();
  279|      2|             node != _agents.end(); node = node->next()) {
  ------------------
  |  Branch (279:14): [True: 0, False: 2]
  ------------------
  280|      0|            node->value()->element.load(&tls_value);
  281|      0|            call_op_returning_void(_op, ret, tls_value);
  282|      0|        }
  283|      2|        return ret;
  284|      2|    }
_ZN4bvar6detail13AgentCombinerIllNS0_5AddToIlEEE23get_or_create_tls_agentEv:
  331|      1|    Agent* get_or_create_tls_agent() {
  332|      1|        Agent* agent = AgentGroup::get_tls_agent(_id);
  333|      1|        if (!agent) {
  ------------------
  |  Branch (333:13): [True: 1, False: 0]
  ------------------
  334|       |            // Create the agent
  335|      1|            agent = AgentGroup::get_or_create_tls_agent(_id);
  336|      1|            if (NULL == agent) {
  ------------------
  |  Branch (336:17): [True: 0, False: 1]
  ------------------
  337|      0|                LOG(FATAL) << "Fail to create agent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  338|      0|                return NULL;
  339|      0|            }
  340|      1|        }
  341|      1|        if (!agent->combiner.expired()) {
  ------------------
  |  Branch (341:13): [True: 0, False: 1]
  ------------------
  342|      0|            return agent;
  343|      0|        }
  344|      1|        agent->reset(_element_identity, this->shared_from_this());
  345|       |        // TODO: Is uniqueness-checking necessary here?
  346|      1|        {
  347|      1|            butil::AutoLock guard(_lock);
  348|      1|            _agents.Append(agent);
  349|      1|        }
  350|      1|        return agent;
  351|      1|    }
_ZN4bvar6detail13AgentCombinerIllNS0_5AddToIlEEE5Agent5resetERKlRKSt10shared_ptrIS4_E:
  175|      1|        void reset(const ElementTp& val, const self_shared_type& c) {
  176|      1|            combiner = c;
  177|      1|            element.store(val);
  178|      1|        }
_ZN4bvar6detail16ElementContainerIlvE5storeEl:
  121|      1|    inline void store(T new_value) {
  122|      1|        _value.store(new_value, butil::memory_order_relaxed);
  123|      1|    }
_ZN4bvar6detail16ElementContainerIlvE6modifyINS0_5AddToIlEElEEvRKT_RKT0_:
  136|      1|    void modify(const Op &op, const T1 &value2) {
  137|      1|        T old_value = _value.load(butil::memory_order_relaxed);
  138|      1|        T new_value = old_value;
  139|      1|        call_op_returning_void(op, new_value, value2);
  140|       |        // There's a contention with the reset operation of combiner,
  141|       |        // if the tls value has been modified during _op, the
  142|       |        // compare_exchange_weak operation will fail and recalculation is
  143|       |        // to be processed according to the new version of value
  144|      1|        while (!_value.compare_exchange_weak(
  ------------------
  |  Branch (144:16): [True: 0, False: 1]
  ------------------
  145|      1|                   old_value, new_value, butil::memory_order_relaxed)) {
  146|      0|            new_value = old_value;
  147|      0|            call_op_returning_void(op, new_value, value2);
  148|      0|        }
  149|      1|    }
_ZN4bvar6detail13AgentCombinerIllNS0_5AddToIlEEEC2EllRKS3_:
  227|      5|        : _id(AgentGroup::create_new_agent())
  228|      5|        , _op(op)
  229|      5|        , _global_result(result_identity)
  230|      5|        , _result_identity(result_identity)
  231|      5|        , _element_identity(element_identity) {
  232|      5|    }
_ZN4bvar6detail13AgentCombinerIiiNS0_5AddToIiEEEC2EiiRKS3_:
  227|      1|        : _id(AgentGroup::create_new_agent())
  228|      1|        , _op(op)
  229|      1|        , _global_result(result_identity)
  230|      1|        , _result_identity(result_identity)
  231|      1|        , _element_identity(element_identity) {
  232|      1|    }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEEC2ES3_S3_RKS4_:
  227|      2|        : _id(AgentGroup::create_new_agent())
  228|      2|        , _op(op)
  229|      2|        , _global_result(result_identity)
  230|      2|        , _result_identity(result_identity)
  231|      2|        , _element_identity(element_identity) {
  232|      2|    }
_ZNK4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE2opEv:
  379|     20|    const BinaryOp& op() const { return _op; }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE16reset_all_agentsEv:
  292|      2|    ResultTp reset_all_agents() {
  293|      2|        ElementTp prev;
  294|      2|        butil::AutoLock guard(_lock);
  295|      2|        ResultTp tmp = _global_result;
  296|      2|        _global_result = _result_identity;
  297|      2|        for (butil::LinkNode<Agent>* node = _agents.head();
  298|      4|             node != _agents.end(); node = node->next()) {
  ------------------
  |  Branch (298:14): [True: 2, False: 2]
  ------------------
  299|      2|            node->value()->element.exchange(&prev, _element_identity);
  300|      2|            call_op_returning_void(_op, tmp, prev);
  301|      2|        }
  302|      2|        return tmp;
  303|      2|    }
_ZN4bvar6detail16ElementContainerIPNS0_7SamplerEvE8exchangeEPS3_RKS3_:
   86|      2|    void exchange(T* prev, const T& new_value) {
   87|      2|        butil::AutoLock guard(_lock);
   88|      2|        *prev = _value;
   89|      2|        _value = new_value;
   90|      2|    }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE23get_or_create_tls_agentEv:
  331|     20|    Agent* get_or_create_tls_agent() {
  332|     20|        Agent* agent = AgentGroup::get_tls_agent(_id);
  333|     20|        if (!agent) {
  ------------------
  |  Branch (333:13): [True: 2, False: 18]
  ------------------
  334|       |            // Create the agent
  335|      2|            agent = AgentGroup::get_or_create_tls_agent(_id);
  336|      2|            if (NULL == agent) {
  ------------------
  |  Branch (336:17): [True: 0, False: 2]
  ------------------
  337|      0|                LOG(FATAL) << "Fail to create agent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  338|      0|                return NULL;
  339|      0|            }
  340|      2|        }
  341|     20|        if (!agent->combiner.expired()) {
  ------------------
  |  Branch (341:13): [True: 18, False: 2]
  ------------------
  342|     18|            return agent;
  343|     18|        }
  344|      2|        agent->reset(_element_identity, this->shared_from_this());
  345|       |        // TODO: Is uniqueness-checking necessary here?
  346|      2|        {
  347|      2|            butil::AutoLock guard(_lock);
  348|      2|            _agents.Append(agent);
  349|      2|        }
  350|      2|        return agent;
  351|     20|    }
_ZN4bvar6detail13AgentCombinerIPNS0_7SamplerES3_NS0_14CombineSamplerEE5Agent5resetERKS3_RKSt10shared_ptrIS5_E:
  175|      2|        void reset(const ElementTp& val, const self_shared_type& c) {
  176|      2|            combiner = c;
  177|      2|            element.store(val);
  178|      2|        }
_ZN4bvar6detail16ElementContainerIPNS0_7SamplerEvE5storeERKS3_:
   81|      2|    void store(const T& new_value) {
   82|      2|        butil::AutoLock guard(_lock);
   83|      2|        _value = new_value;
   84|      2|    }
_ZN4bvar6detail16ElementContainerIPNS0_7SamplerEvE6modifyINS0_14CombineSamplerES3_EEvRKT_RKT0_:
   93|     20|    void modify(const Op &op, const T1 &value2) {
   94|     20|        butil::AutoLock guard(_lock);
   95|     20|        call_op_returning_void(op, _value, value2);
   96|     20|    }

_ZN4bvar6detail16SamplerCollector3runEv:
  135|      2|void SamplerCollector::run() {
  136|      2|    ::usleep(FLAGS_bvar_sampler_thread_start_delay_us);
  137|       |    
  138|       |#ifndef UNIT_TEST
  139|       |    // NOTE:
  140|       |    // * Following vars can't be created on thread's stack since this thread
  141|       |    //   may be abandoned at any time after forking.
  142|       |    // * They can't created inside the constructor of SamplerCollector as well,
  143|       |    //   which results in deadlock.
  144|       |    if (s_cumulated_time_bvar == NULL) {
  145|       |        s_cumulated_time_bvar =
  146|       |            new PassiveStatus<double>(get_cumulated_time, this);
  147|       |    }
  148|       |    if (s_sampling_thread_usage_bvar == NULL) {
  149|       |        s_sampling_thread_usage_bvar =
  150|       |            new bvar::PerSecond<bvar::PassiveStatus<double> >(
  151|       |                    "bvar_sampler_collector_usage", s_cumulated_time_bvar, 10);
  152|       |    }
  153|       |#endif
  154|       |
  155|      2|    butil::LinkNode<Sampler> root;
  156|      2|    int consecutive_nosleep = 0;
  157|      4|    while (!_stop) {
  ------------------
  |  Branch (157:12): [True: 2, False: 2]
  ------------------
  158|      2|        int64_t abstime = butil::cpuwide_time_us();
  159|      2|        Sampler* s = this->reset();
  160|      2|        if (s) {
  ------------------
  |  Branch (160:13): [True: 2, False: 0]
  ------------------
  161|      2|            s->InsertBeforeAsList(&root);
  162|      2|        }
  163|     22|        for (butil::LinkNode<Sampler>* p = root.next(); p != &root;) {
  ------------------
  |  Branch (163:57): [True: 20, False: 2]
  ------------------
  164|       |            // We may remove p from the list, save next first.
  165|     20|            butil::LinkNode<Sampler>* saved_next = p->next();
  166|     20|            Sampler* s = p->value();
  167|     20|            s->_mutex.lock();
  168|     20|            if (!s->_used) {
  ------------------
  |  Branch (168:17): [True: 0, False: 20]
  ------------------
  169|      0|                s->_mutex.unlock();
  170|      0|                p->RemoveFromList();
  171|      0|                delete s;
  172|     20|            } else {
  173|     20|                s->take_sample();
  174|     20|                s->_mutex.unlock();
  175|     20|            }
  176|     20|            p = saved_next;
  177|     20|        }
  178|      2|        bool slept = false;
  179|      2|        int64_t now = butil::cpuwide_time_us();
  180|      2|        _cumulated_time_us += now - abstime;
  181|      2|        abstime += 1000000L;
  182|      4|        while (abstime > now) {
  ------------------
  |  Branch (182:16): [True: 2, False: 2]
  ------------------
  183|      2|            ::usleep(abstime - now);
  184|      2|            slept = true;
  185|      2|            now = butil::cpuwide_time_us();
  186|      2|        }
  187|      2|        if (slept) {
  ------------------
  |  Branch (187:13): [True: 0, False: 2]
  ------------------
  188|      0|            consecutive_nosleep = 0;
  189|      2|        } else {            
  190|      2|            if (++consecutive_nosleep >= WARN_NOSLEEP_THRESHOLD) {
  ------------------
  |  Branch (190:17): [True: 0, False: 2]
  ------------------
  191|      0|                consecutive_nosleep = 0;
  192|      0|                LOG(WARNING) << "bvar is busy at sampling for "
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|      0|                             << WARN_NOSLEEP_THRESHOLD << " seconds!";
  194|      0|            }
  195|      2|        }
  196|      2|    }
  197|      2|}
_ZN4bvar6detail7SamplerC2Ev:
  199|     20|Sampler::Sampler() : _used(true) {}
_ZN4bvar6detail7Sampler8scheduleEv:
  205|     20|void Sampler::schedule() {
  206|       |    // since the SamplerCollector is initialized before the program starts
  207|       |    // flags will not take effect if used in the SamplerCollector constructor
  208|     20|    if (FLAGS_bvar_enable_sampling) {
  ------------------
  |  Branch (208:9): [True: 20, False: 0]
  ------------------
  209|     20|        *butil::get_leaky_singleton<SamplerCollector>() << this;
  210|     20|    }
  211|     20|}
_ZN4bvar6detail16SamplerCollectorC2Ev:
   66|      2|        : _created(false)
   67|      2|        , _stop(false)
   68|      2|        , _cumulated_time_us(0) {
   69|      2|        create_sampling_thread();
   70|      2|    }
_ZN4bvar6detail16SamplerCollector22create_sampling_threadEv:
   91|      2|    void create_sampling_thread() {
   92|      2|        const int rc = pthread_create(&_tid, NULL, sampling_thread, this);
   93|      2|        if (rc != 0) {
  ------------------
  |  Branch (93:13): [True: 0, False: 2]
  ------------------
   94|      0|            LOG(FATAL) << "Fail to create sampling_thread, " << berror(rc);
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|      2|        } else {
   96|      2|            _created = true;
   97|      2|            if (!registered_atfork) {
  ------------------
  |  Branch (97:17): [True: 2, False: 0]
  ------------------
   98|      2|                registered_atfork = true;
   99|      2|                pthread_atfork(NULL, NULL, child_callback_atfork);
  100|      2|            }
  101|      2|        }
  102|      2|    }
_ZN4bvar6detail16SamplerCollector15sampling_threadEPv:
  111|      2|    static void* sampling_thread(void* arg) {
  112|      2|        butil::PlatformThread::SetNameSimple("bvar_sampler");
  113|      2|        static_cast<SamplerCollector*>(arg)->run();
  114|       |        return NULL;
  115|      2|    }
_ZNK4bvar6detail14CombineSamplerclERPNS0_7SamplerES3_:
   36|     22|    void operator()(Sampler* & s1, Sampler* s2) const {
   37|     22|        if (s2 == NULL) {
  ------------------
  |  Branch (37:13): [True: 0, False: 22]
  ------------------
   38|      0|            return;
   39|      0|        }
   40|     22|        if (s1 == NULL) {
  ------------------
  |  Branch (40:13): [True: 4, False: 18]
  ------------------
   41|      4|            s1 = s2;
   42|      4|            return;
   43|      4|        }
   44|     18|        s1->InsertBeforeAsList(s2);
   45|     18|    }

_ZN4bvar6detail14ReducerSamplerINS_7ReducerIiNS0_5AddToIiEENS0_9MinusFromIiEEEEiS4_S6_E11take_sampleEv:
  102|      2|    void take_sample() override {
  103|       |        // Make _q ready.
  104|       |        // If _window_size is larger than what _q can hold, e.g. a larger
  105|       |        // Window<> is created after running of sampler, make _q larger.
  106|      2|        if ((size_t)_window_size + 1 > _q.capacity()) {
  ------------------
  |  Branch (106:13): [True: 2, False: 0]
  ------------------
  107|      2|            const size_t new_cap =
  108|      2|                std::max(_q.capacity() * 2, (size_t)_window_size + 1);
  109|      2|            const size_t memsize = sizeof(Sample<T>) * new_cap;
  110|      2|            void* mem = malloc(memsize);
  111|      2|            if (NULL == mem) {
  ------------------
  |  Branch (111:17): [True: 0, False: 2]
  ------------------
  112|      0|                return;
  113|      0|            }
  114|      2|            butil::BoundedQueue<Sample<T> > new_q(
  115|      2|                mem, memsize, butil::OWNS_STORAGE);
  116|      2|            Sample<T> tmp;
  117|      3|            while (_q.pop(&tmp)) {
  ------------------
  |  Branch (117:20): [True: 1, False: 2]
  ------------------
  118|      1|                new_q.push(tmp);
  119|      1|            }
  120|      2|            new_q.swap(_q);
  121|      2|        }
  122|       |
  123|      2|        Sample<T> latest;
  124|      2|        if (butil::is_same<InvOp, VoidOp>::value) {
  ------------------
  |  Branch (124:13): [Folded, False: 2]
  ------------------
  125|       |            // The operator can't be inversed.
  126|       |            // We reset the reducer and save the result as a sample.
  127|       |            // Suming up samples gives the result within a window.
  128|       |            // In this case, get_value() of _reducer gives wrong answer and
  129|       |            // should not be called.
  130|      0|            latest.data = _reducer->reset();
  131|      2|        } else {
  132|       |            // The operator can be inversed.
  133|       |            // We save the result as a sample.
  134|       |            // Inversed operation between latest and oldest sample within a
  135|       |            // window gives result.
  136|       |            // get_value() of _reducer can still be called.
  137|      2|            latest.data = _reducer->get_value();
  138|      2|        }
  139|      2|        latest.time_us = butil::cpuwide_time_us();
  140|      2|        _q.elim_push(latest);
  141|      2|    }
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIiNS0_5AddToIiEENS0_9MinusFromIiEEEEiS4_S6_E15set_window_sizeEl:
  179|      1|    int set_window_size(time_t window_size) {
  180|      1|        if (window_size <= 0 || window_size > MAX_SECONDS_LIMIT) {
  ------------------
  |  Branch (180:13): [True: 0, False: 1]
  |  Branch (180:33): [True: 0, False: 1]
  ------------------
  181|      0|            LOG(ERROR) << "Invalid window_size=" << window_size;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|      0|            return -1;
  183|      0|        }
  184|      1|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|      1|        if (window_size > _window_size) {
  ------------------
  |  Branch (185:13): [True: 1, False: 0]
  ------------------
  186|      1|            _window_size = window_size;
  187|      1|        }
  188|      1|        return 0;
  189|      1|    }
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIiNS0_5AddToIiEENS0_9MinusFromIiEEEEiS4_S6_E9get_valueElPNS0_6SampleIiEE:
  143|      1|    bool get_value(time_t window_size, Sample<T>* result) {
  144|      1|        if (window_size <= 0) {
  ------------------
  |  Branch (144:13): [True: 0, False: 1]
  ------------------
  145|      0|            LOG(FATAL) << "Invalid window_size=" << window_size;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      0|            return false;
  147|      0|        }
  148|      1|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|      1|        if (_q.size() <= 1UL) {
  ------------------
  |  Branch (149:13): [True: 0, False: 1]
  ------------------
  150|       |            // We need more samples to get reasonable result.
  151|      0|            return false;
  152|      0|        }
  153|      1|        Sample<T>* oldest = _q.bottom(window_size);
  154|      1|        if (NULL == oldest) {
  ------------------
  |  Branch (154:13): [True: 0, False: 1]
  ------------------
  155|      0|            oldest = _q.top();
  156|      0|        }
  157|      1|        Sample<T>* latest = _q.bottom();
  158|      1|        DCHECK(latest != oldest);
  ------------------
  |  |  846|      1|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  ------------------
  |  |  |  |  472|      2|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 1, Folded]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  847|      0|    << "Check failed: " #condition ". "
  ------------------
  159|      1|        if (butil::is_same<InvOp, VoidOp>::value) {
  ------------------
  |  Branch (159:13): [Folded, False: 1]
  ------------------
  160|       |            // No inverse op. Sum up all samples within the window.
  161|      0|            result->data = latest->data;
  162|      0|            for (int i = 1; true; ++i) {
  ------------------
  |  Branch (162:29): [True: 0, Folded]
  ------------------
  163|      0|                Sample<T>* e = _q.bottom(i);
  164|      0|                if (e == oldest) {
  ------------------
  |  Branch (164:21): [True: 0, False: 0]
  ------------------
  165|      0|                    break;
  166|      0|                }
  167|      0|                _reducer->op()(result->data, e->data);
  168|      0|            }
  169|      1|        } else {
  170|       |            // Diff the latest and oldest sample within the window.
  171|      1|            result->data = latest->data;
  172|      1|            _reducer->inv_op()(result->data, oldest->data);
  173|      1|        }
  174|      1|        result->time_us = latest->time_us - oldest->time_us;
  175|      1|        return true;
  176|      1|    }
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIlNS0_5AddToIlEENS0_9MinusFromIlEEEElS4_S6_E11take_sampleEv:
  102|      4|    void take_sample() override {
  103|       |        // Make _q ready.
  104|       |        // If _window_size is larger than what _q can hold, e.g. a larger
  105|       |        // Window<> is created after running of sampler, make _q larger.
  106|      4|        if ((size_t)_window_size + 1 > _q.capacity()) {
  ------------------
  |  Branch (106:13): [True: 4, False: 0]
  ------------------
  107|      4|            const size_t new_cap =
  108|      4|                std::max(_q.capacity() * 2, (size_t)_window_size + 1);
  109|      4|            const size_t memsize = sizeof(Sample<T>) * new_cap;
  110|      4|            void* mem = malloc(memsize);
  111|      4|            if (NULL == mem) {
  ------------------
  |  Branch (111:17): [True: 0, False: 4]
  ------------------
  112|      0|                return;
  113|      0|            }
  114|      4|            butil::BoundedQueue<Sample<T> > new_q(
  115|      4|                mem, memsize, butil::OWNS_STORAGE);
  116|      4|            Sample<T> tmp;
  117|      6|            while (_q.pop(&tmp)) {
  ------------------
  |  Branch (117:20): [True: 2, False: 4]
  ------------------
  118|      2|                new_q.push(tmp);
  119|      2|            }
  120|      4|            new_q.swap(_q);
  121|      4|        }
  122|       |
  123|      4|        Sample<T> latest;
  124|      4|        if (butil::is_same<InvOp, VoidOp>::value) {
  ------------------
  |  Branch (124:13): [Folded, False: 4]
  ------------------
  125|       |            // The operator can't be inversed.
  126|       |            // We reset the reducer and save the result as a sample.
  127|       |            // Suming up samples gives the result within a window.
  128|       |            // In this case, get_value() of _reducer gives wrong answer and
  129|       |            // should not be called.
  130|      0|            latest.data = _reducer->reset();
  131|      4|        } else {
  132|       |            // The operator can be inversed.
  133|       |            // We save the result as a sample.
  134|       |            // Inversed operation between latest and oldest sample within a
  135|       |            // window gives result.
  136|       |            // get_value() of _reducer can still be called.
  137|      4|            latest.data = _reducer->get_value();
  138|      4|        }
  139|      4|        latest.time_us = butil::cpuwide_time_us();
  140|      4|        _q.elim_push(latest);
  141|      4|    }
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIlNS0_5AddToIlEENS0_9MinusFromIlEEEElS4_S6_E15set_window_sizeEl:
  179|      2|    int set_window_size(time_t window_size) {
  180|      2|        if (window_size <= 0 || window_size > MAX_SECONDS_LIMIT) {
  ------------------
  |  Branch (180:13): [True: 0, False: 2]
  |  Branch (180:33): [True: 0, False: 2]
  ------------------
  181|      0|            LOG(ERROR) << "Invalid window_size=" << window_size;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|      0|            return -1;
  183|      0|        }
  184|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|      2|        if (window_size > _window_size) {
  ------------------
  |  Branch (185:13): [True: 2, False: 0]
  ------------------
  186|      2|            _window_size = window_size;
  187|      2|        }
  188|      2|        return 0;
  189|      2|    }
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIlNS0_5AddToIlEENS0_9MinusFromIlEEEElS4_S6_E9get_valueElPNS0_6SampleIlEE:
  143|      2|    bool get_value(time_t window_size, Sample<T>* result) {
  144|      2|        if (window_size <= 0) {
  ------------------
  |  Branch (144:13): [True: 0, False: 2]
  ------------------
  145|      0|            LOG(FATAL) << "Invalid window_size=" << window_size;
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      0|            return false;
  147|      0|        }
  148|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|      2|        if (_q.size() <= 1UL) {
  ------------------
  |  Branch (149:13): [True: 0, False: 2]
  ------------------
  150|       |            // We need more samples to get reasonable result.
  151|      0|            return false;
  152|      0|        }
  153|      2|        Sample<T>* oldest = _q.bottom(window_size);
  154|      2|        if (NULL == oldest) {
  ------------------
  |  Branch (154:13): [True: 0, False: 2]
  ------------------
  155|      0|            oldest = _q.top();
  156|      0|        }
  157|      2|        Sample<T>* latest = _q.bottom();
  158|      2|        DCHECK(latest != oldest);
  ------------------
  |  |  846|      2|    BAIDU_LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON() && !(condition)) \
  |  |  ------------------
  |  |  |  |  472|      4|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 2, Folded]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  847|      0|    << "Check failed: " #condition ". "
  ------------------
  159|      2|        if (butil::is_same<InvOp, VoidOp>::value) {
  ------------------
  |  Branch (159:13): [Folded, False: 2]
  ------------------
  160|       |            // No inverse op. Sum up all samples within the window.
  161|      0|            result->data = latest->data;
  162|      0|            for (int i = 1; true; ++i) {
  ------------------
  |  Branch (162:29): [True: 0, Folded]
  ------------------
  163|      0|                Sample<T>* e = _q.bottom(i);
  164|      0|                if (e == oldest) {
  ------------------
  |  Branch (164:21): [True: 0, False: 0]
  ------------------
  165|      0|                    break;
  166|      0|                }
  167|      0|                _reducer->op()(result->data, e->data);
  168|      0|            }
  169|      2|        } else {
  170|       |            // Diff the latest and oldest sample within the window.
  171|      2|            result->data = latest->data;
  172|      2|            _reducer->inv_op()(result->data, oldest->data);
  173|      2|        }
  174|      2|        result->time_us = latest->time_us - oldest->time_us;
  175|      2|        return true;
  176|      2|    }
_ZN4bvar6detail6SampleIlEC2Ev:
   40|     10|    Sample() : data(), time_us(0) {}
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIlNS0_5AddToIlEENS0_9MinusFromIlEEEElS4_S6_EC2EPS7_:
   93|      2|        : _reducer(reducer)
   94|      2|        , _window_size(1) {
   95|       |        
   96|       |        // Invoked take_sample at begining so the value of the first second
   97|       |        // would not be ignored
   98|      2|        take_sample();
   99|      2|    }
_ZN4bvar6detail14ReducerSamplerINS_7ReducerIiNS0_5AddToIiEENS0_9MinusFromIiEEEEiS4_S6_EC2EPS7_:
   93|      1|        : _reducer(reducer)
   94|      1|        , _window_size(1) {
   95|       |        
   96|       |        // Invoked take_sample at begining so the value of the first second
   97|       |        // would not be ignored
   98|      1|        take_sample();
   99|      1|    }
_ZN4bvar6detail6SampleIiEC2Ev:
   40|      5|    Sample() : data(), time_us(0) {}

_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE6appendERKl:
  114|      6|    void append(const T& value) {
  115|      6|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      6|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      6|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      6|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      6|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      6|        return append_second(value, _op);
  117|      6|    }
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE13append_secondERKlRKS3_:
  161|      6|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      6|    _data.second(_nsecond) = value;
  163|      6|    ++_nsecond;
  164|      6|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 6]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      6|}
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE4Data6secondEi:
  135|      6|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE6appendERKi:
  114|      2|    void append(const T& value) {
  115|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      2|        return append_second(value, _op);
  117|      2|    }
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE13append_secondERKiRKS3_:
  161|      2|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      2|    _data.second(_nsecond) = value;
  163|      2|    ++_nsecond;
  164|      2|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      2|}
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE4Data6secondEi:
  135|      2|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail10SeriesBaseIiNS0_10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE6appendERKi:
  114|      1|    void append(const T& value) {
  115|      1|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      1|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      1|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      1|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      1|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      1|        return append_second(value, _op);
  117|      1|    }
_ZN4bvar6detail10SeriesBaseIiNS0_10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE13append_secondERKiRKS8_:
  161|      1|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      1|    _data.second(_nsecond) = value;
  163|      1|    ++_nsecond;
  164|      1|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 1]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      1|}
_ZN4bvar6detail10SeriesBaseIiNS0_10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE4Data6secondEi:
  135|      1|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail10SeriesBaseIlNS0_10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE6appendERKl:
  114|      2|    void append(const T& value) {
  115|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      2|        return append_second(value, _op);
  117|      2|    }
_ZN4bvar6detail10SeriesBaseIlNS0_10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE13append_secondERKlRKS8_:
  161|      2|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      2|    _data.second(_nsecond) = value;
  163|      2|    ++_nsecond;
  164|      2|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      2|}
_ZN4bvar6detail10SeriesBaseIlNS0_10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE4Data6secondEi:
  135|      2|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail6SeriesIdNS0_5AddToIdEEEC2ERKS3_:
  218|      2|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIdNS0_5AddToIdEEEC2ERKS3_:
  103|      2|        : _op(op)
  104|      2|        , _nsecond(0)
  105|      2|        , _nminute(0)
  106|      2|        , _nhour(0)
  107|      2|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      2|    }
_ZN4bvar6detail10SeriesBaseIdNS0_5AddToIdEEE4DataC2Ev:
  127|      2|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      2|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [Folded, False: 0]
  ------------------
  130|      2|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [True: 0, Folded]
  ------------------
  131|      2|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      2|            }
  133|      2|        }
_ZN4bvar6detail10SeriesBaseIdNS0_5AddToIdEEE6appendERKd:
  114|      2|    void append(const T& value) {
  115|      2|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      2|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      2|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      2|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      2|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      2|        return append_second(value, _op);
  117|      2|    }
_ZN4bvar6detail10SeriesBaseIdNS0_5AddToIdEEE13append_secondERKdRKS3_:
  161|      2|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      2|    _data.second(_nsecond) = value;
  163|      2|    ++_nsecond;
  164|      2|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      2|}
_ZN4bvar6detail10SeriesBaseIdNS0_5AddToIdEEE4Data6secondEi:
  135|      2|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail6SeriesIlNS0_5AddToIlEEEC2ERKS3_:
  218|      6|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEEC2ERKS3_:
  103|      6|        : _op(op)
  104|      6|        , _nsecond(0)
  105|      6|        , _nminute(0)
  106|      6|        , _nhour(0)
  107|      6|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      6|    }
_ZN4bvar6detail10SeriesBaseIlNS0_5AddToIlEEE4DataC2Ev:
  127|      6|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      6|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 6, Folded]
  ------------------
  130|      6|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      6|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      6|            }
  133|      6|        }
_ZN4bvar6detail6SeriesImNS0_5AddToImEEEC2ERKS3_:
  218|      4|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEEC2ERKS3_:
  103|      4|        : _op(op)
  104|      4|        , _nsecond(0)
  105|      4|        , _nminute(0)
  106|      4|        , _nhour(0)
  107|      4|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      4|    }
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE4DataC2Ev:
  127|      4|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      4|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 4, Folded]
  ------------------
  130|      4|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      4|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      4|            }
  133|      4|        }
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE6appendERKm:
  114|      4|    void append(const T& value) {
  115|      4|        BAIDU_SCOPED_LOCK(_mutex);
  ------------------
  |  |   47|      4|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      4|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      4|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      4|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      4|        return append_second(value, _op);
  117|      4|    }
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE13append_secondERKmRKS3_:
  161|      4|void SeriesBase<T, Op>::append_second(const T& value, const Op& op) {
  162|      4|    _data.second(_nsecond) = value;
  163|      4|    ++_nsecond;
  164|      4|    if (_nsecond >= 60) {
  ------------------
  |  Branch (164:9): [True: 0, False: 4]
  ------------------
  165|      0|        _nsecond = 0;
  166|      0|        T tmp = _data.second(0);
  167|      0|        for (int i = 1; i < 60; ++i) {
  ------------------
  |  Branch (167:25): [True: 0, False: 0]
  ------------------
  168|      0|            call_op_returning_void(op, tmp, _data.second(i));
  169|      0|        }
  170|      0|        DivideOnAddition<T, Op>::inplace_divide(tmp, op, 60);
  171|      0|        append_minute(tmp, op);
  172|      0|    }
  173|      4|}
_ZN4bvar6detail10SeriesBaseImNS0_5AddToImEEE4Data6secondEi:
  135|      4|        T& second(int index) { return _array[index]; }
_ZN4bvar6detail6SeriesIlNS0_10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEEC2ERKS8_:
  218|      2|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIlNS0_10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEEC2ERKS8_:
  103|      2|        : _op(op)
  104|      2|        , _nsecond(0)
  105|      2|        , _nminute(0)
  106|      2|        , _nhour(0)
  107|      2|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      2|    }
_ZN4bvar6detail10SeriesBaseIlNS0_10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE4DataC2Ev:
  127|      2|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      2|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 2, Folded]
  ------------------
  130|      2|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      2|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      2|            }
  133|      2|        }
_ZN4bvar6detail6SeriesIiNS0_5AddToIiEEEC2ERKS3_:
  218|      2|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEEC2ERKS3_:
  103|      2|        : _op(op)
  104|      2|        , _nsecond(0)
  105|      2|        , _nminute(0)
  106|      2|        , _nhour(0)
  107|      2|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      2|    }
_ZN4bvar6detail10SeriesBaseIiNS0_5AddToIiEEE4DataC2Ev:
  127|      2|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      2|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 2, Folded]
  ------------------
  130|      2|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      2|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      2|            }
  133|      2|        }
_ZN4bvar6detail6SeriesIiNS0_10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEEC2ERKS8_:
  218|      1|    explicit Series(const Op& op) : Base(op) {}
_ZN4bvar6detail10SeriesBaseIiNS0_10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEEC2ERKS8_:
  103|      1|        : _op(op)
  104|      1|        , _nsecond(0)
  105|      1|        , _nminute(0)
  106|      1|        , _nhour(0)
  107|      1|        , _nday(0) {
  108|       |        pthread_mutex_init(&_mutex, NULL);
  109|      1|    }
_ZN4bvar6detail10SeriesBaseIiNS0_10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpEE4DataC2Ev:
  127|      1|        Data() {
  128|       |            // is_pod does not work for gcc 3.4
  129|      1|            if (butil::is_integral<T>::value ||
  ------------------
  |  Branch (129:17): [True: 1, Folded]
  ------------------
  130|      1|                butil::is_floating_point<T>::value) {
  ------------------
  |  Branch (130:17): [Folded, False: 0]
  ------------------
  131|      1|                memset(static_cast<void*>(_array), 0, sizeof(_array));
  132|      1|            }
  133|      1|        }

_ZN4bvar13PassiveStatusINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2ERKN5butil16BasicStringPieceIS6_EEPFvRSoPvESE_:
  204|     14|        : _print(print), _arg(arg) {
  205|     14|        expose(name);
  206|     14|    }
_ZN4bvar13PassiveStatusIlE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      2|                    DisplayFilter display_filter) override {
  173|      2|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      2|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 2, Folded]
  ------------------
  175|      2|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 2, False: 0]
  ------------------
  176|      2|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 2, False: 0]
  ------------------
  177|      2|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 2, False: 0]
  ------------------
  178|      2|            _series_sampler = new SeriesSampler(this);
  179|      2|            _series_sampler->schedule();
  180|      2|        }
  181|      2|        return rc;
  182|      2|    }
_ZN4bvar13PassiveStatusIlE13SeriesSampler11take_sampleEv:
   62|      2|        void take_sample() override { _series.append(_owner->get_value()); }
_ZNK4bvar13PassiveStatusIlE9get_valueEv:
  139|      2|    Tp get_value() const {
  140|      2|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 2, False: 0]
  ------------------
  141|      2|    }
_ZNK4bvar13PassiveStatusIdE9get_valueEv:
  139|      2|    Tp get_value() const {
  140|      2|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 2, False: 0]
  ------------------
  141|      2|    }
_ZN4bvar13PassiveStatusIdE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      2|                    DisplayFilter display_filter) override {
  173|      2|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      2|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 2, Folded]
  ------------------
  175|      2|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 2, False: 0]
  ------------------
  176|      2|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 2, False: 0]
  ------------------
  177|      2|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 2, False: 0]
  ------------------
  178|      2|            _series_sampler = new SeriesSampler(this);
  179|      2|            _series_sampler->schedule();
  180|      2|        }
  181|      2|        return rc;
  182|      2|    }
_ZN4bvar13PassiveStatusIdE13SeriesSamplerC2EPS1_:
   58|      2|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusIdE13SeriesSampler11take_sampleEv:
   62|      2|        void take_sample() override { _series.append(_owner->get_value()); }
_ZN4bvar13PassiveStatusIlE13SeriesSamplerC2EPS1_:
   58|      2|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusIlEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFlPvESD_:
   81|      2|        : _getfn(getfn)
   82|      2|        , _arg(arg)
   83|      2|        , _sampler(NULL)
   84|      2|        , _series_sampler(NULL) {
   85|      2|        expose(name);
   86|      2|    }
_ZNK4bvar13PassiveStatusImE9get_valueEv:
  139|      4|    Tp get_value() const {
  140|      4|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 4, False: 0]
  ------------------
  141|      4|    }
_ZN4bvar13PassiveStatusImE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      4|                    DisplayFilter display_filter) override {
  173|      4|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      4|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 4, Folded]
  ------------------
  175|      4|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 4, False: 0]
  ------------------
  176|      4|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 4, False: 0]
  ------------------
  177|      4|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 4, False: 0]
  ------------------
  178|      4|            _series_sampler = new SeriesSampler(this);
  179|      4|            _series_sampler->schedule();
  180|      4|        }
  181|      4|        return rc;
  182|      4|    }
_ZN4bvar13PassiveStatusImE13SeriesSamplerC2EPS1_:
   58|      4|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusImE13SeriesSampler11take_sampleEv:
   62|      4|        void take_sample() override { _series.append(_owner->get_value()); }
_ZNK4bvar13PassiveStatusIiE9get_valueEv:
  139|      2|    Tp get_value() const {
  140|      2|        return (_getfn ? _getfn(_arg) : Tp());
  ------------------
  |  Branch (140:17): [True: 2, False: 0]
  ------------------
  141|      2|    }
_ZN4bvar13PassiveStatusIiE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESC_NS_13DisplayFilterE:
  172|      2|                    DisplayFilter display_filter) override {
  173|      2|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  174|      2|        if (ADDITIVE &&
  ------------------
  |  Branch (174:13): [True: 2, Folded]
  ------------------
  175|      2|            rc == 0 &&
  ------------------
  |  Branch (175:13): [True: 2, False: 0]
  ------------------
  176|      2|            _series_sampler == NULL &&
  ------------------
  |  Branch (176:13): [True: 2, False: 0]
  ------------------
  177|      2|            FLAGS_save_series) {
  ------------------
  |  Branch (177:13): [True: 2, False: 0]
  ------------------
  178|      2|            _series_sampler = new SeriesSampler(this);
  179|      2|            _series_sampler->schedule();
  180|      2|        }
  181|      2|        return rc;
  182|      2|    }
_ZN4bvar13PassiveStatusIiE13SeriesSamplerC2EPS1_:
   58|      2|            : _owner(owner), _vector_names(NULL), _series(Op()) {}
_ZN4bvar13PassiveStatusIiE13SeriesSampler11take_sampleEv:
   62|      2|        void take_sample() override { _series.append(_owner->get_value()); }
_ZN4bvar13PassiveStatusIdEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFdPvESD_:
   81|      2|        : _getfn(getfn)
   82|      2|        , _arg(arg)
   83|      2|        , _sampler(NULL)
   84|      2|        , _series_sampler(NULL) {
   85|      2|        expose(name);
   86|      2|    }
_ZN4bvar13PassiveStatusIiEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFiPvESD_:
   81|      2|        : _getfn(getfn)
   82|      2|        , _arg(arg)
   83|      2|        , _sampler(NULL)
   84|      2|        , _series_sampler(NULL) {
   85|      2|        expose(name);
   86|      2|    }
_ZN4bvar13PassiveStatusImEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPFmPvESD_:
   81|      4|        : _getfn(getfn)
   82|      4|        , _arg(arg)
   83|      4|        , _sampler(NULL)
   84|      4|        , _series_sampler(NULL) {
   85|      4|        expose(name);
   86|      4|    }

_ZNK4bvar6detail5AddToIlEclERll:
  324|      2|    { lhs += rhs; }
_ZNK4bvar7ReducerIlNS_6detail5AddToIlEENS1_9MinusFromIlEEE9get_valueEv:
  227|      8|    T get_value() const {
  228|      8|        CHECK(!(butil::is_same<InvOp, detail::VoidOp>::value) || _sampler == NULL)
  ------------------
  |  |  617|      8|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      8|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 8, Folded]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  229|      0|            << "You should not call Reducer<" << butil::class_name_str<T>()
  230|      0|            << ", " << butil::class_name_str<Op>() << ">::get_value() when a"
  231|      0|            << " Window<> is used because the operator does not have inverse.";
  232|      8|        return _combiner->combine_agents();
  233|      8|    }
_ZN4bvar7ReducerIlNS_6detail5AddToIlEENS1_9MinusFromIlEEE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESH_NS_13DisplayFilterE:
  280|      4|                    DisplayFilter display_filter) override {
  281|      4|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  282|      4|        if (rc == 0 &&
  ------------------
  |  Branch (282:13): [True: 4, False: 0]
  ------------------
  283|      4|            _series_sampler == NULL &&
  ------------------
  |  Branch (283:13): [True: 4, False: 0]
  ------------------
  284|      0|            !butil::is_same<InvOp, detail::VoidOp>::value &&
  ------------------
  |  Branch (284:13): [True: 0, Folded]
  ------------------
  285|      0|            !butil::is_same<T, std::string>::value &&
  ------------------
  |  Branch (285:13): [True: 0, Folded]
  ------------------
  286|      4|            FLAGS_save_series) {
  ------------------
  |  Branch (286:13): [True: 4, False: 0]
  ------------------
  287|      4|            _series_sampler = new SeriesSampler(this, _combiner->op());
  288|      4|            _series_sampler->schedule();
  289|      4|        }
  290|      4|        return rc;
  291|      4|    }
_ZN4bvar6detail17SeriesSamplerImplINS_7ReducerIlNS0_5AddToIlEENS0_9MinusFromIlEEEElS4_E11take_sampleEv:
   44|      4|    void take_sample() override { _series.append(_owner->get_value()); }
_ZN4bvar7ReducerIiNS_6detail5AddToIiEENS1_9MinusFromIiEEE11get_samplerEv:
  259|      1|    sampler_type* get_sampler() {
  260|      1|        if (NULL == _sampler) {
  ------------------
  |  Branch (260:13): [True: 1, False: 0]
  ------------------
  261|      1|            _sampler = new sampler_type(this);
  262|      1|            _sampler->schedule();
  263|      1|        }
  264|      1|        return _sampler;
  265|      1|    }
_ZNK4bvar7ReducerIiNS_6detail5AddToIiEENS1_9MinusFromIiEEE9get_valueEv:
  227|      2|    T get_value() const {
  228|      2|        CHECK(!(butil::is_same<InvOp, detail::VoidOp>::value) || _sampler == NULL)
  ------------------
  |  |  617|      2|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      2|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:7): [True: 2, Folded]
  |  |  |  |  |  Branch (472:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  229|      0|            << "You should not call Reducer<" << butil::class_name_str<T>()
  230|      0|            << ", " << butil::class_name_str<Op>() << ">::get_value() when a"
  231|      0|            << " Window<> is used because the operator does not have inverse.";
  232|      2|        return _combiner->combine_agents();
  233|      2|    }
_ZNK4bvar7ReducerIiNS_6detail5AddToIiEENS1_9MinusFromIiEEE6inv_opEv:
  257|      1|    const InvOp& inv_op() const { return _inv_op; }
_ZNK4bvar6detail9MinusFromIiEclERii:
  330|      1|    { lhs -= rhs; }
_ZN4bvar7ReducerIlNS_6detail5AddToIlEENS1_9MinusFromIlEEE11get_samplerEv:
  259|      2|    sampler_type* get_sampler() {
  260|      2|        if (NULL == _sampler) {
  ------------------
  |  Branch (260:13): [True: 2, False: 0]
  ------------------
  261|      2|            _sampler = new sampler_type(this);
  262|      2|            _sampler->schedule();
  263|      2|        }
  264|      2|        return _sampler;
  265|      2|    }
_ZNK4bvar7ReducerIlNS_6detail5AddToIlEENS1_9MinusFromIlEEE6inv_opEv:
  257|      2|    const InvOp& inv_op() const { return _inv_op; }
_ZNK4bvar6detail9MinusFromIlEclERll:
  330|      2|    { lhs -= rhs; }
_ZN4bvar7ReducerIlNS_6detail5AddToIlEENS1_9MinusFromIlEEElsEl:
  302|      1|    typename butil::add_cr_non_integral<T>::type value) {
  303|       |    // It's wait-free for most time
  304|      1|    agent_type* agent = _combiner->get_or_create_tls_agent();
  305|      1|    if (__builtin_expect(!agent, 0)) {
  ------------------
  |  Branch (305:9): [True: 0, False: 1]
  ------------------
  306|      0|        LOG(FATAL) << "Fail to create agent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|      0|        return *this;
  308|      0|    }
  309|      1|    agent->element.modify(_combiner->op(), value);
  310|      1|    return *this;
  311|      1|}
_ZN4bvar5AdderIlvEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE:
  342|      4|    Adder(const butil::StringPiece& name) : Base() {
  343|      4|        this->expose(name);
  344|      4|    }
_ZN4bvar7ReducerIlNS_6detail5AddToIlEENS1_9MinusFromIlEEEC2ElRKS3_RKS5_:
  204|      5|        : _combiner(std::make_shared<combiner_type>(identity, identity, op))
  205|      5|        , _sampler(NULL) , _series_sampler(NULL) , _inv_op(inv_op) {}
_ZN4bvar6detail17SeriesSamplerImplINS_7ReducerIlNS0_5AddToIlEENS0_9MinusFromIlEEEElS4_EC2EPS7_RKS4_:
   43|      4|        : _owner(owner), _series(op) {}
_ZN4bvar5AdderIlvEC2Ev:
  341|      1|    Adder() : Base() {}
_ZN4bvar5AdderIivEC2Ev:
  341|      1|    Adder() : Base() {}
_ZN4bvar7ReducerIiNS_6detail5AddToIiEENS1_9MinusFromIiEEEC2EiRKS3_RKS5_:
  204|      1|        : _combiner(std::make_shared<combiner_type>(identity, identity, op))
  205|      1|        , _sampler(NULL) , _series_sampler(NULL) , _inv_op(inv_op) {}
_ZN4bvar7ReducerIPNS_6detail7SamplerENS1_14CombineSamplerENS1_6VoidOpEEC2ERKS3_RKS4_RKS5_:
  204|      2|        : _combiner(std::make_shared<combiner_type>(identity, identity, op))
  205|      2|        , _sampler(NULL) , _series_sampler(NULL) , _inv_op(inv_op) {}
_ZN4bvar7ReducerIPNS_6detail7SamplerENS1_14CombineSamplerENS1_6VoidOpEE5resetEv:
  238|      2|    T reset() { return _combiner->reset_all_agents(); }
_ZN4bvar7ReducerIPNS_6detail7SamplerENS1_14CombineSamplerENS1_6VoidOpEElsERKS3_:
  302|     20|    typename butil::add_cr_non_integral<T>::type value) {
  303|       |    // It's wait-free for most time
  304|     20|    agent_type* agent = _combiner->get_or_create_tls_agent();
  305|     20|    if (__builtin_expect(!agent, 0)) {
  ------------------
  |  Branch (305:9): [True: 0, False: 20]
  ------------------
  306|      0|        LOG(FATAL) << "Fail to create agent";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|      0|        return *this;
  308|      0|    }
  309|     20|    agent->element.modify(_combiner->op(), value);
  310|     20|    return *this;
  311|     20|}

_ZN4bvar8Variable11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESB_NS_13DisplayFilterE:
  131|     31|                          DisplayFilter display_filter) {
  132|     31|    if (name.empty()) {
  ------------------
  |  Branch (132:9): [True: 0, False: 31]
  ------------------
  133|      0|        LOG(ERROR) << "Parameter[name] is empty";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|      0|        return -1;
  135|      0|    }
  136|       |    // NOTE: It's impossible to atomically erase from a submap and insert into
  137|       |    // another submap without a global lock. When the to-be-exposed name
  138|       |    // already exists, there's a chance that we can't insert back previous
  139|       |    // name. But it should be fine generally because users are unlikely to
  140|       |    // expose a variable more than once and calls to expose() are unlikely
  141|       |    // to contend heavily.
  142|       |
  143|       |    // remove previous pointer from the map if needed.
  144|     31|    hide();
  145|       |
  146|       |    // Build the name.
  147|     31|    _name.clear();
  148|     31|    _name.reserve((prefix.size() + name.size()) * 5 / 4);
  149|     31|    if (!prefix.empty()) {
  ------------------
  |  Branch (149:9): [True: 0, False: 31]
  ------------------
  150|      0|        to_underscored_name(&_name, prefix);
  151|      0|        if (!_name.empty() && butil::back_char(_name) != '_') {
  ------------------
  |  Branch (151:13): [True: 0, False: 0]
  |  Branch (151:31): [True: 0, False: 0]
  ------------------
  152|      0|            _name.push_back('_');
  153|      0|        }
  154|      0|    }
  155|     31|    to_underscored_name(&_name, name);
  156|       |    
  157|     31|    VarMapWithLock& m = get_var_map(_name);
  158|     31|    {
  159|     31|        BAIDU_SCOPED_LOCK(m.mutex);
  ------------------
  |  |   47|     31|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|     31|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|     31|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|     31|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|     31|        VarEntry* entry = m.seek(_name);
  161|     31|        if (entry == NULL) {
  ------------------
  |  Branch (161:13): [True: 31, False: 0]
  ------------------
  162|     31|            entry = &m[_name];
  163|     31|            entry->var = this;
  164|     31|            entry->display_filter = display_filter;
  165|     31|            return 0;
  166|     31|        }
  167|     31|    }
  168|      0|    RELEASE_ASSERT_VERBOSE(!FLAGS_bvar_abort_on_same_name,
  ------------------
  |  |  489|      0|    do {                                                                            \
  |  |  490|      0|        if (!(condition)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (490:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  491|      0|            ASSERT_LOG("Assert failure: " #condition ". " #fmt, ## __VA_ARGS__);    \
  |  |  ------------------
  |  |  |  |  469|      0|    do {                                                                \
  |  |  |  |  470|      0|        std::string log = butil::string_printf(fmt, ## __VA_ARGS__);    \
  |  |  |  |  471|      0|        LOG(FATAL) << log;                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  472|      0|    } while (false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  492|      0|            ::abort();                                                              \
  |  |  493|      0|        }                                                                           \
  |  |  494|      0|    } while (false)
  |  |  ------------------
  |  |  |  Branch (494:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  169|      0|                           "Abort due to name conflict");
  170|      0|    if (!s_bvar_may_abort) {
  ------------------
  |  Branch (170:9): [True: 0, False: 0]
  ------------------
  171|       |        // Mark name conflict occurs, If this conflict happens before
  172|       |        // initialization of bvar_abort_on_same_name, the validator will
  173|       |        // abort the program if needed.
  174|      0|        s_bvar_may_abort = true;
  175|      0|    }
  176|       |        
  177|      0|    LOG(ERROR) << "Already exposed `" << _name << "' whose value is `"
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|      0|               << describe_exposed(_name) << '\'';
  179|      0|    _name.clear();
  180|      0|    return -1;
  181|      0|}
_ZN4bvar8Variable4hideEv:
  187|     31|bool Variable::hide() {
  188|     31|    if (_name.empty()) {
  ------------------
  |  Branch (188:9): [True: 31, False: 0]
  ------------------
  189|     31|        return false;
  190|     31|    }
  191|      0|    VarMapWithLock& m = get_var_map(_name);
  192|      0|    BAIDU_SCOPED_LOCK(m.mutex);
  ------------------
  |  |   47|      0|    decltype(::butil::detail::get_lock_guard<decltype(ref_of_lock)>()) \
  |  |   48|      0|    BAIDU_CONCAT(scoped_locker_dummy_at_line_, __LINE__)(ref_of_lock)
  |  |  ------------------
  |  |  |  |   88|      0|# define BAIDU_CONCAT(a, b) BAIDU_CONCAT_HELPER(a, b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      0|# define BAIDU_CONCAT_HELPER(a, b) a##b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|      0|    VarEntry* entry = m.seek(_name);
  194|      0|    if (entry) {
  ------------------
  |  Branch (194:9): [True: 0, False: 0]
  ------------------
  195|      0|        CHECK_EQ(1UL, m.erase(_name));
  ------------------
  |  |  692|      0|#define CHECK_EQ(val1, val2) BAIDU_CHECK_OP(EQ, ==, val1, val2)
  |  |  ------------------
  |  |  |  |  630|      0|    if (std::string* _result =                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (630:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  631|      0|        ::logging::Check##name##Impl((val1), (val2),                    \
  |  |  |  |  632|      0|                                     #val1 " " #op " " #val2))          \
  |  |  |  |  633|      0|        ::logging::LogMessage(__FILE__, __LINE__, __func__, _result).stream().SetCheck()
  |  |  ------------------
  ------------------
  196|      0|    } else {
  197|      0|        CHECK(false) << "`" << _name << "' must exist";
  ------------------
  |  |  617|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(FATAL).SetCheck(), !(condition))     \
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  618|      0|    << "Check failed: " #condition ". "
  ------------------
  198|      0|    }
  199|      0|    _name.clear();
  200|      0|    return true;
  201|     31|}
_ZN4bvar19to_underscored_nameEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN5butil16BasicStringPieceIS5_EE:
  942|     31|void to_underscored_name(std::string* name, const butil::StringPiece& src) {
  943|     31|    name->reserve(name->size() + src.size() + 8/*just guess*/);
  944|    589|    for (const char* p = src.data(); p != src.data() + src.size(); ++p) {
  ------------------
  |  Branch (944:38): [True: 558, False: 31]
  ------------------
  945|    558|        if (isalpha(*p)) {
  ------------------
  |  Branch (945:13): [True: 503, False: 55]
  ------------------
  946|    503|            if (*p < 'a') { // upper cases
  ------------------
  |  Branch (946:17): [True: 0, False: 503]
  ------------------
  947|      0|                if (p != src.data() && !isupper(p[-1]) &&
  ------------------
  |  Branch (947:21): [True: 0, False: 0]
  |  Branch (947:40): [True: 0, False: 0]
  ------------------
  948|      0|                    butil::back_char(*name) != '_') {
  ------------------
  |  Branch (948:21): [True: 0, False: 0]
  ------------------
  949|      0|                    name->push_back('_');
  950|      0|                }
  951|      0|                name->push_back(*p - 'A' + 'a');
  952|    503|            } else {
  953|    503|                name->push_back(*p);
  954|    503|            }
  955|    503|        } else if (isdigit(*p)) {
  ------------------
  |  Branch (955:20): [True: 0, False: 55]
  ------------------
  956|      0|            name->push_back(*p);
  957|     55|        } else if (name->empty() || butil::back_char(*name) != '_') {
  ------------------
  |  Branch (957:20): [True: 0, False: 55]
  |  Branch (957:37): [True: 55, False: 0]
  ------------------
  958|     55|            name->push_back('_');
  959|     55|        }
  960|    558|    }
  961|     31|}
_ZN4bvar11get_var_mapERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  119|     31|inline VarMapWithLock& get_var_map(const std::string& name) {
  120|     31|    VarMapWithLock& m = get_var_maps()[sub_map_index(name)];
  121|     31|    return m;
  122|     31|}
_ZN4bvar13sub_map_indexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  102|     31|inline size_t sub_map_index(const std::string& str) {
  103|     31|    if (str.empty()) {
  ------------------
  |  Branch (103:9): [True: 0, False: 31]
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|     31|    size_t h = 0;
  107|       |    // we're assume that str is ended with '\0', which may not be in general
  108|    589|    for (const char* p  = str.c_str(); *p; ++p) {
  ------------------
  |  Branch (108:40): [True: 558, False: 31]
  ------------------
  109|    558|        h = h * 5 + *p;
  110|    558|    }
  111|     31|    return h & (SUB_MAP_COUNT - 1);
  112|     31|}
_ZN4bvar12get_var_mapsEv:
  114|     31|inline VarMapWithLock* get_var_maps() {
  115|     31|    pthread_once(&s_var_maps_once, init_var_maps);
  116|     31|    return s_var_maps;
  117|     31|}
variable.cpp:_ZN4bvarL13init_var_mapsEv:
   96|      2|static void init_var_maps() {
   97|       |    // It's probably slow to initialize all sub maps, but rpc often expose 
   98|       |    // variables before user. So this should not be an issue to users.
   99|      2|    s_var_maps = new VarMapWithLock[SUB_MAP_COUNT];
  100|      2|}
_ZN4bvar14VarMapWithLockC2Ev:
   78|     64|    VarMapWithLock() {
   79|     64|        if (init(1024) != 0) {
  ------------------
  |  Branch (79:13): [True: 0, False: 64]
  ------------------
   80|      0|            LOG(WARNING) << "Fail to init VarMap";
  ------------------
  |  |  485|      0|    BAIDU_LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity))
  |  |  ------------------
  |  |  |  |  472|      0|    !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (472:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|      0|        }
   82|       |
   83|     64|        pthread_mutexattr_t attr;
   84|     64|        pthread_mutexattr_init(&attr);
   85|     64|        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
   86|     64|        pthread_mutex_init(&mutex, &attr);
   87|     64|        pthread_mutexattr_destroy(&attr);
   88|     64|    }
_ZN4bvar8VarEntryC2Ev:
   67|     31|    VarEntry() : var(NULL), display_filter(DISPLAY_ON_ALL) {}

_ZN4bvar8VariableC2Ev:
  120|     35|    Variable() {}
_ZN4bvar8Variable6exposeERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENS_13DisplayFilterE:
  150|     31|               DisplayFilter display_filter = DISPLAY_ON_ALL) {
  151|     31|        return expose_impl(butil::StringPiece(), name, display_filter);
  152|     31|    }

_ZNK4bvar6detail10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE8get_spanElPNS0_6SampleIiEE:
   95|      1|    bool get_span(time_t window_size, detail::Sample<value_type>* result) const {
   96|      1|        return _sampler->get_value(window_size, result);
   97|      1|    }
_ZNK4bvar6detail10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE8get_spanElPNS0_6SampleIlEE:
   95|      2|    bool get_span(time_t window_size, detail::Sample<value_type>* result) const {
   96|      2|        return _sampler->get_value(window_size, result);
   97|      2|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESG_NS_13DisplayFilterE:
  146|      1|                    DisplayFilter display_filter) override {
  147|      1|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  148|      1|        if (rc == 0 &&
  ------------------
  |  Branch (148:13): [True: 1, False: 0]
  ------------------
  149|      1|            _series_sampler == NULL &&
  ------------------
  |  Branch (149:13): [True: 1, False: 0]
  ------------------
  150|      1|            FLAGS_save_series) {
  ------------------
  |  Branch (150:13): [True: 1, False: 0]
  ------------------
  151|      1|            _series_sampler = new SeriesSampler(this, _var);
  152|      1|            _series_sampler->schedule();
  153|      1|        }
  154|      1|        return rc;
  155|      1|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler11take_sampleEv:
   61|      1|        void take_sample() override {
   62|      1|            if (series_freq == SERIES_IN_SECOND) {
  ------------------
  |  Branch (62:17): [True: 1, Folded]
  ------------------
   63|       |                // Get one-second window value for PerSecond<>, otherwise the
   64|       |                // "smoother" plot may hide peaks.
   65|      1|                _series.append(_owner->get_value(1));
   66|      1|            } else {
   67|       |                // Get the value inside the full window. "get_value(1)" is 
   68|       |                // incorrect when users intend to see aggregated values of
   69|       |                // the full window in the plot.
   70|      0|                _series.append(_owner->get_value());
   71|      0|            }
   72|      1|        }
_ZNK4bvar9PerSecondINS_5AdderIivEEE9get_valueEl:
  223|      1|    value_type get_value(time_t window_size) const override {
  224|      1|        detail::Sample<value_type> s;
  225|      1|        this->get_span(window_size, &s);
  226|       |        // We may test if the multiplication overflows and use integral ops
  227|       |        // if possible. However signed/unsigned 32-bit/64-bit make the solution
  228|       |        // complex. Since this function is not called often, we use floating
  229|       |        // point for simplicity.
  230|      1|        if (s.time_us <= 0) {
  ------------------
  |  Branch (230:13): [True: 0, False: 1]
  ------------------
  231|      0|            return static_cast<value_type>(0);
  232|      0|        }
  233|      1|        if (butil::is_floating_point<value_type>::value) {
  ------------------
  |  Branch (233:13): [Folded, False: 1]
  ------------------
  234|      0|            return static_cast<value_type>(s.data * 1000000.0 / s.time_us);
  235|      1|        } else {
  236|      1|            return static_cast<value_type>(round(s.data * 1000000.0 / s.time_us));
  237|      1|        }
  238|      1|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE11expose_implERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESG_NS_13DisplayFilterE:
  146|      2|                    DisplayFilter display_filter) override {
  147|      2|        const int rc = Variable::expose_impl(prefix, name, display_filter);
  148|      2|        if (rc == 0 &&
  ------------------
  |  Branch (148:13): [True: 2, False: 0]
  ------------------
  149|      2|            _series_sampler == NULL &&
  ------------------
  |  Branch (149:13): [True: 2, False: 0]
  ------------------
  150|      2|            FLAGS_save_series) {
  ------------------
  |  Branch (150:13): [True: 2, False: 0]
  ------------------
  151|      2|            _series_sampler = new SeriesSampler(this, _var);
  152|      2|            _series_sampler->schedule();
  153|      2|        }
  154|      2|        return rc;
  155|      2|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler11take_sampleEv:
   61|      2|        void take_sample() override {
   62|      2|            if (series_freq == SERIES_IN_SECOND) {
  ------------------
  |  Branch (62:17): [True: 2, Folded]
  ------------------
   63|       |                // Get one-second window value for PerSecond<>, otherwise the
   64|       |                // "smoother" plot may hide peaks.
   65|      2|                _series.append(_owner->get_value(1));
   66|      2|            } else {
   67|       |                // Get the value inside the full window. "get_value(1)" is 
   68|       |                // incorrect when users intend to see aggregated values of
   69|       |                // the full window in the plot.
   70|      0|                _series.append(_owner->get_value());
   71|      0|            }
   72|      2|        }
_ZNK4bvar9PerSecondINS_5AdderIlvEEE9get_valueEl:
  223|      2|    value_type get_value(time_t window_size) const override {
  224|      2|        detail::Sample<value_type> s;
  225|      2|        this->get_span(window_size, &s);
  226|       |        // We may test if the multiplication overflows and use integral ops
  227|       |        // if possible. However signed/unsigned 32-bit/64-bit make the solution
  228|       |        // complex. Since this function is not called often, we use floating
  229|       |        // point for simplicity.
  230|      2|        if (s.time_us <= 0) {
  ------------------
  |  Branch (230:13): [True: 0, False: 2]
  ------------------
  231|      0|            return static_cast<value_type>(0);
  232|      0|        }
  233|      2|        if (butil::is_floating_point<value_type>::value) {
  ------------------
  |  Branch (233:13): [Folded, False: 2]
  ------------------
  234|      0|            return static_cast<value_type>(s.data * 1000000.0 / s.time_us);
  235|      2|        } else {
  236|      2|            return static_cast<value_type>(round(s.data * 1000000.0 / s.time_us));
  237|      2|        }
  238|      2|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSamplerC2EPS5_PS3_:
   59|      2|            : _owner(owner), _series(Op(var)) {}
_ZN4bvar6detail10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpC2EPS3_:
   51|      2|            explicit Op(R* var) : _var(var) {}
_ZN4bvar6detail10WindowBaseINS_5AdderIlvEELNS_15SeriesFrequencyE1EEC2EPS3_l:
   80|      2|        : _var(var)
   81|      2|        , _window_size(window_size > 0 ? window_size : FLAGS_bvar_dump_interval)
  ------------------
  |  Branch (81:24): [True: 0, False: 2]
  ------------------
   82|      2|        , _sampler(var->get_sampler())
   83|      2|        , _series_sampler(NULL) {
   84|      2|        CHECK_EQ(0, _sampler->set_window_size(_window_size));
  ------------------
  |  |  692|      2|#define CHECK_EQ(val1, val2) BAIDU_CHECK_OP(EQ, ==, val1, val2)
  |  |  ------------------
  |  |  |  |  630|      2|    if (std::string* _result =                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (630:22): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  631|      2|        ::logging::Check##name##Impl((val1), (val2),                    \
  |  |  |  |  632|      2|                                     #val1 " " #op " " #val2))          \
  |  |  |  |  633|      2|        ::logging::LogMessage(__FILE__, __LINE__, __func__, _result).stream().SetCheck()
  |  |  ------------------
  ------------------
   85|      2|    }
_ZN4bvar9PerSecondINS_5AdderIivEEEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPS2_:
  205|      1|    PerSecond(const butil::StringPiece& name, R* var) : Base(var, -1) {
  206|      1|        this->expose(name);
  207|      1|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EEC2EPS3_l:
   80|      1|        : _var(var)
   81|      1|        , _window_size(window_size > 0 ? window_size : FLAGS_bvar_dump_interval)
  ------------------
  |  Branch (81:24): [True: 0, False: 1]
  ------------------
   82|      1|        , _sampler(var->get_sampler())
   83|      1|        , _series_sampler(NULL) {
   84|      1|        CHECK_EQ(0, _sampler->set_window_size(_window_size));
  ------------------
  |  |  692|      1|#define CHECK_EQ(val1, val2) BAIDU_CHECK_OP(EQ, ==, val1, val2)
  |  |  ------------------
  |  |  |  |  630|      1|    if (std::string* _result =                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (630:22): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  631|      1|        ::logging::Check##name##Impl((val1), (val2),                    \
  |  |  |  |  632|      1|                                     #val1 " " #op " " #val2))          \
  |  |  |  |  633|      1|        ::logging::LogMessage(__FILE__, __LINE__, __func__, _result).stream().SetCheck()
  |  |  ------------------
  ------------------
   85|      1|    }
_ZN4bvar6detail10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSamplerC2EPS5_PS3_:
   59|      1|            : _owner(owner), _series(Op(var)) {}
_ZN4bvar6detail10WindowBaseINS_5AdderIivEELNS_15SeriesFrequencyE1EE13SeriesSampler2OpC2EPS3_:
   51|      1|            explicit Op(R* var) : _var(var) {}
_ZN4bvar9PerSecondINS_5AdderIlvEEEC2ERKN5butil16BasicStringPieceINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPS2_:
  205|      2|    PerSecond(const butil::StringPiece& name, R* var) : Base(var, -1) {
  206|      2|        this->expose(name);
  207|      2|    }

_ZN9mcpack2pb12OutputStream4AreaC2ERKN5butil17LinkerInitializedE:
   47|      2|        Area(const butil::LinkerInitialized&) {}

_Z15get_fuzz_socketv:
   27|    299|inline brpc::Socket* get_fuzz_socket() {
   28|    299|    static brpc::SocketId sid = 0;
   29|    299|    static brpc::SocketUniquePtr sock_ptr;
   30|    299|    static bool initialized = false;
   31|       |
   32|    299|    if (!initialized) {
  ------------------
  |  Branch (32:9): [True: 1, False: 298]
  ------------------
   33|      1|        brpc::SocketOptions options;
   34|      1|        options.remote_side = butil::EndPoint(butil::IP_ANY, 7777);
   35|      1|        if (brpc::Socket::Create(options, &sid) == 0 &&
  ------------------
  |  Branch (35:13): [True: 1, False: 0]
  ------------------
   36|      1|            brpc::Socket::Address(sid, &sock_ptr) == 0) {
  ------------------
  |  Branch (36:13): [True: 1, False: 0]
  ------------------
   37|      1|            initialized = true;
   38|      1|        }
   39|      1|    }
   40|       |
   41|    299|    return sock_ptr.get();
   42|    299|}

LLVMFuzzerTestOneInput:
   27|    327|{
   28|    327|    if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   22|    654|#define kMinInputLength 5
  ------------------
                  if (size < kMinInputLength || size > kMaxInputLength){
  ------------------
  |  |   23|    323|#define kMaxInputLength 1024
  ------------------
  |  Branch (28:9): [True: 4, False: 323]
  |  Branch (28:35): [True: 24, False: 299]
  ------------------
   29|     28|        return 1;
   30|     28|    }
   31|       |
   32|    299|    std::string input(reinterpret_cast<const char*>(data), size);
   33|    299|    butil::IOBuf buf;
   34|    299|    buf.append(input);
   35|       |
   36|    299|    brpc::Socket* sock = get_fuzz_socket();
   37|    299|    if (sock == NULL) {
  ------------------
  |  Branch (37:9): [True: 0, False: 299]
  ------------------
   38|      0|        return 0;
   39|      0|    }
   40|    299|    brpc::policy::ParseNsheadMessage(&buf, sock, false, NULL);
   41|       |
   42|    299|    return 0;
   43|    299|}

