From: tip-bot for Jan Kiszka <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
jolsa@kernel.org, jan.kiszka@siemens.com, namhyung@kernel.org,
rostedt@goodmis.org, tglx@linutronix.de
Subject: [tip:perf/core] tools lib traceevent: Factor out print_exit_reason in kvm plugin
Date: Tue, 24 Jun 2014 22:48:55 -0700 [thread overview]
Message-ID: <tip-6f21037b3295d4ba20ad2cc7cd4073ec64440f8f@git.kernel.org> (raw)
In-Reply-To: <619c418c8af87f03027b8c8013b0443996605700.1388855989.git.jan.kiszka@web.de>
Commit-ID: 6f21037b3295d4ba20ad2cc7cd4073ec64440f8f
Gitweb: http://git.kernel.org/tip/6f21037b3295d4ba20ad2cc7cd4073ec64440f8f
Author: Jan Kiszka <jan.kiszka@siemens.com>
AuthorDate: Thu, 12 Jun 2014 22:10:04 -0400
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Thu, 19 Jun 2014 18:18:20 +0200
tools lib traceevent: Factor out print_exit_reason in kvm plugin
We will reuse it for nested vmexit tracepoints.
Link: http://lkml.kernel.org/r/619c418c8af87f03027b8c8013b0443996605700.1388855989.git.jan.kiszka@web.de
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.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 3e61220..2d7d1d7 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);
next prev parent reply other threads:[~2014-06-25 5:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-04 17:19 [PATCH 0/3] trace-cmd: Updates for kvm plugin Jan Kiszka
2014-01-04 17:19 ` [PATCH 1/3] trace-cmd: Report unknown VMX exit reasons with code Jan Kiszka
2014-01-04 17:19 ` [PATCH 2/3] trace-cmd: Factor out print_exit_reason in kvm plugin Jan Kiszka
2014-06-25 5:48 ` tip-bot for Jan Kiszka [this message]
2014-01-04 17:19 ` [PATCH 3/3] trace-cmd: Fix and cleanup kvm_nested_vmexit tracepoints Jan Kiszka
2014-06-25 5:49 ` [tip:perf/core] tools lib traceevent: " tip-bot for Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-6f21037b3295d4ba20ad2cc7cd4073ec64440f8f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=jan.kiszka@siemens.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox