Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp551677rwd; Wed, 7 Jun 2023 03:57:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Uzq5/8jQb58TgJ1hiOUUwK98aYAFz858IBsBqty+wNnSNaTFkSDbCYUYUPfWlCmbNSntn X-Received: by 2002:a92:c90f:0:b0:33a:f1b2:eb6c with SMTP id t15-20020a92c90f000000b0033af1b2eb6cmr6931225ilp.3.1686135442660; Wed, 07 Jun 2023 03:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686135442; cv=none; d=google.com; s=arc-20160816; b=xOJMgA98dewVy3AUZfLEFvSuZczO4VZl9IrSp8hdefwpgbB+5TecfcM1nF1A+o//M0 3/OBKhtfYrp+Uw+QdjYAv6QqTlxVSLrGKU/ZUOarHKrvXI8zmT/eBnQ7mUrdM0PMPhwE RFnqeV43Da3mPkbaEw0LRlrLx5o8ET+d96uh7E4gbfEf+spfJCAaxr8uW3qx0ZdSaSVI fg/gCWekVUj154zC2hMlab0QEpAtRIrvMstaHAFJISfCMzgUE7i9cajF1/p5rs1ps6Em 5rf6dV5yALC/G1UEIFXRQaVFiWav+Yv0M6FZ+jbuejaD1Cfb6bGDKx+Dr0UwoPIB5DqT 67Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=N7LrhNNEdA24khblC9g8MfKa4jeWvLQ+nAT4hRuOUJI=; b=Sf0uF6PEtdKhKBSOeQMaiSeZNd42pU5xz08tyHJcrkeMXr6KnIkZFmrVTVQ3FCVsm9 NavbQVKlnhQzDg6eDdlo5OLN5pb949ZqP8rNoJ2sALNuYPMi4fIDaNeHRtb0+2sQaBKZ 43pGNyUxOuF4/TZj/9lg3HnEFzhOgrVNT2Yp1RUzjf3bUNbNHjenaED5oyLqI/H/GF7u E4INvDyHMa5qKaMZRFexIntMrOHxaf822T3ySHo5dJG420BpZWfPTnGnpnRKzwiF0itl Pcda1hsbwbwoJsC6gsBnsL8ZWaxNkP9MoNYODetNC2qLz2ws1vKsvpFHcTrpgLtCIj19 0gfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@isovalent.com header.s=google header.b=XIPDoVV8; 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=NONE dis=NONE) header.from=isovalent.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a637804000000b005348c54150bsi8742103pgc.316.2023.06.07.03.57.10; Wed, 07 Jun 2023 03:57:22 -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=@isovalent.com header.s=google header.b=XIPDoVV8; 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=NONE dis=NONE) header.from=isovalent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239614AbjFGKmq (ORCPT + 99 others); Wed, 7 Jun 2023 06:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239665AbjFGKm3 (ORCPT ); Wed, 7 Jun 2023 06:42:29 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABFD2122 for ; Wed, 7 Jun 2023 03:42:19 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f6ffc2b314so3474795e9.0 for ; Wed, 07 Jun 2023 03:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent.com; s=google; t=1686134537; x=1688726537; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=N7LrhNNEdA24khblC9g8MfKa4jeWvLQ+nAT4hRuOUJI=; b=XIPDoVV88MC7ohXtbTc2BCAz536FGMFDcu4rdZ5ndoe8/wbuZh2LJ8yFLgMkgqX5xS vuNtpp04rDMuXb+tEbdw9+7DjSfzqX0KNlkMYA4fpekCV4J/KMpN3DPo1C6Hv7TSNhMC GsiaGDA1rl0Tv2jzQ7g1Ndhrq/QALkjJP+drhZaztLD/jNveiLBziLAsCrH65+ufAN3A 2jBNTl3WUaFnzfWdmTs2XxvEcl/tZgfYEWYbejMAJbZ3S4V6hf1xIJyZz5zSJPUoFpDv /08sr83xx/vF3wFWesTcnJ9+s60XwYIm+MESMCKWGv88MeIAFjuKC+ZUAJNBPZbKu2HY SCNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686134537; x=1688726537; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N7LrhNNEdA24khblC9g8MfKa4jeWvLQ+nAT4hRuOUJI=; b=Ve/qtWIO/GSFWnMI1tBkLa0d3URiuGgU890D5IiEzR89ZL7AUgQTUy3JQrBN4lawU1 84cciuNmlBa1d3lBtuHONp6f7AFqeiO44l8eeG6zqGddVQ86yNBx5yiRgO0EnsNpkxs9 tjZAYbTRRxMx2KtoaKPXrYuVXOTZlOz1b/uTmYHJur12RKA+4QyoRYb9Q7DO8irsReps yuGM0s8gUKhv2kGMhuMT6SK7Sv+dOolWioV4Gh6EYZzpVbcXLJ7GNyX15gkF4Oc8Qtay 5ooHjPLAZwnRL5a/43fB372oblO1k0s9j5KZSPoAHNn+17MmUphLScH8Lr4fVNtgx1D4 6MYg== X-Gm-Message-State: AC+VfDwLLTeyrDvE5sa4mHBGOxWx8wiu8Mr7DJEml8Pfvj9CQjVW9ya6 ToymxjOFhdDuVbuWgbSplHTK2g== X-Received: by 2002:a7b:c3d4:0:b0:3f4:1ce0:a606 with SMTP id t20-20020a7bc3d4000000b003f41ce0a606mr4065558wmj.1.1686134537631; Wed, 07 Jun 2023 03:42:17 -0700 (PDT) Received: from ?IPV6:2a02:8011:e80c:0:3d52:65d8:7088:94e9? ([2a02:8011:e80c:0:3d52:65d8:7088:94e9]) by smtp.gmail.com with ESMTPSA id h18-20020a1ccc12000000b003f74eb308fasm1648829wmb.48.2023.06.07.03.42.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jun 2023 03:42:17 -0700 (PDT) Message-ID: Date: Wed, 7 Jun 2023 11:42:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 bpf 03/11] bpftool: use a local bpf_perf_event_value to fix accessing its fields Content-Language: en-GB To: Nick Desaulniers , Alexander Lobakin Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Maciej Fijalkowski , Song Liu , Kumar Kartikeya Dwivedi , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tpgxyz@gmail.com, Jiri Olsa References: <20220421003152.339542-1-alobakin@pm.me> <20220421003152.339542-4-alobakin@pm.me> From: Quentin Monnet In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 2023-06-06 14:02 UTC-0700 ~ Nick Desaulniers > On Thu, Apr 21, 2022 at 12:39:04AM +0000, Alexander Lobakin wrote: >> 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: expanded 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. >> Define struct bpf_perf_event_value___local with the >> `preserve_access_index` attribute inside the pid_iter BPF prog to >> allow compiling on any configs. It is a full mirror of a UAPI >> structure, so is compatible both with and w/o CO-RE. >> bpf_perf_event_read_value() requires a pointer of the original type, >> so a cast is needed. >> > > Hi Alexander, > What's the status of this series? I wasn't able to find a v3 on lore. > > We received a report that OpenMandriva is carrying around this patch. > https://github.com/ClangBuiltLinux/linux/issues/1805. > > + Tomasz > > Tomasz, do you have more info which particular configs can reproduce > this issue? Is this patch still necessary? > >> Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command") Hi Nick, This patch is still necessary if you attempt to compile bpftool with skeletons support, on a host with a kernel version lower than 5.15. I took over on the bpftool patches from this series, and sent a new version last month. Given that it only contains the bpftool patches, the series has a different title and is not tagged as v3, but you can find it here: https://lore.kernel.org/all/20230512103354.48374-1-quentin@isovalent.com/t/#u Jiri (+Cc) found an issue with this set when CONFIG_BPF_EVENTS is disabled. I need to replicate and investigate, but I've been short on time to do that over the last few weeks. Best, Quentin