All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm
@ 2014-06-13  2:10 Steven Rostedt
  2014-06-13  2:10 ` [PATCH 1/4] tools lib traceevent: Report unknown VMX exit reasons with code Steven Rostedt
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13  2:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Jan Kiszka

Jiri,

I'm synchronizing the changes that is in trace-cmd and the traceevent
library. I found a few updates that are missing from the kvm plugin.

-- Steve



Jan Kiszka (3):
      tools lib traceevent: Report unknown VMX exit reasons with code
      tools lib traceevent: Factor out print_exit_reason in kvm plugin
      tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints

Steven Rostedt (Red Hat) (1):
      tools lib traceevent: Add back in kvm plugin's nested_vmexit events

----
 tools/lib/traceevent/plugin_kvm.c | 64 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 56 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] tools lib traceevent: Report unknown VMX exit reasons with code
  2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
@ 2014-06-13  2:10 ` Steven Rostedt
  2014-06-13  2:10 ` [PATCH 2/4] tools lib traceevent: Factor out print_exit_reason in kvm plugin Steven Rostedt
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13  2:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Jan Kiszka

[-- Attachment #1: 0001-tools-lib-traceevent-Report-unknown-VMX-exit-reasons.patch --]
[-- Type: text/plain, Size: 1752 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

Allows to parse the result even if the KVM plugin does not yet
understand a specific exit code.

Link: http://lkml.kernel.org/r/5207446F.1090703@web.de

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/lib/traceevent/plugin_kvm.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 9e0e8c61b43b..3e6122067d67 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -240,9 +240,8 @@ static const char *find_exit_reason(unsigned isa, int val)
 	for (i = 0; strings[i].val >= 0; i++)
 		if (strings[i].val == val)
 			break;
-	if (strings[i].str)
-		return strings[i].str;
-	return "UNKNOWN";
+
+	return strings[i].str;
 }
 
 static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,
@@ -251,6 +250,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,
 	unsigned long long isa;
 	unsigned long long val;
 	unsigned long long info1 = 0, info2 = 0;
+	const char *reason;
 
 	if (pevent_get_field_val(s, event, "exit_reason", record, &val, 1) < 0)
 		return -1;
@@ -258,7 +258,11 @@ static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,
 	if (pevent_get_field_val(s, event, "isa", record, &isa, 0) < 0)
 		isa = 1;
 
-	trace_seq_printf(s, "reason %s", find_exit_reason(isa, val));
+	reason = find_exit_reason(isa, val);
+	if (reason)
+		trace_seq_printf(s, "reason %s", reason);
+	else
+		trace_seq_printf(s, "reason UNKNOWN (%llu)", val);
 
 	pevent_print_num_field(s, " rip 0x%lx", event, "guest_rip", record, 1);
 
-- 
2.0.0.rc2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/4] tools lib traceevent: Factor out print_exit_reason in kvm plugin
  2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
  2014-06-13  2:10 ` [PATCH 1/4] tools lib traceevent: Report unknown VMX exit reasons with code Steven Rostedt
@ 2014-06-13  2:10 ` Steven Rostedt
  2014-06-13  2:10 ` [PATCH 3/4] tools lib traceevent: Add back in kvm plugins nested_vmexit events Steven Rostedt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13  2:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Jan Kiszka

[-- Attachment #1: 0002-tools-lib-traceevent-Factor-out-print_exit_reason-in.patch --]
[-- Type: text/plain, Size: 1912 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

We will reuse it for nested vmexit tracepoints.

Link: http://lkml.kernel.org/r/619c418c8af87f03027b8c8013b0443996605700.1388855989.git.jan.kiszka@web.de

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/lib/traceevent/plugin_kvm.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 3e6122067d67..2d7d1d7df0a8 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -244,15 +244,14 @@ static const char *find_exit_reason(unsigned isa, int val)
 	return strings[i].str;
 }
 
-static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,
-			    struct event_format *event, void *context)
+static int print_exit_reason(struct trace_seq *s, struct pevent_record *record,
+			     struct event_format *event, const char *field)
 {
 	unsigned long long isa;
 	unsigned long long val;
-	unsigned long long info1 = 0, info2 = 0;
 	const char *reason;
 
-	if (pevent_get_field_val(s, event, "exit_reason", record, &val, 1) < 0)
+	if (pevent_get_field_val(s, event, field, record, &val, 1) < 0)
 		return -1;
 
 	if (pevent_get_field_val(s, event, "isa", record, &isa, 0) < 0)
@@ -263,6 +262,16 @@ static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,
 		trace_seq_printf(s, "reason %s", reason);
 	else
 		trace_seq_printf(s, "reason UNKNOWN (%llu)", val);
+	return 0;
+}
+
+static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,
+			    struct event_format *event, void *context)
+{
+	unsigned long long info1 = 0, info2 = 0;
+
+	if (print_exit_reason(s, record, event, "exit_reason") < 0)
+		return -1;
 
 	pevent_print_num_field(s, " rip 0x%lx", event, "guest_rip", record, 1);
 
-- 
2.0.0.rc2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/4] tools lib traceevent: Add back in kvm plugins nested_vmexit events
  2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
  2014-06-13  2:10 ` [PATCH 1/4] tools lib traceevent: Report unknown VMX exit reasons with code Steven Rostedt
  2014-06-13  2:10 ` [PATCH 2/4] tools lib traceevent: Factor out print_exit_reason in kvm plugin Steven Rostedt
