fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / kernel / vserver / sched_proc.h
1 #ifndef _VX_SCHED_PROC_H
2 #define _VX_SCHED_PROC_H
3
4
5 static inline
6 int vx_info_proc_sched(struct _vx_sched *sched, char *buffer)
7 {
8         int length = 0;
9
10         length += sprintf(buffer,
11                 "FillRate:\t%8d,%d\n"
12                 "Interval:\t%8d,%d\n"
13                 "TokensMin:\t%8d\n"
14                 "TokensMax:\t%8d\n"
15                 "PrioBias:\t%8d\n"
16                 ,sched->fill_rate[0]
17                 ,sched->fill_rate[1]
18                 ,sched->interval[0]
19                 ,sched->interval[1]
20                 ,sched->tokens_min
21                 ,sched->tokens_max
22                 ,sched->prio_bias
23                 );
24         return length;
25 }
26
27 static inline
28 int vx_info_proc_sched_pc(struct _vx_sched_pc *sched_pc,
29         char *buffer, int cpu)
30 {
31         int length = 0;
32
33         length += sprintf(buffer + length,
34                 "cpu %d: %lld %lld %lld %ld %ld"
35                 ,cpu
36                 ,(unsigned long long)sched_pc->user_ticks
37                 ,(unsigned long long)sched_pc->sys_ticks
38                 ,(unsigned long long)sched_pc->hold_ticks
39                 ,sched_pc->token_time
40                 ,sched_pc->idle_time
41                 );
42         length += sprintf(buffer + length,
43                 " %c%c %d %d %d %d/%d %d/%d"
44                 ,(sched_pc->flags & VXSF_ONHOLD) ? 'H' : 'R'
45                 ,(sched_pc->flags & VXSF_IDLE_TIME) ? 'I' : '-'
46                 ,sched_pc->tokens
47                 ,sched_pc->tokens_min
48                 ,sched_pc->tokens_max
49                 ,sched_pc->fill_rate[0]
50                 ,sched_pc->interval[0]
51                 ,sched_pc->fill_rate[1]
52                 ,sched_pc->interval[1]
53                 );
54         length += sprintf(buffer + length,
55                 " %d %d\n"
56                 ,sched_pc->prio_bias
57                 ,sched_pc->vavavoom
58                 );
59         return length;
60 }
61
62 #endif  /* _VX_SCHED_PROC_H */