diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2009-12-18 09:08:44 -0500 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2009-12-18 09:08:44 -0500 |
commit | 2f41251f9febad2e54fa338ea63a62818970af0c (patch) | |
tree | 470e7ae6305bc554b1564579586b898fd8da5159 /include | |
parent | 0c70a26073633b3879eac57d38f1260c1bebeafc (diff) |
Test kernel tracing events capabilitiestracing-devel
Can events be applied to LITMUS code instead of sched_task_trace ?
PROS:
- architectural indipendency
- easy porting on newer kernel version
- lock free ring buffer implementation already there
CONS:
- need userspace tools conversion to slightly different format
- is it possible to replicate all the previous functionalities?
- only sched_trace_* functions can be implemented through events,
TRACE() debugging features are still implemented in the old way
(??? cannot we simply use the tracing features of the kernel for
debugging purposes ????)
Diffstat (limited to 'include')
-rw-r--r-- | include/trace/events/litmus.h | 147 | ||||
-rw-r--r-- | include/trace/events/sched.h | 3 |
2 files changed, 150 insertions, 0 deletions
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h new file mode 100644 index 000000000000..e5216a8502c2 --- /dev/null +++ b/include/trace/events/litmus.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * LITMUS^RT scheduling events | ||
3 | * included from sched. | ||
4 | */ | ||
5 | #include <litmus/litmus.h> | ||
6 | #include <litmus/rt_param.h> | ||
7 | |||
8 | /* | ||
9 | * Tracing task admission | ||
10 | */ | ||
11 | TRACE_EVENT(litmus_task_param, | ||
12 | |||
13 | TP_PROTO(struct task_struct *t), | ||
14 | |||
15 | TP_ARGS(t), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field( pid_t, pid ) | ||
19 | __field( unsigned int, job ) | ||
20 | __field( lt_t, wcet ) | ||
21 | __field( lt_t, period ) | ||
22 | __field( lt_t, phase ) | ||
23 | __field( int, partition ) | ||
24 | ), | ||
25 | |||
26 | TP_fast_assign( | ||
27 | __entry->pid = t ? t->pid : 0; | ||
28 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
29 | __entry->wcet = get_exec_cost(t); | ||
30 | __entry->period = get_rt_period(t); | ||
31 | __entry->phase = get_rt_phase(t); | ||
32 | __entry->partition = get_partition(t); | ||
33 | ), | ||
34 | |||
35 | TP_printk("period(%d, %Lu).\nwcet(%d, %Lu).\n", | ||
36 | __entry->pid, __entry->period, | ||
37 | __entry->pid, __entry->wcet) | ||
38 | ); | ||
39 | |||
40 | /* | ||
41 | * Tracing jobs release | ||
42 | */ | ||
43 | TRACE_EVENT(litmus_task_release, | ||
44 | |||
45 | TP_PROTO(struct task_struct *t), | ||
46 | |||
47 | TP_ARGS(t), | ||
48 | |||
49 | TP_STRUCT__entry( | ||
50 | __field( pid_t, pid ) | ||
51 | __field( unsigned int, job ) | ||
52 | __field( lt_t, release ) | ||
53 | __field( lt_t, deadline ) | ||
54 | ), | ||
55 | |||
56 | TP_fast_assign( | ||
57 | __entry->pid = t ? t->pid : 0; | ||
58 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
59 | __entry->release = get_release(t); | ||
60 | __entry->deadline = get_deadline(t); | ||
61 | ), | ||
62 | |||
63 | TP_printk("released(job(%u, %u), %Lu).\ndeadline(job(%u, %u), %Lu).\n", | ||
64 | __entry->pid, __entry->job, __entry->release, | ||
65 | __entry->pid, __entry->job, __entry->deadline) | ||
66 | ); | ||
67 | |||
68 | /* | ||
69 | * Tracing jobs completion | ||
70 | */ | ||
71 | TRACE_EVENT(litmus_task_completion, | ||
72 | |||
73 | TP_PROTO(struct task_struct *t, unsigned long forced), | ||
74 | |||
75 | TP_ARGS(t, forced), | ||
76 | |||
77 | TP_STRUCT__entry( | ||
78 | __field( pid_t, pid ) | ||
79 | __field( unsigned int, job ) | ||
80 | __field( lt_t, when ) | ||
81 | __field( unsigned long, forced ) | ||
82 | ), | ||
83 | |||
84 | TP_fast_assign( | ||
85 | __entry->pid = t ? t->pid : 0; | ||
86 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
87 | __entry->when = litmus_clock(); | ||
88 | __entry->forced = forced; | ||
89 | ), | ||
90 | |||
91 | TP_printk("completed(job(%u, %u), %Lu).\n", | ||
92 | __entry->pid, __entry->job, __entry->when) | ||
93 | ); | ||
94 | |||
95 | /* | ||
96 | * Tracing jobs resume | ||
97 | */ | ||
98 | TRACE_EVENT(litmus_task_resume, | ||
99 | |||
100 | TP_PROTO(struct task_struct *t), | ||
101 | |||
102 | TP_ARGS(t), | ||
103 | |||
104 | TP_STRUCT__entry( | ||
105 | __field( pid_t, pid ) | ||
106 | __field( unsigned int, job ) | ||
107 | __field( lt_t, when ) | ||
108 | ), | ||
109 | |||
110 | TP_fast_assign( | ||
111 | __entry->pid = t ? t->pid : 0; | ||
112 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
113 | __entry->when = litmus_clock(); | ||
114 | ), | ||
115 | |||
116 | TP_printk("resumed(job(%u, %u), %Lu).\n", | ||
117 | __entry->pid, __entry->job, __entry->when) | ||
118 | ); | ||
119 | |||
120 | /* | ||
121 | * Tracepoint for switching away previous task | ||
122 | */ | ||
123 | TRACE_EVENT(litmus_switch_away, | ||
124 | |||
125 | TP_PROTO(struct task_struct *t), | ||
126 | |||
127 | TP_ARGS(t), | ||
128 | |||
129 | TP_STRUCT__entry( | ||
130 | __field( pid_t, pid ) | ||
131 | __field( unsigned int, job ) | ||
132 | __field( lt_t, when ) | ||
133 | __field( lt_t, exec_time ) | ||
134 | ), | ||
135 | |||
136 | TP_fast_assign( | ||
137 | __entry->pid = t ? t->pid : 0; | ||
138 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
139 | __entry->when = litmus_clock(); | ||
140 | __entry->exec_time = get_exec_time(t); | ||
141 | ), | ||
142 | |||
143 | TP_printk("scheduled(job(%u, %u), %Lu, %Lu).\n", | ||
144 | __entry->pid, __entry->job, | ||
145 | __entry->when, __entry->exec_time) | ||
146 | ); | ||
147 | |||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 4069c43f4187..0e1d542ca961 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -472,6 +472,9 @@ TRACE_EVENT(sched_stat_iowait, | |||
472 | (unsigned long long)__entry->delay) | 472 | (unsigned long long)__entry->delay) |
473 | ); | 473 | ); |
474 | 474 | ||
475 | /* include LITMUS^RT scheduling events */ | ||
476 | #include "./litmus.h" | ||
477 | |||
475 | #endif /* _TRACE_SCHED_H */ | 478 | #endif /* _TRACE_SCHED_H */ |
476 | 479 | ||
477 | /* This part must be outside protection */ | 480 | /* This part must be outside protection */ |