Back out 712758b52e76 (Bug 925621) for build bustage. r=backout
authorDrew Willcoxon <adw@mozilla.com>
Thu, 24 Oct 2013 17:49:54 -0700
changeset 165856 a701245097855d49a23bd24e26e5f7c471f01222
parent 165855 712758b52e762897e5963f469839cd1ad310824a
child 165857 a25982be666ce6033a73c97a7525dff6e0af0e28
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs925621
milestone27.0a1
backs out712758b52e762897e5963f469839cd1ad310824a
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 712758b52e76 (Bug 925621) for build bustage. r=backout
js/src/builtin/Profilers.cpp
js/src/builtin/Profilers.h
js/src/devtools/Instruments.cpp
js/src/devtools/Instruments.h
--- a/js/src/builtin/Profilers.cpp
+++ b/js/src/builtin/Profilers.cpp
@@ -52,45 +52,45 @@ UnsafeError(const char *format, ...)
 JS_PUBLIC_API(const char *)
 JS_UnsafeGetLastProfilingError()
 {
     return gLastError;
 }
 
 #ifdef __APPLE__
 static bool
-StartOSXProfiling(const char *profileName, pid_t pid)
+StartOSXProfiling(const char *profileName = nullptr)
 {
     bool ok = true;
     const char* profiler = nullptr;
 #ifdef MOZ_SHARK
     ok = Shark::Start();
     profiler = "Shark";
 #endif
 #ifdef MOZ_INSTRUMENTS
-    ok = Instruments::Start(pid);
+    ok = Instruments::Start();
     profiler = "Instruments";
 #endif
     if (!ok) {
         if (profileName)
             UnsafeError("Failed to start %s for %s", profiler, profileName);
         else
             UnsafeError("Failed to start %s", profiler);
         return false;
     }
     return true;
 }
 #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())
         ok = false;
 #endif
     return ok;
 }
 
@@ -221,35 +221,24 @@ struct RequiredStringArg {
     }
 };
 
 static bool
 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;
 }
 
 static bool
 StopProfiling(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     if (args.length() == 0) {
--- a/js/src/builtin/Profilers.h
+++ b/js/src/builtin/Profilers.h
@@ -20,17 +20,17 @@
  * The profileName is used by some profilers to describe the current profiling
  * run. It may be used for part of the filename of the output, but the
  * specifics depend on the profiler. Many profilers will ignore it. Passing in
  * nullptr is legal; some profilers may use it to output to stdout or similar.
  *
  * 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.
  * Returns true if no profilers fail to stop.
  */
 extern JS_PUBLIC_API(bool)
 JS_StopProfiling(const char *profileName);
 
--- a/js/src/devtools/Instruments.cpp
+++ b/js/src/devtools/Instruments.cpp
@@ -138,28 +138,29 @@ Error(CFErrorRef error)
   if (data != nullptr) {
     printf("%.*s\n\n", (int)CFDataGetLength(data), CFDataGetBytePtr(data));
   }
 #endif
   return false;
 }
 
 bool
-Start(pid_t pid)
+Start()
 {
   if (gSession) {
     return false;
   }
 
   if (!LoadDTPerformanceLibrary()) {
     return false;
   }
 
   AutoReleased<CFStringRef> process =
-    CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%d"), pid);
+    CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%d"),
+                             getpid());
   if (!process) {
     return false;
   }
   CFErrorRef error = nullptr;
   gSession = DTPerformanceSessionCreate(nullptr, process, nullptr, &error);
   if (!gSession) {
     return Error(error);
   }
--- a/js/src/devtools/Instruments.h
+++ b/js/src/devtools/Instruments.h
@@ -2,21 +2,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef devtools_Instruments_h
 #define devtools_Instruments_h
 
 #ifdef __APPLE__
 
-#include <unistd.h>
-
 namespace Instruments {
 
-bool Start(pid_t pid);
+bool Start();
 void Pause();
 bool Resume();
 void Stop(const char* profileName);
 
 }
 
 #endif /* __APPLE__ */