Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1641702lqt; Wed, 20 Mar 2024 09:40:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWh6xY4Hv/XAQ/h5g0eOHGW94UbPV3Jb6leU4TphUE5y0br2AgXgNeqw1xaNuTxoa45cTfUKIUX9B8RgJqGdwvz/UgP+6LRhZwpQHnoHQ== X-Google-Smtp-Source: AGHT+IGt6yk9PfmRgF4zptxq3jhs40+7RnHmycDfBQkVyb1urDGme/J+suSQc8p2RWjllpzOVxCO X-Received: by 2002:a25:a2cb:0:b0:dd1:6fab:81e4 with SMTP id c11-20020a25a2cb000000b00dd16fab81e4mr2258221ybn.37.1710952857614; Wed, 20 Mar 2024 09:40:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710952857; cv=pass; d=google.com; s=arc-20160816; b=bm4my7VzlBM1i9anB8ecSpJfXcBQsjrPSMBHZw3vZSnBON5HIFGzT+crflZCOPE1Xw x4eNMio9wngMvN6GjAlNXEDhw98qtODzD+rQ7SkD2gUW9wdT9oTjqc8VK39rBVQDUmql Wv2Y/iDwNmPpj6+0QXtyUjEEdqqS4mviy+UAg7H9zX/dvzHI2JJzudUda/PTuxx2TbWX 41sHQTInY8Dlyo8jBs0vxvdj0dMwSi4UhbhMU7E5F6wjpDPomDOjnDzt1er2Zh1mJgdI 6O4LjJEh1273rSOXy3Zu758sEb7srESkIumFRZHgjmus6DiP5bdnftHHDl8EwxZ7k4zS dVWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=E2Iioua2lyhsilXiJJfaF8CCrcEUXRoDq4VH/C+Uq1U=; fh=k02oBf4UPKAoDRcZBU/jo7Xfqhn6kAGueVZEuN77qrM=; b=MIAb6it0D5PfPC8m8VfOx9A+FK3oUGL7E0W/c+Q13zQbso6Pm9DBpN4ph+aC5PATY2 sv7BkMAW1VNYRBcRLqMMiH9MKIVX+B+0q9n2xG6ufCJWxU7te1+DEy/xa5OCEyvLEoKC U7+qGvYWa9rOPo+/HrKPA9NAs3TLMe9tokmg+BosNYZ4KC1+AsXbBBY9CvxneKsXU881 0Gd5s0rGgn1XpFQKcifDvLzMY9PJwCSdpSoR1AfSMyFR7nr0heF5vcio/GFtFoF9qqsV 6ngtwgIkluaTSgXGig7c7DuNXOAtJrJcrgvFg//hph6B/uznZ3Wr8BjyFhC6WAUO+Lsx 4Inw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=B2TYOo+T; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-109179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p12-20020a05622a13cc00b0043114a72283si1043525qtk.750.2024.03.20.09.40.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 09:40:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=B2TYOo+T; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-109179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 579051C203D7 for ; Wed, 20 Mar 2024 16:40:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB16B23B0; Wed, 20 Mar 2024 16:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="B2TYOo+T" Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C0BA15A5 for ; Wed, 20 Mar 2024 16:40:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710952847; cv=none; b=Fl6s4s7SFgSdukOPG0qye/sGztIzBsUpgwMUJQaUNQ1heq3cHvGWXZ5Gu/7wQk7vwsR7bidw9RCprew5OpNZTuY1DcB/RbZjtk27ih/RA+rOdGIaXBpLslPMEwO8WnV7gaN3zQTCOgB76YfWz3zRRzq60pAffe8OtQC8derxLIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710952847; c=relaxed/simple; bh=IPFJcENiCyzyUJ0Rcq2tI05Ded+kvu7vtcAY8HhSnFM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sHtF3rTDbyFvRwnbysEXilqWJHiMni+LJWpA1a8eZapZIdxRxqk/Bt4Uuc7WRgGSDkod1tDEsOSSxbLqVP3RXtcN30WQSVzlH3SV3ux0Ai90SdKANPgcSfyveKSzXCd/yXziwQZxhJC/T/sKEG9KS586gHVhjBRsa8NVEtxSQow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=B2TYOo+T; arc=none smtp.client-ip=209.85.160.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-42ee0c326e8so2551cf.0 for ; Wed, 20 Mar 2024 09:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710952844; x=1711557644; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=E2Iioua2lyhsilXiJJfaF8CCrcEUXRoDq4VH/C+Uq1U=; b=B2TYOo+TB5/IzVY/NQHHP+S2PCrjCrzwDxoydNWzbz2sb+34SjrB7/daM35F6KKQYy m3rXSqNHJwuhvrZTTsxTjgYWeY48+ZH2w2Ei+aD5cc14UGb3xO0b8j2VYspZkL3TpR4N 0jcwlzSer/4G/BcU5KrR2JbOxGFY5aw6v0FnNIJLNx8M8pD4SstnQ2GaoQd6BINXbgVB bd6O7AkiMWZNWwAdRHrJZwLLjsKzHqEVNqqOMfOtuTFUI27iopl3M7tDe/IrKqU+4rE3 s4rhHP2rzauXe148UmHDNxonq/GTnUtM8XyvLbN//vNImbwPe8FKa5lPYMvF3VvrT0Cg 3e+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710952844; x=1711557644; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E2Iioua2lyhsilXiJJfaF8CCrcEUXRoDq4VH/C+Uq1U=; b=kIn1ZoyYj7aZ/8NF5mDQ2ujKWmGoJRObn28tYQBeEUn4GapINhMOHkNnS/db8z0UVz yW+OUDcZEw72CRA+6GgvxARLHcDZqA5IJvfVQRyp0Mtun5Lxua/cyIn24laIZ5CNgLm7 f+7VpdfLvcthMAgejoqJZO9tcjMIEm1Kl/LVNQ5LwpgpDpmuzKzlEdAGNGMgUYu4e8UI amaKfzoPYell/TTaDtZLzBCOfz8ME6IDc56vq71XArQdSsnFWd6WqbEvSWf192ANOluQ YAXyH9DkPl7XYveiJB1Uyf+wgAtq07PU3BurWLBvlJ3z5NKt4KKnSYu/2BC+rLuPfibB pN/Q== X-Forwarded-Encrypted: i=1; AJvYcCXXMKeDONOwKBCPDTr0eTDb8jR2dgTkyXKoZVY6KpyCThXR93jUaqFHbtA5DbH5EdgAopI9UmH+VJlUvRgCPkojHAMW9G38bEy0/H8v X-Gm-Message-State: AOJu0YwvuYOSJSlZ8+seiJJ6wqmIXnSlgd86SyrfjP09s4AdbvLn95f/ ridspmVN1ppuM631NtuLa/Szy/Iq26FR5ZXUALNYRfULkc8iEMhJ/9x/tujNA/EHdTvdmoZFI5U NDssEnm9j6rxGyEadK5WGKKOE+Lo/w/rgWXaz X-Received: by 2002:a05:622a:1904:b0:431:55a:57fa with SMTP id w4-20020a05622a190400b00431055a57famr221576qtc.16.1710952844403; Wed, 20 Mar 2024 09:40:44 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240126085444.324918-1-xiong.y.zhang@linux.intel.com> <20240126085444.324918-3-xiong.y.zhang@linux.intel.com> In-Reply-To: <20240126085444.324918-3-xiong.y.zhang@linux.intel.com> From: Raghavendra Rao Ananta Date: Wed, 20 Mar 2024 09:40:31 -0700 Message-ID: Subject: Re: [RFC PATCH 02/41] perf: Support guest enter/exit interfaces To: Xiong Zhang Cc: seanjc@google.com, pbonzini@redhat.com, peterz@infradead.org, mizhang@google.com, kan.liang@intel.com, zhenyuw@linux.intel.com, dapeng1.mi@linux.intel.com, jmattson@google.com, kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, zhiyuan.lv@intel.com, eranian@google.com, irogers@google.com, samantha.alt@intel.com, like.xu.linux@gmail.com, chao.gao@intel.com, Kan Liang Content-Type: text/plain; charset="UTF-8" Hi Kan, > > +static void __perf_force_exclude_guest_pmu(struct perf_event_pmu_context *pmu_ctx, > + struct perf_event *event) > +{ > + struct perf_event_context *ctx = pmu_ctx->ctx; > + struct perf_event *sibling; > + bool include_guest = false; > + > + event_sched_out(event, ctx); > + if (!event->attr.exclude_guest) > + include_guest = true; > + for_each_sibling_event(sibling, event) { > + event_sched_out(sibling, ctx); > + if (!sibling->attr.exclude_guest) > + include_guest = true; > + } > + if (include_guest) { > + perf_event_set_state(event, PERF_EVENT_STATE_ERROR); > + for_each_sibling_event(sibling, event) > + perf_event_set_state(event, PERF_EVENT_STATE_ERROR); > + } Does the perf core revert the PERF_EVENT_STATE_ERROR state somewhere from the perf_guest_exit() path, or is it expected to remain in this state? IIUC, in the perf_guest_exit() path, when we land into merge_sched_in(), we never schedule the event back if event->state <= PERF_EVENT_STATE_OFF. Thank you. Raghavendra