Merge "Clean up some dump code." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f3efab1326
@@ -741,17 +741,26 @@ class JobConcurrencyManager {
|
|||||||
|
|
||||||
pw.increaseIndent();
|
pw.increaseIndent();
|
||||||
try {
|
try {
|
||||||
pw.print("Configuration:");
|
pw.println("Configuration:");
|
||||||
pw.increaseIndent();
|
pw.increaseIndent();
|
||||||
pw.print(KEY_SCREEN_OFF_ADJUSTMENT_DELAY_MS, mScreenOffAdjustmentDelayMs).println();
|
pw.print(KEY_SCREEN_OFF_ADJUSTMENT_DELAY_MS, mScreenOffAdjustmentDelayMs).println();
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_ON.normal.dump(pw);
|
CONFIG_LIMITS_SCREEN_ON.normal.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_ON.moderate.dump(pw);
|
CONFIG_LIMITS_SCREEN_ON.moderate.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_ON.low.dump(pw);
|
CONFIG_LIMITS_SCREEN_ON.low.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_ON.critical.dump(pw);
|
CONFIG_LIMITS_SCREEN_ON.critical.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_OFF.normal.dump(pw);
|
CONFIG_LIMITS_SCREEN_OFF.normal.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_OFF.moderate.dump(pw);
|
CONFIG_LIMITS_SCREEN_OFF.moderate.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_OFF.low.dump(pw);
|
CONFIG_LIMITS_SCREEN_OFF.low.dump(pw);
|
||||||
|
pw.println();
|
||||||
CONFIG_LIMITS_SCREEN_OFF.critical.dump(pw);
|
CONFIG_LIMITS_SCREEN_OFF.critical.dump(pw);
|
||||||
|
pw.println();
|
||||||
pw.decreaseIndent();
|
pw.decreaseIndent();
|
||||||
|
|
||||||
pw.print("Screen state: current ");
|
pw.print("Screen state: current ");
|
||||||
@@ -770,18 +779,17 @@ class JobConcurrencyManager {
|
|||||||
|
|
||||||
pw.println();
|
pw.println();
|
||||||
|
|
||||||
pw.println("Current max jobs:");
|
pw.print("Current work counts: ");
|
||||||
pw.println(" ");
|
|
||||||
pw.println(mWorkCountTracker);
|
pw.println(mWorkCountTracker);
|
||||||
|
|
||||||
pw.println();
|
pw.println();
|
||||||
|
|
||||||
pw.print("mLastMemoryTrimLevel: ");
|
pw.print("mLastMemoryTrimLevel: ");
|
||||||
pw.print(mLastMemoryTrimLevel);
|
pw.println(mLastMemoryTrimLevel);
|
||||||
pw.println();
|
pw.println();
|
||||||
|
|
||||||
pw.print("User Grace Period: ");
|
pw.print("User Grace Period: ");
|
||||||
pw.print(mGracePeriodObserver.mGracePeriodExpiration);
|
pw.println(mGracePeriodObserver.mGracePeriodExpiration);
|
||||||
pw.println();
|
pw.println();
|
||||||
|
|
||||||
mStatLogger.dump(pw);
|
mStatLogger.dump(pw);
|
||||||
|
|||||||
@@ -3040,7 +3040,6 @@ public class JobSchedulerService extends com.android.server.SystemService
|
|||||||
pw.println();
|
pw.println();
|
||||||
|
|
||||||
for (int i = mJobRestrictions.size() - 1; i >= 0; i--) {
|
for (int i = mJobRestrictions.size() - 1; i >= 0; i--) {
|
||||||
pw.print(" ");
|
|
||||||
mJobRestrictions.get(i).dumpConstants(pw);
|
mJobRestrictions.get(i).dumpConstants(pw);
|
||||||
pw.println();
|
pw.println();
|
||||||
}
|
}
|
||||||
@@ -3067,7 +3066,6 @@ public class JobSchedulerService extends com.android.server.SystemService
|
|||||||
|
|
||||||
job.dump(pw, " ", true, nowElapsed);
|
job.dump(pw, " ", true, nowElapsed);
|
||||||
|
|
||||||
|
|
||||||
pw.print(" Restricted due to:");
|
pw.print(" Restricted due to:");
|
||||||
final boolean isRestricted = checkIfRestricted(job) != null;
|
final boolean isRestricted = checkIfRestricted(job) != null;
|
||||||
if (isRestricted) {
|
if (isRestricted) {
|
||||||
@@ -3161,39 +3159,28 @@ public class JobSchedulerService extends com.android.server.SystemService
|
|||||||
}
|
}
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.println("Active jobs:");
|
pw.println("Active jobs:");
|
||||||
|
pw.increaseIndent();
|
||||||
for (int i=0; i<mActiveServices.size(); i++) {
|
for (int i=0; i<mActiveServices.size(); i++) {
|
||||||
JobServiceContext jsc = mActiveServices.get(i);
|
JobServiceContext jsc = mActiveServices.get(i);
|
||||||
pw.print(" Slot #"); pw.print(i); pw.print(": ");
|
pw.print("Slot #"); pw.print(i); pw.print(": ");
|
||||||
final JobStatus job = jsc.getRunningJobLocked();
|
jsc.dumpLocked(pw, nowElapsed);
|
||||||
if (job == null) {
|
|
||||||
if (jsc.mStoppedReason != null) {
|
|
||||||
pw.print("inactive since ");
|
|
||||||
TimeUtils.formatDuration(jsc.mStoppedTime, nowElapsed, pw);
|
|
||||||
pw.print(", stopped because: ");
|
|
||||||
pw.println(jsc.mStoppedReason);
|
|
||||||
} else {
|
|
||||||
pw.println("inactive");
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
pw.println(job.toShortString());
|
|
||||||
pw.print(" Running for: ");
|
|
||||||
TimeUtils.formatDuration(nowElapsed - jsc.getExecutionStartTimeElapsed(), pw);
|
|
||||||
pw.print(", timeout at: ");
|
|
||||||
TimeUtils.formatDuration(jsc.getTimeoutElapsed() - nowElapsed, pw);
|
|
||||||
pw.println();
|
|
||||||
job.dump(pw, " ", false, nowElapsed);
|
|
||||||
int priority = evaluateJobPriorityLocked(job);
|
|
||||||
pw.print(" Evaluated priority: ");
|
|
||||||
pw.println(JobInfo.getPriorityString(priority));
|
|
||||||
|
|
||||||
pw.print(" Active at ");
|
final JobStatus job = jsc.getRunningJobLocked();
|
||||||
|
if (job != null) {
|
||||||
|
pw.increaseIndent();
|
||||||
|
job.dump(pw, " ", false, nowElapsed);
|
||||||
|
pw.print("Evaluated priority: ");
|
||||||
|
pw.println(JobInfo.getPriorityString(job.lastEvaluatedPriority));
|
||||||
|
|
||||||
|
pw.print("Active at ");
|
||||||
TimeUtils.formatDuration(job.madeActive - nowUptime, pw);
|
TimeUtils.formatDuration(job.madeActive - nowUptime, pw);
|
||||||
pw.print(", pending for ");
|
pw.print(", pending for ");
|
||||||
TimeUtils.formatDuration(job.madeActive - job.madePending, pw);
|
TimeUtils.formatDuration(job.madeActive - job.madePending, pw);
|
||||||
pw.println();
|
pw.println();
|
||||||
|
pw.decreaseIndent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pw.decreaseIndent();
|
||||||
if (filterUid == -1) {
|
if (filterUid == -1) {
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.print("mReadyToRock="); pw.println(mReadyToRock);
|
pw.print("mReadyToRock="); pw.println(mReadyToRock);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import android.os.RemoteException;
|
|||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.WorkSource;
|
import android.os.WorkSource;
|
||||||
import android.util.EventLog;
|
import android.util.EventLog;
|
||||||
|
import android.util.IndentingPrintWriter;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.util.TimeUtils;
|
import android.util.TimeUtils;
|
||||||
|
|
||||||
@@ -901,8 +902,30 @@ public final class JobServiceContext implements ServiceConnection {
|
|||||||
mTimeoutElapsed = sElapsedRealtimeClock.millis() + timeoutMillis;
|
mTimeoutElapsed = sElapsedRealtimeClock.millis() + timeoutMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void removeOpTimeOutLocked() {
|
private void removeOpTimeOutLocked() {
|
||||||
mCallbackHandler.removeMessages(MSG_TIMEOUT);
|
mCallbackHandler.removeMessages(MSG_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dumpLocked(IndentingPrintWriter pw, final long nowElapsed) {
|
||||||
|
if (mRunningJob == null) {
|
||||||
|
if (mStoppedReason != null) {
|
||||||
|
pw.print("inactive since ");
|
||||||
|
TimeUtils.formatDuration(mStoppedTime, nowElapsed, pw);
|
||||||
|
pw.print(", stopped because: ");
|
||||||
|
pw.println(mStoppedReason);
|
||||||
|
} else {
|
||||||
|
pw.println("inactive");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pw.println(mRunningJob.toShortString());
|
||||||
|
|
||||||
|
pw.increaseIndent();
|
||||||
|
pw.print("Running for: ");
|
||||||
|
TimeUtils.formatDuration(nowElapsed - mExecutionStartTimeElapsed, pw);
|
||||||
|
pw.print(", timeout at: ");
|
||||||
|
TimeUtils.formatDuration(mTimeoutElapsed - nowElapsed, pw);
|
||||||
|
pw.println();
|
||||||
|
pw.decreaseIndent();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user