Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp301205pxb; Wed, 3 Nov 2021 04:34:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp4874PAeWu28cLltRhETWrFt87G7jvno/x0t6b48p5/acg0sa3trK4cYNBmEAM1pppMfq X-Received: by 2002:a17:906:d550:: with SMTP id cr16mr2209553ejc.438.1635939280535; Wed, 03 Nov 2021 04:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635939280; cv=none; d=google.com; s=arc-20160816; b=N/oTtcD6sUiZRRzJ6/tFiU7OVk7IxgywW2zJ3KWLSMJpK71ir79cKLraFMmrgO1ZTn fwRVxWvs0N5hujcxC8xYHfOLW+bp+4aJ6mx481ueD32PzWIZXD9pVVVGTdpjYYYFF3HZ 3taDCA23on5Maz2wlHQbxSZWQy1K+eK9sXtC+/6+hptGhjt8E58SGTg/rZtoWw15XY92 6fAQU/6wkY0IQnJTzWQwk+vIi5JO5R5FKfkxVS6WI7TefRso+0YYSeoeipZJmFO/OVC4 0cET0vT7/xeoezlHjnI/lYXTPhfQaoca2f5t4c+1TYSRzKK89GqV9XpxGDm6LiWw9dzj b9oA== 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=R/AGxfpwS6NI0D4S61LebDR3r5gWPEQUVvpFmS5itk4=; b=YnzN7jI5J+ogGc9rTxzKbrCAbTEw1iEFTA4p4OPR+b3gf6lv1ybDe7AQmhUhH864sH 4fQOgPBxwZh/roFOxxACPWWKX8VXz6WPRSnZkVoy/RY4RTeGniIdat29HHbH1tyQY+PZ mvrPhK8mChUyPZTp53iSKvQpiJyyQj1HvAxwNmDw5Sw7FSb2Sqqz/VjyuJMJ7gfalsWu Xl0PIxVf3rKQMg7z4WZtirj+nY4A+0+M2vV492Ib+FXRBEAb6sq9FnMXO5rqh3+4Z9f8 CHs8xw7Sshe+weCwgzMVQTKPKw/quNc7xrX66n8AuULhTPbHr6liS9SVi3aEwLm0gF08 WS+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="am/zcHLY"; 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 z5si4200406edd.497.2021.11.03.04.34.16; Wed, 03 Nov 2021 04:34:40 -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="am/zcHLY"; 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 S231511AbhKCLez (ORCPT + 99 others); Wed, 3 Nov 2021 07:34:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:49332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230112AbhKCLez (ORCPT ); Wed, 3 Nov 2021 07:34:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6671B61058; Wed, 3 Nov 2021 11:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635939138; bh=zuOcwWfFVIJNTKW1z5rMswsN1iUCKx0zr+HQsJST2yc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=am/zcHLYGHvd2WIhHDtxYA67GZ9wIZjNRVW5E2ZyPg+J6k6LZEW93csBzEk1j309v 4wOxApAf7ZHp2F3TRZC85iMc+7OIZHZJ0l2UkYMZ66o1G5Twl5wruDClSyxOb/+eSC Dciy+4HE9lL/9A/oy76wxJl3Gr6zDhhmTYo3lK5S5ConY1jk/PgKNymNraTFNa4n40 Nl/melwXR/4mHMkXPdsxzzoYJgn9Xd2/V1xV+OGAT1g661BVOvF+C4y0/t7o3sdK8d L05fg7z6PuXy29huuK2LK+2D5mbS8T07ZD6KpNVeyjRdTFlosDLOnPhKAXym66yA1b BbAneJOnbAfpA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 71B97410A1; Wed, 3 Nov 2021 08:32:14 -0300 (-03) Date: Wed, 3 Nov 2021 08:32:14 -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 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). - Arnaldo