@ 2014-06-13  2:10 ` Steven Rostedt
  2014-06-25  5:49   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
  2014-06-13  2:10 ` [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints Steven Rostedt
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13  2:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Jan Kiszka

[-- Attachment #1: 0003-tools-lib-traceevent-Add-back-in-kvm-plugin-s-nested.patch --]
[-- Type: text/plain, Size: 3041 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The nested vmexit events were removed from the backport from trace-cmd because
they were considered buggy. They have since been updated in trace-cmd but
are still missing from the traceevent library. Add back in the buggy
version to be able to backport the fixes.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/lib/traceevent/plugin_kvm.c | 41 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 2d7d1d7df0a8..0d437837569f 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -326,6 +326,35 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,
 	return 0;
 }
 
+
+static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_record *record,
+					    struct event_format *event, void *context)
+{
+	unsigned long long val;
+
+	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
+
+	if (pevent_get_field_val(s, event, "exit_code", record, &val, 1) < 0)
+		return -1;
+
+	trace_seq_printf(s, "reason %s", find_exit_reason(2, val));
+
+	pevent_print_num_field(s, " ext_inf1: %0x016llx", event, "exit_info1", record, 1);
+	pevent_print_num_field(s, " ext_inf2: %0x016llx", event, "exit_info2", record, 1);
+	pevent_print_num_field(s, " ext_int: %0x016llx", event, "exit_int_info", record, 1);
+	pevent_print_num_field(s, " ext_int_err: %0x016llx", event, "exit_int_info_err", record, 1);
+
+	return 0;
+}
+
+static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
+				     struct event_format *event, void *context)
+{
+	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
+
+	return kvm_nested_vmexit_inject_handler(s, record, event, context);
+}
+
 union kvm_mmu_page_role {
 	unsigned word;
 	struct {
@@ -422,6 +451,12 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
 	pevent_register_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
 				      kvm_emulate_insn_handler, NULL);
 
+	pevent_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
+				      kvm_nested_vmexit_handler, NULL);
+
+	pevent_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
+				      kvm_nested_vmexit_inject_handler, NULL);
+
 	pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
 				      kvm_mmu_get_page_handler, NULL);
 
@@ -456,6 +491,12 @@ void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
 	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
 					kvm_emulate_insn_handler, NULL);
 
+	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
+					kvm_nested_vmexit_handler, NULL);
+
+	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
+					kvm_nested_vmexit_inject_handler, NULL);
+
 	pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
 					kvm_mmu_get_page_handler, NULL);
 
-- 
2.0.0.rc2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints
  2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
                   ` (2 preceding siblings ...)
  2014-06-13  2:10 ` [PATCH 3/4] tools lib traceevent: Add back in kvm plugins nested_vmexit events Steven Rostedt
