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

Commit 7ddb8ae4 authored by Devin Moore's avatar Devin Moore Committed by Automerger Merge Worker
Browse files

Merge "Add some binder transaction info when dumping backtraces for ANR" into...

Merge "Add some binder transaction info when dumping backtraces for ANR" into main am: dc20b191 am: 3086c796

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2966068



Change-Id: Ib38fc94905fd7ddb7c14b87c0b6dba401c393ab1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3a2f74f8 3086c796
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ cc_library_shared_for_libandroid_runtime {
                "libdebuggerd_client",
                "libutils",
                "libbinder",
                "libbinderdebug",
                "libbinder_ndk",
                "libui",
                "libgraphicsenv",
+31 −20
Original line number Diff line number Diff line
@@ -16,44 +16,46 @@

#define LOG_TAG "android.os.Debug"

#include "android_os_Debug.h"

#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <assert.h>
#include <binderdebug/BinderDebug.h>
#include <bionic/malloc.h>
#include <ctype.h>
#include <debuggerd/client.h>
#include <dmabufinfo/dmabuf_sysfs_stats.h>
#include <dmabufinfo/dmabufinfo.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <log/log.h>
#include <malloc.h>
#include <meminfo/androidprocheaps.h>
#include <meminfo/procmeminfo.h>
#include <meminfo/sysmeminfo.h>
#include <memtrack/memtrack.h>
#include <memunreachable/memunreachable.h>
#include <nativehelper/JNIPlatformHelp.h>
#include <nativehelper/ScopedUtfChars.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <utils/String8.h>
#include <utils/misc.h>
#include <vintf/KernelConfigs.h>

#include <iomanip>
#include <string>
#include <vector>

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <bionic/malloc.h>
#include <debuggerd/client.h>
#include <log/log.h>
#include <utils/misc.h>
#include <utils/String8.h>

#include <nativehelper/JNIPlatformHelp.h>
#include <nativehelper/ScopedUtfChars.h>
#include "jni.h"
#include <dmabufinfo/dmabuf_sysfs_stats.h>
#include <dmabufinfo/dmabufinfo.h>
#include <meminfo/androidprocheaps.h>
#include <meminfo/procmeminfo.h>
#include <meminfo/sysmeminfo.h>
#include <memtrack/memtrack.h>
#include <memunreachable/memunreachable.h>
#include <android-base/strings.h>
#include "android_os_Debug.h"
#include <vintf/KernelConfigs.h>

namespace android
{
@@ -579,6 +581,15 @@ static bool dumpTraces(JNIEnv* env, jint pid, jstring fileName, jint timeoutSecs
        return false;
    }

    std::string binderState;
    android::status_t status = android::getBinderTransactions(pid, binderState);
    if (status == android::OK) {
        if (!android::base::WriteStringToFd(binderState, fd)) {
            PLOG(ERROR) << "Failed to dump binder state info for pid: " << pid;
        }
    } else {
        PLOG(ERROR) << "Failed to get binder state info for pid: " << pid << " status: " << status;
    }
    int res = dump_backtrace_to_file_timeout(pid, dumpType, timeoutSecs, fd);
    if (fdatasync(fd.get()) != 0) {
        PLOG(ERROR) << "Failed flushing trace.";