LDFLAGS = -i
LIBS = -lsys -lsysutil
-OBJ = is.o dmp.o dmp_kernel.o dmp_pm.o dmp_fs.o dmp_rs.o
+OBJ = main.o dmp.o dmp_kernel.o dmp_pm.o dmp_fs.o dmp_rs.o dmp_ds.o
# build local binary
all build: $(SERVER)
* handle_fkey: handle a function key pressed notification
*/
-#include "is.h"
+#include "inc.h"
-#define NHOOKS 18
+/* Define hooks for the debugging dumps. This table maps function keys
+ * onto a specific dump and provides a description for it.
+ */
+#define NHOOKS 19
struct hook_entry {
int key;
{ SF5, mapping_dmp, "Print key mappings" },
{ SF6, rproc_dmp, "Reincarnation server process table" },
{ SF7, holes_dmp, "Memory free list" },
+ { SF8, data_store_dmp, "Data store contents" },
};
/*===========================================================================*
* handle_fkey *
*===========================================================================*/
-#define pressed(k) ((F1<=(k) && (k)<=F12 && bit_isset(m->FKEY_FKEYS, ((k)-F1+1))) \
+#define pressed(k) ((F1<=(k)&&(k)<=F12 && bit_isset(m->FKEY_FKEYS,((k)-F1+1)))\
|| (SF1<=(k) && (k)<=SF12 && bit_isset(m->FKEY_SFKEYS, ((k)-SF1+1))))
-
-PUBLIC int do_fkey_pressed(message *m)
+PUBLIC int do_fkey_pressed(m)
+message *m; /* notification message */
{
int s, h;
report("IS", "warning, sendrec to TTY failed", s);
/* Now check which keys were pressed: F1-F12, SF1-SF12. */
- for(h = 0; h < NHOOKS; h++)
- if(pressed(hooks[h].key))
- hooks[h].function();
+ for(h=0; h < NHOOKS; h++)
+ if(pressed(hooks[h].key))
+ hooks[h].function();
- /* Inhibit sending a reply message. */
+ /* Don't send a reply message. */
return(EDONTREPLY);
}
-PRIVATE char *keyname(int key)
+/*===========================================================================*
+ * key_name *
+ *===========================================================================*/
+PRIVATE char *key_name(int key)
{
static char name[15];
sprintf(name, "Shift+F%d", key - SF1 + 1);
else
sprintf(name, "?");
-
return name;
}
-
+/*===========================================================================*
+ * reboot_dmp *
+ *===========================================================================*/
PUBLIC void reboot_dmp(void)
{
if (sys_panic) sys_abort(RBT_HALT);
}
+/*===========================================================================*
+ * mapping_dmp *
+ *===========================================================================*/
PUBLIC void mapping_dmp(void)
{
- int h;
-
- printf(
-"Function key mappings for debug dumps in IS server.\n"
-" Key Description\n"
-"-------------------------------------------------------------------------\n");
- for(h = 0; h < NHOOKS; h++)
- printf(" %10s. %s\n", keyname(hooks[h].key), hooks[h].name);
+ int h;
- printf("\n");
+ printf("Function key mappings for debug dumps in IS server.\n");
+ printf(" Key Description\n");
+ printf("-------------------------------------");
+ printf("------------------------------------\n");
- return;
+ for(h=0; h < NHOOKS; h++)
+ printf(" %10s. %s\n", key_name(hooks[h].key), hooks[h].name);
+ printf("\n");
}
--- /dev/null
+/* This file contains procedures to dump DS data structures.
+ *
+ * The entry points into this file are
+ * data_store_dmp: display DS data store contents
+ *
+ * Created:
+ * Oct 18, 2005: by Jorrit N. Herder
+ */
+
+#include "inc.h"
+#include "../ds/store.h"
+
+PUBLIC struct data_store store[NR_DS_KEYS];
+
+FORWARD _PROTOTYPE( char *s_flags_str, (int flags) );
+
+/*===========================================================================*
+ * data_store_dmp *
+ *===========================================================================*/
+PUBLIC void data_store_dmp()
+{
+ struct data_store *dsp;
+ int i,j, n=0;
+ static int prev_i=0;
+
+
+ printf("Data Store (DS) contents dump\n");
+
+ getsysinfo(DS_PROC_NR, SI_DATA_STORE, store);
+
+ printf("-slot- -key- -flags- -val_l1- -val_l2-\n");
+
+ for (i=prev_i; i<NR_DS_KEYS; i++) {
+ dsp = &store[i];
+ if (! dsp->ds_flags & DS_IN_USE) continue;
+ if (++n > 22) break;
+ printf("%3d %8d %s [%8d] [%8d] \n",
+ i, dsp->ds_key,
+ s_flags_str(dsp->ds_flags),
+ dsp->ds_val_l1,
+ dsp->ds_val_l2
+ );
+ }
+ if (i >= NR_DS_KEYS) i = 0;
+ else printf("--more--\r");
+ prev_i = i;
+}
+
+
+PRIVATE char *s_flags_str(int flags)
+{
+ static char str[5];
+ str[0] = (flags & DS_IN_USE) ? 'U' : '-';
+ str[1] = (flags & DS_PUBLIC) ? 'P' : '-';
+ str[2] = '-';
+ str[3] = '\0';
+
+ return(str);
+}
+
* Oct 01, 2004: by Jorrit N. Herder
*/
-#include "is.h"
+#include "inc.h"
#include "../fs/const.h"
#include "../fs/fproc.h"
#include <minix/dmap.h>
/* Debugging dump procedures for the kernel. */
-#include "is.h"
+#include "inc.h"
#include <timers.h>
#include <ibm/interrupt.h>
#include "../../kernel/const.h"
printf("- kmem_size: %5u\n", kinfo.kmem_size);
printf("- bootdev_base: %5u\n", kinfo.bootdev_base);
printf("- bootdev_size: %5u\n", kinfo.bootdev_size);
- printf("- bootdev_mem: %5u\n", kinfo.bootdev_mem);
+ printf("- ramdev_base: %5u\n", kinfo.ramdev_base);
+ printf("- ramdev_size: %5u\n", kinfo.ramdev_size);
printf("- params_base: %5u\n", kinfo.params_base);
printf("- params_size: %5u\n", kinfo.params_size);
printf("- nr_procs: %3u\n", kinfo.nr_procs);
* May 11, 2005: by Jorrit N. Herder
*/
-#include "is.h"
+#include "inc.h"
#include "../pm/mproc.h"
#include <timers.h>
#include <minix/config.h>
* Oct 03, 2005: by Jorrit N. Herder
*/
-#include "is.h"
-#include "../rs/rproc.h"
+#include "inc.h"
+#include "../rs/manager.h"
PUBLIC struct rproc rproc[NR_SYS_PROCS];
getsysinfo(RS_PROC_NR, SI_PROC_TAB, rproc);
printf("Reincarnation Server (RS) system process table dump\n");
- printf("-proc nr-pid- -dev nr/ style- -ticks-checked-alive-- --flags-- -command (argc)-\n");
+ printf("-proc-pid-flag--dev- -T--checked--alive- -starts-backoff- -command (argc)-\n");
for (i=prev_i; i<NR_SYS_PROCS; i++) {
rp = &rproc[i];
- if (! rp->r_flags & IN_USE) continue;
+ if (! rp->r_flags & RS_IN_USE) continue;
if (++n > 22) break;
- printf("%3d %5d %3d/%2d %3u %8u %8u %s %s (%d)",
+ printf("%3d %5d %s %3d/%2d %3u %8u %8u %3dx %3d %s (%d)",
rp->r_proc_nr, rp->r_pid,
+ s_flags_str(rp->r_flags),
rp->r_dev_nr, rp->r_dev_style,
rp->r_period,
- rp->r_check_tm,
- rp->r_alive_tm,
- s_flags_str(rp->r_flags),
+ rp->r_check_tm, rp->r_alive_tm,
+ rp->r_restarts, rp->r_backoff,
rp->r_cmd,
rp->r_argc
);
PRIVATE char *s_flags_str(int flags)
{
static char str[5];
- str[0] = (flags & IN_USE) ? 'U' : '-';
- str[1] = (flags & EXIT_PENDING) ? 'E' : '-';
+ str[0] = (flags & RS_IN_USE) ? 'U' : '-';
+ str[1] = (flags & RS_EXITING) ? 'E' : '-';
str[2] = '-';
str[3] = '\0';
* Apr 29, 2004 by Jorrit N. Herder
*/
-#include "is.h"
+#include "inc.h"
/* Set debugging level to 0, 1, or 2 to see no, some, all debug output. */
#define DEBUG_LEVEL 1
case FKEY_PRESSED:
result = do_fkey_pressed(&m_in);
break;
+ case DEV_PING:
+ notify(m_in.m_source);
+ continue;
default:
report("IS","warning, got illegal request from:", m_in.m_source);
result = EINVAL;
/* Set key mappings. IS takes all of F1-F12 and Shift+F1-F6. */
fkeys = sfkeys = 0;
for (i=1; i<=12; i++) bit_set(fkeys, i);
- for (i=1; i<= 7; i++) bit_set(sfkeys, i);
+ for (i=1; i<= 8; i++) bit_set(sfkeys, i);
if ((s=fkey_map(&fkeys, &sfkeys)) != OK)
report("IS", "warning, fkey_map failed:", s);
}
/* dmp_rs.c */
_PROTOTYPE( void rproc_dmp, (void) );
+
+/* dmp_ds.c */
+_PROTOTYPE( void data_store_dmp, (void) );