Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp882881rwb; Thu, 22 Sep 2022 07:32:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5c2/Bx4Y+EBN1MNqYyp6OCKle+ZceYMQWVyu885EgD6Ga71HGnn9r9jbv7hUPPlwVrEeDM X-Received: by 2002:a17:902:eb03:b0:178:29d3:5537 with SMTP id l3-20020a170902eb0300b0017829d35537mr3442658plb.63.1663857150650; Thu, 22 Sep 2022 07:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663857150; cv=none; d=google.com; s=arc-20160816; b=FqugPg9xW/feV/Xk+qKgWRj0Fo6dMkGTjV/sgIaTuOM+/50sFDQYHf73qE5O1CyJQ7 IJrlKra+qzKOTp7Ktk5MGs4qpU72L5A29lpSrZqVrE/VcPJMSzISA3kSB7CRvRbjKgGt d0djgRtCchT2R7xnHcBeTzf51VTUxry4+Aab5Jyx/a9Jvq1BhXrXnpY3DVM8Elu9r9Yi niitKC9MHaaesay8n89tSWuU8r/BbW9lNm1aKVUCPLF0RLksuss3ZuSwGaLpkHNAG/IF Hc7JHCajMEfBCPdf63zvby4KXKI+WW5U+5F2eVUj18Ga9N4DhYsBZzXFOwizgoT2DAP7 MH0w== 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=zNhQCtxWvF8Q4IPC7y5tVcrAmAIZN451YsFdgUZWDIc=; b=T7YeYtTEmP/mjokB3IYa1WUvt+ywv2CPTwAwSkdXkXfMFCsGs+39OCI06XUl4znukC HU1D3iJWNHgzlH49Dj+6lHmWlN3JS1jR+/tpemRgk2iRaw6eDVS/fV9nSAnF0FLePbK5 ofAsuwhuto81czp1HzUejVdm0jo+caOzSm5ODQXzHpWZfwCFi7OrnwzIWIYfyJXa3Ur8 NQFqHiLzqDpmQrmS/z9eg+/gdDTOrKGzkXywSf+7xudk1pRWDUmCz4OuaVqvOTe1WbkN bVspFSywl/bgz7PL57KCfSSk/zcE5675Zhzgw0EywuLJYVo5fngQCZ18YSIRKUELmf3s wNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=A7i7iCjs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020aa791c4000000b0053870bd5555si6241564pfa.90.2022.09.22.07.32.16; Thu, 22 Sep 2022 07:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=A7i7iCjs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbiIVOJ6 (ORCPT + 99 others); Thu, 22 Sep 2022 10:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiIVOJz (ORCPT ); Thu, 22 Sep 2022 10:09:55 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3B329803; Thu, 22 Sep 2022 07:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zNhQCtxWvF8Q4IPC7y5tVcrAmAIZN451YsFdgUZWDIc=; b=A7i7iCjsZIyacHXjYkAX/Is2WG nYl2smRxQ+vg/w0NtHXTN7nsAwptTVQa/DD1mchpHaecIYUzSLH5c/MsTtcQWrBeUYySiIEOyiZOB RgOmu9kVpSOQ0sZJtg96+sm7Oo+XBI1e12tZ5ZCEi6BKQBaLUGeP5jmyJnLBkd2wHmqFUSKs77Vsg REVJNeT6iicS4GQtsyq8D+KNONDTXnpD7I7/K1STaqFNTyaqpwGMK0+Y7NINryPQW47137XE38kV5 kvdSiP5bVt2kJW0S684xSdn5XRTV6ST7vbr2njJUPR2SQ6hqZ9NEVqCi3LpTYppAPNk9ZDpHRQdAn i8eeZB0A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMtR-00EyUS-GE; Thu, 22 Sep 2022 14:09:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 85E89300169; Thu, 22 Sep 2022 16:09:32 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 61E3B2BBF7EBF; Thu, 22 Sep 2022 16:09:32 +0200 (CEST) Date: Thu, 22 Sep 2022 16:09:32 +0200 From: Peter Zijlstra To: "Wang, Wei W" Cc: "Liang, Kan" , "Li, Xiaoyao" , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "Christopherson,, Sean" , Paolo Bonzini , "linux-perf-users@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Subject: Re: [RFC PATCH v2 2/3] perf/x86/intel/pt: Introduce and export pt_get_curr_event() Message-ID: References: <20220921164521.2858932-1-xiaoyao.li@intel.com> <20220921164521.2858932-3-xiaoyao.li@intel.com> <175b518c-d202-644e-a3a7-67e877852548@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 22, 2022 at 01:59:53PM +0000, Wang, Wei W wrote: > On Thursday, September 22, 2022 9:35 PM, Peter Zijlstra > > On Thu, Sep 22, 2022 at 12:58:49PM +0000, Wang, Wei W wrote: > > > > > Add a function to expose the current running PT event to users. One > > > usage is in KVM, it needs to get and disable the running host PT event > > > before VMEnter to the guest and resumes the event after VMexit to host. > > > > You cannot just kill a host event like that. If there is a host event, the guest > > looses out. > > OK. The intention was to pause the event (that only profiles host info) when switching to guest, > and resume when switching back to host. If the even doesn't profile guest context, then yes. If it does profile guest context, you can't.