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

Commit 877bc778 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "libbinder: binder thread names ++" am: beeff2d3 am: e2970735 am: 1e720b38

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

Change-Id: I45799bf318f483fe541e38b19131ecae7fda0aa6
parents 3094fcd7 1e720b38
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include <binder/ProcessState.h>
#include <binder/ProcessState.h>


#include <android-base/result.h>
#include <android-base/result.h>
#include <android-base/strings.h>
#include <binder/BpBinder.h>
#include <binder/BpBinder.h>
#include <binder/IPCThreadState.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/IServiceManager.h>
@@ -367,8 +368,13 @@ void ProcessState::expungeHandle(int32_t handle, IBinder* binder)
String8 ProcessState::makeBinderThreadName() {
String8 ProcessState::makeBinderThreadName() {
    int32_t s = android_atomic_add(1, &mThreadPoolSeq);
    int32_t s = android_atomic_add(1, &mThreadPoolSeq);
    pid_t pid = getpid();
    pid_t pid = getpid();

    std::string_view driverName = mDriverName.c_str();
    android::base::ConsumePrefix(&driverName, "/dev/");

    String8 name;
    String8 name;
    name.appendFormat("%d_%X:%s", pid, s, mDriverName.c_str());
    name.appendFormat("%.*s:%d_%X", static_cast<int>(driverName.length()), driverName.data(), pid,
                      s);
    return name;
    return name;
}
}