Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp290202rwd; Tue, 30 May 2023 20:44:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7aWDoB1N2bAsRcU29x2rtrCM4jPc6J+KCEwuVBBU02OkfOjtYOf+wxqoWCxlv5jLQGzEL6 X-Received: by 2002:a81:4e06:0:b0:568:9e3f:4ca4 with SMTP id c6-20020a814e06000000b005689e3f4ca4mr4662844ywb.34.1685504694262; Tue, 30 May 2023 20:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685504694; cv=none; d=google.com; s=arc-20160816; b=jzuYziJTkFH35Rx6Wc8AxwGq2PAD13S6NnH8nQorb9GI9+dQIONvO1Q009oh3iycF7 eU9WPzWzbf9L0kE+QRivB0u4kaG+NO7lOnVLmKwlyW4JvZXtq3vNqHAsuTrgyFZjnMT7 DyaT0lKi9cTej10QSn/Png3GVzWxznn/PN4Q38b3TG+s+B6OOz+Zbg609iBE74SzaNj9 Ga9rHX6F9JPO6rVYybZMBXFF5mtVL14rrOFnanXFQF7BbVCs34HFnS1Kz0WWFsJfunpI ESWxwX2BVNHf/GCGlsoQFcBZa+169fuWnE2p787c3twDPfWrfmRaEiAq5XEFumr2td0K klfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GeKYPmPRckVNs2LGFnOl81Sx5GSbaj0lxU0+PhchNX0=; b=VW8bpbNIRvRqzt67qWPbQYjsVR08/vXUx1xj6mb5Atz8fycZqW937tZFy+aB2LWRKk XG6scR9aWfEisAqgiQmIqju6EgBZKlM9ZLlwzNVJMzURKGoxC98gM580/VI3gr6g6XXz 8ZnPMsHlpHGA20+giQzj+xu46/hGg4N8CnJBPMGoNMgm/wEoMymaqjQsenvZIXjR6Clz DpWhwF/oG+nYxv7LeD/HXIUSO2LEQenK2BSk/OpygnxuFC2rqgIOiPbDPefpwm9+EmAG fVrrY2cqMSBmry1PQA0gbcJiuucYrUznNF9LOH86nkOpeFCtmLxR2tL0bTeor9aMSnRD nWCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RrVsT6N8; 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 y23-20020aa79437000000b0064d5dcc9b8asi2835729pfo.125.2023.05.30.20.44.42; Tue, 30 May 2023 20:44:54 -0700 (PDT) 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=20221208 header.b=RrVsT6N8; 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 S234094AbjEaDPd (ORCPT + 99 others); Tue, 30 May 2023 23:15:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234088AbjEaDPZ (ORCPT ); Tue, 30 May 2023 23:15:25 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D34DE5; Tue, 30 May 2023 20:14:59 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-39a50fcc719so56365b6e.2; Tue, 30 May 2023 20:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685502898; x=1688094898; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GeKYPmPRckVNs2LGFnOl81Sx5GSbaj0lxU0+PhchNX0=; b=RrVsT6N8Z8QHaViGcDQczLcUMM0ZDVuStvy7rPLIGXV+vz++jG6nmhjxRjPA8ZYIvz roD2D10dmapfNbZc3mPb7E9KXLW3yYHakxJUi7aL9HL9pGHyS6oaYFlUaQ1uxq2GZZZe Y5gKE2g5DnJcEUBPTSK77ITeLbztdW2J/Fzz+5ZDNXltV2V320cYqEGge/Zrix0h/7ov leEfdR6xXFCDrmqyc6sE4Bfa01Z24kp0jQaPAIVcuh+VZ5zwpddgR0Z6q/jHsyXLecRL hvd0rglGCAaTDJtuYjuGTt189X9OmC60tsFR2baoLHDg+MMqNnZDh++pxjApGn8DJtgD 1bNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685502898; x=1688094898; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GeKYPmPRckVNs2LGFnOl81Sx5GSbaj0lxU0+PhchNX0=; b=AW7VhzhX9dGIfo6vtZdxzs0ez8BmBDbbhEug6QxEz0x1DIkABLb1uw62c9gt7IVe3U 1bm8IMCDXU5IL6hv2hYMJPHgsQ3A/bs1Iw7D/YmFwFKAIEC/K/UoOIOsuMM0P5z2GXGT sbgbivNBILV2ZuM7ylDT7iJFOOzrWHnNjG+MA8ybhhonYu/8T//6nXdM8K5EP6mSo7qE b1+H5ide8hwl3eWS1Na1PQZhvRLXdxrbMmeqmgtpOVcxGhK+VDBFHjYLo6Z9KHtgfuWm 3Ehs9OR5xVODGqIkzZFh43Xp1dB2ky/2lIAAR4GlZ0czhWu1Q21ZNN6maP9MWp7RD4jM mvxw== X-Gm-Message-State: AC+VfDyPbj+ljn3TuJjNwC1+Ib5o52bPw9poiPPUkfiZE7SSgvxmvCJe 8/BiXNEc0TW1IuA7+a7uVV1LvVwjpJzgjm0TLyJX/XpqmJI9jJBh X-Received: by 2002:a05:6808:306:b0:398:4601:4d06 with SMTP id i6-20020a056808030600b0039846014d06mr2204035oie.59.1685502898604; Tue, 30 May 2023 20:14:58 -0700 (PDT) MIME-Version: 1.0 References: <073cf884-e191-e323-1445-b79c86759557@linux.dev> In-Reply-To: <073cf884-e191-e323-1445-b79c86759557@linux.dev> From: Zhouyi Zhou Date: Wed, 31 May 2023 11:14:47 +0800 Message-ID: Subject: Re: a small question about bpftool struct_ops To: Martin KaFai Lau Cc: bpf@vger.kernel.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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,T_SCC_BODY_TEXT_LINE 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 Hi On Sat, May 20, 2023 at 3:01=E2=80=AFAM Martin KaFai Lau wrote: > > On 5/19/23 5:07 AM, Zhouyi Zhou wrote: > > Dear developers: > > I compiled bpftool and bpf tests in mainline (2d1bcbc6cd70), > > but when I invoke: > > bpftool struct_ops register bpf_cubic.bpf.o > > > > the command line fail with: > > libbpf: struct_ops init_kern: struct tcp_congestion_ops data is not > > found in struct bpf_struct_ops_tcp_congestion_ops > > At the machine trying to register the bpf_cubic, please dump the vmlinux = btf and > search for bpf_struct_ops_tcp_congestion_ops and paste it here: > > For example: > #> bpftool btf dump file /sys/kernel/btf/vmlinux > > ... > > [74578] STRUCT 'bpf_struct_ops_tcp_congestion_ops' size=3D256 vlen=3D3 > 'refcnt' type_id=3D145 bits_offset=3D0 > 'state' type_id=3D74569 bits_offset=3D32 > 'data' type_id=3D6241 bits_offset=3D512 > Exciting news: when I construct the kernel package, I found lots of following warnings: WARN: multiple IDs found for 'task_struct': 241, 21719 - using 241 WARN: multiple IDs found for 'vm_area_struct': 360, 21750 - using 360 WARN: multiple IDs found for 'file': 805, 21789 - using 805 WARN: multiple IDs found for 'cgroup': 666, 21819 - using 666 WARN: multiple IDs found for 'inode': 928, 21936 - using 928 WARN: multiple IDs found for 'path': 960, 21965 - using 960 These warnings lead me to: Link: https://lore.kernel.org/lkml/ZBovCrMXJk7NPISp@aurel32.net/T/ So, I upgraded my pahole from [1], and construct the kernel package again, now I can successfully invoke bpftool struct_ops register bpf_cubic.bpf.o [1] https://github.com/acmel/dwarves.git Sorry for the previous noise and Thanks again Best Regards Zhouyi