From patchwork Fri May 25 15:58:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Sandoval X-Patchwork-Id: 920630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-92756-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="EcB9Q/Xk"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40srXR2CSxz9s0W for ; Sat, 26 May 2018 01:59:03 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=hsG8XGjxayHseQVaX+IkEYuwohSSZRx m7PwWDWrf5EVSivsvARe8NTUelC+58uqNAn9NwjkeWRkd0NgUL9+5Jg3IARF70Yd fNjfKstPn9meQoFzDPRH9hHXRP9XjxuGMxefCA9FCuH6f/P33j0O2oJoY9qFyl6V PtQmHAXUHqcE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=b94t4dbwLNfTiKgmqHcy7q8OJa8=; b=EcB9Q /XkoWXwpnvPz4COgCkFk2Vp15SpKLSpPnlP2ht8YYDPDvXCRpYcmIlc46zG66YtG p0uqAOId7QnxQ9PCiasCABHBiB5hcc1xVkhOzqzZCObtHGuDGulZ3Vdl5svLjV/n MFXCOaHXPAqozNaFESippEkI8dUsseyse7fFQo= Received: (qmail 106813 invoked by alias); 25 May 2018 15:58:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 106671 invoked by uid 89); 25 May 2018 15:58:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-HELO: mga17.intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: leonardo.sandoval.gonzalez@linux.intel.com To: libc-alpha@sourceware.org Cc: Leonardo Sandoval Subject: [PATCH 2/3] benchtests: Add --no-header option to omit header Date: Fri, 25 May 2018 10:58:29 -0500 Message-Id: <20180525155830.6864-3-leonardo.sandoval.gonzalez@linux.intel.com> In-Reply-To: <20180525155830.6864-1-leonardo.sandoval.gonzalez@linux.intel.com> References: <20180525155830.6864-1-leonardo.sandoval.gonzalez@linux.intel.com> From: Leonardo Sandoval Having raw output without header makes easier the interaction with other tools, thus include an option to omit it. * benchtests/scripts/compare_string.py: Add --no-header option to omit header --- ChangeLog | 5 +++++ benchtests/scripts/compare_strings.py | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index afddd77315a..cc3e50e3b8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-05-25 Leonardo Sandoval + + * benchtests/scripts/compare_string.py: Add --no-header option + to omit header. + 2018-05-25 Leonardo Sandoval * benchtests/scripts/compare_string.py: Add --no-diff option diff --git a/benchtests/scripts/compare_strings.py b/benchtests/scripts/compare_strings.py index ceeccea13b6..c629bba77fa 100755 --- a/benchtests/scripts/compare_strings.py +++ b/benchtests/scripts/compare_strings.py @@ -79,7 +79,7 @@ def draw_graph(f, v, ifuncs, results): pylab.savefig('%s-%s.png' % (f, v), bbox_inches='tight') -def process_results(results, attrs, base_func, graph, no_diff): +def process_results(results, attrs, base_func, graph, no_diff, no_header): """ Process results and print them Args: @@ -88,16 +88,19 @@ def process_results(results, attrs, base_func, graph, no_diff): """ for f in results['functions'].keys(): - print('Function: %s' % f) + v = results['functions'][f]['bench-variant'] - print('Variant: %s' % v) base_index = 0 if base_func: base_index = results['functions'][f]['ifuncs'].index(base_func) - print("%36s%s" % (' ', '\t'.join(results['functions'][f]['ifuncs']))) - print("=" * 120) + if not no_header: + print('Function: %s' % f) + print('Variant: %s' % v) + print("%36s%s" % (' ', '\t'.join(results['functions'][f]['ifuncs']))) + print("=" * 120) + graph_res = {} for res in results['functions'][f]['results']: attr_list = ['%s=%s' % (a, res[a]) for a in attrs] @@ -133,7 +136,7 @@ def main(args): attrs = args.attributes.split(',') results = parse_file(args.input, args.schema) - process_results(results, attrs, base_func, args.graph, args.no_diff) + process_results(results, attrs, base_func, args.graph, args.no_diff, args.no_header) if __name__ == '__main__': @@ -155,6 +158,8 @@ if __name__ == '__main__': help='Generate a graph from results.') parser.add_argument('--no-diff', action='store_true', help='Do not include diff on .') + parser.add_argument('--no-header', action='store_true', + help='Do not include the header.') args = parser.parse_args() main(args)