Running Android systrace on device

拜拜、爱过 提交于 2019-11-30 20:23:38

问题


I'm unable to run the Android SDK tool called systrace.pl because I get errors like:

error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory 

And indeed the /sys/kernel/debug/tracing directory doesn't even exist.

A little research showed I need to enable debugfs with the following command:

mount -o rw,remount -t debugfs none /sys/kernel/debug

Running mount there afterwards indicates the debugfs is running:

#mount
...
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
...

And I have trace enabled (all items) in the developer settings menu. I'm using the stock ROM 4.1.1 on a Samsung Galaxy S3.

There's a lot of articles out there on systrace for Android but nothing seems to solve the problem of no files actually being generated in /sys/kernel/debug/tracing...


回答1:


Take a look at this document:

Tracing on Android 4.3 and higher

To run a trace on Android 4.3 and higher devices:

Make sure the device is connected through a USB cable and is enabled for debugging.

I think that systrace must be run on a device, not an emulator. I'm getting the same error in my emulator.




回答2:


Answered the same question below:

Make Systrace work with 4.1.2 device on Mac

Looks like your systrace is not enabled on the kernel your device is running, you need to replace your boot.img with one that has systrace support.




回答3:


You don't have access to that categories that you have selected.

use following command to check what all categories that current device can support.

$python systrace.py -l 

     gfx - Graphics
   input - Input
    view - View System
 webview - WebView
      wm - Window Manager
      am - Activity Manager
      sm - Sync Manager
   audio - Audio
   video - Video
  camera - Camera
     hal - Hardware Modules
     app - Application
     res - Resource Loading
  dalvik - Dalvik VM
      rs - RenderScript
  bionic - Bionic C Library
   power - Power Management

root and remount the device before running above command.

adb root
adb remount


来源:https://stackoverflow.com/questions/17207841/running-android-systrace-on-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!