zoukankan      html  css  js  c++  java
  • 使用atrace抓取systrace log

    /system/etc/init/atrace.rc /system/bin/atrace
    mount debugfs
    atrace --list
    /sys/kernel/debug/tracing

    1:抓取atrace之前需要根据内存大小修改trace buffer size
    adb shell "echo 20960 > /sys/kernel/debug/tracing/buffer_size_kb"
    Recommends values:
    For 1G ram device: 4096
    For 2G ram device: 10960
    For 4G and above ram device: 20960

    2:run atrace background
    adb shell
    atrace -z -b 20960 -t 12 gfx input audio view webview wm am hal app res dalvik rs bionic
    power sched freq idle load sync workq memreclaim > /data/local/tmp/atrace.out &

    3:run atrace async mode
    Connect USB
    adb shell atrace --async_start -z -b 20960 gfx input audio view webview wm am hal app res
    dalvik rs bionic power sched freq idle load sync workq memreclaim
    Unplug USB and reproduce your issue
    Once issue get replicated, plugin USB immediately and run
    adb shell atrace --async_dump -z -b 20960 gfx input audio view webview wm am hal app res dalvik
    rs bionic power sched freq idle load sync workq memreclaim >atrace.out

    4:解析atrace
    python systrace.py --from-file 31off_atrace.out -o 31off_atrace.html

    5:配置内核模块trace events后,抓取atrace
    大多数内核模块都有trace配置,我们只需要开启 其trace event。

    adb root
    adb shell "echo > /d/tracing/set_event"
    adb shell "echo 0 > /sys/kernel/debug/tracing/tracing_on"
    adb shell "echo > /sys/kernel/debug/tracing/trace"
    adb shell "echo 20960 > /sys/kernel/debug/tracing/buffer_size_kb"
    
    adb shell "echo 1 > /proc/sys/kernel/sched_schedstats"
    adb shell "echo 1 > /sys/kernel/debug/tracing/events/sched/enable"
    adb shell "echo 1 > /sys/kernel/debug/tracing/events/f2fs/enable"
    
    adb shell "echo sched:*>> /sys/kernel/debug/tracing/set_event"
    adb shell "echo f2fs:*>> /sys/kernel/debug/tracing/set_event"
    
    adb shell "echo 512 > /sys/kernel/debug/tracing/saved_cmdlines_size"
    
    adb shell "echo 1 > /sys/kernel/debug/tracing/events/workqueue/enable"
    adb shell "echo 1 > /sys/kernel/debug/tracing/options/record-tgid"
    
    adb shell atrace -b 41920 -t 15 -z gfx irq input view webview wm am hal res rs bionic power sched freq idle disk pm dalvik network > C:UsersaiboDesktoplog31off_atrace.out
    
  • 相关阅读:
    [转] 英语飙升的好方法
    jndi数据源方式配制SPY
    OJB查询
    ODP.NET应用之我所见
    C#中利用ODP实现瞬间导入百万级数据详解
    Sys.Extended.UI' is null or not an object 中文的訊息
    oracle数据库连接字符串
    seo
    宽幅FLASH产品展示代码多图带左右显示按钮 图
    网站盈利模式分类详解
  • 原文地址:https://www.cnblogs.com/bobfly1984/p/14090162.html
Copyright © 2011-2022 走看看