Module ps_parsers :: Class recording_parser
[show private | hide private]
[frames | no frames]

Class recording_parser


Process Stalker stores generated trace meta-data in recording files. These recordings serve as the starting point for generating "live" visualizations and must be processed prior to use. The purpose of this class is to alleviate the burden of handling recordings by providing an abstraction layer.

Pre-processed recordings are stored in the following format:
   hit time:thread id:module name:module base address:breakpoint offset address
   002d97d0:00000a28:irc.dll:00401000:000092d1
Post-processed recordings add the function offset address as as the second to last field:
   hit time: thread id:module name:module base address:breakpoint function offset address:breakpoint offset address
   002d97d0:00000a28:irc.dll:00401000:00009160:000092d1

To Do: Implement routines to set individual recording entries. I currently have no use for this.

Method Summary
  __init__(self)
Initialize internal member variables.
  __module_test__(self)
Run a few basic tests to ensure the class is working.
Tuple get_recording_entry(self, index)
Get the recording entry at the specified index.
Integer num_entries(self)
Get the entry count for this recording.
  parse(self, filename)
Open the specified *processed* recording and process the data into the internal lists.
  pre_process(self, filename, rebase)
Open the specified recording and process the data into the internal lists.
  save(self, filename)
Save a recording to the specified file.

Method Details

__init__(self)
(Constructor)

Initialize internal member variables.

__module_test__(self)

Run a few basic tests to ensure the class is working.

get_recording_entry(self, index)

Get the recording entry at the specified index.
Parameters:
index - Recording index
           (type=Integer)
Returns:
Time, thread ID, module name, module base address, function offset address, node offset address
           (type=Tuple)
Raises:
psx - An exception is raised if the requested index is out of range.

num_entries(self)

Get the entry count for this recording.
Returns:
Recording count
           (type=Integer)

parse(self, filename)

Open the specified *processed* recording and process the data into the internal lists. File format:
   hit time:thread id:module name:mode base addr.:breakpoint function offset addr.:breakpoint offset addr.
   002d97d0:00000a28:irc.dll:00401000:00009160:000092d1
Parameters:
filename - Filename
           (type=String)
Raises:
psx - An exception is raised if requested recording file can not be opened.

pre_process(self, filename, rebase=0)

Open the specified recording and process the data into the internal lists. File format:
   hit time:thread id:module name:mode base addr.:breakpoint function offset addr.:breakpoint offset addr.
   002d97d0:00000a28:irc.dll:00401000:00009160:000092d1
The second to final field, 'function offset address, is added in the processed output. Processed recorder files will be generated for each thread found within the pre-processed recording.
Parameters:
filename - Filename
           (type=String)
rebase - Optional module rebase address
           (type=DWORD)
Raises:
psx - An exception is raised if requested recording file can not be opened.

save(self, filename)

Save a recording to the specified file. The contents of the recording are generated from our internal variables in sorted order. File format:
   hit time:thread id:module name:mode base addr.:breakpoint function offset addr.:breakpoint offset addr.
   002d97d0:00000a28:irc.dll:00401000:00009160:000092d1
Parameters:
filename - Filename
           (type=String)
Raises:
psx - An exception is raised if the specified file can not be opened for writing.

Generated by Epydoc 2.1 on Tue Jul 05 12:05:31 2005 http://epydoc.sf.net