summaryrefslogtreecommitdiffhomepage
path: root/tools/trace/trace.py
blob: 6850a4cdff6561adc5cfc0a945cd891a6e9b361d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/usr/env python

from optparse import OptionParser
import sys
sys.path.append ('../../host/')
from tcreator.tcreator import *
from tinter.tinter import *

print "Trace System v1.0 by APBTeam\n"

parser = OptionParser()
parser.add_option("-e", "--enum-name", dest="enum_name",
        help="provide the enumerator name", metavar="ENUM")
parser.add_option("-o", "--output", dest="outfile",
        help="Store the eunerator on the output file")
parser.add_option("-i", "--infile", dest="infile",
        help="Read the data from the file")
parser.add_option("-t", "--type", dest="type",
        help="create to create the enumeration, inter to read the log from the flash.")

[options, args] = parser.parse_args()

if options.type == 'create':
    cre = TCreator (options.infile, options.outfile, options.enum_name)
    cre.create ()
elif options.type == "inter":
    inter = TInter (options.infile, options.outfile)
    inter.trace_print()
else:
    print "see the help\n python trace --help"