Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17922133ybl; Thu, 2 Jan 2020 14:52:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwWr0gv4g9zogT6+EmIkzKllrZADDOGxGRhlCAbWH5XnYlDGR3gUPwz3/OiRzZZNCan3ZSW X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr97119779otp.346.1578005539899; Thu, 02 Jan 2020 14:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005539; cv=none; d=google.com; s=arc-20160816; b=nQzklq3LM+Ww9tajTQz7uGPDCFF+YWeOx+mogkXhcwkx6YWfLzeDUwlu8+VpTGr0MQ 8uJpTTRR4wfGr3Qq/ObztvcdlUyWwaQHvSt06ivQModMjkdELbR0lDKlRZaVyevyPpYo 8wAFje7RsaZj5qHaznkUcDPC31/zBReKAEya3WOIG1RKKTHmDFEFXPILtvHLW6MmPE5Z Ohc7edn0eksB3BMYer5TqXf0cUQyN8YoiUhG9kKUJ7EtGhjMuOpBBx6qgCY5Ik5tuJNX RbI1vXPkUq+bxNbKYlLxYhqbxL/iFAc1egTc1IKuRrA9d4gjNjOK1oJ99oD9w1wfMSW4 D+6A== 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=IrpOL4iCAm7zwnWlurAdWLzcMEDYGF5bAsayRCIpzNk=; b=e7Eh2t/JmAFMToMYTra+PfCnC3ACAd8Ee1LiRC5Y6t7kGDDybCkPm6GlCZQn5igKo4 q8jSWh9Bb2OZcqLzlnkqemouvqwtHZywt2VEa8gYtFBHXEcTeMjgM9ZnnCmErn85pa/G LhR7hqB6YNMC/sjGqEaT4Mkj0v4LuFmzc6xWvKx1/eIw/+KXlGjpKSctxT/b9uwHhBXf oGUQUXFiRK1m1Y0ExSs0Xhdtsnr3X8UUB1dMV4oEVR3wS5tK/xSPYz66RXEUl/FmKrmb s10Dyj5132vIJPPeYjNd/Q1BOXFhUH/lh52Hz/+ijXvmFo/HUV8mTOs8WrrdDBPVlTWY TItw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ULoPfYJF; 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 p8si11655833otc.118.2020.01.02.14.52.08; Thu, 02 Jan 2020 14:52:19 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ULoPfYJF; 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 S1729683AbgABWur (ORCPT + 99 others); Thu, 2 Jan 2020 17:50:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:50006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729085AbgABWZH (ORCPT ); Thu, 2 Jan 2020 17:25:07 -0500 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 D60C521835; Thu, 2 Jan 2020 22:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003906; bh=miIK85yk0a1NO2PCsbAMRy5Kn05eMMdekSaRaXVId84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ULoPfYJFF1pwiSZbjml66zEX+7R/tpKzbFeul2OYZyJqc/yqfipKHjad1hCay2QB4 Ohst8GHvyWZwcArPIt+ROpopk26fDBnC2jTg7pIwgNk9JjWPmlWySvSQ9CjRDajkTP rRKMubIWfcS0Yc1AOfQu3QeQWhmRdhjNbQYwI0Rc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Jiri Olsa , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 48/91] perf regs: Make perf_reg_name() return "unknown" instead of NULL Date: Thu, 2 Jan 2020 23:07:30 +0100 Message-Id: <20200102220436.551724548@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220356.856162165@linuxfoundation.org> References: <20200102220356.856162165@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 From: Arnaldo Carvalho de Melo [ Upstream commit 5b596e0ff0e1852197d4c82d3314db5e43126bf7 ] To avoid breaking the build on arches where this is not wired up, at least all the other features should be made available and when using this specific routine, the "unknown" should point the user/developer to the need to wire this up on this particular hardware architecture. Detected in a container mipsel debian cross build environment, where it shows up as: In file included from /usr/mipsel-linux-gnu/include/stdio.h:867, from /git/linux/tools/perf/lib/include/perf/cpumap.h:6, from util/session.c:13: In function 'printf', inlined from 'regs_dump__printf' at util/session.c:1103:3, inlined from 'regs__printf' at util/session.c:1131:2: /usr/mipsel-linux-gnu/include/bits/stdio2.h:107:10: error: '%-5s' directive argument is null [-Werror=format-overflow=] 107 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cross compiler details: mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 Also on mips64: In file included from /usr/mips64-linux-gnuabi64/include/stdio.h:867, from /git/linux/tools/perf/lib/include/perf/cpumap.h:6, from util/session.c:13: In function 'printf', inlined from 'regs_dump__printf' at util/session.c:1103:3, inlined from 'regs__printf' at util/session.c:1131:2, inlined from 'regs_user__printf' at util/session.c:1139:3, inlined from 'dump_sample' at util/session.c:1246:3, inlined from 'machines__deliver_event' at util/session.c:1421:3: /usr/mips64-linux-gnuabi64/include/bits/stdio2.h:107:10: error: '%-5s' directive argument is null [-Werror=format-overflow=] 107 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'printf', inlined from 'regs_dump__printf' at util/session.c:1103:3, inlined from 'regs__printf' at util/session.c:1131:2, inlined from 'regs_intr__printf' at util/session.c:1147:3, inlined from 'dump_sample' at util/session.c:1249:3, inlined from 'machines__deliver_event' at util/session.c:1421:3: /usr/mips64-linux-gnuabi64/include/bits/stdio2.h:107:10: error: '%-5s' directive argument is null [-Werror=format-overflow=] 107 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cross compiler details: mips64-linux-gnuabi64-gcc (Debian 9.2.1-8) 9.2.1 20190909 Fixes: 2bcd355b71da ("perf tools: Add interface to arch registers sets") Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-95wjyv4o65nuaeweq31t7l1s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/perf_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h index c9319f8d17a6..f732e3af2bd4 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h @@ -34,7 +34,7 @@ int perf_reg_value(u64 *valp, struct regs_dump *regs, int id); static inline const char *perf_reg_name(int id __maybe_unused) { - return NULL; + return "unknown"; } static inline int perf_reg_value(u64 *valp __maybe_unused, -- 2.20.1