This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Problems using the older relay interface
- From: David Wilder <dwilder at us dot ibm dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Fri, 07 Sep 2007 08:53:54 -0700
- Subject: Problems using the older relay interface
Hi-
I have a problem with a client trying to get stap working on 2.6.16
kernel. The problem is related to the use of the old relayfs interface
in the kernel. These are the areas where I ran into trouble, please
comment on my purposed changes.
1) Relay changed sometime in the 2.6.16 time frame from relayfs to
relay. runtime.h assumes that all 2.6.16 kernels use the new relay
code. Unfortunately this was not the case. The 2.6.16 based kernel my
client was running was still using the old relay_fs code. Purposed
change :
to--- runtime.h.orig 2007-09-07 08:32:55.000000000 -0700
+++ runtime.h 2007-09-07 08:35:14.000000000 -0700
@@ -30,7 +30,7 @@
#include <linux/compat.h>
#include <linux/mm.h>
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+#if defined (CONFIG_RELAYFS) || defined (CONFIG_RELAYFS_MODULE)
#if !defined (CONFIG_DEBUG_FS) && !defined (CONFIG_DEBUG_FS_MODULE)
#error "DebugFS is required and was not found in the kernel."
#endif
#if defined (CONFIG_RELAYFS_FS) || defined (CONFIG_RELAYFS_FS_MODULE)
2) The same problem exists in staprun. Stap run uses the kernel
version not the existence of relay vs relayfs to determine where to look
for its relay files. We could check /proc/filesystems for the entries
debugfs or relayfs, but I not sure how to handle the case of relayFS or
debugFS being built as a module. Any ideas?
3) I also had to make the following changes to
/src/runtime/transport/relayfs.c to get the stap modules to build.
--- relayfs.c.orig 2007-09-06 14:52:30.000000000 -0700
+++ relayfs.c 2007-09-06 15:21:37.000000000 -0700
@@ -29,18 +29,19 @@
/**
* _stp_subbuf_start - subbuf_start() relayfs callback implementation
*/
+
static int _stp_subbuf_start(struct rchan_buf *buf,
- void *subbuf,
- unsigned prev_subbuf_idx,
- void *prev_subbuf)
-{
- unsigned padding = buf->padding[prev_subbuf_idx];
- if (prev_subbuf)
- *((unsigned *)prev_subbuf) = padding;
+ void *subbuf,
+ void *prev_subbuf,
+ unsigned int prev_padding)
+{
+ if (prev_subbuf)
+ *((unsigned *)prev_subbuf) = prev_padding;
- return sizeof(padding); /* reserve space for padding */
+ return 1;
}
+
/**
* _stp_buf_full - buf_full() relayfs callback implementation
*/
@@ -55,7 +56,7 @@
static struct rchan_callbacks stp_rchan_callbacks =
{
.subbuf_start = _stp_subbuf_start,
- .buf_full = _stp_buf_full,
+ //.buf_full = _stp_buf_full,
};
@@ -97,7 +98,7 @@
kbug("relay_open %d %d\n", utts->buf_size, utts->buf_nr);
utt->rchan = relay_open("trace", utt->dir, utts->buf_size,
- utts->buf_nr, 0, &stp_rchan_callbacks);
+ utts->buf_nr, &stp_rchan_callbacks);
if (!utt->rchan)
goto err;