ia64/xen-unstable

view tools/misc/xen_dmesg.py @ 1372:5a6113c65ead

bitkeeper revision 1.891.1.12 (40a248b0WTGoOa9206iWkyGN0mTPNw)

Allow forcing of IRQ trigger-type to edge or level
(NB. DANGEROUS!).
author kaf24@scramble.cl.cam.ac.uk
date Wed May 12 15:54:24 2004 +0000 (2004-05-12)
parents 9ccd60698e09
children
line source
1 #!/usr/bin/env python
3 """Reads out the contents of the console ring
5 Usage: readconsolering.py [-c]
6 The -c option causes the contents to be cleared.
7 """
9 import sys, Xc # import the Xc Xen Control module
11 xc = Xc.new() # get a new instance of the control interface
13 clear_buffer = False
15 if sys.argv[1:] != []:
16 if sys.argv[1] == "-c":
17 clear_buffer = True
18 else:
19 print >> sys.stderr, "Usage: " + sys.argv[0] + """ [-c]
20 Reads the contents of the console buffer.
21 (specifying -c will also clear current contents)"""
23 # Get the console ring's contents as a string and print it out.
24 # If argument to readconsolering is true then the buffer is cleared as well as
25 # fetching the (pre-clearing) contents.
26 print xc.readconsolering(clear_buffer)