summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2014-10-10 16:23:20 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-10 23:23:39 +0000
commit7bc3878bfbd1b2ea5bfd3fb4dff281b0cc7ab5e4 (patch)
tree408cc2be3806350f4839d5e28ce12861d590d3eb /net/disk_cache
parenta19d5560d9659cd4194076b15d111f2bc840f323 (diff)
downloadchromium_src-7bc3878bfbd1b2ea5bfd3fb4dff281b0cc7ab5e4.zip
chromium_src-7bc3878bfbd1b2ea5bfd3fb4dff281b0cc7ab5e4.tar.gz
chromium_src-7bc3878bfbd1b2ea5bfd3fb4dff281b0cc7ab5e4.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. 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. BUG=422516 TBR=mmenke@chromium.org Review URL: https://codereview.chromium.org/650483003 Cr-Commit-Position: refs/heads/master@{#299210}
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/blockfile/in_flight_backend_io.cc17
-rw-r--r--net/disk_cache/blockfile/in_flight_io.cc5
2 files changed, 20 insertions, 2 deletions
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.cc b/net/disk_cache/blockfile/in_flight_backend_io.cc
index 28d7114..9bb011e 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/blockfile/backend_impl.h"
@@ -64,8 +65,14 @@ void BackendIO::OnDone(bool cancel) {
if (result() == net::OK) {
static_cast<EntryImpl*>(*entry_ptr_)->OnEntryCreated(backend_);
- if (cancel)
+ if (cancel) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is
+ // fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 BackendIO::OnDone"));
+
(*entry_ptr_)->Close();
+ }
}
}
@@ -496,8 +503,14 @@ void InFlightBackendIO::OnOperationComplete(BackgroundIO* operation,
BackendIO* op = static_cast<BackendIO*>(operation);
op->OnDone(cancel);
- if (!op->callback().is_null() && (!cancel || op->IsEntryOperation()))
+ if (!op->callback().is_null() && (!cancel || op->IsEntryOperation())) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422516 InFlightBackendIO::OnOperationComplete"));
+
op->callback().Run(op->result());
+ }
}
void InFlightBackendIO::PostOperation(BackendIO* operation) {
diff --git a/net/disk_cache/blockfile/in_flight_io.cc b/net/disk_cache/blockfile/in_flight_io.cc
index 9ada7c5..176cf87 100644
--- a/net/disk_cache/blockfile/in_flight_io.cc
+++ b/net/disk_cache/blockfile/in_flight_io.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -87,6 +88,10 @@ void InFlightIO::OnIOComplete(BackgroundIO* operation) {
// Runs on the primary thread.
void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
{
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 InFlightIO::InvokeCallback"));
+
// http://crbug.com/74623
base::ThreadRestrictions::ScopedAllowWait allow_wait;
operation->io_completed()->Wait();