Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43970
b: refs/heads/master
c: aba76fd
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 10, 2006
1 parent 43c9ce4 commit 22f5792
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 98c4d57decf97bf8ddfe948a3266aa56b38b1a51
refs/heads/master: aba76fdb8a5fefba73d3490563bf7c4da37b1a34
24 changes: 24 additions & 0 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,27 @@ static int proc_base_fill_cache(struct file *filp, void *dirent, filldir_t filld
proc_base_instantiate, task, p);
}

#ifdef CONFIG_TASK_IO_ACCOUNTING
static int proc_pid_io_accounting(struct task_struct *task, char *buffer)
{
return sprintf(buffer,
"rchar: %llu\n"
"wchar: %llu\n"
"syscr: %llu\n"
"syscw: %llu\n"
"read_bytes: %llu\n"
"write_bytes: %llu\n"
"cancelled_write_bytes: %llu\n",
(unsigned long long)task->rchar,
(unsigned long long)task->wchar,
(unsigned long long)task->syscr,
(unsigned long long)task->syscw,
(unsigned long long)task->ioac.read_bytes,
(unsigned long long)task->ioac.write_bytes,
(unsigned long long)task->ioac.cancelled_write_bytes);
}
#endif

/*
* Thread groups
*/
Expand Down Expand Up @@ -1855,6 +1876,9 @@ static struct pid_entry tgid_base_stuff[] = {
#ifdef CONFIG_FAULT_INJECTION
REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject),
#endif
#ifdef CONFIG_TASK_IO_ACCOUNTING
INF("io", S_IRUGO, pid_io_accounting),
#endif
};

static int proc_tgid_base_readdir(struct file * filp,
Expand Down

0 comments on commit 22f5792

Please sign in to comment.