Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4859080pxb; Sun, 7 Nov 2021 00:36:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaTx6lYEbwI/dtAbSnIGe5LfToQMpiJxVe6CQacjJJ1pK4jqC3hw6s8WBLoIeWIq9y47LY X-Received: by 2002:a17:907:7f8b:: with SMTP id qk11mr87419718ejc.313.1636270574283; Sun, 07 Nov 2021 00:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636270574; cv=none; d=google.com; s=arc-20160816; b=hS7WmqE1Q6rbCIMJFMZmAEVr3VdsjqD1gD73gKSNOHRvHXZbcqf3n/+xpWEbJ8qvrx /xbUJfOEETwttuITXpi0bpK4kIHI/SoEjQKM0Hl1iT23rWaw81tWB18gO99SAdvj6P3v bUAb+COAkOgRh5shcHa7tdzukBOGN5tCGon/JIF0NnUqSGfcMgg+FP7JVP0Kr9Wo5OEJ gq5PMivK9CE3hxGFa63is3E3sZjQzlFaYAiNUudXR6hhko84wBSMBD9q7zQ1T/LycG8v ITGJDxBCNTeYAXaZinAwl1Oc8ULgpasP6g090YeMDYHb/eFWwZYU8498mMHpdjzE+BG1 zZcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=u3/RdcXonNuha/lKFUzE6RnWtTQrrBI90L1FG5D4+q0=; b=MeEQaT72JSUFd2MUh/JC8K65NksrembxOZlSsW5pAsPc8LdfLFCfpetT80TiJJJOqK 3HnCYOdefKGUIrA0wuUp3+n9Am6w1oCtdorqWl5R6l6+RTEenu/WQPtYR4nI7bdenIHz Kywy5VyFaauy8DRtWiCPF6ea85M+Lf3eiuJfHpp2QbsvJbd72GEGcnDIcv+42ctVtNbx inNGRWroBx/w0dfimj0It+ZLUnDGhFjeKdrAqIaCMilIxOT7JjYWRZyjZ2D9EC9Ycpij YEz9EF4rHqbm5M+q2a3jNTRFe8RelcuuFMj8XkSzol2e9UzpDQoWyOpQ46qQs/RDGCfU iPxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=flwve9Ew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si24728348edp.507.2021.11.07.00.35.25; Sun, 07 Nov 2021 00:36:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=flwve9Ew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234272AbhKFT0r (ORCPT + 99 others); Sat, 6 Nov 2021 15:26:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:43432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232498AbhKFT0p (ORCPT ); Sat, 6 Nov 2021 15:26:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 21C7B60F9D; Sat, 6 Nov 2021 19:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636226644; bh=jQGbXnitLchMei/HJt6evi7umlZCzkT9kLGbjbsg+hg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=flwve9EwWJaWib7IpCKyH+YZxli5EQuKuBb+Gel6gCYqH4pWHOcHHA3pSkWhMgVQr ppRkdEXijVaUX0Eiq6ULhfgwRvPvrRwcDtfZd9w/JjwR9L6lRBE0TGFe8b/BOiEU4K WSiz2pnIkT/2kF2e1Yxzcb0tQPTAd/jiNvb5bzZ6H3SzaTHzAEvRLtjRw8I3o6kjEh SkqpoUJpxbhH3KWzwsnrkSe5OF+vSlDc57rs/YDFGAsecP7+e7kjWo0RdfiaCnVUJ/ G2S57gCEKVEvFtv9fVckeIEfZmGOrxMqcUYjGSZqHSKsIhnrsZYSRlWARA3iQrmO1g 2M4N0MJCUSW2Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E6B64410A1; Sat, 6 Nov 2021 16:24:01 -0300 (-03) Date: Sat, 6 Nov 2021 16:24:01 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ravi Bangoria , Jiri Olsa , Ingo Molnar , Peter Zijlstra , linux-kernel , Andi Kleen , Ian Rogers , Stephane Eranian , Kim Phillips Subject: Re: [PATCH v3] perf evsel: Fix missing exclude_{host,guest} setting Message-ID: References: <20211029224929.379505-1-namhyung@kernel.org> <20211103072112.32312-1-ravi.bangoria@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Nov 05, 2021 at 11:00:29AM -0700, Namhyung Kim escreveu: > Hello, > > On Wed, Nov 3, 2021 at 12:22 AM Ravi Bangoria wrote: > > > > > The current logic for the perf missing feature has a bug that it can > > > wrongly clear some modifiers like G or H. Actually some PMUs don't > > > support any filtering or exclusion while others do. But we check it > > > as a global feature. > > > > (Sorry to pitch in bit late) > > > > AMD has one more problem on a similar line. On AMD, non-precise and > > precise sampling are provided by core and IBS pmu respectively. Plus, > > core pmu has filtering capability but IBS does not. Perf by default > > sets precise_ip=3 and exclude_guest=1 and goes on decreasing precise_ip > > with exclude_guest set until perf_event_open() succeeds. This is > > causing perf to always fallback to core pmu (non-precise mode) even if > > it's perfectly feasible to do precise sampling. Do you guys think this > > problem should also be addressed while designing solution for Namhyung's > > patch or solve it seperately like below patch: > > > > ---><--- > > > > From 48808299679199c39ff737a30a7f387669314fd7 Mon Sep 17 00:00:00 2001 > > From: Ravi Bangoria > > Date: Tue, 2 Nov 2021 11:01:12 +0530 > > Subject: [PATCH] perf/amd/ibs: Don't set exclude_guest by default > > > > Perf tool sets exclude_guest by default while calling perf_event_open(). > > Because IBS does not have filtering capability, it always gets rejected > > by IBS PMU driver and thus perf falls back to non-precise sampling. Fix > > it by not setting exclude_guest by default on AMD. > > > > Before: > > $ sudo ./perf record -C 0 -vvv true |& grep precise > > precise_ip 3 > > decreasing precise_ip by one (2) > > precise_ip 2 > > decreasing precise_ip by one (1) > > precise_ip 1 > > decreasing precise_ip by one (0) > > > > After: > > $ sudo ./perf record -C 0 -vvv true |& grep precise > > precise_ip 3 > > decreasing precise_ip by one (2) > > precise_ip 2 > > > > Reported-by: Kim Phillips > > Signed-off-by: Ravi Bangoria > > It'd be nice if it can cover explicit -e cycles:pp as well. Anyway, Ravi, please consider Namhyung's request, a patch on top as I'm adding this already. > Acked-by: Namhyung Kim Thanks, applied. - Arnaldo