Skip to content

Commit e8f331a

Browse files
jan-kiszkaacmel
authored andcommitted
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>
1 parent 4e59ab9 commit e8f331a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/lib/traceevent/plugins/plugin_kvm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static const char *find_exit_reason(unsigned isa, int val)
245245
}
246246
if (!strings)
247247
return "UNKNOWN-ISA";
248-
for (i = 0; strings[i].val >= 0; i++)
248+
for (i = 0; strings[i].str; i++)
249249
if (strings[i].val == val)
250250
break;
251251

0 commit comments

Comments
 (0)