projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix tp_copy_string_from_user handling of faults
[lttng-modules.git]
/
ltt-debugfs-abi.c
diff --git
a/ltt-debugfs-abi.c
b/ltt-debugfs-abi.c
index 81afdbdbae28f13459fc84f9e3ed7dbe97137945..37cccfa35f472f0b43b9aff9693f959dc8680f8a 100644
(file)
--- a/
ltt-debugfs-abi.c
+++ b/
ltt-debugfs-abi.c
@@
-26,6
+26,7
@@
#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/debugfs.h>
+#include <linux/proc_fs.h>
#include <linux/anon_inodes.h>
#include <linux/file.h>
#include <linux/uaccess.h>
#include <linux/anon_inodes.h>
#include <linux/file.h>
#include <linux/uaccess.h>
@@
-43,6
+44,7
@@
*/
static struct dentry *lttng_dentry;
*/
static struct dentry *lttng_dentry;
+static struct proc_dir_entry *lttng_proc_dentry;
static const struct file_operations lttng_fops;
static const struct file_operations lttng_session_fops;
static const struct file_operations lttng_channel_fops;
static const struct file_operations lttng_fops;
static const struct file_operations lttng_session_fops;
static const struct file_operations lttng_channel_fops;
@@
-180,8
+182,8
@@
long lttng_abi_add_context(struct file *file,
context_param.u.perf_counter.config,
context_param.u.perf_counter.name,
ctx);
context_param.u.perf_counter.config,
context_param.u.perf_counter.name,
ctx);
- case LTTNG_KERNEL_CONTEXT_
COMM
:
- return lttng_add_
comm
_to_ctx(ctx);
+ case LTTNG_KERNEL_CONTEXT_
PROCNAME
:
+ return lttng_add_
procname
_to_ctx(ctx);
default:
return -EINVAL;
}
default:
return -EINVAL;
}
@@
-266,7
+268,7
@@
void lttng_metadata_create_events(struct file *channel_file)
* We tolerate no failure path after event creation. It will stay
* invariant for the rest of the session.
*/
* We tolerate no failure path after event creation. It will stay
* invariant for the rest of the session.
*/
- event = ltt_event_create(channel, &metadata_params, NULL);
+ event = ltt_event_create(channel, &metadata_params, NULL
, NULL
);
if (!event) {
goto create_error;
}
if (!event) {
goto create_error;
}
@@
-532,7
+534,7
@@
int lttng_abi_create_event(struct file *channel_file,
* We tolerate no failure path after event creation. It
* will stay invariant for the rest of the session.
*/
* We tolerate no failure path after event creation. It
* will stay invariant for the rest of the session.
*/
- event = ltt_event_create(channel, &event_param, NULL);
+ event = ltt_event_create(channel, &event_param, NULL
, NULL
);
if (!event) {
ret = -EINVAL;
goto event_error;
if (!event) {
ret = -EINVAL;
goto event_error;
@@
-542,7
+544,12
@@
int lttng_abi_create_event(struct file *channel_file,
/* The event holds a reference on the channel */
atomic_long_inc(&channel_file->f_count);
break;
/* The event holds a reference on the channel */
atomic_long_inc(&channel_file->f_count);
break;
- case LTTNG_KERNEL_SYSCALLS:
+ case LTTNG_KERNEL_SYSCALL:
+ /*
+ * Only all-syscall tracing supported for now.
+ */
+ if (event_param.name[0] != '\0')
+ return -EINVAL;
ret = lttng_syscalls_register(channel, NULL);
if (ret)
goto fd_error;
ret = lttng_syscalls_register(channel, NULL);
if (ret)
goto fd_error;
@@
-745,8
+752,14
@@
int __init ltt_debugfs_abi_init(void)
wrapper_vmalloc_sync_all();
lttng_dentry = debugfs_create_file("lttng", S_IWUSR, NULL, NULL,
wrapper_vmalloc_sync_all();
lttng_dentry = debugfs_create_file("lttng", S_IWUSR, NULL, NULL,
- <tng_fops);
- if (IS_ERR(lttng_dentry) || !lttng_dentry) {
+ <tng_fops);
+ if (IS_ERR(lttng_dentry))
+ lttng_dentry = NULL;
+
+ lttng_proc_dentry = proc_create_data("lttng", S_IWUSR, NULL,
+ <tng_fops, NULL);
+
+ if (!lttng_dentry && !lttng_proc_dentry) {
printk(KERN_ERR "Error creating LTTng control file\n");
ret = -ENOMEM;
goto error;
printk(KERN_ERR "Error creating LTTng control file\n");
ret = -ENOMEM;
goto error;
@@
-757,5
+770,8
@@
error:
void __exit ltt_debugfs_abi_exit(void)
{
void __exit ltt_debugfs_abi_exit(void)
{
- debugfs_remove(lttng_dentry);
+ if (lttng_dentry)
+ debugfs_remove(lttng_dentry);
+ if (lttng_proc_dentry)
+ remove_proc_entry("lttng", NULL);
}
}
This page took
0.04113 seconds
and
4
git commands to generate.