Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp684780pxb; Wed, 3 Nov 2021 10:37:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHkprmJB7C0sRSQSsR5owJ0wB1NuEGs5M/dAzCQmmmaaFk7tHpLjVgD3x7pUGidrktS9l7 X-Received: by 2002:a92:8751:: with SMTP id d17mr28237209ilm.104.1635961021552; Wed, 03 Nov 2021 10:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635961021; cv=none; d=google.com; s=arc-20160816; b=iLXUydMpqTaLFVI8dL7jozwH5/T5F2qfE1EyzYNeJgW3+dlmFQhPscazjMIFHQQQA2 yIlH5CRGr0TlxshizNYo7froUN8HKKSte0/b9ebf4H8fLIFj5qhxHs/7LDR4Fh2QJafH Fh0JDZTvo5hYo/AIKh/79DBamA4A1Ivx0C+YxW0Ynn7tVNT1a7fNGpecrmxFxmuRBipw qiWNj+Oacu2RVSKk39E1au5OaQDh/q/3xvuQZAxDQHqKA9lI/7XsBorp0VvFGvAuGC9a ZUnYn03L8n1qQ5wjD+ZH6tajfJSjcahxaFgTaqzPFzGakH6CiICjLZsMCAL01y3j+OkI WkwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rnyetX0QyZqi2Iq5USlzrtlzkMWEd3Rn8ntmHLRK+94=; b=NpHc91VllNGSMendDxwUhoLiTYdDK0RIg7/86vJnXkkWsg6zIoqmGzGuP+fIyVWMeW a3k+ZkZqrt0TrXQz0lLlF1W1fBy42zAyHxcwgAfGIqk6z2NtNSWs+bU/Z49VCXrrAdK0 h0GNQdrUkiW4dnZTpBuLVz/Uw69osib79st15GkF2eoZAwmY7oUWZ8+XBb+ZuhuJSVYM BZ1SAf09U50T2LBOteU4lnCNot/em+hCh8pc6zxSr2N+uEIIEY7bDsNlC9k5RiU+oxRN ERNp8tCoiJi1WNN8zkwBRxrALI/5iUQyZT/8GnMWmfxMf85FayFBvMR2eQTZ/OtW+nhC PUCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FK7PXiKw; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v30si5243049jal.20.2021.11.03.10.36.48; Wed, 03 Nov 2021 10:37:01 -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=@google.com header.s=20210112 header.b=FK7PXiKw; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbhKCRhy (ORCPT + 99 others); Wed, 3 Nov 2021 13:37:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbhKCRhw (ORCPT ); Wed, 3 Nov 2021 13:37:52 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E586C061714 for ; Wed, 3 Nov 2021 10:35:16 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id s14so3341349ilv.10 for ; Wed, 03 Nov 2021 10:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rnyetX0QyZqi2Iq5USlzrtlzkMWEd3Rn8ntmHLRK+94=; b=FK7PXiKwlAEuydEpz5g67Hb5FwusaOXT6NGyZ5VSKuxVPEDcZJuvfBm4ZtrDigrG3l 2IncnecNqtTW/QJXzMCih23eLPLCajo/iI+8qCZU4YBJX2rOU/+XHhTL8mDyJCOGmNiW 6dlHbgy7vwb8Xsb51cbtxu2iL02CN9CtqxmPYmaxbWhwFcwBr/364d2k+yg8jKLmeYym mpqck1V2pOyArZZf66VC8TQlcMKCq9FRYQKo/unDf7HMO0fKMPqpwHw1xN0r0+hyF9U8 2cVjZpbDqmtWSk/bIya6v97RIr+hCHsxD883tN0FVNF05Y0RzNtA4sNgaAOE9qV08xUR rnJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rnyetX0QyZqi2Iq5USlzrtlzkMWEd3Rn8ntmHLRK+94=; b=IV6EMt51jU6nfH0Z/OY5uOMqHiOJ3MPbsZoNvMSC13Kj6NOXaQDPFnLAR591awZPoa P5k5/j2L6o1ilInfsD3p8kOSfPUYPqelgmeELLhnh2+CyEpod+vdjTzm61Q2iqis8Xar l44wzcFZiLXflCW1GrwyApMxJ0/vmzCHNXjgwrqAAZVES1IJDylDiQ8FgI8kQrIAtB9H XlvdzpQibUXHPzdjZFXMvs5c1qsvTANv1uwArMbTvcReMpP4fg4I9RLgi41jPH9ux7bv AqkbVdpHEEPjj7bKpaBnttk1HLVct7uz50csZAbBcOqQJbsDy18qWWtBSYS3Ib0BMTuL G6EQ== X-Gm-Message-State: AOAM530NTD6d4OQ/d5sCifoabM91SQeeebh5HYnmRE0lXAGsCYmFHdmz hIAp9dJ1VlmDlz0ddfLCsdJ5+IvW9Ck8K8qkH21GAA== X-Received: by 2002:a05:6e02:20ca:: with SMTP id 10mr15101347ilq.310.1635960915564; Wed, 03 Nov 2021 10:35:15 -0700 (PDT) MIME-Version: 1.0 References: <20211029224929.379505-1-namhyung@kernel.org> In-Reply-To: From: Stephane Eranian Date: Wed, 3 Nov 2021 10:35:04 -0700 Message-ID: Subject: Re: [PATCH v3] perf evsel: Fix missing exclude_{host,guest} setting To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , LKML , Andi Kleen , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > > > On Tue, Nov 02, 2021 at 04:21:21PM -0700, Namhyung Kim wrote: > > > > On Tue, Nov 2, 2021 at 7:10 AM Jiri Olsa wrote: > > > > > we were discussing this with Arnaldo yesterday and he had an idea to use > > > > > evsel->pmu link to store this info instead of hash.. I first thought we > > > > > needed 'evsel' related data, but after I gave it some thought I think that > > > > > might actually work > > > > > I don't get it.. do we have evsel->pmu already? Or do you want to add it? > > > > Yeah, the filtering facility (attr.exclude_*) should be kept in a PMU data > > > > not in the evsel. So I added a hashmap to find the pmu data from attr.type. > > > > How do I use evsel->pmu to store the info then? > > > > evsel->pmu is not there yet (only evsel->pmu_name) so that > > > would need to be added.. we have evsel__find_pmu available > > > > then the idea is to use evsel->pmu instead of the hasmap, > > > like add: > > > > struct pmu { > > > ... > > > bool missing_exclude_guest; > > > }; > > yeah, or more generaly: > > struct pmu { > ... > struct { > bool exclude_guess; > } missing_features; > }; > > > > set it when the guest filtering fails and and check it > > > instead of the hashmap__find call > > > > > > my argument was following usecase: > > > > > > cycles:G,instructions:G,pmu/bla1/:G,pmu/bla2/ > > > > > > that we would falsely clear pmu/bla1/:G if we used the 'evsel->pmu' data.. > > > > > but then I realized it's detection if pmu support :G and so if the :G is > > > > > not there, none of the events should have it > > > > > > thoughts? > > > > > I don't think I'm following well... ;-p > > > > > 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?