Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752444AbbFKHhG (ORCPT ); Thu, 11 Jun 2015 03:37:06 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:45857 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbbFKHg7 (ORCPT ); Thu, 11 Jun 2015 03:36:59 -0400 Message-ID: <55793A5B.6080202@huawei.com> Date: Thu, 11 Jun 2015 15:35:55 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Namhyung Kim CC: Alexei Starovoitov , , , , , , , , , , , , , , Subject: Re: [RFC PATCH v6 24/32] perf record: Compile scriptlets if pass '.c' to --event References: <1433829036-23687-1-git-send-email-wangnan0@huawei.com> <1433829036-23687-25-git-send-email-wangnan0@huawei.com> <55775F3A.9080204@plumgrid.com> <55777F79.2080605@huawei.com> <20150611071936.GA11184@sejong> In-Reply-To: <20150611071936.GA11184@sejong> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1654 Lines: 58 On 2015/6/11 15:19, Namhyung Kim wrote: > Hi Wang, > > On Wed, Jun 10, 2015 at 08:06:17AM +0800, Wangnan (F) wrote: >> On 2015/6/10 5:48, Alexei Starovoitov wrote: >>> Once clang integration is complete. One can pull >>> upsteam llvm and clang and just use 'clang -O2 -c -march=bpf file.c' >>> >> Good news, so llc part should be removed. >> >> Next version I'd like to use following config options: >> >> [llvm] >> clang-bpf-cmd-template = "$CLANG_EXEC $CLANG_OPTIONS -c $CLANG_SOURCE >> -emit-llvm -O2 -o - | /path/to/llc -march=bpf -filetype=obj -o -" >> clang-path = "/path/to/clang" >> clang-opt = "" >> >> And the default template should be: >> >> $CLANG_EXEC $CLANG_OPTIONS -c "$CLANG_SOURCE" -emit-llvm -O2 -o - > Did you mean this? > > $CLANG_EXEC $CLANG_OPTIONS -O2 -c "$BPF_SOURCE" -march=bpf -o - Thank you for this notice. Now I'm trying this: "$CLANG_EXEC $CLANG_OPTIONS $KERNEL_INC_OPTIONS " "-Wno-unused-value -Wno-pointer-sign " "-working-directory $WORKING_DIR " " -c \"$CLANG_SOURCE\" -march=bpf -O2 -o -" WORKING_DIR is appended because we will get relative include directory using the Makefile trick. > Thanks, > Namhyung > > >> Then with environment variable tricks we make it work with popen. >> >> By this way we can get rid of llc in perf side, and make it work even before >> clang >> integration is complete. >> >> Thank you. -- 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/