From patchwork Tue Dec 1 03:02:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5b2t5rWpKFJpY2hhcmQp?= X-Patchwork-Id: 11941781 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F507C63777 for ; Tue, 1 Dec 2020 03:03:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B66C82076E for ; Tue, 1 Dec 2020 03:03:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=oppoglobal.onmicrosoft.com header.i=@oppoglobal.onmicrosoft.com header.b="I0oWajdN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727096AbgLADDg (ORCPT ); Mon, 30 Nov 2020 22:03:36 -0500 Received: from mail-eopbgr1320074.outbound.protection.outlook.com ([40.107.132.74]:2784 "EHLO APC01-PU1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725859AbgLADDg (ORCPT ); Mon, 30 Nov 2020 22:03:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SCZCYb1jBpv/KY7TKAckDX0YT9jNdlsSnZHwSK96t6dUCKgqgtyRHaJ5/WrYjVqDe1NOm3O0sdS7c98US/DxwsVkK7z6FBAerZbTbLys8yGscH7cz872FHgsGofnoQ9xLFkhiTH4UJ8vx6W3ykjMYc/I1MFZZFkdNr3ggsPVwCRk+YZaUmk2VMUMUqwvoE/SDt5qGHTlbVNjboiOxK36v7i3BmqxX67EMb0dQkSnYBMtq7r98WJynUl7bMWyl/mQsccBxv9FaO5Opiz7WhjZLWPzDTpzn+DWBQ+kCPG53Ml3Tkny9whP6SswKPRTg8PIyklZxmtpVURCnr4xZkQAqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jl+iErc3fVgwWPp0a06KrO5RipMwUjAJ5vx5lXd9o8U=; b=TXDPKk/PHlfYkygokU7bFztk07kIWKaAx2EXbqChdGswaRnypZsWWVG1zz7aO7eoc54XItwIyFRmgBA/jTV2d5Ic9rXRJdsaDhIwdfrqqRyYnNJbFgFlY8HWBgSUntDw0uIlAmF9Z96CVgFQt9NQCq+fRQOdBw/wLGI6lcbQSo7+S40IPue7PqGIrsmxAt85/n8DabLPzUMkfHlkAd4eLyIzFx4bl7ocPTcg9KjZD6RC4rprzaGbGPcTOWMekxH/xUm4yH98WnnbO1Mhq1tOfC+uahmCDnl8V6pApTJCuysZY3E+fHHUKlVtwxksOoCawJ1b0GIZXSMFOg2qTurQ9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppoglobal.onmicrosoft.com; s=selector1-oppoglobal-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jl+iErc3fVgwWPp0a06KrO5RipMwUjAJ5vx5lXd9o8U=; b=I0oWajdNEYM/wVA9F8y6Dg6UuwY06ivPNkga0m1ttpi/Ji/q/BaNLTo8jo5NKHAzx/6ycCc0R17a6pAbN0FWuDI/ZumIGgsWi9o89d71aq+UHR3cr5AmfP0p0PlqU0GwpI4VtD9X5c+UBki8kATAFXyjPNksgrlaZxQh9MrqJBA= Received: from HKAPR02MB4291.apcprd02.prod.outlook.com (2603:1096:203:d3::12) by HK0PR02MB2435.apcprd02.prod.outlook.com (2603:1096:203:1d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.25; Tue, 1 Dec 2020 03:02:02 +0000 Received: from HKAPR02MB4291.apcprd02.prod.outlook.com ([fe80::b9b8:aaf4:2afd:218b]) by HKAPR02MB4291.apcprd02.prod.outlook.com ([fe80::b9b8:aaf4:2afd:218b%3]) with mapi id 15.20.3611.031; Tue, 1 Dec 2020 03:02:02 +0000 From: =?utf-8?b?5b2t5rWpKFJpY2hhcmQp?= To: "ast@kernel.org" , "daniel@iogearbox.net" CC: "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" , =?utf-8?b?5b2t5rWpKFJpY2hhcmQp?= Subject: [PATCH] tools/bpf: Return the appropriate error value Thread-Topic: [PATCH] tools/bpf: Return the appropriate error value Thread-Index: AdbHjjE+0VhjdcMtSGSpXeObkYLiYQ== Date: Tue, 1 Dec 2020 03:02:01 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oppo.com; x-originating-ip: [58.252.5.70] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3083d4ed-9339-4640-10ee-08d895a579f7 x-ms-traffictypediagnostic: HK0PR02MB2435: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rJMAWqQEV1M/wAM7/vFzB32lIjkc9PCVUpiP778OUpDw1AbwalRgHkzee+qXVMyGxMQ0hZGcKQnTtqK5JRDgUdPc9UoVy+PZkFZWVg5utDzs9XlDGKmllH0pbw9hQzPpgSRbuu/j6g8LI/acYWcSBI8jYDOuQfTsGFpWhBRiwMTzDlWsm7RTC8V7sWrNi+IC/oCYVUQzWJENGUokbogkDw6htYTduycfVkEiKbNhRvxlcYTP0yOatqdtBBbBthy2LL32V07ogO6/2tQjL06+IBS/HXVkHVwseOEasu5jwIKFT1XMaT0DdlHvuYoeDcb8i9T/rYPOT+vljw/x3OULEHhXcmfe1hlFxmH2ttSNQH4OcAMPlRpCEtkKTh/Neyxb x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HKAPR02MB4291.apcprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(136003)(39860400002)(366004)(396003)(8936002)(110136005)(52536014)(107886003)(4326008)(54906003)(33656002)(9686003)(55016002)(4744005)(316002)(71200400001)(478600001)(6506007)(2906002)(86362001)(85182001)(186003)(26005)(8676002)(66556008)(5660300002)(64756008)(66446008)(66476007)(7696005)(83380400001)(76116006)(66946007)(11606006);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?utf-8?q?PvscHLgifDsYPZwcikpoZgJ+90SGfR?= =?utf-8?q?Ht5hLuxS5/9fDERdJ96N7cMi/jWUaG2xmK4ggtIU+mf4j/f7rHT4+NScJ6yZnIVms?= =?utf-8?q?n47ErUjyUYhte8wuWoeQR/9UFvT9IXMAIwy4ofzMVc3dDNbMxIEvbrDO/YQPV8sag?= =?utf-8?q?8tlAu/7SLG7ESqUB7riZ+s5B1f9PBeQGyVvKa6vMhxt9j5jIXDuuVJDYGCAwFp3tn?= =?utf-8?q?hFxU+zYq39hyiqEPgjzKK6y34TQm/CQ4pooG3yn8gn4dNaabiLiSM4MOKewGH7eFI?= =?utf-8?q?6N7njUga/JMdeqvmJr+VDgAj7rwHns2ZkIuLghY8Tuj+wUb6NfNWNykRlZIp1LUsh?= =?utf-8?q?Zg55ViG9g+3UcWaqtE1CrcJc3RVuBguZz9GuyvDZ7u3WiPf9C7aLdcvHmObDuGTkQ?= =?utf-8?q?+ArV+X3ZcUIsVrIiaWEXz+60zPiRObr3e84rq2oYVKoPfNhp7dAk5z1xIE/VFrjWy?= =?utf-8?q?sajEbY6JzQnlAWVgz7WGH3gn4CfN5R8Dq3ZuG26fH+0eLBSDqDbkqyh47DEAOW2VQ?= =?utf-8?q?drInbb7r6cCtl9gHHoyear1vHEL5ewfUwdQ0vpzH3z9BjduaH0Yef0b1CSfCWl8mD?= =?utf-8?q?UAiY4J8+fX/uqM+gHSG6m5sYqDJZvbCt1wxMyz5bmQvVTo2THJKbQ53ok5mMcwwAc?= =?utf-8?q?lTwJh0ekY7D/YKo7Wio6g26f/1FyY3kscYULYAB953Fk6oK8XpL8drDCO+0Bl+o3x?= =?utf-8?q?1iLfRtjXIxGdOQUV1MT6b4tu9ajoaMaz71+n2TvlnGXvxn4LKVLN0E5UtGXr2q6T+?= =?utf-8?q?Hy65zn8HFIzUALteCl9UwCFAnj4x8qXxKXzWoNtIWH7svgICPqJrzjKWmwDBJ3+Y/?= =?utf-8?q?KBy/RQ8QfLqi+rP0czjGwHlsDXsC5aViHqjIzVh1oT6kbBYXhVTP2C6ntH3lWvqwC?= =?utf-8?q?iV6sfNXsCf4jNUWl1sIXHTYoz9Lnu6hGMS7newvNwxgYRJ7EF0DFK/EKhNReuDA?= =?utf-8?q?=3D?= MIME-Version: 1.0 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: HKAPR02MB4291.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3083d4ed-9339-4640-10ee-08d895a579f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2020 03:02:02.0446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LUgFueCsMzNxRxaFzM59iZl6wz+KS+ftzUsMrJY5siL3fYTRDLnLqHwzfRskg4JFYAMzPxzAJmpC+klzHfw9Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0PR02MB2435 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Compile times error: "Error: failed to load BTF from /mnt/linux/vmlinux: No such file or directory". This file "/mnt/linux/vmlinux" actually exists, but only because CONFIG_DEBUG_INFO_BTF is not configured with this error. Signed-off-by: Peng Hao --- tools/lib/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.18.4 diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index 231b07203e3d..228f508fbd04 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -865,7 +865,7 @@ struct btf *btf__parse_elf(const char *path, struct btf_ext **btf_ext) err = 0; if (!btf_data) { - err = -ENOENT; + err = -EPROTO; goto done; } btf = btf__new(btf_data->d_buf, btf_data->d_size);