Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754928AbbFKOwW (ORCPT ); Thu, 11 Jun 2015 10:52:22 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34494 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750833AbbFKOwT (ORCPT ); Thu, 11 Jun 2015 10:52:19 -0400 Date: Thu, 11 Jun 2015 23:50:40 +0900 From: Namhyung Kim To: "Wangnan (F)" Cc: Alexei Starovoitov , acme@kernel.org, brendan.d.gregg@gmail.com, daniel@iogearbox.net, masami.hiramatsu.pt@hitachi.com, paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com, jolsa@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org, lizefan@huawei.com, hekuang@huawei.com, xiakaixu@huawei.com, pi3orama@163.com Subject: Re: [RFC PATCH v6 25/32] perf tools: Add 'bpf.' config section to perf default config Message-ID: <20150611145040.GC31117@danjae.kornet> References: <1433829036-23687-1-git-send-email-wangnan0@huawei.com> <1433829036-23687-26-git-send-email-wangnan0@huawei.com> <55777A17.7030000@plumgrid.com> <20150611074553.GB11184@sejong> <55794240.7060009@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55794240.7060009@huawei.com> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1778 Lines: 43 On Thu, Jun 11, 2015 at 04:09:36PM +0800, Wangnan (F) wrote: > On 2015/6/11 15:45, Namhyung Kim wrote: > >On Tue, Jun 09, 2015 at 04:43:19PM -0700, Alexei Starovoitov wrote: > >>On 6/8/15 10:50 PM, Wang Nan wrote: > >>>perf_bpf_config() is added to parse 'bpf' section in perf config file. > >>>Following is an example: > >>> > >>> [bpf] > >>> clang-path = /llvm/bin/x86_64-linux-clang" > >>> llc-path = /llvm/bin/x86_64-linux-llc" > >>> clang-opt = "-nostdinc -isystem /llvm/lib/clang/include -I/kernel/arch/x86/include ..." > >>> llc-opt = "" > >>a section to specify -I flags to compile prog.c is useful, > >>but users shouldn't be populating it manually for kernel headers. > >>How about adding a script that can figure out $(LINUXINCLUDE) > >>automatically ? > >Maybe a dummy question. For what reason it needs such headers? Is it > >possible to have a (part of?) copy of needed bits in the perf source? > > > >Thanks, > >Namhyung > > It is improtant for eBPF script that it should be able to extract > information > from kernel pointers. For example: to extract registers from 'struct > pt_regs' and > to extract fields from 'struct page *'. I believe this is an improtant > reason > why we decide to use C-like language instead of designing a DLS. Therefore, > when > compiling .c to .o, kernel source is mandatory. Since we don't want to limit > the > ability of data accessing of eBPF scripts, we have to give it ability to > access all > kernel headers. Understood, thank you for the explanation! Namhyung -- 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/