Commit graph

7 commits

Author SHA1 Message Date
Jin Qian
726339c7e8 storaged: read emmc health data from sysfs
Sysfs data is straightforward so we don't need parsing anymore.

Also removed periodical check since data is set only once during
driver initialization. Checking at every device boot or storaged
restart should be sufficient to monitor long term status change.

Test: adb logcat -d -b events | grep storaged_emmc_info
Bug: 36228467
Change-Id: I2a181f52c9f19de1e679a3a905aaebafe4d08227
2017-03-28 15:08:31 -07:00
Jin Qian
4fc338e60b storaged: rewrite emmc info class
Test: adb logcat -d -b events | grep storaged_emmc_info
Bug: 36228467
Change-Id: Ib799e60ed65661a9fb99be8ad4c930f547339975
2017-03-16 16:12:55 -07:00
George Burgess IV
151ea52cf6 Add permission bits to open with O_CREAT.
It's an error to pass open O_CREAT without giving it mode bits:
https://linux.die.net/man/3/open

Bug: 32073964
Test: Compiles with clang FORTIFY.
Change-Id: Iaa78c3003ed960e1ffe7e56623dba33db4e17443
2017-02-03 14:45:47 -08:00
Jin Qian
88ad33eff1 storaged: remove task io code
Bug: 34612499
Change-Id: Id0599ee2ae025a186259e95363c1ddd0feae8079
2017-01-24 14:45:50 -08:00
Jin Qian
bcd6e3b9d9 storaged: monitor per-uid IO usage
Add uid_monitor class to query /proc/uid_io/stats periodically.
Add a log tag to record any UID that exceeds IO threshold.

Test: adb shell storaged -u
Bug: 34198239
Change-Id: I53568c30dbefe2f4bdb18054d3dedb30b4133d8b
2017-01-24 14:45:35 -08:00
ynwang
af49d9756f Storaged cleanup
Compliance with Android Coding standards

Test: compile
Bug: 28826771
Change-Id: I10bc4a793bb1da75e8600b81a5d7ff913e310da1
2016-12-21 11:08:24 -08:00
ynwang
62cb372279 storaged: add storaged native daemon
Storaged periodically checks the devices' disk stats and eMMC lifetime.
This information is logged to both the kernel and event log. By event
logging, the data can be aggregated by the checkin service and then
sent to Sawmill.

It also periodically traverses /proc/[pid], maintaining the I/O usage of
all tasks (all sampled tasks). The task I/O data can be reported using
the --dump option.

Storaged is booted when the device boots up and requires the permission
for reading /proc/diskstats, /proc/[pid]/io and debugfs(eMMC ext_csd).
For detailed description, please refer to go/storaged.

Bug: 28826771
Change-Id: I774b1a44cc30092bac1bfcbc08bf487295e7cfed
2016-12-15 15:56:33 -08:00