Revert "Remove WEBRTC_TRACE."

This reverts commit 2209b90449473e1df3e0797b6271c7624b41907d.

Reason for revert: breaks Chromium

Original change's description:
> Remove WEBRTC_TRACE.
> 
> Bug: webrtc:5118
> Change-Id: I0af0f8845ee016fa61d7cecc526e2a672ec8732d
> Reviewed-on: https://webrtc-review.googlesource.com/5382
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20114}

TBR=solenberg@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: Ie54fc05c1d7895c088cba410ed87a7c9a0701427
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:5118
Reviewed-on: https://webrtc-review.googlesource.com/5980
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20115}
diff --git a/modules/audio_processing/agc/agc_manager_direct_unittest.cc b/modules/audio_processing/agc/agc_manager_direct_unittest.cc
index 6a8af6a..a7a296b 100644
--- a/modules/audio_processing/agc/agc_manager_direct_unittest.cc
+++ b/modules/audio_processing/agc/agc_manager_direct_unittest.cc
@@ -13,8 +13,10 @@
 #include "common_types.h"  // NOLINT(build/include)
 #include "modules/audio_processing/agc/mock_agc.h"
 #include "modules/audio_processing/include/mock_audio_processing.h"
+#include "system_wrappers/include/trace.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
+#include "test/testsupport/trace_to_stderr.h"
 
 using ::testing::_;
 using ::testing::DoAll;
@@ -92,6 +94,7 @@
   test::MockGainControl gctrl_;
   TestVolumeCallbacks volume_;
   AgcManagerDirect manager_;
+  test::TraceToStderr trace_to_stderr;
 };
 
 TEST_F(AgcManagerDirectTest, StartupMinVolumeConfigurationIsRespected) {
diff --git a/modules/audio_processing/audio_processing_unittest.cc b/modules/audio_processing/audio_processing_unittest.cc
index 6893159..7cd2c95 100644
--- a/modules/audio_processing/audio_processing_unittest.cc
+++ b/modules/audio_processing/audio_processing_unittest.cc
@@ -38,6 +38,7 @@
 #include "rtc_base/task_queue.h"
 #include "rtc_base/thread.h"
 #include "system_wrappers/include/event_wrapper.h"
+#include "system_wrappers/include/trace.h"
 #include "test/gtest.h"
 #include "test/testsupport/fileutils.h"
 
@@ -350,9 +351,11 @@
   virtual void TearDown();
 
   static void SetUpTestCase() {
+    Trace::CreateTrace();
   }
 
   static void TearDownTestCase() {
+    Trace::ReturnTrace();
     ClearTempFiles();
   }
 
diff --git a/modules/audio_processing/test/aec_dump_based_simulator.cc b/modules/audio_processing/test/aec_dump_based_simulator.cc
index 23b7afb..0e32978 100644
--- a/modules/audio_processing/test/aec_dump_based_simulator.cc
+++ b/modules/audio_processing/test/aec_dump_based_simulator.cc
@@ -14,6 +14,7 @@
 
 #include "modules/audio_processing/test/protobuf_utils.h"
 #include "rtc_base/checks.h"
+#include "test/testsupport/trace_to_stderr.h"
 
 namespace webrtc {
 namespace test {
@@ -209,6 +210,11 @@
 }
 
 void AecDumpBasedSimulator::Process() {
+  std::unique_ptr<test::TraceToStderr> trace_to_stderr;
+  if (settings_.use_verbose_logging) {
+    trace_to_stderr.reset(new test::TraceToStderr(true));
+  }
+
   CreateAudioProcessor();
   dump_input_file_ = OpenFile(settings_.aec_dump_input_filename->c_str(), "rb");
 
@@ -229,6 +235,8 @@
 
   webrtc::audioproc::Event event_msg;
   int num_forward_chunks_processed = 0;
+  const float kOneBykChunksPerSecond =
+      1.f / AudioProcessingSimulator::kChunksPerSecond;
   while (ReadMessageFromFile(dump_input_file_, &event_msg)) {
     switch (event_msg.type()) {
       case webrtc::audioproc::Event::INIT:
@@ -251,6 +259,10 @@
       default:
         RTC_CHECK(false);
     }
+    if (trace_to_stderr) {
+      trace_to_stderr->SetTimeSeconds(num_forward_chunks_processed *
+                                      kOneBykChunksPerSecond);
+    }
   }
 
   fclose(dump_input_file_);
diff --git a/modules/audio_processing/test/wav_based_simulator.cc b/modules/audio_processing/test/wav_based_simulator.cc
index f53d1e5..5992429 100644
--- a/modules/audio_processing/test/wav_based_simulator.cc
+++ b/modules/audio_processing/test/wav_based_simulator.cc
@@ -15,6 +15,7 @@
 
 #include "modules/audio_processing/test/test_utils.h"
 #include "rtc_base/checks.h"
+#include "test/testsupport/trace_to_stderr.h"
 
 namespace webrtc {
 namespace test {
@@ -87,6 +88,11 @@
 }
 
 void WavBasedSimulator::Process() {
+  std::unique_ptr<test::TraceToStderr> trace_to_stderr;
+  if (settings_.use_verbose_logging) {
+    trace_to_stderr.reset(new test::TraceToStderr(true));
+  }
+
   if (settings_.custom_call_order_filename) {
     call_chain_ = WavBasedSimulator::GetCustomEventChain(
         *settings_.custom_call_order_filename);
@@ -100,6 +106,8 @@
   bool samples_left_to_process = true;
   int call_chain_index = 0;
   int num_forward_chunks_processed = 0;
+  const int kOneBykChunksPerSecond =
+      1.f / AudioProcessingSimulator::kChunksPerSecond;
   while (samples_left_to_process) {
     switch (call_chain_[call_chain_index]) {
       case SimulationEventType::kProcessStream:
@@ -116,6 +124,11 @@
     }
 
     call_chain_index = (call_chain_index + 1) % call_chain_.size();
+
+    if (trace_to_stderr) {
+      trace_to_stderr->SetTimeSeconds(num_forward_chunks_processed *
+                                      kOneBykChunksPerSecond);
+    }
   }
 
   DestroyAudioProcessor();