Loading core/java/com/android/internal/os/KernelMemoryBandwidthStats.java +8 −0 Original line number Diff line number Diff line package com.android.internal.os; import android.os.StrictMode; import android.os.SystemClock; import android.text.TextUtils; import android.util.LongSparseLongArray; import android.util.Slog; Loading Loading @@ -37,6 +38,8 @@ public class KernelMemoryBandwidthStats { return; } final long startTime = SystemClock.uptimeMillis(); StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads(); try (BufferedReader reader = new BufferedReader(new FileReader(mSysfsFile))) { parseStats(reader); Loading @@ -50,6 +53,11 @@ public class KernelMemoryBandwidthStats { } finally { StrictMode.setThreadPolicy(policy); } final long readTime = SystemClock.uptimeMillis() - startTime; if (DEBUG || readTime > 100) { Slog.w(TAG, "Reading memory bandwidth file took " + readTime + "ms"); } } @VisibleForTesting Loading core/java/com/android/internal/os/KernelWakelockReader.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.os; import android.os.Process; import android.os.SystemClock; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -66,6 +67,7 @@ public class KernelWakelockReader { byte[] buffer = new byte[32*1024]; int len; boolean wakeup_sources; final long startTime = SystemClock.uptimeMillis(); try { FileInputStream is; Loading @@ -90,6 +92,11 @@ public class KernelWakelockReader { return null; } final long readTime = SystemClock.uptimeMillis() - startTime; if (readTime > 100) { Slog.w(TAG, "Reading wakelock stats took " + readTime + "ms"); } if (len > 0) { if (len >= buffer.length) { Slog.wtf(TAG, "Kernel wake locks exceeded buffer size " + buffer.length); Loading Loading
core/java/com/android/internal/os/KernelMemoryBandwidthStats.java +8 −0 Original line number Diff line number Diff line package com.android.internal.os; import android.os.StrictMode; import android.os.SystemClock; import android.text.TextUtils; import android.util.LongSparseLongArray; import android.util.Slog; Loading Loading @@ -37,6 +38,8 @@ public class KernelMemoryBandwidthStats { return; } final long startTime = SystemClock.uptimeMillis(); StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads(); try (BufferedReader reader = new BufferedReader(new FileReader(mSysfsFile))) { parseStats(reader); Loading @@ -50,6 +53,11 @@ public class KernelMemoryBandwidthStats { } finally { StrictMode.setThreadPolicy(policy); } final long readTime = SystemClock.uptimeMillis() - startTime; if (DEBUG || readTime > 100) { Slog.w(TAG, "Reading memory bandwidth file took " + readTime + "ms"); } } @VisibleForTesting Loading
core/java/com/android/internal/os/KernelWakelockReader.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.os; import android.os.Process; import android.os.SystemClock; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -66,6 +67,7 @@ public class KernelWakelockReader { byte[] buffer = new byte[32*1024]; int len; boolean wakeup_sources; final long startTime = SystemClock.uptimeMillis(); try { FileInputStream is; Loading @@ -90,6 +92,11 @@ public class KernelWakelockReader { return null; } final long readTime = SystemClock.uptimeMillis() - startTime; if (readTime > 100) { Slog.w(TAG, "Reading wakelock stats took " + readTime + "ms"); } if (len > 0) { if (len >= buffer.length) { Slog.wtf(TAG, "Kernel wake locks exceeded buffer size " + buffer.length); Loading