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: 187228 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1302443dyi; Thu, 11 Jan 2024 00:23:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/QNErZmEdX9epFm+r2wi36uUhkB2HiZaJfyGg5Liz11krLnM2dk3lSq2PoqNdBky7DTXi X-Received: by 2002:a17:90a:43:b0:285:8a2a:1744 with SMTP id 3-20020a17090a004300b002858a2a1744mr646349pjb.0.1704961407158; Thu, 11 Jan 2024 00:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704961407; cv=none; d=google.com; s=arc-20160816; b=wFaXAEGFjT5Obvmo6bFiqOm9LEr9UsyDx7ZaxGTUeHXpopujgGWxRd/pjF2TBRuC6q kw6V0cH6TfgB5GGU+2Ug305D5/kzwKXLXgEmzLyNkDVK8lhsIrctDVLbDTBOKFoXa0Zu dJkzfzyPR/MBbYwbDi9YFrQrv52M3dbjYV9Y+kCtj5AReZ5fAJpQTOLxS/V8dClXevPu vy4W8Ke/ItzrQvNVSiRfc8GmSmZZl1SKl58oVkLlYDxG69JIthkelCsSbOPqVzFs8W4a XolSFljwqFOWFdjaT5E5OxnlGKWLV6WvnYMLQ7PD/E+EAvE0o1wo+P6BZQPyijElP30B Hvzg== ARC-Message-Signature: i=1; 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=sPW/ItapwRn5BcUT6xhfqAvhv3we/AoFysFC3Xg1sUM=; fh=cd6f3jNh3j7Qvd5mXmd/oCoIQnwAYeKd0j29JiSirLE=; b=WNY8h0Wef5npwarD8u/qpamZUwoVFjEfnOtxytE6f/zi4MAQd3eJSSgv+rfJmTXOhO ZDkwTmpkGFMMJ7XQnHrf2NBnpuW4WLymGw1V1DG7vUaS4wDuBf+9avIJTFokaAYW+Jq0 RbdRi7fkUtRvUN3TJy+QSzVo3qa6Two53m4mAlIj2LEqvcZi4GR8GLP42rKfFZpb+dJK ory6q1vgmYmtI8MCQ99ZJ7HizlvqLh+60mhT6K5czZKaqBr1byMzu4OYtnvXjmjfUxBX usuZEy4982LXdAcqGqaNRoALbGgM2FXabjHgIeHc2nElqyOCdvcSsfoQZlELUPOWTkXh bjhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RaicXCbo; spf=pass (google.com: domain of linux-kernel+bounces-23207-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23207-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x13-20020a17090aca0d00b0028b62774a1bsi3263816pjt.125.2024.01.11.00.23.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 00:23:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23207-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RaicXCbo; spf=pass (google.com: domain of linux-kernel+bounces-23207-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23207-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E5F71287F8B for ; Thu, 11 Jan 2024 08:21:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83FCB12E47; Thu, 11 Jan 2024 08:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RaicXCbo" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (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 88D8711CB8; Thu, 11 Jan 2024 08:20:11 +0000 (UTC) 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=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="465166550" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="465166550" 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> 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: 1787781612669404847 X-GMAIL-MSGID: 1787781612669404847 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;