summaryrefslogtreecommitdiff
path: root/services/profcollect
AgeCommit message (Collapse)Author
2024-12-17profcollect: Do not collect profiles when the battery is low Yi Kong
Collecting profiles can be a battery intensive task. Do not collect profiles when the battery is low. Test: presubmit Change-Id: I80fd370bc46b9dd3b9d20b3cdb81c8ab974f34a0
2024-12-09profcollect: Move periodic trace worker to the system server Yi Kong
We used to have the periodic background trace worker in the native side, and relied on Doze mode to pause the collection when the device is inactive. This is not very accurate. Instead, we move the worker to the system server where we know exactly if the device is interactive, and we can make sure we only trace when the device is executing workload useful for profiling. Test: manual Bug: 381005420 Change-Id: I3c063cb63cb8d54e3e175eeee3118d60ee79714c
2024-11-21profcollect: Do not upload profiles if verity is disabled Yi Kong
The image might have been tampered if verity is off. Do not trigger profile upload in this case. Test: presubmit Test: turn off verity and check logs Bug: 380188300 Change-Id: Ia9d946cecf6f52c1dbb8870feacf426ea878e056
2024-11-15profcollect: Fix NPE when invoking UsbManager Yi Kong
The UsbManager may intermittently be unavailable following the PHASE_SYSTEM_SERVICES_READY phase. In these instances, disregard the issue and consider adb inactive. Test: presubmit Bug: 376302943 Change-Id: I62ac4ad8bb39759d8ebd9decff99b9d515830569
2024-10-29profcollect: check if ADB is active when the service starts. Yi Kong
Test: manual Bug: 370229109 Change-Id: Ib89dd05669225642b8a877828a85d5aae7e92791
2024-10-25profcollect: Disable tracing while ADB is connected Yi Kong
It is more likely that the device is being used for development work rather than day-to-day usage while ADB is connected. Stop tracing to remove bias introduced from development workload. Test: manual Bug: 370229109 Change-Id: Ie059e0adaa8ad25d0c342befe7d0e3c37cda8078
2024-10-02profcollect: introduce a cool down window between trace events Yi Kong
This will be used to prevent traces from being taken too frequently and negatively affects system performance. Test: m services Bug: 361001113 Change-Id: I14e0caf1bdc9432148ff318f5af054cc1ccc4ac1
2024-09-28profcollect: gracefully handle ServiceSpecificException Yi Kong
We should not crash the service when there is a transient error in the native backend. Test: presubmit Bug: 369526161 Change-Id: I81698c11ed5aba98421a833a0be53db77fa3a7d8
2024-08-21profcollect: increase applaunch trace frequency to 5% Yi Kong
This is to collect more data for the applaunch trace Change-Id: I767feceb2906a766c1b096433440e71517da72ff
2024-08-21profcollect: Refactor tracing code to a util class Yi Kong
Change-Id: I2394687a495bb5bb2595fcc7b33315e75f77dc12 Test: m services
2024-08-19profcollect: Refactor to use a common method for calculating frequency threshold Yi Kong
Change-Id: If05f941bb8397b42c68f44c504a85230a6f10055 Test: presubmit
2024-07-24profcollect: Guard binder calls with null checks Yi Kong
In case of profcollectd dies, mIProfcollect will become null. Guard all calls to mIProfcollect with null checks to prevent NPE. Change-Id: I0908bd2413f77a44a00e2692bb027ba580ecbec6 Test: presubmit Bug: 354339294
2024-07-23profcollect: fix camera event delay logic Yi Kong
Follow up to https://r.android.com/3186246, we should *not* delay trace capture, instead of always adding the delay. Change-Id: I93d917963a1c73e4a28e945488b9b5cb1b16925b Test: presubmit Bug: 319394981
2024-07-22profcollect: Collect camera traces for a longer duration Yi Kong
Increase the duration so that we can get a more complete and accurate trace. Also since we trace for longer, we can always trace initialization behavior. Test: manual Bug: 319394981 Change-Id: Id6bc62d44da418c5e21bc7876971a4b64f59c25d
2024-07-08profcollect: Switch to process level tracing for camera open events Yi Kong
Process level tracing has a lower overhead and can produce more accurate profiles. Test: manual Bug: 319394981 Change-Id: Id27a3ec427af453b353a840f695bc20922734cc2
2024-07-07profcollect: Rename trace_once to trace_system Yi Kong
We are adding another option, trace_process, to perform single process trace. Test: presubmit Bug: 319394981 Change-Id: Ie8920dbcaee5bea383b881b237c6c8a8fffb4eb6
2024-07-04profcollect: collect intilization code behavior for camera open events Yi Kong
First several frames may have a different code behavior for camera code. Allocate a small percentage of traces to capture those behavior. Test: presubmit Change-Id: Icf343b23ee51dfb83798ecc4be9a3fb5a219412b
2024-06-18profcollect: Don't hardcode OnCameraOpened skip packages list Yi Kong
Avoid hardcoding Google package names in AOSP. Test: manual Change-Id: I6d0b2683f6d3c9140591d7147ed95100f7843bf6
2024-06-07profcollect: Use postDelayed instead of starting a thread and sleep Yi Kong
Addresses follow-up comments from https://r.android.com/3115077. Change-Id: I6abaee35a4797c4e0d43daffaf2ab49d650cd9cc Test: presubmit Bug: 319394981
2024-06-06profcollect: Trace on camera open events Yi Kong
This allows us to collect traces for camera related libraries, like libg3a. For the initial experiment, we collect the traces one second after the camera opens. We can fine tune this or switch to other triggers once we have the benchmark numbers. Test: manual Bug: 319394981 Change-Id: Ia65694602af1054dd261f4e72c1c3f82056eb1e3
2024-06-04profcollect: Remove unused DEBUG logs Yi Kong
We have enough logging now, they have become excessive. Change-Id: Ia26dbbf7d771554e29087527bea97d6e6d5887bb Test: presubmit
2024-05-24profcollect: Make binder call on a background thread Yi Kong
Bug: 342527967 Change-Id: I41811e2dae454c67435c1c99d10bc3a28894fbd1 Test: presubmit
2024-05-22profcollect: create and upload profile on every idle maintenance Yi Kong
This reduces the latency before we are able to generate a profile from the server backend. Test: cmd jobscheduler run -f android 260817 Change-Id: Icdbdf809435580b131f5b6677e039f3043264abe
2024-05-11profcollectd: call jobFinished even if failed Yi Kong
Test: presubmit Change-Id: I4472fcf8140a8a9bceaff6b3c5a7abf6bc8df69e
2024-05-03Call jobFinished after ProfcollectBGJobService processing completes Abhishek Gadewar
Summary:Add a call to `jobFinished` after processing completes to ensure that the system is notified that the work has been completed. Test: Run `adb shell cmd jobscheduler run -f android 260817` multiple times in succession. Verify that processing is now triggered each time. Tags: Change-Id: Ifa6fcd8b2fdcea4904677bcae4a1cb36cac33154 Signed-off-by: Abhishek Gadewar <abhishekgadewar@meta.com>
2024-02-06Merge "profcollect: Change dex2oat callback to use Runnable::run" into main Yi Kong
2024-02-06profcollect: Change dex2oat callback to use Runnable::run Yi Kong
Addresses follow up review in https://r.android.com/2909917 Change-Id: Idc979c73b05e5dee53ef756b392c20131e2cdb4b Test: presubmit
2024-02-02profcollect: Increase default dex2oat frequency Yi Kong
Given how infrequently dex2oat gets invoked, the current default of 10% is too low. Bump the default frequency to 25%. Test: presubmit Bug: 319377405 Change-Id: I23fabb7fe75c660ac5a159167ca7b9b3107c4be5
2024-01-31Merge "profcollect: rename variable" into main Yi Kong
2024-01-31profcollect: update OWNERS Yi Kong
Test: N/A Change-Id: I9ade43802d498b6c8eeea576a21f5c546c872345
2024-01-31profcollect: rename variable Yi Kong
BG_PROCESS_PERIOD is not clear for its purpose. BG_PROCESS_INTERVAL is a better name. NFC. Test: presubmit Change-Id: Iea61ef48a93be17eaae16853e6dc6e91a9c083bc
2024-01-16profcollect dex2oat observer Yi Kong
This adds profcollect trigger for dex2oat invocations. This helps improving profile coverage for dex2oat. Bug: 319377405 Test: manual Change-Id: I6fa6f2b0538a87d4fbab7f220052e5be621159bb
2023-05-12ProfcollectForwardingService: Pass usage setting when reporting Yabin Cui
Bug: 282060259 Test: run am broadcast -a com.android.server.profcollect.UPLOAD_PROFILES (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:28f42bba3230d71765278d76b2edda71486a5b75) Merged-In: I891d10d023766009903383abb6421f3947f5f612 Change-Id: I891d10d023766009903383abb6421f3947f5f612
2023-05-02Profcollect: Fix two issues flagged by lint Yi Kong
Bug: 272547391 Test: presubmit Change-Id: I4ac140f3f37c04866d9d88906c26720ce7c71a80
2023-04-30Profcollect: Allow manually triggering profile upload Yi Kong
Also renamed `packProfileReport` method to a more descriptive name. Bug: 272547391 Test: adb shell am broadcast -a com.android.server.profcollect.UPLOAD_PROFILES Change-Id: Icceec481553cc42f674583c8eeae5874f53d18d3
2022-09-14profcollect: Fix possible NPE in ProfcollectBGJobService Yi Kong
The native service might have died, in which case, abort. Test: presubmit Bug: 246660820 Change-Id: I171a0031db104d2c008ee7ef9709f15f76d70b1a
2022-09-01profcollect: Reduce background processing job priority Yi Kong
The processing job is non-critical but quite CPU intensive. Reducing priority allows the system to throttle the job more aggresively. Test: presubmit Bug: 241948742 Change-Id: Ie7aa921dec1aa1f4f8582041dae1679950f4d868
2022-04-25Reduce overhead of activity launch observer Riddle Hsu
The cost of writing ActivityRecordProto is heavy. Especially it executes in window manager's lock. Since the usage of proto was removed. The callback interface is simplified to only send id and name. Though currently there is no use case, it is more accurate to associate different launch sequence because the assumption "only one start at a time" is not true anymore since multi-window/area/display support. Bug: 229822111 Test: atest ActivityMetricsLaunchObserverTests Change-Id: I6a151e72616fd4cf7a2e17d3c7f92aee8605c485
2022-03-26profcollect: Increase background processing frequency to every 4 hours Yi Kong
Test: presubmit Bug: 225062937 Change-Id: Ib88a9be2978e2ea3648536907714c843eb851531
2022-03-09profcollect: Register observers in a background thread Yi Kong
Test: presubmit Bug: 223254054 Change-Id: I24af51326dfe9f69c0ee146387ccabfc9239e7c1
2022-03-08profcollet: Fix possible NPE Yi Kong
If an exception contains no message, Log.e will throw NPE. Test: presubmit Bug: 223235958 Change-Id: Ie754776d3ef830dddbbb90dcc88e081706e96e6a
2022-02-07profcollectd: register callback to wait until ETM is ready. Yabin Cui
ETM may not be ready after boot. So after connecting to profcollectd, register ProviderStatusCallback to wait until ETM is ready. Bug: 213519191 Test: on oriole EVT and DVT devices, profcollectd can record applaunch Test: profiles. Change-Id: I15326b0c95afcf44cd2e85d063496311dda0d04d
2021-11-19profcollect: check hardware capability on a background thread Yi Kong
This is a blocking event, needs to be moved off from the main thread. Also, don't schedule background processing service if the hardware has no tracing support. Test: manual Bug: 79161490 Bug: 206986559 Change-Id: I039211b26f25ead66cf125f152e794b0c08057ee
2021-11-18Merge "profcollect: trace on background thread" Yi Kong
2021-11-18profcollect: trace on background thread Yi Kong
trace is a blocking event, needs to be moved off from the main thread. Test: build Bug: 206893189 Change-Id: Iead5a8f2471c2c0dbe0903294b7dcaf0b810256d
2021-11-15profcollectd: Move threading from native side Yi Kong
Previously trace processing's threading is handled on the native side while the report creation's threading is on the framework side. Move them all to the frameworks side to reduce complexity. Test: build Bug: 183487233 Change-Id: I5dd405b7a73e5be9e0141c20c6c100acbc6defa9
2021-11-08Rename upload action to com.android.shell.action.PROFCOLLECT_UPLOAD Yi Kong
The new name better aligns with the component and permission names. Follow up review comments on https://r.android.com/1784487 Bug: 183487233 Test: presubmit Change-Id: Ibe3a3e51b0dc154ee3e43b27e561fd541b62cc54
2021-10-13profcollect/betterbug integration with content uri Yi Kong
Test: manual Bug: 183487233 Bug: 194155753 Change-Id: I6bdec2d090126c53d3cf2fa9deece2441eeafd98
2021-07-21Merge "profcollect: Add verbose logging for ota status updates" am: ↵ Treehugger Robot
ac418218f8 am: c7c73d4ee1 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1773825 Change-Id: I366385185ad1ba6ab6e6f8c906e86aeae17ee187
2021-07-21profcollect: Add verbose logging for ota status updates Yi Kong
Test: presubmit Bug: 178561556 Change-Id: I4cd6b9bdb15fec4e115fefbef69c0c1e687d2392