From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C0B5615ADAB; Wed, 16 Oct 2024 04:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729053230; cv=none; b=fRDAAhqNAKUGvaX0TyLAjcN7R0uQIpfsTUG28K/61zAv57eagMornZK9G5zjsgF4+dgb7U2fgJJT7228hT29Jxr/uPIaNZJt5fXKskNP8beZKhv9WWeCJNJqKoStS30bNRdVmjiaCQLJzWXrjYn80vcYxhlCYV6Dhbnn3Y2pMDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729053230; c=relaxed/simple; bh=mxN1mIPcd+XN1WgRJWJbfYMuGgJol8BgcGHoph5JMJc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Gfgm1edVds2Qxs9jX+bNNFHB1wTj7PjT2C0/MjVXy0r5tCEtcMmWJasGbVyBWeclaa2N6c7LxXA8488rrC5xHTtr/oSB7mnmqv194knDLfQ4mG/WxG69LXCOVVFFEqJbVvRYTNFn/JYOopTnKB42cdbKDXRHDuuIv6A0aNKiQqs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KqhVFIMN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KqhVFIMN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77E59C4CEC5; Wed, 16 Oct 2024 04:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729053230; bh=mxN1mIPcd+XN1WgRJWJbfYMuGgJol8BgcGHoph5JMJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KqhVFIMNlP5lAvTRuKZFD6YdhXUdMHgY9l9RKh+pvC293g77AICr4X8HFWzPvS1mZ dzT4Cn2ADbd7dBwK7PkgBqZk3f8QRnBKdZM/oXBBPeknl0mi70nmS5++Mc8/NZgiRh XUmoXGBpa2wEKVaCLNYY7f2xlcbh7j8Lz3mYTu45qoQR0LxbkOam2C6qS748Tu/IH3 5wvR7n9elpahHidxVf42a2zwRBLPtVFsLj+MyyAp2ZWXhLOQ5wXM+NQZqVp3gAmmfv g9YSMOGTNfrz2LeCAITMNNnNdCRKSfrfzd86JhvbfI2/xPQToMMFs3QrSjh2/m8+tl KilOYEMmL5Jeg== Date: Tue, 15 Oct 2024 21:33:47 -0700 From: Namhyung Kim To: Ravi Bangoria Cc: Ian Rogers , Arnaldo Carvalho de Melo , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Mark Rutland , James Clark , Kajol Jain , Thomas Richter , Atish Patra , Palmer Dabbelt , Mingwei Zhang Subject: Re: [PATCH 7/8] perf tools: Check fallback error and order Message-ID: References: <20241001002027.1272889-1-namhyung@kernel.org> <20241001002027.1272889-8-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Hello Ravi, On Tue, Oct 15, 2024 at 09:51:50AM +0530, Ravi Bangoria wrote: > > @@ -2366,9 +2403,6 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, > > return 0; > > > > try_fallback: > > - if (evsel__precise_ip_fallback(evsel)) > > - goto retry_open; > > - > > if (evsel__ignore_missing_thread(evsel, perf_cpu_map__nr(cpus), > > idx, threads, thread, err)) { > > /* We just removed 1 thread, so lower the upper nthreads limit. */ > > @@ -2385,11 +2419,15 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, > > if (err == -EMFILE && rlimit__increase_nofile(&set_rlimit)) > > goto retry_open; > > > > - if (err != -EINVAL || idx > 0 || thread > 0) > > - goto out_close; > > + if (err == -EOPNOTSUPP && evsel__precise_ip_fallback(evsel)) > > + goto retry_open; > > This will change the behavior of events like instructions:P on AMD. > > Without patch: > $ ./perf record -e instructions:P -- true > [ perf record: Woken up 2 times to write data ] > [ perf record: Captured and wrote 0.009 MB perf.data (9 samples) ] > > With the patch: > > $ ./perf record -e instructions:P -- true > Error: > The instructions:Pu event is not supported. Thanks for the test, it should support other events too. I've noticed it returns -ENOENT for non-IBS events with precise_ip > 0. Will handle them as well. Thanks, Namhyung