1. ホーム
  2. Android

adb shellのバグレポート解析

2022-02-23 07:58:01
<パス

BugReport形式の解析

BugReportの設定

バグレポート自体にはオプションはなく、ほとんどdumpsys withのようなコマンドで行われます。
1. バッテリーの統計情報をリセットする

adb shell dumpsys batterystats --reset  


2.ウェークロック解析 すべてのウェークロック情報

adb shell dumpsys batterystats --enable full-wake-history


3. カーネルトレース解析は、カーネルを分析し、主にウェイクアップソースとウェイクアップ活動、最初にカーネル解析を有効にする

$ adb shell

# Set the events to trace.
$ echo "power:wakeup_source_activate" >> /d/tracing/set_event
$ echo "power:wakeup_source_deactivate" >> /d/tracing/set_event

# The default trace size for most devices is 1MB, which is relatively low and might cause the logs to overflow.
# 8MB to 10MB should be a decent size for 5-6 hours of logging.

$ echo 8192 > /d/tracing/buffer_size_kb

$ echo 1 > /d/tracing/tracing_on


次に、ログを取得します。

$ echo 0 > /d/tracing/tracing_on
$ adb pull /d/tracing/trace <some path="">

# Take a bug report at this time.
$ adb bugreport > bugreport.txt


バグレポートの内容

バッテリー履歴

1. バグレポートには以下の情報が記録されています。

Brightness
CPU running
Charging on
Charging status
Health
JobScheduler
Kernel only uptime
Kernel only uptime
Package active
Partial wakelock
Phone scanning
Phone state
Plugged
Plugged
Screen
Temperature
Top app
Voltage
Wifi on
Wifi running
Wifi supplicant


2. 概要情報

Battery History (15% used, 40KB used of 256KB, 240 strings using 15KB):

                0 (9) RESET:TIME: 2016-08-23-10-41-35

                0 (3) 031 status=discharging health=good plug=none temp=310 volt=7392 +running

40KB used of 256KB

+14m02s086ms (2) 030 +wake_lock=1000:"WifiSuspend" +14m02s095ms (1) 030 -wake_lock +14m02s086ms 256KBのキャッシュのうち40KBを使用

3. タイムライン

030

+wake_lock RESET TIMEからの経過時間
-wake_lock 現在の電源比率
temp=330 volt=7414 temp wake_lockの開始
volt wake_lockの終了

current=-861

current

PID 3270 wake time: +1ms PID 0 wake time: +847ms 温度
#0: +41m55s146ms to 31 (power-save-off) #1: +2m40s252ms to 32 (screen-on, power-save-off, device-idle-off) #2: +3m20s224ms to 34 (power-save-off, device-idle-off) #3: +2m40s495ms to 35 (screen-on, power-save-off, device-idle-off) #1: +2m40s252ms to 32 電圧

Daily stats:

    Current start time: 2016-08-23-11-08-25

    Next min deadline: 2016-08-24-01-00-00

    Next max deadline: 2016-08-24-03-00-00

    Current daily discharge step durations:

    #0: +41m55s146ms to 31 (power-save-off)

    #1: +2m40s252ms to 32 (screen-on, power-save-off, device-idle-off)

    #2: +3m20s224ms to 34 (power-save-off, device-idle-off)


Package changes: Update com.tencent.mobileqq vers=398 Update com.jingdong.app.mall vers=34669 Update com.tencent.mm vers=840 Update com.sdu.didi.psnger vers=150 Update com.qzone vers=94 は電流値で、+は充電、-は放電です

PIDごとの統計

System starts: 5, currently on battery: false

Time on battery: 4h 50m 51s 103ms (62.2%) realtime, 2h 10m 39s 764ms (27.9%) uptime

Time on battery screen off: 3h 9m 1s 524ms (40.4%) realtime, 28m 50s 181ms (6.2%) uptime

Total run time: 7h 47m 49s 583ms realtime, 5h 7m 38s 242ms uptime

Start clock time: 2016-08-23-10-41-27

Screen on: 1h 41m 49s 579ms (35.0%) 38x, Interactive: 1h 41m 41s 490ms (35.0%)

Screen brightnesses:

    dark 42m 58s 386ms (42.2%)

    dim 58m 43s 967ms (57.7%)

    light 6s 398ms (0.1%)

    bright 819ms (0.0%)

Device idling: 1h 50m 43s 273ms (38.1%) 7x



PIDがパワーロックになる時期

放電ステップ時間

    Capacity: 3900, Computed drain: 1565, actual drain: 819-1053

    Uid 1000: 338 ( cpu=334 wake=2.32 wifi=0.764 sensor=0.522 )

    Screen: 304

    Uid 0: 212 ( cpu=212 wifi=0.00877 )

    Uid u0a112: 35.5 ( cpu=35.4 wifi=0.00295 sensor=0.00000125 )

    Uid u0a101: 32.7 ( cpu=26.8 wifi=4.60 sensor=1.28 )

    Uid u0a100: 28.1 ( cpu=27.1 wake=0.913 wifi=0.00639 )

