Skip to content

Commit f6d0d49

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Skip querying for current ticks for filtered out logs. (#2300)
Summary: Pull Request resolved: #2300 . Reviewed By: kirklandsign Differential Revision: D54646899 fbshipit-source-id: f7afac1422d40028ffba11c8c7f34a8e78db5c12
1 parent 9d6bf72 commit f6d0d49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/platform/log.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ inline void logf(
148148
*/
149149
#define ET_LOG(_level, _format, ...) \
150150
({ \
151-
et_timestamp_t _timestamp = torch::executor::internal::getLogTimestamp(); \
152-
auto _log_level = torch::executor::LogLevel::_level; \
151+
const auto _log_level = torch::executor::LogLevel::_level; \
153152
if (static_cast<uint32_t>(_log_level) >= \
154153
static_cast<uint32_t>(torch::executor::LogLevel::ET_MIN_LOG_LEVEL)) { \
154+
const auto _timestamp = torch::executor::internal::getLogTimestamp(); \
155155
torch::executor::internal::logf( \
156156
_log_level, \
157157
_timestamp, \

0 commit comments

Comments
 (0)