This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

utrace probe support for fedora 9 (2.6.26 like) kernels?


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
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_ */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]