From f125992b2700d86f652e61626c14bd616bc9add5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Tue, 15 Jul 2025 14:57:23 -0700 Subject: [PATCH] NetBpfLoad: don't print multiline log_buf on user builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These tend to be huge (because they can contain the full bpf disassembly) but not very worthwhile, because they often result in logs being rate limitted, and thus we miss out on the useful information. This is particularly true for user builds on non-Google devices installing the production signed tethering apex mainline module. We're better off seeing more of the other log lines... Test: TreeHugger Flag: EXEMPT mainline Signed-off-by: Maciej Żenczykowski Change-Id: Ie25a60c2e602772ab0de2050e7964f0202ff2685 --- bpf/loader/NetBpfLoad.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpf/loader/NetBpfLoad.cpp b/bpf/loader/NetBpfLoad.cpp index ef29cfef1a..10b0601cb2 100644 --- a/bpf/loader/NetBpfLoad.cpp +++ b/bpf/loader/NetBpfLoad.cpp @@ -1284,7 +1284,7 @@ static int loadCodeSections(const char* elfPath, vector& cs, const if (!fd.ok()) { // kernel NULL terminates log_buf, so this checks for non-empty string - if (log_buf[0]) { + if (log_buf[0] && !isUser()) { vector lines = Split(log_buf, "\n"); ALOGW("BPF_PROG_LOAD - BEGIN log_buf contents:");