6

I want to see my traces.

1- In code, I have added these lines of code:

// Start trace recording
android.os.Debug.startMethodTracing("hc_traceview");

and

// Stop trace recording
android.os.Debug.stopMethodTracing();

2- I can see "hc_traceview.terac" in file explorer of DDMS.

3- Based on Viewing Trace Files in Traceview, I ran following command in terminal:

@hesam-K5VD:~/Desktop/Eclipse/sdk/tools$ traceview /mnt/sdcard/hc_traceview

But out put is:

The standalone version of traceview is deprecated.
Please use Android Device Monitor (tools/monitor) instead.
trace file '/mnt/sdcard/hc_traceview' not found

4- Based on suggestion, I ran following command in terminal:

@hesam-K5VD:~/Desktop/Eclipse/sdk/tools$ monitor /mnt/sdcard/hc_traceview

DDMS opened but my traces are not here :( How can I see my traces?

Any suggestion would be appreciated.

Hesam
  • 52,260
  • 74
  • 224
  • 365

4 Answers4

9

Please take a look here : DDMS

The page says you can start and stop method profiling inside DDMS view like this:

  • Launch your app from eclipse in debugging mode.
  • Go to DDMS View
  • In devices window there is a small button called Start Method Profiling
  • Click it when you want ( you can combine it with break points to get accurate start/end)
  • when you're done click Stop Method Profiling
  • A new window in DDMS will appear similer to traceview with the same output.
dcanh121
  • 4,665
  • 11
  • 37
  • 84
Mr.Me
  • 9,192
  • 5
  • 39
  • 51
  • 4
    Thanks Mr.Me, You are right. This is another way which is not accurate . I temporary solved my problem with pulling that file from device to my desktop and opening that .trace file through File/open of DDMS. – Hesam Feb 14 '13 at 10:20
6

You should pull the trace out of the sdcard as follows:

cd your sdk/platform-tools
$ adb pull /sdcard/hc_traceview.trace
open the monitor (double click monitor.bat in sdk/tools). click "Open File..." and select the hc_traceview.trace from the sdk/platform-tools folder. You should now have clean view of your trace. If any problem appear, please comment here.

user2558461
  • 281
  • 1
  • 6
  • 21
2

After the DDMS opened, you have to click on the File menu and select "Open File...", then select the trace file generated in the before step, all the trace info will be displayed.

Ryan
  • 46
  • 2
-1

Pull the trace file out from the sdcard

$ adb pull /sdcard/

Then call,

$ traceview /

Note: Please mention .trace at the end of the traceview file name while calling traceview command

Look here for more information

PavanBhushan
  • 106
  • 2
  • 8