#include <timers.h>
#include <string.h>
#include <ibm/interrupt.h>
+#include <minix/config.h>
#include "../../kernel/const.h"
#include "../../kernel/type.h"
#include "../../kernel/proc.h"
FORWARD _PROTOTYPE( void monparams_dmp, (void) );
FORWARD _PROTOTYPE( void kenv_dmp, (void) );
FORWARD _PROTOTYPE( void memchunks_dmp, (void) );
+#if ENABLE_LOCK_TIMING
+FORWARD _PROTOTYPE( void timing_dmp, (void) );
+#endif
/* Some global data that is shared among several dumping procedures.
* Note that the process table copy has the same name as in the kernel
case F5: monparams_dmp(); break;
case F6: irqtab_dmp(); break;
case F7: kmessages_dmp(); break;
+#if ENABLE_LOCK_TIMING
+ case F8: timing_dmp(); break;
+#endif
case F9: diagnostics_dmp(); break;
case F10: kenv_dmp(); break;
case F11: memchunks_dmp(); break;
printf(print_buf); /* print the messages */
}
+#if ENABLE_LOCK_TIMING
+/*===========================================================================*
+ * timing_dmp *
+ *===========================================================================*/
+PRIVATE void timing_dmp()
+{
+ static struct lock_timedata timingdata[TIMING_CATEGORIES];
+ int r, c, f, skipped = 0, printed = 0, maxlines = 23, x = 0;
+ static int offsetlines = 0;
+
+ if ((r = sys_getlocktimings(timingdata)) != OK) {
+ report("warning: couldn't get copy of lock timings", r);
+ return;
+ }
+
+ for(c = 0; c < TIMING_CATEGORIES; c++) {
+ int b;
+ if(!timingdata[c].lock_timings_range[0] || !timingdata[c].binsize)
+ continue;
+ x = printf("%-*s: misses %lu, resets %lu, measurements %lu: ",
+ TIMING_NAME, timingdata[c].names,
+ timingdata[c].misses,
+ timingdata[c].resets,
+ timingdata[c].measurements);
+ for(b = 0; b < TIMING_POINTS; b++) {
+ int w;
+ if(!timingdata[c].lock_timings[b])
+ continue;
+ x += (w = printf(" %5d: %5d", timingdata[c].lock_timings_range[0] +
+ b*timingdata[c].binsize,
+ timingdata[c].lock_timings[b]));
+ if(x + w >= 80) { printf("\n"); x = 0; }
+ }
+ if(x > 0) printf("\n");
+ }
+}
+#endif
/*===========================================================================*
* kmessages_dmp *
}
print_buf[r] = 0; /* make sure it terminates */
printf("Dump of all messages generated by the kernel.\n\n");
- printf(print_buf); /* print the messages */
+ printf("%s", print_buf); /* print the messages */
}