Loading services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +3 −3 Original line number Diff line number Diff line Loading @@ -291,7 +291,7 @@ public final class ProfcollectForwardingService extends SystemService { "collection_interval", 600); mScheduledExecutorService.scheduleWithFixedDelay(() -> { if (sIProfcollect != null) { Utils.traceSystem(sIProfcollect, "periodic"); Utils.traceSystem(sIProfcollect, "periodic", /* durationMs */ 0); } }, 0, interval, TimeUnit.SECONDS); // Background process and upload service. Loading Loading @@ -373,7 +373,7 @@ public final class ProfcollectForwardingService extends SystemService { @Override public void onIntentStarted(Intent intent, long timestampNanos) { if (Utils.withFrequency("applaunch_trace_freq", 5)) { Utils.traceSystem(sIProfcollect, "applaunch"); Utils.traceSystem(sIProfcollect, "applaunch", /* durationMs */ 0); } } } Loading @@ -393,7 +393,7 @@ public final class ProfcollectForwardingService extends SystemService { private void traceOnDex2oatStart() { if (Utils.withFrequency("dex2oat_trace_freq", 75)) { // Dex2oat could take a while before it starts. Add a short delay before start tracing. Utils.traceSystem(sIProfcollect, "dex2oat", /* delayMs */ 1000); Utils.traceSystem(sIProfcollect, "dex2oat", /* durationMs */ 0, /* delayMs */ 1000); } } Loading services/profcollect/src/com/android/server/profcollect/Utils.java +5 −4 Original line number Diff line number Diff line Loading @@ -44,13 +44,13 @@ final class Utils { * Request a system-wide trace. * Will be ignored if the device does not meet trace criteria or is being rate limited. */ static boolean traceSystem(IProfCollectd iprofcollectd, String eventName) { static boolean traceSystem(IProfCollectd iprofcollectd, String eventName, int durationMs) { if (!checkPrerequisites(iprofcollectd)) { return false; } BackgroundThread.get().getThreadHandler().post(() -> { try { iprofcollectd.trace_system(eventName); iprofcollectd.trace_system(eventName, durationMs); } catch (RemoteException | ServiceSpecificException e) { Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage()); } Loading @@ -62,13 +62,14 @@ final class Utils { * Request a system-wide trace after a delay. * Will be ignored if the device does not meet trace criteria or is being rate limited. */ static boolean traceSystem(IProfCollectd iprofcollectd, String eventName, int delayMs) { static boolean traceSystem(IProfCollectd iprofcollectd, String eventName, int durationMs, int delayMs) { if (!checkPrerequisites(iprofcollectd)) { return false; } BackgroundThread.get().getThreadHandler().postDelayed(() -> { try { iprofcollectd.trace_system(eventName); iprofcollectd.trace_system(eventName, durationMs); } catch (RemoteException | ServiceSpecificException e) { Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage()); } Loading Loading
services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +3 −3 Original line number Diff line number Diff line Loading @@ -291,7 +291,7 @@ public final class ProfcollectForwardingService extends SystemService { "collection_interval", 600); mScheduledExecutorService.scheduleWithFixedDelay(() -> { if (sIProfcollect != null) { Utils.traceSystem(sIProfcollect, "periodic"); Utils.traceSystem(sIProfcollect, "periodic", /* durationMs */ 0); } }, 0, interval, TimeUnit.SECONDS); // Background process and upload service. Loading Loading @@ -373,7 +373,7 @@ public final class ProfcollectForwardingService extends SystemService { @Override public void onIntentStarted(Intent intent, long timestampNanos) { if (Utils.withFrequency("applaunch_trace_freq", 5)) { Utils.traceSystem(sIProfcollect, "applaunch"); Utils.traceSystem(sIProfcollect, "applaunch", /* durationMs */ 0); } } } Loading @@ -393,7 +393,7 @@ public final class ProfcollectForwardingService extends SystemService { private void traceOnDex2oatStart() { if (Utils.withFrequency("dex2oat_trace_freq", 75)) { // Dex2oat could take a while before it starts. Add a short delay before start tracing. Utils.traceSystem(sIProfcollect, "dex2oat", /* delayMs */ 1000); Utils.traceSystem(sIProfcollect, "dex2oat", /* durationMs */ 0, /* delayMs */ 1000); } } Loading
services/profcollect/src/com/android/server/profcollect/Utils.java +5 −4 Original line number Diff line number Diff line Loading @@ -44,13 +44,13 @@ final class Utils { * Request a system-wide trace. * Will be ignored if the device does not meet trace criteria or is being rate limited. */ static boolean traceSystem(IProfCollectd iprofcollectd, String eventName) { static boolean traceSystem(IProfCollectd iprofcollectd, String eventName, int durationMs) { if (!checkPrerequisites(iprofcollectd)) { return false; } BackgroundThread.get().getThreadHandler().post(() -> { try { iprofcollectd.trace_system(eventName); iprofcollectd.trace_system(eventName, durationMs); } catch (RemoteException | ServiceSpecificException e) { Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage()); } Loading @@ -62,13 +62,14 @@ final class Utils { * Request a system-wide trace after a delay. * Will be ignored if the device does not meet trace criteria or is being rate limited. */ static boolean traceSystem(IProfCollectd iprofcollectd, String eventName, int delayMs) { static boolean traceSystem(IProfCollectd iprofcollectd, String eventName, int durationMs, int delayMs) { if (!checkPrerequisites(iprofcollectd)) { return false; } BackgroundThread.get().getThreadHandler().postDelayed(() -> { try { iprofcollectd.trace_system(eventName); iprofcollectd.trace_system(eventName, durationMs); } catch (RemoteException | ServiceSpecificException e) { Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage()); } Loading