From patchwork Tue Mar 25 10:30:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 333372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 D88C114008A for ; Tue, 25 Mar 2014 21:29:35 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=V/NfJxRNXyfcgwIu6F5gOHchVH8oC bW/Frphz/6KtR/G3lJGBWyscKOZkUtJznisjGMVkWhIAopq9smyVPt50t3xKfrpq 11fLXk13IHV3LIxnfczcIe2HFUAq3SIkjJO3kM1O1VKCdgyd2b3/d3oiFOVi8Jok RHcxQEsKTMds2E= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=vmFPY+744GTldUe8Z8A2/XpDrcc=; b=m8N +yJEG15QbD3EaDH0LtSe81kaHVwaWfDNwZhGrOMHRxQm/TU1YaaFxSutvxYOKWCB Nwv9YEhKPdHSldYH9np7juBQszEJPhNTVJezcHPRfQOGhVEmkHQgjN+Td0afmoHA 7iaov6iCXj60Pa9cCMN+crhwVXU2eGJh984mxxqw= Received: (qmail 24381 invoked by alias); 25 Mar 2014 10:29:28 -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 24371 invoked by uid 89); 25 Mar 2014 10:29:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Tue, 25 Mar 2014 16:00:04 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH 3/4] Add machine-info to benchmark output Message-ID: <20140325103004.GC1850@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Hi, This patch adds a script that is invoked by the benchmark target to print information about the machine the current benchmark is running on. Siddhesh * benchtests/scripts/machine-info.sh: New file. * benchtests/Makefile (bench-func): Use it. --- benchtests/Makefile | 3 +++ benchtests/scripts/machine-info.sh | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 benchtests/scripts/machine-info.sh diff --git a/benchtests/Makefile b/benchtests/Makefile index f5488c1..1669b6f 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -125,6 +125,9 @@ bench-set: $(binaries-benchset) # capable language or tool. bench-func: $(binaries-bench) { echo "{"; \ + echo " \"machine\":"; \ + $(.)scripts/machine-info.sh; \ + echo ","; \ $(timing-type); \ echo " ,\"functions\": {"; \ for run in $^; do \ diff --git a/benchtests/scripts/machine-info.sh b/benchtests/scripts/machine-info.sh new file mode 100755 index 0000000..3e51f1c --- /dev/null +++ b/benchtests/scripts/machine-info.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Simple script to get some basic machine information + +echo "{" +sed -n -e 's/vendor_id[ \t]\+: \(.*\)/ "vendor-id": "\1",/p' \ + -e 's/cpu family[ \t]\+: \(.*\)/ "cpu-family": \1,/p' \ + -e 's/\(model\)[ \t]\+: \(.*\)/ "\1": \2,/p' \ + -e 's/cpu cores[ \t]\+: \(.*\)/ "cpu-cores": \1,/p' \ + -e 's/cache size[ \t]\+: \([0-9]\+\).*/ "cache-size": \1,/p' \ + -e 's/MemTotal:[ \t]\+\([0-9]\+\).*/ "memory": \1,/p' \ + -e 's/SwapTotal:[ \t]\+\([0-9]\+\).*/ "swap": \1,/p' \ + /proc/cpuinfo /proc/meminfo | sort -u +echo " \"processors\": $(grep -c 'processor' /proc/cpuinfo)" +echo "}"