Skip to content

perf clang: Builtin clang and perfhook support

Wang Nan lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest18 patches 2 repliesIn review
  2. v330 patches 26 repliesSuperseded
  3. v134 patches 3 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18perf build: Check LLVM version in feature checktools/build/feature/Makefile tools/build/feature/test-llvm-version.cpp tools/build/feature/test-llvm.cpp +1 more+29 -41 reply
1/18perf build: Check LLVM version in feature checktools/build/feature/Makefile tools/build/feature/test-llvm-version.cpp tools/build/feature/test-llvm.cpp +1 more+28 -41 reply
2/18perf build: Support dynamic linking clang librariestools/perf/Makefile.perf+18 -20 replies
3/18perf clang: Cleanup clang optionstools/perf/util/c++/clang.cpp+1 -40 replies
4/18perf clang: Pass full path to builtin clangtools/perf/util/c++/clang.cpp+6 -20 replies
5/18perf clang: Pass CFLAGS to builtin clangtools/perf/util/c++/clang.cpp tools/perf/util/llvm-utils.h+109 -50 replies
6/18perf clang jit: Wrap llvm::Module using PerfModuletools/perf/util/c++/clang-test.cpp tools/perf/util/c++/clang.cpp tools/perf/util/c++/clang.h+34 -180 replies
7/18perf clang jit: Insignt BPF and JIT functions in a Moduletools/perf/util/c++/clang.cpp tools/perf/util/c++/clang.h+45 -00 replies
8/18perf clang jit: add PerfModule::doJIT to JIT perfhook functionstools/perf/tests/bpf-script-example.c tools/perf/tests/clang.c tools/perf/util/c++/clang-c.h +3 more+128 -20 replies
9/18perf clang jit: Export functions for jitted codetools/perf/tests/Build tools/perf/tests/bpf-script-example.c tools/perf/util/c++/clang-c.h +2 more+32 -20 replies
10/18perf clang jit: Actually JIT and hook in bpf loadertools/perf/util/bpf-loader.c tools/perf/util/c++/clang-c.h tools/perf/util/c++/clang.cpp+53 -40 replies
11/18perf clang jit: Collect the lowest address in maps section as map_basetools/perf/util/bpf-loader.c tools/perf/util/c++/clang-c.h tools/perf/util/c++/clang.cpp +1 more+59 -60 replies
12/18perf clang jit: Retrive fd of BPF map from its offsettools/perf/util/bpf-loader.c tools/perf/util/bpf-loader.h+56 -00 replies
13/18perf clang jit: Allow jitted perf hook access BPF mapstools/perf/util/Build tools/perf/util/c++/clang.cpp tools/perf/util/jit-helpers.c +1 more+94 -10 replies
14/18perf clang: Link BPF functions declaration into perftools/perf/util/c++/Build tools/perf/util/c++/bpf-funcs-str.c tools/perf/util/c++/clang-bpf-includes.h+62 -00 replies
15/18perf clang: Declare BPF functions for BPF scripts automaticallytools/perf/tests/bpf-script-example.c tools/perf/tests/bpf-script-test-prologue.c tools/perf/tests/bpf-script-test-relocation.c +1 more+56 -150 replies
16/18perf clang: Include helpers to BPF scriptstools/perf/tests/bpf-script-example.c tools/perf/tests/bpf-script-test-kbuild.c tools/perf/tests/bpf-script-test-prologue.c +5 more+25 -40 replies
17/18perf clang builtin: Define hook helpers by defaulttools/perf/util/c++/bpf-helper-str.c+7 -00 replies
18/18perf clang jit: Export getpid() to perf hooktools/perf/util/c++/bpf-helper-str.c tools/perf/util/c++/clang.cpp+2 -00 replies

Reviews trailers per patch

3 of 19 patches have a Reviewed-by or Acked-by.

PatchAlexei Starovoitov
1/18
1/18
2/18
3/18
4/18
5/18
6/18
7/18A-b
8/18A-b
9/18
10/18
11/18
12/18
13/18A-b
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/18] perf clang: Builtin clang and perfhook support

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
Cc Alexei Starovoitov <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc He Kuang <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Joe Stringer <[email protected]>
Cc Zefan Li <[email protected]>
Signature · 1 line
2.10.1