Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1034803pxy; Sun, 15 Aug 2021 07:51:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWx+bQ2V0+/ey1ipXhBaVPbCYhF2xQCpM2YEQMFBXGaYXsv0rtMLLBZ10+hJOXs72lHYGZ X-Received: by 2002:a17:906:bfc6:: with SMTP id us6mr12114315ejb.548.1629039093122; Sun, 15 Aug 2021 07:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629039093; cv=none; d=google.com; s=arc-20160816; b=DMyTkeTRKOXc2owogWiUPp+BA8uFag44olyBOYJj5w3qHm7S9mvEavRZRwNA1foMDx VWtXmYkE91kznYvcwQLAG4eNsmOmA6l/to2ZI4WyZEnIuq4KeVIoYM+IyOPH836t5x2p t2iNPg5eoeSv7kLgUc1UrfHu+inos9ToSBZR9jPbJLB5cGUZUpvWC0H6IpIn3x+1VHph AJYijVQ1spdSynII6ctr0IAo1UTIHmqKszWCgBg1U2hprL8iSwU1L8KTsdU9OhULVo20 eLoKvAN2pUV96bkLorG5C+4R/taCAkZPY+9UOa86RtkM1VStG+cO97RTNUtk71Ra19D7 vjfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hPUmyIAwZiOFCS37bAN04+p46lm9Xl6ZNgjZIMacu98=; b=XDTuCq6UKoGtjlcpQG1tPNSZXNDGIa7bJrZEGCXbBpx30GUppvxJq70KJNrEd8E0Vk Exz79PWlLslTzIPwKI/IWEkn9GzuGJB8puC+kWwmACU68kBn96Q3ahb8R0Gj1WcoPmbT 8Er2YbhZd54qdEsOR9OoFOagbAGGYNo1NZ3CJ3cBykOfW3mdiMRR54WhwW0QTdVXjPBV X/025+ysQs7qK22lY5vYJVjdZuPTaTKQQ0u+fr/qC06h/CMPGl1TXRrBUAjCziSpZqxE Gc16BAaL4X63cLSOoaxorOhOg5g0bytw2JIltWHz2kqNdnSvbOWZGDBK3CpnTIFlKfGR uJAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@firstfloor.org header.s=mail header.b=owe9lDdY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si7953020ejk.6.2021.08.15.07.51.10; Sun, 15 Aug 2021 07:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@firstfloor.org header.s=mail header.b=owe9lDdY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238691AbhHOOuT (ORCPT + 99 others); Sun, 15 Aug 2021 10:50:19 -0400 Received: from one.firstfloor.org ([193.170.194.197]:53748 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238541AbhHOOuJ (ORCPT ); Sun, 15 Aug 2021 10:50:09 -0400 X-Greylist: delayed 556 seconds by postgrey-1.27 at vger.kernel.org; Sun, 15 Aug 2021 10:50:07 EDT Received: by one.firstfloor.org (Postfix, from userid 503) id 5893D870CD; Sun, 15 Aug 2021 16:40:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firstfloor.org; s=mail; t=1629038411; bh=azAF6tdlRERJnJMOPZFhCDXRn1/H4qSvoDeGxPIaHP8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=owe9lDdY0GP8p5E9fWfvA9cpuUbO9raxRl84mcHZVTSA31mTb5lplKJ4I3VJCLe+C 0L8UoU7Woysh70ydIVxTJMWtUJt1ySBfrlgzrIG9aB5JOQiND06fC0K1BCOGVMbVKv onZ+YWxO+xItbtGTLaNtI/wSEq88tBL03wM5tCJ4= Date: Sun, 15 Aug 2021 07:40:10 -0700 From: Andi Kleen To: Claire Jensen Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, yao.jin@linux.intel.com, song@kernel.org, andi@firstfloor.org, adrian.hunter@intel.com, kan.liang@linux.intel.com, james.clark@arm.com, alexander.antonov@linux.intel.com, changbin.du@intel.com, liuqi115@huawei.com, irogers@google.com, eranian@google.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, clairej735@gmail.com Subject: Re: [PATCH v2 1/1] perf stat: Add JSON output option. Message-ID: <20210815144007.3e7cwiecbre2nt6y@two.firstfloor.org> References: <20210813220754.2104922-1-cjense@google.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="33mn4et7ecvdwvtw" Content-Disposition: inline In-Reply-To: <20210813220754.2104922-1-cjense@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --33mn4et7ecvdwvtw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > CSV output example: > > 1.20,msec,task-clock:u,1204272,100.00,0.697,CPUs utilized > 0,,context-switches:u,1204272,100.00,0.000,/sec > 0,,cpu-migrations:u,1204272,100.00,0.000,/sec > 70,,page-faults:u,1204272,100.00,58.126,K/sec The difficult part of such changes to perf stat is that it has so many different output modes that all need to be tested. Unfortunately the unit tests in perf test are not really enough for it. I have an older script (attached) that tests a lot of these outputs. It just exercises them, you still need to check the output manually Can you check that all these modes work correctly both with and without json? -Andi --33mn4et7ecvdwvtw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=STAT-REGR-TEST #!/bin/sh # test perf stat output combinations with --metric-only # output has to be manually verified [ ! -d obj-perf ] && cd .. set -x PERF=${PERF:-./obj-perf/perf} run() { $PERF stat -a "$@" sleep 2 } runprog() { $PERF stat "$@" true } run run -x, run --per-core run --per-socket run -e cycles,instructions run -dddd # topdown # instructions run -I 500 run -I 500 --per-core run -I 500 --per-socket run -I 500 -e cycles,instructions run -I 500 -dddd run -I 500 -x, run -I 500 --per-core -x, run -I 500 --per-socket -x, run -I 500 -e cycles,instructions -x, run -I 500 -dddd -x, runprog -r3 runprog -r3 -x, $PERF stat -r3 true $PERF stat -r3 -x, true sleep 3 & $PERF stat --per-thread -p $! sleep 1 $PERF stat --per-thread -t $! sleep 1 --33mn4et7ecvdwvtw--