Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6634957ybx; Mon, 11 Nov 2019 12:10:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxhXFDBOQ+YO7z5GxMnDhUyMBNv+YAsOa2ijGbe3dkSPF3hOFakitgGR3AZkUcqUVA8IFD1 X-Received: by 2002:a50:ff19:: with SMTP id a25mr28382846edu.181.1573503026435; Mon, 11 Nov 2019 12:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573503026; cv=none; d=google.com; s=arc-20160816; b=Z06C7vxekIBuxEklvlnlMUIZ92XgggqxZ1D2zDKxViqlTCVRkQQLicN0zTiXNI6Dt3 OYkzkDhIS/A0DUfn8Gj3imk6BTcKKyD9ljgjEyXxiC0ei+CXlUHlITbUmjsg4bnei8VJ TJum2GtXKHhGT9RfnwwtDPVkwJdy5wqKec4FxnsZbLn+RyO3gHghjf27iW/UM5gYwc2l j7cryb2xg9OCDbpDU3ejSsLymlz7O9RH59dWdkpoH+UCXzHO/KmxlekVzGYoF2LLBmrO sCUdwGtwtJge9IROf7v1308qe0wnHWgeqzzUdJuIiztGlND/4HC2hfrsPBfug4O1S76V ecug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vh0lOxBTIyStTtSHCcKqLlpPPA7dotESbLsNyxBw55Y=; b=rGjLMIan+89AiKE0YzuCmSs2W26aElqMRNiQDLLYh7rnaTkOW4XxeDR4thByP/qb5H Pc5GoRZ0lhALbJ/tmKPvj82X73PUmKo3Y32D4JMYWjAXKxnqH9UxD3XVdpC3WJgKRyKt dRY5NIgsFlWccmVUb3YtbsfFrRUXXEN2GxSzxTvpQi07bpVVjzQKQ7zo4VeCHxQFAkcY E6UWxmWpn74AidNkKOZlg8gxYeLWpi+HN6GKlgDa1EedUxrhCtr0dgzqyiQM/DKr+kjF XGNBGDI3C0whXendXX2PSl3tHWuGBuCWWI2kAGEbdaLHrZQZ1l+y7jvm/cN5VoYRFiQ2 nkPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WZ0jIngn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k21si9606246ejc.148.2019.11.11.12.10.00; Mon, 11 Nov 2019 12:10:26 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WZ0jIngn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727136AbfKKUHB (ORCPT + 99 others); Mon, 11 Nov 2019 15:07:01 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:36531 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726845AbfKKUHB (ORCPT ); Mon, 11 Nov 2019 15:07:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573502819; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vh0lOxBTIyStTtSHCcKqLlpPPA7dotESbLsNyxBw55Y=; b=WZ0jIngnDrUnKMZNj5Do1au1v/XIanEXtSee0Il9OwopRJccRdZvtAj9kVZHshD3IDd8FB HYmrPlU1aQ99WQoMHZawFIbZj4TnjsMG88nP4wa3l1yLTkU43lafkDpMgrlgI63ZPjobnu Ladp0wqTmDPZY5KQovTnNKGrn7eHrDQ= 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-388-ylkYT010O8eIPpjcxLndVg-1; Mon, 11 Nov 2019 15:06:58 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 754BA18B9F80; Mon, 11 Nov 2019 20:06:57 +0000 (UTC) Received: from krava (ovpn-204-89.brq.redhat.com [10.40.204.89]) by smtp.corp.redhat.com (Postfix) with SMTP id 4328846; Mon, 11 Nov 2019 20:06:56 +0000 (UTC) Date: Mon, 11 Nov 2019 21:06:55 +0100 From: Jiri Olsa To: Andi Kleen 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: <20191111200655.GB31193@krava> References: <20191107181646.506734-1-andi@firstfloor.org> <20191107181646.506734-14-andi@firstfloor.org> <20191111140415.GA26980@krava> <20191111165028.GC573472@tassilo.jf.intel.com> MIME-Version: 1.0 In-Reply-To: <20191111165028.GC573472@tassilo.jf.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: ylkYT010O8eIPpjcxLndVg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 08:50:28AM -0800, Andi Kleen wrote: > 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: > >=20 > > SNIP > >=20 > > > 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) > > > { > > > =09struct evsel *pos; > > > +=09struct affinity affinity; > > > +=09int cpu, i; > >=20 > > should we have the fallback to current code in here (and below) as well= ? > > also for reading/openning? >=20 > The return only happens when you're out of memory, when nothing > will work anyways. then let's have some assert or BUG_ON on !all_cpus and remove the fallback code from close path jirka >=20 > -Andi >=20 > >=20 > > jirka > >=20 > > > + > > > +=09if (affinity__setup(&affinity) < 0) > > > +=09=09return; >=20