Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1026942yba; Thu, 4 Apr 2019 02:44:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5pQiIRFyWUorbs/kXUvAXsmVB9nF32Q5B5OTxGpKqCgFbEHrjtRvTMAydwjrplGVyeVmy X-Received: by 2002:a65:62d2:: with SMTP id m18mr4901764pgv.122.1554371085738; Thu, 04 Apr 2019 02:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554371085; cv=none; d=google.com; s=arc-20160816; b=0WKZDFoyQmNpR5UVx/sE2wEpJszAxpSaGh8EACGfqfAaLlTqC2qihCtIn0lh1d4Mmq /BsTUDOVHWxNRs43vnVGarDmpetWodoN1ZzB73tWVrOjGd9BQL9qTuf0rgmwSHpHQOSa 5SPEq7Ox6lEeTzXzx54g6StB1G4GGUelgj6MJbtYlESmuc96kmb9iuovUQqvP4ov+wqi ZNZKBs48v5LdSb0YYXi+poH7LBCbju5PBXpvRoaYWiyyPBAdIw8of70CQ+pHAU3o8iMC Z+EYxXRmprgHWA7kgl5GXfMkyIczLsqtNvzgtOCxN1xL8uExydjZ4sP1dAkksEPSsg5E tFnQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hzx+y1bPdxtLxuwL3QJ0MRro+92btZDDaopJ4ys/StE=; b=kUvT8wdbKbJcbMogJmmFxk4Mj/emVHecV8/OHTXHg4w2aEDwcqvVHB3XpShoVx9GgN nb2WNFLxA+MAU91jT57elkPHQ+XEB3AAFy61O12gLodvSDGVCkXnWnMacWT/j3YQnyWn B2Ao+c7nvNxQ3QIxghsyHFFgOyl6yBAH/wU+LNHgHDNmS2fmXqDevvrikAsbSzTXQeTs 8B0ubA+/vngwngmhb5eh9d76NsCbsnuWq/IykCDVZFbQ5yYNSE6j8mTPIV3fr/nzBAV2 6IOTd29vDFTtv5y9SN9PEqeFa/Uqa4P47PpjUNMxTdJiV26j9VqWMlsBc37OZc2ZOqzQ Q+ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dDj2RuQt; 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 k11si16163704pga.257.2019.04.04.02.44.30; Thu, 04 Apr 2019 02:44:45 -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=dDj2RuQt; 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 S1731270AbfDDJAf (ORCPT + 99 others); Thu, 4 Apr 2019 05:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731043AbfDDJAc (ORCPT ); Thu, 4 Apr 2019 05:00:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B8A162184B; Thu, 4 Apr 2019 09:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368432; bh=A8ygAuuwuz+TN4EtylqAIuRwsff8dVeHrwVUHU2oM/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDj2RuQtZqC2EFE6ao0lFP4RdD4Z5bMhH40cWlzEoBleAfEsvQ9SOMrzwEAvVWFpI 8roOPDtS7nD7H0iDhHC9fc/kXLg028+nXVfekQ8QZ4mbsgicxRwMFYGFEHCf8dc2+X BsuY0s4h634AZLjVw9Onf1XM0twh6HOf/39Fm8Gs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nageswara R Sastry , Jiri Olsa , Ravi Bangoria , Alexander Shishkin , Andi Kleen , Jonas Rabenstein , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.19 022/187] perf c2c: Fix c2c report for empty numa node Date: Thu, 4 Apr 2019 10:45:59 +0200 Message-Id: <20190404084604.128426074@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 f3aa9d02a5ab..763c2edf52e7 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