public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* utrace probe support for fedora 9 (2.6.26 like) kernels?
@ 2008-09-19 12:54 Mark Wielaard
  2008-09-22 19:17 ` David Smith
  2008-09-29 20:12 ` Roland McGrath
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Wielaard @ 2008-09-19 12:54 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

Hi,

Does it make sense to try to support the fedora 9 (2.6.26.3-29.fc9)
kernels for the utrace based probes? I am slightly confused which utrace
version this kernel has. So I don't really know what the
utrace_compatibility.h check should be for this though.But with the
following small patch most things seem to work.

Host: Linux dijkstra.wildebeest.org 2.6.26.3-29.fc9.x86_64 #1 SMP Wed Sep 3 03:16:37 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
Snapshot: version 0.7.1/0.135 git branch master, commit e8ea4501 + changes
Distro: Fedora release 9 (Sulphur)

Running /home/mark/src/systemtap/testsuite/systemtap.base/utrace_p5.exp ...
FAIL: UTRACE_P5_02 shutdown (eof)
FAIL: UTRACE_P5_03 shutdown (eof)
FAIL: UTRACE_P5_04 shutdown (eof)
FAIL: UTRACE_P5_05 shutdown (eof)

		=== systemtap Summary ===

# of expected passes		17
# of unexpected failures	4

I haven't looked into the remaining 4 failures yet.

Cheers,

Mark

[-- Attachment #2: utrace-f9-kernel.patch --]
[-- Type: text/x-patch, Size: 1595 bytes --]

diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index 493ca6f..fa9564d 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -428,10 +428,10 @@ stap_utrace_attach(struct task_struct *tsk,
 	}
 	else {
 		rc = utrace_set_events(tsk, engine, event_flags);
-		if (rc == 0)
+		if (rc == 0 || rc == -ESRCH || rc == -EALREADY)
 			debug_task_finder_attach();
 		else
-			_stp_error("utrace_set_events returned error %d on pid %d",
+			_stp_error("utrace_set_events during stap_utrace_attach returned error %d on pid %d",
 				   rc, (int)tsk->pid);
 	}
 	return rc;
@@ -758,8 +758,13 @@ __stp_utrace_task_finder_target_quiesce(enum utrace_resume_action action,
 	rc = utrace_set_events(tsk, engine,
 			       __STP_ATTACHED_TASK_BASE_EVENTS(tgt));
 	if (rc != 0)
-		_stp_error("utrace_set_events returned error %d on pid %d",
+	  {
+	    if (rc == -ESRCH || rc == -EALREADY) /* woops, task already gone? */
+	    	goto utftq_out;
+	    else
+		_stp_error("utrace_set_events during __stp_utrace_task_finder_target_quiesce returned error %d on pid %d",
 			   rc, (int)tsk->pid);
+	  }
 
 	if (tgt->callback != NULL) {
 		/* Call the callback.  Assume that if the thread is a
diff --git a/runtime/utrace_compatibility.h b/runtime/utrace_compatibility.h
index 8003701..07e4f22 100644
--- a/runtime/utrace_compatibility.h
+++ b/runtime/utrace_compatibility.h
@@ -52,6 +52,8 @@ utrace_set_events(struct task_struct *target,
 {
 	return utrace_set_flags(target, engine, eventmask);
 }
+#else
+#define utrace_attach_task utrace_attach
 #endif
 
 #endif	/* _UTRACE_COMPATIBILITY_H_ */

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

* Re: utrace probe support for fedora 9 (2.6.26 like) kernels?
  2008-09-19 12:54 utrace probe support for fedora 9 (2.6.26 like) kernels? Mark Wielaard
@ 2008-09-22 19:17 ` David Smith
  2008-09-29 20:12 ` Roland McGrath
  1 sibling, 0 replies; 3+ messages in thread
From: David Smith @ 2008-09-22 19:17 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: systemtap, Roland McGrath

Mark Wielaard wrote:
> Hi,
> 
> Does it make sense to try to support the fedora 9 (2.6.26.3-29.fc9)
> kernels for the utrace based probes? I am slightly confused which utrace
> version this kernel has. So I don't really know what the
> utrace_compatibility.h check should be for this though.But with the
> following small patch most things seem to work.

I'm not sure what is going on with utrace in 2.6.26.3-29.fc9.  What is
in there isn't the old version of utrace, and isn't the new version of
utrace.  It appears to be some sort of "middle" version that has some
old features and some newer features.

Roland, do you know what happened with 2.6.26.3-29.fc9?

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

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

* Re: utrace probe support for fedora 9 (2.6.26 like) kernels?
  2008-09-19 12:54 utrace probe support for fedora 9 (2.6.26 like) kernels? Mark Wielaard
  2008-09-22 19:17 ` David Smith
@ 2008-09-29 20:12 ` Roland McGrath
  1 sibling, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2008-09-29 20:12 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: systemtap

Sorry I didn't reply earlier in email, though I think I said this privately
to Mark and David already.

The f9 kernels have an intermediate state of the utrace code (newish API
but before utrace_engine_get and many other various changes/fixes).  I
had been keeping thoughts of f9 and backports blissfully absent from my
conscious mind for quite some time.  Basically I still am.  The Fedora
(10) rawhide kernels have the latest bleeding-edge utrace code from my
tree and stay current on a daily basis.  If you can use those for now,
that is certainly simplest.  I think it will work fine on an f9 userland.

I'd been expecting that 2.6.27 might be cut real soon already, and then
hoping for new f9 update kernels to be based on that.  Since everything
short of utrace proper (and some self-contained arch bits) got merged
for 2.6.27, it's the first version where "backporting" will be a real
breeze for me.

I realize it's a bit of hassle for systemtap hackers running stable
Fedora.  But for the moment I still don't think my top priorities should
include 2.6.26 backport of the current work.  If too much longer goes by
before 2.6.27 and/or there is huge demand for it, maybe I will have to
do it.


Thanks,
Roland

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

end of thread, other threads:[~2008-09-29 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-19 12:54 utrace probe support for fedora 9 (2.6.26 like) kernels? Mark Wielaard
2008-09-22 19:17 ` David Smith
2008-09-29 20:12 ` Roland McGrath

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 read-only IMAP folder(s) and NNTP newsgroup(s).