no more scheduling queue dumps (kernel will print this over serial);

initial vm stats retrieve support
This commit is contained in:
Ben Gras 2009-09-21 14:47:24 +00:00
parent 90be3a051f
commit 08d291da53
3 changed files with 12 additions and 53 deletions

View file

@ -8,6 +8,7 @@
*/
#include "inc.h"
#include <minix/vm.h>
struct hook_entry {
int key;
@ -21,7 +22,7 @@ struct hook_entry {
{ F5, monparams_dmp, "Boot monitor parameters" },
{ F6, irqtab_dmp, "IRQ hooks and policies" },
{ F7, kmessages_dmp, "Kernel messages" },
{ F9, sched_dmp, "Scheduling queues" },
{ F8, vm_dmp, "VM status" },
{ F10, kenv_dmp, "Kernel parameters" },
{ F11, timing_dmp, "Timing details (if enabled)" },
{ SF1, mproc_dmp, "Process manager process table" },
@ -100,3 +101,11 @@ PUBLIC void mapping_dmp(void)
printf("\n");
}
/*===========================================================================*
* vm_dmp *
*===========================================================================*/
PUBLIC void vm_dmp(void)
{
vm_ctl(VCTLP_STATS_MEM, 0);
}

View file

@ -224,54 +224,6 @@ PUBLIC void image_dmp()
printf("\n");
}
/*===========================================================================*
* sched_dmp *
*===========================================================================*/
PUBLIC void sched_dmp()
{
struct proc *rdy_head[NR_SCHED_QUEUES];
struct kinfo kinfo;
register struct proc *rp;
vir_bytes ptr_diff;
int r;
/* First obtain a scheduling information. */
if ((r = sys_getschedinfo(proc, rdy_head)) != OK) {
report("IS","warning: couldn't get copy of process table", r);
return;
}
/* Then obtain kernel addresses to correct pointer information. */
if ((r = sys_getkinfo(&kinfo)) != OK) {
report("IS","warning: couldn't get kernel addresses", r);
return;
}
/* Update all pointers. Nasty pointer algorithmic ... */
ptr_diff = (vir_bytes) proc - (vir_bytes) kinfo.proc_addr;
for (r=0;r<NR_SCHED_QUEUES; r++)
if (rdy_head[r] != NIL_PROC)
rdy_head[r] =
(struct proc *)((vir_bytes) rdy_head[r] + ptr_diff);
for (rp=BEG_PROC_ADDR; rp < END_PROC_ADDR; rp++)
if (rp->p_nextready != NIL_PROC)
rp->p_nextready =
(struct proc *)((vir_bytes) rp->p_nextready + ptr_diff);
/* Now show scheduling queues. */
printf("Dumping scheduling queues.\n");
for (r=0;r<NR_SCHED_QUEUES; r++) {
rp = rdy_head[r];
if (!rp) continue;
printf("%2d: ", r);
while (rp != NIL_PROC) {
printf("%3d ", rp->p_nr);
rp = rp->p_nextready;
}
printf("\n");
}
printf("\n");
}
/*===========================================================================*
* kenv_dmp *
@ -311,9 +263,6 @@ PUBLIC void kenv_dmp()
printf("- nr_tasks: %3u\n", kinfo.nr_tasks);
printf("- release: %.6s\n", kinfo.release);
printf("- version: %.6s\n", kinfo.version);
#if DEBUG_LOCK_CHECK
printf("- relocking: %d\n", kinfo.relocking);
#endif
printf("\n");
}
@ -363,7 +312,7 @@ PUBLIC void privileges_dmp()
return;
}
printf("\n--nr-id-name---- -flags- -traps- grants -ipc_to-- -system calls--\n");
printf("\n--nr-id-name---- -flags- -traps- grants -ipc_to-- -ipc_sr-- -system calls--\n");
PROCLOOP(rp, oldrp)
r = -1;

View file

@ -6,6 +6,7 @@ _PROTOTYPE( int main, (int argc, char **argv) );
/* dmp.c */
_PROTOTYPE( int do_fkey_pressed, (message *m) );
_PROTOTYPE( void mapping_dmp, (void) );
_PROTOTYPE( void vm_dmp, (void) );
/* dmp_kernel.c */
_PROTOTYPE( void proctab_dmp, (void) );