summaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3762fe4e3a80..f72e81395dac 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1647,7 +1647,10 @@ struct task_struct {
1647 int __user *set_child_tid; /* CLONE_CHILD_SETTID */ 1647 int __user *set_child_tid; /* CLONE_CHILD_SETTID */
1648 int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ 1648 int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */
1649 1649
1650 cputime_t utime, stime, utimescaled, stimescaled; 1650 cputime_t utime, stime;
1651#ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME
1652 cputime_t utimescaled, stimescaled;
1653#endif
1651 cputime_t gtime; 1654 cputime_t gtime;
1652 struct prev_cputime prev_cputime; 1655 struct prev_cputime prev_cputime;
1653#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 1656#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
@@ -2240,8 +2243,6 @@ struct task_struct *try_get_task_struct(struct task_struct **ptask);
2240#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 2243#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
2241extern void task_cputime(struct task_struct *t, 2244extern void task_cputime(struct task_struct *t,
2242 cputime_t *utime, cputime_t *stime); 2245 cputime_t *utime, cputime_t *stime);
2243extern void task_cputime_scaled(struct task_struct *t,
2244 cputime_t *utimescaled, cputime_t *stimescaled);
2245extern cputime_t task_gtime(struct task_struct *t); 2246extern cputime_t task_gtime(struct task_struct *t);
2246#else 2247#else
2247static inline void task_cputime(struct task_struct *t, 2248static inline void task_cputime(struct task_struct *t,
@@ -2253,6 +2254,13 @@ static inline void task_cputime(struct task_struct *t,
2253 *stime = t->stime; 2254 *stime = t->stime;
2254} 2255}
2255 2256
2257static inline cputime_t task_gtime(struct task_struct *t)
2258{
2259 return t->gtime;
2260}
2261#endif
2262
2263#ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME
2256static inline void task_cputime_scaled(struct task_struct *t, 2264static inline void task_cputime_scaled(struct task_struct *t,
2257 cputime_t *utimescaled, 2265 cputime_t *utimescaled,
2258 cputime_t *stimescaled) 2266 cputime_t *stimescaled)
@@ -2262,12 +2270,15 @@ static inline void task_cputime_scaled(struct task_struct *t,
2262 if (stimescaled) 2270 if (stimescaled)
2263 *stimescaled = t->stimescaled; 2271 *stimescaled = t->stimescaled;
2264} 2272}
2265 2273#else
2266static inline cputime_t task_gtime(struct task_struct *t) 2274static inline void task_cputime_scaled(struct task_struct *t,
2275 cputime_t *utimescaled,
2276 cputime_t *stimescaled)
2267{ 2277{
2268 return t->gtime; 2278 task_cputime(t, utimescaled, stimescaled);
2269} 2279}
2270#endif 2280#endif
2281
2271extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); 2282extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
2272extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); 2283extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
2273 2284