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

Commit 978d5321 authored by Stan Iliev's avatar Stan Iliev
Browse files

Fix RenderThread and worker thread names used by tools

Test: collected systrace and RenderThread hwuiTask1/2 shown
Change-Id: I1114ff72a7ed8c9dc86a64ebd15ca783d1b2ff08
parent b3cd68bc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1202,12 +1202,12 @@ static const JNINativeMethod gMethods[] = {

static JavaVM* mJvm = nullptr;

static void attachRenderThreadToJvm() {
static void attachRenderThreadToJvm(const char* name) {
    LOG_ALWAYS_FATAL_IF(!mJvm, "No jvm but we set the hook??");

    JavaVMAttachArgs args;
    args.version = JNI_VERSION_1_4;
    args.name = NULL;
    args.name = name;
    args.group = NULL;
    JNIEnv* env;
    mJvm->AttachCurrentThreadAsDaemon(&env, (void*) &args);
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ void RenderThread::requestVsync() {
bool RenderThread::threadLoop() {
    setpriority(PRIO_PROCESS, 0, PRIORITY_DISPLAY);
    if (gOnStartHook) {
        gOnStartHook();
        gOnStartHook("RenderThread");
    }
    initThreadLocals();

+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ struct VsyncSource {

class DummyVsyncSource;

typedef void (*JVMAttachHook)();
typedef void (*JVMAttachHook)(const char* name);

class RenderThread : private ThreadBase {
    PREVENT_COPY_AND_ASSIGN(RenderThread);
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ status_t TaskManager::WorkerThread::readyToRun() {
    setpriority(PRIO_PROCESS, 0, PRIORITY_FOREGROUND);
    auto onStartHook = renderthread::RenderThread::getOnStartHook();
    if (onStartHook) {
        onStartHook();
        onStartHook(mName.c_str());
    }

    return NO_ERROR;