History log of /dalvik/tools/dmtracedump/TraceDump.c
Revision Date Author Comments
473aa5c12c7ced74f33ef813ffbfcf596fe2672b 25-Aug-2013 odd.programmer <odd.programmer@gmail.com> Make dmtracedump available on windows pc.

Issue Details:
1.
When dmtracedump is executed on windows pc, command failed.
Error message is "ERROR: unable to read xxxxx bytes from trace file".
This is because trace file is opened in text mode.
2.
When dmtracedump outputs html, #0 method's name isn't "(toplevel)" but "(unknown)".
This is because the positions of (toplevel) and (unknown) in method list interchange on windows pc.
3.
Command of generating png file is invalid for windows.
Command example is "dot -Tpng -o 'foo.png' 'foo.dot'".
When it is executed, it failed.
Error message is "Error: dot: can't open foo.dot.".
This is because command prompt of windows can't open file surrounded by single quotation marks.
4.
dmtracedump failed to create temporary dot file on windows.
This is because temporary dot file is created in "/tmp".
"/tmp" doesn't exist on windows.

Solutions:
1.
Open trace file in binary mode.
2.
In order not to exchange the positoin of (toplevel) and (unknown),
we set the id of (toplevel) to -1 and we set the id of (unknown) to -2.
3.
Replace single qutation marks in command of generating png file to double qutation marks.
4.
Create temporary dot file in current directory.

Change-Id: I2503469fb488fe93cb7a0460ea3fef9b0e139d2d
Signed-off-by: odd.programmer <odd.programmer@gmail.com>
edd7890d3a5356781a9c76f5193749d2eb35a8e8 06-Mar-2013 Elliott Hughes <enh@google.com> Don't crash if the dmtracedump -d file doesn't exist.

Change-Id: Ie4b504b43a8a61d09ca60d68b1a62694391ac223
9f640af99bebc6e96f6e1e9903557e2c8f567483 20-Jul-2011 Jeff Brown <jeffbrown@android.com> Add a dual clock profiler tracing mode.

Dalvik previously supported using either the thread-cpu clock
or the real time clock as the timebase for profiler traces.
This change adds a dual clock mode where both thread-cpu time
and real time timestamps are collected.

Using dual clock mode significantly improves TraceView ability
to accurately reconstruct the global timeline of events,
particularly on SMP systems.

For now, thread-cpu mode remains the default.

Dual clock mode can be enabled by running the following command
and restarting the system server.
adb shell setprop dalvik.vm.extra-opts -Xprofile:dualclock

Change-Id: I14db2ae93325ac01efcc8ed02e8747cc0e834e29
949c3ec207a7720fb47f7b3ca1f84dfcfd70aaa9 25-Jun-2011 Jeff Brown <jeffbrown@google.com> Add a dual clock profiler tracing mode.

Dalvik previously supported using either the thread-cpu clock
or the real time clock as the timebase for profiler traces.
This change adds a dual clock mode where both thread-cpu time
and real time timestamps are collected.

Using dual clock mode significantly improves TraceView ability
to accurately reconstruct the global timeline of events,
particularly on SMP systems.

For now, thread-cpu mode remains the default.

Dual clock mode can be enabled by running the following command
and restarting the system server.
adb shell setprop dalvik.vm.extra-opts -Xprofile:dualclock

Change-Id: I8c0d91a99aa6829dadea328e54dc1225d9827391
291c84f60853d30e1c0d79dd08c5e5164f588e26 26-May-2011 Dan Bornstein <danfuzz@android.com> Prefer printf format "%#x" over "0x%x".

I exist to serve.

Change-Id: I8e2880b20eefd466da8515d5b6b0c5cb75d56169
7b522639a499f63ccb5162576830d0c20539bd05 17-Dec-2010 Andy McFadden <fadden@android.com> Fix dmtracedump.

This rolls back a couple of checkins that were made some time ago. The
dmtracedump tool has largely been broken ever since (only the "-o" mode
worked reliably).

