Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp783497rdb; Tue, 15 Aug 2023 11:46:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1pqaGVsRYhs2GcBJlmoYj3x+4JZUYrd6Tco1dxU9U568i308eIAvvYa5kLb0TiyMA1Ujd X-Received: by 2002:a05:6a20:3d23:b0:138:64d4:b055 with SMTP id y35-20020a056a203d2300b0013864d4b055mr19658200pzi.55.1692125165765; Tue, 15 Aug 2023 11:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692125165; cv=none; d=google.com; s=arc-20160816; b=Ul2RhqvxdSGIrd7rnXKOPUOrHGv2M2l1Ec7auGPYiXer9GADoPhYkJWvESZkgs5keD rK/XOe9JNa6khwPvRd4Kwr3dLWAH4Pefc8oocKcPEWuIaHwZ6E35DDutCz4L7Ej6um+P BvUQJwrnAswh70wSpG2cQTEWDXQwzXcgwP9myCMizt8UCn9GKytnAROIy8+YZxAEZXiI PrwlXFB9g99HdqG6/jbxo+Wo30BeHcTynXDevtzz/EC1faSt7m4Q6Hdr7AiNa8ni6Akh IVOF4YuH5AhJfF3o39ONJRYWeniv16Qqmh57zwau/r3YwX6vVXjkaE1Jb+9iVy/316DD czvQ== 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=MzYiiz3WZbeAVEyL/MuGPRCIimHYuuD231rAyUK7pFs=; fh=GxgHE7gQeC1SlvMX5EoqmV2GggBopq9qcc5GE/v6M7Y=; b=JOiOhvRq8bEwtv5V+eetC/r67BSeIo+o/0wzYrQJWaCNb7OBp62ZhnLf0TGAuUa8oG +rZRXNtJfhjq+qY56x4eAcczkoUknlu452dGh5oOkksOMKtbI3ofdRf5RvnexnmxT0i0 IiJp0FQwr84xHD7fDNzDnT9C7ikijfovra9f0fkq3VToaHNuIvuS4vu/FozxRSe3IE8D SogKxXD5kWd3gL5KMHkMwcJgWx96XWWPVxcq3qZVyy3ABZykG6BBtbrWhDYFp/YeKJ8T 9GCC3RV7V6kymVfE0CVpvVa6GEXYp/MnMRiNNG7BAosgzeKVDoruJ/IRMJL+0PEVkkJ/ ZApw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V5PBC9Ng; 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 o17-20020a637e51000000b0054402b987f8si9879871pgn.605.2023.08.15.11.45.23; Tue, 15 Aug 2023 11:46:05 -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=V5PBC9Ng; 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 S239000AbjHORzN (ORCPT + 99 others); Tue, 15 Aug 2023 13:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239079AbjHORzH (ORCPT ); Tue, 15 Aug 2023 13:55:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1D361FE1; Tue, 15 Aug 2023 10:54:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 46CA76294E; Tue, 15 Aug 2023 17:54:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 826F4C433C8; Tue, 15 Aug 2023 17:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692122079; bh=v29yDhYqu508UQ8smlIqAL9ArZexf9sYdXW1jtQ2aSY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V5PBC9NgvXb+hUlkV3FwE13f6/nLqmwy1aNbcly67fXbELbyzRsbRD1agQfAJAtIv PD7peKiprOF8VMP06evXjhxI3jcfv0OEfnuR1TXIH/AxlLcBjTxGqYX6qS3ECSoAq8 SLDMiEUShvpiSkTVQ1q4Lblg8Col124/G1uDkJzNSWYYLDTEk+TyJ5V7JlIK9uiotB AvIY8zQIMGrHignUS/FrmapQkxPFfYq6agAW4uPiYL18EgQw+6ygoUZYX1PaP9QTdE jvJADhrcvEuB7Iy1YXyxqfm9jBMwGX136JREc+FvQtdfdHR+Gd7kRoKNYoYWavVZcq cloy8uf4O5Qiw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BAE8F404DF; Tue, 15 Aug 2023 14:54:36 -0300 (-03) Date: Tue, 15 Aug 2023 14:54:36 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Adrian Hunter , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 1/3] perf dlfilter: Add a test for resolve_address() Message-ID: References: <20230731091857.10681-1-adrian.hunter@intel.com> 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 Mon, Aug 14, 2023 at 10:28:29AM -0700, Ian Rogers escreveu: > On Thu, Aug 3, 2023 at 1:51 PM Arnaldo Carvalho de Melo wrote: > > > > Em Mon, Jul 31, 2023 at 12:18:55PM +0300, Adrian Hunter escreveu: > > > Extend the "dlfilter C API" test to test > > > perf_dlfilter_fns.resolve_address(). The test currently fails, but passes > > > after a subsequent patch. > > > > Ian, > > > > I think this is ok now, can you please take a look and perhaps > > provide an Acked-by or Reviewed-by? > > Sorry, found this in my backlog. I'm a little confused over which > patch series is current but they all lgtm. > > Reviewed-by: Ian Rogers Thanks, applied. - Arnaldo > Thanks, > Ian > > > - Arnaldo > > > > > Signed-off-by: Adrian Hunter > > > --- > > > tools/perf/dlfilters/dlfilter-test-api-v0.c | 26 ++++++++++++++++++++- > > > 1 file changed, 25 insertions(+), 1 deletion(-) > > > > > > diff --git a/tools/perf/dlfilters/dlfilter-test-api-v0.c b/tools/perf/dlfilters/dlfilter-test-api-v0.c > > > index b1f51efd67d6..72f263d49121 100644 > > > --- a/tools/perf/dlfilters/dlfilter-test-api-v0.c > > > +++ b/tools/perf/dlfilters/dlfilter-test-api-v0.c > > > @@ -254,6 +254,30 @@ static int check_addr_al(void *ctx) > > > return 0; > > > } > > > > > > +static int check_address_al(void *ctx, const struct perf_dlfilter_sample *sample) > > > +{ > > > + struct perf_dlfilter_al address_al; > > > + const struct perf_dlfilter_al *al; > > > + > > > + al = perf_dlfilter_fns.resolve_ip(ctx); > > > + if (!al) > > > + return test_fail("resolve_ip() failed"); > > > + > > > + address_al.size = sizeof(address_al); > > > + if (perf_dlfilter_fns.resolve_address(ctx, sample->ip, &address_al)) > > > + return test_fail("resolve_address() failed"); > > > + > > > + CHECK(address_al.sym && al->sym); > > > + CHECK(!strcmp(address_al.sym, al->sym)); > > > + CHECK(address_al.addr == al->addr); > > > + CHECK(address_al.sym_start == al->sym_start); > > > + CHECK(address_al.sym_end == al->sym_end); > > > + CHECK(address_al.dso && al->dso); > > > + CHECK(!strcmp(address_al.dso, al->dso)); > > > + > > > + return 0; > > > +} > > > + > > > static int check_attr(void *ctx) > > > { > > > struct perf_event_attr *attr = perf_dlfilter_fns.attr(ctx); > > > @@ -290,7 +314,7 @@ static int do_checks(void *data, const struct perf_dlfilter_sample *sample, void > > > if (early && !d->do_early) > > > return 0; > > > > > > - if (check_al(ctx) || check_addr_al(ctx)) > > > + if (check_al(ctx) || check_addr_al(ctx) || check_address_al(ctx, sample)) > > > return -1; > > > > > > if (early) > > > -- > > > 2.34.1 > > > > > > > -- > > > > - Arnaldo -- - Arnaldo