diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index fd959d5b5a80..77a57b5799c4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1804,6 +1804,27 @@ static int proc_base_fill_cache(struct file *filp, void *dirent, filldir_t filld | |||
1804 | proc_base_instantiate, task, p); | 1804 | proc_base_instantiate, task, p); |
1805 | } | 1805 | } |
1806 | 1806 | ||
1807 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
1808 | static int proc_pid_io_accounting(struct task_struct *task, char *buffer) | ||
1809 | { | ||
1810 | return sprintf(buffer, | ||
1811 | "rchar: %llu\n" | ||
1812 | "wchar: %llu\n" | ||
1813 | "syscr: %llu\n" | ||
1814 | "syscw: %llu\n" | ||
1815 | "read_bytes: %llu\n" | ||
1816 | "write_bytes: %llu\n" | ||
1817 | "cancelled_write_bytes: %llu\n", | ||
1818 | (unsigned long long)task->rchar, | ||
1819 | (unsigned long long)task->wchar, | ||
1820 | (unsigned long long)task->syscr, | ||
1821 | (unsigned long long)task->syscw, | ||
1822 | (unsigned long long)task->ioac.read_bytes, | ||
1823 | (unsigned long long)task->ioac.write_bytes, | ||
1824 | (unsigned long long)task->ioac.cancelled_write_bytes); | ||
1825 | } | ||
1826 | #endif | ||
1827 | |||
1807 | /* | 1828 | /* |
1808 | * Thread groups | 1829 | * Thread groups |
1809 | */ | 1830 | */ |
@@ -1855,6 +1876,9 @@ static struct pid_entry tgid_base_stuff[] = { | |||
1855 | #ifdef CONFIG_FAULT_INJECTION | 1876 | #ifdef CONFIG_FAULT_INJECTION |
1856 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), | 1877 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), |
1857 | #endif | 1878 | #endif |
1879 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
1880 | INF("io", S_IRUGO, pid_io_accounting), | ||
1881 | #endif | ||
1858 | }; | 1882 | }; |
1859 | 1883 | ||
1860 | static int proc_tgid_base_readdir(struct file * filp, | 1884 | static int proc_tgid_base_readdir(struct file * filp, |