Log Memory tags using LegacyProfiler

Reviewed By: jspahrsummers

Differential Revision: D2789647

fb-gh-sync-id: 220a0fc4eccccd92a6b8f45b07b32735a7054614
This commit is contained in:
Mike Armstrong 2015-12-29 22:11:40 -08:00 committed by facebook-github-bot-9
parent 322a77340c
commit dfcc4f8ad5
1 changed files with 8 additions and 22 deletions

View File

@ -419,19 +419,12 @@ static JSValueRef nativeTraceBeginLegacy(
size_t argumentCount,
const JSValueRef arguments[],
JSValueRef* exception) {
if (FBSYSTRACE_UNLIKELY(argumentCount < 1)) {
if (exception) {
*exception = facebook::react::makeJSCException(
ctx,
"nativeTraceBeginLegacy: requires TAG Argument");
}
return JSValueMakeUndefined(ctx);
}
if (FBSYSTRACE_LIKELY(argumentCount >= 1)) {
uint64_t tag = tagFromJSValue(ctx, arguments[0], exception);
if (!fbsystrace_is_tracing(tag)) {
return JSValueMakeUndefined(ctx);
}
}
JSStringRef title = JSStringCreateWithUTF8CString(ENABLED_FBSYSTRACE_PROFILE_NAME);
#if WITH_JSC_INTERNAL
@ -451,19 +444,12 @@ static JSValueRef nativeTraceEndLegacy(
size_t argumentCount,
const JSValueRef arguments[],
JSValueRef* exception) {
if (FBSYSTRACE_UNLIKELY(argumentCount < 1)) {
if (exception) {
*exception = facebook::react::makeJSCException(
ctx,
"nativeTraceBeginLegacy: requires TAG Argument");
}
return JSValueMakeUndefined(ctx);
}
if (FBSYSTRACE_LIKELY(argumentCount >= 1)) {
uint64_t tag = tagFromJSValue(ctx, arguments[0], exception);
if (!fbsystrace_is_tracing(tag)) {
return JSValueMakeUndefined(ctx);
}
}
JSStringRef title = JSStringCreateWithUTF8CString(ENABLED_FBSYSTRACE_PROFILE_NAME);
JSEndProfiling(ctx, title);