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

Commit 114e815a authored by Martijn Coenen's avatar Martijn Coenen Committed by Automerger Merge Worker
Browse files

Merge "Repeat proxy limit callback only when exceeding high threshold again."...

Merge "Repeat proxy limit callback only when exceeding high threshold again." am: 7fb82c33 am: 1ccba04c am: a87d5560 am: 6b2aca38 am: b28ad440

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1833504

Change-Id: I5a2ce86e416d884286c4639838bb692400114ca3
parents 91773046 b28ad440
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -48,10 +48,6 @@ uint32_t BpBinder::sBinderProxyCountHighWatermark = 2500;
// Another arbitrary value a binder count needs to drop below before another callback will be called
// Another arbitrary value a binder count needs to drop below before another callback will be called
uint32_t BpBinder::sBinderProxyCountLowWatermark = 2000;
uint32_t BpBinder::sBinderProxyCountLowWatermark = 2000;


// Once the limit has been exceeded, keep calling the limit callback for every this many new proxies
// created over the limit.
constexpr uint32_t REPEAT_LIMIT_CALLBACK_INTERVAL = 1000;

enum {
enum {
    LIMIT_REACHED_MASK = 0x80000000,        // A flag denoting that the limit has been reached
    LIMIT_REACHED_MASK = 0x80000000,        // A flag denoting that the limit has been reached
    COUNTING_VALUE_MASK = 0x7FFFFFFF,       // A mask of the remaining bits for the count value
    COUNTING_VALUE_MASK = 0x7FFFFFFF,       // A mask of the remaining bits for the count value
@@ -129,7 +125,7 @@ sp<BpBinder> BpBinder::create(int32_t handle) {
            uint32_t lastLimitCallbackAt = sLastLimitCallbackMap[trackedUid];
            uint32_t lastLimitCallbackAt = sLastLimitCallbackMap[trackedUid];


            if (trackedValue > lastLimitCallbackAt &&
            if (trackedValue > lastLimitCallbackAt &&
                (trackedValue - lastLimitCallbackAt > REPEAT_LIMIT_CALLBACK_INTERVAL)) {
                (trackedValue - lastLimitCallbackAt > sBinderProxyCountHighWatermark)) {
                ALOGE("Still too many binder proxy objects sent to uid %d from uid %d (%d proxies "
                ALOGE("Still too many binder proxy objects sent to uid %d from uid %d (%d proxies "
                      "held)",
                      "held)",
                      getuid(), trackedUid, trackedValue);
                      getuid(), trackedUid, trackedValue);