diff options
author | hunt <hunt> | 2007-03-28 16:11:28 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-03-28 16:11:28 +0000 |
commit | dba81c1410b8905ddcdeaac0a7af7badac74b341 (patch) | |
tree | 339fd15f59848fc017668df7dffe2ebbd037d65c | |
parent | a0e355e761adebb639c46ecc83ab2ce3380765e5 (diff) | |
download | systemtap-steved-dba81c1410b8905ddcdeaac0a7af7badac74b341.tar.gz systemtap-steved-dba81c1410b8905ddcdeaac0a7af7badac74b341.tar.xz systemtap-steved-dba81c1410b8905ddcdeaac0a7af7badac74b341.zip |
2007-03-28 Martin Hunt <hunt@redhat.com>
* control.c (_stp_ctl_open_cmd): Set _stp_pid.
(stp_ctl_close_cmd): Clear _stp_pid.
* transport.h: Declare _stp_pid;
-rw-r--r-- | runtime/transport/ChangeLog | 6 | ||||
-rw-r--r-- | runtime/transport/control.c | 15 | ||||
-rw-r--r-- | runtime/transport/transport.h | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog index 40519dee..319c50ac 100644 --- a/runtime/transport/ChangeLog +++ b/runtime/transport/ChangeLog @@ -1,3 +1,9 @@ +2007-03-28 Martin Hunt <hunt@redhat.com> + + * control.c (_stp_ctl_open_cmd): Set _stp_pid. + (stp_ctl_close_cmd): Clear _stp_pid. + * transport.h: Declare _stp_pid; + 2007-03-26 Frank Ch. Eigler <fche@elastic.org> * transport.c: Add #include <linux/namei.h> for lookup_one_len. diff --git a/runtime/transport/control.c b/runtime/transport/control.c index 2924edab..443b2302 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -206,10 +206,25 @@ _stp_ctl_read_cmd (struct file *file, char __user *buf, size_t count, loff_t *pp return len; } +static int _stp_ctl_open_cmd (struct inode *inode, struct file *file) +{ + _stp_pid = current->pid; + return 0; +} + +static int _stp_ctl_close_cmd (struct inode *inode, struct file *file) +{ + _stp_pid = 0; + return 0; + +} + static struct file_operations _stp_ctl_fops_cmd = { .owner = THIS_MODULE, .read = _stp_ctl_read_cmd, .write = _stp_ctl_write_cmd, + .open = _stp_ctl_open_cmd, + .release = _stp_ctl_close_cmd, }; static struct dentry *_stp_cmd_file = NULL; diff --git a/runtime/transport/transport.h b/runtime/transport/transport.h index 09a0615e..d1e97edb 100644 --- a/runtime/transport/transport.h +++ b/runtime/transport/transport.h @@ -22,4 +22,6 @@ extern void _stp_print_cleanup(void); static struct dentry *_stp_get_root_dir(const char *name); static int _stp_lock_debugfs(void); static void _stp_unlock_debugfs(void); +int _stp_pid = 0; + #endif /* _TRANSPORT_TRANSPORT_H_ */ |