Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp881033pxb; Wed, 3 Nov 2021 14:05:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9/FYz2lkKLUZ+JyUPtyV9AZ8jhK3F5Crp7lhP07n4wmz8oaJCWYywTeNQkZc/bQRgOpwV X-Received: by 2002:a92:360c:: with SMTP id d12mr27976428ila.172.1635973506163; Wed, 03 Nov 2021 14:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635973506; cv=none; d=google.com; s=arc-20160816; b=g7M6h27g1CbpjOc7KJ60DcABTEJHDW4t+VrrZsmbUiME4ip8gDAmmFYtxrQ7ZUhU0p u9TpMmXExu9yoYaQztqQhzhiUmEqP/xtdmA5xSwbg4iuqimlqafG681qBP8YS4iJTD09 eciopCWD4f19uaaq2eK4PHn5BujPXkzYN4VwaKnw+eOvgHiPDCuPPwGagVKmBl3iPF+v SW2joKrrtA0moxbONgm+0LZQqZiZTiQeepDTsHUsiak3gBjNqSM+/nGcuUfqUImChkRb jDIED5PaKY0xzwUKk9P0rZIuzP9q78dLo3GxoKObPWyb8P5PSxnFGHn1f+MsjS15yXTx 25hQ== 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=zPcjd9JeyhYCR5RWHX3HWd4V1M+0EQiZt2TIQInuia4=; b=aDhiydZPNFH/RSl8vzrGjdPFA9udHZGA0AGOkP5y0WKgsn7R4TTSxLKA7c0f4e1Ihv Sco2/6/0CoMo6XjlJeks2lBGWpo3vaVRtdfRKxMl6mNmO+Z92tSzzUd7nKenwrqPQiin zVrAWx+dvx11p968heWZWI01dyZAq68kFnyCt314XSHa3iAn2iXaYkOIvr4GqHL2BGEA WKebsVlDQwpWVhanLSM/NRDXhtKAieFWvn3lmpGlysTZFQQA1Q76EQIi7Hfg3ROIMjtt sDz9+I/wvyRHmCjp0iFbBqVf3Lnr9Q4gHeFkAvm8DJLuxUsjWGgUhDRSCmzjWVaN+qm5 8nOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XI0ZCGYt; 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 w12si6362105iov.5.2021.11.03.14.04.52; Wed, 03 Nov 2021 14:05:06 -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=XI0ZCGYt; 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 S230202AbhKCVF6 (ORCPT + 99 others); Wed, 3 Nov 2021 17:05:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:39424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhKCVF5 (ORCPT ); Wed, 3 Nov 2021 17:05:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1604961053; Wed, 3 Nov 2021 21:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635973400; bh=d8px2AtfrOiV2LtD9NN0uOgaogAqUK4i3BipGueAhqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XI0ZCGYtiUEQQt77ffSVIwYk9OOH8yEpZBQvIGiJbIog8hts+dMWXj8db7mxSd8wL vpDGD4/x90e5Y2oS1OxXUbCCJ61X2fjNfEgFvYjp3JhTkQwWPfC+y5uv2sMJAs5pEu Up6NEkelo3AmeH7fF/RV16Iyoco9hmAG7MQyNEYHKHaHXyZkMphwls+Pw+2Ppbja/c Ro14m2XAfz7RUA9Hmf87SFpgYcbTVC6YeS4mcrjUWlB3e4vv1qTOuz5uNquqZ3UiRU ylb2hQgy01dhpvcVtc5YbXM2Tho9eYH7HNsOiqda16LxxjlO7DfVHLvLZ8d6hPUk+k 1RDustetjD+oQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E6E39410A1; Wed, 3 Nov 2021 18:03:17 -0300 (-03) Date: Wed, 3 Nov 2021 18:03:17 -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 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. 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. - Arnaldo