Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a360b335 authored by Jin Qian's avatar Jin Qian
Browse files

ANDROID: sched: add a counter to track fsync



Change-Id: I6c138de5b2332eea70f57e098134d1d141247b3f
Signed-off-by: default avatarJin Qian <jinqian@google.com>
parent b77f6fa5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ static int do_fsync(unsigned int fd, int datasync)
	if (f.file) {
		ret = vfs_fsync(f.file, datasync);
		fdput(f);
		inc_syscfs(current);
	}
	return ret;
}
+8 −0
Original line number Diff line number Diff line
@@ -3088,6 +3088,11 @@ static inline void inc_syscw(struct task_struct *tsk)
{
	tsk->ioac.syscw++;
}

static inline void inc_syscfs(struct task_struct *tsk)
{
	tsk->ioac.syscfs++;
}
#else
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
{
@@ -3104,6 +3109,9 @@ static inline void inc_syscr(struct task_struct *tsk)
static inline void inc_syscw(struct task_struct *tsk)
{
}
static inline void inc_syscfs(struct task_struct *tsk)
{
}
#endif

#ifndef TASK_SIZE_OF
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ struct task_io_accounting {
	u64 syscr;
	/* # of write syscalls */
	u64 syscw;
	/* # of fsync syscalls */
	u64 syscfs;
#endif /* CONFIG_TASK_XACCT */

#ifdef CONFIG_TASK_IO_ACCOUNTING
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ static inline void task_chr_io_accounting_add(struct task_io_accounting *dst,
	dst->wchar += src->wchar;
	dst->syscr += src->syscr;
	dst->syscw += src->syscw;
	dst->syscfs += src->syscfs;
}
#else
static inline void task_chr_io_accounting_add(struct task_io_accounting *dst,