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