зеркало из https://github.com/mozilla/gecko-dev.git
Back out 712758b52e76 (Bug 925621) for build bustage. r=backout
This commit is contained in:
Родитель
3f15de1f7b
Коммит
ed2ac321bc
|
@ -57,7 +57,7 @@ JS_UnsafeGetLastProfilingError()
|
|||
|
||||
#ifdef __APPLE__
|
||||
static bool
|
||||
StartOSXProfiling(const char *profileName, pid_t pid)
|
||||
StartOSXProfiling(const char *profileName = nullptr)
|
||||
{
|
||||
bool ok = true;
|
||||
const char* profiler = nullptr;
|
||||
|
@ -66,7 +66,7 @@ StartOSXProfiling(const char *profileName, pid_t pid)
|
|||
profiler = "Shark";
|
||||
#endif
|
||||
#ifdef MOZ_INSTRUMENTS
|
||||
ok = Instruments::Start(pid);
|
||||
ok = Instruments::Start();
|
||||
profiler = "Instruments";
|
||||
#endif
|
||||
if (!ok) {
|
||||
|
@ -81,11 +81,11 @@ StartOSXProfiling(const char *profileName, pid_t pid)
|
|||
#endif
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_StartProfiling(const char *profileName, pid_t pid)
|
||||
JS_StartProfiling(const char *profileName)
|
||||
{
|
||||
bool ok = true;
|
||||
#ifdef __APPLE__
|
||||
ok = StartOSXProfiling(profileName, pid);
|
||||
ok = StartOSXProfiling(profileName);
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
if (!js_StartPerf())
|
||||
|
@ -226,25 +226,14 @@ StartProfiling(JSContext *cx, unsigned argc, jsval *vp)
|
|||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
if (args.length() == 0) {
|
||||
args.rval().setBoolean(JS_StartProfiling(nullptr, getpid()));
|
||||
args.rval().setBoolean(JS_StartProfiling(nullptr));
|
||||
return true;
|
||||
}
|
||||
|
||||
RequiredStringArg profileName(cx, args, 0, "startProfiling");
|
||||
if (!profileName)
|
||||
return false;
|
||||
|
||||
if (args.length() == 1) {
|
||||
args.rval().setBoolean(JS_StartProfiling(profileName.mBytes, getpid()));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!args[1].isInt32()) {
|
||||
JS_ReportError(cx, "startProfiling: invalid arguments (int expected)");
|
||||
return false;
|
||||
}
|
||||
pid_t pid = static_cast<pid_t>(args[1].toInt32());
|
||||
args.rval().setBoolean(JS_StartProfiling(profileName.mBytes, pid));
|
||||
args.rval().setBoolean(JS_StartProfiling(profileName.mBytes));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* Returns true if no profilers fail to start.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_StartProfiling(const char *profileName, pid_t pid);
|
||||
JS_StartProfiling(const char *profileName);
|
||||
|
||||
/**
|
||||
* Stop any profilers that were previously started with JS_StartProfiling.
|
||||
|
|
|
@ -143,7 +143,7 @@ Error(CFErrorRef error)
|
|||
}
|
||||
|
||||
bool
|
||||
Start(pid_t pid)
|
||||
Start()
|
||||
{
|
||||
if (gSession) {
|
||||
return false;
|
||||
|
@ -154,7 +154,8 @@ Start(pid_t pid)
|
|||
}
|
||||
|
||||
AutoReleased<CFStringRef> process =
|
||||
CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%d"), pid);
|
||||
CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%d"),
|
||||
getpid());
|
||||
if (!process) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
namespace Instruments {
|
||||
|
||||
bool Start(pid_t pid);
|
||||
bool Start();
|
||||
void Pause();
|
||||
bool Resume();
|
||||
void Stop(const char* profileName);
|
||||
|
|
Загрузка…
Ссылка в новой задаче