diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-15 07:13:08 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-10-18 16:14:02 -0400 |
commit | 5454446ed47708b26d40337e47affea5e1f298ef (patch) | |
tree | d76e1b681cf2291bf8d9269dd6820bd086ca5db8 /include/litmus | |
parent | 7b84800f5ee2e35671ac08a7d281ac7f0069ce8f (diff) |
Feather-Trace: update locking timestamps
Reassing locking timestamps and prepare support for tracing
system call overheads.
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/trace.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/litmus/trace.h b/include/litmus/trace.h index 7efced0c3078..ee55c2eca482 100644 --- a/include/litmus/trace.h +++ b/include/litmus/trace.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #ifdef CONFIG_SCHED_OVERHEAD_TRACE | 4 | #ifdef CONFIG_SCHED_OVERHEAD_TRACE |
5 | 5 | ||
6 | |||
6 | #include <litmus/feather_trace.h> | 7 | #include <litmus/feather_trace.h> |
7 | #include <litmus/feather_buffer.h> | 8 | #include <litmus/feather_buffer.h> |
8 | 9 | ||
@@ -32,11 +33,14 @@ feather_callback void save_timestamp_def(unsigned long event, unsigned long type | |||
32 | feather_callback void save_timestamp_task(unsigned long event, unsigned long t_ptr); | 33 | feather_callback void save_timestamp_task(unsigned long event, unsigned long t_ptr); |
33 | feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu); | 34 | feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu); |
34 | feather_callback void save_task_latency(unsigned long event, unsigned long when_ptr); | 35 | feather_callback void save_task_latency(unsigned long event, unsigned long when_ptr); |
36 | feather_callback void save_timestamp_time(unsigned long event, unsigned long time_ptr); | ||
35 | 37 | ||
36 | #define TIMESTAMP(id) ft_event0(id, save_timestamp) | 38 | #define TIMESTAMP(id) ft_event0(id, save_timestamp) |
37 | 39 | ||
38 | #define DTIMESTAMP(id, def) ft_event1(id, save_timestamp_def, (unsigned long) def) | 40 | #define DTIMESTAMP(id, def) ft_event1(id, save_timestamp_def, (unsigned long) def) |
39 | 41 | ||
42 | #define TIMESTAMP_CUR(id) DTIMESTAMP(id, is_realtime(current) ? TSK_RT : TSK_BE) | ||
43 | |||
40 | #define TTIMESTAMP(id, task) \ | 44 | #define TTIMESTAMP(id, task) \ |
41 | ft_event1(id, save_timestamp_task, (unsigned long) task) | 45 | ft_event1(id, save_timestamp_task, (unsigned long) task) |
42 | 46 | ||
@@ -46,18 +50,25 @@ feather_callback void save_task_latency(unsigned long event, unsigned long when_ | |||
46 | #define LTIMESTAMP(id, task) \ | 50 | #define LTIMESTAMP(id, task) \ |
47 | ft_event1(id, save_task_latency, (unsigned long) task) | 51 | ft_event1(id, save_task_latency, (unsigned long) task) |
48 | 52 | ||
53 | #define TIMESTAMP_TIME(id, time_ptr) \ | ||
54 | ft_event1(id, save_timestamp_time, (unsigned long) time_ptr) | ||
55 | |||
49 | #else /* !CONFIG_SCHED_OVERHEAD_TRACE */ | 56 | #else /* !CONFIG_SCHED_OVERHEAD_TRACE */ |
50 | 57 | ||
51 | #define TIMESTAMP(id) /* no tracing */ | 58 | #define TIMESTAMP(id) /* no tracing */ |
52 | 59 | ||
53 | #define DTIMESTAMP(id, def) /* no tracing */ | 60 | #define DTIMESTAMP(id, def) /* no tracing */ |
54 | 61 | ||
62 | #define TIMESTAMP_CUR(id) /* no tracing */ | ||
63 | |||
55 | #define TTIMESTAMP(id, task) /* no tracing */ | 64 | #define TTIMESTAMP(id, task) /* no tracing */ |
56 | 65 | ||
57 | #define CTIMESTAMP(id, cpu) /* no tracing */ | 66 | #define CTIMESTAMP(id, cpu) /* no tracing */ |
58 | 67 | ||
59 | #define LTIMESTAMP(id, when_ptr) /* no tracing */ | 68 | #define LTIMESTAMP(id, when_ptr) /* no tracing */ |
60 | 69 | ||
70 | #define TIMESTAMP_TIME(id, time_ptr) /* no tracing */ | ||
71 | |||
61 | #endif | 72 | #endif |
62 | 73 | ||
63 | 74 | ||
@@ -69,7 +80,20 @@ feather_callback void save_task_latency(unsigned long event, unsigned long when_ | |||
69 | * always the next number after the start time event id. | 80 | * always the next number after the start time event id. |
70 | */ | 81 | */ |
71 | 82 | ||
83 | #define __TS_SYSCALL_IN_START(p) TIMESTAMP_TIME(10, p) | ||
84 | #define TS_SYSCALL_IN_END TIMESTAMP_CUR(11) | ||
72 | 85 | ||
86 | #define TS_SYSCALL_OUT_START TIMESTAMP_CUR(20) | ||
87 | #define TS_SYSCALL_OUT_END TIMESTAMP_CUR(21) | ||
88 | |||
89 | #define TS_LOCK_START TIMESTAMP_CUR(30) | ||
90 | #define TS_LOCK_END TIMESTAMP_CUR(31) | ||
91 | |||
92 | #define TS_LOCK_SUSPEND TIMESTAMP_CUR(38) | ||
93 | #define TS_LOCK_RESUME TIMESTAMP_CUR(39) | ||
94 | |||
95 | #define TS_UNLOCK_START TIMESTAMP_CUR(40) | ||
96 | #define TS_UNLOCK_END TIMESTAMP_CUR(41) | ||
73 | 97 | ||
74 | #define TS_SCHED_START DTIMESTAMP(100, TSK_UNKNOWN) /* we only | 98 | #define TS_SCHED_START DTIMESTAMP(100, TSK_UNKNOWN) /* we only |
75 | * care | 99 | * care |
@@ -101,14 +125,6 @@ feather_callback void save_task_latency(unsigned long event, unsigned long when_ | |||
101 | #define TS_EXIT_NP_START TIMESTAMP(150) | 125 | #define TS_EXIT_NP_START TIMESTAMP(150) |
102 | #define TS_EXIT_NP_END TIMESTAMP(151) | 126 | #define TS_EXIT_NP_END TIMESTAMP(151) |
103 | 127 | ||
104 | #define TS_LOCK_START TIMESTAMP(170) | ||
105 | #define TS_LOCK_SUSPEND TIMESTAMP(171) | ||
106 | #define TS_LOCK_RESUME TIMESTAMP(172) | ||
107 | #define TS_LOCK_END TIMESTAMP(173) | ||
108 | |||
109 | #define TS_UNLOCK_START TIMESTAMP(180) | ||
110 | #define TS_UNLOCK_END TIMESTAMP(181) | ||
111 | |||
112 | #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) | 128 | #define TS_SEND_RESCHED_START(c) CTIMESTAMP(190, c) |
113 | #define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) | 129 | #define TS_SEND_RESCHED_END DTIMESTAMP(191, TSK_UNKNOWN) |
114 | 130 | ||