From 69ea714cfdea286bedfc626e17fc4a1df4d28519 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 15 Dec 2020 14:59:47 +0900 Subject: [PATCH] Report task io only when CONFIG_TASK_IO_ACCOUNTING is enabled If kernel does not have CONFIG_TASK_IO_ACCOUNTING, then it is not possbile to support task io usage. Reporting task io only when kernel has CONFIG_TASK_IO_ACCOUNTING, otherwise just report 0. Change-Id: I9b55c9bb85ae3b8900c04564481de7cef249289b Signed-off-by: Seung-Woo Kim --- kernel/proc-tsm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/proc-tsm.c b/kernel/proc-tsm.c index e86ec82..248aaa1 100644 --- a/kernel/proc-tsm.c +++ b/kernel/proc-tsm.c @@ -181,7 +181,11 @@ static int stability_monitor_show(struct seq_file *m, void *v) seq_put_decimal_ull(m, " ", cputime_to_usecs(utime + stime)); seq_put_decimal_ull(m, " ", PAGE_TO_KB(vm_rss)); seq_put_decimal_ll(m, " ", open_fds); +#ifdef CONFIG_TASK_IO_ACCOUNTING seq_put_decimal_ull(m, " ", task_ioac.read_bytes + task_ioac.write_bytes); +#else + seq_put_decimal_ull(m, " ", 0); +#endif seq_printf(m, "\n"); } -- 2.7.4