[1/2] [WIP] health: Add support for storage stats and health#628
Closed
ix5 wants to merge 1 commit into
Closed
Conversation
This was referenced Jul 14, 2019
39d66d4 to
4f9bd17
Compare
3cc88ac to
784b86e
Compare
Merged
699ce56 to
5d1178b
Compare
Collaborator
|
rebase please |
4f9bd17 to
912b29c
Compare
Contributor
Author
|
Rebased. This is NOT ready for merge! Still need testing on UFS devices and remove a few TODOs. Code review on C++ files is appreciated :) |
Collaborator
|
updates? |
Contributor
Author
|
It's more of a toy functionality, android doesn't really use the stats for anything important. |
120f053 to
dea89a4
Compare
Contributor
Author
|
Ping @oshmoun @luk1337 @MarijnS95 for review ( & @kholk if not too busy / disgusted by C++) |
This implements the missing health@2.0 function calls: - get_storage_info() - get_disk_stats() Also introduce a HealthTestingMock for debugging purposes. It is only available in userdebug/eng builds. The prop "persist.vendor.health.fake_storage=1" will trigger fake stats. Storage health reporting is not available for UFS since there is no kernel support for UFS health as of 2019-07-12. Since the SODP devices all have different emmc nodes, attempt to resolve `/sys/block/mmcblk0` to e.g. `/sys/devices/platform/soc/7464900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0`, which gives use the emmc node at `/sys/devices/platform/soc/7464900.sdhci/mmc_host/mmc0/mmc0:0001` For UFS devices, construct the sysfs paths based on the property `ro.boot.bootdevice`, which would look like e.g. `7464900.ufshci`, giving us a path such as: `/sys/devices/platform/soc/7464900.ufshci`. (Currently unused of course) The nodes will have to labeled in the individual platforms' sepolicy dirs. SODP devices report pre-EOL info, two lifetime values and an EMMC revision. Disk statistics are taken from the generic `stat` file, just as the default implemention of `storaged` and the crosshatch/bonito health HAL do.
436c964 to
68bc1eb
Compare
b818544 to
d165b35
Compare
9aed031 to
317ff7e
Compare
Contributor
Author
|
Still not really useful on Android 11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
health: Add support for storage stats and health
This implements the missing health@2.0 function calls:
get_storage_info()get_disk_stats()Also introduce a
HealthTestingMockfor debugging purposes. It is only available in userdebug/eng builds.The prop
persist.vendor.health.fake_storage=1will trigger fake stats.Storage health reporting is not available for UFS since there is no kernel support for UFS health as of 2019-07-12.
Since the SODP devices all have different emmc nodes, attempt to resolve
/sys/block/mmcblk0to e.g./sys/devices/platform/soc/7464900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0, which gives use the emmc node at/sys/devices/platform/soc/7464900.sdhci/mmc_host/mmc0/mmc0:0001For UFS devices, construct the sysfs paths based on the property
ro.boot.bootdevice, which would look like e.g.7464900.ufshci, giving us a path such as:/sys/devices/platform/soc/7464900.ufshci.(Currently unused of course)
The nodes will have to labeled in the individual platforms' sepolicy dirs:
SODP devices report pre-EOL info, two lifetime values and an EMMC revision.
Disk statistics are taken from the generic
statfile, just as the default implemention ofstoragedand the crosshatch/bonito health HAL do.health: Refactor and simplify, drop healthd shims
This change drastically simplifies the code, which had been written under the assumption that AOSP would drop healthd soon. The wrapper libraries make little sense, just drop them.Update: The "simplify" commits have been split out into #647