From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xensource.com
Cc: David Vrabel <david.vrabel@citrix.com>,
George Dunlap <george.dunlap@citrix.com>
Subject: [PATCH 2/2] trace: trace hypercalls inside a multicall
Date: Thu, 24 May 2012 11:37:09 +0100 [thread overview]
Message-ID: <1337855829-15683-3-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1337855829-15683-1-git-send-email-david.vrabel@citrix.com>
From: David Vrabel <david.vrabel@citrix.com>
Add a trace record for every hypercall inside a multicall.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
xen/common/multicall.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index 6c1a9d7..1da53bb 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -11,6 +11,7 @@
#include <xen/multicall.h>
#include <xen/guest_access.h>
#include <xen/perfc.h>
+#include <xen/trace.h>
#include <asm/current.h>
#include <asm/hardirq.h>
@@ -19,6 +20,32 @@ typedef long ret_t;
#define xlat_multicall_entry(mcs)
#endif
+#ifdef COMPAT
+static void __trace_multicall_call(multicall_entry_t *call)
+{
+ unsigned long args[5];
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(args); i++)
+ args[i] = call->args[i];
+
+ __trace_hypercall(call->op, args);
+}
+#else
+static void __trace_multicall_call(multicall_entry_t *call)
+{
+ __trace_hypercall(call->op, call->args);
+}
+#endif
+
+static void trace_multicall_call(multicall_entry_t *call)
+{
+ if ( !tb_init_done )
+ return;
+
+ __trace_multicall_call(call);
+}
+
ret_t
do_multicall(
XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
@@ -47,6 +74,8 @@ do_multicall(
break;
}
+ trace_multicall_call(&mcs->call);
+
do_multicall_call(&mcs->call);
#ifndef NDEBUG
--
1.7.2.5
next prev parent reply other threads:[~2012-05-24 10:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 10:37 [PATCH 0/2] trace: improve hypercall tracing David Vrabel
2012-05-24 10:37 ` [PATCH 1/2] trace: improve usefulness of hypercall trace record David Vrabel
2012-05-24 16:11 ` George Dunlap
2012-05-24 16:14 ` David Vrabel
2012-05-28 16:03 ` Frediano Ziglio
2012-05-28 16:07 ` David Vrabel
2012-05-24 10:37 ` David Vrabel [this message]
2012-05-28 16:03 ` [PATCH 2/2] trace: trace hypercalls inside a multicall Frediano Ziglio
2012-05-28 16:09 ` David Vrabel
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=1337855829-15683-3-git-send-email-david.vrabel@citrix.com \
--to=david.vrabel@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=xen-devel@lists.xensource.com \
/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;
as well as URLs for NNTP newsgroup(s).