Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat: add dsn_unlikely in macro ADD_POINT #1029

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/dsn/utils/latency_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ namespace utils {

#define ADD_POINT(tracer) \
do { \
if (tracer != nullptr && (tracer)->enabled()) \
if (dsn_unlikely(tracer != nullptr && (tracer)->enabled())) \
(tracer)->add_point(fmt::format("{}:{}:{}", __FILENAME__, __LINE__, __FUNCTION__)); \
} while (0)

#define ADD_CUSTOM_POINT(tracer, message) \
do { \
if (tracer != nullptr && (tracer)->enabled()) \
if (dsn_unlikely(tracer != nullptr && (tracer)->enabled())) \
(tracer)->add_point( \
fmt::format("{}:{}:{}_{}", __FILENAME__, __LINE__, __FUNCTION__, (message))); \
} while (0)

#define APPEND_EXTERN_POINT(tracer, ts, message) \
do { \
if (tracer != nullptr && (tracer)->enabled()) \
if (dsn_unlikely(tracer != nullptr && (tracer)->enabled())) \
(tracer)->append_point( \
fmt::format("{}:{}:{}_{}", __FILENAME__, __LINE__, __FUNCTION__, (message)), \
(ts)); \
Expand Down