Bug 859928 - Make profiles be saved in temporary directory for B2G.
authorDave Hylands <dhylands@mozilla.com>
Tue, 09 Apr 2013 12:45:49 -0700
changeset 128207 367df9ba7a519018b9b1f7224d363eefd552134c
parent 128206 5e4ccad71f40bc203b36680e76f502126f709fee
child 128208 e13ccfc9b811e3ae99214e1d00a77996228f72eb
push id26196
push userdhylands@mozilla.com
push dateTue, 09 Apr 2013 19:46:31 +0000
treeherdermozilla-inbound@367df9ba7a51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs859928
milestone23.0a1
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
Bug 859928 - Make profiles be saved in temporary directory for B2G.
tools/profiler/SaveProfileTask.h
--- a/tools/profiler/SaveProfileTask.h
+++ b/tools/profiler/SaveProfileTask.h
@@ -35,17 +35,17 @@ WriteCallback(const jschar *buf, uint32_
  * to be sure that it is not being modified while saving.
  */
 class SaveProfileTask : public nsRunnable {
 public:
   SaveProfileTask() {}
 
   NS_IMETHOD Run() {
     // Get file path
-#   if defined(SPS_PLAT_arm_android)
+#   if defined(SPS_PLAT_arm_android) && !defined(MOZ_WIDGET_GONK)
     nsCString tmpPath;
     tmpPath.AppendPrintf("/sdcard/profile_%i_%i.txt", XRE_GetProcessType(), getpid());
 #   else
     nsCOMPtr<nsIFile> tmpFile;
     nsAutoCString tmpPath;
     if (NS_FAILED(NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpFile)))) {
       LOG("Failed to find temporary directory.");
       return NS_ERROR_FAILURE;
@@ -92,17 +92,17 @@ public:
       if (stream.is_open()) {
         JSAutoCompartment autoComp(cx, obj);
         JSObject* profileObj = profiler_get_profile_jsobject(cx);
         jsval val = OBJECT_TO_JSVAL(profileObj);
         JS_Stringify(cx, &val, nullptr, JSVAL_NULL, WriteCallback, &stream);
         stream.close();
         LOGF("Saved to %s", tmpPath.get());
       } else {
-        LOG("Fail to open profile log file.");
+        LOGF("Fail to open profile log file '%s'.", tmpPath.get());
       }
     }
     JS_EndRequest(cx);
     JS_DestroyContext(cx);
 
     return NS_OK;
   }
 };