Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp959361ybl; Fri, 10 Jan 2020 09:33:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyEchLvUrSdH729Us9VIyAA07wzhDBh0Lpt8gu3QRGVDBfKNCbNSu3ozaQoqn0DuJFanVOp X-Received: by 2002:aca:2114:: with SMTP id 20mr3196897oiz.9.1578677619490; Fri, 10 Jan 2020 09:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578677619; cv=none; d=google.com; s=arc-20160816; b=epGevHsKIo51y9N4nj7aYTeXC8fptUqoeRpjulXXVF0E6Vg4JQIiFRfjQxieEQ58lI kqV5bVnTGz6SIdfl1EZMK5oo7xf24i6SGJTw6L25sxXS7imIfLNYGLiI0m7W3dtKMZa8 4j+WB89AAGUOhBjPFX7TMgnU229Et3B3izcOPVuqWSnk0lm65az3Bx0Sc0z3h2kpSLnV JKQqjkkqFA8DrE61I+3Ltojgcj2v+39cpvzGaqiaEeraeC/eAu47UAOWnclv2uVcDiqw Pnk8qdsewSNnuuqlxaP/x3+CcRPcPJ7TlA09KfbEUpd3rNGM2ajlVm1Fr6kLEF4idWAP C6Vw== 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; bh=vKeWdIudsu9b8CBAQ/KSRcyp+Cy+4cuJ5lwbbPRtabM=; b=mhaJs5gKp5QNwHmziHf2O6RF0SbUDinHxRmbA09ULE8joE5DWRIPen5Pti1s7RFFzd R4AyY/DYOzm4H8Z6l4y4kNnzyMTfsX1EqcYbg0vH/TuX85TnPohncsm4F0wchyovxXfO xAduldhr8K0JFiSvrnItA5/Dnv4mFRvadR0J2gxIkoxsJVd5rSuF5XYXMSADBHnq4ZF2 2NwLq4vpbHWCZYten2Mjghc0osJHvrLhKUoamylWPV+YJZV8uqZqr7VfVOmtUYpE6zop JmAx9fVV+6oreIBRDn+iG7HpOm6IS2OFDHp/YlEpoGS/EWYvWlBz88+ZbHl0OQm78JAR 7YnA== 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 r6si1651192otq.95.2020.01.10.09.33.27; Fri, 10 Jan 2020 09:33:39 -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 S1727197AbgAJRbI (ORCPT + 99 others); Fri, 10 Jan 2020 12:31:08 -0500 Received: from mga05.intel.com ([192.55.52.43]:49934 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbgAJRbI (ORCPT ); Fri, 10 Jan 2020 12:31:08 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2020 09:31:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,417,1571727600"; d="scan'208";a="224255940" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by orsmga003.jf.intel.com with ESMTP; 10 Jan 2020 09:31:07 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id B07C5300DE4; Fri, 10 Jan 2020 09:31:07 -0800 (PST) Date: Fri, 10 Jan 2020 09:31:07 -0800 From: Andi Kleen To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Jann Horn , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: Re: [PATCH] perf tools: Setup initial evlist::all_cpus value Message-ID: <20200110173107.GU15478@tassilo.jf.intel.com> References: <20200110151537.153012-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200110151537.153012-1-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 10, 2020 at 04:15:37PM +0100, Jiri Olsa wrote: > 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. Acked-by: Andi Kleen > > Reported-by: Jann Horn > Link: https://lkml.kernel.org/n/tip-kzioebqr5c3u4t7tafju8pbx@git.kernel.org > Signed-off-by: Jiri Olsa > --- > 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 ae9e65aa2491..5b9f2ca50591 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); > } > > -- > 2.24.1 >