From patchwork Mon Oct 14 10:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13834752 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 8ADBCD16242 for ; Mon, 14 Oct 2024 11:07:25 +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=/oZ0LwYDMp4MznsrFnLwWzsoxWmIrrn8dFfzGK2EYxo=; b=qDQEpyrtWODuvVY5BpeGVQ/S7D z23+wuLmpj56ROR8kcsiFCJe0A8jzgCFOpXtVzJegTxhK5hZEH10bObsPm1q2/4I8cinxVS94wgXG OKDg55+G2iGqjaUAnJyfuPXh2JY3wDrqbHEcGC4prpmjeFzlyGni8euCDIQTieSZwRSAZoOcIsgDg k1Vf9MT+CCVJsJ8SyPNNVAaCXrUQbUWtjWpCW+A0pHy3WK8pY3flm7EufcUmpS5ekNU/xaxP8G2Ej UF7KteLlW6kGtTSJKw5T8gS3VqHZtTjf3JH2l0lm8rj6J0DltLsVRP6B/FyEz1vPR5Hq/0o1GbQ8x T0d+yU/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Iuu-00000004qDi-1rdM; Mon, 14 Oct 2024 11:07:12 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0Ihs-00000004ldv-3lAa for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 10:53:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728903224; x=1760439224; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Xapmrgmg/ZiUC03GXXM+hUQmQNhKOBc4ORSHm821xOc=; b=TFYBxSyqKjy7HlhTxd5r6/TkGax6cGh59QvuDczibpOSxiJYsHddxUJw yNhWUZtE84chck46dMshajCFSBHzKvl4a8SglhsxF4d5WMLTaCF6TeFhA QiLJMVihud5Whgf8WNLXncW84vDj0xy1H/7A6rCdo9wZb1Xu23rdLxAab qtXGQbdKCYc9p7f+2WzGpFVEapT0UyKIvsg0pCYvQNlheQQic9OyrzE6x d3oQNqwN0sICF1PHRExdGL8bkw1Bf6hXOJucca5BLcfTNf+twnScpCxtE WC7hqBqd1EssUBj2o3YFNA7YJSuixidynWcxt3ZAB6SjeTLKckYcQXhGU w==; X-CSE-ConnectionGUID: dPz08p1KRWO0rJZuvNmy0Q== X-CSE-MsgGUID: 9BfF5ld1RJOKvSr2rtI2yA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39366379" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39366379" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2024 03:53:44 -0700 X-CSE-ConnectionGUID: 5hjNC/cvSHu7a8Xnij7aUw== X-CSE-MsgGUID: yF50NB1QTRWI+v+Ze9X7og== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,202,1725346800"; d="scan'208";a="77727535" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.245.115.59]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2024 03:53:34 -0700 From: Adrian Hunter To: Peter Zijlstra , Sean Christopherson , Paolo Bonzini 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 , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, H Peter Anvin , Kan Liang , Zhenyu Wang , mizhang@google.com, kvm@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V13 11/14] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Mon, 14 Oct 2024 13:51:21 +0300 Message-ID: <20241014105124.24473-12-adrian.hunter@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241014105124.24473-1-adrian.hunter@intel.com> References: <20241014105124.24473-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-20241014_035345_191231_DF975F0D X-CRM114-Status: GOOD ( 14.51 ) 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 Reviewed-by: Leo Yan --- Changes in V13: Add error message also in EOPNOTSUPP case (Leo) tools/perf/util/evsel.c | 12 ++++++++++++ tools/perf/util/evsel.h | 1 + 2 files changed, 13 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 9621c8c12406..fd28ff5437b5 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2177,6 +2177,12 @@ bool evsel__detect_missing_features(struct evsel *evsel) perf_missing_features.inherit_sample_read = true; pr_debug2("Using PERF_SAMPLE_READ / :S modifier is not compatible with inherit, falling back to no-inherit.\n"); return true; + } else 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; @@ -3397,6 +3403,10 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, return scnprintf(msg, size, "%s: PMU Hardware doesn't support 'aux_output' feature", evsel__name(evsel)); + if (evsel->core.attr.aux_action) + return scnprintf(msg, size, + "%s: PMU Hardware doesn't support 'aux_action' feature", + evsel__name(evsel)); if (evsel->core.attr.sample_period != 0) return scnprintf(msg, size, "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'", @@ -3427,6 +3437,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 bd08d94d3f8a..d40df2051718 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -221,6 +221,7 @@ struct perf_missing_features { bool weight_struct; bool read_lost; bool branch_counters; + bool aux_pause_resume; bool inherit_sample_read; };