From 7e790af756d7891cb1cf1374bb283a8fbcbe6b49 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 11 Nov 2014 12:22:53 -0800 Subject: Add tracking of parcel memory allocations. Change-Id: I76ffed0e69ccfe70e87d98646f11d4de7c3fd980 --- include/binder/Parcel.h | 6 +++++- include/private/binder/Static.h | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h index 2ee99f8..6a69761 100644 --- a/include/binder/Parcel.h +++ b/include/binder/Parcel.h @@ -205,7 +205,11 @@ public: // Explicitly close all file descriptors in the parcel. void closeFileDescriptors(); - + + // Debugging: get metrics on current allocations. + static size_t getGlobalAllocSize(); + static size_t getGlobalAllocCount(); + private: typedef void (*release_func)(Parcel* parcel, const uint8_t* data, size_t dataSize, diff --git a/include/private/binder/Static.h b/include/private/binder/Static.h index 6a03594..eeb37d7 100644 --- a/include/private/binder/Static.h +++ b/include/private/binder/Static.h @@ -34,7 +34,12 @@ extern Vector gTextBuffers; extern Mutex gProcessMutex; extern sp gProcess; -// For ServiceManager.cpp +// For Parcel.cpp +extern Mutex gParcelGlobalAllocSizeLock; +extern size_t gParcelGlobalAllocSize; +extern size_t gParcelGlobalAllocCount; + +// For IServiceManager.cpp extern Mutex gDefaultServiceManagerLock; extern sp gDefaultServiceManager; extern sp gPermissionController; -- cgit v1.1