Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2895208rwr; Fri, 28 Apr 2023 19:00:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jykua4CiNeNCrztwv7zO/yLhjCXmtiBGfH05o0OxEXWoxMnbcIMyTUty8glFvSiKBDpku X-Received: by 2002:a17:903:2305:b0:1a9:4167:5db7 with SMTP id d5-20020a170903230500b001a941675db7mr5344140plh.4.1682733632841; Fri, 28 Apr 2023 19:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682733632; cv=none; d=google.com; s=arc-20160816; b=xKZ7qSgjie1jLxq0pO94rfwkiPLn4sV9YBpR1CkihMpVLSC+uDiD2Ikz68sSjXFOAG Yn8PNiKNIFt6p90teOin2Zrgygm2Gt377hGh6UqqU1WtQ5sNFyM2+7c08knwoB8jd1F4 4cHafivtXsf9RWYwL3SuTytjaIZ3/Xi3fUfxhZ14xac4GT2PWLHwQNGA+sPHtlxESjJe /y7kX2StHZbvuZ6xFpeBQNhZyidl0nqpsmj2rXECB5H0/Zqg+YoWSNwVs1WyZVxPXVTA Pj10R+FQQCMwPf4uCudLr2aw32jcKt+o0tAq41oLVEZnLlvi9Pu6u8ViiH7YxbkkTGx3 L2Aw== 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:from:date:dkim-signature; bh=gDddITnWg/PMHvEh2qqH5T3kDtjUU15UIxEa1z81XqM=; b=EQq+UwWcJpdn0Z+2LMwtDFcrp+0BSkpvKF6FNrPb2bKzi6TIfQcgwAVJeQ+C1ArfHv xHOq5DQ2wHUUWE0BFMAMxyTcROEt/zV2raL44AdOHxnGasu+0JcM1Uf3ISWzgMNCkxCr Eq/Q1QOx3WNClFYbeSu9txoDOZrT06nI+aaIm/0+XMJc9LUf5KaYGO/Er4Od6qJwKTHe Wd1ROmR6l5owyrMndANrHzKUt2GZH7qUf4D5C+OT230eD6pEl6/a0IBc3pf8hIaI80yF UDxCKIk9FJkYS3QDWILgUAxf18CmpxcGFMC7lI6Y20qb3k8L/Vp2F93CceQkYkUV+yXj A17Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kH51t25N; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id le5-20020a170902fb0500b001a68fd39aa9si21157304plb.424.2023.04.28.19.00.18; Fri, 28 Apr 2023 19:00:32 -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=@kernel.org header.s=k20201202 header.b=kH51t25N; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347253AbjD2B1r (ORCPT + 99 others); Fri, 28 Apr 2023 21:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347074AbjD2B1q (ORCPT ); Fri, 28 Apr 2023 21:27:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B48E7A; Fri, 28 Apr 2023 18:27:45 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0FD74614AD; Sat, 29 Apr 2023 01:27:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37002C433D2; Sat, 29 Apr 2023 01:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682731664; bh=ZRDTKQMp+p7TvmVO01meyOc6q5mUqaXyAqx63RFLezc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kH51t25Nv9/QlCnFMxvjJEZTIvlN4IdUxvigW0bQr4wYmjxzbzR6efFqQ4o9aXX6h OlHCeAmgwEJDt1dDnSoPI+7iuZylBzBqmXifY3oJ95DKoGPwNYKL4zV0mS/XaIysKF 683w0BqCv/SJL+ulP0udxr//8DAWLF+qUd5QTiGAN2UaI2gegOxD1Fr/y12JWNeUCW YlzctBaZx5PaQLUqz5GXuD1b6zhSeWjoV+/F8G9R2r7l78LIEwPPblVeG/IAdn9UUv rRukjxPNPxfFo9NaKcYc7UUrv3ngkTyHevUg85qoiiazT/TUxIHCgPpCmu5ybY14Em 7fq2M2/nGy0tg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 45BE6403B5; Fri, 28 Apr 2023 22:27:41 -0300 (-03) Date: Fri, 28 Apr 2023 22:27:41 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Namhyung Kim , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, Andrii Nakryiko , Hao Luo , Song Liu Subject: Re: [PATCH 1/2] perf lock contention: Fix struct rq lock access Message-ID: References: <20230427234833.1576130-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Em Thu, Apr 27, 2023 at 05:32:08PM -0700, Ian Rogers escreveu: > On Thu, Apr 27, 2023 at 4:48 PM Namhyung Kim wrote: > > > > The BPF CO-RE's ignore suffix rule requires three underscores. > > Otherwise it'd fail like below: > > > > $ sudo perf lock contention -ab > > libbpf: prog 'collect_lock_syms': BPF program load failed: Invalid argument > > libbpf: prog 'collect_lock_syms': -- BEGIN PROG LOAD LOG -- > > reg type unsupported for arg#0 function collect_lock_syms#380 > > ; int BPF_PROG(collect_lock_syms) > > 0: (b7) r6 = 0 ; R6_w=0 > > 1: (b7) r7 = 0 ; R7_w=0 > > 2: (b7) r9 = 1 ; R9_w=1 > > 3: > > failed to resolve CO-RE relocation [381] struct rq__new.__lock (0:0 @ offset 0) > > > > Fixes: 0c1228486bef ("perf lock contention: Support pre-5.14 kernels") > > Signed-off-by: Namhyung Kim > > Acked-by: Ian Rogers Thanks, applied the series. - Arnaldo > Thanks, > Ian > > > --- > > tools/perf/util/bpf_skel/lock_contention.bpf.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/tools/perf/util/bpf_skel/lock_contention.bpf.c b/tools/perf/util/bpf_skel/lock_contention.bpf.c > > index 8911e2a077d8..30c193078bdb 100644 > > --- a/tools/perf/util/bpf_skel/lock_contention.bpf.c > > +++ b/tools/perf/util/bpf_skel/lock_contention.bpf.c > > @@ -418,11 +418,11 @@ int contention_end(u64 *ctx) > > > > extern struct rq runqueues __ksym; > > > > -struct rq__old { > > +struct rq___old { > > raw_spinlock_t lock; > > } __attribute__((preserve_access_index)); > > > > -struct rq__new { > > +struct rq___new { > > raw_spinlock_t __lock; > > } __attribute__((preserve_access_index)); > > > > @@ -434,8 +434,8 @@ int BPF_PROG(collect_lock_syms) > > > > for (int i = 0; i < MAX_CPUS; i++) { > > struct rq *rq = bpf_per_cpu_ptr(&runqueues, i); > > - struct rq__new *rq_new = (void *)rq; > > - struct rq__old *rq_old = (void *)rq; > > + struct rq___new *rq_new = (void *)rq; > > + struct rq___old *rq_old = (void *)rq; > > > > if (rq == NULL) > > break; > > -- > > 2.40.1.495.gc816e09b53d-goog > > -- - Arnaldo