Commit eeee2a4c authored by vadimt's avatar vadimt Committed by Commit bot

Adding instrumentation to locate the source of jankiness.

Previous instrumentations showed that SSLClientSocketNSS::Core::DoHandshake alone is responsible for 14.4 janks per hour in IO thread. I need to instrument the code inside it to find out which part causes jank.

This is a 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.

BUG=424386

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

Cr-Commit-Position: refs/heads/master@{#302665}
parent 5842d631
...@@ -1631,6 +1631,11 @@ void SSLClientSocketNSS::Core::HandshakeCallback( ...@@ -1631,6 +1631,11 @@ void SSLClientSocketNSS::Core::HandshakeCallback(
} }
void SSLClientSocketNSS::Core::HandshakeSucceeded() { void SSLClientSocketNSS::Core::HandshakeSucceeded() {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::HandshakeSucceeded"));
DCHECK(OnNSSTaskRunner()); DCHECK(OnNSSTaskRunner());
PRBool last_handshake_resumed; PRBool last_handshake_resumed;
...@@ -1657,6 +1662,11 @@ void SSLClientSocketNSS::Core::HandshakeSucceeded() { ...@@ -1657,6 +1662,11 @@ void SSLClientSocketNSS::Core::HandshakeSucceeded() {
} }
int SSLClientSocketNSS::Core::HandleNSSError(PRErrorCode nss_error) { int SSLClientSocketNSS::Core::HandleNSSError(PRErrorCode nss_error) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::HandleNSSError"));
DCHECK(OnNSSTaskRunner()); DCHECK(OnNSSTaskRunner());
int net_error = MapNSSClientError(nss_error); int net_error = MapNSSClientError(nss_error);
...@@ -1804,6 +1814,11 @@ int SSLClientSocketNSS::Core::DoHandshake() { ...@@ -1804,6 +1814,11 @@ int SSLClientSocketNSS::Core::DoHandshake() {
int net_error = OK; int net_error = OK;
SECStatus rv = SSL_ForceHandshake(nss_fd_); SECStatus rv = SSL_ForceHandshake(nss_fd_);
// TODO(vadimt): Remove ScopedProfile below once crbug.com/424386 is fixed.
tracked_objects::ScopedProfile tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"424386 SSLClientSocketNSS::Core::DoHandshake 1"));
// Note: this function may be called multiple times during the handshake, so // Note: this function may be called multiple times during the handshake, so
// even though channel id and client auth are separate else cases, they can // even though channel id and client auth are separate else cases, they can
// both be used during a single SSL handshake. // both be used during a single SSL handshake.
......
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