Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11815423pjo; Thu, 2 Jan 2020 14:46:20 -0800 (PST) X-Google-Smtp-Source: APXvYqy2ibNB8EPji+Wg5ImPb+ZEm3lRtAMkwqPwwJ2Ao41GxB5jscLbbZIhYV9rngFdBaRerNdl X-Received: by 2002:a05:6830:1353:: with SMTP id r19mr96256041otq.288.1578005180166; Thu, 02 Jan 2020 14:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005180; cv=none; d=google.com; s=arc-20160816; b=SE77mZsg6OGYebO8Yt8/vlJ1WRm30IiJpG4G/AKU5lNYJzfkMb60pr4pnllQcRJvgA Vt7r8xbuLRB+uPUc2aKS0IP2SDuU8ftlVuEavHlxzwL4ebtofEjYpEKQpR0q153KNpUf +uD+colAUHXUUvJ+CeCVlhnAHisQnO6He6HcKJ3ZKjnKt/p+67BZaJ3P0WlzGIJcReen rFtOfsBgAC8qpJgqhjVA8xlBzLxMsoXA+7Drxk7/GaQKtQZTLnH3Uq7iQbu6KtFglOCe 7DlBHR49N7l99x5QI5RqTHWCJaghYgXIWfPJ+W4wefYq+gX2QdMmU52gWOR4CRRoyrTQ lCVw== 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=5V86tBj9SflSS6ZKEV1MtTblmujsVk2VIMsym+fwCv8=; b=CWkNA6BAsUM71TtwE7YT6DjOsbAD2a9PrsyDfs2QmojmoWxbgRoNvSBACgEog09uPq 6ycFMAV3OiGUbgcXTxIIgaj6BbHPp8aDAJZZzhRqsoxAvmX6WB1R2hcYMjFX0pg0x4ZR JU+9+BUA1ZYDLnRjQOHq4mY6HweiSTbpclJnvfUyf6S8DTZzGZgtmj7qIsD1INWoPtt+ ePA6p7DFWyrN7NQkf5rXVSR4QtPkWvvQfOT50xkCSgnhgA1/FE9ESlhsarSMywe3mDgX b5QaMcVu/Q4oEu6+IgFcoHN4aKEClUuCxVW7g58phtvvZ2t8rnUw1OVQTxgRor2d6qSy 4Jrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oE+/FfFZ"; 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 c19si21604108oto.129.2020.01.02.14.46.08; Thu, 02 Jan 2020 14:46:20 -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="oE+/FfFZ"; 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 S1730829AbgABWo5 (ORCPT + 99 others); Thu, 2 Jan 2020 17:44:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:39400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730245AbgABWco (ORCPT ); Thu, 2 Jan 2020 17:32:44 -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 9D914222C3; Thu, 2 Jan 2020 22:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004364; bh=FB4OyriQdA+Htga/NPJmTLlaQnnALLwAf2sj5wOz2Sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oE+/FfFZMzjWjTbCurpoQ/jZJvqK/BL5FOh5FimzNxBY673WvyMMOzdV7YzA349vI lTfwGcI3Wfhl5LtyFHbvQwcQ5/V5y/euxWHxVSXrUj5Umgz+zqLYvbzZFE7SSr/l4e uChmqBnvOv1zxEAXJE6ol+N4UzxfGxVtrEPZpfAs= 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.9 147/171] perf regs: Make perf_reg_name() return "unknown" instead of NULL Date: Thu, 2 Jan 2020 23:07:58 +0100 Message-Id: <20200102220607.520424176@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@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 679d6e493962..e6324397b295 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h @@ -26,7 +26,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