Bug 791404: Sample at 10ms on gonk for more realistic results. r=BenWa
authorChris Jones <jones.chris.g@gmail.com>
Mon, 24 Sep 2012 15:38:07 -0700
changeset 108061 4cf7fbb68148595cd6f87345245a93d8bcb47738
parent 108060 072674dbb5c7fefb95e2a6aa92b5e5c6fecd88b3
child 108062 d12c34bb82fa3100d0986ef5dec17e865d21e81d
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersBenWa
bugs791404
milestone18.0a1
Bug 791404: Sample at 10ms on gonk for more realistic results. r=BenWa
tools/profiler/sps_sampler.h
--- a/tools/profiler/sps_sampler.h
+++ b/tools/profiler/sps_sampler.h
@@ -84,17 +84,24 @@ extern bool stack_key_initialized;
 #endif
 
 #ifndef PLATFORM_LIKELY_MEMORY_CONSTRAINED
 # define PROFILE_DEFAULT_ENTRY 1000000
 #else
 # define PROFILE_DEFAULT_ENTRY 100000
 #endif
 
-#ifdef ANDROID
+#if defined(PLATFORM_LIKELY_MEMORY_CONSTRAINED)
+/* A 1ms sampling interval has been shown to be a large perf hit
+ * (10fps) on memory-contrained (low-end) platforms, and additionally
+ * to yield different results from the profiler.  Where this is the
+ * important case, b2g, there are also many gecko processes which
+ * magnify these effects. */
+# define PROFILE_DEFAULT_INTERVAL 10
+#elif defined(ANDROID)
 // We use a lower frequency on Android, in order to make things work
 // more smoothly on phones.  This value can be adjusted later with
 // some libunwind optimizations.
 // In one sample measurement on Galaxy Nexus, out of about 700 backtraces,
 // 60 of them took more than 25ms, and the average and standard deviation
 // were 6.17ms and 9.71ms respectively.
 
 // For now since we don't support stackwalking let's use 1ms since it's fast