-
Notifications
You must be signed in to change notification settings - Fork 0
/
pinMiBench.py
executable file
·39 lines (28 loc) · 946 Bytes
/
pinMiBench.py
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
31
32
33
34
35
36
37
38
39
#! /usr/bin/env python
import sys
import os
import fileComsoft
def main():
pinTool=sys.argv[1]
mibenchDir=sys.argv[2]
fileNames=sys.argv[3].split('|')
for i in range(len(fileNames)):
fileNames[i] = fileNames[i].lower()
matchList=[]
fileComsoft.search(mibenchDir, fileNames, matchList)
if matchList.count == 0:
print('no specified file name is found!')
else:
print(str(len(matchList)) + ' files found!')
for i in range( len(matchList)):
print i+1, matchList[i]
for f in matchList:
#1. change working directory
os.chdir(os.path.dirname(f))
#2. execute
cmd = fileComsoft.findMiBenchCmd(f)
fileComsoft.pinCmd(pinTool, cmd)
main()
#with open(sys.argv[1], 'r') as f:
# for line in f:
# print(line)