define LogPrintAt set $offset = (int)$arg0 set $len = (int)$arg1 if $offset > logPosAtomic.consumer.value set $offset = logPosAtomic.consumer.value end if $offset > logBufferSize set $offset = logBufferSize end if $len > $offset set $len = $offset end # Log is a circular buffer; find start of the portion to be dumped set $start = (logPosAtomic.consumer.value - $offset) % logBufferSize if $start + $len <= logBufferSize # The portion to be dumped is contiguous dump memory /dev/tty &logBuffer[$start] &logBuffer[$start+$len] else # The portion to be dumped wraps around the end of the buffer dump memory /dev/tty &logBuffer[$start] &logBuffer[logBufferSize] dump memory /dev/tty &logBuffer[0] &logBuffer[$start+$len-logBufferSize] end end document LogPrintAt starting at offset arg0 from the end, print arg1 characters of the VMkernel debug log buffer. end define LogPrintTail LogPrintAt $arg0 $arg0 end document LogPrintTail print last LEN characters of the VMkernel debug log buffer. end define LogDump set $offset = logBufferSize set $len = logBufferSize if $offset > logPosAtomic.consumer.value set $offset = logPosAtomic.consumer.value end if $len > $offset set $len = $offset end # The log is a circular buffer; find the current start set $start = (logPosAtomic.consumer.value - $offset) % logBufferSize if $start + $len <= logBufferSize # The valid portion is contiguous dump memory $arg0 &logBuffer[$start] &logBuffer[$start+$len] else # The valid portion wraps around the end of the buffer dump memory $arg0 &logBuffer[$start] &logBuffer[logBufferSize] dump memory /tmp/_LogDump_ &logBuffer[0] &logBuffer[$start+$len-logBufferSize] shell cat /tmp/_LogDump_ >> $arg0 shell rm /tmp/_LogDump_ end end document LogDump dump VMKernel log buffer to a file; takes a few minutes to complete! end define LogLevels set $i=0 printf "Default\tCurrent\tName\n" while ($i < logNumDesc) printf "%d\t%d\t%s\n", logDesc[$i].defaultVal, logLevelPtr[$i], logDesc[$i].name set $i=$i+1 end end document LogLevels print various vmkernel LOG levels in debug build end