diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-10-10 19:25:21 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-10-10 19:25:21 -0400 |
commit | 980c85219653614ebc0f6bb072e97dc09e0ef90f (patch) | |
tree | 8f2a3dcad2466a0d90ce725158f8916e2ef0909d /include/litmus | |
parent | 77870ba296b06385088f02516b7346fa7a7756b4 (diff) | |
parent | cdf72c79a135a993f0ad464b8fbc61f8e71948eb (diff) |
Merge branch 'wip-mc' of ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmus2010 into wip-mc
Conflicts:
include/litmus/trace.h
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/litmus.h | 14 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 3 | ||||
-rw-r--r-- | include/litmus/trace.h | 39 |
3 files changed, 50 insertions, 6 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 2112eecd1dc8..4322d59c0e8f 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -129,6 +129,16 @@ void srp_ceiling_block(void); | |||
129 | 129 | ||
130 | #define bheap2task(hn) ((struct task_struct*) hn->value) | 130 | #define bheap2task(hn) ((struct task_struct*) hn->value) |
131 | 131 | ||
132 | static inline struct control_page* get_control_page(struct task_struct *t) | ||
133 | { | ||
134 | return tsk_rt(t)->ctrl_page; | ||
135 | } | ||
136 | |||
137 | static inline int has_control_page(struct task_struct* t) | ||
138 | { | ||
139 | return tsk_rt(t)->ctrl_page != NULL; | ||
140 | } | ||
141 | |||
132 | #ifdef CONFIG_NP_SECTION | 142 | #ifdef CONFIG_NP_SECTION |
133 | 143 | ||
134 | static inline int is_kernel_np(struct task_struct *t) | 144 | static inline int is_kernel_np(struct task_struct *t) |
@@ -244,4 +254,8 @@ static inline quanta_t time2quanta(lt_t time, enum round round) | |||
244 | /* By how much is cpu staggered behind CPU 0? */ | 254 | /* By how much is cpu staggered behind CPU 0? */ |
245 | u64 cpu_stagger_offset(int cpu); | 255 | u64 cpu_stagger_offset(int cpu); |
246 | 256 | ||
257 | #define TS_SYSCALL_IN_START \ | ||
258 | if (has_control_page(current)) \ | ||
259 | __TS_SYSCALL_IN_START(&get_control_page(current)->ts_syscall_start); | ||
260 | |||
247 | #endif | 261 | #endif |
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index e6288e8807f0..221edad83d77 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -63,6 +63,9 @@ struct control_page { | |||
63 | * its non-preemptive section? */ | 63 | * its non-preemptive section? */ |
64 | int delayed_preemption; | 64 | int delayed_preemption; |
65 | 65 | ||
66 | /* locking overhead tracing: time stamp prior to system call */ | ||
67 | uint64_t ts_syscall_start; /* Feather-Trace cycles */ | ||
68 | |||
66 | /* to be extended */ | 69 | /* to be extended */ |
67 | }; | 70 | }; |
68 | 71 | ||
diff --git a/include/litmus/trace.h b/include/litmus/trace.h index 95e1ee647a8a..d6829c416912 100644 --- a/include/litmus/trace.h +++ b/include/litmus/trace.h | |||
@@ -28,7 +28,8 @@ feather_callback void save_timestamp(unsigned long event); | |||
28 | feather_callback void save_timestamp_def(unsigned long event, unsigned long type); | 28 | feather_callback void save_timestamp_def(unsigned long event, unsigned long type); |
29 | feather_callback void save_timestamp_task(unsigned long event, unsigned long t_ptr); | 29 | feather_callback void save_timestamp_task(unsigned long event, unsigned long t_ptr); |
30 | feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu); | 30 | feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu); |
31 | 31 | feather_callback void save_task_latency(unsigned long event, unsigned long when_ptr); | |
32 | feather_callback void save_timestamp_time(unsigned long event, unsigned long time_ptr); | ||
32 | 33 | ||
33 | #define TIMESTAMP(id) ft_event0(id, save_timestamp) | 34 | #define TIMESTAMP(id) ft_event0(id, save_timestamp) |
34 | 35 | ||
@@ -40,6 +41,14 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu) | |||
40 | #define CTIMESTAMP(id, cpu) \ | 41 | #define CTIMESTAMP(id, cpu) \ |
41 | ft_event1(id, save_timestamp_cpu, (unsigned long) cpu) | 42 | ft_event1(id, save_timestamp_cpu, (unsigned long) cpu) |
42 | 43 | ||
44 | #define LTIMESTAMP(id, task) \ | ||
45 | ft_event1(id, save_task_latency, (unsigned long) task) | ||
46 | |||
47 | #define TIMESTAMP_TIME(id, time_ptr) \ | ||
48 | ft_event1(id, save_timestamp_time, (unsigned long) time_ptr) | ||
49 | |||
50 | #define TIMESTAMP_PID(id) ft_event0(id, save_timestamp_pid) | ||
51 | |||
43 | #else /* !CONFIG_SCHED_OVERHEAD_TRACE */ | 52 | #else /* !CONFIG_SCHED_OVERHEAD_TRACE */ |
44 | 53 | ||
45 | #define TIMESTAMP(id) /* no tracing */ | 54 | #define TIMESTAMP(id) /* no tracing */ |
@@ -50,6 +59,12 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu) | |||
50 | 59 | ||
51 | #define CTIMESTAMP(id, cpu) /* no tracing */ | 60 | #define CTIMESTAMP(id, cpu) /* no tracing */ |
52 | 61 | ||
62 | #define LTIMESTAMP(id, when_ptr) /* no tracing */ | ||
63 | |||
64 | #define TIMESTAMP_TIME(id, time_ptr) /* no tracing */ | ||
65 | |||
66 | #define TIMESTAMP_PID(id) /* no tracing */ | ||
67 | |||
53 | #endif | 68 | #endif |
54 | 69 | ||
55 | 70 | ||
@@ -61,6 +76,21 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu) | |||
61 | * always the next number after the start time event id. | 76 | * always the next number after the start time event id. |
62 | */ | 77 | */ |
63 | 78 | ||
79 | #define __TS_SYSCALL_IN_START(p) TIMESTAMP_TIME(10, p) | ||
80 | #define TS_SYSCALL_IN_END TIMESTAMP_PID(11) | ||
81 | |||
82 | #define TS_SYSCALL_OUT_START TIMESTAMP_PID(20) | ||
83 | #define TS_SYSCALL_OUT_END TIMESTAMP_PID(21) | ||
84 | |||
85 | #define TS_LOCK_START TIMESTAMP_PID(30) | ||
86 | #define TS_LOCK_END TIMESTAMP_PID(31) | ||
87 | |||
88 | #define TS_LOCK_SUSPEND TIMESTAMP_PID(38) | ||
89 | #define TS_LOCK_RESUME TIMESTAMP_PID(39) | ||
90 | |||
91 | #define TS_UNLOCK_START TIMESTAMP_PID(40) | ||
92 | #define TS_UNLOCK_END TIMESTAMP_PID(41) | ||
93 | |||
64 | #define TS_SCHED_START DTIMESTAMP(100, TSK_UNKNOWN) /* we only | 94 | #define TS_SCHED_START DTIMESTAMP(100, TSK_UNKNOWN) /* we only |
65 | * care | 95 | * care |
66 | * about | 96 | * about |
@@ -91,12 +121,9 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu) | |||
91 | #define TS_EXIT_NP_START TIMESTAMP(150) | 121 | #define TS_EXIT_NP_START TIMESTAMP(150) |
92 | #define TS_EXIT_NP_END TIMESTAMP(151) | 122 | #define TS_EXIT_NP_END TIMESTAMP(151) |
93 | 123 | ||
94 | #define TS_LOCK_START TIMESTAMP(170) | ||
95 | #define TS_LOCK_END TIMESTAMP(171) | ||
96 | #define TS_UNLOCK_START TIMESTAMP(172) | ||
97 | #define TS_UNLOCK_END TIMESTAMP(173) | ||
98 | |||
99 | #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) | 124 | #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) |
100 | #define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) | 125 | #define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) |
101 | 126 | ||
127 | #define TS_RELEASE_LATENCY(when) LTIMESTAMP(208, &(when)) | ||
128 | |||
102 | #endif /* !_SYS_TRACE_H_ */ | 129 | #endif /* !_SYS_TRACE_H_ */ |