mirror of
https://github.com/andreas-abel/nanoBench.git
synced 2025-12-16 11:30:07 +01:00
file ownerships
This commit is contained in:
@@ -4,6 +4,7 @@ from itertools import count
|
|||||||
from collections import namedtuple, OrderedDict
|
from collections import namedtuple, OrderedDict
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from cacheLib import *
|
from cacheLib import *
|
||||||
@@ -84,7 +85,8 @@ def main():
|
|||||||
with open(args.output ,'w') as f:
|
with open(args.output ,'w') as f:
|
||||||
f.write('\n'.join(html))
|
f.write('\n'.join(html))
|
||||||
print('Graph written to ' + args.output)
|
print('Graph written to ' + args.output)
|
||||||
|
if not args.sim:
|
||||||
|
os.chown(args.output, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ def main():
|
|||||||
|
|
||||||
with open(args.output ,'w') as f:
|
with open(args.output ,'w') as f:
|
||||||
f.write('\n'.join(html))
|
f.write('\n'.join(html))
|
||||||
|
os.chown(args.output, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
else:
|
else:
|
||||||
policyClass = cacheSim.AllPolicies[args.sim]
|
policyClass = cacheSim.AllPolicies[args.sim]
|
||||||
cacheSim.getPermutations(policyClass, args.simAssoc)
|
cacheSim.getPermutations(policyClass, args.simAssoc)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -165,6 +166,7 @@ def main():
|
|||||||
|
|
||||||
with open(args.output ,'w') as f:
|
with open(args.output ,'w') as f:
|
||||||
f.write('\n'.join(html))
|
f.write('\n'.join(html))
|
||||||
|
os.chown(args.output, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
if not args.randPolicies and not args.best:
|
if not args.randPolicies and not args.best:
|
||||||
print('Possible policies: ' + ', '.join(possiblePolicies))
|
print('Possible policies: ' + ', '.join(possiblePolicies))
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from plotly.offline import plot
|
from plotly.offline import plot
|
||||||
@@ -123,6 +124,7 @@ def main():
|
|||||||
with open(args.output ,'w') as f:
|
with open(args.output ,'w') as f:
|
||||||
f.write('\n'.join(html))
|
f.write('\n'.join(html))
|
||||||
print('Output written to ' + args.output)
|
print('Output written to ' + args.output)
|
||||||
|
os.chown(args.output, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import math
|
import math
|
||||||
|
import os
|
||||||
import plotly.graph_objects as go
|
import plotly.graph_objects as go
|
||||||
from plotly.offline import plot
|
from plotly.offline import plot
|
||||||
|
|
||||||
@@ -59,6 +60,7 @@ def main():
|
|||||||
with open(args.output ,'w') as f:
|
with open(args.output ,'w') as f:
|
||||||
f.write('\n'.join(html))
|
f.write('\n'.join(html))
|
||||||
print('Graph written to ' + args.output)
|
print('Graph written to ' + args.output)
|
||||||
|
os.chown(args.output, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -2793,7 +2793,8 @@ def writeHtmlFile(folder, instrNode, title, body):
|
|||||||
folder = '/tmp/cpu-html/' + folder
|
folder = '/tmp/cpu-html/' + folder
|
||||||
if not os.path.exists(folder):
|
if not os.path.exists(folder):
|
||||||
os.makedirs(folder)
|
os.makedirs(folder)
|
||||||
with open(os.path.join(folder, filename), "w") as f:
|
htmlFilename = os.path.join(folder, filename)
|
||||||
|
with open(htmlFilename, "w") as f:
|
||||||
f.write('<html>\n'
|
f.write('<html>\n'
|
||||||
'<head>\n'
|
'<head>\n'
|
||||||
'<title>' + title + '</title>\n'
|
'<title>' + title + '</title>\n'
|
||||||
@@ -2802,6 +2803,7 @@ def writeHtmlFile(folder, instrNode, title, body):
|
|||||||
+ body +
|
+ body +
|
||||||
'</body>\n'
|
'</body>\n'
|
||||||
'</html>\n')
|
'</html>\n')
|
||||||
|
os.chown(htmlFilename, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
|
|
||||||
# returns list of xml instruction nodes
|
# returns list of xml instruction nodes
|
||||||
@@ -3492,9 +3494,12 @@ def main():
|
|||||||
rough_string = ET.tostring(XMLRoot, 'utf-8')
|
rough_string = ET.tostring(XMLRoot, 'utf-8')
|
||||||
reparsed = minidom.parseString(rough_string)
|
reparsed = minidom.parseString(rough_string)
|
||||||
f.write('\n'.join([line for line in reparsed.toprettyxml(indent=' ').split('\n') if line.strip()]))
|
f.write('\n'.join([line for line in reparsed.toprettyxml(indent=' ').split('\n') if line.strip()]))
|
||||||
|
os.chown(args.output, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
with tarfile.open('genhtml-' + arch + (('-IACA' + iacaVersion) if useIACA else '-Measurements') + '.tar.gz', "w:gz") as tar:
|
tarFilename = 'genhtml-' + arch + (('-IACA' + iacaVersion) if useIACA else '-Measurements') + '.tar.gz'
|
||||||
|
with tarfile.open(tarFilename, "w:gz") as tar:
|
||||||
tar.add('/tmp/cpu-html/', arcname=os.path.sep)
|
tar.add('/tmp/cpu-html/', arcname=os.path.sep)
|
||||||
|
os.chown(tarFilename, int(os.environ['SUDO_UID']), int(os.environ['SUDO_GID']))
|
||||||
|
|
||||||
shutil.rmtree('/tmp/cpu-html/')
|
shutil.rmtree('/tmp/cpu-html/')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user