From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941376AbcIZBx1 (ORCPT ); Sun, 25 Sep 2016 21:53:27 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:6319 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941237AbcIZBxZ (ORCPT ); Sun, 25 Sep 2016 21:53:25 -0400 Subject: Re: [PATCH 00/14] perf clang: Support compiling BPF script use builtin clang To: Alexei Starovoitov References: <1474635001-153850-1-git-send-email-wangnan0@huawei.com> <20160924151559.GA49831@ast-mbp.thefacebook.com> CC: , , , , , "Arnaldo Carvalho de Melo" , He Kuang , Jiri Olsa From: "Wangnan (F)" Message-ID: <57E87EAA.2090308@huawei.com> Date: Mon, 26 Sep 2016 09:49:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160924151559.GA49831@ast-mbp.thefacebook.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.57E87EBF.0103,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8435c172cfadb5c0c1183e83b3cb90e1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/9/24 23:16, Alexei Starovoitov wrote: > On Fri, Sep 23, 2016 at 12:49:47PM +0000, Wang Nan wrote: >> This patch set is the first step to implement features I announced >> in LinuxCon NA 2016. See page 31 of: >> >> http://events.linuxfoundation.org/sites/events/files/slides/Performance%20Monitoring%20and%20Analysis%20Using%20perf%20and%20BPF_1.pdf >> >> This patch set links LLVM and Clang libraries to perf, so perf >> is able to compile BPF script to BPF object on the fly. > Nice! > So single perf binary won't have llvm external dependency anymore > or both ways will be maintained? > The command line stays the same? Yes. This patch set doesn't change interface. It compiles BPF script with builtin clang, and if it fail, fall back to external clang. > If I understand the patches correctly, this set is establishing > the basic functionality and more complex features coming? > Yes. Following steps are: 1. Ease of use improvement: automatically include BPF functions declaration and macros. 2. Perf's hook: compile part of BPF script into native code, run them in perf when something happen. Create a channel, coordinate BPF and native code use bpf-output event. 3. Define a new language to support common profiling task. I'm not very clear what the new language should be. It may looks like lua, perf converts it to C then to LLVM IR with builtin clang. Thank you.