Skip to content

Fix UST_LOGGER_MARK_COMPLETED build failure in manifold_trace_logger (#1389)#1389

Open
Raymo111 wants to merge 1 commit into
pytorch:mainfrom
Raymo111:export-D98533235
Open

Fix UST_LOGGER_MARK_COMPLETED build failure in manifold_trace_logger (#1389)#1389
Raymo111 wants to merge 1 commit into
pytorch:mainfrom
Raymo111:export-D98533235

Conversation

@Raymo111
Copy link
Copy Markdown
Member

@Raymo111 Raymo111 commented May 5, 2026

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

Copilot AI review requested due to automatic review settings May 5, 2026 21:37
@meta-cla meta-cla Bot added the cla signed label May 5, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 5, 2026

@Raymo111 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98533235.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_COMPLETED with a direct libkineto::Logger(...).stream() expansion.
  • Replaced USDT_LOGGER_EMIT_MESSAGE similarly to avoid LOG macro substitution at the call site.
  • Kept the higher-level USDT_EMIT_START_TRACE / USDT_EMIT_STOP_TRACE helpers unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libkineto/src/Logger.h Outdated
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 thread libkineto/src/Logger.h Outdated
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
@meta-codesync meta-codesync Bot changed the title Fix UST_LOGGER_MARK_COMPLETED build failure in manifold_trace_logger Fix UST_LOGGER_MARK_COMPLETED build failure in manifold_trace_logger (#1389) May 6, 2026
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 Raymo111 force-pushed the export-D98533235 branch from 2b680c0 to aabfddd Compare May 6, 2026 20:34
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 Raymo111 force-pushed the export-D98533235 branch from aabfddd to 2e73ebd Compare May 6, 2026 22:04
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
@Raymo111 Raymo111 force-pushed the export-D98533235 branch from 2e73ebd to aca90bc Compare May 11, 2026 20:26
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
@Raymo111 Raymo111 force-pushed the export-D98533235 branch from aca90bc to a77f61e Compare May 11, 2026 20:57
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
@Raymo111 Raymo111 force-pushed the export-D98533235 branch from a77f61e to 8f19706 Compare May 11, 2026 21:02
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>
@Raymo111 Raymo111 force-pushed the export-D98533235 branch from 8f19706 to 1934a92 Compare May 12, 2026 00:09
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>
@Raymo111 Raymo111 force-pushed the export-D98533235 branch from 1934a92 to 01ca837 Compare May 12, 2026 20:09
…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 Raymo111 force-pushed the export-D98533235 branch from 01ca837 to a52c3d5 Compare May 13, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants