summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorgauravsh@chromium.org <gauravsh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-17 21:07:46 +0000
committergauravsh@chromium.org <gauravsh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-17 21:07:46 +0000
commite59b75f280bb5ff32936b84c234ecdeb3b37a3b5 (patch)
treeabd94dc1ee640680d008683851bf9d24e5fba6b2 /chromeos
parent010cc1aa71f477b349204fbf8e5dc2d9995b8136 (diff)
downloadchromium_src-e59b75f280bb5ff32936b84c234ecdeb3b37a3b5.zip
chromium_src-e59b75f280bb5ff32936b84c234ecdeb3b37a3b5.tar.gz
chromium_src-e59b75f280bb5ff32936b84c234ecdeb3b37a3b5.tar.bz2
NetworkChangeNotifierChromeos: Add event logging
Add network event logging for important events to the network change notifier. This will help in investigation of (usually hard to repro) bugs in the change notifier. BUG=249313 Review URL: https://chromiumcodereview.appspot.com/17116002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/network/network_change_notifier_chromeos.cc45
1 files changed, 32 insertions, 13 deletions
diff --git a/chromeos/network/network_change_notifier_chromeos.cc b/chromeos/network/network_change_notifier_chromeos.cc
index 1096929..2c4b376 100644
--- a/chromeos/network/network_change_notifier_chromeos.cc
+++ b/chromeos/network/network_change_notifier_chromeos.cc
@@ -7,8 +7,10 @@
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/network/network_change_notifier_chromeos.h"
+#include "chromeos/network/network_event_log.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "net/base/network_change_notifier.h"
@@ -118,7 +120,7 @@ void NetworkChangeNotifierChromeos::UpdateState(
// observers, otherwise we have nothing to do. (Under normal circumstances,
// we should never get duplicate no default network notifications).
if (connection_type_ != CONNECTION_NONE) {
- VLOG(1) << "Lost default network!";
+ NET_LOG_EVENT("NCNDefaultNetworkLost", service_path_);
*ip_address_changed = true;
*dns_changed = true;
*connection_type_changed = true;
@@ -135,13 +137,20 @@ void NetworkChangeNotifierChromeos::UpdateState(
ConnectionTypeFromShill(default_network->type(),
default_network->technology());
if (new_connection_type != connection_type_) {
- VLOG(1) << "Connection type changed from " << connection_type_ << " -> "
- << new_connection_type;
+ NET_LOG_EVENT(
+ "NCNDefaultConnectionTypeChanged",
+ base::StringPrintf("%s -> %s",
+ ConnectionTypeToString(connection_type_),
+ ConnectionTypeToString(new_connection_type)));
*connection_type_changed = true;
}
if (default_network->path() != service_path_) {
- VLOG(1) << "Service path changed from " << service_path_ << " -> "
- << default_network->path();
+ NET_LOG_EVENT(
+ "NCNDefaultNetworkServicePathChanged",
+ base::StringPrintf("%s -> %s",
+ service_path_.c_str(),
+ default_network->path().c_str()));
+
// If we had a default network service change, network resources
// must always be invalidated.
*ip_address_changed = true;
@@ -151,19 +160,29 @@ void NetworkChangeNotifierChromeos::UpdateState(
// Is this a state update with an online->online transition?
bool stayed_online = (!*connection_type_changed &&
connection_type_ != CONNECTION_NONE);
+
+ bool is_suppressed = true;
// Suppress IP address change signalling on online->online transitions
// when getting an IP address update for the first time.
- if (!(stayed_online && ip_address_.empty()))
+ if (!(stayed_online && ip_address_.empty())) {
+ is_suppressed = false;
*ip_address_changed = true;
- VLOG(1) << "IP Address changed from " << ip_address_ << " -> "
- << default_network->ip_address();
+ }
+ NET_LOG_EVENT(
+ base::StringPrintf("%s%s",
+ "NCNDefaultIPAddressChanged",
+ is_suppressed ? " (Suppressed)" : "" ),
+ base::StringPrintf("%s -> %s",
+ ip_address_.c_str(),
+ default_network->ip_address().c_str()));
}
if (default_network->dns_servers() != dns_servers_) {
- VLOG(1) << "DNS servers changed.\n"
- << "Old DNS servers were: "
- << JoinString(dns_servers_, ",") << "\n"
- << "New DNS servers are: "
- << JoinString(default_network->dns_servers(), ",");
+ NET_LOG_EVENT(
+ "NCNDefaultDNSServerChanged",
+ base::StringPrintf(
+ "%s -> %s",
+ JoinString(dns_servers_, ",").c_str(),
+ JoinString(default_network->dns_servers(), ",").c_str()));
*dns_changed = true;
}