summaryrefslogtreecommitdiffstats
path: root/runtime/transport/control.c
diff options
context:
space:
mode:
authorStan Cox <scox@redhat.com>2009-06-19 14:06:52 -0400
committerStan Cox <scox@redhat.com>2009-06-19 14:06:52 -0400
commitd138d3d71a1685c53cc5c2b72ed8ae64d3e012d2 (patch)
tree966ff2622c07fb84513b487482a1a1f46bae5dfc /runtime/transport/control.c
parent45148f5b5e371ff852dbbb08d83c5e87932b372e (diff)
parenteba61c56888482553551a16ec651444a583522e0 (diff)
downloadsystemtap-steved-d138d3d71a1685c53cc5c2b72ed8ae64d3e012d2.tar.gz
systemtap-steved-d138d3d71a1685c53cc5c2b72ed8ae64d3e012d2.tar.xz
systemtap-steved-d138d3d71a1685c53cc5c2b72ed8ae64d3e012d2.zip
Merge branch 'master' of ssh://sourceware.org/git/systemtap
Diffstat (limited to 'runtime/transport/control.c')
-rw-r--r--runtime/transport/control.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/runtime/transport/control.c b/runtime/transport/control.c
index 680d7306..35130f0f 100644
--- a/runtime/transport/control.c
+++ b/runtime/transport/control.c
@@ -9,6 +9,11 @@
* later version.
*/
+#include "control.h"
+#include "../mempool.c"
+#include "symbols.c"
+#include <linux/delay.h>
+
static _stp_mempool_t *_stp_pool_q;
static struct list_head _stp_ctl_ready_q;
static DEFINE_SPINLOCK(_stp_ctl_ready_lock);
@@ -32,7 +37,8 @@ static ssize_t _stp_ctl_write_cmd(struct file *file, const char __user *buf, siz
#ifdef DEBUG_TRANS
if (type < STP_MAX_CMD)
- _dbug("Got %s. len=%d\n", _stp_command_name[type], (int)count);
+ dbug_trans2("Got %s. len=%d\n", _stp_command_name[type],
+ (int)count);
#endif
switch (type) {
@@ -79,27 +85,46 @@ static void _stp_ctl_write_dbug(int type, void *data, int len)
char buf[64];
switch (type) {
case STP_START:
- _dbug("sending STP_START\n");
+ dbug_trans2("sending STP_START\n");
break;
case STP_EXIT:
- _dbug("sending STP_EXIT\n");
+ dbug_trans2("sending STP_EXIT\n");
break;
case STP_OOB_DATA:
snprintf(buf, sizeof(buf), "%s", (char *)data);
- _dbug("sending %d bytes of STP_OOB_DATA: %s\n", len, buf);
+ dbug_trans2("sending %d bytes of STP_OOB_DATA: %s\n", len,
+ buf);
break;
case STP_SYSTEM:
snprintf(buf, sizeof(buf), "%s", (char *)data);
- _dbug("sending STP_SYSTEM: %s\n", buf);
+ dbug_trans2("sending STP_SYSTEM: %s\n", buf);
break;
case STP_TRANSPORT:
- _dbug("sending STP_TRANSPORT\n");
+ dbug_trans2("sending STP_TRANSPORT\n");
+ break;
+ case STP_CONNECT:
+ dbug_trans2("sending STP_CONNECT\n");
+ break;
+ case STP_DISCONNECT:
+ dbug_trans2("sending STP_DISCONNECT\n");
+ break;
+ case STP_BULK:
+ dbug_trans2("sending STP_BULK\n");
+ break;
+ case STP_READY:
+ case STP_RELOCATION:
+ case STP_BUF_INFO:
+ case STP_SUBBUFS_CONSUMED:
+ dbug_trans2("sending old message\n");
+ break;
+ case STP_REALTIME_DATA:
+ dbug_trans2("sending %d bytes of STP_REALTIME_DATA\n", len);
break;
case STP_REQUEST_EXIT:
- _dbug("sending STP_REQUEST_EXIT\n");
+ dbug_trans2("sending STP_REQUEST_EXIT\n");
break;
default:
- _dbug("ERROR: unknown message type: %d\n", type);
+ dbug_trans2("ERROR: unknown message type: %d\n", type);
break;
}
}
@@ -197,7 +222,7 @@ static ssize_t _stp_ctl_read_cmd(struct file *file, char __user *buf,
static int _stp_ctl_open_cmd(struct inode *inode, struct file *file)
{
- if (_stp_attached)
+ if (_stp_ctl_attached)
return -1;
_stp_attach();
return 0;
@@ -205,7 +230,7 @@ static int _stp_ctl_open_cmd(struct inode *inode, struct file *file)
static int _stp_ctl_close_cmd(struct inode *inode, struct file *file)
{
- if (_stp_attached)
+ if (_stp_ctl_attached)
_stp_detach();
return 0;
}