diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-16 23:28:49 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-16 23:28:49 -0400 |
commit | a09e24974cef3b7ac3df4609564fd6f06a8db6f1 (patch) | |
tree | ad65f2235a89d93056e3a9290a943a6a4b89cc16 | |
parent | 5848abe61548e8f5f4a98faf5364207fcb514545 (diff) |
Added lock tracing, probably.
-rw-r--r-- | litmus/sched_psn_edf.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index 249a96e1b73..6f4d4adcec0 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -428,7 +428,7 @@ struct dgl_semaphore { | |||
428 | * it is impossible to have $>m$ boosted jobs. | 428 | * it is impossible to have $>m$ boosted jobs. |
429 | */ | 429 | */ |
430 | bool boosted[NR_CPUS]; | 430 | bool boosted[NR_CPUS]; |
431 | 431 | ||
432 | /* FIFO queue of waiting tasks */ | 432 | /* FIFO queue of waiting tasks */ |
433 | wait_queue_head_t wait; | 433 | wait_queue_head_t wait; |
434 | }; | 434 | }; |
@@ -640,13 +640,20 @@ bool is_mask_valid(struct litmus_lock* l, resource_mask_t mask) | |||
640 | 640 | ||
641 | } | 641 | } |
642 | 642 | ||
643 | #define DGL_CONTAINER 1 | ||
644 | #define for_each_bit(field, idx) \ | ||
645 | for (idx = find_first_bit(&field, sizeof(field)*8); \ | ||
646 | idx < sizeof(field)*8; \ | ||
647 | idx = find_next_bit(&field, sizeof(field)*8, idx)) | ||
648 | |||
643 | int psnedf_dgl_dynamic_group_lock(struct litmus_lock* l, resource_mask_t resources) | 649 | int psnedf_dgl_dynamic_group_lock(struct litmus_lock* l, resource_mask_t resources) |
644 | { | 650 | { |
645 | struct task_struct* t = current; | 651 | struct task_struct* t = current; |
646 | struct dgl_semaphore *sem = dgl_from_lock(l); | 652 | struct dgl_semaphore *sem = dgl_from_lock(l); |
647 | wait_queue_t wait; | 653 | wait_queue_t wait; |
654 | int resource; | ||
648 | unsigned long flags; | 655 | unsigned long flags; |
649 | 656 | ||
650 | TRACE_CUR("Trying to lock a DGL\n"); | 657 | TRACE_CUR("Trying to lock a DGL\n"); |
651 | 658 | ||
652 | if (!is_realtime(t)) | 659 | if (!is_realtime(t)) |
@@ -695,6 +702,10 @@ int psnedf_dgl_dynamic_group_lock(struct litmus_lock* l, resource_mask_t resourc | |||
695 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 702 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
696 | } | 703 | } |
697 | 704 | ||
705 | for_each_bit(resources, resource) | ||
706 | sched_trace_server_switch_to(resource, 0, t->pid, get_job_no(t), | ||
707 | get_partition(t)); | ||
708 | |||
698 | return 0; | 709 | return 0; |
699 | } | 710 | } |
700 | 711 | ||
@@ -713,7 +724,7 @@ int psnedf_dgl_dynamic_group_unlock(struct litmus_lock* l, resource_mask_t resou | |||
713 | struct task_struct *t = current, *tsk; | 724 | struct task_struct *t = current, *tsk; |
714 | struct dgl_semaphore *sem = dgl_from_lock(l); | 725 | struct dgl_semaphore *sem = dgl_from_lock(l); |
715 | unsigned long flags; | 726 | unsigned long flags; |
716 | int err = 0; | 727 | int err = 0, resource; |
717 | resource_mask_t logically_locked; | 728 | resource_mask_t logically_locked; |
718 | struct list_head *pos, *tmp; | 729 | struct list_head *pos, *tmp; |
719 | 730 | ||
@@ -784,6 +795,10 @@ int psnedf_dgl_dynamic_group_unlock(struct litmus_lock* l, resource_mask_t resou | |||
784 | logically_locked = logically_locked | tsk->resources; | 795 | logically_locked = logically_locked | tsk->resources; |
785 | } | 796 | } |
786 | 797 | ||
798 | for_each_bit(resources, resource) | ||
799 | sched_trace_server_switch_away(resource, 0, t->pid, get_job_no(t), | ||
800 | get_partition(t)); | ||
801 | |||
787 | out: | 802 | out: |
788 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 803 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
789 | return err; | 804 | return err; |
@@ -840,6 +855,12 @@ static struct litmus_lock* psnedf_new_dgl(void) | |||
840 | init_waitqueue_head(&sem->wait); | 855 | init_waitqueue_head(&sem->wait); |
841 | sem->litmus_lock.ops = &psnedf_dgl_lock_ops; | 856 | sem->litmus_lock.ops = &psnedf_dgl_lock_ops; |
842 | sem->litmus_lock.type = DGL_SEM; | 857 | sem->litmus_lock.type = DGL_SEM; |
858 | |||
859 | sched_trace_container_param(DGL_CONTAINER, "dgl"); | ||
860 | for (i = 0; i < sizeof(sem->dgl_resources)*8; ++i) { | ||
861 | sched_trace_server_param(i, DGL_CONTAINER, 0, 0); | ||
862 | } | ||
863 | |||
843 | return &sem->litmus_lock; | 864 | return &sem->litmus_lock; |
844 | } | 865 | } |
845 | 866 | ||