#6 Notify SamplingProfiler of the main MachineThread
Reviewed By: bnham Differential Revision: D3503444 fbshipit-source-id: a2e9a692cd5badac5a15416844c8497f88021a5e
This commit is contained in:
Родитель
4843a90c1c
Коммит
edb9fce9c3
|
@ -117,6 +117,7 @@ react_library(
|
|||
'JSCLegacyTracing.cpp',
|
||||
'JSCMemory.cpp',
|
||||
'JSCPerfStats.cpp',
|
||||
'JSCSamplingProfiler.cpp',
|
||||
'JSCTracing.cpp',
|
||||
'JSCWebWorker.cpp',
|
||||
'MethodCall.cpp',
|
||||
|
@ -130,6 +131,7 @@ react_library(
|
|||
'JSCLegacyTracing.h',
|
||||
'JSCMemory.h',
|
||||
'JSCPerfStats.h',
|
||||
'JSCSamplingProfiler.h',
|
||||
'JSCTracing.h',
|
||||
],
|
||||
exported_headers = [
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#include "SystraceSection.h"
|
||||
#include "Value.h"
|
||||
|
||||
#include "JSCSamplingProfiler.h"
|
||||
|
||||
#if defined(WITH_JSC_EXTRA_TRACING) || DEBUG
|
||||
#include "JSCTracing.h"
|
||||
#endif
|
||||
|
@ -223,6 +225,8 @@ void JSCExecutor::initOnJSVMThread() throw(JSException) {
|
|||
addNativeProfilingHooks(m_context);
|
||||
addNativeTracingLegacyHooks(m_context);
|
||||
PerfLogging::installNativeHooks(m_context);
|
||||
|
||||
initSamplingProfilerOnMainJSCThread(m_context);
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FB_MEMORY_PROFILING
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#ifdef WITH_JSC_EXTRA_TRACING
|
||||
|
||||
#include "JSCSamplingProfiler.h"
|
||||
|
||||
#include <JavaScriptCore/API/JSProfilerPrivate.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx) {
|
||||
JSStartSamplingProfilingOnMainJSCThread(ctx);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WITH_JSC_EXTRA_TRACING
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef WITH_JSC_EXTRA_TRACING
|
||||
|
||||
#include <JavaScriptCore/JSContextRef.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WITH_JSC_EXTRA_TRACING
|
Загрузка…
Ссылка в новой задаче