summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
index 977a8a05d6f3..64dbc50b8dd2 100644
--- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
+++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
@@ -398,14 +398,17 @@ public final class ProfcollectForwardingService extends SystemService {
if (randomNum >= traceFrequency) {
return;
}
- // Wait for 1s before starting tracing.
+ // For a small percentage a traces, we collect the initialization behavior.
+ boolean traceInitialization = ThreadLocalRandom.current().nextInt(10) < 1;
+ int traceDelay = traceInitialization ? 0 : 1000;
+ String traceTag = traceInitialization ? "camera_init" : "camera";
BackgroundThread.get().getThreadHandler().postDelayed(() -> {
try {
- mIProfcollect.trace_once("camera");
+ mIProfcollect.trace_once(traceTag);
} catch (RemoteException e) {
Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage());
}
- }, 1000);
+ }, traceDelay);
}
}, null);
}