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