Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp62057lfe; Fri, 15 Apr 2022 19:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAMsqAy+s4poFr8nUPRQF3VjUZyZp0nvECjK9qGwrs3cE/4kQEgOfoUZKVrgwZLx263ugC X-Received: by 2002:a63:290:0:b0:386:5374:b8b5 with SMTP id 138-20020a630290000000b003865374b8b5mr1382215pgc.528.1650076510504; Fri, 15 Apr 2022 19:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650076510; cv=none; d=google.com; s=arc-20160816; b=URS2Yt8tssHUemlxPNmcS1CaVHQuyzGVew/m7E1qahqonmsjbYzvHxsDXxaQH428N/ erkqDXUmUuQWdQ+DSpNrQSrLAmP2BB7gG3Vbq8QJ6TpBGEwBgSa1Y3cjKI7yJ54WQDBb g03p38ziVfWMcuwOMc8NmQ1AoaKxFAbEld1Ss6KMEgOoVdfO44L1EzdB1VbsBtLMtgMN 89EtHvYqVb5g5dskcJDklMLH9hY5s/29KYYIy3tr2CimgBCIqMhY6pa9QPCw8Hq4H+Sw zAXGBxu7r+s2qjYdYDlNX0HVHGr9gXAqw47VdOstySjFLGHGcGZgZ4y6tOsSVwSqHsgj cGsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c8e7MSLtncclvACsCUHhDvhKpJzxaJXu2UuyefxftGc=; b=e7elHQa2FXQuvt38X8UtWCtnmBCKZwTVbBzygU+Elhad9yTP9TUksFvYRlKHHBxCEH IoouCTG+TKoCqfq59ELbRdtGe1nZpivCpaeVBHa8vMr7vce6fP3z6oiBDBZ6rVH9kk4P FU6Q2kaTIH7+yX1WKgXt0bI9cVsIdgzVwo6J0nTLyiu8v9YN3gr4jXIy5EEtgrJxgHqD rMDoAD3aMrWSKtgGPWutD0Yl4RalhqYuqkR4QkSXsaEJTTV7mfCBbh68l0HoqJ+GfMt4 nR+EhJ6cwLy+AoyUafTZgb9wbKdOowpDuiPxG+UstANJW4QuLyL4bleEnnMhjF+sZ8Xs G6HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f8MNQhez; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s11-20020a056a0008cb00b004fa3a8dff9csi3312182pfu.83.2022.04.15.19.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f8MNQhez; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FB4F12E328; Fri, 15 Apr 2022 18:44:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356499AbiDOX1h (ORCPT + 99 others); Fri, 15 Apr 2022 19:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356483AbiDOX10 (ORCPT ); Fri, 15 Apr 2022 19:27:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2FAF27B26; Fri, 15 Apr 2022 16:24:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 790F6B83131; Fri, 15 Apr 2022 23:24:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A869C385A9; Fri, 15 Apr 2022 23:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650065093; bh=ve8zcTJK3ne1EGkyC8vWulpuyQc5Xh6ZoQ+EsFt9Deo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=f8MNQheziBEXQrO0FxkqhOwkyp/nfmv5VcI4MCAXbtxdywRrg4Ok8nWhPn7wnT4oV 26uaqET1A13eL0c9fwo6GD4/3E9bDIC+UNd9r0LRGbHfZFieNHO9c9Sjx8unQMLC/B RJzlVMWW6Q+LMn4uXY0lXXd0xDM/7AG9fsf7NxG7MdOpr+dJmdU7s9vT67drUqHt2n tKxC1kfAcoPvCBqZFnjQDPWv+L5diPtMUG0ASR2oGSCytsKVHR5Ag5fEnRR1jlcbjt Dvx7A0V6tFZEtxwnuBazxUbSi2L1vVGNJ2Y1Kv91zDp7oIDOm4dv/5FAVL/u29w0Mk 5Pveg8OiZwA0Q== Received: by mail-yb1-f173.google.com with SMTP id p65so16609188ybp.9; Fri, 15 Apr 2022 16:24:53 -0700 (PDT) X-Gm-Message-State: AOAM532C1lvTx90fXMcgZrMExT8KvNC0cqYIk6gOh66aZKuHxnAUk94u KdJY3YCZbEWbI8p0AZVuohMMCDaBu7hR5AHmgQ8= X-Received: by 2002:a05:6902:1506:b0:63e:4f1b:40ae with SMTP id q6-20020a056902150600b0063e4f1b40aemr1399464ybu.322.1650065092238; Fri, 15 Apr 2022 16:24:52 -0700 (PDT) MIME-Version: 1.0 References: <20220414223704.341028-1-alobakin@pm.me> <20220414223704.341028-3-alobakin@pm.me> In-Reply-To: <20220414223704.341028-3-alobakin@pm.me> From: Song Liu Date: Fri, 15 Apr 2022 16:24:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next 02/11] bpf: always emit struct bpf_perf_link BTF To: Alexander Lobakin Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , Nathan Chancellor , Nick Desaulniers , Dmitrii Dolgov <9erthalion6@gmail.com>, Quentin Monnet , Tiezhu Yang , Kumar Kartikeya Dwivedi , Chenbo Feng , Willem de Bruijn , Daniel Wagner , Thomas Graf , Ong Boon Leong , linux-perf-users@vger.kernel.org, open list , Networking , bpf , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Thu, Apr 14, 2022 at 3:45 PM Alexander Lobakin wrote: > > When building bpftool with !CONFIG_PERF_EVENTS: > > skeleton/pid_iter.bpf.c:47:14: error: incomplete definition of type 'struct bpf_perf_link' > perf_link = container_of(link, struct bpf_perf_link, link); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > tools/bpf/bpftool/bootstrap/libbpf/include/bpf/bpf_helpers.h:74:22: note: expanded from macro 'container_of' > ((type *)(__mptr - offsetof(type, member))); \ > ^~~~~~~~~~~~~~~~~~~~~~ > tools/bpf/bpftool/bootstrap/libbpf/include/bpf/bpf_helpers.h:68:60: note: expanded from macro 'offsetof' > #define offsetof(TYPE, MEMBER) ((unsigned long)&((TYPE *)0)->MEMBER) > ~~~~~~~~~~~^ > skeleton/pid_iter.bpf.c:44:9: note: forward declaration of 'struct bpf_perf_link' > struct bpf_perf_link *perf_link; > ^ > > &bpf_perf_link is being defined and used only under the ifdef. > Move it out of the block and explicitly emit a BTF to fix > compilation. > > Fixes: cbdaf71f7e65 ("bpftool: Add bpf_cookie to link output") > Signed-off-by: Alexander Lobakin Similar to v1, this fix is weird to me. I hope we have can fix it in user space.