Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4777109imm; Mon, 25 Jun 2018 23:53:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIzWBKDmcghKnNG6HO6ujVvnQjr43QFM/Ew1ub/LZ5Ha9FYwRIPAIqSSwukBzpAATGl2YxL X-Received: by 2002:a63:b609:: with SMTP id j9-v6mr244705pgf.335.1529995981801; Mon, 25 Jun 2018 23:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529995981; cv=none; d=google.com; s=arc-20160816; b=PX+wkAX+foZmrnDbK30c3z3/lyN0YgnkHZuD761z/pQhtWS6VBcu4lpUC3E4Ed3odU a1fiKgg2yrDIGG5h9ul47wE66LI5t52+x1Lbl6nPQ7ONMkME4+QH1bzRhCFOsKljywHo KrDKpP+iShxxnVb+i1huWQOBSI8h11NybZXDFNCUVwrItzA3rPa3YJmlrn4YRJtKMUFM Kr4tE5vXxiTUT5CkbCuDtQdjvFoyyCxtZSXBCat2y8ozo4N4r9C4VXfO1ggjQwhpauZM WIWj0t+SKGymxjSXHSVcz3UlKzA2QYdAAfONuHh14eUHWZzKey8i8KKCPpKopP6t0tjo zFXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=r/c40qB0pM/gGs3Ea5u57t2ai9EgXKdxFb+6k0FK87U=; b=QLMaK1U7bDUl2OlsnNU/Zex0ZCgBAPMJHc0xTCFSU8ardYeDHlU+hGCdBxodrcl/MV 6RVKwRXrlnhFrigaBZMcNvQNf+DyMqHk34QlRA5b5lCm38eQxbA/HfkMDwopHmkxrD4K NcHlxaANlqtVeKOdjBYZ8WraHi3noICusrSPnplHBywTWoQ/rDS0c4af02p2yg8qjTjy RL0nrIwBXCIiNaesmI1xIUEYZxReH59USaIDr7bMmTILk023XITMQ4GYZEXVTkdmMJ+4 fVjLwTAsE0PzQBCfY9TGAelHYs6p5/aDCKA9sEGmBqIpCSjRISitkunMAQxuqVsd17Jz gxGA== 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 e129-v6si985533pfg.112.2018.06.25.23.52.47; Mon, 25 Jun 2018 23:53:01 -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; 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 S1751846AbeFZGwC (ORCPT + 99 others); Tue, 26 Jun 2018 02:52:02 -0400 Received: from terminus.zytor.com ([198.137.202.136]:32933 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbeFZGwB (ORCPT ); Tue, 26 Jun 2018 02:52:01 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5Q6pmT01591095 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Jun 2018 23:51:48 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5Q6pmmw1591092; Mon, 25 Jun 2018 23:51:48 -0700 Date: Mon, 25 Jun 2018 23:51:48 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Richter Message-ID: Cc: heiko.carstens@de.ibm.com, brueckner@linux.ibm.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tmricht@linux.ibm.com, acme@redhat.com, schwidefsky@de.ibm.com, tglx@linutronix.de, hpa@zytor.com Reply-To: acme@redhat.com, tmricht@linux.ibm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, schwidefsky@de.ibm.com, brueckner@linux.ibm.com, heiko.carstens@de.ibm.com, mingo@kernel.org In-Reply-To: <20180611073153.15592-1-tmricht@linux.ibm.com> References: <20180611073153.15592-1-tmricht@linux.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf record: Support s390 random socket_id assignment Git-Commit-ID: 01766229533f9bdb1144a41b4345c8c7286da7b4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 01766229533f9bdb1144a41b4345c8c7286da7b4 Gitweb: https://git.kernel.org/tip/01766229533f9bdb1144a41b4345c8c7286da7b4 Author: Thomas Richter AuthorDate: Mon, 11 Jun 2018 09:31:52 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 25 Jun 2018 11:59:35 -0300 perf record: Support s390 random socket_id assignment On s390 the socket identifier assigned to a CPU identifier is random and (depending on the configuration of the LPAR) may be higher than the CPU identifier. This is currently not supported. Fix this by allowing arbitrary socket identifiers being assigned to CPU id. Output before: [root@p23lp27 perf]# ./perf report --header -I -v ... socket_id number is too big.You may need to upgrade the perf tool. Error: The perf.data file has no samples! # ======== # captured on : Tue May 29 09:29:57 2018 # header version : 1 ... # Core ID and Socket ID information is not available ... [root@p23lp27 perf]# Output after: [root@p23lp27 perf]# ./perf report --header -I -v ... Error: The perf.data file has no samples! # ======== # captured on : Tue May 29 09:29:57 2018 # header version : 1 ... # CPU 0: Core ID 0, Socket ID 6 # CPU 1: Core ID 1, Socket ID 3 # CPU 2: Core ID -1, Socket ID -1 ... [root@p23lp27 perf]# Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Cc: Heiko Carstens Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20180611073153.15592-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/header.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 540cd2dcd3e7..59fcc790c865 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2129,6 +2129,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) int cpu_nr = ff->ph->env.nr_cpus_avail; u64 size = 0; struct perf_header *ph = ff->ph; + bool do_core_id_test = true; ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); if (!ph->env.cpu) @@ -2183,6 +2184,13 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) return 0; } + /* On s390 the socket_id number is not related to the numbers of cpus. + * The socket_id number might be higher than the numbers of cpus. + * This depends on the configuration. + */ + if (ph->env.arch && !strncmp(ph->env.arch, "s390", 4)) + do_core_id_test = false; + for (i = 0; i < (u32)cpu_nr; i++) { if (do_read_u32(ff, &nr)) goto free_cpu; @@ -2192,7 +2200,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) if (do_read_u32(ff, &nr)) goto free_cpu; - if (nr != (u32)-1 && nr > (u32)cpu_nr) { + if (do_core_id_test && nr != (u32)-1 && nr > (u32)cpu_nr) { pr_debug("socket_id number is too big." "You may need to upgrade the perf tool.\n"); goto free_cpu;