From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753334AbdAZTcq (ORCPT ); Thu, 26 Jan 2017 14:32:46 -0500 Received: from mail.kernel.org ([198.145.29.136]:56012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867AbdAZTcp (ORCPT ); Thu, 26 Jan 2017 14:32:45 -0500 Date: Thu, 26 Jan 2017 16:32:40 -0300 From: Arnaldo Carvalho de Melo To: Joe Stringer , ast@fb.com Cc: "Wangnan (F)" , Daniel Borkmann , LKML , netdev Subject: Re: [PATCHv2 perf/core 5/7] tools lib bpf: Add bpf_program__pin() 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 Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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