summaryrefslogtreecommitdiffstats
path: root/dalvik/src
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-06-23 19:21:10 -0700
committerDianne Hackborn <hackbod@google.com>2009-06-24 15:08:56 -0700
commit8205fe4fab4a269a27414009b684595dcec31f4d (patch)
treec63f3ab6d46c9f4eb859719fe6060daa5ebb157b /dalvik/src
parent4127a2fdb3c5c0afdf6eb1f538cd6800786829a2 (diff)
downloadlibcore-8205fe4fab4a269a27414009b684595dcec31f4d.zip
libcore-8205fe4fab4a269a27414009b684595dcec31f4d.tar.gz
libcore-8205fe4fab4a269a27414009b684595dcec31f4d.tar.bz2
Add FileDescriptor variation of startMethodTracing().
This is for bug #1829561 ("am profile" with bad filename kills process), which will allow the am command to take care of opening the file and handing the resulting fd over to the process to be profiled.
Diffstat (limited to 'dalvik/src')
-rw-r--r--dalvik/src/main/java/dalvik/system/VMDebug.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/dalvik/src/main/java/dalvik/system/VMDebug.java b/dalvik/src/main/java/dalvik/system/VMDebug.java
index d9f11ce..efc25d6 100644
--- a/dalvik/src/main/java/dalvik/system/VMDebug.java
+++ b/dalvik/src/main/java/dalvik/system/VMDebug.java
@@ -16,6 +16,7 @@
package dalvik.system;
+import java.io.FileDescriptor;
import java.io.IOException;
/**
@@ -149,8 +150,22 @@ public final class VMDebug {
* @param flags flags to control method tracing. The only one that
* is currently defined is {@link #TRACE_COUNT_ALLOCS}.
*/
+ public static void startMethodTracing(String traceFileName,
+ int bufferSize, int flags) {
+ startMethodTracing(traceFileName, null, bufferSize, flags);
+ }
+
+ /**
+ * Like startMethodTracing(String, int, int), but taking an already-opened
+ * FileDescriptor in which the trace is written. The file name is also
+ * supplied simply for logging. Makes a dup of the file descriptor.
+ *
+ * Not exposed in the SDK unless we are really comfortable with supporting
+ * this and find it would be useful.
+ * @hide
+ */
public static native void startMethodTracing(String traceFileName,
- int bufferSize, int flags);
+ FileDescriptor fd, int bufferSize, int flags);
/**
* Determine whether method tracing is currently active.