From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751487AbcBLPpY (ORCPT ); Fri, 12 Feb 2016 10:45:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55130 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbcBLPpW (ORCPT ); Fri, 12 Feb 2016 10:45:22 -0500 Date: Fri, 12 Feb 2016 13:45:17 -0200 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Wang Nan , Alexei Starovoitov , Arnaldo Carvalho de Melo , Brendan Gregg , Adrian Hunter , Cody P Schafer , "David S. Miller" , He Kuang , =?iso-8859-1?Q?J=E9r=E9mie?= Galarneau , Jiri Olsa , Kirill Smelkov , Li Zefan , Masami Hiramatsu , Namhyung Kim , Peter Zijlstra , pi3orama@163.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/54] perf stat: Forbid user passing improper config terms Message-ID: <20160212154517.GB2663@redhat.com> References: <1454680939-24963-1-git-send-email-wangnan0@huawei.com> <1454680939-24963-11-git-send-email-wangnan0@huawei.com> <20160212134908.GD16190@krava.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160212134908.GD16190@krava.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Feb 12, 2016 at 02:49:08PM +0100, Jiri Olsa escreveu: > On Fri, Feb 05, 2016 at 02:01:35PM +0000, Wang Nan wrote: > > 'perf stat' accepts some config terms but doesn't apply them. For > > example: > > > > # perf stat -e 'instructions/no-inherit/' -e 'instructions/inherit/' bash > > # ls > > # exit > > > > Performance counter stats for 'bash': > > > > 266258061 instructions/no-inherit/ > > 266258061 instructions/inherit/ > > hum, but we support no-/inherit in stat, it'd be better to > implement this one for stat IMO > > > > > > 1.402183915 seconds time elapsed > > > > The result is confusing, because user may expect the first > > 'instructions' event exclude the 'ls' command. > > > > This patch forbit most of those config terms for 'perf stat'. > > > > Result: > > > > # ./perf stat -e 'instructions/no-inherit/' -e 'instructions/inherit/' bash > > event syntax error: 'instructions/no-inherit/' > > \___ Don't use record mode only config terms > > and there's bunch of others which are sampling related: > PARSE_EVENTS__TERM_TYPE_SAMPLE_* > PERF_EVSEL__CONFIG_TERM_CALLGRAPH > PERF_EVSEL__CONFIG_TERM_STACK_USER > ... > > probably all from get_config_terms apart from the 'inherot' ones, > which should end up with the error message, which could be more > user friendly like: > > - Can't use stack-size term in stat event. 'stat' event? If this is the term you want to use maybe: 'stack-size' is not usable in 'perf stat'. But perhaps it would be better as: 'stack-size' can only be used when sampling. Or even more verbose: The 'stack-size' can only be configured when sampling, not when just counting events. No? - Arnaldo