matrix icon indicating copy to clipboard operation
matrix copied to clipboard

Matrix TracePlugin 没有输出具体的耗时调用栈:doFrame

Open lonelyssl opened this issue 1 year ago • 7 comments

在使用TracePlugin进行卡顿方法监控的时候,输出符合条件的卡顿信息中,没有具体的调用方法栈 ,这个是什么情况?求助

maybe happens Jankiness!(56ms) <<<<<<<<<<<<<<<<<<<<< |* [Status] |* Scene: com.iclick.LivePlusPlus.features.push.CameraPushActivity |* Foreground: true |* Priority: -13 Nice: 0 |* is64BitRuntime: true AppMethodBeat is close[true]. =========================================================================

### Tasks

lonelyssl avatar Sep 01 '23 03:09 lonelyssl

demo中也是相同的问题,是自己使用错误,配置有问题还是什么原因哪? 2023-09-01 14:16:10.303 20394-20431/sample.tencent.matrix W/Matrix.EvilMethodTracer: - >>>>>>>>>>>>>>>>>>>>> maybe happens Jankiness!(125ms) <<<<<<<<<<<<<<<<<<<<< |* [Status] |* Scene: sample.tencent.matrix.trace.TestTraceMainActivity |* Foreground: true |* Priority: -13 Nice: -10 |* is64BitRuntime: true AppMethodBeat is close[true]. =========================================================================

lonelyssl avatar Sep 01 '23 06:09 lonelyssl

貌似是项目有bug 可以参考其他反馈, (https://github.com/Tencent/matrix/pull/844) 但是改进之后还是打印不出堆栈日志,不知道是不是gradle版本的原因导致的

zengyunpeng avatar Sep 04 '23 03:09 zengyunpeng

目前使用的是gradle 4.0.0; 应该使用那个版本的gradle哪?

lonelyssl avatar Sep 04 '23 07:09 lonelyssl

调用 UIThreadMonitor.init(), 不过这个已经被 deprecated 了。 851

tennkou avatar Sep 04 '23 13:09 tennkou

遇到同样的问题,不知道谁能解答下

yangjie10930 avatar Oct 11 '23 06:10 yangjie10930

就挺离谱的,TracePlugin中会init UIThreaMonitor,但是增加了一个版本判断:

if (sdkInt < Build.VERSION_CODES.N && willUiThreadMonitorRunning(traceConfig)) {
                    if (!UIThreadMonitor.getMonitor().isInit()) {
                        try {
                            UIThreadMonitor.getMonitor().init(traceConfig);
                        } catch (java.lang.RuntimeException e) {
                            MatrixLog.e(TAG, "[start] RuntimeException:%s", e);
                            return;
                        }
                    }
                }

所以Android version 24以下才好使……如果想用,需要手动init

ErfengLi avatar Apr 16 '24 08:04 ErfengLi

遇到同样的问题,不知道谁能解答下

build:gradle:4.0.1 Android14 在plugin start()之前调用 UIThreadMonitor.init() 可以

wsdydeni avatar Jul 25 '24 12:07 wsdydeni