From patchwork Tue Nov 26 20:08:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Olson, Matthew" X-Patchwork-Id: 13886332 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 CBB941AAD7; Tue, 26 Nov 2024 20:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732652061; cv=fail; b=CjQlwqJH/+bF4rgwlb8PkvUOj8O2+iON9Sfrrcpkh9Vc5onGtbgj+zPtIlfJOUrUaUWioYtPwyU0h+D2WtF8P22UGjeY7xAy3hj9Ww0Xp+D4IQgQJht1o8JGb5VgG53Q37uWNAE5iAMCUKKQZJaNVxdxn//ZptJeGHQBoqsRfk8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732652061; c=relaxed/simple; bh=MuKlvPW4YmlAhOS1HdUOGCUgxXig/11B79xWkgoqtbM=; h=Date:From:To:CC:Subject:Message-ID:Content-Type: Content-Disposition:MIME-Version; b=bssQWgXrx9PC8uIXQ6EzuL54Niag0Z5U8duqbFORWeyzl4zXHsGfCtsPsurIXUg69cDRaCUlYrLB7E+vfqgNiBa+30BvDtAW03wiQFTfKX6tbbkCOsAvrG/llQm19tQeLeQv+iA4bPiII7hgO4bhzcXXmo0HlstvmUGqL4eQoKc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Yx3DA77k; arc=fail smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Yx3DA77k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732652060; x=1764188060; h=date:from:to:cc:subject:message-id:mime-version; bh=MuKlvPW4YmlAhOS1HdUOGCUgxXig/11B79xWkgoqtbM=; b=Yx3DA77kNAu8uh9Z7cUgLhd4wTc4RPk/yXHF4q1NHqQeSTBZ1Q/eAxP+ iX3rAQ4Gwjc7RoBEDFZ1a9WSkrvSs9g9K1+pFdHEXFU5uj5NCsuwZWwLh NVG0kZTE89piMfYkAQA5g5wJ/zbaYu0DFc/SN/F2mbyO+fFjjlPG9rAnh oI8gmsESLBtk7mRtxcr7uyAebj3T6YkvTLkwM1UP10I5hDon+jAvJBPSw aYfRKvTJl1Z/FGmB7Oi6ggkxJFEVrSsin436AGkJ4n+LfRJRdZ1If/Z/1 mRzm07ozMrIVNjf7iLbwdVMxpkWlMnel+v+hTfYfFNKwFLXYy5gVBClI4 Q==; X-CSE-ConnectionGUID: Rq8ZORFqRh+Zp85O+u2vFQ== X-CSE-MsgGUID: 9XMsct49RaOeaZ59lhGziA== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="32968845" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="32968845" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 12:14:19 -0800 X-CSE-ConnectionGUID: 3IrdW1IdQ/S94AlTM5uv8A== X-CSE-MsgGUID: w3NEie+vQy+ZBGMF8PXkXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="92181701" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Nov 2024 12:14:18 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 26 Nov 2024 12:14:18 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 26 Nov 2024 12:14:18 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 26 Nov 2024 12:13:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QrENEYQa9/eL0942b/tzY4w47Si5CpOls6owJvksLG7V+pMOP0Wvwu6h1tasvFuiAh4/17glLi517eZZr7uhzo1MzgWbqXGx2ofOcv4IvNWpLmqnxTEPpd4cE1tTIfpOl1bdIzGAJlEWT2ofkSISWMRDr0lkK9DKpyET0Km64xNDR0R6wumstKEAGSiE1rYkBMkpAYll0Pse4ZV8ZwA0CX+EAlktjzqR6M1GdE5eWuR+2/cey5P42i4VZ1pZlA9vdJpd8XBqEz1Ca3SjrcPcA0x+DJ987Awv67kIswHP9R5RohFZU4mYGJFrJmCD+sIUcuZFOWu5UL8uPT/bA7yD6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=epTLbuB9BLQ4N7kdzeTNIidD7l4SQ0/aVpS5MEGQd38=; b=ZX2JtMT4aPNIDB1KI8VVMMOqWYpdalBBWWVZgD2sPV92g7HnATFQQJUQH91WyvgP7suHGtDZe0bhqFNRTAzrKBuiqyYLKR6PmVOP8FyUZsVmo6guqNjtnY/JVRwGgZs9zqfucd06qqISegkDQYY1E6wn8EFTQZEVnqKX/2QSHZQNolposNLSnUJ5XwQ+HxJMuJsRgOXMYeXl53EDMt14dv33dWNPxX20f655bcHVVEn2k5Le2Gzm309+ELEIqBC7CtnlHABJ4sPGfgDl8KA+/APuDkMvNw04HjJk25trK3VAJqOpaIFUWjT/E3zjvwkc/xXMEigT/IML6P7/Y/9fGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB7446.namprd11.prod.outlook.com (2603:10b6:510:26d::5) by SJ0PR11MB4960.namprd11.prod.outlook.com (2603:10b6:a03:2ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Tue, 26 Nov 2024 20:13:51 +0000 Received: from PH0PR11MB7446.namprd11.prod.outlook.com ([fe80::ee69:297e:231d:4d3a]) by PH0PR11MB7446.namprd11.prod.outlook.com ([fe80::ee69:297e:231d:4d3a%7]) with mapi id 15.20.8182.019; Tue, 26 Nov 2024 20:13:51 +0000 Date: Tue, 26 Nov 2024 14:08:45 -0600 From: Ben Olson To: Andrii Nakryiko , Eduard Zingerman , CC: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , , Subject: [PATCH v3] libbpf: Improve debug message when the base BTF cannot be found Message-ID: Content-Disposition: inline X-ClientProxiedBy: SA1PR02CA0020.namprd02.prod.outlook.com (2603:10b6:806:2cf::27) To PH0PR11MB7446.namprd11.prod.outlook.com (2603:10b6:510:26d::5) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR11MB7446:EE_|SJ0PR11MB4960:EE_ X-MS-Office365-Filtering-Correlation-Id: 97b79173-a2e5-4398-8bde-08dd0e56d7d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: 0kAt/VpWpjsnjetcgRixOQrfm9MfQuWH8Hsax0psZJAZWSWbOkE4Kz6jj1W+C77pCkHZptL3yL+XGz/kN8QVF61iakhKp82cNpGU68inIsbzc27jn9oLqpn+EtDo7MjrQEfYwsp8FXGx7L5IFLlUPbOk4CYjp5+iI3hTXzAqoOmXGSa/rqNczcl3fq3wjY287+rt5AiXymVHHVpde0Fpo6zRrmIJfd4BgYgUwFBT82AhH+9jo7kXRi4wGyAc+TD8sJRK1fUKS8lAVXc7qIUOEXtFYRwQgxXMX2xlV+s6CuAywelAihAvEsk+XaNMtkeEg7gaCKFIdki6jOydV5h++NPxds+L2tBGks09rCkRW9qWYnNQyfhKuyU4eOS0S7QXB9m4BKZ0QDCez3jMUU3f0Eh+h/eb6bxWHESEfx4Jx3tC4S3b/SDbDyq/ZSGrixdtBoh5sMGw7J2AILeNwBuARF8oGy4BJEC5ur85SQEADReaa3gUwVKUhNSLM2/4Z3dC+kLkfr2ie1nMrJsZ99x2sdM8Qg4+KFFE4pziIkYXvr4fkvocSOcNbmCZdprqGEtVnAZWVDdFtKqa3o+AhPaRoq6kx1CogdG12/YAyUVTSedjfRUG3sG1t4Z/ADmB6qFBud5CiWYxYHcrMu3+O581RfS0ATVE9a+g5pTtsA1AuOTwD3VQEYrVV+EP6ZnCOLpXHW6vh0e/ZSkjeZfXDYUwpRiyTokkphopRBuuUG1uckuzmqKYnp3pmG8K0BqPbpldz3mvQvMVy23gp5r/PHhdP7q40GXkLUQJ98dOULlula/xqyp0e46pNAXPvwgx5/jm/L+STi536DbhcPZ7ocwH3XfxynOZMWRbwWiUz8bkoac4Lvzw72z3jEeBSpqOy7dsEQGunZ8WXyydwDaWZJjA+twXsOGq5v1iVz/axN33PnYLIFHFj9da0izGE2H7p4cQPDd1Jy4XOW58XKFesVgkAcquplpxdrXLNFxCJDnVGDIDKR6FvesJA1G0zJbnhvr/WWKUKtMAPiwnoG8z3MstwIFHzecLVtkP0V2WzyS4FT6RucBEIIClsLrCp8r7skOg9pfL8h3dfHqn+MnAc99WZzxOfBkP8EbvGuaug7VSpGyuv07BfnsQ3a5XSaVaF3/bDrjBV2vBi/48Wlaaw++m1CZsd+RmjG+L/X5Rp6s9/wgmTX8E3XI+ywy3KyXfkfvdDLOsvrpVG7GODntIfIt3CAQvOKK23iEygp1p7xAVgVdIJX/1fTL0zNb02bQ37nvw/yLNy3rLV45/U7SBLkeR9e6YfAJnJmbOfzBlQ6RQIlCZWKirsCCL2uYD2DZFqnbyp5JPM6YLp5fVjiCI0MSU+g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB7446.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xILTd6j3jvUjYSZjZwO6Rz2MBPUgSUZmGtaoFhShiZ8Txgpfy3G75EznxLbx4HAZKIV8ii4RgyooHuBaeHsIcYoXGaWTUp4e72ReGpR/rDq+gP2kYytg0I9wVcA3Z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1l8oLjX81Djk4Wp2Heqy63e8Cl+EEKRLNZqTOtWAjRrUQhvQTk76ia537x3UgM32jaDSZdPtjR0dFKH8bvYYSg2dwriQhQxHIuSKRcExqa876hu2vBu0V6ziBgeK4cmvpRLEvwHG/YfVlENiBwg9zIpYZN8XknYzF527s8fKhA1jHwdtZQLLP4nsvsdu4uj7qnf+mEj1RL7RoXoH31TMULxtubr1oPvgEr0hVQz+ugu9uGkxeOgRnO4bL958i39GrHR8+RWyzGx39ri8pSvBq77R0CLWBQBseswux00nRhfr5LGY/3yVqxYRt6rvQhvX42qB+MZLdxaoQUQcjqTtzCr1ahzYlrSU9meg6kjcgcQeypPGUvsrEVYeQDa4xFXZDsk0s/4Y4UEd/sD5keaEAA== X-MS-Exchange-CrossTenant-Network-Message-Id: 97b79173-a2e5-4398-8bde-08dd0e56d7d5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB7446.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 20:13:51.0393 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1YiR0XnWoXt0lDjdDkyre6WUDouSc66wOn+YkN+JgWbGserC/cvV8Mr1mkMN1wTszfaQ6rXs235AdPHo7kibAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4960 X-OriginatorOrg: intel.com X-Patchwork-Delegate: bpf@iogearbox.net When running `bpftool` on a kernel module installed in `/lib/modules...`, this error is encountered if the user does not specify `--base-btf` to point to a valid base BTF (e.g. usually in `/sys/kernel/btf/vmlinux`). However, looking at the debug output to determine the cause of the error simply says `Invalid BTF string section`, which does not point to the actual source of the error. This just improves that debug message to tell users what happened. Signed-off-by: Ben Olson --- tools/lib/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index 12468ae0d573..a4ae2df68b91 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -283,7 +283,7 @@ static int btf_parse_str_sec(struct btf *btf) return -EINVAL; } if (!btf->base_btf && start[0]) { - pr_debug("Invalid BTF string section\n"); + pr_debug("Malformed BTF string section, did you forget to provide base BTF?\n"); return -EINVAL; } return 0;