From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD7FCC433FF for ; Fri, 2 Aug 2019 09:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 988AB206A2 for ; Fri, 2 Aug 2019 09:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738948; bh=WPH78JG2hGWgUDAQrnFeQz4Vyc83sY9/KeL3HcRRCDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AN49JTvj5jqDW3fSwyYUS6K6uIi+9AjQRmk/AwJ5X6FZ/V9tgnBCeilQK8IduMKpK 2w5jhqA42kgHFeE5/HPrGi89nBrPDIjmAqcPx6SoTJO/iJ6hbYkBePKZbPZIjbtpCx AeFa2MM3A9ueQ9/it5QFrALd/492YZePaH00MZlc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391868AbfHBJm1 (ORCPT ); Fri, 2 Aug 2019 05:42:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:44722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390542AbfHBJmY (ORCPT ); Fri, 2 Aug 2019 05:42:24 -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 2EE4D20679; Fri, 2 Aug 2019 09:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738943; bh=WPH78JG2hGWgUDAQrnFeQz4Vyc83sY9/KeL3HcRRCDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVlhB6LI7wRICUEZ3v1wee9jqiQEBPu6JEHKpSJSl0pRJY9b+Ui2OKdxagPPa9I8I 3C95LF9839ksjTqwenR/1QOZTgPHT0mF6RpN0ZEm9r1aJc8s8Z1s1kD34qoVJ7GXUD U2desgCRw8No7wQqVHEngHv/AbUeOd98fnohg7to= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kyle Meyer , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.9 056/223] perf tools: Increase MAX_NR_CPUS and MAX_CACHES Date: Fri, 2 Aug 2019 11:34:41 +0200 Message-Id: <20190802092242.512388192@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 9f94c7f947e919c343b30f080285af53d0fa9902 ] Attempting to profile 1024 or more CPUs with perf causes two errors: perf record -a [ perf record: Woken up X times to write data ] way too many cpu caches.. [ perf record: Captured and wrote X MB perf.data (X samples) ] perf report -C 1024 Error: failed to set cpu bitmap Requested CPU 1024 too large. Consider raising MAX_NR_CPUS Increasing MAX_NR_CPUS from 1024 to 2048 and redefining MAX_CACHES as MAX_NR_CPUS * 4 returns normal functionality to perf: perf record -a [ perf record: Woken up X times to write data ] [ perf record: Captured and wrote X MB perf.data (X samples) ] perf report -C 1024 ... Signed-off-by: Kyle Meyer Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190620193630.154025-1-meyerk@stormcage.eag.rdlabs.hpecorp.net Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/perf.h | 2 +- tools/perf/util/header.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 8f8d895d5b74..3b9d56125ee2 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -23,7 +23,7 @@ static inline unsigned long long rdclock(void) } #ifndef MAX_NR_CPUS -#define MAX_NR_CPUS 1024 +#define MAX_NR_CPUS 2048 #endif extern const char *input_name; diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index de9b369d2d2e..283148104ffb 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1008,7 +1008,7 @@ static int build_caches(struct cpu_cache_level caches[], u32 size, u32 *cntp) return 0; } -#define MAX_CACHES 2000 +#define MAX_CACHES (MAX_NR_CPUS * 4) static int write_cache(int fd, struct perf_header *h __maybe_unused, struct perf_evlist *evlist __maybe_unused) -- 2.20.1