ANDROID: uid_cputime: add per-uid IO usage accounting
authorJin Qian <jinqian@google.com>
Wed, 11 Jan 2017 00:10:35 +0000 (16:10 -0800)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 10 Apr 2017 07:42:16 +0000 (13:12 +0530)
commitcc52d2bc7a54e5431f0734886574bedb7cce4ed4
treee29b921cf11a13be3c8e39e532991f66615dd48f
parent241f0efeac22f02c86243e2719435c62f082d1de
ANDROID: uid_cputime: add per-uid IO usage accounting

IO usages are accounted in foreground and background buckets.
For each uid, io usage is calculated in two steps.

delta = current total of all uid tasks - previus total
current bucket += delta

Bucket is determined by current uid stat. Userspace writes to
/proc/uid_procstat/set <uid> <stat> when uid stat is updated.

/proc/uid_io/stats shows IO usage in this format.
<uid> <foreground IO> <background IO>

Signed-off-by: Jin Qian <jinqian@google.com>
Bug: 34198239
Change-Id: Ib8bebda53e7a56f45ea3eb0ec9a3153d44188102
drivers/misc/uid_cputime.c