Bug 970713: Adjust webrtc trace buffering for about:webrtc changes r=pkerr
authorRandell Jesup <rjesup@jesup.org>
Mon, 09 Jun 2014 04:34:37 -0400
changeset 207833 bbe4ed7704532dc62289fd0d299a941f62641c5f
parent 207832 73019c846afdcf5121e4e96ce780ced976ebc8cf
child 207834 f7e0ffc1debdbac432fa5a96bd0d5ae7765c1fc9
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspkerr
bugs970713
milestone32.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 970713: Adjust webrtc trace buffering for about:webrtc changes r=pkerr
build/gyp.mozbuild
media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc
media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.h
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -26,17 +26,17 @@ gyp_vars = {
     'build_libvpx': 0,
     'build_libyuv': 0,
     'libyuv_dir': '/media/libyuv',
     'yuv_disable_avx2': 0 if CONFIG['HAVE_X86_AVX2'] else 1,
     # don't use openssl
     'use_openssl': 0,
 
     # saves 4MB when webrtc_trace is off
-    'enable_lazy_trace_alloc': 1,
+    'enable_lazy_trace_alloc': 0,
 
      # turn off mandatory use of NEON and instead use NEON detection
     'arm_neon': 0,
     'arm_neon_optional': 1,
 
     'moz_widget_toolkit_gonk': 0,
     'moz_webrtc_omx': 0,
 
--- a/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc
+++ b/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc
@@ -468,27 +468,27 @@ void TraceImpl::AddMessageToList(
   // cache misses/etc
   if (!message_queue_[active_queue_][idx]) {
   return;
 }
 #endif
 
   if (idx >= WEBRTC_TRACE_MAX_QUEUE) {
     if (!trace_file_.Open() && !callback_) {
-      // Keep at least the last 1/4 of old messages when not logging.
+      // Drop the first 1/4 of old messages when not logging.
       // TODO(hellner): isn't this redundant. The user will make it known
       //                when to start logging. Why keep messages before
       //                that?
-      for (int n = 0; n < WEBRTC_TRACE_MAX_QUEUE / 4; ++n) {
-        const int last_quarter_offset = (3 * WEBRTC_TRACE_MAX_QUEUE / 4);
+      for (int n = 0; n < WEBRTC_TRACE_MAX_QUEUE * 3 / 4; ++n) {
+        const int last_quarter_offset = (1 * WEBRTC_TRACE_MAX_QUEUE / 4);
         memcpy(message_queue_[active_queue_][n],
                message_queue_[active_queue_][n + last_quarter_offset],
                WEBRTC_TRACE_MAX_MESSAGE_SIZE);
       }
-      idx = next_free_idx_[active_queue_] = WEBRTC_TRACE_MAX_QUEUE / 4;
+      idx = next_free_idx_[active_queue_] = WEBRTC_TRACE_MAX_QUEUE * 3 / 4;
     } else {
       // More messages are being written than there is room for in the
       // buffer. Drop any new messages.
       // TODO(hellner): its probably better to drop old messages instead
       //                of new ones. One step further: if this happens
       //                it's due to writing faster than what can be
       //                processed. Maybe modify the filter at this point.
       //                E.g. turn of STREAM.
--- a/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.h
+++ b/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.h
@@ -22,17 +22,17 @@ namespace webrtc {
 
 // TODO(pwestin) WEBRTC_TRACE_MAX_QUEUE needs to be tweaked
 // TODO(hellner) the buffer should be close to how much the system can write to
 //               file. Increasing the buffer will not solve anything. Sooner or
 //               later the buffer is going to fill up anyways.
 #if defined(WEBRTC_IOS)
 #define WEBRTC_TRACE_MAX_QUEUE  2000
 #else
-#define WEBRTC_TRACE_MAX_QUEUE  8000
+#define WEBRTC_TRACE_MAX_QUEUE  16000
 #endif
 #define WEBRTC_TRACE_NUM_ARRAY 2
 #define WEBRTC_TRACE_MAX_MESSAGE_SIZE 256
 // Total buffer size is WEBRTC_TRACE_NUM_ARRAY (number of buffer partitions) *
 // WEBRTC_TRACE_MAX_QUEUE (number of lines per buffer partition) *
 // WEBRTC_TRACE_MAX_MESSAGE_SIZE (number of 1 byte charachters per line) =
 // 1 or 4 Mbyte.