@ 2014-06-13  2:10 ` Steven Rostedt
  2014-06-13  9:55   ` Namhyung Kim
  2014-06-13 14:31 ` [PATCH 5/4] tools lib traceevent: Fix format in plugin_kvm Steven Rostedt
  2014-06-16  8:02 ` [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Jiri Olsa
  5 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13  2:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Jan Kiszka

[-- Attachment #1: 0004-tools-lib-traceevent-Fix-and-cleanup-kvm_nested_vmex.patch --]
[-- Type: text/plain, Size: 2482 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

Fix several issues of kvm_nested_vmexit[_inject]: field width aren't
supported with pevent_print, rip was printed twice/incorrectly, SVM ISA
was hard-coded, we don't use ':' to separate field names.

Link: http://lkml.kernel.org/r/8e6c02b22ea8136c139a91c69d6cc73b8c5c184b.1388855989.git.jan.kiszka@web.de

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/lib/traceevent/plugin_kvm.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 0d437837569f..0575e59c65f0 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -330,19 +330,13 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,
 static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_record *record,
 					    struct event_format *event, void *context)
 {
-	unsigned long long val;
-
-	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
-
-	if (pevent_get_field_val(s, event, "exit_code", record, &val, 1) < 0)
+	if (print_exit_reason(s, record, event, "exit_code") < 0)
 		return -1;
 
-	trace_seq_printf(s, "reason %s", find_exit_reason(2, val));
-
-	pevent_print_num_field(s, " ext_inf1: %0x016llx", event, "exit_info1", record, 1);
-	pevent_print_num_field(s, " ext_inf2: %0x016llx", event, "exit_info2", record, 1);
-	pevent_print_num_field(s, " ext_int: %0x016llx", event, "exit_int_info", record, 1);
-	pevent_print_num_field(s, " ext_int_err: %0x016llx", event, "exit_int_info_err", record, 1);
+	pevent_print_num_field(s, " info1 %llx", event, "exit_info1", record, 1);
+	pevent_print_num_field(s, " info2 %llx", event, "exit_info2", record, 1);
+	pevent_print_num_field(s, " int_info %llx", event, "exit_int_info", record, 1);
+	pevent_print_num_field(s, " int_info_err %llx", event, "exit_int_info_err", record, 1);
 
 	return 0;
 }
@@ -350,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_r
 static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
 				     struct event_format *event, void *context)
 {
-	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
+	pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1);
 
 	return kvm_nested_vmexit_inject_handler(s, record, event, context);
 }
-- 
2.0.0.rc2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints
  2014-06-13  2:10 ` [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints Steven Rostedt
@ 2014-06-13  9:55   ` Namhyung Kim
  2014-06-13 13:59     ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Namhyung Kim @ 2014-06-13  9:55 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Jiri Olsa, Jan Kiszka

Hi Steve,

2014-06-12 (목), 22:10 -0400, Steven Rostedt:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Fix several issues of kvm_nested_vmexit[_inject]: field width aren't
> supported with pevent_print, rip was printed twice/incorrectly, SVM ISA
> was hard-coded, we don't use ':' to separate field names.
> 
> Link: http://lkml.kernel.org/r/8e6c02b22ea8136c139a91c69d6cc73b8c5c184b.1388855989.git.jan.kiszka@web.de
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  tools/lib/traceevent/plugin_kvm.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
> index 0d437837569f..0575e59c65f0 100644
> --- a/tools/lib/traceevent/plugin_kvm.c
> +++ b/tools/lib/traceevent/plugin_kvm.c
> @@ -330,19 +330,13 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,
>  static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_record *record,
>  					    struct event_format *event, void *context)
>  {
> -	unsigned long long val;
> -
> -	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
> -
> -	if (pevent_get_field_val(s, event, "exit_code", record, &val, 1) < 0)
> +	if (print_exit_reason(s, record, event, "exit_code") < 0)
>  		return -1;
>  
> -	trace_seq_printf(s, "reason %s", find_exit_reason(2, val));
> -
> -	pevent_print_num_field(s, " ext_inf1: %0x016llx", event, "exit_info1", record, 1);
> -	pevent_print_num_field(s, " ext_inf2: %0x016llx", event, "exit_info2", record, 1);
> -	pevent_print_num_field(s, " ext_int: %0x016llx", event, "exit_int_info", record, 1);
> -	pevent_print_num_field(s, " ext_int_err: %0x016llx", event, "exit_int_info_err", record, 1);
> +	pevent_print_num_field(s, " info1 %llx", event, "exit_info1", record, 1);
> +	pevent_print_num_field(s, " info2 %llx", event, "exit_info2", record, 1);
> +	pevent_print_num_field(s, " int_info %llx", event, "exit_int_info", record, 1);
> +	pevent_print_num_field(s, " int_info_err %llx", event, "exit_int_info_err", record, 1);
>  
>  	return 0;
>  }
> @@ -350,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_r
>  static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
>  				     struct event_format *event, void *context)
>  {
> -	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
> +	pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1);

s/%lx/%llx/

Otherwise this series and previous two cleanup patches look good to me.

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


