Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp814654rwb; Tue, 29 Nov 2022 05:49:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Oud6mOT006xJCXTe3DqbsxUhV3KVl5aL745vlLn2yRZU4gmmBzrbgTKyQTAbkyFTPWf3L X-Received: by 2002:a17:906:830b:b0:7bb:7dda:7d49 with SMTP id j11-20020a170906830b00b007bb7dda7d49mr22147303ejx.156.1669729797832; Tue, 29 Nov 2022 05:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669729797; cv=none; d=google.com; s=arc-20160816; b=tN4/Nb3bVWqFsEFNXS3qtMo3dqr8+ifR81+MziD0wgGxVIO3JsBtZAn82dyB5AOhpp 7E2HTHlUPOdBqYfonDc/jBd1SXWJaIBvVr+tjzasJELdiv6PP7opX6W33AH0qzGt2wjN uLtPVbyDMagfQpvmBQlwrX/xn+W4FbEnWVJqWDJtAhb2luCt0cHrTONCzYo9zffmMWIB CnwBUMQu0aBCcHctB/CnBXsnLAEeVKqQ6qFwsPE3EVkcBFOCwhbdW4iZuHZPlGChuuAA wvFQ9kW6U4EUya+IiwG/a1UVtvx5BwGaOiyO/6+e15bkd19lort2h75oVporlztfhVdX Qc7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CWgzPCN8Q8JJvLGyk+AfDc4+Pr2IKHYLQIGU3p2/Eyc=; b=vkchJWDMlvrpLdnkamALnECbz8N5nsseRBlJ3WBx5cZa+dlxF84bwVhAQIVzGNyLo5 Qqn8iZAIIHTUnCS3ee0bRm4mZB/ANcJgJHJzuYM/5m9qxkT8h74pAIVr9QF+f8bgfxDX mlurTgMQDUcFcNhAMEjZZ1qEy57iYigYp7d3hzcanYeW26XDW7sGpDVAYlS+3o3nMHCd EAwLk6rLZKIR04h4qshJoWkKyNGzF4mZu6ggKUPlyuG+1jlv0ehqLu169FxHJOrCTy7P EkFxzHI25rDs0uBDb9iF0vDDIRRxCbMID9YYNwR6c4AanqxnhS6Zmguf9GSMVNezkMsb /gOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="BtUdQ/Yr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht20-20020a170907609400b0078dcdbb3e87si14060241ejc.530.2022.11.29.05.49.38; Tue, 29 Nov 2022 05:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="BtUdQ/Yr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234226AbiK2Nm7 (ORCPT + 83 others); Tue, 29 Nov 2022 08:42:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbiK2Nmm (ORCPT ); Tue, 29 Nov 2022 08:42:42 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EE56CD9; Tue, 29 Nov 2022 05:42:41 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id 21so582006pfw.4; Tue, 29 Nov 2022 05:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CWgzPCN8Q8JJvLGyk+AfDc4+Pr2IKHYLQIGU3p2/Eyc=; b=BtUdQ/YrfKkfQWaSDfBvaODunvTWCMHK8yeZbWrXkeF1l7A2dA8C89gFYEIOhDco+w 5SIgxYcXLU2lAQ3fMbdozLQDSLYfJpoXeJ1psqvAUnPjBKhp8F7ait4O63BDO7W//21C T/RxWAWNN8+sNh6tugIKmZcMAFavWxesn65Uy8SY0epvCn5B3Ke3B/grzEFssIcX/ICs +wxovN0tlde7dirjW2vAN7tqeGIi29dAGPX59rsxZbee4CJ6sJdlk1oXq/ZVHtpBZcIw HgyrWazLv/5EBkJaPkXDJ+2PrpDiJb8fI8PfF8SJeP5KXd71Axm49P6/GBJLAI4pMpDx 8JOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CWgzPCN8Q8JJvLGyk+AfDc4+Pr2IKHYLQIGU3p2/Eyc=; b=EJP8B3hQsOGzWMTG0OIDlDRsgvosp5dewY20uWWn/6l2Pft0nMLRlYyFAgrNYG5WPU 8Pe3yXchLWVvStypzS8K4OIOwiJt22nmTFDOtkW4FBraYerZ2nIi/VpHwsyB7RdJvHKv UUmyP79TZRgPFuKflpU04qtFixYQgQBNA1oBAn8IVad4OS/0FkL5JJX/0Q0FSvCn0xE7 geqcTfOsAzRjtYQnr5jC27oH74Zev9gLNijfUQpe9Jw7s/wGeJ4/J5UsAJssWUB+agX4 2u3qNQDkIo1MQ1xr4Qv+XqSswXoH0Yg6E0s8q0iKlu/l/c74tdNHN67oKiCg9rv/s2Hy qwdg== X-Gm-Message-State: ANoB5pnfoEIeebv7XWC1iGZXfvGtf6qXd6S3Gd8cD6WV+xBrgOXhL3Hb UTE3SWy2GuAL6h91hT3dUOjQIgZC6VJ7Ax+1 X-Received: by 2002:a63:1601:0:b0:46f:9193:467d with SMTP id w1-20020a631601000000b0046f9193467dmr42215366pgl.479.1669729360674; Tue, 29 Nov 2022 05:42:40 -0800 (PST) Received: from WRT-WX9.. ([103.135.102.183]) by smtp.gmail.com with ESMTPSA id z5-20020aa79f85000000b005636326fdbfsm9977154pfr.78.2022.11.29.05.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 05:42:40 -0800 (PST) From: Changbin Du To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Quentin Monnet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Shuah Khan Cc: Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Alexander Shishkin , Namhyung Kim , Mykola Lysenko , linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, Changbin Du Subject: [PATCH v2 1/2] libbpf: show error info about missing ".BTF" section Date: Tue, 29 Nov 2022 21:42:16 +0800 Message-Id: <20221129134217.52767-2-changbin.du@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221129134217.52767-1-changbin.du@gmail.com> References: <20221129134217.52767-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Show the real problem instead of just saying "No such file or directory". Now will print below info: libbpf: can not find '.BTF' section Error: failed to load BTF from /home/changbin/work/linux/vmlinux: No such file or directory Signed-off-by: Changbin Du --- tools/lib/bpf/btf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index d88647da2c7f..1adc0f6019a0 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -990,6 +990,7 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf, err = 0; if (!btf_data) { + pr_warn("can not find '%s' section\n", BTF_ELF_SEC); err = -ENOENT; goto done; } -- 2.37.2