Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751799AbbFKH5t (ORCPT ); Thu, 11 Jun 2015 03:57:49 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:33703 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbbFKH5m (ORCPT ); Thu, 11 Jun 2015 03:57:42 -0400 Date: Thu, 11 Jun 2015 16:45:53 +0900 From: Namhyung Kim To: Alexei Starovoitov Cc: Wang Nan , 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: <20150611074553.GB11184@sejong> References: <1433829036-23687-1-git-send-email-wangnan0@huawei.com> <1433829036-23687-26-git-send-email-wangnan0@huawei.com> <55777A17.7030000@plumgrid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55777A17.7030000@plumgrid.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1563 Lines: 41 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 > 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/