|
10 | 10 |
|
11 | 11 | struct task_struct;
|
12 | 12 |
|
| 13 | +/* |
| 14 | + * Common vtime APIs |
| 15 | + */ |
| 16 | +#ifdef CONFIG_VIRT_CPU_ACCOUNTING |
| 17 | +extern void vtime_account_kernel(struct task_struct *tsk); |
| 18 | +extern void vtime_account_idle(struct task_struct *tsk); |
| 19 | +#else /* !CONFIG_VIRT_CPU_ACCOUNTING */ |
| 20 | +static inline void vtime_account_kernel(struct task_struct *tsk) { } |
| 21 | +#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */ |
| 22 | + |
| 23 | +#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
| 24 | +extern void arch_vtime_task_switch(struct task_struct *tsk); |
| 25 | +extern void vtime_user_enter(struct task_struct *tsk); |
| 26 | +extern void vtime_user_exit(struct task_struct *tsk); |
| 27 | +extern void vtime_guest_enter(struct task_struct *tsk); |
| 28 | +extern void vtime_guest_exit(struct task_struct *tsk); |
| 29 | +extern void vtime_init_idle(struct task_struct *tsk, int cpu); |
| 30 | +#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */ |
| 31 | +static inline void vtime_user_enter(struct task_struct *tsk) { } |
| 32 | +static inline void vtime_user_exit(struct task_struct *tsk) { } |
| 33 | +static inline void vtime_guest_enter(struct task_struct *tsk) { } |
| 34 | +static inline void vtime_guest_exit(struct task_struct *tsk) { } |
| 35 | +static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { } |
| 36 | +#endif |
| 37 | + |
| 38 | +#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
| 39 | +extern void vtime_account_irq(struct task_struct *tsk, unsigned int offset); |
| 40 | +extern void vtime_account_softirq(struct task_struct *tsk); |
| 41 | +extern void vtime_account_hardirq(struct task_struct *tsk); |
| 42 | +extern void vtime_flush(struct task_struct *tsk); |
| 43 | +#else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ |
| 44 | +static inline void vtime_account_irq(struct task_struct *tsk, unsigned int offset) { } |
| 45 | +static inline void vtime_account_softirq(struct task_struct *tsk) { } |
| 46 | +static inline void vtime_account_hardirq(struct task_struct *tsk) { } |
| 47 | +static inline void vtime_flush(struct task_struct *tsk) { } |
| 48 | +#endif |
| 49 | + |
13 | 50 | /*
|
14 | 51 | * vtime_accounting_enabled_this_cpu() definitions/declarations
|
15 | 52 | */
|
@@ -57,43 +94,6 @@ static inline void vtime_task_switch(struct task_struct *prev) { }
|
57 | 94 |
|
58 | 95 | #endif
|
59 | 96 |
|
60 |
| -/* |
61 |
| - * Common vtime APIs |
62 |
| - */ |
63 |
| -#ifdef CONFIG_VIRT_CPU_ACCOUNTING |
64 |
| -extern void vtime_account_kernel(struct task_struct *tsk); |
65 |
| -extern void vtime_account_idle(struct task_struct *tsk); |
66 |
| -#else /* !CONFIG_VIRT_CPU_ACCOUNTING */ |
67 |
| -static inline void vtime_account_kernel(struct task_struct *tsk) { } |
68 |
| -#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */ |
69 |
| - |
70 |
| -#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
71 |
| -extern void arch_vtime_task_switch(struct task_struct *tsk); |
72 |
| -extern void vtime_user_enter(struct task_struct *tsk); |
73 |
| -extern void vtime_user_exit(struct task_struct *tsk); |
74 |
| -extern void vtime_guest_enter(struct task_struct *tsk); |
75 |
| -extern void vtime_guest_exit(struct task_struct *tsk); |
76 |
| -extern void vtime_init_idle(struct task_struct *tsk, int cpu); |
77 |
| -#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */ |
78 |
| -static inline void vtime_user_enter(struct task_struct *tsk) { } |
79 |
| -static inline void vtime_user_exit(struct task_struct *tsk) { } |
80 |
| -static inline void vtime_guest_enter(struct task_struct *tsk) { } |
81 |
| -static inline void vtime_guest_exit(struct task_struct *tsk) { } |
82 |
| -static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { } |
83 |
| -#endif |
84 |
| - |
85 |
| -#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
86 |
| -extern void vtime_account_irq(struct task_struct *tsk, unsigned int offset); |
87 |
| -extern void vtime_account_softirq(struct task_struct *tsk); |
88 |
| -extern void vtime_account_hardirq(struct task_struct *tsk); |
89 |
| -extern void vtime_flush(struct task_struct *tsk); |
90 |
| -#else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ |
91 |
| -static inline void vtime_account_irq(struct task_struct *tsk, unsigned int offset) { } |
92 |
| -static inline void vtime_account_softirq(struct task_struct *tsk) { } |
93 |
| -static inline void vtime_account_hardirq(struct task_struct *tsk) { } |
94 |
| -static inline void vtime_flush(struct task_struct *tsk) { } |
95 |
| -#endif |
96 |
| - |
97 | 97 |
|
98 | 98 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
99 | 99 | extern void irqtime_account_irq(struct task_struct *tsk, unsigned int offset);
|
|
0 commit comments