Commit 8bc85699 authored by ppi@chromium.org's avatar ppi@chromium.org

Add more tracing for launching Android Services.

This CLs adds trace events for ChildProcessLauncher::start() and
ChildServiceConnection::bind(), improving visibility of the service
startup events in traces.

BUG=363121
R=yfriedman@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266660 0039d316-1c4b-4281-b951-d872f2087c98
parent fb664a71
......@@ -114,6 +114,7 @@ public class ChildProcessConnectionImpl implements ChildProcessConnection {
boolean bind(String[] commandLine) {
if (!mBound) {
TraceEvent.begin();
final Intent intent = createServiceBindIntent();
if (commandLine != null) {
intent.putExtra(EXTRA_COMMAND_LINE, commandLine);
......@@ -121,6 +122,7 @@ public class ChildProcessConnectionImpl implements ChildProcessConnection {
if (mLinkerParams != null)
mLinkerParams.addIntentExtras(intent);
mBound = mContext.bindService(intent, this, mBindFlags);
TraceEvent.end();
}
return mBound;
}
......
......@@ -15,6 +15,7 @@ import com.google.common.annotations.VisibleForTesting;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
import org.chromium.base.TraceEvent;
import org.chromium.base.library_loader.Linker;
import org.chromium.content.app.ChildProcessService;
import org.chromium.content.app.ChromiumLinkerParams;
......@@ -338,6 +339,7 @@ public class ChildProcessLauncher {
int[] fileFds,
boolean[] fileAutoClose,
long clientContext) {
TraceEvent.begin();
assert fileIds.length == fileFds.length && fileFds.length == fileAutoClose.length;
FileDescriptorInfo[] filesToBeMapped = new FileDescriptorInfo[fileFds.length];
for (int i = 0; i < fileFds.length; i++) {
......@@ -369,6 +371,8 @@ public class ChildProcessLauncher {
if (allocatedConnection == null) {
// Notify the native code so it can free the heap allocated callback.
nativeOnChildProcessStarted(clientContext, 0);
Log.e(TAG, "Allocation of new service failed.");
TraceEvent.end();
return;
}
}
......@@ -377,6 +381,7 @@ public class ChildProcessLauncher {
allocatedConnection.getServiceNumber());
triggerConnectionSetup(allocatedConnection, commandLine, childProcessId, filesToBeMapped,
callbackType, clientContext);
TraceEvent.end();
}
@VisibleForTesting
......
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