Loading core/java/android/content/ContentResolver.java +3 −0 Original line number Diff line number Diff line Loading @@ -220,6 +220,7 @@ public abstract class ContentResolver { // Always log queries which take 500ms+; shorter queries are // sampled accordingly. private static final boolean ENABLE_CONTENT_SAMPLE = false; private static final int SLOW_THRESHOLD_MILLIS = 500; private final Random mRandom = new Random(); // guarded by itself Loading Loading @@ -1832,6 +1833,7 @@ public abstract class ContentResolver { private void maybeLogQueryToEventLog(long durationMillis, Uri uri, String[] projection, String selection, String sortOrder) { if (!ENABLE_CONTENT_SAMPLE) return; int samplePercent = samplePercentForDuration(durationMillis); if (samplePercent < 100) { synchronized (mRandom) { Loading Loading @@ -1871,6 +1873,7 @@ public abstract class ContentResolver { private void maybeLogUpdateToEventLog( long durationMillis, Uri uri, String operation, String selection) { if (!ENABLE_CONTENT_SAMPLE) return; int samplePercent = samplePercentForDuration(durationMillis); if (samplePercent < 100) { synchronized (mRandom) { Loading core/jni/android_util_Binder.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -986,6 +986,7 @@ static bool push_eventlog_int(char** pos, const char* end, jint val) { } // From frameworks/base/core/java/android/content/EventLogTags.logtags: #define ENABLE_BINDER_SAMPLE 0 #define LOGTAG_BINDER_OPERATION 52004 static void conditionally_log_binder_call(int64_t start_millis, Loading Loading @@ -1063,6 +1064,7 @@ static jboolean android_os_BinderProxy_transact(JNIEnv* env, jobject obj, ALOGV("Java code calling transact on %p in Java object %p with code %d\n", target, obj, code); #if ENABLE_BINDER_SAMPLE // Only log the binder call duration for things on the Java-level main thread. // But if we don't const bool time_binder_calls = should_time_binder_calls(); Loading @@ -1071,12 +1073,15 @@ static jboolean android_os_BinderProxy_transact(JNIEnv* env, jobject obj, if (time_binder_calls) { start_millis = uptimeMillis(); } #endif //printf("Transact from Java code to %p sending: ", target); data->print(); status_t err = target->transact(code, *data, reply, flags); //if (reply) printf("Transact from Java code to %p received: ", target); reply->print(); #if ENABLE_BINDER_SAMPLE if (time_binder_calls) { conditionally_log_binder_call(start_millis, target, code); } #endif if (err == NO_ERROR) { return JNI_TRUE; Loading Loading
core/java/android/content/ContentResolver.java +3 −0 Original line number Diff line number Diff line Loading @@ -220,6 +220,7 @@ public abstract class ContentResolver { // Always log queries which take 500ms+; shorter queries are // sampled accordingly. private static final boolean ENABLE_CONTENT_SAMPLE = false; private static final int SLOW_THRESHOLD_MILLIS = 500; private final Random mRandom = new Random(); // guarded by itself Loading Loading @@ -1832,6 +1833,7 @@ public abstract class ContentResolver { private void maybeLogQueryToEventLog(long durationMillis, Uri uri, String[] projection, String selection, String sortOrder) { if (!ENABLE_CONTENT_SAMPLE) return; int samplePercent = samplePercentForDuration(durationMillis); if (samplePercent < 100) { synchronized (mRandom) { Loading Loading @@ -1871,6 +1873,7 @@ public abstract class ContentResolver { private void maybeLogUpdateToEventLog( long durationMillis, Uri uri, String operation, String selection) { if (!ENABLE_CONTENT_SAMPLE) return; int samplePercent = samplePercentForDuration(durationMillis); if (samplePercent < 100) { synchronized (mRandom) { Loading
core/jni/android_util_Binder.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -986,6 +986,7 @@ static bool push_eventlog_int(char** pos, const char* end, jint val) { } // From frameworks/base/core/java/android/content/EventLogTags.logtags: #define ENABLE_BINDER_SAMPLE 0 #define LOGTAG_BINDER_OPERATION 52004 static void conditionally_log_binder_call(int64_t start_millis, Loading Loading @@ -1063,6 +1064,7 @@ static jboolean android_os_BinderProxy_transact(JNIEnv* env, jobject obj, ALOGV("Java code calling transact on %p in Java object %p with code %d\n", target, obj, code); #if ENABLE_BINDER_SAMPLE // Only log the binder call duration for things on the Java-level main thread. // But if we don't const bool time_binder_calls = should_time_binder_calls(); Loading @@ -1071,12 +1073,15 @@ static jboolean android_os_BinderProxy_transact(JNIEnv* env, jobject obj, if (time_binder_calls) { start_millis = uptimeMillis(); } #endif //printf("Transact from Java code to %p sending: ", target); data->print(); status_t err = target->transact(code, *data, reply, flags); //if (reply) printf("Transact from Java code to %p received: ", target); reply->print(); #if ENABLE_BINDER_SAMPLE if (time_binder_calls) { conditionally_log_binder_call(start_millis, target, code); } #endif if (err == NO_ERROR) { return JNI_TRUE; Loading