NMI sampling

- if profile --nmi kernel uses NMI watchdog based sampling based on
  Intel architecture performance counters

- using NMI makes kernel profiling possible

- watchdog kernel lockup detection is disabled while sampling as we
  may get unpredictable interrupts in kernel and thus possibly many
  false positives

- if watchdog is not enabled at boot time, profiling enables it and
  turns it of again when done
This commit is contained in:
Tomas Hruby
2010-09-23 10:49:45 +00:00
parent 74c5cd7668
commit e63b85a50b
8 changed files with 197 additions and 45 deletions

View File

@@ -5,12 +5,17 @@
#if SPROFILE /* statistical profiling */
#include "arch_watchdog.h"
EXTERN int sprofiling; /* whether profiling is running */
EXTERN int sprofiling_type; /* whether profiling is running */
EXTERN int sprof_mem_size; /* available user memory for data */
EXTERN struct sprof_info_s sprof_info; /* profiling info for user program */
EXTERN vir_bytes sprof_data_addr_vir; /* user address to write data */
EXTERN endpoint_t sprof_ep; /* user process */
_PROTOTYPE(void nmi_sprofile_handler, (struct nmi_frame * frame));
#endif /* SPROFILE */