aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2020-07-02 14:53:59 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-07-06 09:02:35 -0300
commite8f331aa91a2cfe53fb8585bc45baac66fb54096 (patch)
tree7ea52ad4d1c1f2bfed021883b708613253f45019 /tools/lib/traceevent
parenttools lib traceevent: Change to SPDX License format (diff)
downloadlinux-dev-e8f331aa91a2cfe53fb8585bc45baac66fb54096.tar.xz
linux-dev-e8f331aa91a2cfe53fb8585bc45baac66fb54096.zip
tools lib traceevent: Fix reporting of unknown SVM exit reasons
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 <jan.kiszka@siemens.com> [ Ported from trace-cmd.git ] Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: linux-trace-devel@vger.kernel.org Link: http://lore.kernel.org/lkml/20200702185705.759824282@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent')
-rw-r--r--tools/lib/traceevent/plugins/plugin_kvm.c2
1 files changed, 1 insertions, 1 deletions
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;