Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp236510pxa; Wed, 12 Aug 2020 00:02:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU6gy/Pd3L1IdZOXzDxCW27HfkyO5o99NB/GjkesD6LqXk6cdAssuLHtMeWn9F/Oj48QBN X-Received: by 2002:a17:906:454c:: with SMTP id s12mr4641192ejq.339.1597215743491; Wed, 12 Aug 2020 00:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597215743; cv=none; d=google.com; s=arc-20160816; b=zJBRUyNwpViKhdfJwhhrShoWZJnBUj+RVY0vEyoZVfVfjvDkD5p3JIQycALR8Y0Ifa UizVOsiUjgeeVQ6DlVlFo96y9TQ2o2CwRtHea32C4cQ2H7Lt7ayB4W/boEIgsWFhdP97 6Gtvl5luDr36L8ya2h4zJSuOiMzez2DSIdoeVbQAI+4f1NHwwy8NB9o6WuzJPnfvtAst aUYm6iwX790GDllOqILEdZLf0rn1y2RvS6CK306g3Z4OCtRQTscE9XSoNkH7dFomkDre o5hHIvgx0SgS9xjRJPZykGyiCHhURb+rsVyiSw4abL68SPW5fI2gEkbCQGiu1fOmQMi+ OGrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=oV+0e7tYZSl99PkAY7HqHiLErB+BClu/6MNuVkmh4tE=; b=uDJFg/9oZtax0Mui4koZQK2UHNA5cxzsJI37fjG30/9wr7xYRQrBDyQSXMqSWXLibc j13Y6GPQyZcx9sI9JbjhxJtewndPQC4+0rbyk7T5nWPJfXOKxAIEBBoWGeWHKNzGRKHP lc54G8dWIzHzHv3e/fO3X91Msqy3b6RLmnBhPMq+GvA/Oudw4BkEZsqw5UmXQKgsX6x4 ErV+ZmEiDXEEqU601+co8GKCVOgHC/NGxje8XK1cnfg/iYlVYtI6036MjiT3mFZwBeUg kD7RVkuBs/bWwp3CsZlcAR7ZgBlBAuZP6SzHGtV6kVuMDyg80s12RWSrjeV6VJnJPYQE neyg== 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 g2si713909edv.36.2020.08.12.00.02.00; Wed, 12 Aug 2020 00:02:23 -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 S1726688AbgHLHAX (ORCPT + 99 others); Wed, 12 Aug 2020 03:00:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:19560 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbgHLHAT (ORCPT ); Wed, 12 Aug 2020 03:00:19 -0400 IronPort-SDR: IBaa/VuVjyzLqfEzBc+/KKDSLWa2BwpfElKUXd8IxrmzwIr6IUYBfFg7bFTw12tfPOteu9iefK T0EHgwBS8pRg== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="153123237" X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="153123237" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 00:00:18 -0700 IronPort-SDR: rkDGsL7AV1TKr1aeAiGEWGhM+jb9xINC8K3vDWH4vhPZkUIUvxQH7p9JDx/0atYOxUl5G69f04 CCBnrBYnl68Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="494932590" Received: from kbl-ppc.sh.intel.com ([10.239.159.55]) by fmsmga006.fm.intel.com with ESMTP; 12 Aug 2020 00:00:16 -0700 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, like.xu@linux.intel.com, Jin Yao Subject: [PATCH] perf parse-events: Set exclude_guest for user-space counting Date: Wed, 12 Aug 2020 14:59:53 +0800 Message-Id: <20200812065953.22143-1-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently if we run 'perf record -e cycles:u', exclude_guest is 0. But it doesn't make sense that we request for user-space counting but we also get the guest report. To keep perf semantics consistent and clear, this patch sets exclude_guest for user-space counting. Signed-off-by: Jin Yao --- tools/perf/util/parse-events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 9f7260e69113..4d809f1fe269 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1794,6 +1794,8 @@ static int get_event_modifier(struct event_modifier *mod, char *str, if (*str == 'u') { if (!exclude) exclude = eu = ek = eh = 1; + if (!exclude_GH) + eG = 1; eu = 0; } else if (*str == 'k') { if (!exclude) -- 2.17.1