From patchwork Wed Sep 18 19:33:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihor Solodrai X-Patchwork-Id: 13807130 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC56712B17C for ; Wed, 18 Sep 2024 19:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.134 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726688011; cv=none; b=I4ypdxJ9beFD7ledTerrhF5oF1dsz27PQMXbQseeGGL/Tjd3rP+etLbsZs0qHocE+FwUVZPNyxzMzXjSUexK5XroV+zY6/YL+PBuFW+IIXb63VUPSllniCloKVez1HdaNIZB85KKn7jEnxu6M+A30XLWmfnDAPKwXYLhNu83Zgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726688011; c=relaxed/simple; bh=oQLKF63sbb7ME34qfF3w1z5z75Fq2JOwScuNDPMpmzQ=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=QiodOvzeO4KKGbgOzBRy+a/JAI5w9BbYts8k3/Ikf5RgFySa8joNTNWG+FoMKsphyuwGwIHxybgBFUpQ0ubd4+bVwC8GeNVM15jS2TOqpPeJh6LkrONQQHNc7QuWs1bs+EEY9FqveW+t0bs1sBWCBmiaPlctb7LQ2MRdwRClV3M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=h9GN/g7E; arc=none smtp.client-ip=185.70.40.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="h9GN/g7E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1726688007; x=1726947207; bh=8NuMayBKBM4+C4bSmqsdvawOpW/E/2TAvO55Tn8XKps=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=h9GN/g7EMGv1TWlvE/tYIGcvYBnQ9XHJgy9lyfq3lRvx5VKqzq6ZaWVWAfmV8u13B RvedSuFQGsnmrHXzJ0STPKCbnkr9HROq2EXnQWV0oiyy9PAkptfme/pN2cobciv2p1 ssVSYjVSXlpG8O9H5FAG0swXmwy+nNlG0RMv1O+0X+D/RegOklzLa4eMzXCW86T9Pd AyVILCwyPkQUrSPafK9vewCvqdDTC9GrvD7X8ib2pFvfTGiKcK8ZMJ3Ys4LmCcwh2J C/Ua6zECx90Ax0rLfzwvA6QpwHIRYuXeboFqBMSOUBDJJuBUCph7sWM8qT20pvT/kY Ik7woGV8n6X4Q== Date: Wed, 18 Sep 2024 19:33:22 +0000 To: bpf@vger.kernel.org, andrii@kernel.org From: Ihor Solodrai Cc: ast@kernel.org, daniel@iogearbox.net, eddyz87@gmail.com, mykolal@fb.com Subject: [PATCH bpf-next] libbpf: change log level of BTF loading error message Message-ID: <20240918193319.1165526-1-ihor.solodrai@pm.me> Feedback-ID: 27520582:user:proton X-Pm-Message-ID: 7676296ea97efc4e841f8429c8d6e795629b8587 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net Reduce log level of BTF loading error to INFO if BTF is not required. Suggested-by: Andrii Nakryiko Signed-off-by: Ihor Solodrai --- tools/lib/bpf/libbpf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 219facd0e66e..b8d72b5fbc79 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -3581,11 +3581,12 @@ static int bpf_object__sanitize_and_load_btf(struct bpf_object *obj) report: if (err) { btf_mandatory = kernel_needs_btf(obj); - pr_warn("Error loading .BTF into kernel: %d. %s\n", err, - btf_mandatory ? "BTF is mandatory, can't proceed." - : "BTF is optional, ignoring."); - if (!btf_mandatory) + if (btf_mandatory) { + pr_warn("Error loading .BTF into kernel: %d. BTF is mandatory, can't proceed.\n", err); + } else { + pr_info("Error loading .BTF into kernel: %d. BTF is optional, ignoring.\n", err); err = 0; + } } return err; }