diff options
author | vadimt <vadimt@chromium.org> | 2014-10-27 16:23:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-27 23:24:11 +0000 |
commit | 8ada724c275215eb98e911624edb5abca763fd36 (patch) | |
tree | d17fe685ef08fec1c2b816367c812164e2b0930d | |
parent | abd860e4df97be2bbbd305cb6aa64718f7c8fdc9 (diff) | |
download | chromium_src-8ada724c275215eb98e911624edb5abca763fd36.zip chromium_src-8ada724c275215eb98e911624edb5abca763fd36.tar.gz chromium_src-8ada724c275215eb98e911624edb5abca763fd36.tar.bz2 |
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. They've helped to find and fix janky code. 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 instruments code invoked from URLRequestFileJob::DidOpen, which is responsible for 15.3 jph.
BUG=423948
TBR=mmenke@chromium.org
Review URL: https://codereview.chromium.org/675303004
Cr-Commit-Position: refs/heads/master@{#301480}
-rw-r--r-- | net/url_request/url_request_file_job.cc | 5 | ||||
-rw-r--r-- | net/url_request/url_request_job.cc | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc index 6fc4d1c..eb24a95 100644 --- a/net/url_request/url_request_file_job.cc +++ b/net/url_request/url_request_file_job.cc @@ -270,6 +270,11 @@ void URLRequestFileJob::DidOpen(int result) { DCHECK_GE(remaining_bytes_, 0); if (remaining_bytes_ > 0 && byte_range_.first_byte_position() != 0) { + // TODO(vadimt): Remove ScopedProfile below once crbug.com/423948 is fixed. + tracked_objects::ScopedProfile tracking_profile1( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "423948 URLRequestFileJob::DidOpen 1")); + int rv = stream_->Seek(base::File::FROM_BEGIN, byte_range_.first_byte_position(), base::Bind(&URLRequestFileJob::DidSeek, diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc index 0fe4c7c..09e462b 100644 --- a/net/url_request/url_request_job.cc +++ b/net/url_request/url_request_job.cc @@ -8,6 +8,7 @@ #include "base/compiler_specific.h" #include "base/message_loop/message_loop.h" #include "base/power_monitor/power_monitor.h" +#include "base/profiler/scoped_profile.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "net/base/auth.h" @@ -299,6 +300,11 @@ void URLRequestJob::NotifyBeforeNetworkStart(bool* defer) { } void URLRequestJob::NotifyHeadersComplete() { + // TODO(vadimt): Remove ScopedProfile below once crbug.com/423948 is fixed. + tracked_objects::ScopedProfile tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "423948 URLRequestJob::NotifyHeadersComplete")); + if (!request_ || !request_->has_delegate()) return; // The request was destroyed, so there is no more work to do. |