From patchwork Thu Jul 2 18:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11640207 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7F9114B7 for ; Thu, 2 Jul 2020 18:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D614B21919 for ; Thu, 2 Jul 2020 18:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbgGBS5K (ORCPT ); Thu, 2 Jul 2020 14:57:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:48528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbgGBS5I (ORCPT ); Thu, 2 Jul 2020 14:57:08 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 137B02186A; Thu, 2 Jul 2020 18:57:07 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.93) (envelope-from ) id 1jr4OP-004BHY-SP; Thu, 02 Jul 2020 14:57:05 -0400 Message-ID: <20200702185705.759824282@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 02 Jul 2020 14:53:59 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Jiri Olsa , Namhyung Kim , Andrew Morton , Jan Kiszka , "Tzvetomir Stoyanov (VMware)" Subject: [PATCH v2 15/15] tools lib traceevent: Fix reporting of unknown SVM exit reasons References: <20200702185344.913492689@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: Jan Kiszka On AMD, exist code -1 is also a possible value, but we use it for terminating the list of known exit reasons. This leads to EXIT_ERR being reported for unkown ones. Fix this by using an NULL string pointer as terminal. Link: http://lkml.kernel.org/r/5741D817.3070902@web.de Link: http://lore.kernel.org/linux-trace-devel/20200702174950.123454-7-tz.stoyanov@gmail.com Signed-off-by: Jan Kiszka Signed-off-by: Steven Rostedt [ Ported from trace-cmd.git ] Signed-off-by: Tzvetomir Stoyanov (VMware) Signed-off-by: Steven Rostedt (VMware) --- tools/lib/traceevent/plugins/plugin_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/traceevent/plugins/plugin_kvm.c b/tools/lib/traceevent/plugins/plugin_kvm.c index de76a1e79d9e..51ceeb9147eb 100644 --- a/tools/lib/traceevent/plugins/plugin_kvm.c +++ b/tools/lib/traceevent/plugins/plugin_kvm.c @@ -245,7 +245,7 @@ static const char *find_exit_reason(unsigned isa, int val) } if (!strings) return "UNKNOWN-ISA"; - for (i = 0; strings[i].val >= 0; i++) + for (i = 0; strings[i].str; i++) if (strings[i].val == val) break;