Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5655372img; Wed, 27 Mar 2019 12:32:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzg44KWMpJwHNJvzTFLdq7+kMsaVy03+/w1j6oLO0IGiJP3nchGJLoMGQSapPdBm/VvJSwz X-Received: by 2002:a63:f74c:: with SMTP id f12mr35682432pgk.124.1553715178849; Wed, 27 Mar 2019 12:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715178; cv=none; d=google.com; s=arc-20160816; b=jn8q1JeZ754Iv+kED4x4mRcPidPSZLWxcDT946iiu4L28YINppNiIHgsCB6BpYgFlq 9fi6dc2gdGz45sKDKqjw8DMCYuQJL2giRxr0tdA9aFZPD90xR2vtleL3EKI/p8VF6TlP y565l/xvHUrLuNqgdDr3RLn1VL8mks144Fb/HmgwyMeuIx/5Q/IcmPwGuG7KJCTUvA/s 6LB+1tqDCR47PxG0vFwyskVk/Hlq/uP686Gce2e8Uhj2FaEqp8x6zR6ZdQpk0ZymvaQ2 ag0ZJMfdG/UGdG37QJaVbSe4iHhjPFX186ebO9XJUCYgtdWjaNGsIpRGZRzDJtDiScgI Hr2A== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SqYk1Afz4Cg6Z1LpWVgYapK9Kthd16ftCxHHSHW+BFs=; b=LLrxj1TEjxi8kJTsIErIR26wp2V4WDBE9s7YAiIxlsxCugbGdvvL67/DwhBbUZrxFu Tydz5IhFxDtpVBuqpPF8+dshssFcHyaPBJQbPU+WVu15uu4sb9G9h2idTdkrBYWhmsbZ rgE1eR417BwmZ59/ScT/+10a5z48OMlM8UAZiiYcmN724zzU3UzkUjJcz4e1ZJCoYiHj YYVmYxYMNYko8acXcMJeZdItvB6TdA0mstujKhNEfz8kxIDlxbVMZXC6vM4c12etvoYU 6fTGiPwV1J+q270J2+g2Dh1s8S8DHAhz8uIg/QY66XiphaHQUVDUlXVQ3I5egweaSNwV oHfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="IEe68W/B"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22si18816956pgv.562.2019.03.27.12.32.43; Wed, 27 Mar 2019 12:32:58 -0700 (PDT) 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=@kernel.org header.s=default header.b="IEe68W/B"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388139AbfC0TcG (ORCPT + 99 others); Wed, 27 Mar 2019 15:32:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:42706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731437AbfC0SCq (ORCPT ); Wed, 27 Mar 2019 14:02:46 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1591217D7; Wed, 27 Mar 2019 18:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709765; bh=x4MhSkptBmrxmSueydlgZ0nCt+DZJXIU//L7kIRqYOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IEe68W/BEdGdR4yA7sUrV41xKOqUG0dxAidPaE7JoCEcvLIrmuVlKkiEF+HUEtOkJ 8fXIwOnhvroSOG+gF2o/AiFwPRC25JiSdyhzkDSrvu6NVR2nFzSUV51SbdzH7K5t8A tHzlipfhpbSlMBolFmapfaNhs75I1wfMCl57+U0E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiri Olsa , Jiri Olsa , Alexander Shishkin , Andi Kleen , Jonas Rabenstein , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL 5.0 029/262] perf c2c: Fix c2c report for empty numa node Date: Wed, 27 Mar 2019 13:58:04 -0400 Message-Id: <20190327180158.10245-29-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa [ Upstream commit e34c940245437f36d2c492edd1f8237eff391064 ] Ravi Bangoria reported that we fail with an empty NUMA node with the following message: $ lscpu NUMA node0 CPU(s): NUMA node1 CPU(s): 0-4 $ sudo ./perf c2c report node/cpu topology bugFailed setup nodes Fix this by detecting the empty node and keeping its CPU set empty. Reported-by: Nageswara R Sastry Signed-off-by: Jiri Olsa Tested-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jonas Rabenstein Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190305152536.21035-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/builtin-c2c.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index d340d2e42776..13758a0b367b 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2055,6 +2055,12 @@ static int setup_nodes(struct perf_session *session) if (!set) return -ENOMEM; + nodes[node] = set; + + /* empty node, skip */ + if (cpu_map__empty(map)) + continue; + for (cpu = 0; cpu < map->nr; cpu++) { set_bit(map->map[cpu], set); @@ -2063,8 +2069,6 @@ static int setup_nodes(struct perf_session *session) cpu2node[map->map[cpu]] = node; } - - nodes[node] = set; } setup_nodes_header(); -- 2.19.1