Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp696912pxb; Wed, 20 Jan 2021 18:58:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJynyls/GPQ0uBPgSOx/4/3fTS+Tv8PoU3EAetQ9w5rT6cCUoq0zDX70MIgK+9VLt5tSNL23 X-Received: by 2002:a05:6402:2707:: with SMTP id y7mr9085051edd.5.1611197932962; Wed, 20 Jan 2021 18:58:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611197932; cv=none; d=google.com; s=arc-20160816; b=oxX6Glo/7cbFq+EOQnJU6TsqP0BUEqynW0wXVc84BosfvL0NAw4b1NSXJLsOxIzVXa eBtjjEdNDMB5AcFw0C2WLs8ucS4eqhVgxpL03XmKRwpkPTaRAv8s5+kwcEV7W6VApS4g dEn2i8fCEETb9TU9TBodIlXK3FXkjeMakFFlsDjyUt2DaKSXf2CtvU6jZuJWngLyulFg jPI1kLSuNcWWwWT7qd6CYitzwyj8idVXbAr9XBeyyQq5Nj4IVIVTgkUy11A0PrE8mdnH y4wO6gua+o+Gun9n6Q5VktcX6ZAsCQ+aRwb9Tq+N3PB5iX2xv/fgCb1G6/77EKatAT79 MzyQ== 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=c6ncBIt9Ekf8bjNpiZrZfEcZtf02QM78gxfzabUQ11A=; b=FwcnchsOzLKpWsBdm7qUCEi/g3GYfTtJBuU4Np6mxdCfV1MQApoBkMLKaDxZg5BXaK H0QmlipbuLT0+8WqYs/cxm2+A+JgoUQ0bW30DzNitkVS7zcAGEt+Tp3gTfsfrJO/eWm4 hxdc/VzD5FuvZs6v4Qg0H8pejGSvXP+Ajchnvzy7J+BOeaoDS7L5IjhOsxxAkprGYlmr yvBLs/T9TtwwxRQgtu8zDGJPOeGqXnQmkQgq9BPBe/UqvSbN9H9XX4OqugSYueGrE6An 16DWkb/u8kL2F/BVrNRfCZflPe6itttlB6CgkvQf+6uJijO2li+a7eeTQrfIgxr+e78Z PYxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tcbzaI65; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c22si1290757ejd.523.2021.01.20.18.58.18; Wed, 20 Jan 2021 18:58:52 -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=@kernel.org header.s=k20201202 header.b=tcbzaI65; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbhAUAyA (ORCPT + 99 others); Wed, 20 Jan 2021 19:54:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:53414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732524AbhAUAEi (ORCPT ); Wed, 20 Jan 2021 19:04:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6476523715; Thu, 21 Jan 2021 00:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611187437; bh=5fr4z5/rmbcCQOdmoOF/n3lxb1XPUGiO7WPhD1Lx9rc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tcbzaI657iesOt4GyEiDhf/28WQQz0Npes1+o/o1TfQ2MlC2PgO3gi8X7mktdff0z y4oLOF74BURA8AIgOEkfa5P/nwF6t9JhQ07bZeJSsM/jgaKhoFmBlsXYj+7pd3BRnh Y1DNO9oAIySwphO/i+zFXwzP778YIDT9SFp/nPH3eCJk1Lctj6VGLN8ceR2MOrWDLZ tdawvUvsGCOTLioJJLS33I5cAwNbgakmnT96FtCxgtKhQTN8JCpo0OIZuO2uYr7kbp OzzI9IRaZenmq6PxhToaXHpAPhfOLvoL3C+UBKlZzrsXavj7tgf596TPk0Sbw2/C65 huFfelaYgiuow== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 1945540513; Wed, 20 Jan 2021 21:03:55 -0300 (-03) Date: Wed, 20 Jan 2021 21:03:55 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: "Jin, Yao" , 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: <20210121000355.GB106434@kernel.org> References: <20210104021837.30473-1-yao.jin@linux.intel.com> <20210112100807.GB1273297@krava> <64dba2a3-0bf2-3af3-6f54-6e200840017d@linux.intel.com> <20210120212553.GA1798087@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210120212553.GA1798087@krava> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Jan 20, 2021 at 10:25:53PM +0100, Jiri Olsa escreveu: > On Mon, Jan 18, 2021 at 12:54:37PM +0800, Jin, Yao wrote: > > 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 The value would be to stress that that is an event added to the ones without the + prefix, i.e. the default ones. But by having the command line copied over and the added events at the first lines we should have that abundantly clear. Also we won't print removed events (using -), is that available already? Nope: [root@quaco ~]# perf stat -e -cycles sleep event syntax error: '-cycles' \___ parser error Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events [root@quaco ~]# Like with: [root@quaco ~]# perf stat -d sleep 1 Performance counter stats for 'sleep 1': 0.80 msec task-clock # 0.001 CPUs utilized 1 context-switches # 0.001 M/sec 0 cpu-migrations # 0.000 K/sec 59 page-faults # 0.073 M/sec 2,215,522 cycles # 2.757 GHz (7.40%) 1,073,189 instructions # 0.48 insn per cycle (80.59%) 203,615 branches # 253.392 M/sec 8,309 branch-misses # 4.08% of all branches 245,866 L1-dcache-loads # 305.972 M/sec 14,024 L1-dcache-load-misses # 5.70% of all L1-dcache accesses (92.60%) LLC-loads (0.00%) LLC-load-misses (0.00%) 1.001887261 seconds time elapsed 0.000000000 seconds user 0.001413000 seconds sys Some events weren't counted. Try disabling the NMI watchdog: echo 0 > /proc/sys/kernel/nmi_watchdog perf stat ... echo 1 > /proc/sys/kernel/nmi_watchdog [root@quaco ~]# perf stat -e -LLC* -d sleep 1 event syntax error: '-LLC*' \___ parser error Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events [root@quaco ~]# - Arnaldo