Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1040179pxb; Fri, 21 Jan 2022 08:38:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJweSNw4X49BJkWeWfHJed24Mz2DPeJhG0NBOrSKocHdFnaajO4DKpbV9BVv9uhIN1RJ4veZ X-Received: by 2002:a17:90b:1a8c:: with SMTP id ng12mr1568199pjb.184.1642783118150; Fri, 21 Jan 2022 08:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642783118; cv=none; d=google.com; s=arc-20160816; b=PqiS93txZQC2z96k2UamYniUYSLH/tiGiLK3Lf7Ts8Q4tfp4bCgRkPH1tR/KeOx2Cx N2Nim/6SFwk0Q68B/THaMaam5xYedOBBPTJOscWEAa58fXJiQkuR7QNeIGavygU+YtyD GSCat92akJ8FcoZfHnLlTElXIkEO3cJgRzwaDlivNk/tTgJOByCkwCHjPvoM6ji0K4eq kilP+47ku6SOiD790osNZxrqBoV6XVkP67ekJvnQ9YJKXpa6peGa6Kb8ELfhi/jMPCZB DM4S+o4DAt37M5hQmUkl+47Ce5Ln+WUSmNIif5EwoZ8A1qS8GHAHW5jR1wRh87kfbyjX wBOw== 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; bh=csG7BP0E5MCycApgls4Xoh4zoNViHjehFaQcFY5DDdE=; b=KmPt0OTQ2CpaD721NwJ45b+Pi6LPmeRSZaaUavKehe9ZqkXaRCktYTZ8apLFxTGlQR fNY7iDGPg09HQHqImoxBpbYqPaA6XQNb1mSYALhRrwsFGXPyhKZIdLVyn5JF6yCNr8mo jKSfuspXBB8CJALNjK1C2StSuYQUqKJe8AvN1ru4EY043gW++dyG1bIMvD+xubXGUskI YjoL+mP9lWJm0qYcDNiHRqJMf/I9V1qaeTkqKHN13Ub0fgffiD2i9WsADhhrHmL/yKRU 4viaO/GL2Gx4d7gNKp9OSJXJKFp2G2juAX0FUjeycrGUosyWl60vbmBBriOYoMKZ0jv/ WvYw== 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=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 j6si334087plx.362.2022.01.21.08.38.25; Fri, 21 Jan 2022 08:38:38 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbiASFCL (ORCPT + 99 others); Wed, 19 Jan 2022 00:02:11 -0500 Received: from mail-lf1-f54.google.com ([209.85.167.54]:36468 "EHLO mail-lf1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiASFCJ (ORCPT ); Wed, 19 Jan 2022 00:02:09 -0500 Received: by mail-lf1-f54.google.com with SMTP id b14so4462992lff.3 for ; Tue, 18 Jan 2022 21:02:08 -0800 (PST) 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=csG7BP0E5MCycApgls4Xoh4zoNViHjehFaQcFY5DDdE=; b=0Qrs1KSGmD+f6dWXqqL4Kxop73DOT3gZK7n+kmObPzjoQStzg6IG36Hxa63WE13Kv2 qfNif3Uw2RC7/4ca57C5K4GVtindScnb/FC91aTAZl2WXCSw9l5wi7GeTYDsYdnvR4wl jFsZhlH+755q2o6XckWlrwwwu+893g+M8wfPbN6W+ZHfbsDDcQXuZj5tsukdlOQuBE/j ukvkzadeXUqG2zWZwRzh9d/OiNoS7GJKJXqapp0db5aIqeL4IOTp6LE8VRWToHLcXtTx bpxaFoOT5umdMijH2lbya3eZUMSwQ2fHswSGRiVKXu8mbmJg1FUAnren45X4vA7GFouu AA+w== X-Gm-Message-State: AOAM5311M6vxK0+1/dHQ/n8dqpLF3Yv/xwEQmUXflnxJb3olohC1Y4ZZ 9uGtRjwFc1ZB1wxS9G1uM+ggzvs/6OPwvEaWrJ3XtXiV X-Received: by 2002:a05:6512:10c6:: with SMTP id k6mr15634494lfg.99.1642568527871; Tue, 18 Jan 2022 21:02:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Namhyung Kim Date: Tue, 18 Jan 2022 21:01:56 -0800 Message-ID: Subject: Re: About perf tool set exclude_guest = 1 on guest environment To: Eric Lin Cc: linux-kernel , Jiri Olsa , Alexander Shishkin , Mark Rutland , Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Yao Jin , Greentime Hu , Paul Walmsley , Vincent Chen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Jan 17, 2022 at 8:05 PM Eric Lin wrote: > > Hi all, > > Currently, I run the perf command 'perf record -e branches:u ls' and > 'perf record -e branches ls'. It will set exclude_guest = 1 as below: > > # perf record -e branches:u ls > # perf evlist -v > branches:u: .., exclude_kernel: 1, exclude_hv: 1,, exclude_guest: 1, .. > > # perf record -e branches ls > # perf evlist -v > branches: ..., exclude_guest: 1, ... > > As I understand it, set exclude_guest =1 will not include guest counting. > May I ask if I run the above commands as a guest user, should the > architecture implementation ignore this exclude_guest flags and still > make perf can count guest events in Linux kernel? So do you want to run the command in the host? Then you can use both 'H' and 'G' modifiers like # perf record -e branches:HG ls or (for user-mode only) # perf record -e branches:uHG ls Thanks, Namhyung