Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc

Issue 2296253002: Enable BWE logging to command line when rtc_enable_bwe_test_logging is set to true (Closed)
Patch Set: adding macro declaration Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 printf("%s\t", state.tag.c_str()); 84 printf("%s\t", state.tag.c_str());
85 va_list args; 85 va_list args;
86 va_start(args, format); 86 va_start(args, format);
87 vprintf(format, args); 87 vprintf(format, args);
88 va_end(args); 88 va_end(args);
89 printf("\n"); 89 printf("\n");
90 } 90 }
91 } 91 }
92 92
93 void Logging::Plot(int figure, double value) { 93 void Logging::Plot(int figure, double value) {
94 Plot(figure, value, "-"); 94 Plot(figure, value, 0, "-");
95 }
96
97 void Logging::Plot(int figure, double value, uint32_t ssrc) {
98 Plot(figure, value, ssrc, "-");
95 } 99 }
96 100
97 void Logging::Plot(int figure, double value, const std::string& alg_name) { 101 void Logging::Plot(int figure, double value, const std::string& alg_name) {
102 Plot(figure, value, 0, alg_name);
103 }
104
105 void Logging::Plot(int figure,
106 double value,
107 uint32_t ssrc,
108 const std::string& alg_name) {
98 CriticalSectionScoped cs(crit_sect_.get()); 109 CriticalSectionScoped cs(crit_sect_.get());
99 ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); 110 ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
100 assert(it != thread_map_.end()); 111 assert(it != thread_map_.end());
101 const State& state = it->second.stack.top(); 112 const State& state = it->second.stack.top();
102 std::string label = state.tag + '@' + alg_name; 113 std::stringstream ss;
114 ss << ssrc;
115 std::string label = state.tag + ':' + ss.str() + '@' + alg_name;
103 std::string prefix("Available"); 116 std::string prefix("Available");
104 if (alg_name.compare(0, prefix.length(), prefix) == 0) { 117 if (alg_name.compare(0, prefix.length(), prefix) == 0) {
105 std::string receiver("Receiver"); 118 std::string receiver("Receiver");
106 size_t start_pos = label.find(receiver); 119 size_t start_pos = label.find(receiver);
107 if (start_pos != std::string::npos) { 120 if (start_pos != std::string::npos) {
108 label.replace(start_pos, receiver.length(), "Sender"); 121 label.replace(start_pos, receiver.length(), "Sender");
109 } 122 }
110 } 123 }
111 if (state.enabled) { 124 if (state.enabled) {
112 printf("PLOT\t%d\t%s\t%f\t%f\n", figure, label.c_str(), 125 printf("PLOT\t%d\t%s\t%f\t%f\n", figure, label.c_str(),
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // Update time so that next log/plot will use the latest time seen so far 254 // Update time so that next log/plot will use the latest time seen so far
242 // in this call tree. 255 // in this call tree.
243 state->timestamp_ms = std::max(state->timestamp_ms, newest_timestamp_ms); 256 state->timestamp_ms = std::max(state->timestamp_ms, newest_timestamp_ms);
244 } 257 }
245 } 258 }
246 } // namespace bwe 259 } // namespace bwe
247 } // namespace testing 260 } // namespace testing
248 } // namespace webrtc 261 } // namespace webrtc
249 262
250 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE 263 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h ('k') | webrtc/modules/rtp_rtcp/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698