diff options
author | hunt <hunt> | 2007-11-01 19:19:33 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-11-01 19:19:33 +0000 |
commit | 68e81635a3fd6d11f6e605995c72801c66305171 (patch) | |
tree | 3871759d4412aedebf85975ccfcedfe712613559 /runtime/transport/procfs.c | |
parent | d47936fc8f3245d9f14797eb7bf2e876b3c37c99 (diff) | |
download | systemtap-steved-68e81635a3fd6d11f6e605995c72801c66305171.tar.gz systemtap-steved-68e81635a3fd6d11f6e605995c72801c66305171.tar.xz systemtap-steved-68e81635a3fd6d11f6e605995c72801c66305171.zip |
2007-11-01 Martin Hunt <hunt@redhat.com>
* procfs.c, control.c, transport.c: Recognize when stapio
is detached and disable delayed work. Enable when attached.
Cleanup code to destroy workqueue on exit.
Diffstat (limited to 'runtime/transport/procfs.c')
-rw-r--r-- | runtime/transport/procfs.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c index 88740847..069e379e 100644 --- a/runtime/transport/procfs.c +++ b/runtime/transport/procfs.c @@ -324,6 +324,8 @@ static int _stp_ctl_send (int type, void *data, int len) } else { while ((err = _stp_ctl_write(type, data, len)) < 0 && trylimit--) msleep (5); + if (err > 0) + wake_up_interruptible(&_stp_ctl_wq); } return err; } @@ -430,23 +432,19 @@ static int _stp_sym_close_cmd (struct inode *inode, struct file *file) return 0; } -static int _stp_ctl_opens = 0; static int _stp_ctl_open_cmd (struct inode *inode, struct file *file) { - /* only allow one reader */ - if (_stp_ctl_opens) + if (_stp_attached) return -1; - _stp_ctl_opens++; - _stp_pid = current->pid; + _stp_attach(); return 0; } static int _stp_ctl_close_cmd (struct inode *inode, struct file *file) { - if (_stp_ctl_opens) - _stp_ctl_opens--; - _stp_pid = 0; + if (_stp_attached) + _stp_detach(); return 0; } |