From patchwork Thu Jan 11 08:19:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13516876 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 463EDC4707B for ; Thu, 11 Jan 2024 08:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zrFPtx5aagU5xo4i5eVHhwfN3nwM6706D3GC5oFGTzU=; b=ksxl7UQBvXMfCx BWODN3Hunstqbk1IrvXV+oUi0yICOkId+vc7jaLjtuB4Rugsyirr1X0RCOT72EZ+t2i0jvw/DkUrV oHEtYu1QDm4BipfPRDL/I7jJ3SQF+GZcpAlCRtU33s2MlKD8X4j+H0yWuG5tHOxE3bWuS2OtYPVTw Gjdku9sVZ38+87Sk9HEswK/VIWf9HxrGLxUauY1DT+AKPL9JO4wacqX6azoOZfjjVlEaQmOawArU0 whSwI6PrLcxEqd3NDnefMTB8Q6yDl2CYuoOgydqxsbvJwEeaTlZu5lGHSogyfdwJZVou0w6B1E0zc ZoJrWtraSFDf/8nGoTwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNqIS-00GTUQ-33; Thu, 11 Jan 2024 08:20:16 +0000 Received: from mgamail.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNqIN-00GSyh-1r for linux-arm-kernel@lists.infradead.org; Thu, 11 Jan 2024 08:20:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704961211; x=1736497211; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rOhfmpbYgoKrUXXDJ0BAf5fZlUodRZm8hIzBviZ2FWk=; b=RaicXCboP8JjPBxYs4zgPM0uvf6Ui7q96uoV3tVSnPgcDETmzTzn5NWg 5iOzOLjuLTBPqC3qUatc1Ki2mpMB//35I1W57rAzsE8eqvq5Z7kz9BEgZ Oz0YZ3mTiPjxldhzIbpq6PJRkjA3l8NNIh2xf6GfNo4lcAYPe3GRPJUDj svQd+pzGfqg5iThNRYUtArDkvA8elwS9Pxe8f4P3qYVovCKBPpei3t0w8 Nxs+2M5lxVHa35zUZoTNKIRhkTGZ8wELCheRX8WYsQGgCYj/2PdNk6Ydr eorOrUUfyZ0AR6AI6K9uN6WjQ39Dib4tuUqu7gLjP/2mKSdAZ+2sMBJyQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="465166549" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="465166549" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 00:20:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="925923144" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="925923144" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.52.224]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 00:20:05 -0800 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V4 08/11] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Thu, 11 Jan 2024 10:19:11 +0200 Message-Id: <20240111081914.3123-9-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111081914.3123-1-adrian.hunter@intel.com> References: <20240111081914.3123-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240111_002011_706378_BE1B5287 X-CRM114-Status: GOOD ( 17.32 ) 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 Display "feature is not supported" error message if aux_start_paused, aux_pause or aux_resume result in a perf_event_open() error. Signed-off-by: Adrian Hunter --- tools/perf/util/evsel.c | 10 +++++++++- tools/perf/util/evsel.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 2ccfc5c6f52f..5681266acdfd 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1890,7 +1890,13 @@ bool evsel__detect_missing_features(struct evsel *evsel) * Must probe features in the order they were added to the * perf_event_attr interface. */ - if (!perf_missing_features.branch_counters && + if (!perf_missing_features.aux_pause_resume && + (evsel->core.attr.aux_pause || evsel->core.attr.aux_resume || + evsel->core.attr.aux_start_paused)) { + perf_missing_features.aux_pause_resume = true; + pr_debug2_peo("Kernel has no aux_pause/aux_resume support, bailing out\n"); + return false; + } else if (!perf_missing_features.branch_counters && (evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS)) { perf_missing_features.branch_counters = true; pr_debug2("switching off branch counters support\n"); @@ -3057,6 +3063,8 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, return scnprintf(msg, size, "clockid feature not supported."); if (perf_missing_features.clockid_wrong) return scnprintf(msg, size, "wrong clockid (%d).", clockid); + if (perf_missing_features.aux_pause_resume) + return scnprintf(msg, size, "The 'aux_pause / aux_resume' feature is not supported, update the kernel."); if (perf_missing_features.aux_output) return scnprintf(msg, size, "The 'aux_output' feature is not supported, update the kernel."); if (!target__has_cpu(target)) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index efbb6e848287..cb316bba3c58 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -192,6 +192,7 @@ struct perf_missing_features { bool weight_struct; bool read_lost; bool branch_counters; + bool aux_pause_resume; }; extern struct perf_missing_features perf_missing_features;