1 /* include/linux/cpuacct.h
3 * Copyright (C) 2010 Google, Inc.
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.
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.
19 #include <linux/cgroup.h>
21 #ifdef CONFIG_CGROUP_CPUACCT
24 * Platform specific CPU frequency hooks for cpuacct. These functions are
25 * called from the scheduler.
27 struct cpuacct_charge_calls
{
29 * Platforms can take advantage of this data and use
30 * per-cpu allocations if necessary.
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
);
39 int cpuacct_charge_register(struct cpuacct_charge_calls
*fn
);
41 #endif /* CONFIG_CGROUP_CPUACCT */