>  
>  	return kvm_nested_vmexit_inject_handler(s, record, event, context);
>  }




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints
  2014-06-13  9:55   ` Namhyung Kim
@ 2014-06-13 13:59     ` Steven Rostedt
  0 siblings, 0 replies; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13 13:59 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: linux-kernel, Jiri Olsa, Jan Kiszka

On Fri, 13 Jun 2014 18:55:37 +0900
Namhyung Kim <namhyung@kernel.org> wrote:


> >  {
> > -	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
> > +	pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1);
> 
> s/%lx/%llx/

I'll make this as a separate fix to keep the original patch as is.

> 
> Otherwise this series and previous two cleanup patches look good to me.
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>
> 

Thanks!

-- Steve


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 5/4] tools lib traceevent: Fix format in plugin_kvm
  2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
                   ` (3 preceding siblings ...)
  2014-06-13  2:10 ` [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints Steven Rostedt
@ 2014-06-13 14:31 ` Steven Rostedt
  2014-06-25  5:49   ` [tip:perf/core] " tip-bot for Steven Rostedt
  2014-06-16  8:02 ` [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Jiri Olsa
  5 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2014-06-13 14:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Olsa, Namhyung Kim, Jan Kiszka

The format field argument passed to the format
in pevent_print_num_field() will be of type long long. That means that
%ll must be used instead of %l.

Reported-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 0575e59..88fe83d 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -344,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_r
 static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
 				     struct event_format *event, void *context)
 {
-	pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1);
+	pevent_print_num_field(s, "rip %llx ", event, "rip", record, 1);
 
 	return kvm_nested_vmexit_inject_handler(s, record, event, context);
 }

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm
  2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
                   ` (4 preceding siblings ...)
  2014-06-13 14:31 ` [PATCH 5/4] tools lib traceevent: Fix format in plugin_kvm Steven Rostedt
@ 2014-06-16  8:02 ` Jiri Olsa
  5 siblings, 0 replies; 11+ messages in thread
From: Jiri Olsa @ 2014-06-16  8:02 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Jiri Olsa, Namhyung Kim, Jan Kiszka

On Thu, Jun 12, 2014 at 10:10:02PM -0400, Steven Rostedt wrote:
> Jiri,
> 
> I'm synchronizing the changes that is in trace-cmd and the traceevent
> library. I found a few updates that are missing from the kvm plugin.

queued, also the 5/4 ;-)

thanks,
jirka

> 
> -- Steve
> 
> 
> 
> Jan Kiszka (3):
>       tools lib traceevent: Report unknown VMX exit reasons with code
>       tools lib traceevent: Factor out print_exit_reason in kvm plugin
>       tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints
> 
> Steven Rostedt (Red Hat) (1):
>       tools lib traceevent: Add back in kvm plugin's nested_vmexit events
> 
> ----
>  tools/lib/traceevent/plugin_kvm.c | 64 ++++++++++++++++++++++++++++++++++-----
>  1 file changed, 56 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [tip:perf/core] tools lib traceevent: Add back in kvm plugins nested_vmexit events
  2014-06-13  2:10 ` [PATCH 3/4] tools lib traceevent: Add back in kvm plugins nested_vmexit events Steven Rostedt
@ 2014-06-25  5:49   ` tip-bot for Steven Rostedt (Red Hat)
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Steven Rostedt (Red Hat) @ 2014-06-25  5:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jolsa, rostedt, tglx, namhyung

Commit-ID:  ea092aeb6d4725048c5a46d1c9cbb4fea49b80b0
Gitweb:     http://git.kernel.org/tip/ea092aeb6d4725048c5a46d1c9cbb4fea49b80b0
Author:     Steven Rostedt (Red Hat) <rostedt@goodmis.org>
AuthorDate: Thu, 12 Jun 2014 22:10:05 -0400
Committer:  Jiri Olsa <jolsa@kernel.org>
CommitDate: Thu, 19 Jun 2014 18:18:25 +0200

tools lib traceevent: Add back in kvm plugins nested_vmexit events

The nested vmexit events were removed from the backport from trace-cmd because
they were considered buggy. They have since been updated in trace-cmd but
are still missing from the traceevent library. Add back in the buggy
version to be able to backport the fixes.

Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20140613021157.291421941@goodmis.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/traceevent/plugin_kvm.c | 41 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 2d7d1d7..0d43783 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -326,6 +326,35 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,
 	return 0;
 }
 
