From mboxrd@z Thu Jan 1 00:00:00 1970 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 017D4D1625C for ; Mon, 14 Oct 2024 12:47:15 +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: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AhDE6RFKEKJbFQmqW3J0ZzGBCW6YAQqeFz50rWc3lJ0=; b=QbHTW/4VuHmbq/69hOpf859+fc zAvbOLuftpjSAmhAcHLP4oIhQ1XXs46heY/18QkzqJvbYwJU4pAkxCEsZ1fSgbUT9YLKY6Nir4MGM Gt58GD6rslbqjPMQ0eQdlYHHVdgzcOpE7GGjZnsEUOAbiMpXbjLluCeqIbd7TTTXfpN9JrOzQDzhJ pPjHg5QPCpZTCHVI/2iFh4wfASzKz8CixWhZwmKlJIZlDBLbBYjX3hWgaGpiBxDQe8eOm30kdvl5u NR59Y7cdcYuUpsPXGPkdahwN5H3uiNaI3i+QM+UpMB5UxGBHdSDLDhRF+Sgjst+YoHo0lbr5b9b5G pt1v4qhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0KTa-000000057sP-0G6F; Mon, 14 Oct 2024 12:47:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0IyE-00000004r8E-3eya for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 11:10:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 49AFC1007; Mon, 14 Oct 2024 04:11:06 -0700 (PDT) Received: from [10.2.76.71] (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E88E13F51B; Mon, 14 Oct 2024 04:10:31 -0700 (PDT) Message-ID: Date: Mon, 14 Oct 2024 12:10:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V13 11/14] perf tools: Add missing_features for aux_start_paused, aux_pause, aux_resume To: Adrian Hunter , 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 References: <20241014105124.24473-1-adrian.hunter@intel.com> <20241014105124.24473-12-adrian.hunter@intel.com> Content-Language: en-US From: Leo Yan In-Reply-To: <20241014105124.24473-12-adrian.hunter@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_041039_098112_A4EC0A6B X-CRM114-Status: GOOD ( 19.73 ) 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 On 10/14/24 11:51, Adrian Hunter wrote: > > > 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; > }; > > -- > 2.43.0 > >