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-11-24 14:15:06 -0500 |
commit | 4490f9ecf94e28458069a02e8cfcf4f385390499 (patch) | |
tree | 04e8166b5f0fdf53614db0977b8d56f727007390 | |
parent | b739b4033c0f55f9194be2793db9e6ace06047db (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 7aad7f0ad8f2..6ed504f4750e 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 | ||
@@ -799,6 +800,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
799 | set_priority_inheritance(sem->owner, sem->hp_waiter); | 800 | set_priority_inheritance(sem->owner, sem->hp_waiter); |
800 | } | 801 | } |
801 | 802 | ||
803 | TS_LOCK_SUSPEND; | ||
804 | |||
802 | /* release lock before sleeping */ | 805 | /* release lock before sleeping */ |
803 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 806 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
804 | 807 | ||
@@ -809,6 +812,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
809 | 812 | ||
810 | schedule(); | 813 | schedule(); |
811 | 814 | ||
815 | TS_LOCK_RESUME; | ||
816 | |||
812 | /* Since we hold the lock, no other task will change | 817 | /* Since we hold the lock, no other task will change |
813 | * ->owner. We can thus check it without acquiring the spin | 818 | * ->owner. We can thus check it without acquiring the spin |
814 | * lock. */ | 819 | * lock. */ |
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index eb444ecf1288..8e4a22dd8d6a 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; |
@@ -422,6 +423,8 @@ int psnedf_fmlp_lock(struct litmus_lock* l) | |||
422 | 423 | ||
423 | __add_wait_queue_tail_exclusive(&sem->wait, &wait); | 424 | __add_wait_queue_tail_exclusive(&sem->wait, &wait); |
424 | 425 | ||
426 | TS_LOCK_SUSPEND; | ||
427 | |||
425 | /* release lock before sleeping */ | 428 | /* release lock before sleeping */ |
426 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 429 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
427 | 430 | ||
@@ -432,6 +435,8 @@ int psnedf_fmlp_lock(struct litmus_lock* l) | |||
432 | 435 | ||
433 | schedule(); | 436 | schedule(); |
434 | 437 | ||
438 | TS_LOCK_RESUME; | ||
439 | |||
435 | /* Since we hold the lock, no other task will change | 440 | /* Since we hold the lock, no other task will change |
436 | * ->owner. We can thus check it without acquiring the spin | 441 | * ->owner. We can thus check it without acquiring the spin |
437 | * lock. */ | 442 | * lock. */ |