Commit 1da99a52 authored by rtenneti's avatar rtenneti Committed by Commit bot

Instrumenting QUIC code to find jank in GetConnectionDescriptionString

and GetWifiPHYLayerProtocol

BUG=422516
R=rch@chromium.org, vadimt@chromium.org

Review URL: https://codereview.chromium.org/940133002

Cr-Commit-Position: refs/heads/master@{#317163}
parent d1c719ac
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/profiler/scoped_tracker.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
...@@ -200,6 +201,10 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) { ...@@ -200,6 +201,10 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
} }
WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { WifiPHYLayerProtocol GetWifiPHYLayerProtocol() {
// TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is fixed.
tracked_objects::ScopedTracker tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422516 net_util_win::GetWifiPHYLayerProtocol1"));
const internal::WlanApi& wlanapi = internal::WlanApi::GetInstance(); const internal::WlanApi& wlanapi = internal::WlanApi::GetInstance();
if (!wlanapi.initialized) if (!wlanapi.initialized)
return WIFI_PHY_LAYER_PROTOCOL_NONE; return WIFI_PHY_LAYER_PROTOCOL_NONE;
...@@ -207,10 +212,18 @@ WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { ...@@ -207,10 +212,18 @@ WifiPHYLayerProtocol GetWifiPHYLayerProtocol() {
internal::WlanHandle client; internal::WlanHandle client;
DWORD cur_version = 0; DWORD cur_version = 0;
const DWORD kMaxClientVersion = 2; const DWORD kMaxClientVersion = 2;
// TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is fixed.
tracked_objects::ScopedTracker tracking_profile2(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422516 net_util_win::GetWifiPHYLayerProtocol2"));
DWORD result = wlanapi.OpenHandle(kMaxClientVersion, &cur_version, &client); DWORD result = wlanapi.OpenHandle(kMaxClientVersion, &cur_version, &client);
if (result != ERROR_SUCCESS) if (result != ERROR_SUCCESS)
return WIFI_PHY_LAYER_PROTOCOL_NONE; return WIFI_PHY_LAYER_PROTOCOL_NONE;
// TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is fixed.
tracked_objects::ScopedTracker tracking_profile3(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422516 net_util_win::GetWifiPHYLayerProtocol3"));
WLAN_INTERFACE_INFO_LIST* interface_list_ptr = NULL; WLAN_INTERFACE_INFO_LIST* interface_list_ptr = NULL;
result = wlanapi.enum_interfaces_func(client.Get(), NULL, result = wlanapi.enum_interfaces_func(client.Get(), NULL,
&interface_list_ptr); &interface_list_ptr);
...@@ -219,6 +232,10 @@ WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { ...@@ -219,6 +232,10 @@ WifiPHYLayerProtocol GetWifiPHYLayerProtocol() {
scoped_ptr<WLAN_INTERFACE_INFO_LIST, internal::WlanApiDeleter> interface_list( scoped_ptr<WLAN_INTERFACE_INFO_LIST, internal::WlanApiDeleter> interface_list(
interface_list_ptr); interface_list_ptr);
// TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is fixed.
tracked_objects::ScopedTracker tracking_profile4(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422516 net_util_win::GetWifiPHYLayerProtocol4"));
// Assume at most one connected wifi interface. // Assume at most one connected wifi interface.
WLAN_INTERFACE_INFO* info = NULL; WLAN_INTERFACE_INFO* info = NULL;
for (unsigned i = 0; i < interface_list->dwNumberOfItems; ++i) { for (unsigned i = 0; i < interface_list->dwNumberOfItems; ++i) {
...@@ -235,6 +252,10 @@ WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { ...@@ -235,6 +252,10 @@ WifiPHYLayerProtocol GetWifiPHYLayerProtocol() {
WLAN_CONNECTION_ATTRIBUTES* conn_info_ptr; WLAN_CONNECTION_ATTRIBUTES* conn_info_ptr;
DWORD conn_info_size = 0; DWORD conn_info_size = 0;
WLAN_OPCODE_VALUE_TYPE op_code; WLAN_OPCODE_VALUE_TYPE op_code;
// TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is fixed.
tracked_objects::ScopedTracker tracking_profile5(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422516 net_util_win::GetWifiPHYLayerProtocol5"));
result = wlanapi.query_interface_func( result = wlanapi.query_interface_func(
client.Get(), &info->InterfaceGuid, wlan_intf_opcode_current_connection, client.Get(), &info->InterfaceGuid, wlan_intf_opcode_current_connection,
NULL, &conn_info_size, reinterpret_cast<VOID**>(&conn_info_ptr), NULL, &conn_info_size, reinterpret_cast<VOID**>(&conn_info_ptr),
......
...@@ -284,6 +284,12 @@ const char* GetConnectionDescriptionString() { ...@@ -284,6 +284,12 @@ const char* GetConnectionDescriptionString() {
// This function only seems usefully defined on Windows currently. // This function only seems usefully defined on Windows currently.
if (type == NetworkChangeNotifier::CONNECTION_UNKNOWN || if (type == NetworkChangeNotifier::CONNECTION_UNKNOWN ||
type == NetworkChangeNotifier::CONNECTION_WIFI) { type == NetworkChangeNotifier::CONNECTION_WIFI) {
// TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is
// fixed.
tracked_objects::ScopedTracker tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422516 QuicConnectionLogger GetConnectionDescriptionString1"));
WifiPHYLayerProtocol wifi_type = GetWifiPHYLayerProtocol(); WifiPHYLayerProtocol wifi_type = GetWifiPHYLayerProtocol();
switch (wifi_type) { switch (wifi_type) {
case WIFI_PHY_LAYER_PROTOCOL_NONE: case WIFI_PHY_LAYER_PROTOCOL_NONE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment