Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp32528lfe; Fri, 15 Apr 2022 18:04:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMjwF6UR4MV+umVC/7u0yTn0+DyNf2I7+KT8zroyRDXFuNkAEuXtwZlPnjHKhPl/drvz3H X-Received: by 2002:a17:902:7ec1:b0:156:17a4:a2f8 with SMTP id p1-20020a1709027ec100b0015617a4a2f8mr1611073plb.155.1650071054657; Fri, 15 Apr 2022 18:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650071054; cv=none; d=google.com; s=arc-20160816; b=fnSK81OzFwvIE6Cti87KwyNaYaB/CmLiuuKYUi+RB3m+hZ5A3k8z+V7HuwNnF+NR+w XII9kGWUWTIr/TSkwezDVbDl6eEWZrxLAaLU1ALR89bjFQH8dhsRzWiePde2P9GjGP0Z trnkGVk3pDEqkqw2nQber+N67dHG/Mkta9H5bCXyEYQDhLCgStozPDYi81WAugWAPyse vPpPLlGsd5YgoDAA9i6oNtDWWSvlpjVr/PDWTH6+wAIfQw6bUN12rhNQMrF6xIFWzkDv QHpRLGvdP3Ag81kOdxEbMrbM5yQ7kn4HSkQMoXeL+WIjSKr5w8bvyHfFjT5ccrSAjb1q rkWw== 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:subject:reply-to:cc:from:to :dkim-signature:date; bh=Jjx4TEjThTwWL8bj+lhR5ya+aOGQp9+e5cNVbMKzJbU=; b=bQDy4G81UQSSx4MtLceL2xJfr0FkYydqM/c6wWXNh3AhCppTNOVwyXX4jpA5yclD4V /4f+aQGTYfIAYEVtM8mNimvmXRmyn/HYhRHWiAbXb7xquAOhRPfO8mwR7TTMElemHvOh ROwHLpocWQi0WKcNQsbksOyteKUTyOGRI1Fs/biY57Z6SULJmJkoJwsng6PKaLwPZVcs pX/gBaNxRvFt8wzrOJk7QEGKsBLs+D4EaH+Mdspk5gNmTMV9ht8Fzz4GZJwDyFX+K+ja E1mLlhZzU8q26CsKMPTn1T4yqIXISiBuNMPPURUO9T3BI1B+iBFOVVYcUz00ybOAEk5s 1e4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=n1JYQEqn; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i9-20020a63cd09000000b003a27204cc3csi2783561pgg.857.2022.04.15.18.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:04:14 -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=@pm.me header.s=protonmail2 header.b=n1JYQEqn; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DBBECF1AE2; Fri, 15 Apr 2022 17:45:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347200AbiDNWry (ORCPT + 99 others); Thu, 14 Apr 2022 18:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347190AbiDNWrx (ORCPT ); Thu, 14 Apr 2022 18:47:53 -0400 Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF19C681C; Thu, 14 Apr 2022 15:45:27 -0700 (PDT) Date: Thu, 14 Apr 2022 22:45:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1649976323; bh=Jjx4TEjThTwWL8bj+lhR5ya+aOGQp9+e5cNVbMKzJbU=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=n1JYQEqnS0UycH2UG6rdRF0NDW9N472WSec3ZYaZEP3WdQJe6sEY8fOYa6pQDOBdN n8KwoW1Q61coy1P8wCY8gGLszNUHTwKDvm15696xiuA8j78ApsqvDyfkMtgZ16Emsr qFgZpsBF6piz0VCrrmuPaYznPT8dig9fPkTg9vphSHENpc3o3X51MeHt3Z8UuaPibu dBKc0hQoG/Q2AVm6EWq3QzG2b5A3fa3WbRKOTPt1VVTl/7k+9vfWIBxus5+8owcR+B xU2HYkr/S5czp89OwOV035PGE7HAeeZcuNkP9UoLJWEaE3NimsNNbjEJlF0n7asDZa 5+VuryUcvrAiQ== To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko From: Alexander Lobakin Cc: 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?Q?Bj=C3=B6rn_T=C3=B6pel?= , Magnus Karlsson , Jonathan Lemon , Nathan Chancellor , Nick Desaulniers , Alexander Lobakin , 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, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Reply-To: Alexander Lobakin Subject: [PATCH bpf-next 03/11] tools, bpf: fix bpftool build with !CONFIG_BPF_EVENTS Message-ID: <20220414223704.341028-4-alobakin@pm.me> In-Reply-To: <20220414223704.341028-1-alobakin@pm.me> References: <20220414223704.341028-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fix the following error when building bpftool: CLANG profiler.bpf.o CLANG pid_iter.bpf.o skeleton/profiler.bpf.c:18:21: error: invalid application of 'sizeof' to an= incomplete type 'struct bpf_perf_event_value' __uint(value_size, sizeof(struct bpf_perf_event_value)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tools/bpf/bpftool/bootstrap/libbpf/include/bpf/bpf_helpers.h:13:39: note: e= xpanded from macro '__uint' ^~~ tools/bpf/bpftool/bootstrap/libbpf/include/bpf/bpf_helper_defs.h:7:8: note:= forward declaration of 'struct bpf_perf_event_value' struct bpf_perf_event_value; ^ struct bpf_perf_event_value is being used in the kernel only when CONFIG_BPF_EVENTS is enabled, so it misses a BTF entry then. Emit the type unconditionally to fix the problem. Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command") Signed-off-by: Alexander Lobakin --- kernel/bpf/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 34fdf27d14cf..dd8284a60a8e 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -4286,6 +4286,7 @@ static int link_create(union bpf_attr *attr, bpfptr_t= uattr) =09=09goto out; =09case BPF_PROG_TYPE_PERF_EVENT: =09case BPF_PROG_TYPE_TRACEPOINT: +=09=09BTF_TYPE_EMIT(struct bpf_perf_event_value); =09=09if (attr->link_create.attach_type !=3D BPF_PERF_EVENT) { =09=09=09ret =3D -EINVAL; =09=09=09goto out; -- 2.35.2