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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E9E9C433F5 for ; Wed, 3 Nov 2021 21:03:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CE1360E0C for ; Wed, 3 Nov 2021 21:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbhKCVF7 (ORCPT ); Wed, 3 Nov 2021 17:05:59 -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