From patchwork Fri Jan 20 12:34:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 46314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp172701wrn; Fri, 20 Jan 2023 04:36:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXvv5rsAN1Y7E/SYYyGkVPMUEzTz390GrNcxFXxOuhXeUpOY4UneEg9a//JmbVCQ0VvSnME0 X-Received: by 2002:a17:907:96a2:b0:7e0:eed0:8beb with SMTP id hd34-20020a17090796a200b007e0eed08bebmr13671348ejc.41.1674218182367; Fri, 20 Jan 2023 04:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674218182; cv=none; d=google.com; s=arc-20160816; b=gMyDZ+bCKM4yAki2vgZBIBQqaeQs6qmZJi5hPofKkYIA81ieghklDg7qEG0YFUQvDO iDoOeRHCRgpdHNWo6X/QWEibeV7anurNN3n7JUrxuPd1SiXHWnLCGSLbvj+x1u7prkuy NpdrY+I0BpPf5nazUAJrLCi9rbFdJdZJgzb/jclsQiZajaT/AymnsoOlZ3o9FdQTXN/+ zD2VWSZz/18IhLniXVX130ceA8c1+rOgU39p/hSJreNMFqH5nZMShwFVDe3dqIvUySlh fvezQNTngV9dcmPNscXLmBzcu7MctNg0VIuX1uHaSp/CEXJE/wOknyFBmIct2WJkxYG0 yFXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RM9vjN/VAVk9YjCQar6K/xpYLwKcqqeqpYuzXn9Ciyo=; b=TYGdpfNFzh4qLZe930bjuhB534hh9eCPi71K3Up6l+OqCk2l4t6d0LRxqLOetcxjUP bfO6r43nslPDWrR02ClsJE603UWtVWQxNocuN0J5ySjY03hQU3SVgXYTQKznVMdqiP6T WHQ33DJF7+mvdfNwNrf26pTKCnTk0KUCgj4DqwLvhCfuAiXfbe/YKx5B+WymFvpssXDh J0afpjEkpvulM8FfJYNw1tiznoG36II/aFVFeSNYtbTe/usTHBGoOscCrjNCidu/PG89 0BVbbBQTQcJPAGtCOsN/sWpJvzrdxcpTPGFLvJh/GlqrKHi1gchaw6I1lh8E6F7o3H3H v/6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UjkGq5EN; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id co16-20020a0564020c1000b0049e28b8b54fsi12977269edb.213.2023.01.20.04.35.58; Fri, 20 Jan 2023 04:36:22 -0800 (PST) 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=@intel.com header.s=Intel header.b=UjkGq5EN; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbjATMfb (ORCPT + 99 others); Fri, 20 Jan 2023 07:35:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbjATMfZ (ORCPT ); Fri, 20 Jan 2023 07:35:25 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 336DEBC88A; Fri, 20 Jan 2023 04:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674218124; x=1705754124; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lNQ8moBpynyS7kwekoi/lFg0Su2X2visRdfx5+bbhQc=; b=UjkGq5ENE3mNuNGOAA9xH4MGsf9TDKIRKo241TeLgm3vN5dOrRoOch/c 1GkVpWnBe74zE6zjTorqXb7Pd7zYW6XjcfCiYYsdjKKe1mRO46ngIo05M otdF8jZsRrDxdD55DDPZQgKEDAjA5ryh4SjU4Icgc35pMJJnFSeVTb5Dt LIfvumoC5DTB/y7jbfe2fpgLnLTC+GJ+xv1rMgr6cQf6ZDL0TpM/gR1VW 8Jdo4G+/8wC23LHAQSvwIdEkEVCctYiFy9w/WKIffMF/I04odkhJnk4hN YBnWtxSNRUsojTXNq6K2xL8bKt4IEgJWdrpJqoPaqybClwkROqF8maEDX Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="387935204" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="387935204" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 04:35:23 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="692847434" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="692847434" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.223.163]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 04:35:21 -0800 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH 04/10] perf symbols: Add dso__find_symbol_nocache() Date: Fri, 20 Jan 2023 14:34:50 +0200 Message-Id: <20230120123456.12449-5-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230120123456.12449-1-adrian.hunter@intel.com> References: <20230120123456.12449-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki 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_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755545004995264707?= X-GMAIL-MSGID: =?utf-8?q?1755545004995264707?= Symbols should not be cached when there are more symbols still to add. Add dso__find_symbol_nocache() to facilitate that. Signed-off-by: Adrian Hunter --- tools/perf/util/symbol.c | 5 +++++ tools/perf/util/symbol.h | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index a3a165ae933a..a024f06f75d8 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -556,6 +556,11 @@ struct symbol *dso__find_symbol(struct dso *dso, u64 addr) return dso->last_find_result.symbol; } +struct symbol *dso__find_symbol_nocache(struct dso *dso, u64 addr) +{ + return symbols__find(&dso->symbols, addr); +} + struct symbol *dso__first_symbol(struct dso *dso) { return symbols__first(&dso->symbols); diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index f735108c4d4e..2fdeb22bd02f 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -148,6 +148,7 @@ void dso__delete_symbol(struct dso *dso, struct symbol *sym); struct symbol *dso__find_symbol(struct dso *dso, u64 addr); +struct symbol *dso__find_symbol_nocache(struct dso *dso, u64 addr); struct symbol *dso__find_symbol_by_name(struct dso *dso, const char *name); struct symbol *symbol__next_by_name(struct symbol *sym);