Skip to contentSkip to conversation

scripts: dummy-tools, add pahole

PATCH Superseded Jiri Slaby 3 participants 6 messages Apr 14, 2022 – Apr 19, 2022 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 scripts: dummy-tools, add pahole

CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And when multiple people update the config, this value constantly changes. Even if they use dummy scripts.

To fix this:
* add a pahole dummy script returning v99.99 -> 9999
* call it in Makefile taking CROSS_COMPILE into account.

The latter happens only if $(CROSS_COMPILE)pahole really exists. This is because a cross pahole likely exists only in dummy tools now, not in real cross tools.

Fixes 613fe1692377 (kbuild: Add CONFIG_PAHOLE_VERSION)
Cc Masahiro Yamada <[email protected]>
Cc Michal Marek <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 Makefile                   | 2 +-
 scripts/dummy-tools/pahole | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100755 scripts/dummy-tools/pahole
Makefile +1 -1
index ecbd42f3451a..2ef722ba0a41 100644
@@ -502,7 +502,7 @@ RUSTFMT		= rustfmt
 CLIPPY_DRIVER	= clippy-driver
 BINDGEN		= bindgen
 CARGO		= cargo
-PAHOLE		= pahole
+PAHOLE		= $(if $(wildcard $(CROSS_COMPILE)pahole),$(CROSS_COMPILE)pahole,pahole)
 RESOLVE_BTFIDS	= $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
 LEX		= flex
 YACC		= bison
scripts/dummy-tools/pahole new file +4 -0
new file mode 100755
index 000000000000..53501a36fa71
@@ -0,0 +1,4 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+
+echo v99.99
Signature · 1 line
2.35.2
#1 lore raw
Quoted 5 lines · Jiri Slaby

CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And when multiple people update the config, this value constantly changes. Even if they use dummy scripts.

Quoted 7 lines

To fix this:
* add a pahole dummy script returning v99.99 -> 9999
* call it in Makefile taking CROSS_COMPILE into account.

The latter happens only if $(CROSS_COMPILE)pahole really exists. This is because a cross pahole likely exists only in dummy tools now, not in real cross tools.

I do not think this is the right thing to do.

(As I said somewhere, I am opposed to checking pahole version in Kconfig).

Also, $(CROSS_COMPILE)pahole looks insane.

You can create a dummy pahole in your local system.

$ echo 'echo v99.99' > $HOME/bin/dummy-pahole
$ chmod +x  $HOME/bin/dummy-pahole
$ make CROSS_COMPILE=scripts/dummy-tools  PAHOLE=dummy-pahole  menuconfig
Quoted 38 lines
Fixes 613fe1692377 (kbuild: Add CONFIG_PAHOLE_VERSION)
Cc Masahiro Yamada <[email protected]>
Cc Michal Marek <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 Makefile                   | 2 +-
 scripts/dummy-tools/pahole | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100755 scripts/dummy-tools/pahole
Makefile +1 -1
index ecbd42f3451a..2ef722ba0a41 100644
@@ -502,7 +502,7 @@ RUSTFMT             = rustfmt
 CLIPPY_DRIVER  = clippy-driver
 BINDGEN                = bindgen
 CARGO          = cargo
-PAHOLE         = pahole
+PAHOLE         = $(if $(wildcard $(CROSS_COMPILE)pahole),$(CROSS_COMPILE)pahole,pahole)
 RESOLVE_BTFIDS = $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
 LEX            = flex
 YACC           = bison
scripts/dummy-tools/pahole new file +4 -1
new file mode 100755
index 000000000000..53501a36fa71
@@ -0,0 +1,4 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+
+echo v99.99
--

2.35.2

Signature · 2 lines
Best Regards
Masahiro Yamada
author
#2 lore raw
Quoted 10 lines · Masahiro Yamada
Quoted 9 lines · Jiri Slaby

CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And when multiple people update the config, this value constantly changes. Even if they use dummy scripts.

To fix this:
* add a pahole dummy script returning v99.99 -> 9999
* call it in Makefile taking CROSS_COMPILE into account.

Quoted 8 lines
Quoted 3 lines

The latter happens only if $(CROSS_COMPILE)pahole really exists. This is because a cross pahole likely exists only in dummy tools now, not in real cross tools.

I do not think this is the right thing to do.

(As I said somewhere, I am opposed to checking pahole version in Kconfig).

If you ask me, I am all for removal as this causes pain. But it's there, so I cannot do anything about that.

