aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/litmus_proc.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-18 11:13:07 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-18 11:14:15 -0500
commitcc9f46d0ce73ae30e3918999976ef587b0e8a04d (patch)
tree85c3da741b968ce8ad0f3b75daa86238cd93a054 /litmus/litmus_proc.c
parente6b58b65441925c307f40ce5bd9d5676750f7601 (diff)
/proc hooks for locking protocols.
RSM locks only make use of /proc for now.
Diffstat (limited to 'litmus/litmus_proc.c')
-rw-r--r--litmus/litmus_proc.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/litmus/litmus_proc.c b/litmus/litmus_proc.c
index 136fecfb0b8b..be62d04da376 100644
--- a/litmus/litmus_proc.c
+++ b/litmus/litmus_proc.c
@@ -10,6 +10,10 @@
10 10
11#include <litmus/clustered.h> 11#include <litmus/clustered.h>
12 12
13#ifdef CONFIG_LITMUS_LOCKING
14#include <litmus/locking.h>
15#endif
16
13/* in litmus/litmus.c */ 17/* in litmus/litmus.c */
14extern atomic_t rt_task_count; 18extern atomic_t rt_task_count;
15 19
@@ -23,6 +27,9 @@ static struct proc_dir_entry *litmus_dir = NULL,
23#ifdef CONFIG_LITMUS_SOFTIRQD 27#ifdef CONFIG_LITMUS_SOFTIRQD
24 *klmirqd_file = NULL, 28 *klmirqd_file = NULL,
25#endif 29#endif
30#ifdef CONFIG_LITMUS_LOCKING
31 *locks_dir = NULL,
32#endif
26 *plugs_file = NULL; 33 *plugs_file = NULL;
27 34
28/* in litmus/sync.c */ 35/* in litmus/sync.c */
@@ -187,6 +194,15 @@ int __init init_litmus_proc(void)
187 plugs_file = create_proc_read_entry("loaded", 0444, plugs_dir, 194 plugs_file = create_proc_read_entry("loaded", 0444, plugs_dir,
188 proc_read_plugins, NULL); 195 proc_read_plugins, NULL);
189 196
197#ifdef CONFIG_LITMUS_LOCKING
198 locks_dir = proc_mkdir("locks", litmus_dir);
199 if (!locks_dir) {
200 printk(KERN_ERR "Could not allocate locks directory "
201 "procfs entry.\n");
202 return -ENOMEM;
203 }
204#endif
205
190 return 0; 206 return 0;
191} 207}
192 208
@@ -196,6 +212,8 @@ void exit_litmus_proc(void)
196 remove_proc_entry("loaded", plugs_dir); 212 remove_proc_entry("loaded", plugs_dir);
197 if (plugs_dir) 213 if (plugs_dir)
198 remove_proc_entry("plugins", litmus_dir); 214 remove_proc_entry("plugins", litmus_dir);
215 if (locks_dir)
216 remove_proc_entry("locks", litmus_dir);
199 if (stat_file) 217 if (stat_file)
200 remove_proc_entry("stats", litmus_dir); 218 remove_proc_entry("stats", litmus_dir);
201 if (curr_file) 219 if (curr_file)
@@ -362,3 +380,24 @@ struct proc_dir_entry* create_cluster_file(struct proc_dir_entry* parent,
362 return cluster_file; 380 return cluster_file;
363} 381}
364 382
383#ifdef CONFIG_LITMUS_LOCKING
384struct proc_dir_entry* litmus_add_proc_lock(struct litmus_lock* l, read_proc_t func)
385{
386 struct proc_dir_entry* entry = NULL;
387
388 if (locks_dir)
389 entry = create_proc_read_entry(l->name, 0444, locks_dir, func, l);
390
391 return entry;
392}
393
394void litmus_remove_proc_lock(struct litmus_lock* l)
395{
396 if (locks_dir)
397 remove_proc_entry(l->name, locks_dir);
398}
399#endif
400
401
402
403