diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-02-20 14:56:38 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-02-20 14:56:38 +0100 |
commit | 02615365a92ca2570c1f96abc8a97674aa2ccae1 (patch) | |
tree | ebedfd91a0f6d299b39e84295e091e12c0767dc8 /runtime/transport/debugfs.c | |
parent | c3bad3042df505a3470f1e20b09822a9df1d4761 (diff) | |
parent | adc67597f327cd43d58b1d0cb740dab14a75a058 (diff) | |
download | systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.tar.gz systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.tar.xz systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.zip |
Merge branch 'master' into pr6866
Conflicts:
ChangeLog: Removed
runtime/ChangeLog: Removed
runtime/sym.c: Merged
runtime/task_finder.c: Merged
tapset/ChangeLog: Removed
testsuite/ChangeLog: Removed
Diffstat (limited to 'runtime/transport/debugfs.c')
-rw-r--r-- | runtime/transport/debugfs.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/runtime/transport/debugfs.c b/runtime/transport/debugfs.c new file mode 100644 index 00000000..dc651a56 --- /dev/null +++ b/runtime/transport/debugfs.c @@ -0,0 +1,45 @@ +/* -*- linux-c -*- + * + * debugfs functions + * Copyright (C) 2009 Red Hat Inc. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ + +#define STP_DEFAULT_BUFFERS 50 + +inline static int _stp_ctl_write_fs(int type, void *data, unsigned len) +{ + return 0; +} + +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"); + return -1; + } + + /* create [debugfs]/systemtap/module_name/.cmd */ + _stp_cmd_file = debugfs_create_file(".cmd", 0600, _stp_utt->dir, + NULL, &_stp_ctl_fops_cmd); + if (_stp_cmd_file == NULL) { + errk("Error creating systemtap debugfs entries.\n"); + return -1; + } + _stp_cmd_file->d_inode->i_uid = _stp_uid; + _stp_cmd_file->d_inode->i_gid = _stp_gid; + + return 0; +} + +static void _stp_unregister_ctl_channel_fs(void) +{ + if (_stp_cmd_file) + debugfs_remove(_stp_cmd_file); +} |