summaryrefslogtreecommitdiffstats
path: root/vm/Globals.h
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-06-24 17:05:33 -0700
committerJeff Brown <jeffbrown@google.com>2011-06-27 17:24:36 -0700
commit949c3ec207a7720fb47f7b3ca1f84dfcfd70aaa9 (patch)
tree5d9bbfd7cf1c062dcaf59a34d47c32dcdb2a687a /vm/Globals.h
parent585536275618a37d6e91393ec2b82e8b98632656 (diff)
downloadandroid_dalvik-949c3ec207a7720fb47f7b3ca1f84dfcfd70aaa9.tar.gz
android_dalvik-949c3ec207a7720fb47f7b3ca1f84dfcfd70aaa9.tar.bz2
android_dalvik-949c3ec207a7720fb47f7b3ca1f84dfcfd70aaa9.zip
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
Diffstat (limited to 'vm/Globals.h')
-rw-r--r--vm/Globals.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/vm/Globals.h b/vm/Globals.h
index bf92781ef..fcb6b29b8 100644
--- a/vm/Globals.h
+++ b/vm/Globals.h
@@ -67,6 +67,15 @@ enum RegisterMapMode {
};
/*
+ * Profiler clock source.
+ */
+enum ProfilerClockSource {
+ kProfilerClockSourceThreadCpu,
+ kProfilerClockSourceWall,
+ kProfilerClockSourceDual,
+};
+
+/*
* All fields are initialized to zero.
*
* Storage allocated here must be freed by a subsystem shutdown function.
@@ -96,8 +105,7 @@ struct DvmGlobals {
int jdwpPort;
bool jdwpSuspend;
- /* use wall clock as method profiler clock source? */
- bool profilerWallClock;
+ ProfilerClockSource profilerClockSource;
/*
* Lock profiling threshold value in milliseconds. Acquires that