From patchwork Thu Feb 8 11:31:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 198326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp100702dyd; Thu, 8 Feb 2024 03:35:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUZmeZ6Kj9kDGfYw7QXbBaNl55ywvRlA7znLdkSTNAur01FsniIhC0RE0wIRZA6nzLwkYgX/4+VlnH6um1O/fG515EANg== X-Google-Smtp-Source: AGHT+IF1yLi4nnnG+F6g04GtB6xbDrKVgkBSAh6mqkWchENojgvzKyJwtfQuuz1CBtUEfoggpONF X-Received: by 2002:aa7:df99:0:b0:561:12a3:fe64 with SMTP id b25-20020aa7df99000000b0056112a3fe64mr865030edy.9.1707392113899; Thu, 08 Feb 2024 03:35:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707392113; cv=pass; d=google.com; s=arc-20160816; b=bI0IamNWFCvwuHfioZytsKubdC0OcpaXy69tQBF6vftbDA++T2PdIVbRw7PfPmFXGI 33pA8WBiWN001MvrPZHJUjcJv3MqfK2Dy+aOWO4n7E7VC9Vnwf2rTgE/E7UN99qSWtn0 +jWog9OYcAqVeXmGEg1piQpkKJS6IRUaHay6WbJjC+xFooPSj/W60WMpHju7R68sOt2a ACyUl6WJdKvVLjTiMjUAEsvwvq4ftsCSN3NsH6oniAZTNm/DMx8dvP0r+cZf5cyTb4gd 9lJDj3EMqE+ZhMZQSw3hNfumTweDjt5PNQUb/gUIcuLRaLKbCyU6a9I+q4vTNoSr63Jc v89A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=n3qsVDGtKRh68lOkPnCuMAbofKTly6NAF87a/UKM40Q=; fh=IrHYFXc1IrB6ULYaQMYJ39hYn0TaFMfSmwzkkkrJKs8=; b=JaI0LlbZbsOzjzZkpFZoUaohghwuNUl/YD2ramD8Kx8TZs/sPbIs5FLqpdG5Cccyf+ 4WXKYhFAVH1hajBPhBoKYRz81wojq8q5ioWvZeeySDoN6Bvuoe1yP7MaSkKasOuLCvbL /lUXd9Zh4GzlWjfwGIGqSlA4uB7+nQdb5pUFM72LGJ0jWrxOj4M9koJCZ6T/9h+hW5ti nl5QYG/WiRCyXv6oVJWr4hCb50pcYqyM/vGD7CeXfrTCIpibw0+RnTR8mVD/MzYpIeeV M8/MJq0pYu6D6F+rW4eLZw4j1M3GZ45oSdM7vgaS0gsiBphkqrSFB28H65m0j52HR7od jXnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="dYH+3/b4"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57969-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57969-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXH9l5G1FuhzZ5QRO/mcdPsv4WT68WqFgSOE936otPamKXWPBMZ1dd0lre2Sa2BzR0jDAST8nORJ6NtchPxfwGxfWv9YQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u16-20020aa7d0d0000000b0055eeadefccbsi754407edo.654.2024.02.08.03.35.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:35:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57969-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="dYH+3/b4"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57969-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57969-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7BE9D1F2888E for ; Thu, 8 Feb 2024 11:35:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9A26768F7; Thu, 8 Feb 2024 11:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dYH+3/b4" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78B8076417; Thu, 8 Feb 2024 11:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391960; cv=none; b=X/iIpJBk747gTR+dHECkOkh1TOJ7fKeKgw5di26KP7APFdMKnRV8t5N1NLxmLf+MUB/sy1M0txWIvpMa1GQZXU1VbNDQaiDCu+yzFxZnDUOouV8ib/KjZkXneeCC8pG8okkRMSzWhDyHwU94d4+y9ZYWvSKaPD/9IL+wN7xpOsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391960; c=relaxed/simple; bh=6DpUpJ1gq9LuRkJBX6BDqLjCRgV6K9lzl/yGpxHeMUY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aq+O9sQEyg+HHd2VB5Vai0svyu6q0U2DKqr9BI3lCp/4siqGdTw9qVY7dDma3Bh3aH+O7RchBsO2SRfrloFaPocMc4hjqx9xJajFNGZFpmxLzMV0Qvzc83NwF5i/ZicpDs57NDzYtGPQkbry6P1UeFfwUlB7zcDMQtK3Ok/dRvc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dYH+3/b4; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707391959; x=1738927959; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6DpUpJ1gq9LuRkJBX6BDqLjCRgV6K9lzl/yGpxHeMUY=; b=dYH+3/b4lPFYwf5TIXEWpSBEhuDlIADspzz3xdS+X6YAVX0RL5LqFvyO r3H9bSmyDOnbZ+gAEI5ojwNifr+EucrsjVynxn/Hl4iradG7Zj/X76enE dM8PdixUvR9qB3ARKnjZ+HjeLPrdJKvAfNfbidCzE9+GHJ5nngP/2op7L 12Mm7nB9XX5YuThTPO7XwP9S79duUzTezgxKuAoKu95RC+jHAEfB+e7G5 OCAQ4PESi9NbD1+9DUttKpYc16rEVUHFSBVreEqfHb4CPk/VB4jA1eoWC 2oixvukn7ppFGHqWxhShK4y+AJovBTR3fL/k6YrreMqmKFH6WQu5fcRbL A==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="1345710" X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1345710" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1957714" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.219.88]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:32 -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 , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V5 09/12] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Thu, 8 Feb 2024 13:31:24 +0200 Message-Id: <20240208113127.22216-10-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240208113127.22216-1-adrian.hunter@intel.com> References: <20240208113127.22216-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790330393448788473 X-GMAIL-MSGID: 1790330393448788473 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 --- 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 8401685461bf..9d2fde919604 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"); @@ -3089,6 +3095,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 517cff431de2..8ef5a6fdbd45 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;