Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -18371,6 +18371,7 @@ package android.os { method public static void startMethodTracing(java.lang.String); method public static void startMethodTracing(java.lang.String, int); method public static void startMethodTracing(java.lang.String, int, int); method public static void startMethodTracingSampling(java.lang.String, int, int); method public static void startNativeTracing(); method public static deprecated void stopAllocCounting(); method public static void stopMethodTracing(); core/java/android/os/Debug.java +41 −13 Original line number Diff line number Diff line Loading @@ -576,7 +576,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * tracing. */ public static void startMethodTracing() { VMDebug.startMethodTracing(DEFAULT_TRACE_FILE_PATH, 0, 0); VMDebug.startMethodTracing(DEFAULT_TRACE_FILE_PATH, 0, 0, false, 0); } /** Loading @@ -587,7 +587,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * information about reading trace files. * * @param traceName Name for the trace log file to create. * If no name argument is given, this value defaults to "/sdcard/dmtrace.trace". * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. */ Loading @@ -602,7 +602,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Log Viewer</a> for * information about reading trace files. * @param traceName Name for the trace log file to create. * If no name argument is given, this value defaults to "/sdcard/dmtrace.trace". * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. * Loading @@ -625,26 +625,54 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * in relative terms (e.g. was run #1 faster than run #2). The times * for native methods will not change, so don't try to use this to * compare the performance of interpreted and native implementations of the * same method. As an alternative, consider using "native" tracing * in the emulator via {@link #startNativeTracing()}. * same method. As an alternative, consider using sampling-based method * tracing via {@link #startMethodTracingSampling(String, int, int)} or * "native" tracing in the emulator via {@link #startNativeTracing()}. * </p> * * @param traceName Name for the trace log file to create. * If no name argument is given, this value defaults to "/sdcard/dmtrace.trace". * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. * @param bufferSize The maximum amount of trace data we gather. If not given, it defaults to 8MB. * @param flags Flags to control method tracing. The only one that is currently defined is {@link #TRACE_COUNT_ALLOCS}. */ public static void startMethodTracing(String traceName, int bufferSize, int flags) { VMDebug.startMethodTracing(fixTraceName(traceName), bufferSize, flags, false, 0); } /** * Start sampling-based method tracing, specifying the trace log file name, * the buffer size, and the sampling interval. The trace files will be put * under "/sdcard" unless an absolute path is given. See <a href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Log Viewer</a> * for information about reading trace files. * * @param traceName Name for the trace log file to create. * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. * @param bufferSize The maximum amount of trace data we gather. If not given, it defaults to 8MB. * @param intervalUs The amount of time between each sample in microseconds. */ public static void startMethodTracingSampling(String traceName, int bufferSize, int intervalUs) { VMDebug.startMethodTracing(fixTraceName(traceName), bufferSize, 0, true, intervalUs); } String pathName = traceName; if (pathName.charAt(0) != '/') pathName = DEFAULT_TRACE_PATH_PREFIX + pathName; if (!pathName.endsWith(DEFAULT_TRACE_EXTENSION)) pathName = pathName + DEFAULT_TRACE_EXTENSION; /** * Formats name of trace log file for method tracing. */ private static String fixTraceName(String traceName) { if (traceName == null) traceName = DEFAULT_TRACE_FILE_PATH; if (traceName.charAt(0) != '/') traceName = DEFAULT_TRACE_PATH_PREFIX + traceName; if (!traceName.endsWith(DEFAULT_TRACE_EXTENSION)) traceName = traceName + DEFAULT_TRACE_EXTENSION; VMDebug.startMethodTracing(pathName, bufferSize, flags); return traceName; } /** Loading @@ -658,7 +686,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo */ public static void startMethodTracing(String traceName, FileDescriptor fd, int bufferSize, int flags) { VMDebug.startMethodTracing(traceName, fd, bufferSize, flags); VMDebug.startMethodTracing(traceName, fd, bufferSize, flags, false, 0); } /** Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -18371,6 +18371,7 @@ package android.os { method public static void startMethodTracing(java.lang.String); method public static void startMethodTracing(java.lang.String, int); method public static void startMethodTracing(java.lang.String, int, int); method public static void startMethodTracingSampling(java.lang.String, int, int); method public static void startNativeTracing(); method public static deprecated void stopAllocCounting(); method public static void stopMethodTracing();
core/java/android/os/Debug.java +41 −13 Original line number Diff line number Diff line Loading @@ -576,7 +576,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * tracing. */ public static void startMethodTracing() { VMDebug.startMethodTracing(DEFAULT_TRACE_FILE_PATH, 0, 0); VMDebug.startMethodTracing(DEFAULT_TRACE_FILE_PATH, 0, 0, false, 0); } /** Loading @@ -587,7 +587,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * information about reading trace files. * * @param traceName Name for the trace log file to create. * If no name argument is given, this value defaults to "/sdcard/dmtrace.trace". * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. */ Loading @@ -602,7 +602,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Log Viewer</a> for * information about reading trace files. * @param traceName Name for the trace log file to create. * If no name argument is given, this value defaults to "/sdcard/dmtrace.trace". * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. * Loading @@ -625,26 +625,54 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo * in relative terms (e.g. was run #1 faster than run #2). The times * for native methods will not change, so don't try to use this to * compare the performance of interpreted and native implementations of the * same method. As an alternative, consider using "native" tracing * in the emulator via {@link #startNativeTracing()}. * same method. As an alternative, consider using sampling-based method * tracing via {@link #startMethodTracingSampling(String, int, int)} or * "native" tracing in the emulator via {@link #startNativeTracing()}. * </p> * * @param traceName Name for the trace log file to create. * If no name argument is given, this value defaults to "/sdcard/dmtrace.trace". * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. * @param bufferSize The maximum amount of trace data we gather. If not given, it defaults to 8MB. * @param flags Flags to control method tracing. The only one that is currently defined is {@link #TRACE_COUNT_ALLOCS}. */ public static void startMethodTracing(String traceName, int bufferSize, int flags) { VMDebug.startMethodTracing(fixTraceName(traceName), bufferSize, flags, false, 0); } /** * Start sampling-based method tracing, specifying the trace log file name, * the buffer size, and the sampling interval. The trace files will be put * under "/sdcard" unless an absolute path is given. See <a href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Log Viewer</a> * for information about reading trace files. * * @param traceName Name for the trace log file to create. * If {@code traceName} is null, this value defaults to "/sdcard/dmtrace.trace". * If the files already exist, they will be truncated. * If the trace file given does not end in ".trace", it will be appended for you. * @param bufferSize The maximum amount of trace data we gather. If not given, it defaults to 8MB. * @param intervalUs The amount of time between each sample in microseconds. */ public static void startMethodTracingSampling(String traceName, int bufferSize, int intervalUs) { VMDebug.startMethodTracing(fixTraceName(traceName), bufferSize, 0, true, intervalUs); } String pathName = traceName; if (pathName.charAt(0) != '/') pathName = DEFAULT_TRACE_PATH_PREFIX + pathName; if (!pathName.endsWith(DEFAULT_TRACE_EXTENSION)) pathName = pathName + DEFAULT_TRACE_EXTENSION; /** * Formats name of trace log file for method tracing. */ private static String fixTraceName(String traceName) { if (traceName == null) traceName = DEFAULT_TRACE_FILE_PATH; if (traceName.charAt(0) != '/') traceName = DEFAULT_TRACE_PATH_PREFIX + traceName; if (!traceName.endsWith(DEFAULT_TRACE_EXTENSION)) traceName = traceName + DEFAULT_TRACE_EXTENSION; VMDebug.startMethodTracing(pathName, bufferSize, flags); return traceName; } /** Loading @@ -658,7 +686,7 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo */ public static void startMethodTracing(String traceName, FileDescriptor fd, int bufferSize, int flags) { VMDebug.startMethodTracing(traceName, fd, bufferSize, flags); VMDebug.startMethodTracing(traceName, fd, bufferSize, flags, false, 0); } /** Loading