Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp183424pxa; Tue, 18 Aug 2020 20:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWz2670+aXIAHqe6VLeUEI57dhENPLAq0XSVfW2hNwAfJqk39qI09WFJOBWKkdhrdMCRh9 X-Received: by 2002:a17:906:c29a:: with SMTP id r26mr22534162ejz.153.1597808577154; Tue, 18 Aug 2020 20:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597808577; cv=none; d=google.com; s=arc-20160816; b=iH4MJr87CANnF1ja1AByjPRDztB/cCl0T6sB+Ii6XEbmr+bHvsDAyPSeU/8pY6b2SC hABdYl2ynud3hRP2E2MQR+1KZzViKBs3T/TjyzBGa5GA+lWQI2/F7VrRfsAVPm55cqGh 2ST1qbkLaucXvoqAKWDRGvndW2bNhj9gTXdPXvt0NHf80CG/4Id5Exd9wHKxc1co7/Wu oHjE3oinn5s7wrHdBDuUxduYi5JGFTC0plVTk8Iv5TgZY4etnOyuxwSTr29X7aF/ueuP +QKPNxcoi5qByGI1o3XBEoXzBgqaYar5jSJgMASzGo4r1e2qlwFThTFXn7uNrZlfUO7o LWzA== 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:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=dyN97zqnQOtawahr9H9JZrTAb2NxaQxIsLGOarR9RXg=; b=F/MUU7oYS7qABIPXkNuwUoqgGuo+iJJSKuVUEvMILi2Pa3Ps/WmR+MFZ70y/5K2ms5 wnDOpRPr7PAjE7rT/fsWoutbnJoE7VAgHo8hFJgQgvJ3gSYvGvF0PK4WJyLo3Cd2usRm fBdbyCXzg12nQ4Sk/PJ8UCyzlF6n6zRlbN75Q+JjDpBS9mMUiwiOLP4mBKnCObYR0AVz HM0x1DxQGxT4jjXcasquinkFSzW/KkFWBMTKS87/IfyXPw307umUFOFv20Np+NigS75n H9J9nKZ7dSqQqvVB73CP70dEJcuG+yxr2J7dKC1cAWvuNkAJOj2+9zG0d3DRZro4lyDQ +eiQ== 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 r25si13483934ejx.486.2020.08.18.20.42.33; Tue, 18 Aug 2020 20:42:57 -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 S1727776AbgHSDFN (ORCPT + 99 others); Tue, 18 Aug 2020 23:05:13 -0400 Received: from mga14.intel.com ([192.55.52.115]:45388 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgHSDFM (ORCPT ); Tue, 18 Aug 2020 23:05:12 -0400 IronPort-SDR: f5CvnXkEXvNh3RIqMMQAyb2TORvQnyhh3GBv8vREkxUG5FMXFYYvnZkdUp5Lu6XZkQiWKfo1Sa c6wi2I9jjfcg== X-IronPort-AV: E=McAfee;i="6000,8403,9717"; a="154303446" X-IronPort-AV: E=Sophos;i="5.76,329,1592895600"; d="scan'208";a="154303446" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 20:05:12 -0700 IronPort-SDR: s+saYji99ULqmAoVtci/uAy6Q6OAVxXDlPQIPfE9XSjw3yHMoiO7WpUm1bsKP3kIja8ArQq9jQ puitc8RCXNDw== X-IronPort-AV: E=Sophos;i="5.76,329,1592895600"; d="scan'208";a="472059985" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.238.4.128]) ([10.238.4.128]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 20:05:08 -0700 Subject: Re: [PATCH v3] perf parse-events: Set exclude_guest=1 for user-space counting To: "Jin, Yao" , 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 References: <20200814012120.16647-1-yao.jin@linux.intel.com> <20200814124722.GG13995@kernel.org> From: Like Xu Organization: Intel OTC Message-ID: <3521b375-6f00-e815-94e5-49eae2a7c989@linux.intel.com> Date: Wed, 19 Aug 2020 11:05:05 +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: 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 2020/8/17 10:32, Jin, Yao wrote: > 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? My concern is about do not break the perf kvm usages and Yao did it in v3. Tested-by: Like Xu >> >> - 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? Do we really need to support sample guests without using perf kvm? If it's true, I would prefer "cycles:uG" to cover guest user space events only, "cycles:kG" to cover guest kernel space events only, and only host events are sampled without the ":G" modifier by default. I am not sure if ":G" has been used in perf. At the very least, this v3 patch may not block the follow-up patch from Yao (if any). Thanks, Like Xu > > Thanks > Jin Yao