Quasaur
Quasaur

Reputation: 1365

Android - Eclipse: Trace Files

I have two issues--but first thing's first:
Dell Inspiron M5030: AMD Athlon II P360
Windows 7 Ultimate 32bit SP 1
Android ADT 21.0.1-543035
org.eclipse.platform.ide 3.8.0-I20120608-1200
EMULATOR:
4.0" WVGA (480x800:hdpi)
Android 4.2 (API 17)
armeabi-v7a
RAM:512, VM Heap:16
Internal Storage: 600MB
SDCard Size 128MB, Use Host GPU

In the onCreate of my activity i have these lines:

super.onCreate(savedInstanceState);
if (BuildConfig.DEBUG) {
        Log.i(Constants.TAG_ACTSPLASH, "onCreate() Method called.");
        Debug.startMethodTracing("actsplash");
}

In the onDestroy of my activity i have these lines:

super.onDestroy();
    if (BuildConfig.DEBUG) {
            Log.i(Constants.TAG_ACTSPLASH, "onDestroy()");
            Debug.stopMethodTracing();
    }

PROBLEM NUMBER ONE: In debug mode, after onCreate is called, Logcat says:

davlikvm: Unable to open trace file '/mnt/sdcard/actsplash.trace': Permission denied

NOTE: when running the apk on my Epic4G (Android 4.2) the trace file is created.

PROBLEM NUMBER TWO: The tracefile extracted from the Epic4G can't be processed. (1) When running traceview I get the error:

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

(2) When running ADM ('%SDK%/tools/monitor.bat') and loading the trace file i get:

Failed to read the stack trace.

This article says something about a key file...is that what's missing? Any help would be appreciated!

Upvotes: 3

Views: 2210

Answers (3)

happlebao
happlebao

Reputation: 306

For problem number 2: Traceview can't resolve relative paths. I had to specify the full path to the tracefile (still using only the basename) starting with "C:/"

http://www.talkandroid.com/android-forums/android-games-applications/509-traceview-cant-find-trace-file.html

Upvotes: 0

Quasaur
Quasaur

Reputation: 1365

The problem seems to be with the 4.2 emulator; the 4.1 emulator processed the trace file and (unlike the 4.2 emulator) allowed me to pull the file and load it in ADM (Android Debug Monitor).

Upvotes: 0

fadden
fadden

Reputation: 52313

The first problem can be fixed by adding the WRITE_EXTERNAL_STORAGE permission to your app, so that it can write to /sdcard. Alternatively, explicitly specify a filename for the trace file in your private app data storage area, and pull the file from there.

The second problem is "trace file not found", which is a direct result of the first. The third problem appears to be a variation of the second.

The trace file itself used to be split into "key" and "data" files, but those were combined into a single .trace file a long time ago.

Upvotes: 2

Related Questions