| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 #include <stack> | 123 #include <stack> |
| 124 #include <string> | 124 #include <string> |
| 125 | 125 |
| 126 #include "webrtc/base/constructormagic.h" | 126 #include "webrtc/base/constructormagic.h" |
| 127 #include "webrtc/base/scoped_ptr.h" | 127 #include "webrtc/base/scoped_ptr.h" |
| 128 #include "webrtc/common_types.h" | 128 #include "webrtc/common_types.h" |
| 129 | 129 |
| 130 #define BWE_TEST_LOGGING_GLOBAL_CONTEXT(name) \ | 130 #define BWE_TEST_LOGGING_GLOBAL_CONTEXT(name) \ |
| 131 do { \ | 131 do { \ |
| 132 webrtc::testing::bwe::Logging::GetInstance()->SetGlobalContext(name); \ | 132 webrtc::testing::bwe::Logging::GetInstance()->SetGlobalContext(name); \ |
| 133 } while (0); | 133 } while (0) |
| 134 | 134 |
| 135 #define BWE_TEST_LOGGING_GLOBAL_ENABLE(enabled) \ | 135 #define BWE_TEST_LOGGING_GLOBAL_ENABLE(enabled) \ |
| 136 do { \ | 136 do { \ |
| 137 webrtc::testing::bwe::Logging::GetInstance()->SetGlobalEnable(enabled); \ | 137 webrtc::testing::bwe::Logging::GetInstance()->SetGlobalEnable(enabled); \ |
| 138 } while (0); | 138 } while (0) |
| 139 | 139 |
| 140 #define __BWE_TEST_LOGGING_CONTEXT_NAME(ctx, line) ctx ## line | 140 #define __BWE_TEST_LOGGING_CONTEXT_NAME(ctx, line) ctx ## line |
| 141 #define __BWE_TEST_LOGGING_CONTEXT_DECLARE(ctx, line, name, time, enabled) \ | 141 #define __BWE_TEST_LOGGING_CONTEXT_DECLARE(ctx, line, name, time, enabled) \ |
| 142 webrtc::testing::bwe::Logging::Context \ | 142 webrtc::testing::bwe::Logging::Context \ |
| 143 __BWE_TEST_LOGGING_CONTEXT_NAME(ctx, line)(name, time, enabled) | 143 __BWE_TEST_LOGGING_CONTEXT_NAME(ctx, line)(name, time, enabled) |
| 144 | 144 |
| 145 #define BWE_TEST_LOGGING_CONTEXT(name) \ | 145 #define BWE_TEST_LOGGING_CONTEXT(name) \ |
| 146 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __LINE__, name, -1, true) | 146 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __LINE__, name, -1, true) |
| 147 #define BWE_TEST_LOGGING_ENABLE(enabled) \ | 147 #define BWE_TEST_LOGGING_ENABLE(enabled) \ |
| 148 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __LINE__, "", -1, \ | 148 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __LINE__, "", -1, \ |
| 149 static_cast<bool>(enabled)) | 149 static_cast<bool>(enabled)) |
| 150 #define BWE_TEST_LOGGING_TIME(time) \ | 150 #define BWE_TEST_LOGGING_TIME(time) \ |
| 151 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __LINE__, "", \ | 151 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __LINE__, "", \ |
| 152 static_cast<int64_t>(time), true) | 152 static_cast<int64_t>(time), true) |
| 153 | 153 |
| 154 #define BWE_TEST_LOGGING_LOG1(name, format, _1) \ | 154 #define BWE_TEST_LOGGING_LOG1(name, format, _1) \ |
| 155 do { \ | 155 do { \ |
| 156 BWE_TEST_LOGGING_CONTEXT(name); \ | 156 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 157 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1); \ | 157 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1); \ |
| 158 } while (0); | 158 } while (0) |
| 159 #define BWE_TEST_LOGGING_LOG2(name, format, _1, _2) \ | 159 #define BWE_TEST_LOGGING_LOG2(name, format, _1, _2) \ |
| 160 do { \ | 160 do { \ |
| 161 BWE_TEST_LOGGING_CONTEXT(name); \ | 161 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 162 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2); \ | 162 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2); \ |
| 163 } while (0); | 163 } while (0) |
| 164 #define BWE_TEST_LOGGING_LOG3(name, format, _1, _2, _3) \ | 164 #define BWE_TEST_LOGGING_LOG3(name, format, _1, _2, _3) \ |
| 165 do { \ | 165 do { \ |
| 166 BWE_TEST_LOGGING_CONTEXT(name); \ | 166 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 167 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2, _3); \ | 167 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2, _3); \ |
| 168 } while (0); | 168 } while (0) |
| 169 #define BWE_TEST_LOGGING_LOG4(name, format, _1, _2, _3, _4) \ | 169 #define BWE_TEST_LOGGING_LOG4(name, format, _1, _2, _3, _4) \ |
| 170 do { \ | 170 do { \ |
| 171 BWE_TEST_LOGGING_CONTEXT(name); \ | 171 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 172 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2, _3, \ | 172 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2, _3, \ |
| 173 _4); \ | 173 _4); \ |
| 174 } while (0); | 174 } while (0) |
| 175 #define BWE_TEST_LOGGING_LOG5(name, format, _1, _2, _3, _4, _5) \ | 175 #define BWE_TEST_LOGGING_LOG5(name, format, _1, _2, _3, _4, _5) \ |
| 176 do {\ | 176 do {\ |
| 177 BWE_TEST_LOGGING_CONTEXT(name); \ | 177 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 178 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2, _3, \ | 178 webrtc::testing::bwe::Logging::GetInstance()->Log(format, _1, _2, _3, \ |
| 179 _4, _5); \ | 179 _4, _5); \ |
| 180 } while (0); | 180 } while (0) |
| 181 | 181 |
| 182 #define BWE_TEST_LOGGING_PLOT(figure, name, time, value) \ | 182 #define BWE_TEST_LOGGING_PLOT(figure, name, time, value) \ |
| 183 do { \ | 183 do { \ |
| 184 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ | 184 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ |
| 185 static_cast<int64_t>(time), true); \ | 185 static_cast<int64_t>(time), true); \ |
| 186 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value); \ | 186 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value); \ |
| 187 } while (0); | 187 } while (0) |
| 188 | 188 |
| 189 #define BWE_TEST_LOGGING_PLOT_WITH_NAME(figure, name, time, value, alg_name) \ | 189 #define BWE_TEST_LOGGING_PLOT_WITH_NAME(figure, name, time, value, alg_name) \ |
| 190 do { \ | 190 do { \ |
| 191 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ | 191 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ |
| 192 static_cast<int64_t>(time), true); \ | 192 static_cast<int64_t>(time), true); \ |
| 193 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value, \ | 193 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value, \ |
| 194 alg_name); \ | 194 alg_name); \ |
| 195 } while (0); | 195 } while (0) |
| 196 | 196 |
| 197 #define BWE_TEST_LOGGING_BAR(figure, name, value, flow_id) \ | 197 #define BWE_TEST_LOGGING_BAR(figure, name, value, flow_id) \ |
| 198 do { \ | 198 do { \ |
| 199 BWE_TEST_LOGGING_CONTEXT(name); \ | 199 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 200 webrtc::testing::bwe::Logging::GetInstance()->PlotBar(figure, name, value, \ | 200 webrtc::testing::bwe::Logging::GetInstance()->PlotBar(figure, name, value, \ |
| 201 flow_id); \ | 201 flow_id); \ |
| 202 } while (0); | 202 } while (0) |
| 203 | 203 |
| 204 #define BWE_TEST_LOGGING_BASELINEBAR(figure, name, value, flow_id) \ | 204 #define BWE_TEST_LOGGING_BASELINEBAR(figure, name, value, flow_id) \ |
| 205 do { \ | 205 do { \ |
| 206 BWE_TEST_LOGGING_CONTEXT(name); \ | 206 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 207 webrtc::testing::bwe::Logging::GetInstance()->PlotBaselineBar( \ | 207 webrtc::testing::bwe::Logging::GetInstance()->PlotBaselineBar( \ |
| 208 figure, name, value, flow_id); \ | 208 figure, name, value, flow_id); \ |
| 209 } while (0); | 209 } while (0) |
| 210 | 210 |
| 211 #define BWE_TEST_LOGGING_ERRORBAR(figure, name, value, ylow, yhigh, title, \ | 211 #define BWE_TEST_LOGGING_ERRORBAR(figure, name, value, ylow, yhigh, title, \ |
| 212 flow_id) \ | 212 flow_id) \ |
| 213 do { \ | 213 do { \ |
| 214 BWE_TEST_LOGGING_CONTEXT(name); \ | 214 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 215 webrtc::testing::bwe::Logging::GetInstance()->PlotErrorBar( \ | 215 webrtc::testing::bwe::Logging::GetInstance()->PlotErrorBar( \ |
| 216 figure, name, value, ylow, yhigh, title, flow_id); \ | 216 figure, name, value, ylow, yhigh, title, flow_id); \ |
| 217 } while (0); | 217 } while (0) |
| 218 | 218 |
| 219 #define BWE_TEST_LOGGING_LIMITERRORBAR( \ | 219 #define BWE_TEST_LOGGING_LIMITERRORBAR( \ |
| 220 figure, name, value, ylow, yhigh, error_title, ymax, limit_title, flow_id) \ | 220 figure, name, value, ylow, yhigh, error_title, ymax, limit_title, flow_id) \ |
| 221 do { \ | 221 do { \ |
| 222 BWE_TEST_LOGGING_CONTEXT(name); \ | 222 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 223 webrtc::testing::bwe::Logging::GetInstance()->PlotLimitErrorBar( \ | 223 webrtc::testing::bwe::Logging::GetInstance()->PlotLimitErrorBar( \ |
| 224 figure, name, value, ylow, yhigh, error_title, ymax, limit_title, \ | 224 figure, name, value, ylow, yhigh, error_title, ymax, limit_title, \ |
| 225 flow_id); \ | 225 flow_id); \ |
| 226 } while (0); | 226 } while (0) |
| 227 | 227 |
| 228 #define BWE_TEST_LOGGING_LABEL(figure, title, y_label, num_flows) \ | 228 #define BWE_TEST_LOGGING_LABEL(figure, title, y_label, num_flows) \ |
| 229 do { \ | 229 do { \ |
| 230 BWE_TEST_LOGGING_CONTEXT(title); \ | 230 BWE_TEST_LOGGING_CONTEXT(title); \ |
| 231 webrtc::testing::bwe::Logging::GetInstance()->PlotLabel( \ | 231 webrtc::testing::bwe::Logging::GetInstance()->PlotLabel( \ |
| 232 figure, title, y_label, num_flows); \ | 232 figure, title, y_label, num_flows); \ |
| 233 } while (0); | 233 } while (0) |
| 234 | 234 |
| 235 namespace webrtc { | 235 namespace webrtc { |
| 236 | 236 |
| 237 class CriticalSectionWrapper; | 237 class CriticalSectionWrapper; |
| 238 | 238 |
| 239 namespace testing { | 239 namespace testing { |
| 240 namespace bwe { | 240 namespace bwe { |
| 241 | 241 |
| 242 class Logging { | 242 class Logging { |
| 243 public: | 243 public: |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 ThreadMap thread_map_; | 314 ThreadMap thread_map_; |
| 315 | 315 |
| 316 RTC_DISALLOW_COPY_AND_ASSIGN(Logging); | 316 RTC_DISALLOW_COPY_AND_ASSIGN(Logging); |
| 317 }; | 317 }; |
| 318 } // namespace bwe | 318 } // namespace bwe |
| 319 } // namespace testing | 319 } // namespace testing |
| 320 } // namespace webrtc | 320 } // namespace webrtc |
| 321 | 321 |
| 322 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE | 322 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE |
| 323 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_LOGGING_H_ | 323 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_LOGGING_H_ |
| OLD | NEW |