Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1495193rdd; Thu, 11 Jan 2024 00:23:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjWKUPvr1lH41EI2WwLkzR1r/rJ/H68NnIdbROEsnJHrLrd+/P4T2rw1dCbnUY3iCy4QY0 X-Received: by 2002:a17:902:c405:b0:1d4:47ea:639c with SMTP id k5-20020a170902c40500b001d447ea639cmr860652plk.33.1704961396914; Thu, 11 Jan 2024 00:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704961396; cv=none; d=google.com; s=arc-20160816; b=P0Ewd8MoyyeQKSZcmKLW7EBpgKwSMxRIVnCzC+oSEam0GyNInhyTDMicrri46DXGBk pmKg6YkBMvaTW+siRmo/HdeohY1xZnAHvVfbB0UG2FE0HZV4hwx0Z95SEJXMLSCbm/HI gm5oj7O1VG6EDPMC6pJ2LKnpqxwFN65UmtASfSJG6GNTiE8EJsIXQy1sYiuJ1x92dO5e vmKZmg4VCQ4vnlk504FGLB2WtyJyctQZfknz+s/Ogn0FvEiDi3pwDRzBM8zePHt251tY RdAc+Ye++tusRmi1mEIviwXyfvKxRQzRgsNo5OKfZrmfNJJdrBbV3PbEUuhe5eFF8cVj E6cA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s2-20020a170902ea0200b001cff34e87a0si618197plg.600.2024.01.11.00.23.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 00:23:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23207-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23207-linux.lists.archive=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 661E32855EC for ; Thu, 11 Jan 2024 08:21:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A90D911737; Thu, 11 Jan 2024 08:20:13 +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 Content-Transfer-Encoding: 8bit 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; -- 2.34.1