diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-05-02 21:57:58 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-05-02 21:57:58 -0400 |
| commit | 588411e07c2c93456d29904b813c05553db88559 (patch) | |
| tree | 128da753107c1b1f4811e152834827a3b870d309 | |
| parent | e856595d055f3a1f8ca46f19e8d061f73e12a09a (diff) | |
litmus core: report ready tasks to user space
| -rw-r--r-- | litmus/litmus.c | 9 | ||||
| -rw-r--r-- | litmus/sync.c | 14 |
2 files changed, 21 insertions, 2 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c index becc00069b..60e7507ba0 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
| @@ -701,6 +701,9 @@ static struct sysrq_key_op sysrq_kill_rt_tasks_op = { | |||
| 701 | 701 | ||
| 702 | #endif | 702 | #endif |
| 703 | 703 | ||
| 704 | /* in sync.c */ | ||
| 705 | int count_tasks_waiting_for_release(void); | ||
| 706 | |||
| 704 | static int proc_read_stats(char *page, char **start, | 707 | static int proc_read_stats(char *page, char **start, |
| 705 | off_t off, int count, | 708 | off_t off, int count, |
| 706 | int *eof, void *data) | 709 | int *eof, void *data) |
| @@ -708,8 +711,10 @@ static int proc_read_stats(char *page, char **start, | |||
| 708 | int len; | 711 | int len; |
| 709 | 712 | ||
| 710 | len = snprintf(page, PAGE_SIZE, | 713 | len = snprintf(page, PAGE_SIZE, |
| 711 | "real-time task count = %d\n", | 714 | "real-time tasks = %d\n" |
| 712 | atomic_read(&rt_task_count)); | 715 | "ready for release = %d\n", |
| 716 | atomic_read(&rt_task_count), | ||
| 717 | count_tasks_waiting_for_release()); | ||
| 713 | return len; | 718 | return len; |
| 714 | } | 719 | } |
| 715 | 720 | ||
diff --git a/litmus/sync.c b/litmus/sync.c index 9c9941fc27..bd2c677d64 100644 --- a/litmus/sync.c +++ b/litmus/sync.c | |||
| @@ -33,6 +33,20 @@ static long do_wait_for_ts_release(void) | |||
| 33 | return ret; | 33 | return ret; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | int count_tasks_waiting_for_release(void) | ||
| 37 | { | ||
| 38 | long flags; | ||
| 39 | int task_count = 0; | ||
| 40 | struct list_head *pos; | ||
| 41 | |||
| 42 | spin_lock_irqsave(&ts_release.wait.lock, flags); | ||
| 43 | list_for_each(pos, &ts_release.wait.task_list) { | ||
| 44 | task_count++; | ||
| 45 | } | ||
| 46 | spin_unlock_irqrestore(&ts_release.wait.lock, flags); | ||
| 47 | |||
| 48 | return task_count; | ||
| 49 | } | ||
| 36 | 50 | ||
| 37 | static long do_release_ts(lt_t start) | 51 | static long do_release_ts(lt_t start) |
| 38 | { | 52 | { |
