diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-05 22:57:57 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-05 22:57:57 -0500 |
commit | 26c9534ab5b19d9bbd092df8ff2439722c0b2758 (patch) | |
tree | e71acb53337e2ec809a73eb3c057197f5befddad | |
parent | 9ad6af9eaa75f5023b26b8a8c7b943088a83fd1b (diff) |
Feather-Trace: trace locking-related suspensions
-rw-r--r-- | include/litmus/trace.h | 9 | ||||
-rw-r--r-- | litmus/sched_gsn_edf.c | 5 | ||||
-rw-r--r-- | litmus/sched_psn_edf.c | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/include/litmus/trace.h b/include/litmus/trace.h index 05f487263f28..a725e8b583ba 100644 --- a/include/litmus/trace.h +++ b/include/litmus/trace.h | |||
@@ -92,9 +92,12 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu) | |||
92 | #define TS_EXIT_NP_END TIMESTAMP(151) | 92 | #define TS_EXIT_NP_END TIMESTAMP(151) |
93 | 93 | ||
94 | #define TS_LOCK_START TIMESTAMP(170) | 94 | #define TS_LOCK_START TIMESTAMP(170) |
95 | #define TS_LOCK_END TIMESTAMP(171) | 95 | #define TS_LOCK_SUSPEND TIMESTAMP(171) |
96 | #define TS_UNLOCK_START TIMESTAMP(172) | 96 | #define TS_LOCK_RESUME TIMESTAMP(172) |
97 | #define TS_UNLOCK_END TIMESTAMP(173) | 97 | #define TS_LOCK_END TIMESTAMP(173) |
98 | |||
99 | #define TS_UNLOCK_START TIMESTAMP(180) | ||
100 | #define TS_UNLOCK_END TIMESTAMP(181) | ||
98 | 101 | ||
99 | #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) | 102 | #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) |
100 | #define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) | 103 | #define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) |
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index c5c9600c33d8..bd3b36223428 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <litmus/sched_plugin.h> | 18 | #include <litmus/sched_plugin.h> |
19 | #include <litmus/edf_common.h> | 19 | #include <litmus/edf_common.h> |
20 | #include <litmus/sched_trace.h> | 20 | #include <litmus/sched_trace.h> |
21 | #include <litmus/trace.h> | ||
21 | 22 | ||
22 | #include <litmus/preempt.h> | 23 | #include <litmus/preempt.h> |
23 | 24 | ||
@@ -762,6 +763,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
762 | set_priority_inheritance(sem->owner, sem->hp_waiter); | 763 | set_priority_inheritance(sem->owner, sem->hp_waiter); |
763 | } | 764 | } |
764 | 765 | ||
766 | TS_LOCK_SUSPEND; | ||
767 | |||
765 | /* release lock before sleeping */ | 768 | /* release lock before sleeping */ |
766 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 769 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
767 | 770 | ||
@@ -772,6 +775,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
772 | 775 | ||
773 | schedule(); | 776 | schedule(); |
774 | 777 | ||
778 | TS_LOCK_RESUME; | ||
779 | |||
775 | /* Since we hold the lock, no other task will change | 780 | /* Since we hold the lock, no other task will change |
776 | * ->owner. We can thus check it without acquiring the spin | 781 | * ->owner. We can thus check it without acquiring the spin |
777 | * lock. */ | 782 | * lock. */ |
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index abb06fa53e3a..250c55a1e13d 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <litmus/sched_plugin.h> | 20 | #include <litmus/sched_plugin.h> |
21 | #include <litmus/edf_common.h> | 21 | #include <litmus/edf_common.h> |
22 | #include <litmus/sched_trace.h> | 22 | #include <litmus/sched_trace.h> |
23 | #include <litmus/trace.h> | ||
23 | 24 | ||
24 | typedef struct { | 25 | typedef struct { |
25 | rt_domain_t domain; | 26 | rt_domain_t domain; |
@@ -428,6 +429,8 @@ int psnedf_fmlp_lock(struct litmus_lock* l) | |||
428 | 429 | ||
429 | __add_wait_queue_tail_exclusive(&sem->wait, &wait); | 430 | __add_wait_queue_tail_exclusive(&sem->wait, &wait); |
430 | 431 | ||
432 | TS_LOCK_SUSPEND; | ||
433 | |||
431 | /* release lock before sleeping */ | 434 | /* release lock before sleeping */ |
432 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 435 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
433 | 436 | ||
@@ -438,6 +441,8 @@ int psnedf_fmlp_lock(struct litmus_lock* l) | |||
438 | 441 | ||
439 | schedule(); | 442 | schedule(); |
440 | 443 | ||
444 | TS_LOCK_RESUME; | ||
445 | |||
441 | /* Since we hold the lock, no other task will change | 446 | /* Since we hold the lock, no other task will change |
442 | * ->owner. We can thus check it without acquiring the spin | 447 | * ->owner. We can thus check it without acquiring the spin |
443 | * lock. */ | 448 | * lock. */ |