4

I am trying to use traceview to run some profiling against an Android application. I have wrapped the code that I want to trace with the following lines:

Debug.startMethodTracing("xxx");
// code
Debug.stopMethodTracing();

It successfully generated a trace file, that I pulled from sdcard using the following command line:

./adb pull /sdcard/xxx.trace

However when running traceview like this:

./traceview /.../xxx.trace

I am getting the following error message:

Usage: java com.android.traceview.MainWindow [-r] trace -r regression only

I cannot understand this error message and I didn't find anything useful on Google.

Any help would be much appreciated.

Thanks!

Amokrane Chentir
  • 29,907
  • 37
  • 114
  • 158
  • 1
    I haven't used Traceview from the command line. If you're an Eclipse user, you can open the trace from Eclipse and bring it up in the Eclipse edition of Traceview. – CommonsWare Sep 17 '11 at 00:26

1 Answers1

1

make sure that Debug class you imported is this one : android.os.Debug

or do this :

android.os.Debug.startMethodTracing("xxx");
android.os.Debug.stopMethodTracing();
Mouna Cheikhna
  • 38,870
  • 10
  • 48
  • 69