From 4490f9ecf94e28458069a02e8cfcf4f385390499 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Sat, 5 Feb 2011 22:57:57 -0500 Subject: Feather-Trace: trace locking-related suspensions --- include/litmus/trace.h | 9 ++++++--- litmus/sched_gsn_edf.c | 5 +++++ 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) #define TS_EXIT_NP_END TIMESTAMP(151) #define TS_LOCK_START TIMESTAMP(170) -#define TS_LOCK_END TIMESTAMP(171) -#define TS_UNLOCK_START TIMESTAMP(172) -#define TS_UNLOCK_END TIMESTAMP(173) +#define TS_LOCK_SUSPEND TIMESTAMP(171) +#define TS_LOCK_RESUME TIMESTAMP(172) +#define TS_LOCK_END TIMESTAMP(173) + +#define TS_UNLOCK_START TIMESTAMP(180) +#define TS_UNLOCK_END TIMESTAMP(181) #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) #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 @@ #include #include #include +#include #include @@ -799,6 +800,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) set_priority_inheritance(sem->owner, sem->hp_waiter); } + TS_LOCK_SUSPEND; + /* release lock before sleeping */ spin_unlock_irqrestore(&sem->wait.lock, flags); @@ -809,6 +812,8 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) schedule(); + TS_LOCK_RESUME; + /* Since we hold the lock, no other task will change * ->owner. We can thus check it without acquiring the spin * 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 @@ #include #include #include +#include typedef struct { rt_domain_t domain; @@ -422,6 +423,8 @@ int psnedf_fmlp_lock(struct litmus_lock* l) __add_wait_queue_tail_exclusive(&sem->wait, &wait); + TS_LOCK_SUSPEND; + /* release lock before sleeping */ spin_unlock_irqrestore(&sem->wait.lock, flags); @@ -432,6 +435,8 @@ int psnedf_fmlp_lock(struct litmus_lock* l) schedule(); + TS_LOCK_RESUME; + /* Since we hold the lock, no other task will change * ->owner. We can thus check it without acquiring the spin * lock. */ -- cgit v1.2.2