# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import os import sys import glob from collections import defaultdict import cPickle as pickle import locale import kmaxdata import numpy import itertools import re version = "3.19" datafiles = kmaxdata.buildsystem_datafiles(version) print "%% program:", os.path.basename(sys.argv[0]) print "%% version: ", version print "%% data files:", " ".join(datafiles) locale.setlocale(locale.LC_ALL, 'en_US.utf8') # Read pickled data object allbuildsystemdata = {} for datafile in datafiles: # if "x86" in datafile: with open(datafile, "rb") as f: buildsystemdata = pickle.load(f) if buildsystemdata.version == version: allbuildsystemdata[buildsystemdata.arch] = buildsystemdata
argparser.add_argument('version', type=str, help="""the git tag name of the Linux version""") # argparser.add_argument('arch', # type=str, # help="""the arch subdirectory name of the architecture""") args = argparser.parse_args() version = args.version # arch = args.arch # if arch == "x86": # arch = linuxinstance.get_x86_archname(version) buildsystem_data = {} for buildsystem_datafile in kmaxdata.buildsystem_datafiles(version): with open(buildsystem_datafile, 'rb') as f: data = pickle.load(f) buildsystem_data[data.arch] = data all = set([]) for arch in buildsystem_data.keys(): all.update([ "CONFIG_" + c for c in buildsystem_data[arch].config_vars ]) unselectable = {} for arch in buildsystem_data.keys(): unselectable[arch] = all.difference([ "CONFIG_" + c for c in buildsystem_data[arch].config_vars ]) roots = defaultdict(set)
("3.14",3,2014), ("3.15",6,2014), ("3.16",8,2014), ("3.17",10,2014), ("3.18",12,2014), ("3.19",2,2015), ] data = [] if use_cached_data: with open("tmp_data", "rb") as f: data = pickle.load(f) else: for version, month, year in versions: datafiles = kmaxdata.buildsystem_datafiles(version, path=datapath) sys.stderr.write("%s\n" % (datafiles)) if len(datafiles) == 0: continue buildsystemdata = {} for datafile in datafiles: with open(datafile, "rb") as f: inputdata = pickle.load(f) if inputdata.version == version: sys.stderr.write("%s %s\n" % (inputdata.version, inputdata.arch)) buildsystemdata[inputdata.arch] = inputdata allconfigs = set() allunits = set() compunits = set() libunits = set()
import locale import kmaxdata import numpy outformats = [ 'tex', 'csv', 'x86' ] # if len(sys.argv) < 3: # sys.stderr.write("USAGE: %s tex|csv|x86 buildsystem_1 buildsystem_2 ...\n" % (os.path.basename(sys.argv[0]))) # exit(1) # outformat = sys.argv[1] # datafiles = sys.argv[2:] outformat = 'tex' version = "3.19" datafiles = kmaxdata.buildsystem_datafiles(version) if outformat not in outformats: print "output format not supported. supported formats: %s" % (", ".join(outformats),) exit(1) if outformat == "tex" or outformat == "x86": format_number = lambda number: locale.format("%d", number, grouping=True) format_range = lambda numbers: " & ".join(numbers) elif outformat == "csv": format_number = lambda number: str(number) format_range = lambda numbers: ",".join(numbers) if outformat == "tex": print "%% program:", os.path.basename(sys.argv[0]) print "%% data files:", " ".join(datafiles)