mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-16 15:12:39 +01:00
This example demonstrates how to use the generic cgroup subsystem for a simple resource tracker that counts, for the processes in a cgroup, the total CPU time used and the %CPU used in the last complete 10 second interval. Portions contributed by Balbir Singh <[email protected]> Signed-off-by: Paul Menage <[email protected]> Cc: Serge E. Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Paul Jackson <[email protected]> Cc: Kirill Korotaev <[email protected]> Cc: Herbert Poetzl <[email protected]> Cc: Srivatsa Vaddagiri <[email protected]> Cc: Cedric Le Goater <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
15 lines
304 B
C
15 lines
304 B
C
|
|
#ifndef _LINUX_CPU_ACCT_H
|
|
#define _LINUX_CPU_ACCT_H
|
|
|
|
#include <linux/cgroup.h>
|
|
#include <asm/cputime.h>
|
|
|
|
#ifdef CONFIG_CGROUP_CPUACCT
|
|
extern void cpuacct_charge(struct task_struct *, cputime_t cputime);
|
|
#else
|
|
static void inline cpuacct_charge(struct task_struct *p, cputime_t cputime) {}
|
|
#endif
|
|
|
|
#endif
|