diff --git a/tools/CacheAnalyzer/cacheGraph.py b/tools/CacheAnalyzer/cacheGraph.py index c931bbe..2d1b393 100755 --- a/tools/CacheAnalyzer/cacheGraph.py +++ b/tools/CacheAnalyzer/cacheGraph.py @@ -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() diff --git a/tools/CacheAnalyzer/permPolicy.py b/tools/CacheAnalyzer/permPolicy.py index a495773..e0d7ca2 100755 --- a/tools/CacheAnalyzer/permPolicy.py +++ b/tools/CacheAnalyzer/permPolicy.py @@ -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) diff --git a/tools/CacheAnalyzer/replPolicy.py b/tools/CacheAnalyzer/replPolicy.py index 5e69e99..5678380 100755 --- a/tools/CacheAnalyzer/replPolicy.py +++ b/tools/CacheAnalyzer/replPolicy.py @@ -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)) diff --git a/tools/CacheAnalyzer/setDueling.py b/tools/CacheAnalyzer/setDueling.py index 8f73478..8257f89 100755 --- a/tools/CacheAnalyzer/setDueling.py +++ b/tools/CacheAnalyzer/setDueling.py @@ -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__": diff --git a/tools/CacheAnalyzer/strideGraph.py b/tools/CacheAnalyzer/strideGraph.py index ae80f86..ef516d0 100755 --- a/tools/CacheAnalyzer/strideGraph.py +++ b/tools/CacheAnalyzer/strideGraph.py @@ -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() diff --git a/tools/cpuBench/cpuBench.py b/tools/cpuBench/cpuBench.py index aac0923..49c44db 100755 --- a/tools/cpuBench/cpuBench.py +++ b/tools/cpuBench/cpuBench.py @@ -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('\n' '
\n' '