Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1455127rwr; Fri, 5 May 2023 14:35:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5fJHRzZhuYAfjEYQqmE+tj8Zaq/hhTFEn1zbG6GLbpXcDpTxamMoEmscu5SDvhAIz6ML3O X-Received: by 2002:a05:6a00:4186:b0:62d:bf69:e9e0 with SMTP id ca6-20020a056a00418600b0062dbf69e9e0mr7606247pfb.17.1683322521818; Fri, 05 May 2023 14:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683322521; cv=none; d=google.com; s=arc-20160816; b=RLQOxoqSx2hAh3ZgvaF4wavWSp8dSVAW6w6ksz/kgxwz3erGgO0P9Kc1FcyKbTxh+0 VQk/TeEGaSFnf+xzax5mskeIP3MnXq5x+aWBEDM1NlvCeCV2PwYF90akKEm7FzZ0p0kD NTeQZAO+il5cLjTe0Klj+TWN+Z8SaBTIliDPITvFn5ricXNxmp8kNok9fbFCWd+4zQgD wrX7KIQIiX/HTqlTOicx+fHTneo/xw/RmmuNrVfv7yCubbHaeh1bQ2U6hiUVZZ3J2xBK 8H5FthARUgz7tBk6+aTd+snECcN7UU2xAZZQCPz9TKKbn11LY75u1b1qE0y2/aE1PIQq 65cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=XkXl7THQTcSoWGAdjQDIdbhF6z1BfCF8i0FLGfTc968=; b=QACVyFHop3lIzyMYeR/ZUL9+h/7mSQ6yraa+8/C6sb/g5QrYE6s6TBBpXmj8EhemVf vFFJxkI1OkxAqR9DC6tceyBgSQV0h4dUdLl8rzVUf9um+hJVg6Xr0YXqWo+lDxiAb5zz 3dgXCyialWXlm+Xu6QDUyz140eOhhQ53EsBdCEM5FzxofmuPOUlVxlHjmbB9NBXE84zr KS3QrKGxvBHjRMcOi/lPXMO/SWWjBhw2GP2bNLB8atwQzJSzvTXul4r2orwxLiPBMSG0 eMGRHwIbCKKJajnYEhLZ18A5pMBDmflT/OCmo2h7Xujcfa/1vllpFBbTMIvHI93z/l0I XJWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sRdmQuof; 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 o28-20020a63921c000000b0050faaed4f76si2936222pgd.751.2023.05.05.14.35.09; Fri, 05 May 2023 14:35:21 -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=sRdmQuof; 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 S231613AbjEEVPz (ORCPT + 99 others); Fri, 5 May 2023 17:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbjEEVPx (ORCPT ); Fri, 5 May 2023 17:15:53 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB48B525D; Fri, 5 May 2023 14:15:49 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-50bdd7b229cso4424821a12.0; Fri, 05 May 2023 14:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683321348; x=1685913348; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=XkXl7THQTcSoWGAdjQDIdbhF6z1BfCF8i0FLGfTc968=; b=sRdmQuofItEEH82RKq9MBofo4Nh/ZIFNlsNcDcvk1mVnBErH+TV2IMzo3AzwX5dIZ4 V+z2Bvj7iSpPPSE8bNCcBzbsm/ipq0/2lqo4V69eIJ9P9YjToAmwg5fj8inUxi0SfTJc KMzOx8oXFd7losmEa98OQMkZDE+CJuvVrWV/V+Eu7jd08AOEuHZra0ZMIdzxMz+/zpzu N98Jc89YFqH5grcpwsX0LDsq9Z0FOdUdCk6f9sV4YVVjzU8/Q6qqQcUAboY3AYnx+fEU Mpm+qxs4i64HWCgPvWLTnrYn6D+FPIazQKm9xA01Pwya9SlEHXwociXtjoxY+uvUsSew pn+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683321348; x=1685913348; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XkXl7THQTcSoWGAdjQDIdbhF6z1BfCF8i0FLGfTc968=; b=ABTQfD2I5ZdZszQNhlqLzyJ3D/gt/GP2bjLd8q5HQoO7HPCEj6KHbDr4mdYhYuWF0F ioO9ilXrSghze7Yy9C8x17QAohW4s1mNZTeihyUJ+aq/LFNB44qiAE1GlJeFX7BovBeC 0C0YvYX73imrP0cZMew7UeA7Wd2xI8zLM5Bs0slolvv8e+ZNX0tqCtjSHS0KcNCnptWq iwATymSAw3yLtX5sQtyeHQVuX4HKgxco4wnf/F/J03Fy+sRdjFrVJvqG0yNbnNxgiUoo IEKYeyOLrzj40MHhazMmnKGJYqIeitPCmai2NICYrARX6RnoPZYB5HvRMcg4riePnaGA NhGg== X-Gm-Message-State: AC+VfDy7yAIZxCSJAZSrWJaIpmuJ1PDjoVEf+6+UMEYjPo4blipZKM3s 0af7GUSVXUb477XPyihFJME= X-Received: by 2002:a17:907:7d9f:b0:94f:7d45:4312 with SMTP id oz31-20020a1709077d9f00b0094f7d454312mr2471434ejc.29.1683321347955; Fri, 05 May 2023 14:15:47 -0700 (PDT) Received: from krava ([83.240.60.209]) by smtp.gmail.com with ESMTPSA id ss13-20020a170907038d00b009659fed3612sm1384758ejb.24.2023.05.05.14.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 14:15:47 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Fri, 5 May 2023 23:15:45 +0200 To: Ian Rogers Cc: Jiri Olsa , Arnaldo Carvalho de Melo , Linus Torvalds , Andrii Nakryiko , Namhyung Kim , Song Liu , Andrii Nakryiko , Ingo Molnar , Thomas Gleixner , Clark Williams , Kate Carcia , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Adrian Hunter , Changbin Du , Hao Luo , James Clark , Kan Liang , Roman Lozko , Stephane Eranian , Thomas Richter , Arnaldo Carvalho de Melo , bpf , Alexei Starovoitov , Yang Jihong , Mark Rutland , Paul Clarke Subject: Re: [PATCH RFC/RFT] perf bpf skels: Stop using vmlinux.h generated from BTF, use subset of used structs + CO-RE. was Re: BPF skels in perf .Re: [GIT PULL] perf tools changes for v6.4 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 On Fri, May 05, 2023 at 01:46:30PM -0700, Ian Rogers wrote: > On Fri, May 5, 2023 at 1:43 PM Jiri Olsa wrote: > > > > On Fri, May 05, 2023 at 10:04:47AM -0700, Ian Rogers wrote: > > > On Fri, May 5, 2023 at 9:56 AM Arnaldo Carvalho de Melo wrote: > > > > > > > > Em Fri, May 05, 2023 at 10:33:15AM -0300, Arnaldo Carvalho de Melo escreveu: > > > > > Em Fri, May 05, 2023 at 01:03:14AM +0200, Jiri Olsa escreveu: > > > > > That with the preserve_access_index isn't needed, we need just the > > > > > fields that we access in the tools, right? > > > > > > > > I'm now doing build test this in many distro containers, without the two > > > > reverts, i.e. BPF skels continue as opt-out as in my pull request, to > > > > test build and also for the functionality tests on the tools using such > > > > bpf skels, see below, no touching of vmlinux nor BTF data during the > > > > build. > > > > > > > > - Arnaldo > > > > > > > > From 882adaee50bc27f85374aeb2fbaa5b76bef60d05 Mon Sep 17 00:00:00 2001 > > > > From: Arnaldo Carvalho de Melo > > > > Date: Thu, 4 May 2023 19:03:51 -0300 > > > > Subject: [PATCH 1/1] perf bpf skels: Stop using vmlinux.h generated from BTF, > > > > use subset of used structs + CO-RE > > > > > > > > Linus reported a build break due to using a vmlinux without a BTF elf > > > > section to generate the vmlinux.h header with bpftool for use in the BPF > > > > tools in tools/perf/util/bpf_skel/*.bpf.c. > > > > > > > > Instead add a vmlinux.h file with the structs needed with the fields the > > > > tools need, marking the structs with __attribute__((preserve_access_index)), > > > > so that libbpf's CO-RE code can fixup the struct field offsets. > > > > > > > > In some cases the vmlinux.h file that was being generated by bpftool > > > > from the kernel BTF information was not needed at all, just including > > > > linux/bpf.h, sometimes linux/perf_event.h was enough as non-UAPI > > > > types were not being used. > > > > > > > > To keep te patch small, include those UAPI headers from the trimmed down > > > > vmlinux.h file, that then provides the tools with just the structs and > > > > the subset of its fields needed for them. > > > > > > > > Testing it: > > > > > > > > # perf lock contention -b find / > /dev/null > > > > I tested perf lock con -abv -L rcu_state sleep 1 > > and needed fix below > > > > jirka > > I thought this was fixed by: > https://lore.kernel.org/lkml/20230427234833.1576130-1-namhyung@kernel.org/ > but I think that is just in perf-tools-next. ah ok, missed that one thanks, jirka