+
+static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_record *record,
+					    struct event_format *event, void *context)
+{
+	unsigned long long val;
+
+	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
+
+	if (pevent_get_field_val(s, event, "exit_code", record, &val, 1) < 0)
+		return -1;
+
+	trace_seq_printf(s, "reason %s", find_exit_reason(2, val));
+
+	pevent_print_num_field(s, " ext_inf1: %0x016llx", event, "exit_info1", record, 1);
+	pevent_print_num_field(s, " ext_inf2: %0x016llx", event, "exit_info2", record, 1);
+	pevent_print_num_field(s, " ext_int: %0x016llx", event, "exit_int_info", record, 1);
+	pevent_print_num_field(s, " ext_int_err: %0x016llx", event, "exit_int_info_err", record, 1);
+
+	return 0;
+}
+
+static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
+				     struct event_format *event, void *context)
+{
+	pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1);
+
+	return kvm_nested_vmexit_inject_handler(s, record, event, context);
+}
+
 union kvm_mmu_page_role {
 	unsigned word;
 	struct {
@@ -422,6 +451,12 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
 	pevent_register_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
 				      kvm_emulate_insn_handler, NULL);
 
+	pevent_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
+				      kvm_nested_vmexit_handler, NULL);
+
+	pevent_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
+				      kvm_nested_vmexit_inject_handler, NULL);
+
 	pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
 				      kvm_mmu_get_page_handler, NULL);
 
@@ -456,6 +491,12 @@ void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
 	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
 					kvm_emulate_insn_handler, NULL);
 
+	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
+					kvm_nested_vmexit_handler, NULL);
+
+	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
+					kvm_nested_vmexit_inject_handler, NULL);
+
 	pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
 					kvm_mmu_get_page_handler, NULL);
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [tip:perf/core] tools lib traceevent: Fix format in plugin_kvm
  2014-06-13 14:31 ` [PATCH 5/4] tools lib traceevent: Fix format in plugin_kvm Steven Rostedt
@ 2014-06-25  5:49   ` tip-bot for Steven Rostedt
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Steven Rostedt @ 2014-06-25  5:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jolsa, rostedt, tglx, namhyung

Commit-ID:  a21e3a34bef9e9c177be61111ced23e71e25fd8a
Gitweb:     http://git.kernel.org/tip/a21e3a34bef9e9c177be61111ced23e71e25fd8a
Author:     Steven Rostedt <rostedt@goodmis.org>
AuthorDate: Fri, 13 Jun 2014 10:31:27 -0400
Committer:  Jiri Olsa <jolsa@kernel.org>
CommitDate: Thu, 19 Jun 2014 18:18:33 +0200

tools lib traceevent: Fix format in plugin_kvm

The format field argument passed to the format
in pevent_print_num_field() will be of type long long. That means that
%ll must be used instead of %l.

Acked-by: Namhyung Kim <namhyung@kernel.org>
Reported-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20140613103127.1a9bdee7@gandalf.local.home
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/traceevent/plugin_kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 0575e59..88fe83d 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -344,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_r
 static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record,
 				     struct event_format *event, void *context)
 {
-	pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1);
+	pevent_print_num_field(s, "rip %llx ", event, "rip", record, 1);
 
 	return kvm_nested_vmexit_inject_handler(s, record, event, context);
 }

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-06-25  5:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-13  2:10 [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Steven Rostedt
2014-06-13  2:10 ` [PATCH 1/4] tools lib traceevent: Report unknown VMX exit reasons with code Steven Rostedt
2014-06-13  2:10 ` [PATCH 2/4] tools lib traceevent: Factor out print_exit_reason in kvm plugin Steven Rostedt
2014-06-13  2:10 ` [PATCH 3/4] tools lib traceevent: Add back in kvm plugins nested_vmexit events Steven Rostedt
2014-06-25  5:49   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2014-06-13  2:10 ` [PATCH 4/4] tools lib traceevent: Fix and cleanup kvm_nested_vmexit tracepoints Steven Rostedt
2014-06-13  9:55   ` Namhyung Kim
2014-06-13 13:59     ` Steven Rostedt
2014-06-13 14:31 ` [PATCH 5/4] tools lib traceevent: Fix format in plugin_kvm Steven Rostedt
2014-06-25  5:49   ` [tip:perf/core] " tip-bot for Steven Rostedt
2014-06-16  8:02 ` [PATCH 0/4] tools lib tracing: Updates from trace-cmd for plugin_kvm Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.