From patchwork Wed Jun 26 20:36:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13713395 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A07E2C27C4F for ; Wed, 26 Jun 2024 20:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:From:Subject :References:Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lcJ2tbGh1Yfs0OJM6bkJDG9fBvcliigGM1tYWqZJmL4=; b=xUfjO5yKI1DymFViCGGBZBT1hD sJHVwu3ngOl6oYgTx7x6gwN/jbT7CLH7c9MZ1XaGUw3Jg/a2yda83+cE0hkHp5FUXyfQCzKfblgzZ x7OVMDPHuXKAlfEKMytUNYy7CBlOQzbn5UrC5gpEfJDyCnffD8zQs7wMTk7hElQtdT4DKuOfzS1Cz XlBeOgeMaiGbBIQIftYauRsdvAgcz0ojCJtsW3SfFiEvJbCpwAZBZDsDAPtyZ6yOrqOusFNtZinF6 a/xjLPezq7hhZYMIzAiTJXNZxzE3SLtwA/9TS7xyqKSDw6UAcb5OYGfubH+jl0LsLQGpTSNDEcmPh 2JVigNcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMZO3-00000008FGc-3x6F; Wed, 26 Jun 2024 20:37:03 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMZNk-00000008F6c-3GoR for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2024 20:36:46 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-dfa73db88dcso13883227276.0 for ; Wed, 26 Jun 2024 13:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719434203; x=1720039003; darn=lists.infradead.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=lcJ2tbGh1Yfs0OJM6bkJDG9fBvcliigGM1tYWqZJmL4=; b=NEqPLW19iwSJh4GN51SKY/NBPaoZlNSwp/qZjfiyhXm6aUHtfcQwMjnl2oFHq5ue2q aK2Aggml4YEhzdjHWH1bDFUksHFhJv5ussAPzr1AQrzR7qn7rlVq1wVg4T7lR4JCqdVE prpNcERyjKpGG+daUapLwU3kP/rAympxPrI8uVz0qgdESOHtgMOcmbjOSOLVApXmBNHc exB/X6VdoGifMY+g9g777sAgvrtZR1papfk5z8X74NQRtmx/ts+UuT6OmOkAKHJfzDl1 5/QTuUJFo9JgljVV0RTxsWXNVj1duUjj65e6dtmKWRbBkTzzPcWXCby8iGh5+hSZ8aRr fCDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719434203; x=1720039003; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lcJ2tbGh1Yfs0OJM6bkJDG9fBvcliigGM1tYWqZJmL4=; b=uFi3Qkzw7XFWHbTVueMAOSUVrJhM0pI8NW5X9XU7a11k35HXH1r+AL7hVoL2YjHtNK jJMSol3pKfIGROCFld7i/EHmUPau/tczPZ2Mx0GN+VXq+A/w/zywhL40EOFGLQF2ptmd YaINFPLQnDpH0ZhhRWcr6D+jljfPL2biFHGCIP/gLUMFDaUXgPDolum9kct8iFZuw8d2 GeCZl+uknVvHsc3W78wYW/p4DqcOEoBF9MQe5sOkFarXufesv+6QWapSAp6QluO43zeZ P2ldpGJZDE42QjCZ6JMI5ejr7VEXWhmq9gYydMkloE94+EYafa4EuWVzkwQBsZT0uKcg rvKw== X-Forwarded-Encrypted: i=1; AJvYcCW6GB1Evs5hNU+zlXUEIi1VH99ELvVlVoKHMR/Pbs8EWXLeWdvMvdSuVjywuE9EIj689af/QhmRmZ9MihguoCnj1e9QV+Bb1vLVx/8YeDrjOPyeUWo= X-Gm-Message-State: AOJu0Yy0ibWOp33G0Co90ro+IQImTvzxfRBNbyeVWh6g0nm/Wm4iuM9n 2SuUDt/guIhdSTrlxNvmwsTvX4UZHgYD6xmt2OvgeFytSYUZaR/VWh2Z6R+CR24xhTwYfjABu3U LCnjw1Q== X-Google-Smtp-Source: AGHT+IF1ujd8fnaq1c9+yRQXwV8wiVuEn0TIgaMmQb8DJtqM0t0gj5rgMA3or/ZxmEcUAkhmByF2yBScwXbC X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:23a1:25b9:2412:56de]) (user=irogers job=sendgmr) by 2002:a05:6902:f84:b0:e03:31ec:8a25 with SMTP id 3f1490d57ef6-e0331ec8b21mr6829276.10.1719434203172; Wed, 26 Jun 2024 13:36:43 -0700 (PDT) Date: Wed, 26 Jun 2024 13:36:04 -0700 In-Reply-To: <20240626203630.1194748-1-irogers@google.com> Message-Id: <20240626203630.1194748-3-irogers@google.com> Mime-Version: 1.0 References: <20240626203630.1194748-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Subject: [PATCH v2 02/27] perf cs-etm: Fix address sanitizer dso build failure From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Nick Terrell , Nick Desaulniers , Oliver Upton , Anshuman Khandual , Song Liu , Ilkka Koskinen , Huacai Chen , Yanteng Si , Sun Haiyong , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_133644_914601_0DAD170D X-CRM114-Status: GOOD ( 15.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org cs-etm.c had been missed from having accessor functions added for the sake of reference count checking. Add the function calls and missing dso accessor functions. Fixes: ee756ef7491e ("perf dso: Add reference count checking and accessor functions") Signed-off-by: Ian Rogers --- tools/perf/util/cs-etm.c | 10 +++++----- tools/perf/util/dso.h | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 9fd2967d4e3f..e1a7eebbb15f 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -1013,7 +1013,7 @@ static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u8 trace_chan_id, if (!dso) goto out; - if (dso->data.status == DSO_DATA_STATUS_ERROR && + if (dso__data(dso)->status == DSO_DATA_STATUS_ERROR && dso__data_status_seen(dso, DSO_DATA_STATUS_SEEN_ITRACE)) goto out; @@ -1027,11 +1027,11 @@ static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u8 trace_chan_id, if (len <= 0) { ui__warning_once("CS ETM Trace: Missing DSO. Use 'perf archive' or debuginfod to export data from the traced system.\n" " Enable CONFIG_PROC_KCORE or use option '-k /path/to/vmlinux' for kernel symbols.\n"); - if (!dso->auxtrace_warned) { + if (!dso__auxtrace_warned(dso)) { pr_err("CS ETM Trace: Debug data not found for address %#"PRIx64" in %s\n", - address, - dso->long_name ? dso->long_name : "Unknown"); - dso->auxtrace_warned = true; + address, + dso__long_name(dso) ? dso__long_name(dso) : "Unknown"); + dso__set_auxtrace_warned(dso); } goto out; } diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index d72f3b8c37f6..878c1f441868 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -280,6 +280,16 @@ static inline void dso__set_annotate_warned(struct dso *dso) RC_CHK_ACCESS(dso)->annotate_warned = 1; } +static inline bool dso__auxtrace_warned(const struct dso *dso) +{ + return RC_CHK_ACCESS(dso)->auxtrace_warned; +} + +static inline void dso__set_auxtrace_warned(struct dso *dso) +{ + RC_CHK_ACCESS(dso)->auxtrace_warned = 1; +} + static inline struct auxtrace_cache *dso__auxtrace_cache(struct dso *dso) { return RC_CHK_ACCESS(dso)->auxtrace_cache;