Capacity: 3900, Computed drain: 1565...

Uid u0a112: 33から32への放電時間は2m40s252ms、カッコ内は単純な消費電力の理由

日別統計

  Kernel Wake lock wlan_rx_wake: 11m 4s 92ms (319 times) realtime

  Kernel Wake lock wlan_wd_wake: 8m 51s 176ms (1432 times) realtime

  Kernel Wake lock mmc1_detect : 2m 34s 710ms (482 times) realtime


日別統計排出プロセス

  Wake lock 1000 eventloop: 1m 53s 858ms (92 times) realtime

  Wake lock 1000 dispatcher: 29s 367ms (39 times) realtime

  Wake lock u0a100 WakerLock:25822454: 21s 879ms (29 times) realtime


変更されたパッケージ

前回チャージからの統計情報

Wakeup reason unknown: 4m 36s 753ms (150 times) realtime

Wakeup reason Abort:Last active Wakeup Source: wlan_wd_wake: 1m 6s 628ms (32 times) realtime

Wakeup reason Abort:Last active Wakeup Source: ARD: 53s 17ms (25 times) realtime


前回の充電から今までの各種統計、名前を見て意義を確認する。

推定使用電力(mAh)

1001:

    Wake lock ServiceStateTracker realtime

    Wake lock CallerInfoCache realtime

    Wake lock RADIOPOWERDOWN_IFNOCARD_WAKELOCK: 14s 321ms partial (3 times) realtime

    Wake lock SERVICESTATE_WAIT_DISCONNECT_WAKELOCK realtime

    ...
    TOTAL wake: 17s 288ms partial realtime

    Foreground activities: 2s 36ms realtime (2 times)

    Foreground for: 4h 50m 34s 89ms 

    Active for: 4h 50m 36s 257ms 

    Running for: 4h 50m 36s 264ms
    ...
    Total cpu time: u=1m 12s 192ms s=48s 219ms p=0mAh

    Proc com.huawei.skytone:

        CPU: 80ms usr + 30ms krn ; 0ms fg

        28 starts

    Proc com.android.phone:

        CPU: 39s 770ms usr + 21s 950ms krn ; 0ms fg

        8 starts
    ...
    Apk com.huawei.ims:

        Service com.huawei.ims:

            Created for: 2h 10m 4s 956ms uptime

            Starts: 5, launches: 5

    Apk com.android.phone:

        Service com.android.phone:

            Created for: 2h 10m 4s 945ms uptime

            Starts: 5, launches: 5 

TOTAL wake

Total cpu ヘッダーはバッテリーの全体情報です
Proc ... uidに基づく消費電力統計

すべてのカーネルウェイクロック

Apk ...

カーネルウェイクロックゲッター情報、期間、回数

すべてのパーシャルウェイクロック

  Wake lock 1000 eventloop: 1m 53s 858ms (92 times) realtime

  Wake lock 1000 dispatcher: 29s 367ms (39 times) realtime

  Wake lock u0a100 WakerLock:25822454: 21s 879ms (29 times) realtime


部分的なウェイクロック情報

すべてのウェイクアップの理由

Wakeup reason unknown: 4m 36s 753ms (150 times) realtime

Wakeup reason Abort:Last active Wakeup Source: wlan_wd_wake: 1m 6s 628ms (32 times) realtime

Wakeup reason Abort:Last active Wakeup Source: ARD: 53s 17ms (25 times) realtime


システムウェイクアップの理由

UID統計に関する詳細情報

1001:

    Wake lock ServiceStateTracker realtime

    Wake lock CallerInfoCache realtime

    Wake lock RADIOPOWERDOWN_IFNOCARD_WAKELOCK: 14s 321ms partial (3 times) realtime

    Wake lock SERVICESTATE_WAIT_DISCONNECT_WAKELOCK realtime

    ...
    TOTAL wake: 17s 288ms partial realtime

    Foreground activities: 2s 36ms realtime (2 times)

    Foreground for: 4h 50m 34s 89ms 

    Active for: 4h 50m 36s 257ms 

    Running for: 4h 50m 36s 264ms
    ...
    Total cpu time: u=1m 12s 192ms s=48s 219ms p=0mAh

    Proc com.huawei.skytone:

        CPU: 80ms usr + 30ms krn ; 0ms fg

        28 starts

    Proc com.android.phone:

        CPU: 39s 770ms usr + 21s 950ms krn ; 0ms fg

        8 starts
    ...
    Apk com.huawei.ims:

        Service com.huawei.ims:

            Created for: 2h 10m 4s 956ms uptime

            Starts: 5, launches: 5

    Apk com.android.phone:

        Service com.android.phone:

            Created for: 2h 10m 4s 945ms uptime

            Starts: 5, launches: 5 


TOTAL wake ウェークロック情報
Total cpu cpu情報
Proc ... 製品情報へ

Apk ...

.............................分析される