From patchwork Fri Jun 28 06:51:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13715546 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 93208C2BBCA for ; Fri, 28 Jun 2024 06:53:05 +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=bNLJCFZYiC4AutOFxhsMgFtr4/ /UgGkBjJXA5b42gbcA+DYpchuq3GzwZ0w1ias7g71b1XqUsy0knC+now/TERaEBsB85R8jaNEbUKX tql13bezHB8nZK0XuiYYiL0QLD+6KRXyv/dhgi+PUaVlt2XBACzEArO/Jwgm6eV6ltRKjhJA54oJt Fs0NEwTzva4VwNURFtq/lYaVRQQl95icuWA7/lsI9JSck+shQVvB76J2FlHbW/0fSS16wwuXtpYcX FyL9DkELBEOxUxhJsTtLAjFLq4Sjxd0rmBur8mq84IkO1AdHas5UiNSGCiF/VAY50DjK6VfZX7r0g OWQYGGsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sN5Ta-0000000CoSF-14b3; Fri, 28 Jun 2024 06:52:54 +0000 Received: from mgamail.intel.com ([198.175.65.16]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sN5TA-0000000Co34-2EBG for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2024 06:52:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719557549; x=1751093549; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rYla/CIs7On6YzggSgFMLvRtaI5JJQYxImdMCRGvFkc=; b=ZAYLM1Gf+gWAFswuIGaAVwS7fHa/ynH+THewUmbRNIZC3nkteqg9nVde AzfWFl56ZA+Q9dU9W50oYCiZwjMOEVrrih5jb5TDfJZdaZOCuARe/hx9J 5v2/lD/tii0Ks21GMDIvCrmOGM32YJcVlnM75F6y2ZibH8aIztb7yOBkL L3K2K7UOmwz/SG7KJY0YC2lt+FPScQ8Xp6UEkz56QAa9bnhE5V0j9g2Wm qGmlqtxcLF41XwjT6thUCX58Ou2dOgmmtUm3gmekc5liQ+EsfXYSg0NbF S8S/oBAxHcB/a/DAZJJVlAMJC1+6y5Fva47V4NElT+RUmuSYCML7qPNM5 g==; X-CSE-ConnectionGUID: LRYQLI5DTdqbBvj0bthnZw== X-CSE-MsgGUID: OvnMUUYaQJqwuVXPKQ4jog== X-IronPort-AV: E=McAfee;i="6700,10204,11116"; a="16857258" X-IronPort-AV: E=Sophos;i="6.09,168,1716274800"; d="scan'208";a="16857258" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2024 23:52:29 -0700 X-CSE-ConnectionGUID: F0P9f+Q6QjCPXpJLFaP9Iw== X-CSE-MsgGUID: f/mN6Ox0TPKEik6BlDpD/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,168,1716274800"; d="scan'208";a="75386730" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.246.49.253]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2024 23:52:23 -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 V8 09/12] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Fri, 28 Jun 2024 09:51:08 +0300 Message-Id: <20240628065111.59718-10-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240628065111.59718-1-adrian.hunter@intel.com> References: <20240628065111.59718-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-20240627_235228_679891_337EE5B2 X-CRM114-Status: GOOD ( 16.56 ) 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;