aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-01-11 04:17:10 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-01-11 04:24:18 -0500
commit642049ba7d30b24fb9927a22d44d6b84139668dc (patch)
treeeaa73b8f77c949b1a56ab0271bda5be7b3746725 /src
parentd427bf8561f488bfec36b14b02af5b8ca0b2782f (diff)
Make release_ts a bit more userfriendly
The -f option required manually *also* setting the -w option. This is no longer required. While at it, simplify the code by using the /proc interface.
Diffstat (limited to 'src')
-rw-r--r--src/kernel_iface.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/kernel_iface.c b/src/kernel_iface.c
index 4cc1af5..e446102 100644
--- a/src/kernel_iface.c
+++ b/src/kernel_iface.c
@@ -56,9 +56,8 @@ ssize_t read_file(const char* fname, void* buf, size_t maxlen)
56 return got; 56 return got;
57} 57}
58 58
59int get_nr_ts_release_waiters(void) 59int read_litmus_stats(int *ready, int *all)
60{ 60{
61 int ready = 0, all = 0;
62 char buf[100]; 61 char buf[100];
63 ssize_t len; 62 ssize_t len;
64 63
@@ -67,11 +66,17 @@ int get_nr_ts_release_waiters(void)
67 len = sscanf(buf, 66 len = sscanf(buf,
68 "real-time tasks = %d\n" 67 "real-time tasks = %d\n"
69 "ready for release = %d\n", 68 "ready for release = %d\n",
70 &all, &ready); 69 all, ready);
71 if (len == 2) 70 return len == 2;
71}
72
73int get_nr_ts_release_waiters(void)
74{
75 int ready, all;
76 if (read_litmus_stats(&ready, &all))
72 return ready; 77 return ready;
73 else 78 else
74 return len; 79 return -1;
75} 80}
76 81
77/* thread-local pointer to control page */ 82/* thread-local pointer to control page */