From patchwork Tue Aug 6 15:55: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: 13755196 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 1DFD5C52D71 for ; Tue, 6 Aug 2024 16:02:17 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qGtdEFCTBsHm2z/13Y6GzMl1ISBAmlMHSfvPBK+7dEA=; b=uMI1rZxH/GsmdSZ9zjLC3QPuMO Jkd01uFU5x1jiwb/KGmBYAvrDl4Q6ck7Hq9iO6Gj5XIR0xI9AEDsnD6Z5AYa4DKc6GfMGbe9K3Au/ c59MDKSy/5UBQvOTnr9dAxp1+RoIxZ9wF76rrbhxoTIdCr2ey/CpxiFdwkZFESREiejCa/jKjw2yf PS8p0mbMVgfv44EJF5UzQ+nIiNMSNGEkGERsg2nlIz0cQNyZsCMFymnSeU8zSVGrnTAPpGlokiJ3r XQ6A54se1vgCXcWp92wIsZGu7mpjLHayCgtZ4KBuGOLhzGuTv7sL5LMGs7Gh3GRj5e9ubM9yPef3k VZRXOTuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbMdQ-00000002HBF-2dsK; Tue, 06 Aug 2024 16:02:04 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbMYp-00000002Fms-1I1s for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 15:57:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722959839; x=1754495839; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rYla/CIs7On6YzggSgFMLvRtaI5JJQYxImdMCRGvFkc=; b=FB4UG2UVJtM6gMiAQKYGdQcY/rjyWcBa3sXEFEp7ggDSXCGPjVSE4WDs +3iWuPF8qHAsZa4XGQ0zh9wG9G1wpXJ8/MLvcqzOr9hqbVI0qGcbUN9e0 efjlx8GZEAgP21Xg7ky/SvIV9lVdTqUHj0xYQn0cJ7BGHRldnllEdQNRk rrXYGfk5Bhg/NY1dafV4RUH1wChVGlU4qPyQ472nQp9FHjZt4qrAQEDRB 6MCdM9wSxJTUik1bncflbUsm1u7D78+TEI+e/oWDum/Lcbjge02PUGU8v oHmRDCSfO9fJkICLGw8+nXTNferVIeNeeDVz8o4S7rV4tckGYnZrSbBcY g==; X-CSE-ConnectionGUID: m5Hmwz0XTLi9v8CeEGAQoA== X-CSE-MsgGUID: oABx4TO+Tu27Ai60fsZT9w== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="43514217" X-IronPort-AV: E=Sophos;i="6.09,268,1716274800"; d="scan'208";a="43514217" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 08:56:14 -0700 X-CSE-ConnectionGUID: aNbjtSaBT6C5UTVG0bTOqA== X-CSE-MsgGUID: w0KlU80PRFK/N1EC2J5FvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,268,1716274800"; d="scan'208";a="56631332" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.94.248.17]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 08:56:08 -0700 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 , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V11 07/10] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Tue, 6 Aug 2024 18:55:11 +0300 Message-Id: <20240806155514.17900-8-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806155514.17900-1-adrian.hunter@intel.com> References: <20240806155514.17900-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-20240806_085719_757400_5DB5C9C0 X-CRM114-Status: GOOD ( 16.63 ) 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 Acked-by: Ian Rogers Reviewed-by: Andi Kleen --- 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 cc2873131093..3aa90054de97 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2078,7 +2078,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"); @@ -3324,6 +3330,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 80b5f6dd868e..0b0c847e776d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -206,6 +206,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;