From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
David Howells <dhowells@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
Jonathan Corbet <corbet@lwn.net>,
Liam Howlett <liam.howlett@oracle.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Zeng Heng <zengheng4@huawei.com>,
keyrings@vger.kernel.org, linux-doc@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 3/5] kbuild: do not print extra logs for V=2
Date: Fri, 23 Dec 2022 01:25:33 +0900 [thread overview]
Message-ID: <20221222162535.1578462-3-masahiroy@kernel.org> (raw)
In-Reply-To: <20221222162535.1578462-1-masahiroy@kernel.org>
Some scripts increase the verbose level when V=1, but others when
not V=0.
I think the former is correct because V=2 is not a log level but
a switch to print the reason for rebuilding.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Documentation/Makefile | 2 +-
arch/powerpc/kernel/prom_init_check.sh | 9 ++++-----
| 9 ++++++---
scripts/asn1_compiler.c | 4 ++--
scripts/kernel-doc | 4 ++--
5 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index bb73dcb5ed05..023fa658a0a8 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -28,7 +28,7 @@ BUILDDIR = $(obj)/output
PDFLATEX = xelatex
LATEXOPTS = -interaction=batchmode -no-shell-escape
-ifeq ($(KBUILD_VERBOSE),0)
+ifeq ($(findstring 1, $(KBUILD_VERBOSE)),)
SPHINXOPTS += "-q"
endif
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index 311890d71c4c..5a319863f289 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -51,11 +51,10 @@ do
# a leading . on the name, so strip it off here.
UNDEF="${UNDEF#.}"
- if [ $KBUILD_VERBOSE ]; then
- if [ $KBUILD_VERBOSE -ne 0 ]; then
- echo "Checking prom_init.o symbol '$UNDEF'"
- fi
- fi
+ case "$KBUILD_VERBOSE" in
+ *1*)
+ echo "Checking prom_init.o symbol '$UNDEF'" ;;
+ esac
OK=0
for WHITE in $WHITELIST
--git a/certs/extract-cert.c b/certs/extract-cert.c
index 8c1fb9a70d66..d3a0ff2867c0 100644
--- a/certs/extract-cert.c
+++ b/certs/extract-cert.c
@@ -78,7 +78,7 @@ static void drain_openssl_errors(void)
static const char *key_pass;
static BIO *wb;
static char *cert_dst;
-static int kbuild_verbose;
+static bool verbose;
static void write_cert(X509 *x509)
{
@@ -90,19 +90,22 @@ static void write_cert(X509 *x509)
}
X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf));
ERR(!i2d_X509_bio(wb, x509), "%s", cert_dst);
- if (kbuild_verbose)
+ if (verbose)
fprintf(stderr, "Extracted cert: %s\n", buf);
}
int main(int argc, char **argv)
{
char *cert_src;
+ char *kbuild_verbose;
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
ERR_clear_error();
- kbuild_verbose = atoi(getenv("KBUILD_VERBOSE")?:"0");
+ kbuild_verbose = getenv("KBUILD_VERBOSE");
+ if (kbuild_verbose && strchr(kbuild_verbose, '1'))
+ verbose = true;
key_pass = getenv("KBUILD_SIGN_PIN");
diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
index 71d4a7c87900..7b6756a8c15d 100644
--- a/scripts/asn1_compiler.c
+++ b/scripts/asn1_compiler.c
@@ -567,8 +567,8 @@ int main(int argc, char **argv)
int fd;
kbuild_verbose = getenv("KBUILD_VERBOSE");
- if (kbuild_verbose)
- verbose_opt = atoi(kbuild_verbose);
+ if (kbuild_verbose && strchr(kbuild_verbose, '1'))
+ verbose_opt = true;
while (argc > 4) {
if (strcmp(argv[1], "-v") == 0)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 54b0893cae66..8ad0a7d68d9a 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -175,8 +175,8 @@ my $declaration_start_line;
my ($type, $declaration_name, $return_type);
my ($newsection, $newcontents, $prototype, $brcount, %source_map);
-if (defined($ENV{'KBUILD_VERBOSE'})) {
- $verbose = "$ENV{'KBUILD_VERBOSE'}";
+if (defined($ENV{'KBUILD_VERBOSE'}) && $ENV{'KBUILD_VERBOSE'} =~ '1') {
+ $verbose = 1;
}
if (defined($ENV{'KCFLAGS'})) {
--
2.34.1
next prev parent reply other threads:[~2022-12-22 16:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 16:25 [PATCH 1/5] kbuild: refactor silent mode detection Masahiro Yamada
2022-12-22 16:25 ` [PATCH 2/5] kbuild: print short log in addition to the whole command with V=1 Masahiro Yamada
2022-12-23 11:23 ` Nicolas Schier
2022-12-22 16:25 ` Masahiro Yamada [this message]
2022-12-23 11:23 ` [PATCH 3/5] kbuild: do not print extra logs for V=2 Nicolas Schier
2022-12-22 16:25 ` [PATCH 4/5] kbuild: allow to combine multiple V= levels Masahiro Yamada
2022-12-23 11:23 ` Nicolas Schier
2022-12-22 16:25 ` [PATCH 5/5] kbuild: drop V=0 support Masahiro Yamada
2022-12-23 11:24 ` Nicolas Schier
2022-12-22 17:51 ` [PATCH 1/5] kbuild: refactor silent mode detection Nick Desaulniers
2022-12-23 11:23 ` Nicolas Schier
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=20221222162535.1578462-3-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=corbet@lwn.net \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=keyrings@vger.kernel.org \
--cc=liam.howlett@oracle.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=zengheng4@huawei.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