aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpuacct.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cpuacct.h')
-rw-r--r--include/linux/cpuacct.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/cpuacct.h b/include/linux/cpuacct.h
new file mode 100644
index 00000000000..8f68e733fe1
--- /dev/null
+++ b/include/linux/cpuacct.h
@@ -0,0 +1,43 @@
1/* include/linux/cpuacct.h
2 *
3 * Copyright (C) 2010 Google, Inc.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef _CPUACCT_H_
17#define _CPUACCT_H_
18
19#include <linux/cgroup.h>
20
21#ifdef CONFIG_CGROUP_CPUACCT
22
23/*
24 * Platform specific CPU frequency hooks for cpuacct. These functions are
25 * called from the scheduler.
26 */
27struct cpuacct_charge_calls {
28 /*
29 * Platforms can take advantage of this data and use
30 * per-cpu allocations if necessary.
31 */
32 void (*init) (void **cpuacct_data);
33 void (*charge) (void *cpuacct_data, u64 cputime, unsigned int cpu);
34 void (*cpufreq_show) (void *cpuacct_data, struct cgroup_map_cb *cb);
35 /* Returns power consumed in milliWatt seconds */
36 u64 (*power_usage) (void *cpuacct_data);
37};
38
39int cpuacct_charge_register(struct cpuacct_charge_calls *fn);
40
41#endif /* CONFIG_CGROUP_CPUACCT */
42
43#endif // _CPUACCT_H_