This is an automated email from the ASF dual-hosted git repository.

guangmingchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new c16fdc6b Opt IOBuf Profiler (#3251)
c16fdc6b is described below

commit c16fdc6bb8b3215518e081d4e47b20f62000de6f
Author: Bright Chen <[email protected]>
AuthorDate: Thu Mar 26 15:34:27 2026 +0800

    Opt IOBuf Profiler (#3251)
---
 src/butil/iobuf_profiler.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/butil/iobuf_profiler.cpp b/src/butil/iobuf_profiler.cpp
index 8d213a72..a88e7c55 100644
--- a/src/butil/iobuf_profiler.cpp
+++ b/src/butil/iobuf_profiler.cpp
@@ -73,7 +73,9 @@ bool IsIOBufProfilerEnabled() {
 }
 
 bool IsIOBufProfilerSamplable() {
-    pthread_once(&g_iobuf_profiler_info_once, InitGlobalIOBufProfilerInfo);
+    if (!IsIOBufProfilerEnabled()) {
+        return false;
+    }
     if (g_iobuf_profiler_sample_rate == 100) {
         return true;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to