This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.26-41-gdd3e86a
- From: siddhesh at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 7 Aug 2017 19:29:04 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.26-41-gdd3e86a
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via dd3e86ad7cf5ea1b5a42b7962732f98882c63ff8 (commit)
via b115e819af637101d9d9b0d26c3685b7236d3fb1 (commit)
from 7ee38e6040d34bca96ee668efbbd2f56b446319d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=dd3e86ad7cf5ea1b5a42b7962732f98882c63ff8
commit dd3e86ad7cf5ea1b5a42b7962732f98882c63ff8
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Tue Aug 8 00:56:10 2017 +0530
benchtests: Avoid a display error when running in text terminal
The compare_strings.py script generates a graph for the benchmarks it
performs a comparison on and that fails if X is not available. Avoid
the error and ensure that only the graph is generated and saved as a
PNG file.
* benchtests/scripts/compare_strings.py: Avoid display error
when generating graph.
diff --git a/ChangeLog b/ChangeLog
index efdd9b6..b64ed05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2017-08-07 Siddhesh Poyarekar <siddhesh@sourceware.org>
+ * benchtests/scripts/compare_strings.py: Avoid display error when
+ running on a text terminal.
+
* benchtests/scripts/compare_strings.py (main): Add an
optional -base option.
(process_results): New argument base_func.
diff --git a/benchtests/scripts/compare_strings.py b/benchtests/scripts/compare_strings.py
index 43e70eb..b3c57e2 100755
--- a/benchtests/scripts/compare_strings.py
+++ b/benchtests/scripts/compare_strings.py
@@ -21,6 +21,8 @@ Given a string benchmark result file, print a table with comparisons with a
baseline. The baseline is the first function, which typically is the builtin
function.
"""
+import matplotlib as mpl
+mpl.use('Agg')
import sys
import os
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b115e819af637101d9d9b0d26c3685b7236d3fb1
commit b115e819af637101d9d9b0d26c3685b7236d3fb1
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Tue Aug 8 00:55:12 2017 +0530
benchtests: Allow selecting baseline for compare_string.py
This patch allows one to provide the function name using an optional
-base option to compare all other functions against. This is useful
when pitching one implementation of a string function against
alternatives. In the absence of this option, comparisons are done
against the first ifunc in the list.
* benchtests/scripts/compare_strings.py (main): Add an
optional -base option.
(process_results): New argument base_func.
diff --git a/ChangeLog b/ChangeLog
index 887fc71..efdd9b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2017-08-07 Siddhesh Poyarekar <siddhesh@sourceware.org>
+ * benchtests/scripts/compare_strings.py (main): Add an
+ optional -base option.
+ (process_results): New argument base_func.
+
* benchtests/bench-memcpy.c (test_main): Use TEST_NAME instead of
hardcoding memcpy.
* benchtests/bench-memcpy-large.c (test_name): Likewise.
diff --git a/benchtests/scripts/compare_strings.py b/benchtests/scripts/compare_strings.py
index 9d73ec4..43e70eb 100755
--- a/benchtests/scripts/compare_strings.py
+++ b/benchtests/scripts/compare_strings.py
@@ -21,6 +21,7 @@ Given a string benchmark result file, print a table with comparisons with a
baseline. The baseline is the first function, which typically is the builtin
function.
"""
+
import sys
import os
import json
@@ -74,7 +75,7 @@ def draw_graph(f, v, ifuncs, results):
pylab.savefig('%s-%s.png' % (f, v), bbox_inches='tight')
-def process_results(results, attrs):
+def process_results(results, attrs, base_func):
""" Process results and print them
Args:
@@ -84,6 +85,10 @@ def process_results(results, attrs):
for f in results['functions'].keys():
print('Function: %s' % f)
+ base_index = 0
+ if base_func:
+ base_index = results['functions'][f]['ifuncs'].index(base_func)
+
print('\t'.join(results['functions'][f]['ifuncs']))
v = results['functions'][f]['bench-variant']
print('Variant: %s' % v)
@@ -91,19 +96,17 @@ def process_results(results, attrs):
graph_res = {}
for res in results['functions'][f]['results']:
attr_list = ['%s=%s' % (a, res[a]) for a in attrs]
- first = True
+ i = 0
key = ','.join(attr_list)
sys.stdout.write('%s: \t' % key)
graph_res[key] = res['timings']
for t in res['timings']:
sys.stdout.write ('%.2f' % t)
- if first:
- first = False
- else:
- diff = (res['timings'][0] - t) * 100 / res['timings'][0]
-
+ if i != base_index:
+ diff = (res['timings'][base_index] - t) * 100 / res['timings'][base_index]
sys.stdout.write (' (%.2f%%)' % diff)
sys.stdout.write('\t')
+ i = i + 1
print('')
draw_graph(f, v, results['functions'][f]['ifuncs'], graph_res)
@@ -114,15 +117,20 @@ def main(args):
Take a string benchmark output file and compare timings.
"""
if len(args) < 3:
- print('Usage: %s <input file> <schema file> attr1 [attr2 ...]' % sys.argv[0])
+ print('Usage: %s <input file> <schema file> [-base=ifunc_name] attr1 [attr2 ...]' % sys.argv[0])
sys.exit(os.EX_USAGE)
+ base_func = None
filename = args[0]
schema_filename = args[1]
- attrs = args[2:]
+ if args[2].find('-base=') == 0:
+ base_func = args[2][6:]
+ attrs = args[3:]
+ else:
+ attrs = args[2:]
results = parse_file(filename, schema_filename)
- process_results(results, attrs)
+ process_results(results, attrs, base_func)
if __name__ == '__main__':
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
benchtests/scripts/compare_strings.py | 30 ++++++++++++++++++++----------
2 files changed, 27 insertions(+), 10 deletions(-)
hooks/post-receive
--
GNU C Library master sources