Quoted 7 lines

Also, $(CROSS_COMPILE)pahole looks insane.

You can create a dummy pahole in your local system.

$ echo 'echo v99.99' > $HOME/bin/dummy-pahole
$ chmod +x  $HOME/bin/dummy-pahole
$ make CROSS_COMPILE=scripts/dummy-tools  PAHOLE=dummy-pahole  menuconfig

Well, the question is how do I that for every kernel developer in SUSE?

thanks,

Signature · 2 lines
js
suse labs
author
#3 lore raw
Quoted 24 lines · Jiri Slaby
Quoted 10 lines · Masahiro Yamada
Quoted 9 lines · Jiri Slaby

CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And when multiple people update the config, this value constantly changes. Even if they use dummy scripts.

To fix this:
* add a pahole dummy script returning v99.99 -> 9999
* call it in Makefile taking CROSS_COMPILE into account.

Quoted 8 lines
Quoted 3 lines

The latter happens only if $(CROSS_COMPILE)pahole really exists. This is because a cross pahole likely exists only in dummy tools now, not in real cross tools.

I do not think this is the right thing to do.

(As I said somewhere, I am opposed to checking pahole version in Kconfig).

If you ask me, I am all for removal as this causes pain. But it's there, so I cannot do anything about that.

Quoted 2 lines

Also, $(CROSS_COMPILE)pahole looks insane.

Quoted 7 lines
Quoted 5 lines

You can create a dummy pahole in your local system.

$ echo 'echo v99.99' > $HOME/bin/dummy-pahole
$ chmod +x  $HOME/bin/dummy-pahole
$ make CROSS_COMPILE=scripts/dummy-tools  PAHOLE=dummy-pahole  menuconfig

Well, the question is how do I that for every kernel developer in SUSE?

IOW it'd be quite easier if the scripts/dummy-tools/pahole part of the patch was in the tree. (I don't insist on the Makefile change.)

Quoted 1 line

thanks,--

js
suse labs

#4 lore raw
Quoted 30 lines · Jiri Slaby
Quoted 28 lines · Jiri Slaby
Quoted 15 lines · Masahiro Yamada
Quoted 5 lines · Jiri Slaby

CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And when multiple people update the config, this value constantly changes. Even if they use dummy scripts.

Quoted 7 lines

To fix this:
* add a pahole dummy script returning v99.99 -> 9999
* call it in Makefile taking CROSS_COMPILE into account.

The latter happens only if $(CROSS_COMPILE)pahole really exists. This is because a cross pahole likely exists only in dummy tools now, not in real cross tools.

Quoted 4 lines

I do not think this is the right thing to do.

(As I said somewhere, I am opposed to checking pahole version in Kconfig).

If you ask me, I am all for removal as this causes pain. But it's there, so I cannot do anything about that.

Quoted 4 lines

Also, $(CROSS_COMPILE)pahole looks insane.

You can create a dummy pahole in your local system.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
$ echo 'echo v99.99' > $HOME/bin/dummy-pahole
$ chmod +x  $HOME/bin/dummy-pahole
$ make CROSS_COMPILE=scripts/dummy-tools  PAHOLE=dummy-pahole  menuconfig

Well, the question is how do I that for every kernel developer in SUSE?

IOW it'd be quite easier if the scripts/dummy-tools/pahole part of the patch was in the tree. (I don't insist on the Makefile change.)

I do not mind scripts/dummy-tools/pahole
although you need to do
make CROSS_COMPILE=scripts/dummy-tools
PAHOLE=scripts/dummy-tools/pahole menuconfig

Quoted 3 lines
Quoted 1 line

thanks,--

js
suse labs

Signature · 2 lines
Best Regards
Masahiro Yamada
#5 lore raw
Quoted 7 lines · Masahiro Yamada
Quoted 4 lines
Quoted 1 line

Well, the question is how do I that for every kernel developer in SUSE?

IOW it'd be quite easier if the scripts/dummy-tools/pahole part of the patch was in the tree. (I don't insist on the Makefile change.)

I do not mind scripts/dummy-tools/pahole

Perfect!

Quoted 3 lines

although you need to do
make CROSS_COMPILE=scripts/dummy-tools
PAHOLE=scripts/dummy-tools/pahole menuconfig

That's easy -- the developers use a script that I can modify. (Oppositng to writing files to their homes etc.)

Will send a v2.

thanks,

Signature · 2 lines
js
suse labs