Synchronize libtraceevent with trace-cmd
cover Synchronize libtraceevent with trace-cmd
Backported traceevent library patches from trace-cmd lib/traceevent
Jan Kiszka (2):
tools lib traceevent: Add more SVM exit reasons
tools lib traceevent: Fix reporting of unknown SVM exit reasons
Julia Cartwright (1):
tools lib traceevent: Add plugin for decoding syscalls/sys_enter_futex
Steven Rostedt (Red Hat) (2):
tools lib traceevent: Add --debug to trace-cmd report tools lib traceevent: Add plugin for tlb_flush
Steven Rostedt (VMware) (3):
tools lib traceevent: Add -O offset for function plugin tools lib traceevent: Add builtin handler for trace_marker_raw tools lib traceevent: Change to SPDX License format
Tom Zanussi (1):
tools lib traceevent: Add proper KBUFFER_TYPE_TIME_STAMP handling
Tzvetomir Stoyanov (VMware) (6):
tools lib traceevent: Remove trace-cmd plugin handling routines tools lib traceevent: Move plugin options from trace-cmd to
libtraceevent.
tools lib traceevent: Introduced new traceevent API, for adding new
plugins directories.
tools lib traceevent: Add support for more printk format specifiers tools lib traceevent: Optimize pretty_print() function tools lib traceevent: Move kernel_stack event handler to "function"
plugin.
tools/lib/traceevent/event-parse-local.h | 22 +- tools/lib/traceevent/event-parse.c | 1004 ++++++++++++----- tools/lib/traceevent/event-parse.h | 34 +- tools/lib/traceevent/event-plugin.c | 261 ++++- tools/lib/traceevent/kbuffer-parse.c | 43 +- tools/lib/traceevent/kbuffer.h | 19 +- tools/lib/traceevent/plugins/Build | 2 + tools/lib/traceevent/plugins/Makefile | 2 + .../lib/traceevent/plugins/plugin_function.c | 123 +- tools/lib/traceevent/plugins/plugin_futex.c | 123 ++ tools/lib/traceevent/plugins/plugin_hrtimer.c | 17 +- tools/lib/traceevent/plugins/plugin_jbd2.c | 17 +- tools/lib/traceevent/plugins/plugin_kmem.c | 17 +- tools/lib/traceevent/plugins/plugin_kvm.c | 42 +- .../lib/traceevent/plugins/plugin_mac80211.c | 17 +- .../traceevent/plugins/plugin_sched_switch.c | 17 +- tools/lib/traceevent/plugins/plugin_tlb.c | 66 ++ 17 files changed, 1406 insertions(+), 420 deletions(-) create mode 100644 tools/lib/traceevent/plugins/plugin_futex.c create mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c
Signature · 1 line
2.26.2
PATCH 10/15 tools lib traceevent: Add -O offset for function plugin
From: Steven Rostedt (VMware) <[email protected]>
When -O offset is added to trace-cmd report with the function plugin enabled, it will display the offset of the functions along with their names. This helps in finding exactly where a function was called by its parent.
trace-cmd report -O parent -O offset
[..]
rcuc/163-1330 [163] 740.653251: function: _raw_spin_lock+0x0 <-- rcu_cpu_kthread+0x4d8
--- .../lib/traceevent/plugins/plugin_function.c | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
tools/lib/traceevent/plugins/plugin_function.c +22 -2
@@ -49,6 +49,13 @@ struct tep_plugin_option plugin_options[] = "Try to show function call indents, based on parents", .set = 1, }, + { + .name = "offset", + .plugin_alias = "ftrace", + .description = + "Show function names as well as their offsets", + .set = 0, + }, { .name = NULL, }
@@ -56,6 +63,7 @@ struct tep_plugin_option plugin_options[] =static struct tep_plugin_option *ftrace_parent = &plugin_options[0 ];static struct tep_plugin_option *ftrace_indent = &plugin_options[1 ]; +static struct tep_plugin_option *ftrace_offset = &plugin_options[2 ];static void add_child (struct func_stack *stack,const char *child,int pos) {
@@ -123,6 +131,18 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)return 0 ; } +static void show_function (struct trace_seq *s,struct tep_handle *tep, +const char *func,unsigned long long function) +{ +unsigned long long offset; + +trace_seq_printf (s,"%s" , func); +if (ftrace_offset->set) { + offset =tep_find_function_address (tep, function); +trace_seq_printf (s,"+0x%x " , (int )(function - offset)); + } +} +static int function_handler (struct trace_seq *s,struct tep_record *record,struct tep_event *event,void *context) {
@@ -149,14 +169,14 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,trace_seq_printf (s,"%*s" , index*3 ,"" );if (func) -trace_seq_printf (s,"%s" , func); +show_function (s, tep, func, function);else trace_seq_printf (s,"0x%llx" , function);if (ftrace_parent->set) {trace_seq_printf (s," <-- " );if (parent) -trace_seq_printf (s,"%s" , parent); +show_function (s, tep, parent, pfunction);else trace_seq_printf (s,"0x%llx" , pfunction); }
Signature · 1 line
2.26.2
PATCH 11/15 tools lib traceevent: Add plugin for decoding syscalls/sys_enter_futex
In reply to Tzvetomir Stoyanov (VMware)From: Julia Cartwright <[email protected]>
The futex syscall is a complicated one. It supports thirteen multiplexed operations, each with different semantics and encodings for the syscalls six arguments.
Manually decoding these arguments is tedious and error prone.
This plugin provides symbolic names for futex operations, futex flags, and tries to be intelligent about the intent of specific arguments (for example, waking operations use 'val' as an integer count, not just an arbitrary value).
It doesn't do a full decode of the FUTEX_WAKE_OP's 'val3' argument, however, this is a good starting point.
--- tools/lib/traceevent/plugins/Build | 1 + tools/lib/traceevent/plugins/Makefile | 1 + tools/lib/traceevent/plugins/plugin_futex.c | 137 ++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 tools/lib/traceevent/plugins/plugin_futex.c
tools/lib/traceevent/plugins/Build +1 -0
@@ -5,6 +5,7 @@ plugin_kvm-y += plugin_kvm.o plugin_mac80211-y += plugin_mac80211.o plugin_sched_switch-y += plugin_sched_switch.o plugin_function-y += plugin_function.o +plugin_futex-y += plugin_futex.o plugin_xen-y += plugin_xen.o plugin_scsi-y += plugin_scsi.o plugin_cfg80211-y += plugin_cfg80211.o
tools/lib/traceevent/plugins/Makefile +1 -0
@@ -134,6 +134,7 @@ PLUGINS += plugin_kvm.so PLUGINS += plugin_mac80211.so PLUGINS += plugin_sched_switch.so PLUGINS += plugin_function.so +PLUGINS += plugin_futex.so PLUGINS += plugin_xen.so PLUGINS += plugin_scsi.so PLUGINS += plugin_cfg80211.so
tools/lib/traceevent/plugins/plugin_futex.c new file +137 -0
137 lines not on this page · raw message
Signature · 1 line
2.26.2
PATCH 12/15 tools lib traceevent: Move kernel_stack event handler to "function" plugin.
In reply to Tzvetomir Stoyanov (VMware)The "kernel_stack" event handler does not depend on any trace-cmd context, it can be used aside from the application. The code is moved to libtraceevent "function" plugin.
--- .../lib/traceevent/plugins/plugin_function.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+)
tools/lib/traceevent/plugins/plugin_function.c +41 -0
@@ -184,11 +184,52 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,return 0 ; } +static int +trace_stack_handler (struct trace_seq *s,struct tep_record *record, +struct tep_event *event,void *context) +{ +struct tep_format_field *field; +unsigned long long addr; +const char *func; +int long_size; +void *data = record->data; + + field =tep_find_any_field (event,"caller" ); +if (!field) { +trace_seq_printf (s,"<CANT FIND FIELD %s>" ,"caller" ); +return 0 ; + } + +trace_seq_puts (s,"<stack trace >\n" ); + + long_size =tep_get_long_size (event->tep); + +for (data += field->offset; data < record->data + record->size; + data += long_size) { + addr =tep_read_number (event->tep, data, long_size); + +if ((long_size ==8 && addr == (unsigned long long )-1 ) || + ((int )addr ==-1 )) +break ; + + func =tep_find_function (event->tep, addr); +if (func) +trace_seq_printf (s,"=> %s (%llx)\n" , func, addr); +else +trace_seq_printf (s,"=> %llx\n" , addr); + } + +return 0 ; +} +int TEP_PLUGIN_LOADER (struct tep_handle *tep) {tep_register_event_handler (tep,-1 ,"ftrace" ,"function" , function_handler,NULL ); +tep_register_event_handler (tep,-1 ,"ftrace" ,"kernel_stack" , + trace_stack_handler,NULL ); +tep_plugin_add_options ("ftrace" , plugin_options);return 0 ;
Signature · 1 line
2.26.2
PATCH 13/15 tools lib traceevent: Add builtin handler for trace_marker_raw
In reply to Tzvetomir Stoyanov (VMware)From: Steven Rostedt (VMware) <[email protected]>
When something is written into trace_marker_raw, it goes in as a binary. But the printk_fmt() of the event that is created (raw_data)'s format file only prints the first byte of data:
print fmt: "id:%04x %08x", REC->id, (int)REC->buf[0]
This is no very useful if we want to see the full data output.
Implement the processing of the raw_data event like it is in the kernel.
--- .../lib/traceevent/plugins/plugin_function.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+)
tools/lib/traceevent/plugins/plugin_function.c +41 -0
@@ -222,6 +222,44 @@ trace_stack_handler(struct trace_seq *s, struct tep_record *record,return 0 ; } +static int +trace_raw_data_handler (struct trace_seq *s,struct tep_record *record, +struct tep_event *event,void *context) +{ +struct tep_format_field *field; +unsigned long long id; +int long_size; +void *data = record->data; + +if (tep_get_field_val (s, event,"id" , record, &id,1 )) +return trace_seq_putc (s,'!' ); + +trace_seq_printf (s,"# %llx" , id); + + field =tep_find_any_field (event,"buf" ); +if (!field) { +trace_seq_printf (s,"<CANT FIND FIELD %s>" ,"buf" ); +return 0 ; + } + + long_size =tep_get_long_size (event->tep); + +for (data += field->offset; data < record->data + record->size; + data += long_size) { +int size =sizeof (long ); +int left = (record->data + record->size) - data; +int i; + +if (size > left) + size = left; + +for (i =0 ; i < size; i++) +trace_seq_printf (s," %02x" , *(unsigned char *)(data + i)); + } + +return 0 ; +} +int TEP_PLUGIN_LOADER (struct tep_handle *tep) { tep_register_event_handler(tep, -1, "ftrace", "function",
@@ -230,6 +268,9 @@ int TEP_PLUGIN_LOADER(struct tep_handle *tep)tep_register_event_handler (tep,-1 ,"ftrace" ,"kernel_stack" , trace_stack_handler,NULL ); +tep_register_event_handler (tep,-1 ,"ftrace" ,"raw_data" , + trace_raw_data_handler,NULL ); +tep_plugin_add_options ("ftrace" , plugin_options);return 0 ;
Signature · 1 line
2.26.2
PATCH 14/15 tools lib traceevent: Change to SPDX License format
In reply to Tzvetomir Stoyanov (VMware)From: Steven Rostedt (VMware) <[email protected]>
Replaced COPYING with a description of how the SPDX identifiers are used. Added a GPL-2.0 and LGPL-2.1 license file in the new LICENSES directory. Then removed all the license templates from the source files and replaced them with the corresponding SPDX identifier.
--- tools/lib/traceevent/event-parse.h | 16 +--------------- tools/lib/traceevent/kbuffer.h | 17 +---------------- tools/lib/traceevent/plugins/plugin_function.c | 17 +---------------- tools/lib/traceevent/plugins/plugin_futex.c | 16 +--------------- tools/lib/traceevent/plugins/plugin_hrtimer.c | 17 +---------------- tools/lib/traceevent/plugins/plugin_jbd2.c | 17 +---------------- tools/lib/traceevent/plugins/plugin_kmem.c | 17 +---------------- tools/lib/traceevent/plugins/plugin_kvm.c | 17 +---------------- tools/lib/traceevent/plugins/plugin_mac80211.c | 17 +---------------- .../traceevent/plugins/plugin_sched_switch.c | 17 +---------------- tools/lib/traceevent/plugins/plugin_tlb.c | 17 +---------------- 11 files changed, 11 insertions(+), 174 deletions(-)
tools/lib/traceevent/event-parse.h +1 -15
@@ -1,21 +1,7 @@ +/* SPDX-License-Identifier: LGPL-2.1 */ /* * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt <[email protected]> * -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #ifndef _PARSE_EVENTS_H#define _PARSE_EVENTS_H
tools/lib/traceevent/kbuffer.h +1 -16
@@ -1,22 +1,7 @@ +/* SPDX-License-Identifier: LGPL-2.1 */ /* * Copyright (C) 2012 Red Hat Inc, Steven Rostedt <[email protected]> * -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #ifndef _KBUFFER_H#define _KBUFFER_H
tools/lib/traceevent/plugins/plugin_function.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_futex.c +1 -15
@@ -1,23 +1,9 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2017 National Instruments Corp. * * Author: Julia Cartwright <[email protected]> * -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_hrtimer.c +1 -16
@@ -1,22 +1,7 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2009 Red Hat Inc, Steven Rostedt <[email protected]> * Copyright (C) 2009 Johannes Berg <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_jbd2.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_kmem.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2009 Red Hat Inc, Steven Rostedt <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_kvm.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2009 Red Hat Inc, Steven Rostedt <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_mac80211.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2009 Johannes Berg <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_sched_switch.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
tools/lib/traceevent/plugins/plugin_tlb.c +1 -16
@@ -1,21 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1 /* * Copyright (C) 2015 Red Hat Inc, Steven Rostedt <[email protected]> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License (not later!) -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, see <http://www.gnu.org/licenses> -* -* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.26.2
PATCH 15/15 tools lib traceevent: Fix reporting of unknown SVM exit reasons
In reply to Tzvetomir Stoyanov (VMware)From: Jan Kiszka <[email protected]>
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.
--- tools/lib/traceevent/plugins/plugin_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/plugins/plugin_kvm.c +1 -1
@@ -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 ;
Signature · 1 line
2.26.2