Bug 799638 - Use stackwalk on startup profiling for win/mac. r=ehsan
authorBenoit Girard <b56girard@gmail.com>
Sat, 13 Oct 2012 21:03:09 -0400
changeset 110341 632ce3e7d3efa25a537974502ba4e5c2e55feaa0
parent 110340 f82c3f3bb6548edf4840ca7cafa7e0a9937dadb4
child 110342 2a8fef2bd2285e5b8f41f8f53770c951bc2a78af
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs799638
milestone19.0a1
Bug 799638 - Use stackwalk on startup profiling for win/mac. r=ehsan
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -1005,19 +1005,23 @@ void mozilla_sampler_init()
   // We can't open pref so we use an environment variable
   // to know if we should trigger the profiler on startup
   // NOTE: Default
   const char *val = PR_GetEnv("MOZ_PROFILER_STARTUP");
   if (!val || !*val) {
     return;
   }
 
-  const char* features = "js";
+  const char* features[] = {"js"
+#if defined(XP_WIN) || defined(XP_MACOSX)
+                         , "stackwalk"
+#endif
+                         };
   mozilla_sampler_start(PROFILE_DEFAULT_ENTRY, PROFILE_DEFAULT_INTERVAL,
-                        &features, 1);
+                        features, mozilla::ArrayLength(features));
 }
 
 void mozilla_sampler_deinit()
 {
   mozilla_sampler_stop();
   // We can't delete the Stack because we can be between a
   // sampler call_enter/call_exit point.
   // TODO Need to find a safe time to delete Stack