Merge "Include blob sizes in blob_store service dump." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c712786944
@@ -29,6 +29,8 @@ import static android.app.blob.XmlTags.TAG_COMMITTER;
|
|||||||
import static android.app.blob.XmlTags.TAG_LEASEE;
|
import static android.app.blob.XmlTags.TAG_LEASEE;
|
||||||
import static android.os.Process.INVALID_UID;
|
import static android.os.Process.INVALID_UID;
|
||||||
import static android.system.OsConstants.O_RDONLY;
|
import static android.system.OsConstants.O_RDONLY;
|
||||||
|
import static android.text.format.Formatter.FLAG_IEC_UNITS;
|
||||||
|
import static android.text.format.Formatter.formatFileSize;
|
||||||
|
|
||||||
import static com.android.server.blob.BlobStoreConfig.TAG;
|
import static com.android.server.blob.BlobStoreConfig.TAG;
|
||||||
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_COMMIT_TIME;
|
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_COMMIT_TIME;
|
||||||
@@ -335,7 +337,9 @@ class BlobMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void forEachLeasee(Consumer<Leasee> consumer) {
|
void forEachLeasee(Consumer<Leasee> consumer) {
|
||||||
mLeasees.forEach(consumer);
|
synchronized (mMetadataLock) {
|
||||||
|
mLeasees.forEach(consumer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File getBlobFile() {
|
File getBlobFile() {
|
||||||
@@ -460,54 +464,57 @@ class BlobMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dump(IndentingPrintWriter fout, DumpArgs dumpArgs) {
|
void dump(IndentingPrintWriter fout, DumpArgs dumpArgs) {
|
||||||
fout.println("blobHandle:");
|
synchronized (mMetadataLock) {
|
||||||
fout.increaseIndent();
|
fout.println("blobHandle:");
|
||||||
mBlobHandle.dump(fout, dumpArgs.shouldDumpFull());
|
fout.increaseIndent();
|
||||||
fout.decreaseIndent();
|
mBlobHandle.dump(fout, dumpArgs.shouldDumpFull());
|
||||||
|
fout.decreaseIndent();
|
||||||
|
fout.println("size: " + formatFileSize(mContext, getSize(), FLAG_IEC_UNITS));
|
||||||
|
|
||||||
fout.println("Committers:");
|
fout.println("Committers:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
if (mCommitters.isEmpty()) {
|
if (mCommitters.isEmpty()) {
|
||||||
fout.println("<empty>");
|
fout.println("<empty>");
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0, count = mCommitters.size(); i < count; ++i) {
|
for (int i = 0, count = mCommitters.size(); i < count; ++i) {
|
||||||
final Committer committer = mCommitters.valueAt(i);
|
final Committer committer = mCommitters.valueAt(i);
|
||||||
fout.println("committer " + committer.toString());
|
fout.println("committer " + committer.toString());
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
committer.dump(fout);
|
committer.dump(fout);
|
||||||
fout.decreaseIndent();
|
fout.decreaseIndent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
fout.decreaseIndent();
|
||||||
fout.decreaseIndent();
|
|
||||||
|
|
||||||
fout.println("Leasees:");
|
fout.println("Leasees:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
if (mLeasees.isEmpty()) {
|
if (mLeasees.isEmpty()) {
|
||||||
fout.println("<empty>");
|
fout.println("<empty>");
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0, count = mLeasees.size(); i < count; ++i) {
|
for (int i = 0, count = mLeasees.size(); i < count; ++i) {
|
||||||
final Leasee leasee = mLeasees.valueAt(i);
|
final Leasee leasee = mLeasees.valueAt(i);
|
||||||
fout.println("leasee " + leasee.toString());
|
fout.println("leasee " + leasee.toString());
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
leasee.dump(mContext, fout);
|
leasee.dump(mContext, fout);
|
||||||
fout.decreaseIndent();
|
fout.decreaseIndent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
fout.decreaseIndent();
|
||||||
fout.decreaseIndent();
|
|
||||||
|
|
||||||
fout.println("Open fds:");
|
fout.println("Open fds:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
if (mRevocableFds.isEmpty()) {
|
if (mRevocableFds.isEmpty()) {
|
||||||
fout.println("<empty>");
|
fout.println("<empty>");
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0, count = mRevocableFds.size(); i < count; ++i) {
|
for (int i = 0, count = mRevocableFds.size(); i < count; ++i) {
|
||||||
final String packageName = mRevocableFds.keyAt(i);
|
final String packageName = mRevocableFds.keyAt(i);
|
||||||
final ArraySet<RevocableFileDescriptor> packageFds =
|
final ArraySet<RevocableFileDescriptor> packageFds =
|
||||||
mRevocableFds.valueAt(i);
|
mRevocableFds.valueAt(i);
|
||||||
fout.println(packageName + "#" + packageFds.size());
|
fout.println(packageName + "#" + packageFds.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
fout.decreaseIndent();
|
||||||
}
|
}
|
||||||
fout.decreaseIndent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeToXml(XmlSerializer out) throws IOException {
|
void writeToXml(XmlSerializer out) throws IOException {
|
||||||
|
|||||||
@@ -1070,10 +1070,8 @@ public class BlobStoreManagerService extends SystemService {
|
|||||||
return shouldRemove;
|
return shouldRemove;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (LOGV) {
|
Slog.d(TAG, "Completed idle maintenance; deleted "
|
||||||
Slog.v(TAG, "Completed idle maintenance; deleted "
|
+ Arrays.toString(deletedBlobIds.toArray()));
|
||||||
+ Arrays.toString(deletedBlobIds.toArray()));
|
|
||||||
}
|
|
||||||
writeBlobSessionsAsync();
|
writeBlobSessionsAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import static android.system.OsConstants.O_CREAT;
|
|||||||
import static android.system.OsConstants.O_RDONLY;
|
import static android.system.OsConstants.O_RDONLY;
|
||||||
import static android.system.OsConstants.O_RDWR;
|
import static android.system.OsConstants.O_RDWR;
|
||||||
import static android.system.OsConstants.SEEK_SET;
|
import static android.system.OsConstants.SEEK_SET;
|
||||||
|
import static android.text.format.Formatter.FLAG_IEC_UNITS;
|
||||||
|
import static android.text.format.Formatter.formatFileSize;
|
||||||
|
|
||||||
import static com.android.server.blob.BlobStoreConfig.TAG;
|
import static com.android.server.blob.BlobStoreConfig.TAG;
|
||||||
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_SESSION_CREATION_TIME;
|
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_SESSION_CREATION_TIME;
|
||||||
@@ -533,6 +535,7 @@ class BlobStoreSession extends IBlobStoreSession.Stub {
|
|||||||
fout.println("ownerUid: " + mOwnerUid);
|
fout.println("ownerUid: " + mOwnerUid);
|
||||||
fout.println("ownerPkg: " + mOwnerPackageName);
|
fout.println("ownerPkg: " + mOwnerPackageName);
|
||||||
fout.println("creation time: " + BlobStoreUtils.formatTime(mCreationTimeMs));
|
fout.println("creation time: " + BlobStoreUtils.formatTime(mCreationTimeMs));
|
||||||
|
fout.println("size: " + formatFileSize(mContext, getSize(), FLAG_IEC_UNITS));
|
||||||
|
|
||||||
fout.println("blobHandle:");
|
fout.println("blobHandle:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
|
|||||||
Reference in New Issue
Block a user