From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 234CEC001B0 for ; Tue, 15 Aug 2023 17:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238969AbjHORzN (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@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