Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17926894ybl; Thu, 2 Jan 2020 14:59:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwYSufEYNkU6obWyQpnyq1qsdsSnKM9Wq3G5hgM2SvqE9x51a3kTYtv116su8Ug1dEwY/6U X-Received: by 2002:a05:6830:1e8a:: with SMTP id n10mr83687140otr.303.1578005944704; Thu, 02 Jan 2020 14:59:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005944; cv=none; d=google.com; s=arc-20160816; b=Z020KiAekA97esDQp1BWoQwq6YbiuKNfbFSVffWYAuGtyBqJl5VlYFJNo6I6y3pY/r WNb9L7l/FHMT20sSOYEnWcB2wWHa8V8z5ajPtF+9lOFgYawVpXufUObDGy4pEjmt0Ga2 GIQPWvEWEHI/dIBkmm4M+gU4mcwU31vMDZHTFz04Ov0VMfoWujrpaU9OJ5GK/iBlXZm9 uP3LuYdId/8Fu4/ICh05wzM6udNxmm58ifv4oy+cPuGwc735Z3uFKg02ElULXoSUu92D wYDzkuKDMdUkvEelmJacn/UC6Qybl9QJgUV92mM/gvEcXXTJeNmn9IsN0XkLOG6JTVyS HKdA== 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=TcURqWK4nllifW3p4cVg78VdMpHwjBPC81irIxj7Rf4=; b=cULs2TtOhnWGO1pJ4vkFHcJphMz6yOWfLJXX9xRZ7smYGt7RKnndIz1RfMlxS56u3F dyStv8Em41JkUl9++1XNrFIsjqZBgGW8fZOA7+/C6KyH5OL4bUhrdN3aynnIn/7wLpg+ a4wQHcsa7Q7vOufBPxtPygxkjEYWqYxNpbLSojMvSCKllo8suX7RUYxL6s5nnrtU9Kqb qyKpz+kdBSJDLQdHZ3P01krxGhcwG17QF2D7oeiAgtJN430hiigDvZotKY0Kv5GACl2h r84+HdjQSsLat5FSHT4zAvtnoby23VmyP5CbXXjKVSqkwU91MtWrWkZwdV0imEcTj8J2 p5Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XRyYn+mZ; 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 q2si26773700otn.220.2020.01.02.14.58.53; Thu, 02 Jan 2020 14:59:04 -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=XRyYn+mZ; 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 S1728270AbgABWQh (ORCPT + 99 others); Thu, 2 Jan 2020 17:16:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:58584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728267AbgABWQf (ORCPT ); Thu, 2 Jan 2020 17:16:35 -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 113B221582; Thu, 2 Jan 2020 22:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003394; bh=GVo4GKy7q082vEvWrIg+e60rbluAIwFbPYrVXvcfSnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XRyYn+mZdf0oefKBOG3CbOVw0iuv+dFkXmoKjJlbFz4Cst2dcHySLa8tyLHALHn3O 8EgIbOlpRtnb3irfWvbUEVNwTu/tcLZxJW5CnunXjtz1foiJtsWFqSpDkZC4nKEiEX aYqmx4evTybljX1R7sHkBMBHgN9jl3E3durjI8Wk= 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 5.4 117/191] perf regs: Make perf_reg_name() return "unknown" instead of NULL Date: Thu, 2 Jan 2020 23:06:39 +0100 Message-Id: <20200102215842.391232934@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@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 47fe34e5f7d5..ec7640cc4c91 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h @@ -41,7 +41,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