Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbcLFHbp (ORCPT ); Tue, 6 Dec 2016 02:31:45 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:28860 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbcLFHbm (ORCPT ); Tue, 6 Dec 2016 02:31:42 -0500 From: Wang Nan To: CC: , , Wang Nan , Alexei Starovoitov , "Arnaldo Carvalho de Melo" , He Kuang , Jiri Olsa , Zefan Li , Subject: [PATCH v4 00/18] perf clang: Builtin clang and perfhook support Date: Tue, 6 Dec 2016 07:13:38 +0000 Message-ID: <20161206071356.5312-1-wangnan0@huawei.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3481 Lines: 73 This is version 4 of perf builtin clang and perfhook patch series. In this patch set: 1. Cleanup options passed to clang. 2. Check LLVM version. Fail if llvm version < 3.9.0, and warn when it > 3.9.0. More version will be allowed after releasing of LLVM 3.9.1 / 4.0.0. 3. Support dynamic linking LLVM and clang libraries. 4. Rebase to Arnaldo's newest perf/core. Wang Nan (18): perf build: Check LLVM version in feature check perf build: Support dynamic linking clang libraries perf clang: Cleanup clang options perf clang: Pass full path to builtin clang perf clang: Pass CFLAGS to builtin clang perf clang jit: Wrap llvm::Module using PerfModule perf clang jit: Insignt BPF and JIT functions in a Module perf clang jit: add PerfModule::doJIT to JIT perfhook functions perf clang jit: Export functions for jitted code perf clang jit: Actually JIT and hook in bpf loader perf clang jit: Collect the lowest address in maps section as map_base perf clang jit: Retrive fd of BPF map from its offset perf clang jit: Allow jitted perf hook access BPF maps perf clang: Link BPF functions declaration into perf perf clang: Declare BPF functions for BPF scripts automatically perf clang: Include helpers to BPF scripts perf clang builtin: Define hook helpers by default perf clang jit: Export getpid() to perf hook tools/build/feature/Makefile | 8 +- tools/build/feature/test-llvm-version.cpp | 12 + tools/build/feature/test-llvm.cpp | 5 + tools/perf/Makefile.config | 8 +- tools/perf/Makefile.perf | 20 +- tools/perf/tests/Build | 2 +- tools/perf/tests/bpf-script-example.c | 30 ++- tools/perf/tests/bpf-script-test-kbuild.c | 2 + tools/perf/tests/bpf-script-test-prologue.c | 6 +- tools/perf/tests/bpf-script-test-relocation.c | 17 +- tools/perf/tests/clang.c | 4 + tools/perf/util/Build | 1 + tools/perf/util/bpf-loader.c | 85 ++++++- tools/perf/util/bpf-loader.h | 19 ++ tools/perf/util/c++/Build | 2 + tools/perf/util/c++/bpf-funcs-str.c | 49 ++++ tools/perf/util/c++/bpf-helper-str.c | 23 ++ tools/perf/util/c++/clang-bpf-includes.h | 13 + tools/perf/util/c++/clang-c.h | 24 +- tools/perf/util/c++/clang-test.cpp | 51 +++- tools/perf/util/c++/clang.cpp | 335 ++++++++++++++++++++++++-- tools/perf/util/c++/clang.h | 47 +++- tools/perf/util/jit-helpers.c | 57 +++++ tools/perf/util/jit-helpers.h | 28 +++ tools/perf/util/llvm-utils.h | 9 +- 25 files changed, 802 insertions(+), 55 deletions(-) create mode 100644 tools/build/feature/test-llvm-version.cpp create mode 100644 tools/perf/util/c++/bpf-funcs-str.c create mode 100644 tools/perf/util/c++/bpf-helper-str.c create mode 100644 tools/perf/util/c++/clang-bpf-includes.h create mode 100644 tools/perf/util/jit-helpers.c create mode 100644 tools/perf/util/jit-helpers.h Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: He Kuang Cc: Jiri Olsa Cc: Joe Stringer Cc: Zefan Li Cc: pi3orama@163.com -- 2.10.1