Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp784899pxb; Wed, 20 Jan 2021 22:32:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcQzKzWjekBjW0fALkq1sLQ0XEsSi8sR1afjnAEPgCFqc/+bPwfzqawYlLEQL5FiS5DLpP X-Received: by 2002:a50:d88c:: with SMTP id p12mr9967797edj.370.1611210768884; Wed, 20 Jan 2021 22:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611210768; cv=none; d=google.com; s=arc-20160816; b=CEnaEtpPnTWrTWxsm3ORhcpxxl7ecR1FTefoTS8nSw+pKqN/0MGp85NynIUhU0rpo7 G6j5kXiyHxgBRczThkZPLr9XH60XqAWob64I8q20GWl6phxsNHeFKnmiqik+5xjK87Y5 QL/Jmc33OdrnaCZ5BMOpQ68EWsWGcYf4JBdsALOoiBKURbQTssjQIxjYr9Uz25cUZEo8 oEnn5PGD9Hi/i8zoDANakNUMUfqnfRzYIv3K3hy+DQSWuPboPAT3rOrIjfYMxGxM1qPp T7/kG4p5SpaQ6CuAcvU272adEWtrfh5OI6/pQnjgji8WUlL3AGt84jPYdaSwh5UUK27X JfcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6M0kiTHNLGAWYX3jX6GQ7MllBMP9eI8gpCnHl+Iru4E=; b=0YwiOroNXwq1oqFaODM6KHdCMdng3+jTfstzccKXLl9ZRcA+Rw9e0rqQW58yDfbTIn A7veGzzXi0BZc2qcczbvScSzDSf1B+kK5KODyrskvnJpMYv23O/ELUqmDvYMCdOyZxp2 ieBBbd3mV227iIkx0SrlXD1nkL5oKcRXSffM4Yn6AqqjnmbZYB9mMnuxfvib1KCxUMyw 83ZFTs0UETPcM0Wf6QObHb1YFwwFlQap6ifGrvFTy+UQ9Uub2ogsZd5OVkq9+g4FrUE3 hCalePxqdDP6aFrmbfcTyLHtiZXq1Nem5r2XMO+UFqXYSy33QEbiu7/GpWhE5qsDMaWd 04YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CxNRwCxz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si1539242ejs.49.2021.01.20.22.32.25; Wed, 20 Jan 2021 22:32:48 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=CxNRwCxz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387853AbhATXqx (ORCPT + 99 others); Wed, 20 Jan 2021 18:46:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57360 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728464AbhATV1h (ORCPT ); Wed, 20 Jan 2021 16:27:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611177960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6M0kiTHNLGAWYX3jX6GQ7MllBMP9eI8gpCnHl+Iru4E=; b=CxNRwCxzvTzkI4eo0Prs2pnCd2xEmm4GsrVIE91GLcJ7W2PEiFIKIGFjm831Z3gskfnUWD 6kJHgxV/AQfmC4ZrvgmVuqs29jaqS5oYOAuCAN/g/lj7A6jVZdlKsHwAHLJyo09HX/Pswd MKpzdgVlcoYthUkOnFNpjgz2A8WN2fQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-170-PUdxj0ibMC6SgjhV1SGiLQ-1; Wed, 20 Jan 2021 16:25:57 -0500 X-MC-Unique: PUdxj0ibMC6SgjhV1SGiLQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B3FE107ACE4; Wed, 20 Jan 2021 21:25:56 +0000 (UTC) Received: from krava (unknown [10.40.194.35]) by smtp.corp.redhat.com (Postfix) with SMTP id 024FF1992D; Wed, 20 Jan 2021 21:25:53 +0000 (UTC) Date: Wed, 20 Jan 2021 22:25:53 +0100 From: Jiri Olsa To: "Jin, Yao" Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v2] perf stat: Append to default list if use -e +event Message-ID: <20210120212553.GA1798087@krava> References: <20210104021837.30473-1-yao.jin@linux.intel.com> <20210112100807.GB1273297@krava> <64dba2a3-0bf2-3af3-6f54-6e200840017d@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64dba2a3-0bf2-3af3-6f54-6e200840017d@linux.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 12:54:37PM +0800, Jin, Yao wrote: > Hi Jiri, > > On 1/12/2021 6:08 PM, Jiri Olsa wrote: > > On Mon, Jan 04, 2021 at 10:18:37AM +0800, Jin Yao wrote: > > > The default event list includes the most common events which are widely > > > used by users. But with -e option, the current perf only counts the events > > > assigned by -e option. Users may want to collect some extra events with > > > the default list. For this case, users have to manually add all the events > > > from the default list. It's inconvenient. Also, users may don't know how to > > > get the default list. > > > > > > Now it supports a simple syntax: -e +event > > > > > > The prefix '+' tells perf to append this event (or event list) to default > > > event list. > > > > > > Before: > > > > > > root@kbl-ppc:~# ./perf stat -e power/energy-pkg/ -a -- sleep 1 > > > > > > Performance counter stats for 'system wide': > > > > > > 2.04 Joules power/energy-pkg/ > > > > > > 1.000863884 seconds time elapsed > > > > > > After: > > > > > > root@kbl-ppc:~# ./perf stat -e +power/energy-pkg/ -a -- sleep 1 > > > > > > Performance counter stats for 'system wide': > > > > > > 2.11 Joules +power/energy-pkg/ # 0.000 K/sec > > > > I dont think we should print the extra '+' prefix > > > > jirka > > > > > 8,007.17 msec cpu-clock # 7.993 CPUs utilized > > > 125 context-switches # 0.016 K/sec > > > 8 cpu-migrations # 0.001 K/sec > > > 2 page-faults # 0.000 K/sec > > > 8,520,084 cycles # 0.001 GHz > > > 2,808,302 instructions # 0.33 insn per cycle > > > 555,427 branches # 0.069 M/sec > > > 59,005 branch-misses # 10.62% of all branches > > > > > > 1.001832003 seconds time elapsed > > > > > > Signed-off-by: Jin Yao > > > > Printing '+' prefix is the original behavior. > > Without this patch, > > root@kbl-ppc:# ./perf stat -e +power/energy-pkg/ -a -- sleep 1 > > Performance counter stats for 'system wide': > > 2.02 Joules +power/energy-pkg/ > > 1.000859434 seconds time elapsed > > The '+' prefix is printed. So I finally decide not to remove the '+' prefix > in order to keep original behavior. hm, originaly there's no purpose for the '+', right? it seems it's more like bug then anything else you added function to the '+' to add default events to specified event, which I think is good idea, but I don't think we should display the extra '+' in output thanks, jirka