BPF List
 help / color / mirror / Atom feed
From: Christy Lee <christylee@fb.com>
To: <ast@kernel.org>, <daniel@iogearbox.net>, <andrii@kernel.org>
Cc: <bpf@vger.kernel.org>, <kernel-team@fb.com>, <christylee@fb.com>,
	<christyc.y.lee@gmail.com>
Subject: [PATCH v2 bpf-next 3/3] Only output backtracking information in log level 2
Date: Wed, 15 Dec 2021 11:22:25 -0800	[thread overview]
Message-ID: <20211215192225.1278237-4-christylee@fb.com> (raw)
In-Reply-To: <20211215192225.1278237-1-christylee@fb.com>

Backtracking information is very verbose, don't print it in log
level 1 to improve readability.

Signed-off-by: Christy Lee <christylee@fb.com>
---
 kernel/bpf/verifier.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index a8f1426b0367..2cb86972ed35 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -2398,7 +2398,7 @@ static int backtrack_insn(struct bpf_verifier_env *env, int idx,
 
 	if (insn->code == 0)
 		return 0;
-	if (env->log.level & BPF_LOG_LEVEL) {
+	if (env->log.level & BPF_LOG_LEVEL2) {
 		verbose(env, "regs=%x stack=%llx before ", *reg_mask, *stack_mask);
 		verbose(env, "%d: ", idx);
 		print_bpf_insn(&cbs, insn, env->allow_ptr_leaks);
@@ -2656,7 +2656,7 @@ static int __mark_chain_precision(struct bpf_verifier_env *env, int regno,
 		DECLARE_BITMAP(mask, 64);
 		u32 history = st->jmp_history_cnt;
 
-		if (env->log.level & BPF_LOG_LEVEL)
+		if (env->log.level & BPF_LOG_LEVEL2)
 			verbose(env, "last_idx %d first_idx %d\n", last_idx, first_idx);
 		for (i = last_idx;;) {
 			if (skip_first) {
@@ -2743,7 +2743,7 @@ static int __mark_chain_precision(struct bpf_verifier_env *env, int regno,
 				new_marks = true;
 			reg->precise = true;
 		}
-		if (env->log.level & BPF_LOG_LEVEL) {
+		if (env->log.level & BPF_LOG_LEVEL2) {
 			mark_verifier_state_scratched(env);
 			verbose(env, "parent %s regs=%x stack=%llx marks:",
 				new_marks ? "didn't have" : "already had",
-- 
2.30.2


  parent reply	other threads:[~2021-12-15 19:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 19:22 [PATCH v2 bpf-next 0/3] Improve verifier log readability Christy Lee
2021-12-15 19:22 ` [PATCH v2 bpf-next 1/3] Only print scratched registers and stack slots to verifier logs Christy Lee
2021-12-16  7:02   ` Andrii Nakryiko
     [not found]     ` <CAPqJDZpuZ586TawooQhxZGvOqgF4yCjT0yOLEXAUer8eJDO7gw@mail.gmail.com>
2021-12-16 16:02       ` Christy Lee
2021-12-15 19:22 ` [PATCH v2 bpf-next 2/3] Right align verifier states in " Christy Lee
2021-12-16  7:02   ` Andrii Nakryiko
     [not found]     ` <CAPqJDZr1AudE2PfbZQarHf0N5i_-xm-zyhfLqS5rogX98UtNLQ@mail.gmail.com>
2021-12-16 16:03       ` Christy Lee
2021-12-16 19:37         ` Andrii Nakryiko
2021-12-15 19:22 ` Christy Lee [this message]
2021-12-16  7:02   ` [PATCH v2 bpf-next 3/3] Only output backtracking information in log level 2 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=20211215192225.1278237-4-christylee@fb.com \
    --to=christylee@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christyc.y.lee@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.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