All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] lttng: Trace syscall exits
Date: Wed, 25 Feb 2009 19:30:39 +0100	[thread overview]
Message-ID: <49A58E4F.6060907@domain.hid> (raw)

Add proper marks for the end of Xenomai's syscall handling, just like
LTTng provides for Linux syscall. That is helpful to keep the overview
of current context and the time spent there. And it allows to track the
return code.

Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---

 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index e2f2968..b9303b2 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -1924,7 +1924,7 @@ static inline int do_hisyscall_event(unsigned event, unsigned domid, void *data)
 	muxid = __xn_mux_id(regs);
 	muxop = __xn_mux_op(regs);
 
-	trace_mark(xn_nucleus, syscall_histage,
+	trace_mark(xn_nucleus, syscall_histage_entry,
 		   "thread %p thread_name %s muxid %d muxop %d",
 		   thread, thread ? xnthread_name(thread) : NULL,
 		   muxid, muxop);
@@ -1932,14 +1932,14 @@ static inline int do_hisyscall_event(unsigned event, unsigned domid, void *data)
 	if (muxid < 0 || muxid > XENOMAI_MUX_NR ||
 	    muxop < 0 || muxop >= muxtable[muxid].props->nrcalls) {
 		__xn_error_return(regs, -ENOSYS);
-		return RTHAL_EVENT_STOP;
+		goto ret_handled;
 	}
 
 	sysflags = muxtable[muxid].props->systab[muxop].flags;
 
 	if ((sysflags & __xn_exec_shadow) != 0 && !thread) {
 		__xn_error_return(regs, -EPERM);
-		return RTHAL_EVENT_STOP;
+		goto ret_handled;
 	}
 
 	if ((sysflags & __xn_exec_conforming) != 0)
@@ -2018,6 +2018,10 @@ static inline int do_hisyscall_event(unsigned event, unsigned domid, void *data)
 	else if ((sysflags & __xn_exec_switchback) != 0 && switched)
 		xnshadow_harden();	/* -EPERM will be trapped later if needed. */
 
+      ret_handled:
+
+	trace_mark(xn_nucleus, syscall_histage_exit,
+		   "ret %ld", __xn_reg_rval(regs));
 	return RTHAL_EVENT_STOP;
 
       linux_syscall:
@@ -2115,7 +2119,7 @@ static inline int do_losyscall_event(unsigned event, unsigned domid, void *data)
 	muxid = __xn_mux_id(regs);
 	muxop = __xn_mux_op(regs);
 
-	trace_mark(xn_nucleus, syscall_lostage,
+	trace_mark(xn_nucleus, syscall_lostage_entry,
 		   "thread %p thread_name %s muxid %d muxop %d",
 		   xnpod_active_p() ? xnpod_current_thread() : NULL,
 		   xnpod_active_p() ? xnthread_name(xnpod_current_thread()) : NULL,
@@ -2137,7 +2141,7 @@ static inline int do_losyscall_event(unsigned event, unsigned domid, void *data)
 		   syscall. */
 		if ((err = xnshadow_harden()) != 0) {
 			__xn_error_return(regs, err);
-			return RTHAL_EVENT_STOP;
+			goto ret_handled;
 		}
 
 		switched = 1;
@@ -2165,6 +2169,9 @@ static inline int do_losyscall_event(unsigned event, unsigned domid, void *data)
 	else if ((sysflags & __xn_exec_switchback) != 0 && switched)
 		xnshadow_relax(0);
 
+      ret_handled:
+	trace_mark(xn_nucleus, syscall_lostage_exit,
+		   "ret %ld", __xn_reg_rval(regs));
 	return RTHAL_EVENT_STOP;
 }
 


             reply	other threads:[~2009-02-25 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 18:30 Jan Kiszka [this message]
2009-02-25 18:38 ` [Xenomai-core] [PATCH] lttng: Trace syscall exits 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=49A58E4F.6060907@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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 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.