Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758770AbcDHQQy (ORCPT ); Fri, 8 Apr 2016 12:16:54 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:57000 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758681AbcDHQQw (ORCPT ); Fri, 8 Apr 2016 12:16:52 -0400 Subject: Re: [PATCH 1/4] perf trace: Improve error message when receive non-tracepoint events To: Arnaldo Carvalho de Melo References: <1460128045-97310-1-git-send-email-wangnan0@huawei.com> <1460128045-97310-2-git-send-email-wangnan0@huawei.com> <20160408152257.GO5945@kernel.org> CC: , , , Arnaldo Carvalho de Melo , Jiri Olsa From: "Wangnan (F)" Message-ID: <5707D879.8030406@huawei.com> Date: Sat, 9 Apr 2016 00:12:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160408152257.GO5945@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.5707D887.0052,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 85b39c8be0bc6555613219ed60d9947d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1346 Lines: 40 On 2016/4/8 23:22, Arnaldo Carvalho de Melo wrote: > Em Fri, Apr 08, 2016 at 03:07:22PM +0000, Wang Nan escreveu: >> Before this patch, strange error message is provided if passed a >> non-tracepoint event to 'perf trace': >> >> # perf trace -a --ev cycles sleep 1 >> Failed to set filter "common_pid != 27500" on event cycles with 22 (Invalid argument) >> >> This is because 'perf trace' accepts all valid events during cmdline >> parsing, but in fact user can only provide tracepoints, because it >> needs filter. >> >> This patch validate evlist, report error earlier: >> >> # ./perf trace -a --ev cycles sleep 1 >> Only support tracepoint events! > Humm, perhaps we should instead refrain from setting filters to non > tracepoint events? I.e. I don't see why we whouldn't support, say, > software events... > > /me trying some now, i.e.: > > # trace --ev minor-faults --no-syscalls > > But it has some issues... > > - Arnaldo > We already have commit fdf14720fbd02 ("perf tools: Only set filter for tracepoints events") so you won't see the ugly error message again. However, I think parsing non-tracepoint events in 'perf trace' is still a challange. We never support it in 'perf trace' and I'm not too much sure who will need this feature and how to use them, and why he/she can't use 'perf record' instead. Thank you.