Example #1
0
import traceparser as parser

HOST = 'localhost'
PORT = 3306
USER = '******'
DB = 'sestet'

# Main

if len(sys.argv) != 3:
  print "Usage: %s TrialName TraceFile" % sys.argv[0]
  exit(-1)

trial_spec = sys.argv[1]

parser.parse_file(sys.argv[2])

conn = None
cursor = None


try:
  conn = mdb.connect(host = HOST, user = USER, port = PORT, db = DB)
  cursor = conn.cursor()
  cursor.execute("SELECT add_trial('%s')" % trial_spec)
  trial_id = cursor.fetchone()[0]
  print "Trial#: %d" % trial_id
  
  for func in parser.func_list:
    cursor.callproc('add_function', \
                    (func.name, func.get_parent().name, \
Example #2
0
import sys
from collections import defaultdict

import traceparser as parser

# Main

file = sys.argv[-1]
parser.parse_file(file)

# Prints the function sequence
for func in parser.func_list:
  print func.to_string()

print "Number of skipped lines: %d" % parser.num_skipped
print "Number of partial function exits: %d" % parser.num_partial_exit

# Prints the highest level functions
for proc in parser.proc_dict.keys():
  root = parser.proc_dict[proc]
  func_stat = defaultdict(list)
  for func in root.children:
    func_stat[func.name].append(func.duration)
  print "%s\n%s" % (proc, func_stat)
  
  for func in root.broken_entries:
    print "Broken Entry: %s" % func.to_string()