Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2325318ybl; Mon, 20 Jan 2020 00:29:21 -0800 (PST) X-Google-Smtp-Source: APXvYqx7MSEoDDGS72U7P+A26lq1N4zx5dI1s42+BQiRT8YELfkSU+wmctFQHfV57+/oeEWkTH9p X-Received: by 2002:aca:3f54:: with SMTP id m81mr11616217oia.73.1579508961121; Mon, 20 Jan 2020 00:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579508961; cv=none; d=google.com; s=arc-20160816; b=mwfTV2fs8LF+w5TYFB9oOnutut87VRsQVsa4EDhbkuSe2McrQM+9AC9xyeJAhEU3gX d/DFVNJA8aMNiiz1LHQogucb2KvnxwQzfc7M68ppAPtK7tyx+Y3J57GYl9CDSLds67Tz yZqTt/VcVnvsLaL7/kbzV6MEFTWgN5n+CRy5j7NovHxAI4HFDN1jwSSF5THRVrht5cD4 qvz6T/MBwNVYmRvlxje6t+sPoNz3Ammow59KU2QSiI5gEyWf/pVhRLeNhE4bOxwtFAwN NVMRbAoZFkQbQZL/jg+2VmIN1ZMndBDG50314AFBU/rBb5j/I1lD6LglwlaVsnr5w0Lq e6eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=nGcsw90E3OdL6vpljzKSCHrRrSRA1+lFkjr3kvJ6YnQ=; b=gdfXOPuxDQ8Iiv2bgfXiDT1uexTgjsIn+56mtm1mrD1l++yRfyYN3cCaTc6JOI394Y jt0aRg2EGkyZD1V/Yj4TdANfgBOGerPSPMg5Q31gjj19JAFdT4UzAOXB1E4K9eY1eFWE cjSmUmcxl8NXEqu6FYfddRqatvQqJ19O2IQWKYpKdZLLoL/h8P1H7AB3phIk3vEeyWj4 yG+h1peB91BhSkz5kPL83LlN4G+Y3JtKpebJjKXd0o685g0kDZSnnvciPDgzpC1MxVqP aZJycnShYIn6RR/BWGbMuBdyUPgQ03JnQkv+2/+dNXsfJnKvhVex5zcG3qjq57ERGCbB PC6w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si21491335oto.129.2020.01.20.00.29.09; Mon, 20 Jan 2020 00:29:21 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727422AbgATI12 (ORCPT + 99 others); Mon, 20 Jan 2020 03:27:28 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:60784 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbgATI1Z (ORCPT ); Mon, 20 Jan 2020 03:27:25 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1itSOw-0002te-89; Mon, 20 Jan 2020 09:27:14 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id CD7A41C1A3E; Mon, 20 Jan 2020 09:27:13 +0100 (CET) Date: Mon, 20 Jan 2020 08:27:13 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] libperf: Setup initial evlist::all_cpus value Cc: Jann Horn , Jiri Olsa , Andi Kleen , Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , x86 , LKML In-Reply-To: <20200110151537.153012-1-jolsa@kernel.org> References: <20200110151537.153012-1-jolsa@kernel.org> MIME-Version: 1.0 Message-ID: <157950883357.396.5010464056338949713.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: cb71f7d43ece3d5a4f400f510c61b2ec7c9ce9a1 Gitweb: https://git.kernel.org/tip/cb71f7d43ece3d5a4f400f510c61b2ec7c9ce9a1 Author: Jiri Olsa AuthorDate: Fri, 10 Jan 2020 16:15:37 +01:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Tue, 14 Jan 2020 12:02:19 -03:00 libperf: Setup initial evlist::all_cpus value Jann Horn reported crash in perf ftrace because evlist::all_cpus isn't initialized if there's evlist without events, which is the case for perf ftrace. Adding initial initialization of evlist::all_cpus from given cpus, regardless of events in the evlist. Fixes: 7736627b865d ("perf stat: Use affinity for closing file descriptors") Reported-by: Jann Horn Signed-off-by: Jiri Olsa Acked-by: Andi Kleen Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200110151537.153012-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/perf/evlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c index ae9e65a..5b9f2ca 100644 --- a/tools/lib/perf/evlist.c +++ b/tools/lib/perf/evlist.c @@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist, evlist->threads = perf_thread_map__get(threads); } + if (!evlist->all_cpus && cpus) + evlist->all_cpus = perf_cpu_map__get(cpus); + perf_evlist__propagate_maps(evlist); }