Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754443AbbGFPkq (ORCPT ); Mon, 6 Jul 2015 11:40:46 -0400 Received: from mail.kernel.org ([198.145.29.136]:56719 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751991AbbGFPkn (ORCPT ); Mon, 6 Jul 2015 11:40:43 -0400 Date: Mon, 6 Jul 2015 12:40:35 -0300 From: Arnaldo Carvalho de Melo To: pi3orama Cc: Wang Nan , "a.p.zijlstra@chello.nl" , "mingo@redhat.com" , "jolsa@kernel.org" , "peterz@infradead.org" , "namhyung@kernel.org" , "kan.liang@intel.com" , "adrian.hunter@intel.com" , "ak@linux.intel.com" , "cody@linux.vnet.ibm.com" , "jacob.w.shin@gmail.com" , "standby24x7@gmail.com" , "lizefan@huawei.com" , "yunlong.song@huawei.com" , "rostedt@goodmis.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] perf record: Allow passing perf's own pid to '--filter' Message-ID: <20150706154035.GI16826@kernel.org> References: <1436156251-147535-1-git-send-email-wangnan0@huawei.com> <20150706135650.GG16826@kernel.org> <03223997-411B-4C5E-B03D-080F40EE76D6@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <03223997-411B-4C5E-B03D-080F40EE76D6@163.com> X-Url: http://acmel.wordpress.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 Content-Length: 1654 Lines: 41 Em Mon, Jul 06, 2015 at 11:00:10PM +0800, pi3orama escreveu: > 发自我的 iPhone > > 在 2015年7月6日,下午9:56,Arnaldo Carvalho de Melo 写道: > > I.e. having something in the filter expression that gets transformed > > into the tools' pid, I have no problem with that, just curious about > > what would be the best character to signal that a substitution needs to > > be performed, if it is really '@VAR', as my first selection would be > > '$VAR', > $ has special meaning for shell. Using $ in cmdline require users use escaping or '' quoted string. Therefore I believe @ should be better. What do you think? Yeah, that gets in the way, as it gets in the way for '!', i.e. negating, and even tho, that is what is used in strace (and in 'perf trace'): strace -e \!open,write ls Or: strace -e '!open,write' ls But apart from that, it would be good if expressions used in 'perf probe' and here could have as much as possible the same semantics for those markers, i.e. 'perf probe' already uses @ for some stuff, probably the meaning is for "at", i.e. something at some place. '$' strongly associated with variables, so I don't think it would be a big problem to enclose expressions where variables (we may end having others, no?) in '', i.e. perf record -e sched:*switch --filter 'common_pid != $PERF_PID' -a Doesn't look so ugly or cumbersome :-) - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/