mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-18 04:13:51 +08:00
#15 Add a button in devtools to start/stop the Sampling Profiler
Differential Revision: D3555704 fbshipit-source-id: 4add16c923fcfd306892efec4630c24ae438d6dd
This commit is contained in:
committed by
Facebook Github Bot 8
parent
e762d961cd
commit
ec0ccf599a
@@ -4,13 +4,30 @@
|
||||
|
||||
#include "JSCSamplingProfiler.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <JavaScriptCore/API/JSProfilerPrivate.h>
|
||||
#include "JSCHelpers.h"
|
||||
|
||||
#include "Value.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
namespace {
|
||||
static JSValueRef pokeSamplingProfiler(
|
||||
JSContextRef ctx,
|
||||
JSObjectRef function,
|
||||
JSObjectRef thisObject,
|
||||
size_t argumentCount,
|
||||
const JSValueRef arguments[],
|
||||
JSValueRef* exception) {
|
||||
return JSPokeSamplingProfiler(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx) {
|
||||
JSStartSamplingProfilingOnMainJSCThread(ctx);
|
||||
installGlobalFunction(ctx, "pokeSamplingProfiler", pokeSamplingProfiler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user