Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1978466pxb; Thu, 4 Nov 2021 11:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbly5Gsgj73ru49K6qXfvS0XH4CqbNjyBAs5QsPMdxJNhL9fpJece1kUvkuoO2JnhTuY48 X-Received: by 2002:a05:6402:4309:: with SMTP id m9mr9850360edc.93.1636051744389; Thu, 04 Nov 2021 11:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636051744; cv=none; d=google.com; s=arc-20160816; b=keNHy727BG30B0FdPmmYn7An3dhxWhMOjICRG/uECVs3NVq0dqtMIfVcCkmAFiOhfg ck1afIhj8CPAPgOh8i3/zRZ6+sZ8F38P8rDxpzSG3U8h7g1cggfeXkGmoG5F9+CXHakt 4T20faTgoQtUCHEa7L3aBfmO1FYVc4M33yB3/B0+GlVDZtBnYbgWl7ULL9dS4lvRTYge 3FYgixS8xCA7zP3n++mdpqZzGsWjP1rcqleU+rtJjltBHkvfwdTYriPM7tBQ0OQfD6aK KzRQtkNfubPFIy9auEPzIOAo3WNw2xBw4WPWxCfzgJYo6OXUHwPrZNWZiwleNOvOQ+wL YPBA== 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=RsyjdxexjozQMRR8SItGA7X2a/SGxpsZX2VzzTYsgkY=; b=nH4dm5D2+9wE+ipS807aigMV7xBfhLarEUkFpM5VBNzdUKZcampBoiUF2o+OP0446T 8QILpPEKP9h4Y6s8pT7+/xksh8ileJRydA3OWVfAE/O75HXgnZ9ept19hU+hKvxgYs1g 7xrmiKyrfETqW653A3j6P8skWm9uz8E1D7+ZoL9tdHPhfa4irTYigSNt1XMyqyb8ovX6 Ws0EBKOZgXCcIDg6Tl29PdMI/Fr0/tUzMImwVw7jqPTzsOILShx8nUIJRgHezNwPxYRx NAKwiR+CtiP6aSfdpcOuw0vOL11Bizlv6gWk2/7vqvmIixovB2cymVkQqNbEueUcXmqw PN2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WoXEayTj; 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 y15si10564568eda.291.2021.11.04.11.48.40; Thu, 04 Nov 2021 11:49:04 -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=WoXEayTj; 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 S233887AbhKDRmp (ORCPT + 99 others); Thu, 4 Nov 2021 13:42:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231667AbhKDRmo (ORCPT ); Thu, 4 Nov 2021 13:42:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 523B360E90; Thu, 4 Nov 2021 17:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636047606; bh=IcgAGLN2juO/X4PpyOuhrmT+wzS1AUDVoeN1jSoWPqg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WoXEayTjhWctFyFrvTPZ2EBv+GD8iyOPNiVjaxv3/O3PRvG8B7HqeKnJO/WfMVWOi 7tEmGg0emfDTfh11Ea7WSzKEu0k+tmEXyHr58hPL5WrUa48L2fJCcQnfdXDDPb3V2C cFKJ5JNXC3gr8Nf8msT1XFKtymFjGO6Q9k2uB8hwQCGh4lL7hPyZYmxtYdupy/avOH 6ZlbsM01TLSfBzCCY+SjPgCodKhhf/uAuUkxYSyIEu2pBRM64nBLjTZGUbpDcqFGLQ qO/REcKfJ0OSLF1UF+qJLfIXuRmsVl4ucu1xk7e2F6fS218BezaCxXaxNEIyglew4A /pFegIJCH0O1g== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 35A1F410A1; Thu, 4 Nov 2021 14:40:03 -0300 (-03) Date: Thu, 4 Nov 2021 14:40:03 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , LKML , Andi Kleen , Ian Rogers Subject: Re: [PATCH v3] perf evsel: Fix missing exclude_{host,guest} setting Message-ID: References: <20211029224929.379505-1-namhyung@kernel.org> 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 Wed, Nov 03, 2021 at 03:29:50PM -0700, Stephane Eranian escreveu: > On Wed, Nov 3, 2021 at 2:03 PM Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 03, 2021 at 10:35:04AM -0700, Stephane Eranian escreveu: > > > On Wed, Nov 3, 2021 at 4:32 AM Arnaldo Carvalho de Melo wrote: > > > > Em Wed, Nov 03, 2021 at 12:44:12AM -0700, Stephane Eranian escreveu: > > > > > On Wed, Nov 3, 2021 at 12:24 AM Jiri Olsa wrote: > > > > > > > If the pmu doesn't support host/guest filtering, pmu/bla1/G > > > > > > > may count something. Not sure if it's better to error out. > > > > > > > But the cycles:G and instructions:G should result in 0 > > > > > > > in case there's no VM running. > > > > > > hm, I think if pmu doesn't support host/guest filtering then > > > > > > I think 'pmu/bla1/G' should error, no? better no number than > > > > > > bad number > > > > > Yes, it should in my opinion. > > > > Yeah, I thought about this yesterday (holiday here). > > > Otherwise you create the illusion that you are monitoring in guest > > > mode when you are not. > > > The question is: how can the tool know which modifiers are supported > > > per pmu model? > > As things stand kernel-wise, we should just do capability querying, i.e. > > if the user asks for a feature not available for a specific PMU, we > > should refuse and provide a helpful error message to the user. > > If the PMUs in the kernel had some kind of mask that stated what of the > > 'struct perf_event_attr' selectable features are supported, then we > > would just be able to avoid bothering the kernel asking for unsupported > > stuff. > I think we could add something like that in the sysfs entry for each > PMU instance. > that would avoid all these perf_event_open() calls and trying to > decipher the error > code. That would speed up these checks with newer kernels, yeah, with older kernels we'd fall back to what we have now + bailing out in the current case (PMUs not supporting exclude_guest). - Arnaldo > > Just for exclude_guest we don't even need to have > > evsel->pmu->missing_features.exclude_guest, as this is a hard error, no > > point in caching previous capability queries.