Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6420205ybx; Mon, 11 Nov 2019 08:52:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwuHlCsm+Yto+5Ggm5Rjarrx0EMVfg83T+sR63AJxVlQNNngbuty7aYKHseXpwl0layBK8H X-Received: by 2002:a17:906:95c4:: with SMTP id n4mr8059830ejy.39.1573491132307; Mon, 11 Nov 2019 08:52:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573491132; cv=none; d=google.com; s=arc-20160816; b=g9VSy/zd52Y8Wj+AtzNL9ztIsBCfjWFez48aOlSRUk0sxKctjTvvu2wq/Grea4IpM+ zOt/4gkMCMFCOnrsCWsWWcSpl3Z0pFykeVn6EVXh60zzJ965Wu27MRW1SQ335HedSfqf t8mcdRDBnLGSsVM3iqFtIiWJ86lj7+uVn5V4oOZTzCC9GrvRJe0P6K4mZTSBhE5YpdJ2 so+iCVCbAwalstgBAkbJ3NU79H8bNeyNqxGc9RUQBElGpaVii3PC0aP45j/QHencjkwR 1s+/4MNLA0QjV+txyh+wTPGHtodh3sXrhB7vvVBed5JL54uSmjZ7XeSpExOJ9hFxYprt OOtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uJNrROvj3GOpyNL7F9frqP6b2jtrAKrMACLAb8Cy+Fg=; b=j/t5qJwzx9yri/bm1pF4ojN3Wm6dXqLQVKWfZR3dLMkKB9ldWLuVeh6qAkTYFkiEsf NBoo/dPSFCol+Ec+V8JFxRs6IBMh+wuz0J5LhL6j/racfRVNL24J+17yrXBwImx3v8D3 5mMuISNXva6f3WCPJuasfsoPn2n6RKwiUDpZIyZOUdNmKblxTzJZld6cRl0YJWZjkze6 ZwypAtIXyq3Zlw30vzekg+CTvi61YsrgrikHTEdA0Txa6XKwWvo95o9nTmQUDCtvXwfS zaMyMDY1UDOuUComFmYaezA/BquYppj0KF/Sc7mFTOhJpnejtFN82GEVggMjmmcN4NZ0 YR9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b34si11704710edc.74.2019.11.11.08.51.48; Mon, 11 Nov 2019 08:52:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727020AbfKKQua (ORCPT + 99 others); Mon, 11 Nov 2019 11:50:30 -0500 Received: from mga07.intel.com ([134.134.136.100]:9514 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726985AbfKKQua (ORCPT ); Mon, 11 Nov 2019 11:50:30 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Nov 2019 08:50:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,293,1569308400"; d="scan'208";a="202385368" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by fmsmga007.fm.intel.com with ESMTP; 11 Nov 2019 08:50:28 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id A39E3301376; Mon, 11 Nov 2019 08:50:28 -0800 (PST) Date: Mon, 11 Nov 2019 08:50:28 -0800 From: Andi Kleen To: Jiri Olsa Cc: Andi Kleen , jolsa@kernel.org, acme@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 13/13] perf stat: Use affinity for enabling/disabling events Message-ID: <20191111165028.GC573472@tassilo.jf.intel.com> References: <20191107181646.506734-1-andi@firstfloor.org> <20191107181646.506734-14-andi@firstfloor.org> <20191111140415.GA26980@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191111140415.GA26980@krava> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 11, 2019 at 03:04:15PM +0100, Jiri Olsa wrote: > On Thu, Nov 07, 2019 at 10:16:46AM -0800, Andi Kleen wrote: > > SNIP > > > diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c > > index 33080f79b977..571bb102b432 100644 > > --- a/tools/perf/util/evlist.c > > +++ b/tools/perf/util/evlist.c > > @@ -378,11 +378,28 @@ bool evsel__cpu_iter_skip(struct evsel *ev, int cpu) > > void evlist__disable(struct evlist *evlist) > > { > > struct evsel *pos; > > + struct affinity affinity; > > + int cpu, i; > > should we have the fallback to current code in here (and below) as well? > also for reading/openning? The return only happens when you're out of memory, when nothing will work anyways. -Andi > > jirka > > > + > > + if (affinity__setup(&affinity) < 0) > > + return;