Skip to content

Commit c16fdc6

Browse files
authored
Opt IOBuf Profiler (#3251)
1 parent d1d6175 commit c16fdc6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/butil/iobuf_profiler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ bool IsIOBufProfilerEnabled() {
7373
}
7474

7575
bool IsIOBufProfilerSamplable() {
76-
pthread_once(&g_iobuf_profiler_info_once, InitGlobalIOBufProfilerInfo);
76+
if (!IsIOBufProfilerEnabled()) {
77+
return false;
78+
}
7779
if (g_iobuf_profiler_sample_rate == 100) {
7880
return true;
7981
}

0 commit comments

Comments
 (0)