Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754003AbbFIXn0 (ORCPT ); Tue, 9 Jun 2015 19:43:26 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:35454 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932420AbbFIXnW (ORCPT ); Tue, 9 Jun 2015 19:43:22 -0400 Message-ID: <55777A17.7030000@plumgrid.com> Date: Tue, 09 Jun 2015 16:43:19 -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: Wang Nan , acme@kernel.org, brendan.d.gregg@gmail.com, daniel@iogearbox.net, namhyung@kernel.org, masami.hiramatsu.pt@hitachi.com, paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com, jolsa@kernel.org, dsahern@gmail.com CC: 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 References: <1433829036-23687-1-git-send-email-wangnan0@huawei.com> <1433829036-23687-26-git-send-email-wangnan0@huawei.com> In-Reply-To: <1433829036-23687-26-git-send-email-wangnan0@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1288 Lines: 32 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 -- 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/