Bug 790261 - Avoid the profiler misbehaving randomly when mozilla_sampler_start is given impossible values. r=Benwa
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Sep 2012 17:33:53 +0200
changeset 106888 fe96a330ddd8f79d7cb51560a8d80f17ab1517b7
parent 106887 e3c8270cfefedd90993f458cdfe212be6d9f73ba
child 106889 cb4045ed877677bfc62b22889ae629d232c7216f
push id23452
push useremorley@mozilla.com
push dateWed, 12 Sep 2012 20:51:15 +0000
treeherdermozilla-central@7781628da6dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenwa
bugs790261
milestone18.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 790261 - Avoid the profiler misbehaving randomly when mozilla_sampler_start is given impossible values. r=Benwa
tools/profiler/TableTicker.cpp
--- a/tools/profiler/TableTicker.cpp
+++ b/tools/profiler/TableTicker.cpp
@@ -1084,18 +1084,19 @@ void mozilla_sampler_start(int aProfileE
   ProfileStack *stack = tlsStack.get();
   if (!stack) {
     ASSERT(false);
     return;
   }
 
   mozilla_sampler_stop();
 
-  TableTicker *t = new TableTicker(aInterval, aProfileEntries, stack,
-                                   aFeatures, aFeatureCount);
+  TableTicker *t = new TableTicker(aInterval ? aInterval : PROFILE_DEFAULT_INTERVAL,
+                                   aProfileEntries ? aProfileEntries : PROFILE_DEFAULT_ENTRY,
+                                   stack, aFeatures, aFeatureCount);
   tlsTicker.set(t);
   t->Start();
   if (t->ProfileJS())
       stack->enableJSSampling();
 }
 
 void mozilla_sampler_stop()
 {