Tencent / matrix

Matrix is a plugin style, non-invasive APM system developed by WeChat.
Other
11.47k stars 1.86k forks source link

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

Open lonelyssl opened 10 months ago

lonelyssl commented 10 months ago

在使用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 commented 10 months ago

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].

zengyunpeng commented 10 months ago

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

lonelyssl commented 10 months ago

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

tennkou commented 10 months ago

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

yangjie10930 commented 8 months ago

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

ErfengLi commented 2 months ago

就挺离谱的,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