The key feature this removes is "filters". I don't know what they do.

Bug 2643529

Change-Id: I602c96da7a704286715d81d3fb227f490e933fcc
fe1d6d586614fa51d82857e09128d6671be21d56 25-Aug-2010 Andy McFadden <fadden@android.com> Add option for specifying wall-clock in method profiling.

Normally you want to use the per-thread CPU clock rather than the wall
clock, because (a) it's more useful and (b) traceview goes a little nuts
if you don't. However, it's useful for some performance testing.

The command-line option allows you to switch modes like this:

% adb shell stop
% adb shell setprop dalvik.vm.extra-opts -Xprofile:wallclock
% adb shell start

This also changes the somewhat nebulous "clock=global" trace header line
to "clock=wall". Nothing looks at this anyway so I'm not worried
about breaking compatibility.

While I was in here, I fixed a couple of problems caused by failure to
initialize data structures that made dmtracedump crash (yay valgrind).

Bug 2943229.

(cherry-pick from dalvik-dev)

Change-Id: I2f6657f7abe02f2a17784588d922b88397639a47
ea4143449084917fb5ec25b1f3b29a1130284432 25-Aug-2010 Andy McFadden <fadden@android.com> Add option for specifying wall-clock in method profiling.

Normally you want to use the per-thread CPU clock rather than the wall
clock, because (a) it's more useful and (b) traceview goes a little nuts
if you don't. However, it's useful for some performance testing.

The command-line option allows you to switch modes like this:

% adb shell stop
% adb shell setprop dalvik.vm.extra-opts -Xprofile:wallclock
% adb shell start

This also changes the somewhat nebulous "clock=global" trace header line
to "clock=wall". Nothing looks at this anyway so I'm not worried
about breaking compatibility.

While I was in here, I fixed a couple of problems caused by failure to
initialize data structures that made dmtracedump crash (yay valgrind).

Bug 2943229.

Change-Id: Ib8884027c0a7e93044a3284802b176ea991387b5
de75089fb7216d19e9c22cce4dc62a49513477d3 09-Jun-2010 Carl Shapiro <cshapiro@google.com> Remove trailing whitespace.

Change-Id: I95534bb2b88eaf48f2329282041118cd034c812b
769ccf5b59359d54301a3f99d511992e9cc78a45 29-Jan-2010 Jack Veenstra <veenstra@google.com> Fix a couple minor bugs (bug 2404859) in TraceDump.c

1. A switch statement was missing a "break" after option letter "f".
2. The heavily-used function "lookupMethod()" had an expression using mod (%) instead of bitwise-and (&).
f434b16855feb706e6a4b4c7837dbd3c343d1c82 18-Dec-2009 Rodrigo Ipince <ipince@google.com> Added support for filter in dmtracedump tool, along with some test cases.

Some corner cases are still not handled in the code, but will be eventually.
44828ed25841ea5180346695dfc07ef33b2b7e73 29-Jan-2010 Jack Veenstra <veenstra@google.com> Fix a couple minor bugs (bug 2404859) in TraceDump.c

1. A switch statement was missing a "break" after option letter "f".
2. The heavily-used function "lookupMethod()" had an expression using mod (%) instead of bitwise-and (&).
6978d9dd28968b3817533d036ae7b53309053faa 18-Dec-2009 Rodrigo Ipince <ipince@google.com> Added support for filter in dmtracedump tool, along with some test cases.

Some corner cases are still not handled in the code, but will be eventually.
72e93344b4d1ffc71e9c832ec23de0657e5b04a5 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
5b55af706cf3823494123da092a0a0319297a93e 04-Aug-2009 Rodrigo Ipince <ipince@google.com> Added thread profile to dmtracedump output

The thread profile lists all the running threads, sorted by elapsed time.
f6c387128427e121477c1b32ad35cdcaa5101ba3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
f72d5de56a522ac3be03873bdde26f23a5eeeb3c 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
2ad60cfc28e14ee8f0bb038720836a4696c478ad 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution