Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp956882pxb; Wed, 3 Nov 2021 15:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrYGCFa9cGaQm6f3BnGldYoAkFZgEsxqmEzSXlSBD8f1EMpIAxeFixa9LR+O0ruRmlrOnL X-Received: by 2002:a50:8d4b:: with SMTP id t11mr38745492edt.371.1635978779098; Wed, 03 Nov 2021 15:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635978779; cv=none; d=google.com; s=arc-20160816; b=yX/+otlo05Ib42FHQ0F/+ZGXzcTPr14JeTkD9XYTB0Hr7z7SxzlAZhKL/PTvQoJK8O VifJ2hwPGhe2g9P5/MOFae9NSPeeYSZQrBTZzb7QGIDCAkKIyvJymMoPVKaFHD82/vzU FCmgcizgnhFfUOjJf7kB5r8hDqqP+mSlXTQRVvK6qAQCygdzQ4SbSEUcNsTDE67qBbKP gFhPc34dXDQ89kCqNujD/gwjp0K6JyNe3yYPsPQ3ibxuW4dnbmox1OzBYyYlB9t89U8y WoZG1RlcteDMpC8RxQOeebxiSmdRVwNPcblb9F/0XHE0GyC9AtWwZAYj8Kva5erGHAZB eGbg== 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=0RTQmT2qEoeRXNJDGTe+Cy/M7zjSsz0CZeWCPpV13nI=; b=0VAAxd1G3uLAvq1e/TXcxu2tHyZJA9ZGk+ILdQueMmpL3f+n6wV0dnAuaHgItxZxmy ChikUGhCbGonJPFYVuCSO4ZuV370HSSV9Ahfd2Y84EYKKa5VDr+/bG8ifRQyyBPtyT79 c6WqiVD8i2PVUVrZJtF5yhvyf39qiBKHuYktneR4QCYd6MRr9f7vgEktg5giVuMI4JqH ITjCq5sSfrxZlbHlCDQupOyTnV20ggO0LTdI6u+rMIi2cMKzc0/f8AFU9Yfx8wOqW0EV 3T7infMyn0mQrjCoAwLygYyqqFWfgUmFr6x0OTBA+EQvK83vE4mf48T8tg2cmDOQTgZN wxBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=k0ndu3Pg; 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 g2si5256916edb.9.2021.11.03.15.32.35; Wed, 03 Nov 2021 15:32:59 -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=k0ndu3Pg; 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 S230084AbhKCWck (ORCPT + 99 others); Wed, 3 Nov 2021 18:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbhKCWcj (ORCPT ); Wed, 3 Nov 2021 18:32:39 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF2E2C061714 for ; Wed, 3 Nov 2021 15:30:02 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id w10so4175731ilc.13 for ; Wed, 03 Nov 2021 15:30:02 -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=0RTQmT2qEoeRXNJDGTe+Cy/M7zjSsz0CZeWCPpV13nI=; b=k0ndu3PgkpfnKJbC7v6jWcEN6hxAzwH/7qvoiaIZiJCmwYIcCW8g3mfw4tUAl4/lIb 5dZSngF/HNur43bgeDjOSIr7mVBqJzKx4EpEBAjqkVkRfIqliteDh4ZfSe3BG5q+TBDq NEYxDcpnbMjDbuiNdXY3Ur27gFowHMqSvPShSibf4fNgEv+GOkJ2QB4YpNmUyoO6LE40 PLoZ6sgNAjRWgvmqmyXF6MswiI13Uz66IoeW6GwRcevb2fhnxV9UnIGseE4pTwyfiU+r z6aFjr4gMq1c1tECF4hb1JhgqVjVPZX5YSS7HxYdBieCAL0+XmEt+gMRlq/iAHNXpy0R uSiQ== 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=0RTQmT2qEoeRXNJDGTe+Cy/M7zjSsz0CZeWCPpV13nI=; b=ksGaMbltr9XjP3/COKzm5BigiN3h8lypoaU+wXkX9G9KEjnyL6ik+JRynjvc7SqmrB KA9pwX5dl5+5vFcJQrZdWbSJTpa6AWK4w7so2SSWYncE7S49C4JKFsx7+DURzZokaxNV GBWjVLtraqImlNCh8wTt2zvO8LvTs5yjf0bAIrEYDG9m1po0TGqJsPQp+l1R2+f5hghU Qw4O4QWw3DM4ZmJ6Cfe/lr+0O7ScP3bnDSyDEGRvlbVwg9u8TkGhQUc0mxlqrBSmZOyQ DpSYmOW5f6C9R859qllwBgOftWi5lnady/oPPF0SRHsIA26Wm3BwUbuLnfuv0F3PD04s KvCQ== X-Gm-Message-State: AOAM532KQ0vU7tI2z6TblmCQ4ZKGkugF2SUWtxiUAVjuEqLTgfl4mi/T puLernOXKg4tHoY9fjUciqQwijRLJWsDnp85r8a5EA== X-Received: by 2002:a05:6e02:b22:: with SMTP id e2mr10430693ilu.73.1635978602155; Wed, 03 Nov 2021 15:30:02 -0700 (PDT) MIME-Version: 1.0 References: <20211029224929.379505-1-namhyung@kernel.org> In-Reply-To: From: Stephane Eranian Date: Wed, 3 Nov 2021 15:29:50 -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 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. > 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