Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp358035ybz; Wed, 29 Apr 2020 01:19:20 -0700 (PDT) X-Google-Smtp-Source: APiQypJHrXrVCSBOdMeSQniNyDMvTE1npeP85NifsGBo9eZCHYPc5wS8mVmfe8EhH01uixrrfcD4 X-Received: by 2002:a17:906:4d8f:: with SMTP id s15mr1558874eju.288.1588148360548; Wed, 29 Apr 2020 01:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588148360; cv=none; d=google.com; s=arc-20160816; b=LbK8husA92g2Wm2qC/AMzGdK1Pxu8pI/BuDa4OF9eg8kD8y5wum6t/WVLHLlk4TjaN U2al27gPVj0CGcLRNSmZ4tmMgDiDYddYQ2oOB6yILoCIiOHBiV/MSYRHj/xAAJE/Q58m Py9IN65/hc3Dhr+k7SNjCCLgxDqAWELu2ZnFuNTaByEtV87u5M5Wks8JF+Xd20RDVKSh 1VgYpH2AYnDYTzkuWNA35i+Jf/DC4FL4sE5NMfpXhI3bL5N4LuhHidJeilycQ/HLPTyh eJM9v+/9elK6HX1PeE02McWDCYHDhJe1x0nF+jddFudWWg/TeQ3+0Wb34tI6ifRKkWda O2fw== 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=gNkjTiGAz2R8MMqKluleYUcDiaJ0cWYcMV4d5C4/Ams=; b=d0TJcaFwBtVbuBn0+ErFKonMXB5vBWjMsWLl9YMhGL7oqREdNcOpEfjan+OP5TGxzn /DUZ3KBgPhoD8NwEVDRiHOdWC2tT56ddQRgYRtOvMzA3EIAIpfKvFyFsd/9NStV96Fta clvMBkuMjXRx2le/NnpoGD9sA79E7bh3OX4gTjF/0GerXn4nswk356T8h5AB2L+6IRT+ FBgjlhWYtX5sSuxcB92VuOpW0qgkoKygVjb2nMymQ8PmjYldGIPtgJjVh8zoUfXQD7Ky rj8BqdwKm33ZqBtOKMjBBsPBOc9sTa3symudLRmfM0YLdMG5PCLpNDQB7L5j7nPVJkwl Duxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Hk2hX4/q"; 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 g5si3224751edu.188.2020.04.29.01.18.57; Wed, 29 Apr 2020 01:19:20 -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="Hk2hX4/q"; 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 S1726523AbgD2IQu (ORCPT + 99 others); Wed, 29 Apr 2020 04:16:50 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57864 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbgD2IQt (ORCPT ); Wed, 29 Apr 2020 04:16:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588148208; 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=gNkjTiGAz2R8MMqKluleYUcDiaJ0cWYcMV4d5C4/Ams=; b=Hk2hX4/q/an5C+pRgT9ky/8OtdK+fiQyEPjKXD3nddRTMS6ILQ6hzJakSVcPo39TJXhG2j nDyG85kFqsJfWmdUah6U4ZhdBZ7lgB1CmS7ZLb4sU0QPPOYmwJBTQ/+5kWBEt6tBRHjxg+ kIVS/phrxAydPo+WML+0LqmN6ao1agk= 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-1-uVwcsBLmPnK3RrZcrkl7aA-1; Wed, 29 Apr 2020 04:16:44 -0400 X-MC-Unique: uVwcsBLmPnK3RrZcrkl7aA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C58721005510; Wed, 29 Apr 2020 08:16:42 +0000 (UTC) Received: from krava (ovpn-114-35.ams2.redhat.com [10.36.114.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B312E5D9E5; Wed, 29 Apr 2020 08:16:40 +0000 (UTC) Date: Wed, 29 Apr 2020 10:16:39 +0200 From: Jiri Olsa To: Andi Kleen Cc: Jin Yao , acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH] perf stat: Fix uncore event mixed metric with workload error issue Message-ID: <20200429081639.GJ1476763@krava> References: <20200427144116.27330-1-yao.jin@linux.intel.com> <20200428105155.GG1476763@krava> <20200428211922.GA874567@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428211922.GA874567@tassilo.jf.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 02:19:22PM -0700, Andi Kleen wrote: > > 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? > > Don't see what it would break. > > Yes maybe we need to special case duration_time more, but that would > be a much bigger patch. would below change work for you? if duration_time is the only case, I'd rather go with the special case for it jirka --- diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 9207b6c45475..2518204cffd1 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1853,6 +1853,8 @@ static void setup_system_wide(int forks) struct evsel *counter; evlist__for_each_entry(evsel_list, counter) { + if (counter->tool_event == PERF_TOOL_DURATION_TIME) + continue; if (!counter->core.system_wide) return; }