lkml.org 
[lkml]   [2015]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v6 25/32] perf tools: Add 'bpf.' config section to perf default config
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


\
 
 \ /
  Last update: 2015-06-11 17:21    [W:1.011 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site