diff options
author | Dan Sandler <dsandler@android.com> | 2015-04-10 10:08:45 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2015-04-16 04:08:53 +0000 |
commit | aa5c2346c7291465aaca53f59878582dccbe4835 (patch) | |
tree | 5e174252b660c88e6abbd90b402789e80b654aea /libs/binder | |
parent | 668285721ba81fc4fb6f5e223b382f5e604c64c2 (diff) | |
download | frameworks_native-aa5c2346c7291465aaca53f59878582dccbe4835.zip frameworks_native-aa5c2346c7291465aaca53f59878582dccbe4835.tar.gz frameworks_native-aa5c2346c7291465aaca53f59878582dccbe4835.tar.bz2 |
Add ashmem stats to Parcels
Requires change Ifaf115da in frameworks/base.
Bug: 20079551
Change-Id: Ifaf115dabd1a59cdb1b46e2d49c41f64ac107de4
Diffstat (limited to 'libs/binder')
-rw-r--r-- | libs/binder/Parcel.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index d4dd8c7..0e11d53 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -938,6 +938,8 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob) int fd = ashmem_create_region("Parcel Blob", len); if (fd < 0) return NO_MEMORY; + mBlobAshmemSize += len; + int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE); if (result < 0) { status = result; @@ -1901,6 +1903,7 @@ void Parcel::initState() mFdsKnown = true; mAllowFds = true; mOwner = NULL; + mBlobAshmemSize = 0; } void Parcel::scanForFds() const @@ -1918,6 +1921,11 @@ void Parcel::scanForFds() const mFdsKnown = true; } +size_t Parcel::getBlobAshmemSize() const +{ + return mBlobAshmemSize; +} + // --- Parcel::Blob --- Parcel::Blob::Blob() : |