Merge "Frameworks: Fix system server profiling" am: eed99d8629

am: e8d1374024

Change-Id: I228f91fb48566f541bfd8a84be71968b13992e2d
This commit is contained in:
Andreas Gampe
2018-03-15 17:19:06 +00:00
committed by android-build-merger
2 changed files with 9 additions and 1 deletions

View File

@@ -704,7 +704,7 @@ public final class ActivityThread extends ClientTransactionHandler {
streamingOutput);
profiling = true;
} catch (RuntimeException e) {
Slog.w(TAG, "Profiling failed on path " + profileFile);
Slog.w(TAG, "Profiling failed on path " + profileFile, e);
try {
profileFd.close();
profileFd = null;

View File

@@ -25378,6 +25378,14 @@ public class ActivityManagerService extends IActivityManager.Stub
} catch (IOException e) {
}
mProfilerInfo.profileFd = null;
if (proc.pid == MY_PID) {
// When profiling the system server itself, avoid closing the file
// descriptor, as profilerControl will not create a copy.
// Note: it is also not correct to just set profileFd to null, as the
// whole ProfilerInfo instance is passed down!
profilerInfo = null;
}
} else {
stopProfilerLocked(proc, profileType);
if (profilerInfo != null && profilerInfo.profileFd != null) {