summaryrefslogtreecommitdiffstats
path: root/storaged
Commit message (Collapse)AuthorAgeFilesLines
* Move system/core/ off NO_ERROR.Elliott Hughes2018-10-082-3/+3
| | | | | | | | It causes trouble for Windows, and OK already exists. Bug: N/A Test: builds Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
* Match src paths with aidl package nameDan Willemsen2018-09-141-1/+10
| | | | | | | | | | In order for the build system to track updates to the header files during incremental builds, always specify the src files using the same path as the package for C++ compilations. Bug: 112114177 Test: m Change-Id: Iec355bf4c11204a09bb164bbf14eaa1a148c5f36
* storaged: change log level for health HAL callsYifan Hong2018-09-132-2/+10
| | | | | | | | | | Devices that does not implement getDiskStats and getStorageInfo returns NOT_SUPPORTED as a value. Do not log to error stream in this case. Fixes: 114475810 Test: boots Change-Id: I95e9ebe23b4dee451cb8f6e8dc0b60a224006600
* storaged: Cap io_history when loading stats from disk.David Anderson2018-08-213-16/+49
| | | | | | | | | | Similar to add_record_locked, load_uid_io_proto should respect the maximum number of records. Bug: 111578975 Test: storaged_test.load_uid_io_proto Change-Id: Ic3c5095cdd09d2184f436813b5ab50d3ee0007b2 Merged-In: Ic3c5095cdd09d2184f436813b5ab50d3ee0007b2
* storaged: Don't duplicate uid_records from proto files.David Anderson2018-08-214-5/+60
| | | | | | | | | | | | | It is possible for storaged to load the same saved proto file multiple times, for example, if system_server crashes. In this case we do not want to fill io_history with duplicate entries. This patch elides records for which an app+userid record already exists for the same timestamp. Bug: 111578975 Test: gtest storaged_test.load_uid_io_proto Change-Id: I87bc3e37d6464079cece03b5852285d79067b935 Merged-In: I87bc3e37d6464079cece03b5852285d79067b935
* storaged: Fix-up private variable names in uid_monitor.David Anderson2018-08-213-83/+86
| | | | | | | Bug: N/A Test: storaged builds Change-Id: Ifd21e25baa7b1c6ce41c5e0ec5247f47ba716e6e Merged-In: Ifd21e25baa7b1c6ce41c5e0ec5247f47ba716e6e
* storaged: fix headers.Yifan Hong2018-07-174-1/+4
| | | | | | | | | | | | | | | Add missing libbatteryservice_headers dependency. It used to use global header include dirs, which is bad. Add old transitive dependency from libbatteryservice_headers as well. Test: builds Bug: 68724651 Change-Id: Idcc4452160dce70b4f8b48e2d809dcd5744b93b4 Merged-In: Idcc4452160dce70b4f8b48e2d809dcd5744b93b4 (cherry picked from commit 0b31908912d7a1802ce7e3d0f0857fe6b34d926b)
* Merge "storaged: lower capabilities in init" am: 183b575e78David Anderson2018-04-121-0/+1
|\ | | | | | | | | | | am: 04cc5c3616 Change-Id: I2b1f68bfc21febb0f5ade62d06815377b03c77eb
| * Merge "storaged: lower capabilities in init"Treehugger Robot2018-04-121-0/+1
| |\
| | * storaged: lower capabilities in initDavid Anderson2018-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Lower storaged's capabilities to DAC_READ_SEARCH as an initial step toward running it non-root. Bug: 77634061 Test: storaged still runs and its /proc/pid/status has lower CapPrms Change-Id: Ibfe0349fc059e2f37efba33f587176e8ce6be9fe
* | | Merge "storaged: update OWNERS" am: ffc325a3b2David Anderson2018-04-121-1/+1
|\| | | | | | | | | | | | | | | | | am: 2e0f524713 Change-Id: I1d4d1279f5af662f7f6e0706c34e3c9369ac0550
| * | storaged: update OWNERSDavid Anderson2018-04-111-1/+1
| |/ | | | | | | | | | | Bug: N/A Test: N/A Change-Id: Ic3e3fbcb4c4357a286ef05feab68e65390e2eab3
* | Merge "storaged: remove unused includes" am: 0289f35b83David Anderson2018-04-061-3/+0
|\| | | | | | | | | | | am: 6cebd27db8 Change-Id: Ia6f60132c3026621252015028cb7ebe2559a47bd
| * storaged: remove unused includesDavid Anderson2018-04-051-3/+0
| | | | | | | | | | | | Bug: 35323867 Test: N/A Change-Id: I21c0b62765dbd27a462288c5e7577905240720f0
* | Merge "storaged: fix divide-by-zero when updating history" into pi-devDavid Anderson2018-04-023-4/+34
|\ \ | | | | | | | | | | | | | | | am: 0b637d94d6 Change-Id: If668d3a3a349070a734ebce66e8e4eef0465bdef
| * | storaged: fix divide-by-zero when updating historyDavid Anderson2018-03-273-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 75984894 Test: storaged unit tests on x86/64 platforms Change-Id: I8c491f70705c662d40d0b212bcbc43a0de279bec Merged-In: I8c491f70705c662d40d0b212bcbc43a0de279bec (cherry picked from commit f2dd78bb2c9fe0e6482cf012e26664752fc64401)
* | | Merge "storaged: owner adjustment" am: 387319307aMark Salyzyn2018-03-231-0/+1
|\ \ \ | |/ / |/| / | |/ | | | | am: 785c18d4d1 Change-Id: I8fc93957370c2ef95ddbea5ce1d3f16ada31611d
| * storaged: owner adjustmentMark Salyzyn2018-03-231-0/+1
| | | | | | | | | | | | | | | | Added salyzyn@ for final owner review on adjustments to storaged. Test: none Signed-off-by: Mark Salyzyn <salyzyn@google.com> Change-Id: Iac73403ea416a4820f72689f5860aa88931def06
* | health: Modify IHealthInfo Callback interface to return V2.0 HealthInfoHridya Valsaraju2018-01-182-3/+3
| | | | | | | | | | | | Bug: 71860528 Test: vts-tradefed run vts -m VtsHalHealthV2_0 Change-Id: I7de39ffa4c21772d8878c9a3f054bc6dbbde2fb9
* | Merge "Provide Recent Disk Perf via IStoraged"TreeHugger Robot2018-01-186-0/+22
|\ \
| * | Provide Recent Disk Perf via IStoragedMichael Wachenschwanz2018-01-086-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Expose recent disk write performance to Java side services. Bug: 62393328 Test: manual Change-Id: I6002681b17e7f5b9538b4dc9e312843cf838e467
* | | storaged: use health HAL to read StorageInfo.Yifan Hong2018-01-163-7/+51
| | | | | | | | | | | | | | | | | | | | | Test: storaged unit tests Bug: 68388678 Change-Id: Iec395a33bac72f49366e8c30ea7e709c8acdcfa2
* | | storaged: use health HAL to read DiskStats.Yifan Hong2018-01-166-36/+123
| | | | | | | | | | | | | | | | | | Test: storaged unit tests Bug: 68388678 Change-Id: I03ce3aa71fb54ae40489c7b35973cd4b83b13bfb
* | | storaged: storaged_t replace initHealthService with init.Yifan Hong2018-01-163-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | storaged_t has more fields that depend on the health service; they should be initialized in the new init() function. Test: storaged unit tests Change-Id: I70d41e5d0a0ef20c39c41c7539a284937bd21ad5
* | | storaged: use get_health_serviceYifan Hong2018-01-162-15/+12
|/ / | | | | | | | | | | Test: storaged unit tests Bug: 68388678 Change-Id: I67100a9a0ad27f9e5b8fc077ff83c442e2bebe71
* | storaged: align buffer address and size for direct_ioJin Qian2017-12-133-71/+86
| | | | | | | | | | | | | | | | O_DIRECT requires buffer address and size to be aligned Bug: 63629306 Change-Id: I268abb1c0ba32af4fd2e92210192c47a1f173238
* | Merge "Add OWNERS." am: 3289b9c928 am: 515c8fe572Elliott Hughes2017-12-081-0/+1
|\| | | | | | | | | | | am: aede8375fe Change-Id: I28f7a8f3fa9c9837f4043768e70c0d985ed95abd
| * Merge "Add OWNERS."Elliott Hughes2017-12-071-0/+1
| |\
| | * Add OWNERS.Elliott Hughes2017-12-071-0/+1
| | | | | | | | | | | | | | | | | | Bug: N/A Test: N/A Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
| * | storaged: call getNamesForUids to get uid namesJin Qian2017-08-082-21/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls getNamesForUids when one of the two conditions are true. 1. entries for new uids are reported from io stats 2. previous getNamesForUids failed Bug: 62805090 Merged-In: I120b81e1857b2aa0a90d0fb85c8d749e985df78e Change-Id: I120b81e1857b2aa0a90d0fb85c8d749e985df78e
| * | storaged: fix excessive accounting when io usage has negative deltaJin Qian2017-08-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When current io bytes are smaller than previous bytes, add 0 to delta instead of adding current io bytes. Bug: 64317562 Merged-In: If0c9814892ad61b790baa6395649af10b11d5b7c Change-Id: I1ffd7ac33649ab3b8405c83b1328fa9bf49702c0
* | | Export AIDL files as a filegroup for framework.jarColin Cross2017-11-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Put AIDL files into a filegroup so they can be imported as sources for framework.jar. Test: m checkbuild Change-Id: I1a5335384e9291af1f26e7418f15fcfa082ee356
* | | storaged: remove protos from storaged classJin Qian2017-11-097-66/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | protobuf is only needed when serializing/deserializing data. Instead of maintaining a permanent buffer in storaged object, move the container to stack so that the buffer is released when we don't need it. In addition, we don't need to clear the buffer before updating it. Also added a function to clear user io history when the user is removed. Bug: 63740245 Change-Id: Ia5d19b9a0c3f92a93b061a56be89bb0b958a2a29
* | | Merge "storaged: fix regression found in unit-test"Jin Qian2017-11-071-1/+1
|\ \ \
| * | | storaged: fix regression found in unit-testJin Qian2017-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Should use reference instead of copy to clear storaged proto Bug: 63740245 Change-Id: Ibb933a0bac12508467fc104b37e7cc490dfbe948
* | | | Merge changes from topic "health2-health1"Yifan Hong2017-11-072-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * changes: storaged: update for using 1.0::HealthInfo. Health@2.0: uses @1.0::HealthInfo
| * | | | storaged: update for using 1.0::HealthInfo.Yifan Hong2017-11-062-3/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Test: boots Bug: 63702641 Change-Id: I97e322af97347c603f10b5b5b82cd3ae52c58b8f
* / / / do not getTransport before getting IHealth service.Yifan Hong2017-11-031-4/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | getService already has getTransport logic. Test: storaged unit tests Bug: 63702641 Change-Id: I29be15e5713ac276fbbeda88224d8aef514319c6
* | | storaged: split proto file into multiple CE areasJin Qian2017-10-3114-189/+461
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use user_id (from app uid) to determine file location. /data/misc_ce/<user_id>/storaged/storaged.proto Vold notifies storaged when a user's CE area becomes available. Then storaged restores data from the proto in that area and combines them into IO history. Vold also notifies storaged when the CE area is being deleted. Storaged clears internal history about this user and deletes the proto file. IO perf is stored in user_0 area since it's not user related. Test: dumpsys storaged before/after multiple users' unlock Bug: 63740245 Change-Id: I39f923f6b09e9f2a29e9286ce02b3b3bcbfb9f94
* | | storaged: talk to healthd in hwbinder.Yifan Hong2017-10-194-43/+74
| | | | | | | | | | | | | | | Test: storaged-unit-tests Change-Id: I6ebfea3470b4b37b2516ffb2b14385f65bb4b80e
* | | storaged: move proto file to /data/misc_ce/0/storagedJin Qian2017-10-188-18/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use proto_stat to indicate status of CE area. Before user_0 unlocks, storaged detects CE NOT_AVAILABLE when attempting to read the proto file. It then skips reading/writting the proto. When user_0 logs in, vold calls onUserStart in storaged, which sets proto_stat to AVAILABLE. At next event, storaged tries to read the proto. If it's a success, proto_stat is changed to LOADED. After that, storaged reads and writes proto normally. Test: adb shell storaged -u -p Bug: 63740245 Change-Id: I1fdd42c430e91682f6cc07497fcad5be52489b4e
* | | storaged: use AIDL to generate storaged binder calls.Jin Qian2017-10-1817-279/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split binder calls into two separate services. "storaged" service will be used by external clients, e.g. vold. - Added stub onUserStarted/onUserStopped to prepare for moving storaged.proto into ce area. "storaged_pri" private service will be used by storaged cmdline, e.g. adb shell storaged -u - Added parcelable UidInfo for private service. - Change format of perf history to one vector with first 3 elements showing size of recent/daily/weekly perf history. Test: adb shell storaged -u -p Bug: 63740245 Change-Id: Ib0367282a95b6cb0a38f064f0456e849ecccc210
* | | storaged: record IO perf history from proto updatesJin Qian2017-10-1013-110/+525
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Record the bandwidth when writing storaged.proto to monitor system storage performance. The history is maintained in 3 catergories. 1. samples of last 24 hours. 2. daily average of last 7 days. 3. weekly average of last 52 weeks. Sampling frequency of the first catergory is set to once every hour. Storaged also flushes proto at same frequency. The proto file is padded to reach a minimal size of 128KB. Storaged writes 16KB at a time. Bandwidth calculation ignores time spent in the first write and writes smaller than 16KB. bandwidth = total size of 16KB writes / time spent in 16KB writes Restructured the code so that storaged.cpp handles proto load/flush. It calls individual module to sync proto with internal data structures. Added a cmdline argument to dump perf history. adb shell storaged -p I/O perf history (KB/s) : most_recent <--------- least_recent last 24 hours : 5315 3775 3659 2042 3890 5652 3649 3696 6023 last 7 days : 4648 3532 3828 3567 3841 3359 4676 last 52 weeks : 3817 4275 3836 3766 4280 0 0 0 0 0 ... Test: adb shell storaged -p atp:asit/perf/jank_systemui_test atp:asit/perf/appstartup_hermetic_cyclic_dropcache_test atp:asit/perf/appstartup_non_hermetic_cyclic_dropcache_test Bug: 63629306 Change-Id: Ie7051e7a8df883d4a6818ea9a54a10f4dccb4843
* | | storaged: clean up disk stats codeJin Qian2017-10-0212-535/+576
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged disk_stats_publisher into disk_stats_monitor class. Moved proc file check to disk_stats class instead of doing so in storaged, same for uid_io. Added is_zero function to check zero disk_stats. Added operators to compute disk_stats. Change-Id: I277ae51f6fe18464f92e45c03471343784e67093
* | | storaged: fix task io stats parsingJin Qian2017-09-281-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comm field in task io stats string can have comma since this field includes task arguments. As a result, splitting the string by comma doesn't always give 13 fields. Parse the string in following way to fix that. last 11 fields -> pid and io stats Second field to 12th from last -> comm Bug: 63739275 Change-Id: I6a2418260444c71d6492fc6cbd639d3cc54ceaed
* | | storaged: store io_history as protobuf file on userdataJin Qian2017-08-156-15/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convert storaged internal io_history to protobuf format and serialize it to userdata partition. Also load this file during storaged startup to reconstruct io history. Bug: 63740245 Change-Id: I0697525df1c31fdec20f5ed4e3e9363e2dde244f
* | | storaged: convert Android.mk to Android.bpJin Qian2017-08-153-89/+80
| | | | | | | | | | | | Change-Id: Ia59f6cc94f0eaea531a8e516b0492e0dfecc6ce0
* | | storaged: add parser for dumpsys storaged outputYang Jin2017-08-091-0/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rank uids by io stats and display their tasks. Can either rank by combining io stats for same uids or io stats for the last appearing uid. See python ranker.py -h for details. Test: python ranker.py -i io.txt -o output.txt -u 20 -cnt Bug: 63739275 Change-Id: Ieee1d7a9bf190266fc6a055c0922434fcd9099c6
* | | storaged: call getNamesForUids to get uid namesJin Qian2017-08-082-22/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | Calls getNamesForUids when one of the two conditions are true. 1. entries for new uids are reported from io stats 2. previous getNamesForUids failed Bug: 62805090 Change-Id: I120b81e1857b2aa0a90d0fb85c8d749e985df78e
* | | Merge "storaged: add task io to dump service"Jin Qian2017-07-267-86/+225
|\ \ \ | |/ / |/| |