aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/trace.c')
-rw-r--r--litmus/trace.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/litmus/trace.c b/litmus/trace.c
index da650dfe7f4d..e7ea1c2ab3e4 100644
--- a/litmus/trace.c
+++ b/litmus/trace.c
@@ -90,12 +90,33 @@ static void free_timestamp_buffer(struct ftdev* ftdev, unsigned int idx)
90 90
91static int __init init_ft_overhead_trace(void) 91static int __init init_ft_overhead_trace(void)
92{ 92{
93 int err;
94
93 printk("Initializing Feather-Trace overhead tracing device.\n"); 95 printk("Initializing Feather-Trace overhead tracing device.\n");
94 ftdev_init(&overhead_dev, THIS_MODULE, "ft_trace"); 96 err = ftdev_init(&overhead_dev, THIS_MODULE, 1, "ft_trace");
95 overhead_dev.minor_cnt = 1; /* only one buffer */ 97 if (err)
98 goto err_out;
99
96 overhead_dev.alloc = alloc_timestamp_buffer; 100 overhead_dev.alloc = alloc_timestamp_buffer;
97 overhead_dev.free = free_timestamp_buffer; 101 overhead_dev.free = free_timestamp_buffer;
98 return register_ftdev(&overhead_dev); 102
103 err = register_ftdev(&overhead_dev);
104 if (err)
105 goto err_dealloc;
106
107 return 0;
108
109err_dealloc:
110 ftdev_exit(&overhead_dev);
111err_out:
112 printk(KERN_WARNING "Could not register ft_trace module.\n");
113 return err;
114}
115
116static void __exit exit_ft_overhead_trace(void)
117{
118 ftdev_exit(&overhead_dev);
99} 119}
100 120
101module_init(init_ft_overhead_trace); 121module_init(init_ft_overhead_trace);
122module_exit(exit_ft_overhead_trace);