Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: base/android/java/src/org/chromium/base/TraceEvent.java

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/java/src/org/chromium/base/SysUtils.java ('k') | base/base_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/TraceEvent.java
diff --git a/base/android/java/src/org/chromium/base/TraceEvent.java b/base/android/java/src/org/chromium/base/TraceEvent.java
index 5611f57ac6d0c9407577538962cb5357baa88040..4721b254d422b69a44a4b6404b6f7fac8724f1d6 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();
« no previous file with comments | « base/android/java/src/org/chromium/base/SysUtils.java ('k') | base/base_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698