Skip to content

Commit

Permalink
Adding instrumentation to locate the source of jankiness.
Browse files Browse the repository at this point in the history
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=424386
TBR=rvargas@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#300163}
  • Loading branch information
vadimt authored and Commit bot committed Oct 17, 2014
1 parent cd44405 commit a57132a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion net/socket/ssl_client_socket_nss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,11 @@ int SSLClientSocketNSS::Core::HandleNSSError(PRErrorCode nss_error) {
}

int SSLClientSocketNSS::Core::DoHandshakeLoop(int last_io_result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::DoHandshakeLoop"));

DCHECK(OnNSSTaskRunner());

int rv = last_io_result;
Expand Down Expand Up @@ -1725,6 +1730,11 @@ int SSLClientSocketNSS::Core::DoHandshakeLoop(int last_io_result) {
}

int SSLClientSocketNSS::Core::DoReadLoop(int result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::DoReadLoop"));

DCHECK(OnNSSTaskRunner());
DCHECK(false_started_ || handshake_callback_called_);
DCHECK_EQ(STATE_NONE, next_handshake_state_);
Expand Down Expand Up @@ -2195,6 +2205,11 @@ void SSLClientSocketNSS::Core::OnSendComplete(int result) {
// callback. For Read() and Write(), that's what we want. But for Connect(),
// the caller expects OK (i.e. 0) for success.
void SSLClientSocketNSS::Core::DoConnectCallback(int rv) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::DoConnectCallback"));

DCHECK(OnNSSTaskRunner());
DCHECK_NE(rv, ERR_IO_PENDING);
DCHECK(!user_connect_callback_.is_null());
Expand All @@ -2206,6 +2221,11 @@ void SSLClientSocketNSS::Core::DoConnectCallback(int rv) {
}

void SSLClientSocketNSS::Core::DoReadCallback(int rv) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::DoReadCallback"));

DCHECK(OnNSSTaskRunner());
DCHECK_NE(ERR_IO_PENDING, rv);
DCHECK(!user_read_callback_.is_null());
Expand All @@ -2222,7 +2242,7 @@ void SSLClientSocketNSS::Core::DoReadCallback(int rv) {
FROM_HERE,
base::Bind(&Core::DidNSSRead, this, rv));
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
tracked_objects::ScopedProfile tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"SSLClientSocketNSS::Core::DoReadCallback"));
PostOrRunCallback(
Expand Down

0 comments on commit a57132a

Please sign in to comment.