summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-10-14 16:55:09 -0700
committerDianne Hackborn <hackbod@google.com>2013-10-14 17:15:40 -0700
commit878deb3c7b33a0c508137143c776e07bab0296cf (patch)
tree22f09fb67d0450d2e3b2dec204f0dedccc9ef2db /core/java/android
parentb5da7b23df5278a5e722b601eb8ef7e98537a51e (diff)
Fix issue #11223335: APR: Lots of failures in procstats due to...
...bad cleanup of crashing processes We now have a special path for crashing processes, to silently clean up their state. Also some tweaks to Log/Slog.wtf to get better stack crawl summaries in APR. Change-Id: Ieced26989907a6e7615b6fa033813fced78d7474
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/util/Log.java19
-rw-r--r--core/java/android/util/Slog.java8
2 files changed, 11 insertions, 16 deletions
diff --git a/core/java/android/util/Log.java b/core/java/android/util/Log.java
index 8c1cf5fec8a1..abd173a50721 100644
--- a/core/java/android/util/Log.java
+++ b/core/java/android/util/Log.java
@@ -253,7 +253,7 @@ public final class Log {
* @param msg The message you would like logged.
*/
public static int wtf(String tag, String msg) {
- return wtf(tag, msg, null);
+ return wtf(LOG_ID_MAIN, tag, msg, null, false);
}
/**
@@ -262,7 +262,7 @@ public final class Log {
* @hide
*/
public static int wtfStack(String tag, String msg) {
- return wtfStack(LOG_ID_MAIN, tag, msg);
+ return wtf(LOG_ID_MAIN, tag, msg, null, true);
}
/**
@@ -272,7 +272,7 @@ public final class Log {
* @param tr An exception to log.
*/
public static int wtf(String tag, Throwable tr) {
- return wtf(tag, tr.getMessage(), tr);
+ return wtf(LOG_ID_MAIN, tag, tr.getMessage(), tr, false);
}
/**
@@ -283,18 +283,13 @@ public final class Log {
* @param tr An exception to log. May be null.
*/
public static int wtf(String tag, String msg, Throwable tr) {
- return wtf(LOG_ID_MAIN, tag, msg, tr);
+ return wtf(LOG_ID_MAIN, tag, msg, tr, false);
}
- static int wtfStack(int logId, String tag, String msg) {
- TerribleFailure here = new TerribleFailure("here", null);
- here.fillInStackTrace();
- return wtf(logId, tag, msg, here);
- }
-
- static int wtf(int logId, String tag, String msg, Throwable tr) {
+ static int wtf(int logId, String tag, String msg, Throwable tr, boolean localStack) {
TerribleFailure what = new TerribleFailure(msg, tr);
- int bytes = println_native(logId, ASSERT, tag, msg + '\n' + getStackTraceString(tr));
+ int bytes = println_native(logId, ASSERT, tag, msg + '\n'
+ + getStackTraceString(localStack ? what : tr));
sWtfHandler.onTerribleFailure(tag, what);
return bytes;
}
diff --git a/core/java/android/util/Slog.java b/core/java/android/util/Slog.java
index a5c22ffbacd1..70795bbc43c0 100644
--- a/core/java/android/util/Slog.java
+++ b/core/java/android/util/Slog.java
@@ -79,19 +79,19 @@ public final class Slog {
}
public static int wtf(String tag, String msg) {
- return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null);
+ return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null, false);
}
public static int wtfStack(String tag, String msg) {
- return Log.wtfStack(Log.LOG_ID_SYSTEM, tag, msg);
+ return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null, true);
}
public static int wtf(String tag, Throwable tr) {
- return Log.wtf(Log.LOG_ID_SYSTEM, tag, tr.getMessage(), tr);
+ return Log.wtf(Log.LOG_ID_SYSTEM, tag, tr.getMessage(), tr, false);
}
public static int wtf(String tag, String msg, Throwable tr) {
- return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, tr);
+ return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, tr, false);
}
public static int println(int priority, String tag, String msg) {