Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2733696rwo; Thu, 3 Aug 2023 14:11:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFjYmJZra1yc9a6I1npfxKdvbE7IR3wYYjko1W9NuHlQEP64sA10D/ngm0/JEpo4Vd6EPbF X-Received: by 2002:a17:906:530b:b0:993:6845:89d6 with SMTP id h11-20020a170906530b00b00993684589d6mr7939806ejo.47.1691097069647; Thu, 03 Aug 2023 14:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691097069; cv=none; d=google.com; s=arc-20160816; b=WPdQ1TNwa2+SKje8fk3WjvVAMn8uAgUmggoLCb3mB6KD/QRVdLGX8x9cTWP3PZ5u7O Yfl9Pnph5DiJyLoIU+UOkvpK7nUdpu7yIQAn+JQMTSkZK84+ny8TLAar44LBkBh4wIfU pjjchktBJauhFfsfytLjtR2PqcT11wDTDKtnPE+3oWyhPwlJFv0nPIBuH1PLgL0fVbUF rsxn26eICghNao0xqFIxmnnPEOLJkjXV3XpBRNSUCtZ2xojJEuViVWPfmAMBBOZa3ODu /ktJS9tTyjl5AzfbpUjMu8xVDgyHgQHUeTKshXKGRHb79zF1LV31+sfzEhKW5cVlCJNc WIeQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tI/pyehH7rvqZ+odSaqG4r1U3xgDoL8VMCVJOK5NASs=; fh=Aw4Q3i7vpZm+Ze3ZqPwrYm9hh4h1BxpTm9XdcQ836aI=; b=eVhEq5PuxlztT5v8NTWsS1CYl3AujApkK1SowYTpPAzkp52KJr6LRi+japMtPFS4by 8P34CNWd7C3H1Udw6tyQSr02J6VvlnE4qObhSn0vP+YSAQhdFf/kvrWiTANAlW7bp9JP VAPYz/o55kHafHTXefb9lfSrQgFSSnscKcFDmKBc6QKThL29Gzjy4sHLRtEUSVa7PgnN HDIgFF0aKlv3zxyguMBXjWTQK05Gdd/hF8oVwRmHMiqLeFuUsxQ+qStl8JYCNqZnepMl prsHLil951+BFAcNL2X3T20T3ys77bErOnRiUJsTYfQCc8VPAlmsOtThjiE98kgNLkp2 FSQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="TxDyQr/r"; 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 s17-20020a1709062ed100b0099bd39dcec3si505277eji.95.2023.08.03.14.10.45; Thu, 03 Aug 2023 14:11:09 -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="TxDyQr/r"; 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 S231951AbjHCUvw (ORCPT + 99 others); Thu, 3 Aug 2023 16:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbjHCUvv (ORCPT ); Thu, 3 Aug 2023 16:51:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 871E811F; Thu, 3 Aug 2023 13:51:50 -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 2576861EA5; Thu, 3 Aug 2023 20:51:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F0A4C433C8; Thu, 3 Aug 2023 20:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691095909; bh=V7wJi7Pcy7UiUd+kBOXn5BnCLDetBgZyMEtNsqBRtQE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TxDyQr/rp2VehgeKDNILgILbKe2f43HJdbXTkm9VDeoTf/qFkWd5S1oNSTJWBbInf FeG5syK5QK2w7BP79tRjHj8kll/wCvtg7OO78kpTa72GrI6QzsoDvrz/9d1PDLvywk asElkm2RNXb/dxGQOvRx3JeW0LpHuA+Txrnas6XURqIfMsi7VBay9EeFgLW3yr2fq3 4hx3vYPm3rrwDiG6R3FPCmJuAvHrumwloRtlTqO2JVHs6qSOJkPD83y0YQXjcWgcZg kzLI16Q37kP7DOkivNgd6ItfTQ3GoIRxz7JOhjCk26YTnQu0E5TddIp+0IQPpxqrPv 1Nf1z+UMYOInQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 48C58404DF; Thu, 3 Aug 2023 17:51:46 -0300 (-03) Date: Thu, 3 Aug 2023 17:51:46 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers , Adrian Hunter Cc: 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=us-ascii Content-Disposition: inline In-Reply-To: <20230731091857.10681-1-adrian.hunter@intel.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 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 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? - 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