maxmorin e9ef907991 Revert of Add logging of host lookups made by TurnPort to the RtcEventLog. (patchset #11 id:200001 of https://codereview.webrtc.org/2996933003/ )
Reason for revert:
Breaks Chromium build due to the changed constructor in webrtc/p2p/client/basicportallocator.h.

Build (example): https://build.chromium.org/p/chromium.webrtc.fyi/builders/Linux%20Builder/builds/19739.

Log:
FAILED: obj/remoting/protocol/protocol/port_allocator.o
/b/c/goma_client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/remoting/protocol/protocol/port_allocator.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"310694-2\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_GLIBCXX_DEBUG=1 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -DEXPAT_RELATIVE_PATH -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DPROTOBUF_USE_DLLS -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DFEATURE_ENABLE_VOICEMAIL -DGTEST_RELATIVE_PATH -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DBORINGSSL_SHARED_LIBRARY -I../.. -Igen -I../../build/linux/debian_jessie_amd64-sysroot/usr/include/glib-2.0 -I../../build/linux/debian_jessie_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../third_party/libwebp/src -I../../third_party/khronos -I../../gpu -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/webrtc_overrides -I../../testing/gtest/include -I../../third_party -I../../third_party/webrtc_overrides -I../../third_party -I../../third_party/boringssl/src/include -I../../build/linux/debian_jessie_amd64-sysroot/usr/include/nss -I../../build/linux/debian_jessie_amd64-sysroot/usr/include/nspr -I../../third_party/libyuv/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fdebug-prefix-map=/b/c/b/Linux_Builder__dbg_/src=. -m64 -march=x86-64 -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -O0 -fno-omit-frame-pointer -g2 -gsplit-dwarf -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-auto-raw-pointer -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wno-header-guard -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++14 -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_jessie_amd64-sysroot -fno-exceptions -fvisibility-inlines-hidden -c ../../remoting/protocol/port_allocator.cc -o obj/remoting/protocol/protocol/port_allocator.o
../../remoting/protocol/port_allocator.cc:48:7: error: no matching constructor for initialization of 'cricket::BasicPortAllocator'
    : BasicPortAllocator(network_manager.get(), socket_factory.get()),
      ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/webrtc/p2p/client/basicportallocator.h:35:12: note: candidate constructor not viable: requires single argument 'network_manager', but 2 arguments were provided
  explicit BasicPortAllocator(rtc::NetworkManager* network_manager);
           ^
../../third_party/webrtc/p2p/client/basicportallocator.h:30:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class BasicPortAllocator : public PortAllocator {
      ^
../../third_party/webrtc/p2p/client/basicportallocator.h:32:3: note: candidate constructor not viable: requires 3 arguments, but 2 were provided
  BasicPortAllocator(rtc::NetworkManager* network_manager,
  ^
../../third_party/webrtc/p2p/client/basicportallocator.h:36:3: note: candidate constructor not viable: requires 3 arguments, but 2 were provided
  BasicPortAllocator(rtc::NetworkManager* network_manager,
  ^
../../third_party/webrtc/p2p/client/basicportallocator.h:39:3: note: candidate constructor not viable: requires 5 arguments, but 2 were provided
  BasicPortAllocator(rtc::NetworkManager* network_manager,
  ^
1 error generated.

Original issue's description:
> Add logging host lookups made by TurnPort to the RtcEventLog.
>
> The following fields are logged:
> - error, if there was an error.
> - elapsed time in milliseconds
>
> BUG=webrtc:8100
>
> Review-Url: https://codereview.webrtc.org/2996933003
> Cr-Commit-Position: refs/heads/master@{#19574}
> Committed: c251cb13c0

TBR=terelius@webrtc.org,pthatcher@webrtc.org,jonaso@google.com,pthatcher@google.com,solenberg@webrtc.org,deadbeef@webrtc.org,jonaso@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:8100

Review-Url: https://codereview.webrtc.org/3012473002
Cr-Commit-Position: refs/heads/master@{#19578}
2017-08-29 11:49:00 +00:00

232 lines
8.6 KiB
C++

/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
#define WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
#include <memory>
#include <string>
#include <vector>
#include "webrtc/config.h"
#include "webrtc/rtc_base/platform_file.h"
namespace webrtc {
// Forward declaration of storage class that is automatically generated from
// the protobuf file.
namespace rtclog {
class EventStream;
struct StreamConfig {
uint32_t local_ssrc = 0;
uint32_t remote_ssrc = 0;
uint32_t rtx_ssrc = 0;
std::string rsid;
bool remb = false;
std::vector<RtpExtension> rtp_extensions;
RtcpMode rtcp_mode = RtcpMode::kReducedSize;
struct Codec {
Codec(const std::string& payload_name,
int payload_type,
int rtx_payload_type)
: payload_name(payload_name),
payload_type(payload_type),
rtx_payload_type(rtx_payload_type) {}
std::string payload_name;
int payload_type;
int rtx_payload_type;
};
std::vector<Codec> codecs;
};
} // namespace rtclog
class Clock;
class RtcEventLogImpl;
struct AudioEncoderRuntimeConfig;
enum class MediaType;
enum class BandwidthUsage;
enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
enum ProbeFailureReason {
kInvalidSendReceiveInterval,
kInvalidSendReceiveRatio,
kTimeout
};
class RtcEventLog {
public:
virtual ~RtcEventLog() {}
// Factory method to create an RtcEventLog object.
static std::unique_ptr<RtcEventLog> Create();
// TODO(nisse): webrtc::Clock is deprecated. Delete this method and
// above forward declaration of Clock when
// webrtc/system_wrappers/include/clock.h is deleted.
static std::unique_ptr<RtcEventLog> Create(const Clock* clock) {
return Create();
}
// Create an RtcEventLog object that does nothing.
static std::unique_ptr<RtcEventLog> CreateNull();
// Starts logging a maximum of max_size_bytes bytes to the specified file.
// If the file already exists it will be overwritten.
// If max_size_bytes <= 0, logging will be active until StopLogging is called.
// The function has no effect and returns false if we can't start a new log
// e.g. because we are already logging or the file cannot be opened.
virtual bool StartLogging(const std::string& file_name,
int64_t max_size_bytes) = 0;
// Same as above. The RtcEventLog takes ownership of the file if the call
// is successful, i.e. if it returns true.
virtual bool StartLogging(rtc::PlatformFile platform_file,
int64_t max_size_bytes) = 0;
// Deprecated. Pass an explicit file size limit.
bool StartLogging(const std::string& file_name) {
return StartLogging(file_name, 10000000);
}
// Deprecated. Pass an explicit file size limit.
bool StartLogging(rtc::PlatformFile platform_file) {
return StartLogging(platform_file, 10000000);
}
// Stops logging to file and waits until the thread has finished.
virtual void StopLogging() = 0;
// Logs configuration information for a video receive stream.
virtual void LogVideoReceiveStreamConfig(
const rtclog::StreamConfig& config) = 0;
// Logs configuration information for a video send stream.
virtual void LogVideoSendStreamConfig(const rtclog::StreamConfig& config) = 0;
// Logs configuration information for an audio receive stream.
virtual void LogAudioReceiveStreamConfig(
const rtclog::StreamConfig& config) = 0;
// Logs configuration information for an audio send stream.
virtual void LogAudioSendStreamConfig(const rtclog::StreamConfig& config) = 0;
// Logs the header of an incoming or outgoing RTP packet. packet_length
// is the total length of the packet, including both header and payload.
virtual void LogRtpHeader(PacketDirection direction,
const uint8_t* header,
size_t packet_length) = 0;
// Same as above but used on the sender side to log packets that are part of
// a probe cluster.
virtual void LogRtpHeader(PacketDirection direction,
const uint8_t* header,
size_t packet_length,
int probe_cluster_id) = 0;
// Logs an incoming or outgoing RTCP packet.
virtual void LogRtcpPacket(PacketDirection direction,
const uint8_t* packet,
size_t length) = 0;
// Logs an audio playout event.
virtual void LogAudioPlayout(uint32_t ssrc) = 0;
// Logs a bitrate update from the bandwidth estimator based on packet loss.
virtual void LogLossBasedBweUpdate(int32_t bitrate_bps,
uint8_t fraction_loss,
int32_t total_packets) = 0;
// Logs a bitrate update from the bandwidth estimator based on delay changes.
virtual void LogDelayBasedBweUpdate(int32_t bitrate_bps,
BandwidthUsage detector_state) = 0;
// Logs audio encoder re-configuration driven by audio network adaptor.
virtual void LogAudioNetworkAdaptation(
const AudioEncoderRuntimeConfig& config) = 0;
// Logs when a probe cluster is created.
virtual void LogProbeClusterCreated(int id,
int bitrate_bps,
int min_probes,
int min_bytes) = 0;
// Logs the result of a successful probing attempt.
virtual void LogProbeResultSuccess(int id, int bitrate_bps) = 0;
// Logs the result of an unsuccessful probing attempt.
virtual void LogProbeResultFailure(int id,
ProbeFailureReason failure_reason) = 0;
// Reads an RtcEventLog file and returns true when reading was successful.
// The result is stored in the given EventStream object.
// The order of the events in the EventStream is implementation defined.
// The current implementation writes a LOG_START event, then the old
// configurations, then the remaining events in timestamp order and finally
// a LOG_END event. However, this might change without further notice.
// TODO(terelius): Change result type to a vector?
static bool ParseRtcEventLog(const std::string& file_name,
rtclog::EventStream* result);
};
// No-op implementation is used if flag is not set, or in tests.
class RtcEventLogNullImpl : public RtcEventLog {
public:
bool StartLogging(const std::string& file_name,
int64_t max_size_bytes) override {
return false;
}
bool StartLogging(rtc::PlatformFile platform_file,
int64_t max_size_bytes) override {
return false;
}
void StopLogging() override {}
void LogVideoReceiveStreamConfig(
const rtclog::StreamConfig& config) override {}
void LogVideoSendStreamConfig(const rtclog::StreamConfig& config) override {}
void LogAudioReceiveStreamConfig(
const rtclog::StreamConfig& config) override {}
void LogAudioSendStreamConfig(const rtclog::StreamConfig& config) override {}
void LogRtpHeader(PacketDirection direction,
const uint8_t* header,
size_t packet_length) override {}
void LogRtpHeader(PacketDirection direction,
const uint8_t* header,
size_t packet_length,
int probe_cluster_id) override {}
void LogRtcpPacket(PacketDirection direction,
const uint8_t* packet,
size_t length) override {}
void LogAudioPlayout(uint32_t ssrc) override {}
void LogLossBasedBweUpdate(int32_t bitrate_bps,
uint8_t fraction_loss,
int32_t total_packets) override {}
void LogDelayBasedBweUpdate(int32_t bitrate_bps,
BandwidthUsage detector_state) override {}
void LogAudioNetworkAdaptation(
const AudioEncoderRuntimeConfig& config) override {}
void LogProbeClusterCreated(int id,
int bitrate_bps,
int min_probes,
int min_bytes) override{};
void LogProbeResultSuccess(int id, int bitrate_bps) override{};
void LogProbeResultFailure(int id,
ProbeFailureReason failure_reason) override{};
};
} // namespace webrtc
#endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_