[2.15.0_merge_3.2.0]
This commit is contained in:
@@ -9,8 +9,9 @@ import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
@@ -21,6 +22,16 @@ import com.mogo.eagle.core.function.api.devatools.strict.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.api.devatools.download.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.tencent.matrix.Matrix
|
||||
import com.tencent.matrix.iocanary.IOCanaryPlugin
|
||||
import com.tencent.matrix.iocanary.config.IOConfig
|
||||
import com.tencent.matrix.plugin.Plugin
|
||||
import com.tencent.matrix.plugin.PluginListener
|
||||
import com.tencent.matrix.report.Issue
|
||||
import com.tencent.matrix.trace.TracePlugin
|
||||
import com.tencent.matrix.trace.config.SharePluginInfo
|
||||
import com.tencent.matrix.trace.config.TraceConfig
|
||||
import com.zhjt.mogo_core_function_devatools.apm.*
|
||||
import com.mogo.eagle.core.function.api.upgrade.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
@@ -31,11 +42,11 @@ import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Compani
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.koom.KoomInitTask
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.matrix.DynamicConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangManager.Companion.moFangManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb.Companion.getDb
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager.Companion.iPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
@@ -43,6 +54,8 @@ import com.zhjt.mogo_core_function_devatools.strict.*
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager.Companion.traceManager
|
||||
import com.zhjt.mogo_core_function_devatools.tts.TtsManager.Companion.ttsManager
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.UpgradeManager.Companion.upgradeManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_DEVA_TOOLS)
|
||||
class DevaToolsProvider : IDevaToolsProvider {
|
||||
@@ -65,12 +78,13 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
|
||||
override fun initBiz() {
|
||||
if (DebugConfig.isDebug()) {
|
||||
KoomInitTask.init(AbsMogoApplication.getApp())
|
||||
}
|
||||
ttsManager.initTts(mContext!!) //todo
|
||||
//链路相关
|
||||
traceManager.init(mContext!!)
|
||||
if (DebugConfig.isDebug()) {
|
||||
KoomInitTask.init(AbsMogoApplication.getApp())
|
||||
initMatrix()
|
||||
}
|
||||
ttsManager.initTts(mContext!!) //todo
|
||||
bizConfigCenter.init(mContext!!)
|
||||
FuncConfigImpl.init()
|
||||
MogoLogCatchManager.init(mContext!!)
|
||||
@@ -107,6 +121,76 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMatrix() {
|
||||
val builder: Matrix.Builder = Matrix.Builder(AbsMogoApplication.getApp())
|
||||
builder.pluginListener(object : PluginListener {
|
||||
override fun onInit(plugin: Plugin?) {
|
||||
}
|
||||
|
||||
override fun onStart(plugin: Plugin?) {
|
||||
}
|
||||
|
||||
override fun onStop(plugin: Plugin?) {
|
||||
}
|
||||
|
||||
override fun onDestroy(plugin: Plugin?) {
|
||||
}
|
||||
|
||||
override fun onReportIssue(issue: Issue?) {
|
||||
var isEvil = false
|
||||
issue?.apply {
|
||||
if (plugin is TracePlugin) {
|
||||
if (tag == SharePluginInfo.TAG_PLUGIN_EVIL_METHOD) {
|
||||
isEvil = true
|
||||
printEvilMsg(issue.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isEvil) {
|
||||
w("TraceCanary", issue?.toString())
|
||||
}
|
||||
}
|
||||
})
|
||||
val config: TraceConfig = TraceConfig.Builder()
|
||||
.enableFPS(true) // 帧率
|
||||
.enableEvilMethodTrace(true) // 慢方法
|
||||
.enableAnrTrace(true) // anr
|
||||
.enableStartup(true) // app启动
|
||||
.isDebug(true) // debug包
|
||||
.isDevEnv(true) // dev环境
|
||||
.build()
|
||||
|
||||
// Trace Canary插件
|
||||
val tracePlugin = TracePlugin(config)
|
||||
builder.plugin(tracePlugin)
|
||||
|
||||
val ioCanaryPlugin = IOCanaryPlugin(
|
||||
IOConfig.Builder()
|
||||
.dynamicConfig(DynamicConfigImpl())
|
||||
.build())
|
||||
|
||||
builder.plugin(ioCanaryPlugin)
|
||||
|
||||
Matrix.init(builder.build())
|
||||
// 日志刷太快,关掉
|
||||
Matrix.setLogIml(null)
|
||||
// 开启Trace Canary
|
||||
tracePlugin.start()
|
||||
ioCanaryPlugin.start()
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_LINK_LOG_ANR,
|
||||
linkCode = ChainConstant.CHAIN_LINK_ANR,
|
||||
endpoint = PAD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_RECORD_ANR,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private fun printEvilMsg(evilMethod: String) {
|
||||
w("TraceCanary", evilMethod)
|
||||
}
|
||||
|
||||
override fun startLogCatch() {
|
||||
MogoLogCatchManager.startCatchLog()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zhjt.mogo_core_function_devatools.matrix
|
||||
|
||||
import com.tencent.mrs.plugin.IDynamicConfig
|
||||
|
||||
class DynamicConfigImpl: IDynamicConfig {
|
||||
|
||||
fun isFPSEnable(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
fun isTraceEnable(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
fun isMatrixEnable(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
fun isDumpHprof(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun get(key: String?, defStr: String?): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun get(key: String?, defInt: Int): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun get(key: String?, defLong: Long): Long {
|
||||
return 0L
|
||||
}
|
||||
|
||||
override fun get(key: String?, defBool: Boolean): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun get(key: String?, defFloat: Float): Float {
|
||||
return 0f
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,6 +67,8 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_PLANNING_ACTIONS)
|
||||
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_NATIVE_LEAK)
|
||||
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_ANR] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_ANR)
|
||||
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_CLOUD_V2N] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_CLOUD_WEB_SOCKET_V2N)
|
||||
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_HD_MAP] =
|
||||
@@ -93,6 +95,8 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
ChainLogParam(true, "ADAS PLANNING 决策行为")
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK] =
|
||||
ChainLogParam(true, "Native Leak Record")
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_ANR] =
|
||||
ChainLogParam(true, "ANR Record")
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CLOUD_V2N] =
|
||||
ChainLogParam(true, "Cloud WebSocket V2N")
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_HD_MAP] =
|
||||
|
||||
Reference in New Issue
Block a user