lkml.org 
[lkml]   [2015]   [Jun]   [9]   [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 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 ?
You can even invoke such flag detector from perf via something like:
f = open /tmpdir/Makefile
fprintf(f, "obj-y := dummy.o\n");
fprintf(f, "$(obj)/%%.o: $(src)/%%.c\n");
fprintf(f, "\t@echo -n \"$(NOSTDINC_FLAGS) $(LINUXINCLUDE)
$(EXTRA_CFLAGS)\" > %s\n", cachefile);
snprintf(cmd, "make -s -C /lib/modules/%s/build M=%s dummy.o",
uts_release, tmpdir);
system(cmd);
read flags from cachefile and cache it for the future.
...
or as independent script that populates .perfconfig



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