summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/vtime.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index 65aef5e9d04e..aa9bfea8804a 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -12,12 +12,9 @@ struct task_struct;
12/* 12/*
13 * vtime_accounting_cpu_enabled() definitions/declarations 13 * vtime_accounting_cpu_enabled() definitions/declarations
14 */ 14 */
15#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 15#if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE)
16static inline bool vtime_accounting_cpu_enabled(void) { return true; } 16static inline bool vtime_accounting_cpu_enabled(void) { return true; }
17extern void vtime_account_irq_enter(struct task_struct *tsk); 17#elif defined(CONFIG_VIRT_CPU_ACCOUNTING_GEN)
18#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
19
20#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
21/* 18/*
22 * Checks if vtime is enabled on some CPU. Cputime readers want to be careful 19 * Checks if vtime is enabled on some CPU. Cputime readers want to be careful
23 * in that case and compute the tickless cputime. 20 * in that case and compute the tickless cputime.
@@ -38,11 +35,9 @@ static inline bool vtime_accounting_cpu_enabled(void)
38 35
39 return false; 36 return false;
40} 37}
41#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */ 38#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
42
43#ifndef CONFIG_VIRT_CPU_ACCOUNTING
44static inline bool vtime_accounting_cpu_enabled(void) { return false; } 39static inline bool vtime_accounting_cpu_enabled(void) { return false; }
45#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */ 40#endif
46 41
47 42
48/* 43/*
@@ -70,14 +65,10 @@ extern void vtime_account_user(struct task_struct *tsk);
70static inline void vtime_task_switch(struct task_struct *prev) { } 65static inline void vtime_task_switch(struct task_struct *prev) { }
71static inline void vtime_account_system(struct task_struct *tsk) { } 66static inline void vtime_account_system(struct task_struct *tsk) { }
72static inline void vtime_account_user(struct task_struct *tsk) { } 67static inline void vtime_account_user(struct task_struct *tsk) { }
73static inline void vtime_account_irq_enter(struct task_struct *tsk) { }
74#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */ 68#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
75 69
76#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 70#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
77extern void arch_vtime_task_switch(struct task_struct *tsk); 71extern void arch_vtime_task_switch(struct task_struct *tsk);
78static inline void vtime_account_irq_enter(struct task_struct *tsk) { }
79static inline void vtime_account_irq_exit(struct task_struct *tsk) { }
80
81extern void vtime_user_enter(struct task_struct *tsk); 72extern void vtime_user_enter(struct task_struct *tsk);
82 73
83static inline void vtime_user_exit(struct task_struct *tsk) 74static inline void vtime_user_exit(struct task_struct *tsk)
@@ -88,11 +79,6 @@ extern void vtime_guest_enter(struct task_struct *tsk);
88extern void vtime_guest_exit(struct task_struct *tsk); 79extern void vtime_guest_exit(struct task_struct *tsk);
89extern void vtime_init_idle(struct task_struct *tsk, int cpu); 80extern void vtime_init_idle(struct task_struct *tsk, int cpu);
90#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */ 81#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */
91static inline void vtime_account_irq_exit(struct task_struct *tsk)
92{
93 /* On hard|softirq exit we always account to hard|softirq cputime */
94 vtime_account_system(tsk);
95}
96static inline void vtime_user_enter(struct task_struct *tsk) { } 82static inline void vtime_user_enter(struct task_struct *tsk) { }
97static inline void vtime_user_exit(struct task_struct *tsk) { } 83static inline void vtime_user_exit(struct task_struct *tsk) { }
98static inline void vtime_guest_enter(struct task_struct *tsk) { } 84static inline void vtime_guest_enter(struct task_struct *tsk) { }
@@ -100,6 +86,19 @@ static inline void vtime_guest_exit(struct task_struct *tsk) { }
100static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { } 86static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { }
101#endif 87#endif
102 88
89#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
90extern void vtime_account_irq_enter(struct task_struct *tsk);
91static inline void vtime_account_irq_exit(struct task_struct *tsk)
92{
93 /* On hard|softirq exit we always account to hard|softirq cputime */
94 vtime_account_system(tsk);
95}
96#else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
97static inline void vtime_account_irq_enter(struct task_struct *tsk) { }
98static inline void vtime_account_irq_exit(struct task_struct *tsk) { }
99#endif
100
101
103#ifdef CONFIG_IRQ_TIME_ACCOUNTING 102#ifdef CONFIG_IRQ_TIME_ACCOUNTING
104extern void irqtime_account_irq(struct task_struct *tsk); 103extern void irqtime_account_irq(struct task_struct *tsk);
105#else 104#else