From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752909AbbI1Tjo (ORCPT ); Mon, 28 Sep 2015 15:39:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59266 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751596AbbI1Tjm (ORCPT ); Mon, 28 Sep 2015 15:39:42 -0400 Date: Mon, 28 Sep 2015 21:39:37 +0200 From: Jiri Olsa To: He Kuang Cc: a.p.zijlstra@chello.nl, mingo@redhat.com, acme@kernel.org, jolsa@kernel.org, kan.liang@intel.com, adrian.hunter@intel.com, wangnan0@huawei.com, pi3orama@163.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/4] perf tools: Prompt proper error message for wrong terms of hw/sw events Message-ID: <20150928193937.GB18363@krava.redhat.com> References: <1443412336-120050-1-git-send-email-hekuang@huawei.com> <1443412336-120050-2-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443412336-120050-2-git-send-email-hekuang@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2015 at 03:52:14AM +0000, He Kuang wrote: > Prompt proper error message and show valid terms when wrong config > terms is specificed for hw/sw type perf events. This patch makes the > original error prompt function formats_error_string() more generic, > which only outputs the static config terms for hw/sw perf events, and > prepends pmu formats for pmu events. > > Before this patch: > > $ perf record -e 'cpu-clock/freqx=200/' -a sleep 1 > invalid or unsupported event: 'cpu-clock/freqx=200/' > Run 'perf list' for a list of valid events > > usage: perf record [] [] > or: perf record [] -- [] > > -e, --event event selector. use 'perf list' to list available events > > After this patch: > > $ perf record -e 'cpu-clock/freqx=200/' -a sleep 1 > event syntax error: 'cpu-clock/freqx=200/' > \___ unknown term > > valid terms: config,config1,config2,name,period,freq,branch_type,time,call-graph,stack-size > > Run 'perf list' for a list of valid events > > usage: perf record [] [] > or: perf record [] -- [] > > -e, --event event selector. use 'perf list' to list available events > > Signed-off-by: He Kuang Acked-by: Jiri Olsa thanks, jirka