From patchwork Tue Oct 22 15:59:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13845966 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 2BCDDD2CDFA for ; Tue, 22 Oct 2024 16:37:03 +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=v/J1p3U+BOPIhIAos7tRcYiSPi6HxMji3PnbpE9ntG8=; b=QD3m8ZN9uTE0Nz2CfgHq1oVDVH 2zXGhF7A2ZwMsK1Bb5u/34Bw7xj81HHltvmnBrUK39XjDVxuFyLa4D4YUi6oejPAc70MvH2aUFy1h 6tndl3p80gpKdFQ2oP5N2NGXDrb6Va+xJE65SWN/efAqWA9+8+PwrOB5zw8njI62gGnMrn5rfCWxF V8GHNyF6htcPEE4umQE1lqBPSwUqbBKaULQnTKMKQLBKiT9YMU8wY7oDWxd8XFFOQnaVLFBwRWfG+ qNZBYt8Vfb5HtkjVw2H7rHgaklV5CdwfGAo2NjIOq0dPNbWvEizacFOWUmyGqqPVsjW+tisqMnR0Z wmVZkTXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3HsH-0000000BUUK-3whE; Tue, 22 Oct 2024 16:36:49 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3HJQ-0000000BLvY-2y2n for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 16:00:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729612849; x=1761148849; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E+8Aa9jyAI9q9zAoy3PHOZCEhyfbGlYPdlZudFdxdfg=; b=bBmnZ47tsT9Va/o32Y2hWHASVJ5fOuBPFeWzOiyjTHBf3v49N/YMpLnG vks8xYaqqGJQBu1fd7MJ0HHyNHGuqP/a8VUonCVyKSaNoLarzn6jcVgaq 8dn8RdW1UjEFbGG4crqgm0yOl6qcu2R2PPhwu/Ms+N07GmikiWZRX5hKV V4ywtONOVM9zUk57Pe88qqTkG1oNZcn7AN4/BkndgPz1u9LCGbGq1j8es rtdn0G8M072r+fmYxOOBDIFMH1CeMIDBQ3Yx4ZZ3qidjvzlS2Nt33INHr XYJwbk6BFhOz4mpiv1ULrREDW8qt/kx8F5PTFxCGKvHgl0Rm7ezjtrv+G g==; X-CSE-ConnectionGUID: 3rQrtVUQTxu4HiLK+bBgWg== X-CSE-MsgGUID: 8UDKMVKqSEyw9KpzuoRh2Q== X-IronPort-AV: E=McAfee;i="6700,10204,11233"; a="29271075" X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="29271075" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 09:00:48 -0700 X-CSE-ConnectionGUID: XoTMTwC8T42T0qY3NZQvpQ== X-CSE-MsgGUID: Dh9UCfcNREqJ58L/+TuJ2A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="79858761" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.ger.corp.intel.com) ([10.246.16.81]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 09:00:40 -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 , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, H Peter Anvin , Kan Liang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V14 08/11] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Tue, 22 Oct 2024 18:59:14 +0300 Message-ID: <20241022155920.17511-9-adrian.hunter@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241022155920.17511-1-adrian.hunter@intel.com> References: <20241022155920.17511-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-20241022_090048_787195_B4CABE1C X-CRM114-Status: GOOD ( 14.22 ) 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 --- 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 95593b55d9a7..88b31a005ac6 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2102,6 +2102,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; @@ -3279,6 +3285,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'", @@ -3309,6 +3319,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 9fcaf417b277..87135012217d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -205,6 +205,7 @@ struct perf_missing_features { bool weight_struct; bool read_lost; bool branch_counters; + bool aux_pause_resume; bool inherit_sample_read; };