netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	Saeed Mahameed <saeedm@nvidia.com>,
	Andrii Nakryiko <andrii@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH net] scripts/pahole-flags.sh: Make sure pahole --version works
Date: Thu, 30 Dec 2021 23:56:07 -0800	[thread overview]
Message-ID: <20211231075607.94752-1-saeed@kernel.org> (raw)

From: Saeed Mahameed <saeedm@nvidia.com>

I had a broken pahole and it's been driving me crazy to see tons of the
following error messages on every build.

pahole: symbol lookup error: pahole: undefined symbol: btf_gen_floats
scripts/pahole-flags.sh: line 12: [: : integer expression expected
scripts/pahole-flags.sh: line 16: [: : integer expression expected

Address this by redirecting pahole --version stderr to devnull,
and validate stdout has a non empty string, otherwise exit silently.

Fixes: 9741e07ece7c ("kbuild: Unify options for BTF generation for vmlinux and modules")
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 scripts/pahole-flags.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
index e6093adf4c06..b3b53f890d40 100755
--- a/scripts/pahole-flags.sh
+++ b/scripts/pahole-flags.sh
@@ -7,7 +7,8 @@ if ! [ -x "$(command -v ${PAHOLE})" ]; then
 	exit 0
 fi
 
-pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
+pahole_ver=$(${PAHOLE} --version 2>/dev/null | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
+[ -z "${pahole_ver}" ] && exit 0
 
 if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then
 	# pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
-- 
2.33.1


             reply	other threads:[~2021-12-31  7:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31  7:56 Saeed Mahameed [this message]
2022-01-05 13:42 ` [PATCH net] scripts/pahole-flags.sh: Make sure pahole --version works Daniel Borkmann
2022-01-05 22:14   ` Saeed Mahameed
2022-01-06  3:45     ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211231075607.94752-1-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=jolsa@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).