Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3989466ybz; Tue, 28 Apr 2020 03:56:33 -0700 (PDT) X-Google-Smtp-Source: APiQypLbW2+I3pcd5cAloqwO/Ee8Uk5ONNaJPC+f8KlVnoPrDCuXIBnpCBvW5izcOqBxwR84FOj2 X-Received: by 2002:a17:906:3492:: with SMTP id g18mr22907834ejb.112.1588071393596; Tue, 28 Apr 2020 03:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588071393; cv=none; d=google.com; s=arc-20160816; b=r4fFZajXNrZrUTrP12VRFIvLi3QGeyUT2C76WaCh0tTk906/aK2QN1EQY6YtAhdNsz hptLCzqakvk7sHaDnzA0W65pYQx+Z5NRmjZeeGIYDi7h74IVumZ5siEryeO7oOPwVYG6 jdqVeftF0Qa8opQeVgi6EZPfjOv/UPN0nLji783Xo00MVikkz8iX73bsS3uM0Uzn4GQV 4vX1de4lowwPwYdn80/aNT0cLtvVf8j3GU7Ui6T+XGT+SFkCTCGOxEPaAD6OX2y8Ss9z xLgPH1bb9uA/xV3m+3Rv4lCCt5qd71UOZ4WPBtQGF0f6iL8W9oA0HaPTUprGOUnq84Db D3GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=j+DATouWaEe2jPNagjdiXPLUjwQpgYMzZZtq37hZJbg=; b=IPtyIcvU54dSSLujHyBAIeQsWbhcq/8i6g+c3RWX1khWJnXnnRPDh2fA0jKpOCiN+7 JUoGjPMCNQO8obQj6Mk/pudvzEZHM6y9TVhatzXNkpcZODViN6VyDn/+1OEoOwpDjU2/ SeGAg9fIxbW8nKQDsX3knHKZiXoI3MWJrxCmsvCB7QZI+v5f+eK9zGQ4PMVGC0PB82Lw qHzEuJbi/qGkpndGyzQ3RYRVUa+oP7iVWoVSEdQNTwVJDGf05qslfPVdWwHhs13EQn6b vCBQNpYwLNBQW/tvAEJFDAvuBGse5Y+GaG5lqly8ioRwl0kdL48dTM2ndRJ3ysk10VHG pd8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CreWbZrG; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si1388544edq.498.2020.04.28.03.56.09; Tue, 28 Apr 2020 03:56:33 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CreWbZrG; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726416AbgD1KwI (ORCPT + 99 others); Tue, 28 Apr 2020 06:52:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:45441 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726406AbgD1KwI (ORCPT ); Tue, 28 Apr 2020 06:52:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588071125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j+DATouWaEe2jPNagjdiXPLUjwQpgYMzZZtq37hZJbg=; b=CreWbZrGEMK/VcBB5e01DBn34JU0/+RPEpCA4/e2WcKRF+068I81SmqolCL8ii1gKfgRTG VTMGQ1rViz0fHVyGLtgonpMZDE3tYnqba4FJbIxrnMxUIEoxwXhsBh+O6fzxWyyj980+Ji xa6Yqzmn1BPw4bPPP9qHtihMBb/o4RE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-Y21dZNK8PKKsYSs6Fo-svw-1; Tue, 28 Apr 2020 06:52:01 -0400 X-MC-Unique: Y21dZNK8PKKsYSs6Fo-svw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 446BC84B8A0; Tue, 28 Apr 2020 10:52:00 +0000 (UTC) Received: from krava (unknown [10.40.196.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF32B1001925; Tue, 28 Apr 2020 10:51:57 +0000 (UTC) Date: Tue, 28 Apr 2020 12:51:55 +0200 From: Jiri Olsa To: Jin Yao Cc: acme@kernel.org, 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 Subject: Re: [PATCH] perf stat: Fix uncore event mixed metric with workload error issue Message-ID: <20200428105155.GG1476763@krava> References: <20200427144116.27330-1-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200427144116.27330-1-yao.jin@linux.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2020 at 10:41:16PM +0800, Jin Yao wrote: SNIP > index 9207b6c45475..b01ee06b1965 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -1841,8 +1841,8 @@ static void setup_system_wide(int forks) > * conditions is met: > * > * - there's no workload specified > - * - there is workload specified but all requested > - * events are system wide events > + * - there is workload specified but at least one requested > + * event is system wide event > */ > if (!target__none(&target)) > return; > @@ -1851,13 +1851,16 @@ static void setup_system_wide(int forks) > target.system_wide = true; > else { > struct evsel *counter; > + bool system_wide = false; > > evlist__for_each_entry(evsel_list, counter) { > - if (!counter->core.system_wide) > - return; > + if (counter->core.system_wide) { > + system_wide = true; > + break; > + } I wonder this would break some expectations.. would it be more safe to detect duration event and bypass it from the decission? but maybe the case I'm worried about is not a problem at all.. Andi? jirka > } > > - if (evsel_list->core.nr_entries) > + if (evsel_list->core.nr_entries && system_wide) > target.system_wide = true; > } > } > -- > 2.17.1 >