Commit 775c3028 authored by vadimt's avatar vadimt Committed by Commit bot

Adding instrumentation to locate the source of jankiness.

Mechanical change that adds instrumentation required to locate the source of jankiness (i.e. a long-running fragment of code executed as a part of the task that causes jank) in the code. See the bug for details on what kind of jank we are after.
A number of similar CLs were landed, and none of them caused issues. The code of the instrumentation is highly optimized and is not expected to affect performance. The code simply creates a diagnostic task which is identical to ones created by PostTask or IPC message handlers.
Landing as TBR since this is a mechanical, safe and temporary change.

This CL specifically instruments some presumably most popular callbacks invoked by “callback.Run(result);” line in TCPClientSocket::DidCompleteReadWrite.

BUG=418183
TBR=asanka@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#299389}
parent d62145de
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/profiler/scoped_profile.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/values.h" #include "base/values.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
...@@ -357,6 +358,11 @@ int HttpStreamParser::ReadResponseBody(IOBuffer* buf, int buf_len, ...@@ -357,6 +358,11 @@ int HttpStreamParser::ReadResponseBody(IOBuffer* buf, int buf_len,
} }
void HttpStreamParser::OnIOComplete(int result) { void HttpStreamParser::OnIOComplete(int result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"418183 DidCompleteReadWrite => HttpStreamParser::OnIOComplete"));
result = DoLoop(result); result = DoLoop(result);
// The client callback can do anything, including destroying this class, // The client callback can do anything, including destroying this class,
......
...@@ -2652,6 +2652,11 @@ void SSLClientSocketNSS::Core::DidNSSWrite(int result) { ...@@ -2652,6 +2652,11 @@ void SSLClientSocketNSS::Core::DidNSSWrite(int result) {
} }
void SSLClientSocketNSS::Core::BufferSendComplete(int result) { void SSLClientSocketNSS::Core::BufferSendComplete(int result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"418183 DidCompleteReadWrite => Core::BufferSendComplete"));
if (!OnNSSTaskRunner()) { if (!OnNSSTaskRunner()) {
if (detached_) if (detached_)
return; return;
...@@ -2695,6 +2700,11 @@ void SSLClientSocketNSS::Core::OnGetChannelIDComplete(int result) { ...@@ -2695,6 +2700,11 @@ void SSLClientSocketNSS::Core::OnGetChannelIDComplete(int result) {
void SSLClientSocketNSS::Core::BufferRecvComplete( void SSLClientSocketNSS::Core::BufferRecvComplete(
IOBuffer* read_buffer, IOBuffer* read_buffer,
int result) { int result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"418183 DidCompleteReadWrite => SSLClientSocketNSS::Core::..."));
DCHECK(read_buffer); DCHECK(read_buffer);
if (!OnNSSTaskRunner()) { if (!OnNSSTaskRunner()) {
......
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