Redirect logs to stderr in audioproc_f.

Notably, this displays logs from the AGC.

Also add a "time per chunk" field to the perf output.

R=aluebs@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/56509004

Cr-Commit-Position: refs/heads/master@{#9302}
diff --git a/webrtc/modules/audio_processing/audio_processing_tests.gypi b/webrtc/modules/audio_processing/audio_processing_tests.gypi
index f5d6dae..7658e10 100644
--- a/webrtc/modules/audio_processing/audio_processing_tests.gypi
+++ b/webrtc/modules/audio_processing/audio_processing_tests.gypi
@@ -109,6 +109,7 @@
             'audioproc_debug_proto',
             'audioproc_test_utils',
             'audioproc_protobuf_utils',
+            '<(webrtc_root)/test/test.gyp:test_support',
             '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
           ],
           'sources': [ 'test/audioproc_float.cc', ],
diff --git a/webrtc/modules/audio_processing/test/audioproc_float.cc b/webrtc/modules/audio_processing/test/audioproc_float.cc
index b3765c5..381d7fd 100644
--- a/webrtc/modules/audio_processing/test/audioproc_float.cc
+++ b/webrtc/modules/audio_processing/test/audioproc_float.cc
@@ -21,6 +21,7 @@
 #include "webrtc/modules/audio_processing/test/protobuf_utils.h"
 #include "webrtc/modules/audio_processing/test/test_utils.h"
 #include "webrtc/system_wrappers/interface/tick_util.h"
+#include "webrtc/test/testsupport/trace_to_stderr.h"
 
 DEFINE_string(dump, "", "The name of the debug dump file to read from.");
 DEFINE_string(i, "", "The name of the input file to read from.");
@@ -73,6 +74,7 @@
     return 1;
   }
 
+  test::TraceToStderr trace_to_stderr(true);
   WavReader in_file(FLAGS_i);
   // If the output format is uninitialized, use the input format.
   const int out_channels =
@@ -127,6 +129,8 @@
   int num_chunks = 0;
   while (in_file.ReadSamples(in_interleaved.size(),
                              &in_interleaved[0]) == in_interleaved.size()) {
+    // Have logs display the file time rather than wallclock time.
+    trace_to_stderr.SetTimeSeconds(num_chunks * 1.f / kChunksPerSecond);
     FloatS16ToFloat(&in_interleaved[0], in_interleaved.size(),
                     &in_interleaved[0]);
     Deinterleave(&in_interleaved[0], in_buf.num_frames(),
@@ -155,8 +159,11 @@
     num_chunks++;
   }
   if (FLAGS_perf) {
-    printf("Execution time: %.3fs\nFile time: %.2fs\n\n",
-           accumulated_time.Milliseconds() * 0.001f, num_chunks * 0.01f);
+    int64_t execution_time_ms = accumulated_time.Milliseconds();
+    printf("\nExecution time: %.3f s\nFile time: %.2f s\n"
+           "Time per chunk: %.3f ms\n",
+           execution_time_ms * 0.001f, num_chunks * 1.f / kChunksPerSecond,
+           execution_time_ms * 1.f / num_chunks);
   }
   return 0;
 }