diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-22 11:37:08 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-22 11:37:08 -0400 |
commit | d6454850dd3c9d74b700924b56378c4c9ab9fa57 (patch) | |
tree | 6665a24339ca689b1156ea7e93d4f93811c3f794 /runtime/transport/debugfs.c | |
parent | d729143af5242b17645d3f405141918940680894 (diff) | |
parent | 4116c576d5654287b0af598aee4a14eb2af73224 (diff) | |
download | systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.gz systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.xz systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/transport/debugfs.c')
-rw-r--r-- | runtime/transport/debugfs.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/runtime/transport/debugfs.c b/runtime/transport/debugfs.c index 85ee604d..6bbef53b 100644 --- a/runtime/transport/debugfs.c +++ b/runtime/transport/debugfs.c @@ -10,6 +10,7 @@ */ #include <linux/debugfs.h> +#include "transport.h" #define STP_DEFAULT_BUFFERS 50 @@ -22,18 +23,26 @@ static struct dentry *_stp_cmd_file = NULL; static int _stp_register_ctl_channel_fs(void) { - if (_stp_utt == NULL) { - errk("_expected _stp_utt to be set.\n"); + struct dentry *module_dir = _stp_get_module_dir(); + if (module_dir == NULL) { + errk("no module directory found.\n"); return -1; } /* create [debugfs]/systemtap/module_name/.cmd */ - _stp_cmd_file = debugfs_create_file(".cmd", 0600, _stp_utt->dir, + _stp_cmd_file = debugfs_create_file(".cmd", 0600, module_dir, NULL, &_stp_ctl_fops_cmd); if (_stp_cmd_file == NULL) { errk("Error creating systemtap debugfs entries.\n"); return -1; } + else if (IS_ERR(_stp_cmd_file)) { + _stp_cmd_file = NULL; + errk("Error creating systemtap debugfs entries: %ld\n", + -PTR_ERR(_stp_cmd_file)); + return -1; + } + _stp_cmd_file->d_inode->i_uid = _stp_uid; _stp_cmd_file->d_inode->i_gid = _stp_gid; |