Skip to contentSkip to conversation

perf config: Update default value for llvm.clang-bpf-cmd-template

PATCH Applied Leo Yan 3 participants 3 messages Jun 7, 2019 – Jun 17, 2019

Subsystems (4)
lore
Share & tools
lore

Leo Yan

author
#0 lore raw

PATCH 1/1 perf config: Update default value for llvm.clang-bpf-cmd-template

The clang bpf cmdline template has defined default value in the file tools/perf/util/llvm-utils.c, which has been changed for several times.

This patch updates the documentation to reflect the latest default value for the configuration llvm.clang-bpf-cmd-template.

Fixes d35b168c3dcd ("perf bpf: Give precedence to bpf header dir")
Fixes cb76371441d0 ("perf llvm: Allow passing options to llc in addition to clang")
Fixes 1b16fffa389d ("perf llvm-utils: Add bpf include path to clang command line")
---
 tools/perf/Documentation/perf-config.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-config.txt +6 -3
index 462b3cde0675..e4aa268d2e38 100644
@@ -564,9 +564,12 @@ llvm.*::
 	llvm.clang-bpf-cmd-template::
 		Cmdline template. Below lines show its default value. Environment
 		variable is used to pass options.
-		"$CLANG_EXEC -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS \
-		-Wno-unused-value -Wno-pointer-sign -working-directory \
-		$WORKING_DIR  -c $CLANG_SOURCE -target bpf -O2 -o -"
+		"$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
+		"-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE "	\
+		"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
+		"-Wno-unused-value -Wno-pointer-sign "		\
+		"-working-directory $WORKING_DIR "		\
+		"-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"
 
 	llvm.clang-opt::
 		Options passed to clang.
Signature · 1 line
2.17.1
#1 lore raw

Em Fri, Jun 07, 2019 at 10:35:08PM +0800, Leo Yan escreveu:

Quoted 9 lines

The clang bpf cmdline template has defined default value in the file tools/perf/util/llvm-utils.c, which has been changed for several times.

This patch updates the documentation to reflect the latest default value for the configuration llvm.clang-bpf-cmd-template.

Fixes d35b168c3dcd ("perf bpf: Give precedence to bpf header dir")
Fixes cb76371441d0 ("perf llvm: Allow passing options to llc in addition to clang")
Fixes 1b16fffa389d ("perf llvm-utils: Add bpf include path to clang command line")

Well done! Three fixes! :-)

Who was it that made the changes and forgot to update the docs... oops, it was me 8-)

Thanks, applied.

- Arnaldo

Quoted 27 lines
---
 tools/perf/Documentation/perf-config.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-config.txt +6 -3
index 462b3cde0675..e4aa268d2e38 100644
@@ -564,9 +564,12 @@ llvm.*::
 	llvm.clang-bpf-cmd-template::
 		Cmdline template. Below lines show its default value. Environment
 		variable is used to pass options.
-		"$CLANG_EXEC -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS \
-		-Wno-unused-value -Wno-pointer-sign -working-directory \
-		$WORKING_DIR  -c $CLANG_SOURCE -target bpf -O2 -o -"
+		"$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
+		"-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE "	\
+		"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
+		"-Wno-unused-value -Wno-pointer-sign "		\
+		"-working-directory $WORKING_DIR "		\
+		"-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"
 
 	llvm.clang-opt::
 		Options passed to clang.
Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo
#2 lore raw
In reply to Leo Yan
perf config: Update default value for llvm.clang-bpf-cmd-template
Commit-ID:  87407fa58b6645cecd24102f58476b8dd7ce778d
Gitweb:     https://git.kernel.org/tip/87407fa58b6645cecd24102f58476b8dd7ce778d
Author:     Leo Yan <[email protected]>
AuthorDate: Fri, 7 Jun 2019 22:35:08 +0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 10 Jun 2019 16:20:11 -0300

perf config: Update default value for llvm.clang-bpf-cmd-template

The clang bpf cmdline template has defined default value in the file tools/perf/util/llvm-utils.c, which has been changed for several times.

This patch updates the documentation to reflect the latest default value for the configuration llvm.clang-bpf-cmd-template.

Cc Alexander Shishkin <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Daniel Borkmann <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Drayton <[email protected]>
Cc Martin KaFai Lau <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Song Liu <[email protected]>
Cc Yonghong Song <[email protected]>
Fixes d35b168c3dcd ("perf bpf: Give precedence to bpf header dir")
Fixes cb76371441d0 ("perf llvm: Allow passing options to llc in addition to clang")
Fixes 1b16fffa389d ("perf llvm-utils: Add bpf include path to clang command line")
---
 tools/perf/Documentation/perf-config.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-config.txt +6 -3
index 462b3cde0675..e4aa268d2e38 100644
@@ -564,9 +564,12 @@ llvm.*::
 	llvm.clang-bpf-cmd-template::
 		Cmdline template. Below lines show its default value. Environment
 		variable is used to pass options.
-		"$CLANG_EXEC -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS \
-		-Wno-unused-value -Wno-pointer-sign -working-directory \
-		$WORKING_DIR  -c $CLANG_SOURCE -target bpf -O2 -o -"
+		"$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
+		"-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE "	\
+		"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
+		"-Wno-unused-value -Wno-pointer-sign "		\
+		"-working-directory $WORKING_DIR "		\
+		"-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"
 
 	llvm.clang-opt::
 		Options passed to clang.