diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2011-08-15 00:51:06 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2011-08-15 00:51:06 +0000 |
commit | 154c4a088e477b9154a0ba8540aeafe06d2ce1f3 (patch) | |
tree | 1afac503467fda38566f42d6fa96af4e0b6f200e /libstdc++-v3/scripts | |
parent | 675bc3526eddeb97e1d992eec8ec9bb812f98c38 (diff) | |
download | gcc-154c4a088e477b9154a0ba8540aeafe06d2ce1f3.zip gcc-154c4a088e477b9154a0ba8540aeafe06d2ce1f3.tar.gz gcc-154c4a088e477b9154a0ba8540aeafe06d2ce1f3.tar.bz2 |
make_graph_test_infos.xml: Edit.
2011-08-14 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/data/make_graph_test_infos.xml: Edit.
* testsuite/data/make_graph_htmls.xml: Remove
* scripts/make_graph.py: Edit, fix.
* scripts/make_graphs.py: Remove.
* doc/Makefile.am (doc-svg-performance): New.
(doc-html-performance): Remove.
* doc/Makefile.in: Regenerate.
* doc/xml/manual/test_policy_data_structures.xml: Markup changes.
* doc/xml/manual/policy_data_structures.xml: Same.
* doc/xml/manual/locale.xml: Same.
Testsuite renames.
* performance/ext/pb_ds/priority_queue_text_modify_down_timing.cc:
Rename.
* performance/ext/pb_ds/random_int_find_timing.cc: Same.
* performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp
* performance/ext/pb_ds/multimap_text_find_timing.hpp
* performance/ext/pb_ds/priority_queue_random_int_push_timing.cc: Same.
* performance/ext/pb_ds/priority_queue_text_modify_timing.hpp
* performance/ext/pb_ds/tree_order_statistics_timing.cc: Same.
* performance/ext/pb_ds/multimap_text_insert_mem_usage_large.cc: Same.
* performance/ext/pb_ds/priority_queue_text_push_pop_timing.cc: Same.
* performance/ext/pb_ds/priority_queue_text_join_timing.cc: Same.
* performance/ext/pb_ds/multimap_text_insert_timing_small.cc: Same.
* performance/ext/pb_ds/random_int_subscript_insert_timing.cc: Same.
* performance/ext/pb_ds/tree_text_lor_find_timing.cc: Same.
* performance/ext/pb_ds/priority_queue_text_pop_mem_usage.cc: Same.
* performance/ext/pb_ds/multimap_text_find_timing_small.cc: Same.
* performance/ext/pb_ds/text_find_timing.cc: Same.
* performance/ext/pb_ds/tree_text_insert_timing.cc: Same.
* performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc: Same.
* performance/ext/pb_ds/random_int_subscript_find_timing.cc: Same.
* performance/ext/pb_ds/priority_queue_text_push_timing.cc: Same.
* performance/ext/pb_ds/tree_split_join_timing.cc: Same.
* performance/ext/pb_ds/multimap_text_insert_timing_large.cc: Same.
* performance/ext/pb_ds/priority_queue_text_modify_up_timing.cc: Same.
* performance/ext/pb_ds/multimap_text_find_timing_large.cc: Same.
* performance/ext/pb_ds/priority_queue_random_int_push_pop_timing.cc:
Same.
* performance/ext/pb_ds/multimap_text_insert_timing.hpp
* performance/ext/pb_ds/multimap_text_insert_mem_usage_small.cc: Same.
* performance/ext/pb_ds/hash_zlob_random_int_find_timing.cc: Same.
* performance/ext/pb_ds/all_int_find.cc: To these new files...
* performance/ext/pb_ds/all_int_subscript_find.cc: ...this.
* performance/ext/pb_ds/all_int_subscript_insert.cc: ...this.
* performance/ext/pb_ds/all_text_find.cc: ...this.
* performance/ext/pb_ds/hash_int_erase_mem.cc: ...this.
* performance/ext/pb_ds/hash_zlob_int_find.cc: ...this.
* performance/ext/pb_ds/multimap_text_find.hpp
* performance/ext/pb_ds/multimap_text_find_large.cc: ...this.
* performance/ext/pb_ds/multimap_text_find_small.cc: ...this.
* performance/ext/pb_ds/multimap_text_insert.hpp
* performance/ext/pb_ds/multimap_text_insert_large.cc: ...this.
* performance/ext/pb_ds/multimap_text_insert_mem.hpp
* performance/ext/pb_ds/multimap_text_insert_mem_large.cc: ...this.
* performance/ext/pb_ds/multimap_text_insert_mem_small.cc: ...this.
* performance/ext/pb_ds/multimap_text_insert_small.cc: ...this.
* performance/ext/pb_ds/priority_queue_int_push.cc: ...this.
* performance/ext/pb_ds/priority_queue_int_push_pop.cc: ...this.
* performance/ext/pb_ds/priority_queue_text_join.cc: ...this.
* performance/ext/pb_ds/priority_queue_text_modify_down.cc: ...this.
* performance/ext/pb_ds/priority_queue_text_modify.hpp
* performance/ext/pb_ds/priority_queue_text_modify_up.cc: ...this.
* performance/ext/pb_ds/priority_queue_text_pop_mem.cc: ...this.
* performance/ext/pb_ds/priority_queue_text_push.cc: ...this.
* performance/ext/pb_ds/priority_queue_text_push_pop.cc: ...this.
* performance/ext/pb_ds/tree_order_statistics.cc: ...this.
* performance/ext/pb_ds/tree_split_join.cc: ...this.
* performance/ext/pb_ds/tree_text_insert.cc: ...this.
* performance/ext/pb_ds/tree_text_lor_find.cc: ...this.
* doc/xml/images/*: Image and image filename changes.
From-SVN: r177756
Diffstat (limited to 'libstdc++-v3/scripts')
-rwxr-xr-x | libstdc++-v3/scripts/make_graph.py | 444 | ||||
-rwxr-xr-x | libstdc++-v3/scripts/make_graphs.py | 160 |
2 files changed, 88 insertions, 516 deletions
diff --git a/libstdc++-v3/scripts/make_graph.py b/libstdc++-v3/scripts/make_graph.py index 88b8d38..8daba6e 100755 --- a/libstdc++-v3/scripts/make_graph.py +++ b/libstdc++-v3/scripts/make_graph.py @@ -3,9 +3,6 @@ import string import sys import re -import os -import platform -import commands from Numeric import * from pychart import * from xml.dom import minidom @@ -14,22 +11,6 @@ class exception: pass -def comp_platform_info(compiler): - ret = '<ul>\n' - so = commands.getstatusoutput('cat /proc/cpuinfo | grep \'cpu MHz\'') - if so[0] == 0: - ret += '<li>CPU speed - %s</li>\n' % so[1] - so = commands.getstatusoutput('cat /proc/meminfo | grep \'MemTotal\'') - if so[0] == 0: - ret += '<li>Memory - %s</li>\n' % so[1] - ret += '<li>Platform - %s</li>\n' % platform.platform() - so = commands.getstatusoutput(compiler + ' --version') - if so[0] == 0: - ret += '<li>Compiler - %s</li>\n' % so[1] - ret += '</ul>\n' - return ret - - class res: """ A 'structure' representing the results of a test. @@ -85,7 +66,7 @@ class res_getter: label = string.strip(label) return label - def __parse_res_sets(self, f_name, cntnr_list): + def __parse_result_sets(self, f_name, cntnr_list): tst_dat = minidom.parse(f_name) x_label = self.__get_label(tst_dat, 'x_name') y_label = self.__get_label(tst_dat, 'y_name') @@ -112,7 +93,7 @@ class res_getter: def get(self, res_dir, test_name): cntnr_list = self.__test_to_container_res_sets[test_name] f_name = res_dir + '/' + self.__test_to_f_names[test_name] - parsed = self.__parse_res_sets(f_name, cntnr_list) + parsed = self.__parse_result_sets(f_name, cntnr_list) x_label = parsed[0] y_label = parsed[1] cntnr_descs = parsed[2] @@ -121,18 +102,18 @@ class res_getter: return res(x_label, y_label, cntnr_list, cntnr_descs, res_sets) -class png_maker: +class image_maker: """ - This class creates a png file from a result set. + This class creates a svg file from a result set. """ class __style_chooser: def __init__(self): self.native_re = re.compile(r'n_(?:.*?)') - self.native_tick_mark_0 = tick_mark.Circle(size = 4) - self.native_tick_mark_1 = tick_mark.Square(size = 4) - self.native_line_style_0 = line_style.T(color = color.black, width=2) - self.native_line_style_1 = line_style.T(color = color.black, width=2) + self.native_tick_mark_0 = tick_mark.blackdtri + self.native_tick_mark_1 = tick_mark.blackdia + self.native_line_style_0 = line_style.gray50_dash1 + self.native_line_style_1 = line_style.gray50_dash2 self.mask_re = re.compile(r'mask(?:.*?)') self.mod_re = re.compile(r'mod(?:.*?)') @@ -186,8 +167,8 @@ class png_maker: sys.stderr.write(cntnr + '\n') raise exception - # mask / mod - if cntnr.find('lc_1div8_1div') <> -1: + # mask / mod + if cntnr.find('lc_1div8_1div') <> -1: if cntnr.find('mask') <> -1: # mask if self.lc_1div8_1div2_re.search(cntnr): @@ -198,24 +179,24 @@ class png_maker: if self.lc_1div8_1div1_re.search(cntnr): if cntnr.find('nsth') <> -1: tm = tick_mark.dia - else: + else: tm = tick_mark.circle3 - else: - # mod + else: + # mod if self.lc_1div8_1div2_re.search(cntnr): if cntnr.find('nsth') <> -1: tm = tick_mark.tri else: - tm = tick_mark.square + tm = tick_mark.square if self.lc_1div8_1div1_re.search(cntnr): if cntnr.find('nsth') <> -1: - tm = tick_mark.dtri - else: - tm = tick_mark.star + tm = tick_mark.dtri + else: + tm = tick_mark.star if self.mcolc_1div2_re.search(cntnr): tm = tick_mark.circle3 - + return (tm, line_style.T(color = clr, width = 2)) @@ -227,356 +208,107 @@ class png_maker: return self.__mmap_re.sub('\nmmap_\n', cntnr) def make(self, res, of_name): + print of_name + + # theme settings + theme.debug_level = 3 theme.output_format = 'svg' - theme.output_file = of_name theme.scale_factor = 2 - theme.default_font_family = "Gill Sans Std" theme.default_line_width = 0.5 - theme.default_font_size = 7 + theme.default_font_size = 8 theme.use_color = 1 theme.reinitialize() + + # canvas settings + f = file(of_name, "w") + can = canvas.init(f, "svg") + + # axes y_tick_interval = self.__get_y_tics(res) -# xaxis = axis.X(format = '/a90/hL%d', - xaxis = axis.X(format = "/a-50{}%d", + xaxis = axis.X(format = "/6/i/a-90{}%d", tic_interval = 200, - label = res.x_label) -# yaxis = axis.Y(format = '%.2e', - yaxis = axis.Y(format = "/a-50{}%.2e", - tic_interval = y_tick_interval, - label = res.y_label) + label = res.x_label, label_offset = (0, -20)) + yaxis = axis.Y(format = "/6/i/a0{}%.2e", + tic_interval = y_tick_interval, tic_label_offset = (-25, 0), + label = res.y_label, label_offset = (-15, 0)) + + # legend legend_lines = len(res.cntnr_list) - legend_vloc = 50 + (legend_lines * 10) + legend_vloc = 80 + (legend_lines * 10) legend_hloc = -0 - ar = area.T(x_axis = xaxis, y_axis = yaxis, - legend = legend.T(loc=(legend_hloc,-legend_vloc), - frame_line_style=None, - inter_row_sep=2), - size=(240,110)) + lg = legend.T(loc=(legend_hloc,-legend_vloc), + frame_line_style = None, inter_row_sep = 2) + + # plot datasets + ar = area.T(x_axis = xaxis, y_axis = yaxis, legend = lg, size = (240,110), x_range = (0, 2200)) plot_list = [] for cntnr in res.cntnr_list: style = self.__sc.choose(cntnr) - print cntnr - pl = line_plot.T(label = self.__container_label_name(cntnr), - data = res.res_sets[cntnr], - tick_mark = style[0], - line_style = style[1]) + pl = line_plot.T(label = self.__container_label_name(cntnr), + data = res.res_sets[cntnr], + tick_mark = style[0], + line_style = style[1]) plot_list.append(pl) + for plot in plot_list: ar.add_plot(plot) - ar.draw() + # render image + ar.draw(can) + can.close() - def __get_y_tics(self, res): + + def __get_y_max_min(self, res): mx = 0 + nx = 0 for cntnr in res.cntnr_list: m = max(d[1] for d in res.res_sets[cntnr]) mx = max(m, mx) - return mx / 5 - - - -def make_tt(s): - return '<tt>' + s + '</tt>' - -def make_b(s): - return '<b>' + s + '</b>' - -def make_ttb(s): - return '<tt><b>' + s + '</b></tt>' - -def make_i(s): - return '<i>' + s + '</i>' - -def make_pb_ds_class_href(c_name): - return '<a href = "' + c_name + '.html">' + make_tt(c_name) + '</a>\n' - -def build_value_to_pb_ds_class_href(s_desc): - value = s_desc.attributes['value'].value - ret = make_pb_ds_class_href(value) - return ret - -class hash_desc_to_html_builder: - def build_specific_comb_hash_fn(self, s_desc): - comb_hash_fn_desc = s_desc.getElementsByTagName('Comb_Hash_Fn')[0] - ret = make_tt('Comb_Hash_Fn') - ret = ret + ' = ' - ret = ret + build_value_to_pb_ds_class_href(comb_hash_fn_desc) - return ret - - def __build_nom_denom(self, s_desc): - nom_denom = s_desc.attributes['nom'].value + '/' + s_desc.attributes['denom'].value - return make_i(nom_denom) - - def __build_lc_trigger_desc(self, s_desc): - ret = build_value_to_pb_ds_class_href(s_desc) - ret = ret + ' with ' + make_i('α<sub>min</sub>') - ret = ret + ' = ' + self.__build_nom_denom(s_desc.getElementsByTagName('alpha_min')[0]) - ret = ret + ' and ' + make_i('α<sub>max</sub>') - ret = ret + ' = ' + self.__build_nom_denom(s_desc.getElementsByTagName('alpha_max')[0]) - return ret - - def build_specific_resize_policy(self, s_desc): - ret = make_tt('Resize_Policy') - ret = ret + ' = ' - resize_policy_desc = s_desc.getElementsByTagName('Resize_Policy')[0] - ret = ret + build_value_to_pb_ds_class_href(resize_policy_desc) - ret = ret + ' with ' + make_tt('Size_Policy') - ret = ret + ' = ' - size_policy_desc = resize_policy_desc.getElementsByTagName('Size_Policy')[0] - ret = ret + build_value_to_pb_ds_class_href(size_policy_desc) - ret = ret + ', and ' + make_tt('Trigger_Policy') - ret = ret + ' = ' - trigger_policy_desc = resize_policy_desc.getElementsByTagName('Trigger_Policy')[0] - if trigger_policy_desc.attributes['value'].value == 'hash_load_check_resize_trigger': - ret = ret + self.__build_lc_trigger_desc(trigger_policy_desc) - else: - raise exception - return ret - - -class cc_hash_desc_to_html_builder: - def __init__(self): - self.__hash_builder = hash_desc_to_html_builder() - - def build(self, s_desc): - ret = build_value_to_pb_ds_class_href(s_desc) - ret = ret + 'with ' + self.__hash_builder.build_specific_comb_hash_fn(s_desc) - ret = ret + ', and ' + self.__hash_builder.build_specific_resize_policy(s_desc) - return ret + n = min(d[1] for d in res.res_sets[cntnr]) + nx = min(n, nx) + return (mx, nx) + def __get_x_max_min(self, res): + mx = 0 + nx = 0 + for cntnr in res.cntnr_list: + m = max(d[0] for d in res.res_sets[cntnr]) + mx = max(m, mx) + n = min(d[0] for d in res.res_sets[cntnr]) + nx = min(n, nx) + return (mx, nx) -class gp_hash_desc_to_html_builder: - def __init__(self): - self.__hash_builder = hash_desc_to_html_builder() - - def build(self, s_desc): - ret = build_value_to_pb_ds_class_href(s_desc) - ret = ret + ' with ' + self.__hash_builder.build_specific_comb_hash_fn(s_desc) - ret = ret + ', ' + self.__hash_builder.build_specific_resize_policy(s_desc) - ret = ret + ', and ' + make_tt('Probe_Fn') - ret = ret + ' = ' - probe_fn = s_desc.getElementsByTagName('Probe_Fn')[0].attributes['value'].value - ret = ret + make_pb_ds_class_href(probe_fn) - return ret - - -class basic_tree_like_desc_to_html_builder: - def build_tag(self, s_desc): - ret = make_tt('Tag') - ret = ret + ' = ' - tag_desc = s_desc.getElementsByTagName('Tag')[0] - ret = ret + build_value_to_pb_ds_class_href(tag_desc) - return ret - - def build_node_update(self, s_desc): - ret = make_tt('Node_Update') - ret = ret + ' = ' - node_update_desc = s_desc.getElementsByTagName('Node_Update')[0] - ret = ret + build_value_to_pb_ds_class_href(node_update_desc) - return ret - - -class basic_tree_desc_to_html_builder: - def __init__(self): - self.__tree_like_builder = basic_tree_like_desc_to_html_builder() + def __get_y_tics(self, res): + mx = 0 + for cntnr in res.cntnr_list: + m = max(d[1] for d in res.res_sets[cntnr]) + mx = max(m, mx) + return mx / 5 - def build(self, s_desc): - ret = build_value_to_pb_ds_class_href(s_desc) - ret = ret + ' with ' + self.__tree_like_builder.build_tag(s_desc) - ret = ret + ', and ' + self.__tree_like_builder.build_node_update(s_desc) - return ret +def main(test_infos_f_name, res_dir, doc_dir): + xmls_dat = minidom.parse(test_infos_f_name) + for test in xmls_dat.getElementsByTagName('test'): -class basic_trie_desc_to_html_builder: - def __init__(self): - self.__tree_like_builder = basic_tree_like_desc_to_html_builder() - - def build(self, s_desc): - ret = build_value_to_pb_ds_class_href(s_desc) - ret = ret + ' with ' + self.__tree_like_builder.build_tag(s_desc) - ret = ret + ', and ' + self.__tree_like_builder.build_node_update(s_desc) - return ret - -class lu_desc_to_html_builder: - def build(self, s_desc): - ret = build_value_to_pb_ds_class_href(s_desc) - ret = ret + ' with ' + make_tt('Update_Policy') - ret = ret + ' = ' - update_policy_desc = s_desc.getElementsByTagName('Update_Policy')[0] - ret = ret + build_value_to_pb_ds_class_href(update_policy_desc) - return ret - - -class std_desc_to_html_builder: - def build(self, s_desc): - value = s_desc.attributes['value'].value - return make_tt(value.replace('std_', 'std::')) - - -class std_tr1_desc_to_html_builder: - def build(self, s_desc): - value = s_desc.attributes['value'].value - ret = make_tt(value.replace('std_tr1_', 'std::tr1::')) - ret = ret + ' with ' + make_tt('cache_hash_code') - ret = ret + ' = ' - cache_hash_code = s_desc.getElementsByTagName('cache_hash_code')[0].attributes['value'].value - ret = ret + make_ttb(cache_hash_code) - return ret - -class gnucxx_desc_to_html_builder: - def build(self, s_desc): - value = s_desc.attributes['value'].value - return make_tt(value.replace('__gnucxx_', '__gnucxx::')) - -class stdext_desc_to_html_builder: - def build(self, s_desc): - value = s_desc.attributes['value'].value - return make_tt(value.replace('stdext_', 'stdext::')) - -class npq_desc_to_html_builder: - def build(self, vector): - if vector: - under = make_tt('std::vector') - else: - under = make_tt('std::deque') - - return make_tt('std::priority_queue') + ' adapting ' + under - -class binary_heap_desc_to_html_builder: - def build(self, s_desc): - ret = make_pb_ds_class_href('priority_queue') - ret = ret + ' with ' + make_tt('Tag') - ret = ret + ' = ' + make_pb_ds_class_href('binary_heap_tag') - return ret - -class thin_heap_desc_to_html_builder: - def build(self, s_desc): - ret = make_pb_ds_class_href('priority_queue') - ret = ret + ' with ' + make_tt('Tag') - ret = ret + ' = ' + make_pb_ds_class_href('thin_heap_tag') - return ret - -class binomial_heap_desc_to_html_builder: - def build(self, s_desc): - ret = make_pb_ds_class_href('priority_queue') - ret = ret + ' with ' + make_tt('Tag') - ret = ret + ' = ' + make_pb_ds_class_href('binomial_heap_tag') - return ret - -class rc_binomial_heap_desc_to_html_builder: - def build(self, s_desc): - ret = make_pb_ds_class_href('priority_queue') - ret = ret + ' with ' + make_tt('Tag') - ret = ret + ' = ' + make_pb_ds_class_href('rc_binomial_heap_tag') - return ret - -class pairing_heap_desc_to_html_builder: - def build(self, s_desc): - ret = make_pb_ds_class_href('priority_queue') - ret = ret + ' with ' + make_tt('Tag') - ret = ret + ' = ' + make_pb_ds_class_href('pairing_heap_tag') - return ret - -class legend_desc_builder: - """ - Returns a string corresponding to a specific container type. - """ - def __init__(self): - self.__cc_hash_builder = cc_hash_desc_to_html_builder() - self.__gp_hash_builder = gp_hash_desc_to_html_builder() - self.__basic_tree_builder = basic_tree_desc_to_html_builder() - self.__basic_trie_builder = basic_trie_desc_to_html_builder() - self.__lu_builder = lu_desc_to_html_builder() - self.__std_builder = std_desc_to_html_builder() - self.__std_tr1_builder = std_tr1_desc_to_html_builder() - self.__gnucxx_builder = gnucxx_desc_to_html_builder() - self.__stdext_builder = stdext_desc_to_html_builder() - self.__npq_builder = npq_desc_to_html_builder() - self.__thin_heap_builder = thin_heap_desc_to_html_builder() - self.__thin_heap_builder = thin_heap_desc_to_html_builder() - self.__binary_heap_builder = binary_heap_desc_to_html_builder() - self.__binomial_heap_builder = binomial_heap_desc_to_html_builder() - self.__rc_binomial_heap_builder = rc_binomial_heap_desc_to_html_builder() - self.__pairing_heap_builder = pairing_heap_desc_to_html_builder() - - def __build_specific(self, s_desc): - type = s_desc.attributes['value'].value - - if type == 'thin_heap': - return self.__thin_heap_builder.build(s_desc) - if type == 'binary_heap': - return self.__binary_heap_builder.build(s_desc) - if type == 'binomial_heap': - return self.__binomial_heap_builder.build(s_desc) - if type == 'rc_binomial_heap': - return self.__rc_binomial_heap_builder.build(s_desc) - if type == 'pairing_heap': - return self.__pairing_heap_builder.build(s_desc) - if type == 'cc_hash_table': - ret = self.__cc_hash_builder.build(s_desc) - elif type == 'gp_hash_table': - ret = self.__gp_hash_builder.build(s_desc) - elif type == 'tree': - ret = self.__basic_tree_builder.build(s_desc) - elif type == 'trie': - ret = self.__basic_trie_builder.build(s_desc) - elif type == 'list_update': - ret = self.__lu_builder.build(s_desc) - elif type == 'std::priority_queue_vector': - return self.__npq_builder.build(True) - elif type == 'std::priority_queue_deque': - return self.__npq_builder.build(False) - elif type == 'std_set' or type == 'std_map' or type == 'std_multimap': - return self.__std_builder.build(s_desc) - elif type == 'std_tr1_unordered_set' or type == 'std_tr1_unordered_map': - return self.__std_tr1_builder.build(s_desc) - elif type == 'stdext_hash_set' or type == 'stdext_hash_map' or type == 'stdext_hash_multimap': - return self.__stdext_builder.build(s_desc) - elif type == '__gnucxx_hash_set' or type == '__gnucxx_hash_map' or type == '__gnucxx_hash_multimap': - return self.__gnucxx_builder.build(s_desc) - else: - sys.stderr.write('cannot recognize %s\n' % type) - raise exception - return ret - - - def build(self, desc): - s_descs = desc.getElementsByTagName('type') - if s_descs.length == 0: - print desc.toxml() - raise exception - ret = '' - count = 0 - for s_desc in s_descs: - if count > 0: - ret = ret + ', mapping each key to ' - ret = ret + self.__build_specific(s_desc) - count = count + 1 - return ret - - -def main(doc_dir, res_dir, test_infos_f_name, test_name, build_name): - res_gtr = res_getter(test_infos_f_name) - res = res_gtr.get(res_dir, test_name) - png_mkr = png_maker() -# png_of_name = doc_dir + '/' + test_name + '_' + build_name + '.png' - png_of_name = doc_dir + '/' + test_name + '_' + build_name + '.svg' - print png_of_name - png_mkr.make(res, png_of_name) + # parse results + test_name = test.attributes['name'].value + res_gtr = res_getter(test_infos_f_name) + res = res_gtr.get(res_dir, test_name) + # generate image + image_mkr = image_maker() + svg_of_name = doc_dir + '/pbds_' + test_name + '.svg' + image_mkr.make(res, svg_of_name) if __name__ == "__main__": """ - This module takes 6 parameters from the command line: - Docs directory - Results directory + This module takes 3 parameters from the command line: Tests info XML file name - Test name - Build name - Compiler name + Test results directory + Image output directory """ - usg = "make_graph.py <doc_dir> <res_dir> <test_info_file> <test_name> <build_name>\n" - if len(sys.argv) != 6: + usg = "make_graph.py <test_info_file> <res_dir> <image_dir>\n" + if len(sys.argv) != 4: sys.stderr.write(usg) raise exception - main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5]) + main(sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/libstdc++-v3/scripts/make_graphs.py b/libstdc++-v3/scripts/make_graphs.py deleted file mode 100755 index e230e7a..0000000 --- a/libstdc++-v3/scripts/make_graphs.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/python - -import sys -import commands -import re -from xml.dom import minidom -from BeautifulSoup import BeautifulSoup -import make_graph - -class exception: - pass - -res_div_re = re.compile('(.*?)_res_div') -settings_div_re = re.compile('(.*?)_settings_div') - - -gray_border_div_str = '<div style = "border-style: dotted; border-width: 1px; border-color: lightgray">' -space_div_str = '<div style = "width: 100%; height: 20px">' - - - -def logical_build_from_build(build): - if build == 'gcc': - return 'g++' - if build == 'msvc': - return 'msvc++' - if build == 'local': - return 'local' - sys.stderr.write(build) - raise exception - - -def img_title_from_origs(label, title, base_build_ref, build_name, logical_build_name): - title = title.replace('_tt_', '<tt>') - title = title.replace('_455tt_', '</tt>') - title = title.replace('_b_', '<b>') - title = title.replace('_455b_', '</b>') - title = title.replace('_456', ',') - title = title.replace('_457', '[]') - title = title.replace('_', ' ') - return '%s: %s - <a href = "%s_performance_tests.html#%s">%s</a>' % ( - label, - title, - base_build_ref, - build_name, - logical_build_name) - - -def make_png(src_dir, doc_dir, res_dir, tests_info_xml_f_name, build_name, test_name): - cmd_str = '%s/scripts/make_graph.py %s %s %s %s %s' % ( - src_dir, doc_dir, - res_dir, - tests_info_xml_f_name, - test_name, - build_name) - # Must start a new process for pychart - otherwise pngs overlap. - so = commands.getstatusoutput(cmd_str) - if(so[0] != 0): - sys.stderr.write(cmd_str + '\n') - sys.stderr.write(so[1] + '\n') - sys.exit(-1) - - -def make_png_str(label, test_name, build): - ret = '<h6 class="c1">' - ret += '<a name="%s" id= "%s">' % (label, label) - ret += '<img src="%s" ' % (test_name + '_' + build + '.png') - ret += 'alt="no image" />' - ret += '</a></h6>' - return ret - -def process_html(html_f_name, src_dir, build_dir, htmls_xml_f_name, tests_info_xml_f_name, build_name, compiler_name): - doc_dir = src_dir + "/doc/html/ext/pb_ds" - res_dir = build_dir - html_f = open(doc_dir + '/' + html_f_name) - soup = BeautifulSoup(html_f.read()) - html_f.close() - platform_comp_re = re.compile('platform_comp_%s' % build_name) - for d in soup('div'): - try: - settings_m = settings_div_re.match(d['id']) - res_m = res_div_re.match(d['id']) - except: - settings_m = None - res_m = None - - if settings_m: - build = settings_m.groups()[0] - if build == build_name: - logical_build_name = logical_build_from_build(build) - info = gray_border_div_str - info += '<h3><a name = "%s"><u>%s</u></a></h3>' % (build, logical_build_name) - info += make_graph.comp_platform_info(compiler_name) - info += '</div>%s</div>' % space_div_str - d.contents = info - elif res_m: - label = res_m.groups()[0] - d = d.divTag - - build = d['id'].replace('%s_' % label, '') - - if build == build_name: - logical_build_name = logical_build_from_build(build) - d = d.divTag - test_name = d['id'].replace('%s_' % label, '') - d = d.divTag - base_build_ref = d['id'].replace('%s_' % label, '') - d = d.divTag - title = d['id'].replace('%s_' % label, '') - img_title = img_title_from_origs(label, title, base_build_ref, build, logical_build_name) - - make_png(src_dir, doc_dir, res_dir, tests_info_xml_f_name, build_name, test_name) - png_str = make_png_str(label, test_name, build) - content = gray_border_div_str - content += png_str - content += img_title -# content += make_graph.legend(doc_dir, res_dir, tests_info_xml_f_name, test_name, build_name) - content += '</div>%s</div>' % space_div_str - d.contents = content - - return soup - - - -if __name__ == "__main__": - """ - Doc dir - This module takes 6 parameters from the command line: - Source directory - Build directory - HTMLs XML file name - Tests info XML file name - Build name - Compiler name - """ - - usg = "make_graph.py <src_dir> <build_dir> <htmls_xml_f_name> <tests_info_xml_f_name> <build_name> <compiler_name>\n" - - if len(sys.argv) != 7: - sys.stderr.write(usg) - raise exception - - src_dir = sys.argv[1] - build_dir = sys.argv[2] - htmls_xml_f_name = sys.argv[3] - tests_info_xml_f_name = sys.argv[4] - build_name = sys.argv[5] - compiler_name = sys.argv[6] - doc_dir = src_dir + "/doc/html/ext/pb_ds" - htmls_dat = minidom.parse(htmls_xml_f_name) - for html in htmls_dat.getElementsByTagName('html'): - html_f_name = html.attributes['name'].value - - new_soup = process_html(html_f_name, src_dir, build_dir, htmls_xml_f_name, tests_info_xml_f_name, build_name, compiler_name) - - html_f = open(doc_dir + '/' + html_f_name, 'w') - html_f.write(str(new_soup)) - html_f.close() - - |