OSDN Git Service

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)
committerJin Qian <jinqian@google.com>
Tue, 14 Mar 2017 20:07:19 +0000 (13:07 -0700)
commitbce3e4dd9d49f2a3da44841a6b0b6dcb56ec149d
tree61aa43bf31e5df1eb286f61aef1ee9de615a953b
parenta2849d45025ca5894e99502752a86ebc744a4361
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