From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbbEURxZ (ORCPT ); Thu, 21 May 2015 13:53:25 -0400 Received: from mail-ig0-f179.google.com ([209.85.213.179]:34994 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbbEURxX (ORCPT ); Thu, 21 May 2015 13:53:23 -0400 Message-ID: <555E1B90.2010809@plumgrid.com> Date: Thu, 21 May 2015 10:53:20 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Wangnan (F)" , paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, jolsa@kernel.org, dsahern@gmail.com, daniel@iogearbox.net, brendan.d.gregg@gmail.com, masami.hiramatsu.pt@hitachi.com CC: lizefan@huawei.com, linux-kernel@vger.kernel.org, pi3orama@163.com Subject: Re: [RFC PATCH v3 06/37] bpf tools: Introduce 'bpf' library to tools References: <1431860222-61636-1-git-send-email-wangnan0@huawei.com> <1431860222-61636-7-git-send-email-wangnan0@huawei.com> <555A22DB.5040200@plumgrid.com> <555C03F7.4040206@huawei.com> <555C1A97.3060805@plumgrid.com> <555D25A3.9010507@huawei.com> In-Reply-To: <555D25A3.9010507@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/15 5:24 PM, Wangnan (F) wrote: > > > Do you think we should classify kprobe/socket programs in libbpf layer > instead of perf? > > In my current implementation, type of a program is determined by perf by > parsing names of > corresponding sections. Format of section names should be part of > interface between perf > (and iproute2 and others) and eBPF programs. What libbpf should do is to > fetch those > names and give them to caller, let caller decide the type of programs. > Therefore, if > the program is written for perf, writer of program even don't need to > think about > kprobe/socket program type since in perf currently we can only use > kprobe program. if whole section name string is passed to perf/iproute2 then it's fine, but libbpf already parses 'map', 'license', 'version' section names. Are you saying everything else will be passed to perf directly? perf will parse section string, generate extra prologue insns based on debug info found in vmlinux and call into library back to load them? Sounds ok-ish. Let's see how code looks.