Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2d0f2f3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Frameworks: Fix system server profiling" into pi-dev

parents 5e61df7a 4f68924d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+8 −0
Original line number Diff line number Diff line
@@ -25377,6 +25377,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) {