Bug 799638 - Use stackwalk on startup profiling for win/mac. r=ehsan
authorBenoit Girard <b56girard@gmail.com>
Sun, 14 Oct 2012 12:08:11 -0400
changeset 110415 6886bd9090c3d744aca44c95d494ba0d6fd66293
parent 110414 8e24562328a9c6286f8fbc2c5c5c4c8c2220df04
child 110416 2d29c74b9c9cb3014d7b53eb7cbffef99236da5e
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, sizeof(features)/sizeof(const char*));
 }
 
 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