Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1772097pxb; Sun, 17 Jan 2021 22:26:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCs2dZN/V716Ya74RksauKFa1d4Hci4q89Dpemh6iFU2mqXKzr2sWTty240GnwkB1GXZRN X-Received: by 2002:aa7:cb49:: with SMTP id w9mr18857378edt.357.1610951194173; Sun, 17 Jan 2021 22:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610951194; cv=none; d=google.com; s=arc-20160816; b=SNnP7g3Zc9rvCC24QVzrikuw0/0rK1AGxtFCBZK9HAzc0tlqy4OIzOCj9oGhKx6PPq lxTAaXs/AzVNEGSmdVyas7II0x64rJCCWky2fv5qSM3IMzWBMU4rzYHgCjZdfRAcNp/a rQnqf2YDQD/0mtAeuN17sWaYff96sRH3leElBU9xsbK2OTvClATXiqimM6bN4DAQmod0 p2JLGPxEDmcqiz0n7NrjlUHJadTVGabg7IpY+2TQY6qFICvd6fPONV/CyxpOOWCGP5Zf IcqxE9aLYskUCNlKNw7rKSeMJzTYKw1vubOI3dgigQx//tkB6oe8R6yu8t83Es6toHAH 0PGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=HwBfqDdKbc+X5MerWF6xbR3hOsOjA1+L0HH/quX+J5M=; b=S/TqXP8VqRP9c2dL+wy6Hdb4uy+ScVkhfiAvjJwX//rPozVC4JfbTBihPiVaAoGRz7 adL49w/cPBn3TULdI/faPh6lri2lBQrpo3455E9GcbOGbYLT3W3rCtY28DYJLRFj4znm Pdw9yk7c50RlyNqNSQN1/Rlgg32snyu75zrbIyTh/55BVDvPlmmYKntQBwUdDj+f8jOh A+Uv6IOgvTe0x4CM2G727FyTEt/IWk3l9NC6zEplA7b0M4vRq2p0fIt+i7JeHt5mv+LW z0TOl2m9Ld1eSVm8PGRv/pw5G5hrr7obmXeqLQbFODZpD0I5mzZr+U3qxXMa5TTkzh7G /P5A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si7360885ejd.679.2021.01.17.22.26.11; Sun, 17 Jan 2021 22:26:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbhARE42 (ORCPT + 99 others); Sun, 17 Jan 2021 23:56:28 -0500 Received: from mga05.intel.com ([192.55.52.43]:43921 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbhARE42 (ORCPT ); Sun, 17 Jan 2021 23:56:28 -0500 IronPort-SDR: uRo9Et2p2EXxZduwGqDUorwnZ92whXHcYDOVb+lvKxUpyvkcOWBLYHnIs6PONW+/jqq/ja7l9H goplEP2FvIqA== X-IronPort-AV: E=McAfee;i="6000,8403,9867"; a="263562979" X-IronPort-AV: E=Sophos;i="5.79,355,1602572400"; d="scan'208";a="263562979" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2021 20:54:42 -0800 IronPort-SDR: x/F1t2tK6H5or7+JFTyHNHYtlkvRQ7PE4851Xm5SYNR2655Ho+VjAplpU1avtvAFDzAp6BNIXp e/n3d9zEyUwQ== X-IronPort-AV: E=Sophos;i="5.79,355,1602572400"; d="scan'208";a="383428999" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.4.27]) ([10.238.4.27]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2021 20:54:39 -0800 Subject: Re: [PATCH v2] perf stat: Append to default list if use -e +event To: Jiri Olsa 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 References: <20210104021837.30473-1-yao.jin@linux.intel.com> <20210112100807.GB1273297@krava> From: "Jin, Yao" Message-ID: <64dba2a3-0bf2-3af3-6f54-6e200840017d@linux.intel.com> Date: Mon, 18 Jan 2021 12:54:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210112100807.GB1273297@krava> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks Jin Yao