Fix UST_LOGGER_MARK_COMPLETED build failure in manifold_trace_logger (#1389)#1389
Open
Raymo111 wants to merge 1 commit into
Open
Fix UST_LOGGER_MARK_COMPLETED build failure in manifold_trace_logger (#1389)#1389Raymo111 wants to merge 1 commit into
Raymo111 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates libkineto's stage/USDT logging macros so they no longer expand through LOG(...), avoiding build failures when glog transitively redefines LOG in translation units that include both headers.
Changes:
- Replaced
UST_LOGGER_MARK_COMPLETEDwith a directlibkineto::Logger(...).stream()expansion. - Replaced
USDT_LOGGER_EMIT_MESSAGEsimilarly to avoidLOGmacro substitution at the call site. - Kept the higher-level
USDT_EMIT_START_TRACE/USDT_EMIT_STOP_TRACEhelpers unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+257
to
+265
| // glog/logging.h. | ||
| #define UST_LOGGER_MARK_COMPLETED(stage) \ | ||
| libkineto::VoidLogger() & \ | ||
| libkineto::Logger(libkineto::LoggerOutputType::STAGE, __LINE__, __FILE__).stream() \ | ||
| << "Completed Stage: " << stage | ||
|
|
||
| #define USDT_LOGGER_EMIT_MESSAGE(usdt_type) \ | ||
| libkineto::VoidLogger() & \ | ||
| libkineto::Logger(libkineto::LoggerOutputType::USDT, __LINE__, __FILE__).stream() << usdt_type |
Comment on lines
+263
to
+265
| #define USDT_LOGGER_EMIT_MESSAGE(usdt_type) \ | ||
| libkineto::VoidLogger() & \ | ||
| libkineto::Logger(libkineto::LoggerOutputType::USDT, __LINE__, __FILE__).stream() << usdt_type |
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 6, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235 Signed-off-by: Raymond Li <raymo@meta.com>
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 6, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235 Signed-off-by: Raymond Li <raymo@meta.com>
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 11, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235
2e73ebd to
aca90bc
Compare
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 11, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235
aca90bc to
a77f61e
Compare
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 11, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235
a77f61e to
8f19706
Compare
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 12, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235 Signed-off-by: Raymond Li <raymo@meta.com>
8f19706 to
1934a92
Compare
Raymo111
added a commit
to Raymo111/kineto
that referenced
this pull request
May 12, 2026
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235 Signed-off-by: Raymond Li <raymo@meta.com>
1934a92 to
01ca837
Compare
…ytorch#1389) Summary: The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies on kineto's custom LOG macro. However, glog's LOG macro (included transitively via ust_logger_collector -> fb_device_utils -> glog) redefines LOG to COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier COMPACT_GOOGLE_LOG_libkineto at the call site. These macros now expand directly to the underlying libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them immune to glog redefining LOG at the call site. Differential Revision: D98533235 Signed-off-by: Raymond Li <raymo@meta.com>
01ca837 to
a52c3d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The UST_LOGGER_MARK_COMPLETED, USDT_LOGGER_EMIT_MESSAGE, and USDT_EMIT_START_TRACE
macros in Logger.h expanded to LOG(libkineto::LoggerOutputType::STAGE), which relies
on kineto's custom LOG macro. However, glog's LOG macro (included transitively via
ust_logger_collector -> fb_device_utils -> glog) redefines LOG to
COMPACT_GOOGLE_LOG_##severity, producing the nonsensical identifier
COMPACT_GOOGLE_LOG_libkineto at the call site.
These macros now expand directly to the underlying
libkineto::VoidLogger() & libkineto::Logger(...).stream() expression, making them
immune to glog redefining LOG at the call site.
Differential Revision: D98533235