Touch Log 打开方法(MTK)

本文介绍了如何在Android设备上临时开启debug模式,启用各种日志以追踪触摸事件和系统输入,包括viewinputlogs、nativeinputlogs和InputDispatcher的设置,以及如何在Goodix触控驱动中添加特定log以定位触控问题。
摘要由CSDN通过智能技术生成
  1. 进入debug 模式,打开 开发者模式 中的显示点按操作反馈

  2. 打开android Framework log

First, enable view input logs
adb root
adb shell "setprop mtk_d.viewroot.enable 707000"

After framework restart(adb shell stop/start) enable native input logs
/*inputReader touch 的log 开法
adb shell setprop sys.input.TouchFilterEnable true
adb shell setprop sys.input.TouchFilterLogEnable true
/*inputDispatcher的log 开法
adb shell setprop sys.inputlog.enabled true
adb shell dumpsys input

复测前输入
adb shell setprop log.tag.InputDispatcherInboundEvent DEBUG
adb shell setprop log.tag.InputTransportTransportActions DEBUG

不用重启手机就可以生效,重启手机后会失效。

  1. 动态开启APP层LOG方法如下:

adb shell setprop debug.viewroot.enable 7000
(P版本这个属性名称换了,换成mtk_d.viewroot.enable了, 故P版本后这句要换成
adb shell setprop mtk_d.viewroot.enable 7000 )
adb shell setprop debug.view.keylog true
adb shell setprop debug.view.touchlog true
adb shell setprop debug.view.motionlog true
adb shell setprop debug.inputclient.enable 1
adb shell stop
adb shell start

需等待手机软重启后才能生效

  1. kernel event的查看方法
    adb shell getevent -i
    adb shell getevent -tlr

需添加的Log

在分析Touch问题时,可在Touch driver的中断函数中加入log对触摸进行追踪
例如如下log:

行 205417: <6>[13247.422097] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1293] goodix_ts_threadirq_func IN!
行 205419: <6>[13247.423564] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1654] goodix_event_handler IN!
行 205422: <6>[13247.503799] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in
行 205427: <6>[13247.897794] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out
行 205429: <6>[13247.898684] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1670] ic_type = 3
行 205432: <6>[13248.223617] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1671] return checksum_u8_ys =0
行 205435: <6>[13248.284083] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1707] goodix_event_handler OUT!
行 205437: <6>[13248.367879] .(1)[7602:kworker/1:0][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in
行 205438: <6>[13248.368066] .(1)[7602:kworker/1:0][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out
行 205444: <6>[13248.478453] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1328] goodix_ts_threadirq_func OUT!
行 205446: <6>[13248.480243] .(6)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1293] goodix_ts_threadirq_func IN!
行 205448: <6>[13248.481548] .(6)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1654] goodix_event_handler IN!
行 205450: <6>[13248.900707] .(6)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in
行 205451: <6>[13248.901870] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out
行 205453: <6>[13248.904084] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1670] ic_type = 3
行 205454: <6>[13248.904102] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1671] return checksum_u8_ys =0
行 205455: <6>[13248.918160] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1707] goodix_event_handler OUT!
行 205456: <6>[13248.919639] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1328] goodix_ts_threadirq_func OUT!
行 205457: <6>[13248.921225] .(7)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1293] goodix_ts_threadirq_func IN!
行 205458: <6>[13248.922475] .(7)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1654] goodix_event_handler IN!
行 205459: <6>[13248.923628] .(7)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in
行 205460: <6>[13248.925483] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out
行 205461: <6>[13248.926680] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1670] ic_type = 3
行 205462: <6>[13248.927706] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1671] return checksum_u8_ys =0
行 205463: <6>[13248.929092] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1707] goodix_event_handler OUT!
行 205464: <6>[13248.930501] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1328] goodix_ts_threadirq_func OUT!

通过log是否打出以及打出时间与流程可以对问题进行判断

  • 21
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值