Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933493Ab1EXWGY (ORCPT ); Tue, 24 May 2011 18:06:24 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:51061 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756414Ab1EXWGX (ORCPT ); Tue, 24 May 2011 18:06:23 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=GhI15EaJe3S80ntp7ajNES1ok5FubiILbsI2pi48bE4wSO5DiXPlHf+wdXNG/egEWo P6JCZUxDWb3tvlG4BXMx7odc316Pj+4zKGxehqA4ohPGxBZ8Hhe/IYjvuMRJO+u5fXHz PoXx8EKBHXHPFTOjiLtFRhIe5ttXvpBd35uwc= MIME-Version: 1.0 In-Reply-To: <20110521103315.GA23651@elte.hu> References: <1305968203-14240-1-git-send-email-jim.cromie@gmail.com> <1305968203-14240-3-git-send-email-jim.cromie@gmail.com> <20110521103315.GA23651@elte.hu> From: Jim Cromie Date: Tue, 24 May 2011 16:05:53 -0600 Message-ID: Subject: Re: [PATCH 2/2] dont commify big numbers by default, let -B do it To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, paulus@samba.org, acme@ghostprotocols.net Content-Type: multipart/mixed; boundary=000e0cd3077c6ce43204a40cccd7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 11319 Lines: 225 --000e0cd3077c6ce43204a40cccd7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, May 21, 2011 at 4:33 AM, Ingo Molnar wrote: > > * Jim Cromie wrote: > >> Currently, big numbers get commas by default, which complicates parsing >> by automation. [...] > > Well, automation can turn it off via --no-big-num, right? ah. my man-page is a bit behind (but is in usage, and in Doc/perf-stat.txt) > Also, i think for automation we'd also like to have a 'simple output' mod= e, > would you like to add that? OK, heres 1st cut at it, adding option --simple, for review / feedback Its based upon the csv-output code mostly, with some vestiges of verbose.. I altered csv-output to have event-name 1st this seems what folks would expect normally, I surmised that existing was a short-cut.. Then added "noise" part of reason for sending early is this column swap, it might annoy existing users. [jimc@groucho perf]$ ./perf stat -r3 -x' ' true task-clock-msecs1.009533 0.142% context-switches 0 -nan% CPU-migrations 0 100.000% page-faults 85 0.000% cycles 789434 0.107% instructions 488768 0.546% branches 102796 0.505% branch-misses 8472 1.688% cache-references 0 -nan% (scaled from 0.00%) cache-misses 0 -nan% (scaled from 0.00%) [jimc@groucho perf]$ ./perf stat -r3 -x' ------- ' true task-clock-msecs1.036450 ------- ------- 3.519% context-switches ------- 0 ------- -nan% CPU-migrations ------- 0 ------- -nan% page-faults ------- 85 ------- 0.000% cycles ------- 812151 ------- 3.463% instructions ------- 499263 ------- 0.368% branches ------- 104240 ------- 0.224% branch-misses ------- 8125 ------- 4.627% cache-references ------- 0 ------- -nan% (scaled from 0.00%) cache-misses ------- 0 ------- -nan% (scaled from 0.00%) I also need to do something better with -no-aggr format, doesnt do right with extra column [jimc@groucho perf]$ sudo ./perf stat -r3 -x' ------- ' -A -a true CPU0 ------- task-clock-msecs2.099862 ------- CPU1 ------- task-clock-msecs2.084522 ------- CPU2 ------- task-clock-msecs2.072948 ------- CPU3 ------- task-clock-msecs2.071611 ------- CPU0 ------- context-switches ------- 2 CPU1 ------- context-switches ------- 0 CPU2 ------- context-switches ------- 3 CPU3 ------- context-switches ------- 6 CPU0 ------- CPU-migrations ------- 2 ... > Something a bit like what you can see in 'perf stat -v true': > Without the human output later on, and with elapsed time added as well. for my part, Id like the moral equivalent of time(s)? output too, though I suspect thats a separate patch.. [jimc@groucho perf]$ time ./perf stat -x' ' -- sh -c 'sleep 3' task-clock-msecs6.830999 context-switches 2 CPU-migrations 1 page-faults 477 cycles 5404163 (scaled from 72.07%) instructions 3302699 branches 804750 branch-misses 51870 cache-references 1584532 (scaled from 45.93%) cache-misses 36616 (scaled from 31.36%) real 0m3.019s user 0m0.005s sys 0m0.012s are these timings already taken by perf-stat ? is it a simple matter of addition and printing ? If not, whats involved ? Also, task-clock-msec doesnt quite match up with times' user number Whats going on here ? > Thanks, > > =A0 =A0 =A0 =A0Ingo > thank you ~jimc PS: attaching now (in gmail web iface), will try to thread up to this, RSN, with git send-email --000e0cd3077c6ce43204a40cccd7 Content-Type: text/x-patch; charset=US-ASCII; name="0001-add-simple-output-mode-to-perf-stat-based-upon-csv-o.patch" Content-Disposition: attachment; filename="0001-add-simple-output-mode-to-perf-stat-based-upon-csv-o.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_go3e82qb0 RnJvbSA2Y2QxNjY3YWU1MjI3MzdkNTc3ZDNmNjczMTRjNjk1MmJjM2E1ZTRmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gQ3JvbWllIDxqaW0uY3JvbWllQGdtYWlsLmNvbT4KRGF0 ZTogVHVlLCAyNCBNYXkgMjAxMSAxNTo1NjozOSAtMDYwMApTdWJqZWN0OiBbUEFUQ0hdIGFkZCAt LXNpbXBsZSBvdXRwdXQgbW9kZSB0byBwZXJmLXN0YXQsIGJhc2VkIHVwb24gY3N2LW91dHB1dAoK cHJvZHVjZXMgb3V0cHV0IGxpa2UgdGhpcyAoV0lQKToKCnBlcmZdJCAuL3BlcmYgc3RhdCAteCcg ICcgLXIzIC0tIHNoIC1jICdzbGVlcCAzJwp0YXNrLWNsb2NrLW1zZWNzNi44OTY1OTQgICAgMS4x MDUlCmNvbnRleHQtc3dpdGNoZXMgIDMgIDAuMDAwJQpDUFUtbWlncmF0aW9ucyAgMCAgLW5hbiUK cGFnZS1mYXVsdHMgIDQ3NyAgMC4wMDAlCmN5Y2xlcyAgNTU0MDQ4MyAgMS4wMDIlICAoc2NhbGVk IGZyb20gNjkuOTIlKQppbnN0cnVjdGlvbnMgIDM4ODE3OTQgIDcuNzc5JSAgK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nN0ZWFkIG9mIHN0ZGVyciIpLAorCU9QVF9CT09MRUFOKCdzJywgInNpbXBsZSIs ICZzaW1wbGUsCisJCSAgICAic2ltcGxlIG91dHB1dCBmb3Igc2NyaXB0cy9hdXRvbWF0aW9uIiks CiAJT1BUX0VORCgpCiB9OwogCi0tIAoxLjcuNC40Cgo= --000e0cd3077c6ce43204a40cccd7-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/