diff options
author | Feng Qian <fqian@google.com> | 2009-08-17 23:22:06 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-08-17 23:26:55 -0700 |
commit | 86a5ca9e73301722e0a4917dc43b19dc61cac571 (patch) | |
tree | e9e4c694c9b7e0d049da07b442897a1ac950181a /WebKit | |
parent | e631646ae9030296d7c00c2298031aa01040351d (diff) | |
download | external_webkit-86a5ca9e73301722e0a4917dc43b19dc61cac571.zip external_webkit-86a5ca9e73301722e0a4917dc43b19dc61cac571.tar.gz external_webkit-86a5ca9e73301722e0a4917dc43b19dc61cac571.tar.bz2 |
Add re-entry count for QemuTracerAuto class.
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/TimeCounter.cpp | 2 | ||||
-rw-r--r-- | WebKit/android/TimeCounter.h | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/WebKit/android/TimeCounter.cpp b/WebKit/android/TimeCounter.cpp index 5f69cf6..7abc113 100644 --- a/WebKit/android/TimeCounter.cpp +++ b/WebKit/android/TimeCounter.cpp @@ -65,6 +65,8 @@ uint32_t TimeCounter::sCounter[TimeCounter::TotalTimeCounterCount]; uint32_t TimeCounter::sLastCounter[TimeCounter::TotalTimeCounterCount]; uint32_t TimeCounter::sStartTime[TimeCounter::TotalTimeCounterCount]; +int QemuTracerAuto::reentry_count = 0; + static const char* timeCounterNames[] = { "css parsing", "javascript", diff --git a/WebKit/android/TimeCounter.h b/WebKit/android/TimeCounter.h index 47e681b..29c3eb9 100644 --- a/WebKit/android/TimeCounter.h +++ b/WebKit/android/TimeCounter.h @@ -98,8 +98,19 @@ private: class QemuTracerAuto { public: - QemuTracerAuto() { qemu_start_tracing(); } - ~QemuTracerAuto() { qemu_stop_tracing(); } + QemuTracerAuto() { + if (!reentry_count) + qemu_start_tracing(); + reentry_count++; + } + + ~QemuTracerAuto() { + reentry_count--; + if (!reentry_count) + qemu_stop_tracing(); + } +private: + static int reentry_count; }; } |