- map in as much memory as is necessary in 4MB chunks to
[minix.git] / servers / is / dmp_rs.c
blobc3f738954c663f490d2cdc35f322dc228f871766
1 /* This file contains procedures to dump RS data structures.
3 * The entry points into this file are
4 * rproc_dump: display RS system process table
6 * Created:
7 * Oct 03, 2005: by Jorrit N. Herder
8 */
10 #include "inc.h"
11 #include <timers.h>
12 #include <minix/rs.h>
13 #include "../../kernel/priv.h"
14 #include "../rs/manager.h"
16 PUBLIC struct rproc rproc[NR_SYS_PROCS];
18 FORWARD _PROTOTYPE( char *s_flags_str, (int flags) );
20 /*===========================================================================*
21 * rproc_dmp *
22 *===========================================================================*/
23 PUBLIC void rproc_dmp()
25 struct rproc *rp;
26 int i,j, n=0;
27 static int prev_i=0;
29 getsysinfo(RS_PROC_NR, SI_PROC_TAB, rproc);
31 printf("Reincarnation Server (RS) system process table dump\n");
32 printf("-endpoint-flag--dev- -T---checked----alive-starts-backoff-label command-\n");
33 for (i=prev_i; i<NR_SYS_PROCS; i++) {
34 rp = &rproc[i];
35 if (! rp->r_flags & RS_IN_USE) continue;
36 if (++n > 22) break;
37 printf("%9d %s %3d/%2d %3u %8u %8u %4dx %3d %s %s",
38 rp->r_proc_nr_e,
39 s_flags_str(rp->r_flags),
40 rp->r_dev_nr, rp->r_dev_style,
41 rp->r_period,
42 rp->r_check_tm, rp->r_alive_tm,
43 rp->r_restarts, rp->r_backoff,
44 rp->r_label,
45 rp->r_cmd
47 printf("\n");
49 if (i >= NR_SYS_PROCS) i = 0;
50 else printf("--more--\r");
51 prev_i = i;
55 PRIVATE char *s_flags_str(int flags)
57 static char str[5];
58 str[0] = (flags & RS_IN_USE) ? 'U' : '-';
59 str[1] = (flags & RS_EXITING) ? 'E' : '-';
60 str[2] = '-';
61 str[3] = '\0';
63 return(str);