diff options
author | boliu <boliu@chromium.org> | 2014-12-15 08:03:30 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-15 16:03:47 +0000 |
commit | 8e5c0b0f824d35e369d5db10f0c131d12b5e95a3 (patch) | |
tree | 420f62bd7c41ebf040507a01b2da9413c20c2a6e /base | |
parent | 72e9ec8981e90a0d75ece2b861520cfbdbbdff7f (diff) | |
download | chromium_src-8e5c0b0f824d35e369d5db10f0c131d12b5e95a3.zip chromium_src-8e5c0b0f824d35e369d5db10f0c131d12b5e95a3.tar.gz chromium_src-8e5c0b0f824d35e369d5db10f0c131d12b5e95a3.tar.bz2 |
android: Remove TraceEvent.begin()/end()
All callers have been moved to onens with explicit event names. Removing
the expensive dumping stack implemntation.
BUG=439118
Review URL: https://codereview.chromium.org/803603002
Cr-Commit-Position: refs/heads/master@{#308356}
Diffstat (limited to 'base')
-rw-r--r-- | base/android/java/src/org/chromium/base/TraceEvent.java | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/base/android/java/src/org/chromium/base/TraceEvent.java b/base/android/java/src/org/chromium/base/TraceEvent.java index 5611f57..4721b25 100644 --- a/base/android/java/src/org/chromium/base/TraceEvent.java +++ b/base/android/java/src/org/chromium/base/TraceEvent.java @@ -239,19 +239,6 @@ public class TraceEvent { } /** - * Convenience wrapper around the versions of begin() that take string parameters. - * The name of the event will be derived from the class and function name that call this. - * IMPORTANT: if using this version, ensure end() (no parameters) is always called from the - * same calling context. - * - * Note that the overhead is at ms or sub-ms order. Don't use this when millisecond accuracy - * is desired. - */ - public static void begin() { - if (sEnabled) nativeBegin(getCallerName(), null); - } - - /** * Triggers the 'begin' native trace event with no arguments. * @param name The name of the event. */ @@ -269,14 +256,6 @@ public class TraceEvent { } /** - * Convenience wrapper around the versions of end() that take string parameters. - * @see #begin() - */ - public static void end() { - if (sEnabled) nativeEnd(getCallerName(), null); - } - - /** * Triggers the 'end' native trace event with no arguments. * @param name The name of the event. */ @@ -293,21 +272,6 @@ public class TraceEvent { if (sEnabled) nativeEnd(name, arg); } - private static String getCallerName() { - // This was measured to take about 1ms on Trygon device. - StackTraceElement[] stack = java.lang.Thread.currentThread().getStackTrace(); - - // Commented out to avoid excess call overhead, but these lines can be useful to debug - // exactly where the TraceEvent's client is on the callstack. - // int index = 0; - // while (!stack[index].getClassName().equals(TraceEvent.class.getName())) ++index; - // while (stack[index].getClassName().equals(TraceEvent.class.getName())) ++index; - // System.logW("TraceEvent caller is at stack index " + index); - - // '4' Was derived using the above commented out code snippet. - return stack[4].getClassName() + "." + stack[4].getMethodName(); - } - private static native void nativeRegisterEnabledObserver(); private static native void nativeStartATrace(); private static native void nativeStopATrace(); |