diff --git a/build.gradle b/build.gradle index 338ea3c644..e025f4c7e6 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ buildscript { classpath "com.mogo.cloud:hook:${service_chain_version}" classpath "com.mogo.cloud:bizconfig:${plugin_version}" classpath 'com.volcengine:apm_insight_plugin:1.4.2' - classpath "com.mogo.thread.opt:plg:${plugin_version}" + classpath "com.mogo.thread.opt:plg:10.2.0_mogo" classpath "com.mogo.cloud:systrace:${plugin_version}" classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18' classpath "com.mogo.sticky:service:${plugin_version}" diff --git a/config.gradle b/config.gradle index b9e796074d..ab9fabe5ab 100644 --- a/config.gradle +++ b/config.gradle @@ -214,7 +214,7 @@ ext { //========================= autosize ====================== androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1', - thread_opt : "com.mogo.thread.opt:lib:10.1.2_mogo", + thread_opt : "com.mogo.thread.opt:lib:10.2.0_mogo", weak_network : "com.mogo.weak:network:1.0.0", btrace : "com.bytedance.btrace:rhea-core:2.0.0", diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/ThreadOptStartup.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/ThreadOptStartup.kt index 71b6f41435..3e6e293b92 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/ThreadOptStartup.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/ThreadOptStartup.kt @@ -2,9 +2,12 @@ package com.mogo.eagle.core.function.startup.stageone import android.content.* import android.os.Process +import android.os.Trace +import android.util.* import com.mogo.thread.ext.core.* import com.mogo.thread.ext.core.config.* import com.mogo.thread.ext.core.config.priority.* +import com.mogo.thread.ext.core.trace.* import com.rousetime.android_startup.* import java.io.* import java.text.* @@ -23,6 +26,18 @@ class ThreadOptStartup: AndroidStartup() { .setPriority("GLThread\\s+\\d+", Process.THREAD_PRIORITY_BACKGROUND) .setPriority("Dispatch-\\w+", Process.THREAD_PRIORITY_BACKGROUND) .build()) + .traceConfig(TraceConfig.Builder() + .enabled(false) + .trace(object : ITrace { + override fun enter(section: String) { + //Trace.beginSection(section) + //Log.d("TTTTTT", "enter->$section" ) + } + override fun exit() { + //Trace.endSection() + } + }) + .build()) /*.dump(DumpConfig.Builder() .dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath) .dumpPeriod(5, SECONDS) diff --git a/gradle/bytex/bytex_thread_opt.gradle b/gradle/bytex/bytex_thread_opt.gradle index 9f6b309718..54e13f1319 100644 --- a/gradle/bytex/bytex_thread_opt.gradle +++ b/gradle/bytex/bytex_thread_opt.gradle @@ -3,5 +3,7 @@ thread_opt { enable true enableInDebug true logLevel "DEBUG" + trace_enable !rootProject.isReleaseBuild() + //thread_replace_with_coroutine false }