From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: Re: [PATCHv2 perf/core 5/7] tools lib bpf: Add bpf_program__pin() Date: Thu, 26 Jan 2017 16:32:40 -0300 Message-ID: <20170126193240.GC17504@kernel.org> References: <20170123011128.26534-1-joe@ovn.org> <20170123011128.26534-6-joe@ovn.org> <921d83a9-aa44-acee-4fcf-dbc45cc0a66a@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Wangnan (F)" , Daniel Borkmann , LKML , netdev To: Joe Stringer , ast@fb.com Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Em Wed, Jan 25, 2017 at 10:18:22AM +0800, Wangnan (F) escreveu: > On 2017/1/25 9:16, Joe Stringer wrote: > > On 24 January 2017 at 17:06, Wangnan (F) wrote: > > > On 2017/1/25 9:04, Wangnan (F) wrote: > > > Is it possible to use directory tree instead? > > > %s/object/mapname > > > %s/object/prog/instance > > I don't think objects have names, so let's assume an object with two > > program instances named foo, and one map named bar. > > A call of bpf_object__pin(obj, "/sys/fs/bpf/myobj") would mount with > > the following files and directories: > > /sys/fs/bpf/myobj/foo/1 > > /sys/fs/bpf/myobj/foo/2 > > /sys/fs/bpf/myobj/bar > > Alternatively, if you want to control exactly where you want the > > progs/maps to be pinned, you can call eg > > bpf_program__pin_instance(prog, "/sys/fs/bpf/wherever", 0) and that > > instance will be mounted to /sys/fs/bpf/wherever, or alternatively > > bpf_program__pin(prog, "/sys/fs/bpf/foo"), and you will end up with > > /sys/fs/bpf/foo/{0,1}. > > This looks pretty reasonable to me. > It looks good to me. Ok, please continue from perf/core, Ingo merged the first patch of this patchset today, - Arnaldo