summaryrefslogtreecommitdiffstats
path: root/core/java/android/os
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-06-23 19:22:52 -0700
committerDianne Hackborn <hackbod@google.com>2009-06-24 16:23:14 -0700
commit9c8dd55a9d829c29a3feee9469d8c2f27a9f5516 (patch)
treedeb1f95fbdc6972bf1d50fffb79ef2c74731314b /core/java/android/os
parent0bc7b8490b1575bb8266a3b0c6652d4f460fcda1 (diff)
downloadframeworks_base-9c8dd55a9d829c29a3feee9469d8c2f27a9f5516.zip
frameworks_base-9c8dd55a9d829c29a3feee9469d8c2f27a9f5516.tar.gz
frameworks_base-9c8dd55a9d829c29a3feee9469d8c2f27a9f5516.tar.bz2
Fix bug 1829561 ("am profile" with bad filename kills process).
The am command is now the one that takes care of opening the target file, handling the opened file descriptor to the process that will be profiled. This allows you to send profile data to anywhere the shell can access, and avoids any problems coming up from the target process trying to open the file.
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/Debug.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index 8fcb4d7..d40ea6b 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -21,6 +21,7 @@ import com.android.internal.util.TypedProperties;
import android.util.Config;
import android.util.Log;
+import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
@@ -378,6 +379,20 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
}
/**
+ * 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 void startMethodTracing(String traceName, FileDescriptor fd,
+ int bufferSize, int flags) {
+ VMDebug.startMethodTracing(traceName, fd, bufferSize, flags);
+ }
+
+ /**
* Determine whether method tracing is currently active.
* @hide
*/