Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934986AbbKTIOb (ORCPT ); Fri, 20 Nov 2015 03:14:31 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:27581 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934361AbbKTIOa (ORCPT ); Fri, 20 Nov 2015 03:14:30 -0500 Message-ID: <564ED621.4050500@huawei.com> Date: Fri, 20 Nov 2015 16:13:21 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: , , CC: , , , , , , , , , , , , Arnaldo Carvalho de Melo Subject: Re: [RFC PATCH 1/7] perf tools: Add API to config maps in bpf object References: <1445078910-73699-1-git-send-email-wangnan0@huawei.com> <1445078910-73699-2-git-send-email-wangnan0@huawei.com> In-Reply-To: <1445078910-73699-2-git-send-email-wangnan0@huawei.com> 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.0A090204.564ED632.0024,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: 8341110ad71f4024456f43db8fb55427 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1423 Lines: 42 On 2015/10/17 18:48, Wang Nan wrote: > bpf__config_obj() is introduced as a core API to config BPF object > after loading. One configuration option of maps is introduced. After > this patch BPF object can accept configuration like: > > maps.my_map.value=1234 There's an inconvience in this syntax. In following cmdline: # perf record -e mybpf.c/maps.channel.value=1234/ ls because of the greedy manner of flex, mybpf.c/maps.c would be expressed as path of a BPF source file (and yes, it is a valid path). If flex has a non-greedy mode then it would be fixed easily. However, the official flex docs reveals its policy that it doesn't and would not provide non-greedy matching. Even if we have non-greedy matching, we are unable to prohibit user to put their BPF object into path like /home/user/mybpf.c/thefile.c Fortunately this patch has not beed merged, so we have a chance to fix it at very beginning. I will replace all '.' in object config string to ':', so the above cmdline becomes: # perf record -e mybpf.c/maps:channel:value=1234/ ls [1] http://flex.sourceforge.net/manual/Why-doesn_0027t-flex-have-non_002dgreedy-operators-like-perl-does_003f.html -- 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/