From patchwork Thu Oct 10 14:31:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13830392 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 080A1CF11FD for ; Thu, 10 Oct 2024 15:12:06 +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=kVMBTCr1L5aOLYHOgLK3XpSDpxJ7bcsbeYGEJY9nJcA=; b=EhcHYt5AbZ2Zqoad/PWic9nDiu txbNMrsx5o4t62Z99WRuHAYT/iYjslEt5OzjwKe0VUvSj2tr6lF6WklS/m1/YcgnSou5V9KAi6yh1 3EDM+D/5N1cwjXPwqaKUVS+1yJZ2kxidp4AKeWlLS8oSUNVQszrEkNPfWX1zVp7ctTdXYbyZ/FpRC VU7vyRWnZKtjnILPNbUKKXLS7LFSKrKBBzXbIOfNiBzybx+FrZY5FsX0Xazoy1b+dNe69HJpfx/F4 Q6/l2mcF0bJP0u8eFAHsoeOes8LA3N1PP9wKFYtSmFTN1LajqoGrmT5kylUHUBuw4mB4eRL1V9fYF FG+EAZ1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syupW-0000000DH0f-2KfE; Thu, 10 Oct 2024 15:11:54 +0000 Received: from mgamail.intel.com ([198.175.65.18]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syuEo-0000000D7if-2g16 for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 14:34:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728570839; x=1760106839; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e+48Ut8MyB4QjyHlcLA/pzs7EnBkLPei5N1nhqjrvYM=; b=Dvt7ZFpxYpcqJWiDoXHiWTDLY9BNkIYk5OEyWD2Vqoif0Tiw/x6HCSkE 0W49lvlqlHpHB8eTX2ceSch2iApA72AMclL+EaHtVdr/Rc+DX9sMzTS2n 3glHGlSTeKYWwfhp6SSLhF6RNg2khZ33NF4RGwVvLxL+9p3gkORW/kczM PdZlvHCnRZ4Xjxn8dioMWcz89lN9sWBPU2UFKk/9fCVfTeLPa2cYI5D+B /iOupzpN0/84B8783YUpc7wAwKTI/iLfFoCUeALFXM2UleFoSaEStKj3a 8g/hMdz0Uz9KoiGJxUafK112gbd7/XIxgB7VuUTAgEPFgJ6DC+h0lyVua g==; X-CSE-ConnectionGUID: 5ojFH8qzQ4CaQliJj1LZcA== X-CSE-MsgGUID: 7ASqrf0YTRePlmSbK2rqog== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="28064411" X-IronPort-AV: E=Sophos;i="6.11,193,1725346800"; d="scan'208";a="28064411" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 07:33:58 -0700 X-CSE-ConnectionGUID: zY2H3ocOQsK0SAlNfFqrIQ== X-CSE-MsgGUID: W5PdynkwTVKSFLk7KFi4lA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,193,1725346800"; d="scan'208";a="81189496" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.246.16.81]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 07:33:48 -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 , kvm@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V12 11/14] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume Date: Thu, 10 Oct 2024 17:31:48 +0300 Message-ID: <20241010143152.19071-12-adrian.hunter@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010143152.19071-1-adrian.hunter@intel.com> References: <20241010143152.19071-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-20241010_073358_758933_3407B7B4 X-CRM114-Status: GOOD ( 16.62 ) 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 d34ceab9e454..927aa61e7b14 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2147,7 +2147,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"); @@ -3397,6 +3403,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 15e745a9a798..778fcdb8261f 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; }; extern struct perf_missing_features perf_missing_features;