-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1/2] [WIP] health: Add support for storage stats and health #628
Closed
Conversation
This file contains 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
ix5
changed the title
[WIP] health: Add support for storage stats and health, refactor & simplify
[1/2] [WIP] health: Add support for storage stats and health, refactor & simplify
Jul 14, 2019
This was referenced Jul 14, 2019
ix5
force-pushed
the
health-storage-stats
branch
from
July 26, 2019 13:53
39d66d4
to
4f9bd17
Compare
jerpelea
force-pushed
the
master
branch
2 times, most recently
from
September 4, 2019 11:42
3cc88ac
to
784b86e
Compare
ix5
changed the title
[1/2] [WIP] health: Add support for storage stats and health, refactor & simplify
[1/2] [WIP] health: Add support for storage stats and health
Sep 30, 2019
Merged
jerpelea
force-pushed
the
master
branch
3 times, most recently
from
October 3, 2019 13:16
699ce56
to
5d1178b
Compare
rebase please |
ix5
force-pushed
the
health-storage-stats
branch
from
November 5, 2019 19:06
4f9bd17
to
912b29c
Compare
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 :) |
updates? |
It's more of a toy functionality, android doesn't really use the stats for anything important. |
jerpelea
force-pushed
the
master
branch
2 times, most recently
from
February 25, 2020 11:44
120f053
to
dea89a4
Compare
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.
jerpelea
force-pushed
the
master
branch
3 times, most recently
from
July 2, 2020 08:29
436c964
to
68bc1eb
Compare
jerpelea
force-pushed
the
master
branch
2 times, most recently
from
September 2, 2020 13:52
b818544
to
d165b35
Compare
jerpelea
force-pushed
the
master
branch
2 times, most recently
from
September 15, 2020 13:54
9aed031
to
317ff7e
Compare
Still not really useful on Android 11 |
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
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 ofstoraged
and 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