Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp997844rwd; Wed, 7 Jun 2023 09:31:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hiPtMBq4YTREmjqVl8REkYJNz/XoAoii8UhwbJLOab7n8EVJgXGQ40mtvujyrCChGDCWq X-Received: by 2002:a05:6a00:3a27:b0:65e:ec60:b019 with SMTP id fj39-20020a056a003a2700b0065eec60b019mr2440734pfb.25.1686155516101; Wed, 07 Jun 2023 09:31:56 -0700 (PDT) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020aa79988000000b0063bba133a6esi8862758pfh.4.2023.06.07.09.31.42; Wed, 07 Jun 2023 09:31:56 -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=@intel.com header.s=Intel header.b=aG19j65N; arc=fail (signature failed); 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjFGQUh (ORCPT + 99 others); Wed, 7 Jun 2023 12:20:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbjFGQUc (ORCPT ); Wed, 7 Jun 2023 12:20:32 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE0D199D; Wed, 7 Jun 2023 09:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686154831; x=1717690831; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=oATLTFPiEhxtm7BkGsGRbc8I3UyLxNW78ARqJiUpXd8=; b=aG19j65N5OYt//nB2EmI+7EKP2jRXgLt4P4BY2qhI/wh102pJtnIBD2n AVy0eEZb3S1s8Uko8C3HDU0svSyuGL6fuAlBqeWpEeZ48qNhnClef1meH QyScmjp1N4D/PEVhWpT/2nu4t5AHpyqSleSLgn0w1vKd3Skv2hSxjgDbX CFC3Cq20Bg7GJo9KAgl86bYfmGrUR46YrrRX0M3ZdmEyDp/naVhaIIt3Y 43RqT7lQXqB0j2QPDsuifu5g6dJ8UvnWNQtS5+/QwFS+39k+nONh+SXFs QshB0yOzVrG1xKsSL+S1mOhIY3XfP1olEj2vZ3nW8WBhc6LiMHZJIfz9A Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="420596497" X-IronPort-AV: E=Sophos;i="6.00,224,1681196400"; d="scan'208";a="420596497" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 09:20:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="779525382" X-IronPort-AV: E=Sophos;i="6.00,224,1681196400"; d="scan'208";a="779525382" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP; 07 Jun 2023 09:20:24 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.23; Wed, 7 Jun 2023 09:20:23 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Wed, 7 Jun 2023 09:20:23 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Wed, 7 Jun 2023 09:20:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YNHBiho68GqGp9IZb9mfOa8S+6SGRVCtWZBSsKkl0gfcgvDUwdgbDpPuWA3LWpR9ePgPiVtzDEgRYNX+1sKOFLt181oxDNGxi9uCn6OfeJ1umTurdZE155B+t+5mYD+hoXSu1HITfFeHxsm+hGc+zB5T2b/4f6XWA2lZ1DfNbD87NnK8iAiWQoIKoEvChnkJVIfXEq4K0hlERU36GuqlghvwU3zFOE7E8eVwvFaZyPbsIjGCcitopeIwueu4Ls1hq0d9BNr10hmE+PoxuosOf+KmH2gim59HeII82x5mYduiwa2uwPz3By00ZtzPWCtj0KadDAJhh+lZi1DxvOTtmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=U0Qr1+0jbtl8qXudQmOfbJs0JdkYWUHQxUni1924HF0=; b=GHcGGHK/oMgKUTW5dx2+Ht1GvQj0/6f+hje2BlD65HdGpl8UBx5INSYXB6S7e/uCUgnw7uYbkxefcZHFN3Z8HNTCXEuEBA/A+xCOrSqPC3m9VYQqDcldR0fHaIsFq3kC5h0jDWLZpdOBRiNZrVGpPttyL7aH7Z5wO9rVZgAs6mNByGsQYpOMO7OQshmWxL7GqI9HXsXjmqpz5RR8IiBkh11SZHteHzUOlADe3mZK7aRHoy70OkF/39obe+OsymgU8DK8fPh1ELTiDBSxc27bwHPbT0G+WOQdCRQcD/JMXnd27zfAIEAuWax4LnOj5ScpxJ2flQDqWND4YktQw62i4A== 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 DM6PR11MB3625.namprd11.prod.outlook.com (2603:10b6:5:13a::21) by DM6PR11MB4611.namprd11.prod.outlook.com (2603:10b6:5:2a5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Wed, 7 Jun 2023 16:20:21 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::82b6:7b9d:96ce:9325]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::82b6:7b9d:96ce:9325%6]) with mapi id 15.20.6455.030; Wed, 7 Jun 2023 16:20:20 +0000 Message-ID: Date: Wed, 7 Jun 2023 18:18:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 bpf 03/11] bpftool: use a local bpf_perf_event_value to fix accessing its fields Content-Language: en-US To: Nick Desaulniers CC: Alexander Lobakin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Maciej Fijalkowski , Song Liu , Kumar Kartikeya Dwivedi , , , , References: <20220421003152.339542-1-alobakin@pm.me> <20220421003152.339542-4-alobakin@pm.me> From: Alexander Lobakin In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0182.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::7) To DM6PR11MB3625.namprd11.prod.outlook.com (2603:10b6:5:13a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR11MB3625:EE_|DM6PR11MB4611:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aef559c-224e-4f32-f78a-08db67731661 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KfnqP7W5oS9kSd2AcHbRxmw4NG17Usuiy/9YacmGMt2uhaI5q2Uqm+PzPrIUcNMYhNckV95p68zioy8JklM7694uN9+vwJ3ZeZF43j56u+HOL4036OXpG7pPG6h+/BwyWDE4hiqte/gEVQTC+xj5p8kABNFb1puuSJYgPjTjiB9zgzm/tBSgbDddlD930g4w3ZZnRk8MdPJduQ4vlFOND9c7DkrRfVFkZ1XxC5lw5vdwiUv/aiBS8fGmVk3r1PUgQW2REUrXceHXKIh5nofOCJhuP/u9qewyycJ5JAHxdnLRuy9XKKDZyH89/iKfA1ED9wiufzYj2F/pLH19c4vppt8nxLHypDTW2Dm+MUeVsqlpTLBmD6zsRf6wZDOLYPIsnf44m34CxYcMXGosTIuk00jLihG7FGVor5/uPpG3cwAZIz1dUxTAjsKCIOoxRoHfbz3BsRKf0k5tlnYFNBHq8aoXfwvyBcfByryQIigIjNGYMWsk7YKMqgZxoPxdTTSN4AZ973NtZaUKvzgQRB3AYdGdZJOjSbRDp1JT+06q+Xv9nmeTYSv8H67pgeVVGy76oxWn0iSdF3mgKvxgTQA4lPlwN3S4JHBIi5hNPhIR5SnjyAw9YURze01AlE+mAxM/pxbFWWlRb2qoJLU0fPV3zA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3625.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(136003)(346002)(39860400002)(451199021)(83380400001)(7416002)(478600001)(82960400001)(8936002)(8676002)(316002)(4326008)(66556008)(66476007)(6916009)(5660300002)(31696002)(38100700002)(86362001)(41300700001)(66946007)(2906002)(6486002)(54906003)(36756003)(6512007)(966005)(186003)(6506007)(26005)(31686004)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y05KU0V6bG9wdWhFUWtSUS83YTVXdjdVZ1lKeHJUN2JCSW5TS01MbkNkRXRV?= =?utf-8?B?QXdlZUtEWk8rRFZEKzgwd2dNR2xwZHJNTi9OVm5UdkF2Y2Vkc1pvUm9nck9s?= =?utf-8?B?L3praDBzWnkxeUdqYVF5QUVlUUkxMHNtQTUwdGtLRzFrMEd3THFFK2NnbEEr?= =?utf-8?B?RmhDeW5EbzNMZXUvazUxellnemg3TURFaEJsWE5TYXNKOEtha0tPSjFZQmx2?= =?utf-8?B?Qy9SRlZJOCtZb2d6UlpIdDMxWmM5WG8zY01KY0FXRWlCbW5EeHQ0MjJFWW52?= =?utf-8?B?SXdJbGZFYTA3bkZVd0o1eFhoVzlNY2JPUXJ1VUl5amFKa0gvZXZHNEkvU2g5?= =?utf-8?B?bmVpQkdxbHBIUDFKR1NjeFRpT2lxNjBHc2lMeXhuUUhPVDZVOGFuRE5kUnRF?= =?utf-8?B?SUNBMUlrb1BxSk5pWGZ4aG5IVjFJbmZyMUxKM0I5blZxb3d4ckFLc1NvQTJm?= =?utf-8?B?b3dvZ3hjZHBWbW12akpYYjVqRVlZdFZyYXY5TDEvckNBc0l3Qml1OUFWeEF1?= =?utf-8?B?SU5VYzVZVXMwenJEMnRBZVRnaSttSVdUNjd4WVl2aVRSOXBtZ1IxbVdtMGtR?= =?utf-8?B?OEZmK0FlVXQ1bDVBTWVmRVhvdE8rQW5YZmdML0lVbzZEdFhwZTVaNEVteFRZ?= =?utf-8?B?a05pTE9yWkpPUHRFVUVnazVkT1dMbzFPY0YrSTlnb1hmMkx1ZlVTK0N3R29H?= =?utf-8?B?OW9YaTlHOVdTNk1PQlpKZzluZ3ZUTjkyNmpPNGY4a3hpUllFWElTTWMw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RUHhVZ1NpWjNnYSt1UHZVZW55YnI4N0FPMGp4?= =?utf-8?B?TndWc1pMaGxwSjFmbEROeHpSRTJYV3oxS1U2enI4aXFsOHFMa1NsSDh6ZXB5?= =?utf-8?B?YjZMUDZ1UXJKR3BYd1A5WnJIZFJlZFQvdlo4S0RXR2dqTFdDaWY2YkF6Skcz?= =?utf-8?B?cFgrWmp4L3pHWHM4WmVhL0U2M0QwUUw0VGZacyswaDNEMjMwVDUxdlYyaHhN?= =?utf-8?B?T3gvbFZNRnFvcVFlRTJTUnhHQ1pEekxKUnFuTlVkcVJVYk1wb05ST3pKdU0w?= =?utf-8?B?aUQwem4rRG9nMDY3bnlOa3dmRGlwV2hRVXJXYmZsS0FGMUxLNngwU0hvaXpB?= =?utf-8?B?UFM5aEZadEF3M0MrODRzSE9Ha0EzeG5GMmZqemc5Y2E0YlZxbDJJa0Jjc2lS?= =?utf-8?B?ZkhvL3FlR0lma0ovZURaL2ROVDlCcnBqU2hVMUc1RWZ4b0NmR2Zmc01GaGww?= =?utf-8?B?WFZVLzkzWVZ1QkZ2b0ltaUthVWpxYmNEZ0JWV2Q5dHlTaXBkT3ZNaFZGTm9n?= =?utf-8?B?b1E9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8aef559c-224e-4f32-f78a-08db67731661 X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3625.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2023 16:20:19.9863 (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: s4efYJnKxClm9lr2aLaVxG9ScJok9/aHH9ZOzAQ6ebTdp7pJQ2NjboPb+uIFtyTfEidbt+tGgoMNmPysOUWhpPpNT4C+ksj9Ue+ME+VsW/0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4611 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 From: Nick Desaulniers Date: Tue, 6 Jun 2023 14:02:44 -0700 > 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. Hi, Sorry, I haven't been working on my private/home kernel projects for quite a long. As Quentin mentioned, he took some patches from the series into his own set. I'd support that one rather than mine. > > 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") >> Suggested-by: Andrii Nakryiko >> Signed-off-by: Alexander Lobakin Thanks, Olek