Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2000740pxa; Sun, 16 Aug 2020 19:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+S/G6INt+y7JG252EUWgdTMQ+9OVdoDDXhev5OuKLqiq8vzHDgP6vZfqksvEE2osfQMp5 X-Received: by 2002:a50:fd83:: with SMTP id o3mr12502165edt.170.1597631672064; Sun, 16 Aug 2020 19:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597631672; cv=none; d=google.com; s=arc-20160816; b=ItHpajIrqYXqCS+pEJdziDb0kAP97U+DKPd8TanoMZVKD/nnZc8fQH2Pnln55YMMl2 j7qEATAfRlmPCbmno6qepL8rfDSA9xeIthY54XSjxmTh5245RQMCo9gFma94aswrEshx 1E53FTl/15+pqIe2nK3LIpReNZ4NtZPKdP0I7l62Pu/Ckk3mnxEjy5wZXl5ESgvqlv66 ObmWaSG8PA1YIomaxukQ1/4zcB348+jTJhcpvW/YO+f2pYxMXIVgbBRTsc8/0eLfkM/l eM49737cK5HMwK88T40ZjXAq8k319b8fMbADGhlI5dCQuKB1jH4G3mYT0xCISfYwOPJT ha4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=YuDfJ2vYM48YdSW/+gToaJergPJr5Bdt/frPWrjqUV8=; b=UBpwOZdieF4jr7AQhzvFQoiWB1sIDrUvTo62CIcEs58zsTS3keWOuSUhTKUBZ6DuXX Doyo+Hv+Q5MRqycK8qOkmKS7XwVHj1TT1yHxHcTuVRxooAW4PrecdIqq7920cS1Eq1hO 7toZ24stj033XZ524JUBskjKl8lbmrmeeaEgsplxBymGagkRLC3gH8YrRNM2bK9FUunX tlFoxk4ANrldkneqoqfnKoeebn4JhehriZtu8CsTUYDXBW+lQ5dPLEPANgXUFxBK5/dL E5AleaHgIdcbm0X+XTV72P1zjRX9GG0lB9plt7MGcRjgwNqlmBodq6mFiCQVD6yOOz87 /jjw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si10284008ejw.97.2020.08.16.19.34.09; Sun, 16 Aug 2020 19:34:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726887AbgHQCc4 (ORCPT + 99 others); Sun, 16 Aug 2020 22:32:56 -0400 Received: from mga03.intel.com ([134.134.136.65]:25270 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbgHQCcz (ORCPT ); Sun, 16 Aug 2020 22:32:55 -0400 IronPort-SDR: gGh+2HWZES1Q5wjo7EWOvdEcDjoaYG4XX5TC2KwbtgtvbyKKjKFo1Mp9I5USSkfUGUR/C97+e6 WsmEF4jLwTog== X-IronPort-AV: E=McAfee;i="6000,8403,9715"; a="154601723" X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="154601723" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2020 19:32:55 -0700 IronPort-SDR: yR653rNF2cnbdtHCzlVrDuXp2u7FAbIuJ45Hw0G1vq2PBC5BBSoj4TaNdRkhDwFLk7QwDvWgn9 gSvhf7S7IiZw== X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="496858335" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.5.239]) ([10.238.5.239]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2020 19:32:52 -0700 Subject: Re: [PATCH v3] perf parse-events: Set exclude_guest=1 for user-space counting To: Arnaldo Carvalho de Melo Cc: jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, like.xu@linux.intel.com References: <20200814012120.16647-1-yao.jin@linux.intel.com> <20200814124722.GG13995@kernel.org> From: "Jin, Yao" Message-ID: Date: Mon, 17 Aug 2020 10:32:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200814124722.GG13995@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, On 8/14/2020 8:47 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Aug 14, 2020 at 09:21:20AM +0800, Jin Yao escreveu: >> Currently if we run 'perf record -e cycles:u', exclude_guest=0. >> >> But it doesn't make sense in most cases that we request for >> user-space counting but we also get the guest report. >> >> Of course, we also need to consider perf kvm usage case that >> authorized perf users on the host may only want to count guest >> user space events. For example, >> >> perf kvm --guest record -e cycles:u > Ok, probably this works, but what if I want to record guest user samples > without using 'perf kvm'? > > Can we have a 'U' modifier, perhaps, for that? > > I.e. > > perf record -e cycles:uU would not set exclude_host not exclude_guest, > cycles:u excludes guest user, cycles:U excludes host user, would that be > possible? > > Anyway, I think that with what we have, your patch makes sense, having a > way to, without using 'perf kvm' still be able to sample the guest can > be done on top. of this. > > Xu, can we get your Reviewed-by if this addresses your concerns? > > - Arnaldo > Do you suggest we will create a new modifier 'U' as a follow-up patch? cycles:u - Count host user space but it doesn't count the guest user space (exclude_host = 0, exclude_guest = 1, exclude_kernel = 1, exclude_user = 0, exclude_hv = 1) cycles:U - Count the guest user space but it doesn't count the host user space (exclude_host = 1, exclude_guest = 0, exclude_kernel = 1, exclude_user = 0, exclude_hv = 1) Is above understanding correct? Thanks Jin Yao