Skip to content

ENABLE_JS_SYSTRACE_TO_ETW (JS ETW Tracing) is Unintentionally Always Disabled #4245

@NickGerleman

Description

@NickGerleman

In #3934 we introduced a subtle build-logic issue which leads to ENABLE_JS_SYSTRACE_TO_ETW always being disabled. We had intended to only enable it when using patched React Native, but end up comparing against a literal string instead of a property. See '$PATCH_RN'=='true' in the following condition.

<PreprocessorDefinitions Condition="'$(ENABLE_JS_SYSTRACE_TO_ETW)'=='true' AND '$PATCH_RN'=='true'">ENABLE_JS_SYSTRACE_TO_ETW;WITH_FBSYSTRACE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Reenabling this on deforked React Native leads to build errors:

d:\react-native-windows\vnext\reactwindowscore\tracing\fbsystrace.h(71): error C2664: 'void fbsystrace::FbSystraceSection::init(void)': cannot convert argument 1 from 'const double' to 'std::string &&' (compiling source file D:\react-native-windows\vnext\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp)
2>  d:\react-native-windows\vnext\reactwindowscore\tracing\fbsystrace.h(69): note: Reason: cannot convert from 'const double' to 'std::string' (compiling source file D:\react-native-windows\vnext\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp)
2>  d:\react-native-windows\vnext\reactwindowscore\tracing\fbsystrace.h(69): note: No constructor could take the source type, or constructor overload resolution was ambiguous (compiling source file D:\react-native-windows\vnext\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp)
2>  d:\react-native-windows\vnext\reactwindowscore\tracing\fbsystrace.h(82): note: see reference to function template instantiation 'void fbsystrace::FbSystraceSection::init<const double&>(std::string &&,const double &)' being compiled (compiling source file D:\react-native-windows\vnext\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp)
2>  d:\react-native-windows\vnext\build\x64\debug\reactcommon\react-native-patched\reactcommon\cxxreact\systracesection.h(30): note: see reference to function template instantiation 'fbsystrace::FbSystraceSection::FbSystraceSection<const char(&)[11],const double&>(uint64_t,std::string &&,const char (&)[11],const double &)' being compiled (compiling source file D:\react-native-windows\vnext\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp)
2>  d:\react-native-windows\vnext\build\x64\debug\reactcommon\react-native-patched\reactcommon\jsiexecutor\jsireact\jsiexecutor.cpp(233): note: see reference to function template instantiation 'facebook::react::ConcreteSystraceSection::ConcreteSystraceSection<const char(&)[11],const double&>(const char *,const char (&)[11],const double &)' being compiled
2>  d:\react-native-windows\node_modules\.folly\folly-2019.09.30.00\folly\range.h(1356): note: see reference to class template instantiation 'folly::Range<const char *>' being compiled (compiling source file D:\react-native-windows\vnext\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp)

We can fix this without much issue in 0.60-stable, but need to think a bit harder in how to do it in 0.61 where we don't use the fork.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions