Created
April 10, 2015 06:02
-
-
Save williamtu/6ebbb8249b85d56fc78a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import curses | |
import sys, os, time, optparse, ctypes | |
from ctypes import * | |
class DebugfsProvider(object): | |
def __init__(self): | |
self.base = '/sys/kernel/debug/kvm' | |
self._fields = os.listdir(self.base) | |
def fields(self): | |
return self._fields | |
def select(self, fields): | |
self._fields = fields | |
def read(self): | |
def val(key): | |
return int(file(self.base + '/' + key).read()) | |
return dict([(key, val(key)) for key in self._fields]) | |
vmx_exit_reasons = { | |
0: 'EXCEPTION_NMI', | |
1: 'EXTERNAL_INTERRUPT', | |
2: 'TRIPLE_FAULT', | |
7: 'PENDING_INTERRUPT', | |
8: 'NMI_WINDOW', | |
9: 'TASK_SWITCH', | |
10: 'CPUID', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment